From 1c16c0cb6398e6ba5d906525111fe8f9675fbf7e Mon Sep 17 00:00:00 2001 From: OV2 Date: Sun, 12 Mar 2023 17:31:25 +0100 Subject: [PATCH] Fix ips sequences in patch dir --- memmap.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/memmap.cpp b/memmap.cpp index 093d0daf..2e135e65 100644 --- a/memmap.cpp +++ b/memmap.cpp @@ -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; } \ No newline at end of file