Commit f69eeaf
committed
IOP: Reset recompiler and map RAM mirrors on IOP soft reset
When SifIopReset triggers (SBUS_F240 bit 19), psxReset() reloads the
IOP BIOS kernel into RAM but does not flush the IOP recompiler cache.
The recompiler keeps stale compiled blocks for IOP RAM addresses that
now contain different code. When the fresh kernel executes, the
recompiler serves old translations, causing the IOP to crash on
garbage instructions (psxUNK).
Add psxCpu->Reset() after psxReset() in the SBUS_F240 handler to
flush all cached recompiler blocks. This forces fresh recompilation
from the new RAM contents, allowing IOP soft resets to complete
correctly. This fixes SifIopReset as used by ps2link and other
PS2 homebrew that perform runtime IOP resets.
Additionally, map IOP RAM mirrors throughout kuseg (pages 0x0000-
0x1DFF) in the recompiler lookup table. The PS2 IOP mirrors its
2MB RAM across the entire kuseg address space (0x00000000-
0x1DFFFFFF). The BIOS uses these mirrored addresses during IOP
soft resets (e.g. jumping to 0x0d000100 which mirrors to physical
0x00000100). Without the mirrored pages in recLUT, code execution
at mirrored addresses would hit unmapped pages.1 parent 06616ec commit f69eeaf
2 files changed
+16
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
| 181 | + | |
181 | 182 | | |
182 | 183 | | |
183 | 184 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
955 | 955 | | |
956 | 956 | | |
957 | 957 | | |
958 | | - | |
959 | | - | |
960 | | - | |
961 | | - | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
962 | 962 | | |
963 | | - | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
964 | 969 | | |
965 | | - | |
966 | | - | |
967 | | - | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
968 | 975 | | |
969 | 976 | | |
970 | 977 | | |
| |||
0 commit comments