Permalink
Browse files

test snes9x

  • Loading branch information...
1 parent 6c9f556 commit 650228c7bd7603529aeb21ba25c75a3a8f41a852 Scott Davies committed Apr 10, 2015
@@ -7,8 +7,6 @@
#include "memmap.h"
#include "controls.h"
-extern bool8 S9xLoadROMImage (const TCHAR *string);
-
// Return whether a game has been loaded. Should return FALSE if
// no ROM is loaded, or a ROM has been unloaded.
bool GameIsActive()
@@ -45,10 +43,14 @@ void ResetEmulation()
S9xReset();
}
-void LoadROMFromEmu( char* sFullPath )
+extern bool8 S9xLoadROMImage( const TCHAR* string );
+void LoadROMFromEmu( const char* sFullPath )
{
+#ifdef UNICODE
+ S9xLoadROMImage( Widen( sFullPath ).c_str() );
+#else
S9xLoadROMImage( sFullPath );
- //Pre_Load_Rom( HWnd, sFullPath );
+#endif
}
// Installs these shared functions into the DLL
@@ -28,12 +28,14 @@
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120_xp</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
+ <CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120_xp</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
@@ -149,7 +151,7 @@ if %ERRORLEVEL% LEQ 3 exit 0</Command>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>../../DXSDK_March09_x86;../../NVIDIA_Cg_x86;$(ProjectDir);$(ProjectDir)..\;$(ProjectDir)..\..\;$(ProjectDir)..\zlib-1.2.8;$(ProjectDir)..\unzip;$(ProjectDir)..\..\FMOD\api\inc;$(ProjectDir)..\libpng;$(ProjectDir)..\apu\bapu;$(ProjectDir)..\..\common;$(ProjectDir)..\..\RA_Integration;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>../../DXSDK_March09_x86;../../NVIDIA_Cg_x86;$(ProjectDir);$(ProjectDir)..\;$(ProjectDir)..\..\;$(ProjectDir)..\apu\bapu;$(ProjectDir)..\libpng;$(ProjectDir)..\unzip;$(ProjectDir)..\zlib-1.2.8;$(ProjectDir)..\..\common;$(ProjectDir)..\..\FMOD\api\inc;$(ProjectDir)..\..\RA_Integration;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;HAVE_LIBPNG;JMA_SUPPORT;ZLIB_WINAPI;UNZIP_SUPPORT;__WIN32__;NETPLAY_SUPPORT;D3D_DEBUG_INFO;RA_SNES9X;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<StructMemberAlignment>Default</StructMemberAlignment>
@@ -2427,7 +2427,7 @@ LRESULT CALLBACK WinProc(
if( LOWORD(wParam) >= IDM_RA_MENUSTART &&
LOWORD(wParam) < IDM_RA_MENUEND )
{
- LoadLibrary("RichEd20.dll");
+ LoadLibrary( _T( "RichEd20.dll" ) );
RA_InvokeDialog( LOWORD(wParam) );
// hack! undo autosave
@@ -3721,13 +3721,13 @@ void FreezeUnfreeze (int slot, bool8 freeze)
{
if( RA_HardcoreModeIsActive() )
{
- if( MessageBox( NULL, "Hardcore mode is active. If you load/save a state, Hardcore Mode will be disabled. Continue?", "Warning", MB_YESNO ) == IDNO )
+ if( MessageBox( nullptr,
+ _T( "Hardcore mode is active. If you load/save a state, Hardcore Mode will be disabled. Continue?" ),
+ _T( "Warning" ),
+ MB_YESNO ) == IDNO )
return;
}
- const char *filename;
- char ext [_MAX_EXT + 1];
-
#ifdef NETPLAY_SUPPORT
if (!freeze && Settings.NetPlay && !Settings.NetPlayServer)
{
@@ -3736,9 +3736,10 @@ void FreezeUnfreeze (int slot, bool8 freeze)
return;
}
#endif
-
+
+ char ext [_MAX_EXT + 1];
snprintf(ext, _MAX_EXT, ".%03d", slot);
- filename = S9xGetFilename(ext,SNAPSHOT_DIR);
+ const char *filename = S9xGetFilename(ext,SNAPSHOT_DIR);
S9xSetPause (PAUSE_FREEZE_FILE);
@@ -121,7 +121,7 @@ void AchievementPopup::Render( HDC hDC, RECT& rcDest )
const int nHeight = rcDest.bottom - rcDest.top;
- float fFadeInY = GetYOffsetPct() * ( POPUP_DIST_Y_FROM_PCT * (float)nHeight );
+ float fFadeInY = GetYOffsetPct() * ( POPUP_DIST_Y_FROM_PCT * static_cast<float>( nHeight ) );
fFadeInY += ( POPUP_DIST_Y_TO_PCT * static_cast<float>( nHeight ) );
const int nTitleY = static_cast<int>( fFadeInY );
@@ -2,17 +2,15 @@
#include <Windows.h>
#include <WindowsX.h>
+#include <ShlObj.h>
+#include <tchar.h>
+#include <assert.h>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <deque>
#include <map>
-//#include <CommCtrl.h>
-//#include <direct.h>
-#include <ShlObj.h>
-#include <tchar.h>
-#include <assert.h>
#ifndef RA_EXPORTS
@@ -55,7 +55,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>c:\sdk\DX90CSDK\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>..\DXSDK_March09_x86\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_LIVEURL;_DEBUG;RA_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
@@ -65,7 +65,7 @@
</ClCompile>
<Link>
<AdditionalDependencies>windowscodecs.lib;winmm.lib;Winhttp.lib;ddraw.lib;dxguid.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <AdditionalLibraryDirectories>$(DXSDK_DIR)/lib/x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>..\DXSDK_March09_x86\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
<SubSystem>Windows</SubSystem>
@@ -76,7 +76,7 @@
<Optimization>Full</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<WholeProgramOptimization>false</WholeProgramOptimization>
- <AdditionalIncludeDirectories>c:\sdk\DX90CSDK\include;../directx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>..\DXSDK_March09_x86\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;RA_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
@@ -86,7 +86,7 @@
</ClCompile>
<Link>
<AdditionalDependencies>windowscodecs.lib;winmm.lib;Winhttp.lib;ddraw.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <AdditionalLibraryDirectories>$(DXSDK_DIR)/lib/x86;../directx;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>..\DXSDK_March09_x86\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<LinkTimeCodeGeneration />
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -341,7 +341,7 @@ void WriteBufferToFile( const char* sFile, const char* sBuffer, int nBytes )
}
else
{
- MessageBox( nullptr, "Problems writing file!", sFile, MB_OK );
+ MessageBox( nullptr, _T( "Problems writing file!" ), Widen( sFile ).c_str(), MB_OK );
}
}
@@ -391,9 +391,9 @@ const char* CCONV _RA_InstallIntegration()
#endif
if( g_hRADLL == NULL )
{
- TCHAR buffer[ 1024 ];
- sprintf_s( buffer, 1024, _T( "LoadLibrary failed: %d : %s\n" ), ::GetLastError(), GetLastErrorAsString().c_str() );
- MessageBox( nullptr, buffer, _T( "Sorry!" ), MB_OK );
+ char buffer[ 1024 ];
+ sprintf_s( buffer, 1024, "LoadLibrary failed: %d : %s\n", ::GetLastError(), GetLastErrorAsString().c_str() );
+ MessageBox( nullptr, Widen( buffer ).c_str(), _T( "Sorry!" ), MB_OK );
return "0.000";
}

0 comments on commit 650228c

Please sign in to comment.