aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorretro-wertz2019-08-03 12:02:35 +0800
committerretro-wertz2019-08-03 12:02:35 +0800
commit1893f4083d715eb37bf8051cd539597d2abd922b (patch)
tree56e5c54024b23392122f76832326ef2042cdf365
parent3e42b1155e892eae2dcd0ee62d0645ef43b889a5 (diff)
downloadpcsx_rearmed-1893f4083d715eb37bf8051cd539597d2abd922b.tar.gz
pcsx_rearmed-1893f4083d715eb37bf8051cd539597d2abd922b.tar.bz2
pcsx_rearmed-1893f4083d715eb37bf8051cd539597d2abd922b.zip
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.
-rw-r--r--libpcsxcore/misc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libpcsxcore/misc.c b/libpcsxcore/misc.c
index 0b151a5..82e6b8b 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");