PCSX2 / pcsx2

PCSX2 - The Playstation 2 Emulator
https://pcsx2.net
GNU General Public License v3.0
11.45k stars 1.59k forks source link

[BUG]: Achievements: Unable to hash Major League Baseball 2K6 #8889

Closed Coloradohusky closed 1 year ago

Coloradohusky commented 1 year ago

Describe the Bug

Attempting to load up Major League Baseball 2K6 for use with RetroAchievements gets me this error: (Achievements) Caught exception while trying to read ELF 'cdrom0:\SLUS_212.35;2'. When I reproduce with Visual Studio, it fails at GetIndexOf("SLUS_212.35;2"): image

Reproduction Steps

Obtain a dump of Major League Baseball 2K6, and verify it matches the ReDump hashes. Turn on achievements, the system console (if you wish to see the error there), and run the game. The error will show up, and Achievements -> Game Info will show Game not loaded or no RetroAchievements available. If run with UseRAIntegration = true, then RAIntegration -> View Game Hash will state No game loaded.

Expected Behavior

A hash should properly generate.

PCSX2 Revision

v1.7.4524

Operating System

Windows 10 (64bit)

If Linux - Specify Distro

No response

Mrlinkwii commented 1 year ago

Can I have the .dmp file , pcsx2 created

Coloradohusky commented 1 year ago

It didn't create one - PCSX2 didn't crash

F0bes commented 1 year ago

So the game uses ;2 as it's ELF version suffix. Our CDVD code overrides this with ;1 but the acheivements code does not. When the achievements code goes to hash the file, it looks for the un-hacked original ELF file (which is not available in the ISO filesystem because it was patched)

Related hack code is here (13 years old!): https://github.com/F0bes/pcsx2/blob/5a4f5cdc5e983ccf90bb65f17b19e48e63c63c35/pcsx2/CDVD/CDVD.cpp#L413

I managed to make it work here: https://github.com/F0bes/pcsx2/tree/achievements-suffix-hack

There is probably a better way to do it though.