mirror of https://github.com/snes9xgit/snes9x.git
Add Settings.IsPatched to know if ROM was patched.
This commit is contained in:
parent
c6facbdf4a
commit
ac4d458f7b
584
gtk/po/es.po
584
gtk/po/es.po
File diff suppressed because it is too large
Load Diff
582
gtk/po/fr_FR.po
582
gtk/po/fr_FR.po
File diff suppressed because it is too large
Load Diff
577
gtk/po/ja.po
577
gtk/po/ja.po
File diff suppressed because it is too large
Load Diff
582
gtk/po/pt_BR.po
582
gtk/po/pt_BR.po
File diff suppressed because it is too large
Load Diff
572
gtk/po/ru.po
572
gtk/po/ru.po
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1342,7 +1342,7 @@ Snes9xWindow::show_rom_info ()
|
||||||
"<i>Video:</i> %s\n"
|
"<i>Video:</i> %s\n"
|
||||||
"<i>CRC32:</i> %08X\n"
|
"<i>CRC32:</i> %08X\n"
|
||||||
"<i>Revision:</i> %s"
|
"<i>Revision:</i> %s"
|
||||||
"<b><i>%s</i></b>"),
|
"<b><i>%s%s</i></b>"),
|
||||||
Memory.ROMFilename,
|
Memory.ROMFilename,
|
||||||
Memory.ROMName,
|
Memory.ROMName,
|
||||||
Memory.ROMSpeed,
|
Memory.ROMSpeed,
|
||||||
|
@ -1363,10 +1363,15 @@ Snes9xWindow::show_rom_info ()
|
||||||
"NTSC 60Hz" : "PAL 50Hz",
|
"NTSC 60Hz" : "PAL 50Hz",
|
||||||
Memory.ROMCRC32,
|
Memory.ROMCRC32,
|
||||||
Memory.Revision (),
|
Memory.Revision (),
|
||||||
|
(Settings.IsPatched) ? _("\n\nThis ROM has been patched with ") :
|
||||||
(Memory.ROMChecksum !=
|
(Memory.ROMChecksum !=
|
||||||
Memory.CalculatedChecksum) ?
|
Memory.CalculatedChecksum) ?
|
||||||
_("\n\nThis ROM has been modified or damaged")
|
_("\n\nThis ROM has been modified or damaged")
|
||||||
: "");
|
: "",
|
||||||
|
Settings.IsPatched == 1 ? "IPS" :
|
||||||
|
Settings.IsPatched == 2 ? "BPS" :
|
||||||
|
Settings.IsPatched == 3 ? "UPS" :
|
||||||
|
"");
|
||||||
gtk_window_set_title (GTK_WINDOW (msg), _("File Information"));
|
gtk_window_set_title (GTK_WINDOW (msg), _("File Information"));
|
||||||
|
|
||||||
gtk_dialog_run (GTK_DIALOG (msg));
|
gtk_dialog_run (GTK_DIALOG (msg));
|
||||||
|
|
15
memmap.cpp
15
memmap.cpp
|
@ -1401,7 +1401,6 @@ bool8 CMemory::LoadROM (const char *filename)
|
||||||
if (!totalFileSize)
|
if (!totalFileSize)
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
|
|
||||||
if (!Settings.NoPatch)
|
|
||||||
CheckForAnyPatch(filename, HeaderCount != 0, totalFileSize);
|
CheckForAnyPatch(filename, HeaderCount != 0, totalFileSize);
|
||||||
}
|
}
|
||||||
while(!LoadROMInt(totalFileSize));
|
while(!LoadROMInt(totalFileSize));
|
||||||
|
@ -1678,7 +1677,6 @@ bool8 CMemory::LoadMultiCart (const char *cartA, const char *cartB)
|
||||||
if (Multi.cartSizeB) {
|
if (Multi.cartSizeB) {
|
||||||
strcpy(Multi.fileNameB, cartB);
|
strcpy(Multi.fileNameB, cartB);
|
||||||
|
|
||||||
if(!Settings.NoPatch)
|
|
||||||
CheckForAnyPatch(cartB, HeaderCount != 0, Multi.cartSizeB);
|
CheckForAnyPatch(cartB, HeaderCount != 0, Multi.cartSizeB);
|
||||||
|
|
||||||
Multi.cartOffsetB = 0x400000;
|
Multi.cartOffsetB = 0x400000;
|
||||||
|
@ -1691,7 +1689,6 @@ bool8 CMemory::LoadMultiCart (const char *cartA, const char *cartB)
|
||||||
if (Multi.cartSizeA) {
|
if (Multi.cartSizeA) {
|
||||||
strcpy(Multi.fileNameA, cartA);
|
strcpy(Multi.fileNameA, cartA);
|
||||||
|
|
||||||
if(!Settings.NoPatch)
|
|
||||||
CheckForAnyPatch(cartA, HeaderCount != 0, Multi.cartSizeA);
|
CheckForAnyPatch(cartA, HeaderCount != 0, Multi.cartSizeA);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2572,6 +2569,13 @@ void CMemory::InitROM (void)
|
||||||
SET_UI_COLOR(255, 255, 0);
|
SET_UI_COLOR(255, 255, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Use slight blue tint to indicate ROM was patched.
|
||||||
|
if (Settings.IsPatched)
|
||||||
|
{
|
||||||
|
Settings.DisplayColor = BUILD_PIXEL(26, 26, 31);
|
||||||
|
SET_UI_COLOR(216, 216, 255);
|
||||||
|
}
|
||||||
|
|
||||||
if (Multi.cartType == 4)
|
if (Multi.cartType == 4)
|
||||||
{
|
{
|
||||||
Settings.DisplayColor = BUILD_PIXEL(0, 16, 31);
|
Settings.DisplayColor = BUILD_PIXEL(0, 16, 31);
|
||||||
|
@ -3806,6 +3810,7 @@ static bool8 ReadUPSPatch (Stream *r, long, int32 &rom_size)
|
||||||
|| ((rom_crc32 == px_crc32) && (out_crc32 == py_crc32))
|
|| ((rom_crc32 == px_crc32) && (out_crc32 == py_crc32))
|
||||||
|| ((rom_crc32 == py_crc32) && (out_crc32 == px_crc32))
|
|| ((rom_crc32 == py_crc32) && (out_crc32 == px_crc32))
|
||||||
) {
|
) {
|
||||||
|
Settings.IsPatched = 3;
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
//technically, reaching here means that patching has failed.
|
//technically, reaching here means that patching has failed.
|
||||||
|
@ -3913,6 +3918,7 @@ static bool8 ReadBPSPatch (Stream *r, long, int32 &rom_size)
|
||||||
memcpy(Memory.ROM, patched_rom, target_size);
|
memcpy(Memory.ROM, patched_rom, target_size);
|
||||||
rom_size = target_size;
|
rom_size = target_size;
|
||||||
delete[] patched_rom;
|
delete[] patched_rom;
|
||||||
|
Settings.IsPatched = 2;
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
delete[] patched_rom;
|
delete[] patched_rom;
|
||||||
|
@ -4013,6 +4019,7 @@ static bool8 ReadIPSPatch (Stream *r, long offset, int32 &rom_size)
|
||||||
if (ofs != -1 && ofs - offset < rom_size)
|
if (ofs != -1 && ofs - offset < rom_size)
|
||||||
rom_size = ofs - offset;
|
rom_size = ofs - offset;
|
||||||
|
|
||||||
|
Settings.IsPatched = 1;
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4052,6 +4059,8 @@ static int unzFindExtension (unzFile &file, const char *ext, bool restart, bool
|
||||||
|
|
||||||
void CMemory::CheckForAnyPatch (const char *rom_filename, bool8 header, int32 &rom_size)
|
void CMemory::CheckForAnyPatch (const char *rom_filename, bool8 header, int32 &rom_size)
|
||||||
{
|
{
|
||||||
|
Settings.IsPatched = false;
|
||||||
|
|
||||||
if (Settings.NoPatch)
|
if (Settings.NoPatch)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
1
snes9x.h
1
snes9x.h
|
@ -297,6 +297,7 @@ struct SSettings
|
||||||
bool8 ApplyCheats;
|
bool8 ApplyCheats;
|
||||||
bool8 NoPatch;
|
bool8 NoPatch;
|
||||||
bool8 IgnorePatchChecksum;
|
bool8 IgnorePatchChecksum;
|
||||||
|
bool8 IsPatched;
|
||||||
int32 AutoSaveDelay;
|
int32 AutoSaveDelay;
|
||||||
bool8 DontSaveOopsSnapshot;
|
bool8 DontSaveOopsSnapshot;
|
||||||
bool8 UpAndDown;
|
bool8 UpAndDown;
|
||||||
|
|
Loading…
Reference in New Issue