libretro / pcsx_rearmed

ARM optimized PCSX fork
GNU General Public License v2.0
168 stars 120 forks source link

[Lightrec] Goemon Shin Sedai Shumei fails to get ingame when Lightrec is enabled #838

Closed Ploggy closed 4 months ago

Ploggy commented 4 months ago

PCSX-ReARMed Version

r241 459f02ad

Your device

PC

Operating System of your device

Other (consoles, etc.)

CPU architecture

x86-64 (64bit Intel, AMD, etc.)

Issue description

Goemon Shin Sedai Shumei will crash Retroarch when you try to load New Game, the game will play fine in interpreter.

Step-by-step reproduction and logs

Load Goemon Shin Sedai Shumei Get to the Main Menu Select New Game (Retroarch will crash and exit)

notaz commented 4 months ago

@pcercuei confirmed, exits with

ERROR: Unable to recompile block at PC 0x009d6830
pcercuei commented 4 months ago

Sent a PR.

Actual fix is https://github.com/pcercuei/lightrec/commit/601afca8e889bdda7040ff5c64f7bbd20d1d5f2c

FYI, the code would do:

0x80030ba8 (0x0)    lw      ra,4(sp)
0x80030bac (0x4)    jr      ra
0x80030bb0 (0x8)    addiu   sp,sp,0x0008

Lightrec was swapping the first two opcodes in an attempt to support the load delay. Now I just don't swap them, which in theory is still invalid, as Lightrec will always give the new value to JR. But the game doesn't seem to mind.