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>CRC32:</i> %08X\n"
|
||||
"<i>Revision:</i> %s"
|
||||
"<b><i>%s</i></b>"),
|
||||
"<b><i>%s%s</i></b>"),
|
||||
Memory.ROMFilename,
|
||||
Memory.ROMName,
|
||||
Memory.ROMSpeed,
|
||||
|
@ -1363,10 +1363,15 @@ Snes9xWindow::show_rom_info ()
|
|||
"NTSC 60Hz" : "PAL 50Hz",
|
||||
Memory.ROMCRC32,
|
||||
Memory.Revision (),
|
||||
(Settings.IsPatched) ? _("\n\nThis ROM has been patched with ") :
|
||||
(Memory.ROMChecksum !=
|
||||
Memory.CalculatedChecksum) ?
|
||||
_("\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_dialog_run (GTK_DIALOG (msg));
|
||||
|
|
21
memmap.cpp
21
memmap.cpp
|
@ -1401,8 +1401,7 @@ bool8 CMemory::LoadROM (const char *filename)
|
|||
if (!totalFileSize)
|
||||
return (FALSE);
|
||||
|
||||
if (!Settings.NoPatch)
|
||||
CheckForAnyPatch(filename, HeaderCount != 0, totalFileSize);
|
||||
CheckForAnyPatch(filename, HeaderCount != 0, totalFileSize);
|
||||
}
|
||||
while(!LoadROMInt(totalFileSize));
|
||||
|
||||
|
@ -1678,8 +1677,7 @@ bool8 CMemory::LoadMultiCart (const char *cartA, const char *cartB)
|
|||
if (Multi.cartSizeB) {
|
||||
strcpy(Multi.fileNameB, cartB);
|
||||
|
||||
if(!Settings.NoPatch)
|
||||
CheckForAnyPatch(cartB, HeaderCount != 0, Multi.cartSizeB);
|
||||
CheckForAnyPatch(cartB, HeaderCount != 0, Multi.cartSizeB);
|
||||
|
||||
Multi.cartOffsetB = 0x400000;
|
||||
memcpy(ROM + Multi.cartOffsetB,ROM,Multi.cartSizeB);
|
||||
|
@ -1691,8 +1689,7 @@ bool8 CMemory::LoadMultiCart (const char *cartA, const char *cartB)
|
|||
if (Multi.cartSizeA) {
|
||||
strcpy(Multi.fileNameA, cartA);
|
||||
|
||||
if(!Settings.NoPatch)
|
||||
CheckForAnyPatch(cartA, HeaderCount != 0, Multi.cartSizeA);
|
||||
CheckForAnyPatch(cartA, HeaderCount != 0, Multi.cartSizeA);
|
||||
}
|
||||
|
||||
return LoadMultiCartInt();
|
||||
|
@ -2572,6 +2569,13 @@ void CMemory::InitROM (void)
|
|||
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)
|
||||
{
|
||||
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 == py_crc32) && (out_crc32 == px_crc32))
|
||||
) {
|
||||
Settings.IsPatched = 3;
|
||||
return true;
|
||||
} else {
|
||||
//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);
|
||||
rom_size = target_size;
|
||||
delete[] patched_rom;
|
||||
Settings.IsPatched = 2;
|
||||
return true;
|
||||
} else {
|
||||
delete[] patched_rom;
|
||||
|
@ -4013,6 +4019,7 @@ static bool8 ReadIPSPatch (Stream *r, long offset, int32 &rom_size)
|
|||
if (ofs != -1 && ofs - offset < rom_size)
|
||||
rom_size = ofs - offset;
|
||||
|
||||
Settings.IsPatched = 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)
|
||||
{
|
||||
Settings.IsPatched = false;
|
||||
|
||||
if (Settings.NoPatch)
|
||||
return;
|
||||
|
||||
|
|
Loading…
Reference in New Issue