Fixes for PlayStation RetroAchievements hashing (#4085)

* Fixed RA hash for PlayStation games when BOOT line contains tabs where spaces are expected.

* Fixed RA hash and prevented infinite loop when PlayStation executable is in subdirectory.
This commit is contained in:
prenoeg 2024-10-14 19:53:29 -07:00 committed by GitHub
parent 62abee4813
commit e77a036e0e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 12 additions and 0 deletions

View File

@ -97,6 +97,15 @@ namespace BizHawk.Client.EmuHawk
return (buf2048[index + 4] << 16) | (buf2048[index + 3] << 8) | buf2048[index + 2];
}
}
// move on to next sector if filename not found in current sector due to subdirectory
if (buf2048[index] == 0)
{
dsr.ReadLBA_2048(++sector, buf2048, 0);
index = 0;
continue;
}
index += buf2048[index];
}
@ -114,6 +123,9 @@ namespace BizHawk.Client.EmuHawk
dsr.ReadLBA_2048(sector, buf2048, 0);
exePath = Encoding.ASCII.GetString(buf2048);
// replace any tab characters with space characters to normalize exePath
exePath = exePath.Replace('\t', ' ');
// "BOOT = cdrom:" precedes the path
var index = exePath.IndexOf("BOOT = cdrom:", StringComparison.Ordinal);
if (index < -1) break;