From: retro-wertz Date: Sat, 3 Aug 2019 04:02:35 +0000 (+0800) Subject: Fix region detection for Wild Arms X-Git-Tag: r24l~706^2~3 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1893f4083d715eb37bf8051cd539597d2abd922b;p=pcsx_rearmed.git 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. --- 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");