Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplified identification of PlayStation EXE for RA hash. #4092

Closed
wants to merge 2 commits into from

Conversation

prenoeg
Copy link
Contributor

@prenoeg prenoeg commented Oct 16, 2024

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
Copy link
Member

CasualPokePlayer commented Oct 16, 2024

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
Copy link
Member

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

@prenoeg
Copy link
Contributor Author

prenoeg commented Oct 16, 2024

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
Copy link
Member

Pushed my own fixes here: 09d72bf

@prenoeg prenoeg deleted the ra-grandia branch October 17, 2024 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants