win32: fix unicode file loading via command line

This commit is contained in:
OV2 2012-09-11 17:13:33 +02:00
parent 47ef0fca45
commit ac60d9117e
2 changed files with 6 additions and 5 deletions

View File

@ -298,7 +298,7 @@ static bool try_save(const char *fname, ConfigFile &conf){
return false;
}
static char rom_filename [MAX_PATH] = {0,};
static char rom_filename [MAX_PATH] = {0};
static bool S9xSaveConfigFile(ConfigFile &conf){
@ -359,7 +359,7 @@ const char* WinParseCommandLineAndLoadConfigFile (char *line)
static char *parameters [MAX_PARAMETERS];
int count = 0;
parameters [count++] = "Snes9X";
//parameters [count++] = "Snes9X";
while (count < MAX_PARAMETERS && *p)
{

View File

@ -322,8 +322,6 @@ HINSTANCE g_hInst;
#include "../debug.h"
#endif
static const char *rom_filename = NULL;
struct SJoypad Joypad[16] = {
{
true, /* Joypad 1 enabled */
@ -3338,6 +3336,7 @@ int WINAPI WinMain(
LPSTR lpCmdLine,
int nCmdShow)
{
char cmdLine[MAX_PATH];
Settings.StopEmulation = TRUE;
SetCurrentDirectory(S9xGetDirectoryT(DEFAULT_DIR));
@ -3356,7 +3355,9 @@ int WINAPI WinMain(
ConfigFile::SetAlphaSort(false);
ConfigFile::SetTimeSort(false);
rom_filename = WinParseCommandLineAndLoadConfigFile (lpCmdLine);
strcpy(cmdLine,_tToChar(GetCommandLine()));
const char *rom_filename = WinParseCommandLineAndLoadConfigFile (cmdLine);
WinSaveConfigFile ();
WinLockConfigFile ();