TASEmulators / BizHawk

BizHawk is a multi-system emulator written in C#. BizHawk provides nice features for casual gamers such as full screen, and joypad support in addition to full rerecording and debugging tools for all system cores.
http://tasvideos.org/BizHawk.html
Other
2.21k stars 385 forks source link

Simplified identification of PlayStation EXE for RA hash. #4092

Closed prenoeg closed 1 month ago

prenoeg commented 1 month ago

I found another instance of the BOOT line in SYSTEM.CNF containing unexpected characters. This is similar to the issue with Chrono Cross mentioned in #4085, but this time it's an extra space character with the game Grandia:

"BOOT  = cdrom:" vs
"BOOT\t= cdrom:" vs
"BOOT = cdrom:"

Normalizing the string again is an option, but I think something different would be better. According to the following documentation:

https://psx-spx.consoledev.net/cdromfileformats/#cdrom-file-playstation-exe-and-systemcnf

the PlayStation executable path will have the following format:

"drive:\path\name.ext;version"

I think we can just pull the executable path from this part of the string by using ':' and ';' as indexes without trying to match "BOOT =" since that part of the string could contain unexpected whitespace characters. If this is an oversimplification that won't work (in the long run) please let me know, but these changes have been working fine with Grandia, Chrono Cross and the other games I've been testing like Tekken 3 and Wild Arms.

CasualPokePlayer commented 1 month ago

Akagawa Jirou - Majo-tachi no Nemuri - Fukkatsusai (Japan) appears to not work under this change, although it doesn't seem to work before regardless. It appears to have this as the BOOT line: BOOT=cdrom:\SLPS_018.63

A double odd case here which would break under the old code: no spaces, and the path does not end with ;, just a newline. The lack of a ; would break even this newer code.

(Could perhaps be more games like this, this is just the first one I found that had this).

YoshiRulz commented 1 month ago

.SubstringBefore('\n').SubstringAfter('=').Trim().SubstringBefore(';')?

prenoeg commented 1 month ago

I have updated my changes to support the missing semicolon. In these cases we can use the carriage return character '\r' to terminate the path. It appears that every line in SYSTEM.CNF ends with CRLF so hopefully that is consistent.

I'm not sure how common it is for the semicolon to be missing like this, but not even any of the other Akagawa Jirou games exhibit this behavior. It's pretty impressive you managed to find this game so fast.

If there is a much more elegant solution available please feel free to go with that instead of this.

CasualPokePlayer commented 1 month ago

Pushed my own fixes here: 09d72bf34fd7cb5f64e24c6bf1f11a30276300a2