aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornotaz2011-06-06 19:43:26 +0300
committernotaz2011-06-07 12:46:35 +0300
commit665e364a0aba523bb555f369efe4c7be966a6666 (patch)
tree9278a268959b1b064e567bcc1d83649cfeb80871
parenta48ae3a7decaae1f0bbc45fb0ce37e030fd5357b (diff)
downloadpcsx_rearmed-665e364a0aba523bb555f369efe4c7be966a6666.tar.gz
pcsx_rearmed-665e364a0aba523bb555f369efe4c7be966a6666.tar.bz2
pcsx_rearmed-665e364a0aba523bb555f369efe4c7be966a6666.zip
r3000a: don't patch RAM to work around BIOS
BIOS steps over if GTE instructions are interrupted, we must work around that since we don't emulate the pipeline. Previous workaround sucks since it hacks emulated RAM..
-rw-r--r--libpcsxcore/r3000a.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/libpcsxcore/r3000a.c b/libpcsxcore/r3000a.c
index 98aff3a..1e8d0b0 100644
--- a/libpcsxcore/r3000a.c
+++ b/libpcsxcore/r3000a.c
@@ -79,6 +79,15 @@ void psxShutdown() {
}
void psxException(u32 code, u32 bd) {
+ if (!Config.HLE && (((PSXMu32(psxRegs.pc) >> 24) & 0xfe) == 0x4a)) {
+ // "hokuto no ken" / "Crash Bandicot 2" ...
+ // BIOS does not allow to return to GTE instructions
+ // (just skips it, supposedly because it's scheduled already)
+ // so we step over it with the interpreter
+ extern void execI();
+ execI();
+ }
+
// Set the Cause
psxRegs.CP0.n.Cause = code;
@@ -102,11 +111,6 @@ void psxException(u32 code, u32 bd) {
psxRegs.CP0.n.Status = (psxRegs.CP0.n.Status &~0x3f) |
((psxRegs.CP0.n.Status & 0xf) << 2);
- if (!Config.HLE && (((PSXMu32(psxRegs.CP0.n.EPC) >> 24) & 0xfe) == 0x4a)) {
- // "hokuto no ken" / "Crash Bandicot 2" ... fix
- PSXMu32ref(psxRegs.CP0.n.EPC)&= SWAPu32(~0x02000000);
- }
-
if (Config.HLE) psxBiosException();
}