Rename IPS_DIR to PATCH_DIR, split cheats path in win32

This commit is contained in:
OV2 2017-09-04 20:41:04 +02:00
parent 7455501db8
commit cb3ace471e
10 changed files with 26 additions and 17 deletions

View File

@ -204,7 +204,7 @@ enum s9x_getdirtype
SCREENSHOT_DIR, SCREENSHOT_DIR,
SPC_DIR, SPC_DIR,
CHEAT_DIR, CHEAT_DIR,
IPS_DIR, PATCH_DIR,
BIOS_DIR, BIOS_DIR,
LOG_DIR, LOG_DIR,
SAT_DIR, SAT_DIR,

View File

@ -142,7 +142,7 @@ S9xGetDirectory (enum s9x_getdirtype dirtype)
sprintf (path, "%s", gui_config->savestate_directory); sprintf (path, "%s", gui_config->savestate_directory);
break; break;
case IPS_DIR: case PATCH_DIR:
sprintf (path, "%s", gui_config->patch_directory); sprintf (path, "%s", gui_config->patch_directory);
break; break;

View File

@ -4280,7 +4280,7 @@ void CMemory::CheckForAnyPatch (const char *rom_filename, bool8 header, int32 &r
} }
#endif #endif
n = S9xGetFilename(".bps", IPS_DIR); n = S9xGetFilename(".bps", PATCH_DIR);
if ((patch_file = OPEN_FSTREAM(n, "rb")) != NULL) if ((patch_file = OPEN_FSTREAM(n, "rb")) != NULL)
{ {
@ -4344,7 +4344,7 @@ void CMemory::CheckForAnyPatch (const char *rom_filename, bool8 header, int32 &r
} }
#endif #endif
n = S9xGetFilename(".ups", IPS_DIR); n = S9xGetFilename(".ups", PATCH_DIR);
if ((patch_file = OPEN_FSTREAM(n, "rb")) != NULL) if ((patch_file = OPEN_FSTREAM(n, "rb")) != NULL)
{ {
@ -4626,7 +4626,7 @@ void CMemory::CheckForAnyPatch (const char *rom_filename, bool8 header, int32 &r
} }
#endif #endif
n = S9xGetFilename(".ips", IPS_DIR); n = S9xGetFilename(".ips", PATCH_DIR);
if ((patch_file = OPEN_FSTREAM(n, "rb")) != NULL) if ((patch_file = OPEN_FSTREAM(n, "rb")) != NULL)
{ {
@ -4653,7 +4653,7 @@ void CMemory::CheckForAnyPatch (const char *rom_filename, bool8 header, int32 &r
do do
{ {
snprintf(ips, 9, ".%03d.ips", i); snprintf(ips, 9, ".%03d.ips", i);
n = S9xGetFilename(ips, IPS_DIR); n = S9xGetFilename(ips, PATCH_DIR);
if (!(patch_file = OPEN_FSTREAM(n, "rb"))) if (!(patch_file = OPEN_FSTREAM(n, "rb")))
break; break;
@ -4690,7 +4690,7 @@ void CMemory::CheckForAnyPatch (const char *rom_filename, bool8 header, int32 &r
snprintf(ips, _MAX_EXT + 3, ".ips%d", i); snprintf(ips, _MAX_EXT + 3, ".ips%d", i);
if (strlen(ips) > _MAX_EXT + 1) if (strlen(ips) > _MAX_EXT + 1)
break; break;
n = S9xGetFilename(ips, IPS_DIR); n = S9xGetFilename(ips, PATCH_DIR);
if (!(patch_file = OPEN_FSTREAM(n, "rb"))) if (!(patch_file = OPEN_FSTREAM(n, "rb")))
break; break;
@ -4725,7 +4725,7 @@ void CMemory::CheckForAnyPatch (const char *rom_filename, bool8 header, int32 &r
do do
{ {
snprintf(ips, 5, ".ip%d", i); snprintf(ips, 5, ".ip%d", i);
n = S9xGetFilename(ips, IPS_DIR); n = S9xGetFilename(ips, PATCH_DIR);
if (!(patch_file = OPEN_FSTREAM(n, "rb"))) if (!(patch_file = OPEN_FSTREAM(n, "rb")))
break; break;

View File

@ -261,7 +261,7 @@ STREAM S9xMSU1OpenFile(char *msu_ext, bool skip_unpacked)
if (!unzFile) if (!unzFile)
{ {
zip_filename = S9xGetFilename(".msu1", IPS_DIR); zip_filename = S9xGetFilename(".msu1", PATCH_DIR);
unzFile = unzOpen(zip_filename); unzFile = unzOpen(zip_filename);
} }
@ -395,7 +395,7 @@ bool S9xMSU1ROMExists(void)
unzFile unzFile = unzOpen(S9xGetFilename(".msu1", ROMFILENAME_DIR)); unzFile unzFile = unzOpen(S9xGetFilename(".msu1", ROMFILENAME_DIR));
if(!unzFile) if(!unzFile)
unzFile = unzOpen(S9xGetFilename(".msu1", IPS_DIR)); unzFile = unzOpen(S9xGetFilename(".msu1", PATCH_DIR));
if (unzFile) if (unzFile)
{ {

View File

@ -278,7 +278,7 @@ static const char dirNames[13][32] =
"screenshot", // SCREENSHOT_DIR "screenshot", // SCREENSHOT_DIR
"spc", // SPC_DIR "spc", // SPC_DIR
"cheat", // CHEAT_DIR "cheat", // CHEAT_DIR
"patch", // IPS_DIR "patch", // PATCH_DIR
"bios", // BIOS_DIR "bios", // BIOS_DIR
"log", // LOG_DIR "log", // LOG_DIR
"" ""

View File

@ -951,7 +951,8 @@ void WinRegisterConfigItems()
AddStringC("Dir:SPCs", GUI.SPCDir, _MAX_PATH, ".\\SPCs", "directory where SPCs will be saved"); AddStringC("Dir:SPCs", GUI.SPCDir, _MAX_PATH, ".\\SPCs", "directory where SPCs will be saved");
AddStringC("Dir:Savestates", GUI.FreezeFileDir, _MAX_PATH, ".\\Saves", "directory where savestates will be created and loaded from"); AddStringC("Dir:Savestates", GUI.FreezeFileDir, _MAX_PATH, ".\\Saves", "directory where savestates will be created and loaded from");
AddStringC("Dir:SRAM", GUI.SRAMFileDir, _MAX_PATH, ".\\Saves", "directory where battery saves will be created and loaded from"); AddStringC("Dir:SRAM", GUI.SRAMFileDir, _MAX_PATH, ".\\Saves", "directory where battery saves will be created and loaded from");
AddStringC("Dir:Patches", GUI.PatchDir, _MAX_PATH, ".\\Cheats", "directory in which ROM patches (.ips files) and cheats (.cht files) will be looked for"); AddStringC("Dir:Cheats", GUI.CheatDir, _MAX_PATH, ".\\Cheats", "directory in which cheats (.cht files) will be looked for");
AddStringC("Dir:Patches", GUI.PatchDir, _MAX_PATH, ".\\Patches", "directory in which ROM patches (.ips/.bps/.ups files) will be looked for");
AddStringC("Dir:Bios", GUI.BiosDir, _MAX_PATH, ".\\BIOS", "directory where BIOS files (such as \"BS-X.bios\") will be located"); AddStringC("Dir:Bios", GUI.BiosDir, _MAX_PATH, ".\\BIOS", "directory where BIOS files (such as \"BS-X.bios\") will be located");
AddStringC("Dir:SatData", GUI.SatDir, _MAX_PATH, ".\\SatData", "directory where Satellaview Signal Data files will be located"); AddStringC("Dir:SatData", GUI.SatDir, _MAX_PATH, ".\\SatData", "directory where Satellaview Signal Data files will be located");
AddBoolC("Dir:Lock", GUI.LockDirectories, false, "true to prevent Snes9x from changing configured directories when you browse to a new location"); AddBoolC("Dir:Lock", GUI.LockDirectories, false, "true to prevent Snes9x from changing configured directories when you browse to a new location");

View File

@ -344,11 +344,14 @@ const TCHAR *S9xGetDirectoryT (enum s9x_getdirtype dirtype)
rv = GUI.SPCDir; rv = GUI.SPCDir;
break; break;
case IPS_DIR: case PATCH_DIR:
case CHEAT_DIR:
rv = GUI.PatchDir; rv = GUI.PatchDir;
break; break;
case CHEAT_DIR:
rv = GUI.CheatDir;
break;
case SNAPSHOT_DIR: case SNAPSHOT_DIR:
rv = GUI.FreezeFileDir; rv = GUI.FreezeFileDir;
break; break;

View File

@ -578,7 +578,8 @@ Nintendo is a trade mark.")
#define SETTINGS_OPTION_DIRECTORY_SPCS TEXT("SPCs") #define SETTINGS_OPTION_DIRECTORY_SPCS TEXT("SPCs")
#define SETTINGS_OPTION_DIRECTORY_SAVES TEXT("Saves") #define SETTINGS_OPTION_DIRECTORY_SAVES TEXT("Saves")
#define SETTINGS_OPTION_DIRECTORY_SRAM TEXT("SRAM") #define SETTINGS_OPTION_DIRECTORY_SRAM TEXT("SRAM")
#define SETTINGS_OPTION_DIRECTORY_PATCHESANDCHEATS TEXT("Patch&Cheat") #define SETTINGS_OPTION_DIRECTORY_PATCHES TEXT("Patch")
#define SETTINGS_OPTION_DIRECTORY_CHEATS TEXT("Cheat")
#define SETTINGS_OPTION_DIRECTORY_BIOS TEXT("BIOS files") #define SETTINGS_OPTION_DIRECTORY_BIOS TEXT("BIOS files")
#define SETTINGS_OPTION_DIRECTORY_SATDATA TEXT("Satellaview") #define SETTINGS_OPTION_DIRECTORY_SATDATA TEXT("Satellaview")

View File

@ -5134,7 +5134,7 @@ INT_PTR CALLBACK DlgAboutProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
} }
INT_PTR CALLBACK DlgEmulatorProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) INT_PTR CALLBACK DlgEmulatorProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{ {
static TCHAR paths[9][MAX_PATH]; static TCHAR paths[10][MAX_PATH];
static int which = 0; static int which = 0;
switch(msg) switch(msg)
{ {
@ -5182,7 +5182,9 @@ INT_PTR CALLBACK DlgEmulatorProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPar
lstrcpy(paths[inum++],GUI.SRAMFileDir); lstrcpy(paths[inum++],GUI.SRAMFileDir);
SendDlgItemMessage(hDlg,IDC_DIRCOMBO,CB_ADDSTRING,0,(LPARAM)(LPCTSTR)SETTINGS_OPTION_DIRECTORY_SRAM); SendDlgItemMessage(hDlg,IDC_DIRCOMBO,CB_ADDSTRING,0,(LPARAM)(LPCTSTR)SETTINGS_OPTION_DIRECTORY_SRAM);
lstrcpy(paths[inum++],GUI.PatchDir); lstrcpy(paths[inum++],GUI.PatchDir);
SendDlgItemMessage(hDlg,IDC_DIRCOMBO,CB_ADDSTRING,0,(LPARAM)(LPCTSTR)SETTINGS_OPTION_DIRECTORY_PATCHESANDCHEATS); SendDlgItemMessage(hDlg,IDC_DIRCOMBO,CB_ADDSTRING,0,(LPARAM)(LPCTSTR)SETTINGS_OPTION_DIRECTORY_PATCHES);
lstrcpy(paths[inum++], GUI.CheatDir);
SendDlgItemMessage(hDlg, IDC_DIRCOMBO, CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)SETTINGS_OPTION_DIRECTORY_CHEATS);
lstrcpy(paths[inum++],GUI.BiosDir); lstrcpy(paths[inum++],GUI.BiosDir);
SendDlgItemMessage(hDlg,IDC_DIRCOMBO,CB_ADDSTRING,0,(LPARAM)(LPCTSTR)SETTINGS_OPTION_DIRECTORY_BIOS); SendDlgItemMessage(hDlg,IDC_DIRCOMBO,CB_ADDSTRING,0,(LPARAM)(LPCTSTR)SETTINGS_OPTION_DIRECTORY_BIOS);
lstrcpy(paths[inum++],GUI.SatDir); lstrcpy(paths[inum++],GUI.SatDir);
@ -5248,6 +5250,7 @@ INT_PTR CALLBACK DlgEmulatorProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPar
lstrcpy(GUI.FreezeFileDir,paths[inum++]); lstrcpy(GUI.FreezeFileDir,paths[inum++]);
lstrcpy(GUI.SRAMFileDir,paths[inum++]); lstrcpy(GUI.SRAMFileDir,paths[inum++]);
lstrcpy(GUI.PatchDir,paths[inum++]); lstrcpy(GUI.PatchDir,paths[inum++]);
lstrcpy(GUI.CheatDir, paths[inum++]);
lstrcpy(GUI.BiosDir,paths[inum++]); lstrcpy(GUI.BiosDir,paths[inum++]);
lstrcpy(GUI.SatDir,paths[inum++]); lstrcpy(GUI.SatDir,paths[inum++]);

View File

@ -393,6 +393,7 @@ struct sGUI {
TCHAR FreezeFileDir [_MAX_PATH]; TCHAR FreezeFileDir [_MAX_PATH];
TCHAR SRAMFileDir [_MAX_PATH]; TCHAR SRAMFileDir [_MAX_PATH];
TCHAR PatchDir [_MAX_PATH]; TCHAR PatchDir [_MAX_PATH];
TCHAR CheatDir [_MAX_PATH];
TCHAR BiosDir [_MAX_PATH]; TCHAR BiosDir [_MAX_PATH];
TCHAR SatDir [_MAX_PATH]; TCHAR SatDir [_MAX_PATH];
bool LockDirectories; bool LockDirectories;