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

[ISSUE]: Commit 0156510d00858f784322248cf90f3aaf863240f4 breaks PS2Disk (and probably other functions) #116

Closed
1 task done
karas84 opened this issue Sep 30, 2023 · 1 comment · Fixed by #117
Closed
1 task done
Labels

Comments

@karas84
Copy link
Contributor

karas84 commented Sep 30, 2023

Checks

  • I have checked existing issues for duplicates and found none

Describe the issue

Commit 0156510 which introduced 64-bit size support breaks PS2Disk. The issue manifests as wLaunchELF giving the error PS2Disk => Failed CDVD 0x14. The "problem" seems to lie in the genLseek used by preloadCNF. when preloadCNF tries to guess the media type by looking for a proper SYSTEM.CNF it first tries to open it with genOpen which succeeds, and then it tries to get its file size using genLseek which returns -1 (actually it returns 4294967295 as the value is not cast to an int). The commit updated the genLseek function to use lseek64 which at least in this in this specific instance returns -1. Reverting back (as a test) to lseek, the correct SYSTEM.CNF size is returned and the game boots correctly.
It is reasonable to assume that the change may affect other use cases and break other functions.

Console model

PCSX2 and SCPH90004

@karas84
Copy link
Contributor Author

karas84 commented Oct 2, 2023

I created a PR (#117) that should fix the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant