Add --no-patch to forcefully disable all patching.

This commit is contained in:
Themaister 2012-03-20 23:45:58 +01:00
parent 4e772003c8
commit 5272008f54
4 changed files with 16 additions and 2 deletions

View File

@ -198,6 +198,10 @@ Attempts to apply a IPS patch to the current ROM image. No files are altered.
If this flag is not specified, SSNES will look for a .ips file with same basename as ROM specified. If this flag is not specified, SSNES will look for a .ips file with same basename as ROM specified.
Note that SSNES cannot perform any error checking if patching was successful due to how IPS works. Note that SSNES cannot perform any error checking if patching was successful due to how IPS works.
.TP
\fB--no-patch\fR
Disables all kinds of ROM patching.
.TP .TP
\fB--xml MAP, -X MAP\fR \fB--xml MAP, -X MAP\fR
Specifies path to XML memory map for the given ROM. Specifies path to XML memory map for the given ROM.

7
file.c
View File

@ -289,8 +289,11 @@ static ssize_t read_rom_file(FILE *file, void **buf)
ret_buf = (uint8_t*)rom_buf; ret_buf = (uint8_t*)rom_buf;
} }
// Attempt to apply a patch. if (!g_extern.block_patch)
patch_rom(&ret_buf, &ret); {
// Attempt to apply a patch.
patch_rom(&ret_buf, &ret);
}
// Remove copier header if present (512 first bytes). // Remove copier header if present (512 first bytes).
if ((ret & 0x7fff) == 512) if ((ret & 0x7fff) == 512)

View File

@ -286,6 +286,7 @@ struct global
char savestate_name[PATH_MAX]; char savestate_name[PATH_MAX];
char xml_name[PATH_MAX]; char xml_name[PATH_MAX];
bool block_patch;
bool ups_pref; bool ups_pref;
bool bps_pref; bool bps_pref;
bool ips_pref; bool ips_pref;

View File

@ -537,6 +537,7 @@ static void print_help(void)
puts("\t-U/--ups: Specifies path for UPS patch that will be applied to ROM."); puts("\t-U/--ups: Specifies path for UPS patch that will be applied to ROM.");
puts("\t--bps: Specifies path for BPS patch that will be applied to ROM."); puts("\t--bps: Specifies path for BPS patch that will be applied to ROM.");
puts("\t--ips: Specifies path for IPS patch that will be applied to ROM."); puts("\t--ips: Specifies path for IPS patch that will be applied to ROM.");
puts("\t--no-patch: Disables all forms of rom patching.");
puts("\t-X/--xml: Specifies path to XML memory map."); puts("\t-X/--xml: Specifies path to XML memory map.");
puts("\t-D/--detach: Detach SSNES from the running console. Not relevant for all platforms.\n"); puts("\t-D/--detach: Detach SSNES from the running console. Not relevant for all platforms.\n");
} }
@ -685,6 +686,7 @@ static void parse_input(int argc, char *argv[])
{ "ups", 1, NULL, 'U' }, { "ups", 1, NULL, 'U' },
{ "bps", 1, &val, 'B' }, { "bps", 1, &val, 'B' },
{ "ips", 1, &val, 'I' }, { "ips", 1, &val, 'I' },
{ "no-patch", 0, &val, 'n' },
{ "xml", 1, NULL, 'X' }, { "xml", 1, NULL, 'X' },
{ "detach", 0, NULL, 'D' }, { "detach", 0, NULL, 'D' },
{ "features", 0, &val, 'f' }, { "features", 0, &val, 'f' },
@ -916,6 +918,10 @@ static void parse_input(int argc, char *argv[])
g_extern.ips_pref = true; g_extern.ips_pref = true;
break; break;
case 'n':
g_extern.block_patch = true;
break;
#ifdef HAVE_FFMPEG #ifdef HAVE_FFMPEG
case 's': case 's':
{ {