Fix ips sequences in patch dir

This commit is contained in:
OV2 2023-03-12 17:31:25 +01:00
parent d502fe0738
commit 1c16c0cb63
1 changed files with 6 additions and 6 deletions

View File

@ -3908,9 +3908,9 @@ void CMemory::CheckForAnyPatch(const char *rom_filename, bool8 header, int32 &ro
auto try_ips_sequence = [&](const char *pattern) -> bool {
for (int i = 0; i < 1000; i++)
{
char ips[8];
snprintf(ips, 8, pattern, i);
if (!try_patch("IPS", ips, ReadIPSPatch))
char ips[9];
snprintf(ips, 9, pattern, i);
if (!try_patch("IPS", S9xGetFilename(ips, PATCH_DIR), ReadIPSPatch))
break;
}
return flag;
@ -3922,10 +3922,10 @@ void CMemory::CheckForAnyPatch(const char *rom_filename, bool8 header, int32 &ro
return;
if (try_patch("IPS", S9xGetFilename(".ips", PATCH_DIR), ReadIPSPatch))
return;
if (try_ips_sequence("%03d.ips"))
if (try_ips_sequence(".%03d.ips"))
return;
if (try_ips_sequence("ips%d"))
if (try_ips_sequence(".ips%d"))
return;
if (try_ips_sequence("ip%d"))
if (try_ips_sequence(".ip%d"))
return;
}