diff --git a/docs/ssnes.1 b/docs/ssnes.1 index e99771fd55..2f56477d7e 100644 --- a/docs/ssnes.1 +++ b/docs/ssnes.1 @@ -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. 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 \fB--xml MAP, -X MAP\fR Specifies path to XML memory map for the given ROM. diff --git a/file.c b/file.c index fca1465bb9..dc72f50af2 100644 --- a/file.c +++ b/file.c @@ -289,8 +289,11 @@ static ssize_t read_rom_file(FILE *file, void **buf) ret_buf = (uint8_t*)rom_buf; } - // Attempt to apply a patch. - patch_rom(&ret_buf, &ret); + if (!g_extern.block_patch) + { + // Attempt to apply a patch. + patch_rom(&ret_buf, &ret); + } // Remove copier header if present (512 first bytes). if ((ret & 0x7fff) == 512) diff --git a/general.h b/general.h index 5ab385fe02..c03c2f2174 100644 --- a/general.h +++ b/general.h @@ -286,6 +286,7 @@ struct global char savestate_name[PATH_MAX]; char xml_name[PATH_MAX]; + bool block_patch; bool ups_pref; bool bps_pref; bool ips_pref; diff --git a/ssnes.c b/ssnes.c index 45bc587807..6fdacf8f77 100644 --- a/ssnes.c +++ b/ssnes.c @@ -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--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--no-patch: Disables all forms of rom patching."); 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"); } @@ -685,6 +686,7 @@ static void parse_input(int argc, char *argv[]) { "ups", 1, NULL, 'U' }, { "bps", 1, &val, 'B' }, { "ips", 1, &val, 'I' }, + { "no-patch", 0, &val, 'n' }, { "xml", 1, NULL, 'X' }, { "detach", 0, NULL, 'D' }, { "features", 0, &val, 'f' }, @@ -916,6 +918,10 @@ static void parse_input(int argc, char *argv[]) g_extern.ips_pref = true; break; + case 'n': + g_extern.block_patch = true; + break; + #ifdef HAVE_FFMPEG case 's': {