From 1893f4083d715eb37bf8051cd539597d2abd922b Mon Sep 17 00:00:00 2001 From: retro-wertz Date: Sat, 3 Aug 2019 12:02:35 +0800 Subject: [PATCH] Fix region detection for Wild Arms - Wild Arms EU and US version has non-standard string (probably for region protection) causing auto-region detection to fail and wrong CDROM info in log. - This fix sanitizes the string name to remove unneeded characters ("EXE\" in this case that comes before the serial-number). This would sanitize the CD-ROM info in log as well. --- libpcsxcore/misc.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libpcsxcore/misc.c b/libpcsxcore/misc.c index 0b151a5a..82e6b8b6 100644 --- a/libpcsxcore/misc.c +++ b/libpcsxcore/misc.c @@ -357,6 +357,14 @@ int CheckCdrom() { return -1; } } + /* Workaround for Wild Arms EU/US which has non-standard string causing incorrect region detection */ + if (exename[0] == 'E' && exename[1] == 'X' && exename[2] == 'E' && exename[3] == '\\') { + size_t offset = 4; + size_t i, len = strlen(exename) - offset; + for (i = 0; i < len; i++) + exename[i] = exename[i + offset]; + exename[i] = '\0'; + } } else if (GetCdromFile(mdir, time, "PSX.EXE;1") != -1) { strcpy(exename, "PSX.EXE;1"); strcpy(CdromId, "SLUS99999"); -- 2.39.2