gameblabla / pcsx4all

RS-97/RG350 port of PCSX4ALL. Switched to C, HLE improvements etc...
37 stars 11 forks source link

[LLE/HLE] Tetris with Cardcaptor Sakura #5

Closed gameblabla closed 5 years ago

gameblabla commented 5 years ago

This game has a modchip protection that checks for reads on the PIO addresses. This is what Mednafen said in their changelog about this game "PSX: Return data with all bits set on reads from the PIO memory area when it's not in use(for PSFs or whatnot); fixes game lockup in "Tetris with Cardcaptor Sakura"."

And here's the actual fix for the game https://github.com/libretro-mirrors/mednafen-git/blob/5a8eb89d2a3b43b551481c3b2fc9a0414120e3d9/src/psx/psx.cpp#L736

And the commit in more detail (check src/psx/psx.cpp) https://github.com/libretro-mirrors/mednafen-git/commit/64e7fdd90bbaf646759655652b416270988e6b1a#diff-07dfe6eb665d450cfff500b9e73837b1

I tried to apply the fix in PCSX4Armed, (psxhw.cpp, add a case that covers from 0x1F000000 to 0x1F7FFFFF), however it does jackshit. I noticed that the game was doing writes just above that and trying to return those to 0 will prevent the game from booting up.

It seems like the fix only worked because Mednafen also covered some (unknown) corner cases too. No$PSX also suffers from this issue, even with a dump of the CD-ROM controller, and the documentation says nothing about protection against modchips unfortunately. Looks like no one cares about it but let's hope someone brave enough will step in.

This issue happens in both LLE & HLE. Note that the game will bootup much faster in HLE bios mode before locking up.

EDIT: I've been told that EPSXe also runs this game fine but i suspect they are hotpatching the game instead. There's a cheat to disable the modchip detection but no one to document it and PCSX4ALL does not sadly support cheats.

gameblabla commented 5 years ago

This is now fixed by Senquack ( fix is https://github.com/gameblabla/pcsx4all/commit/b6a29e4a9ed34680a6957b95f5e214c5f76fd04d )