X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=libpcsxcore%2Fpsxinterpreter.c;h=ff4949133ff5aaa91ea53165d67681a80966ee98;hp=8eb4749de46c7882e62d5be0bd4b471c8ec20b13;hb=8ad120c9c4dca424feac32098cb4af6a2c8f641f;hpb=c7a56f4f574167acc7e3751cf04aa9bf9ebba913 diff --git a/libpcsxcore/psxinterpreter.c b/libpcsxcore/psxinterpreter.c index 8eb4749d..ff494913 100644 --- a/libpcsxcore/psxinterpreter.c +++ b/libpcsxcore/psxinterpreter.c @@ -25,6 +25,7 @@ #include "r3000a.h" #include "gte.h" #include "psxhle.h" +#include "debug.h" static int branch = 0; static int branch2 = 0; @@ -38,14 +39,14 @@ static u32 branchPC; #define debugI() #endif -inline void execI(); +void execI(); // Subsets void (*psxBSC[64])(); void (*psxSPC[64])(); void (*psxREG[32])(); void (*psxCP0[32])(); -void (*psxCP2[64])(); +void (*psxCP2[64])(struct psxCP2Regs *regs); void (*psxCP2BSC[32])(); static void delayRead(int reg, u32 bpc) { @@ -407,7 +408,7 @@ static int psxDelayBranchTest(u32 tar1) { return psxDelayBranchExec(tmp2); } -__inline void doBranch(u32 tar) { +static void doBranch(u32 tar) { u32 *code; u32 tmp; @@ -779,15 +780,14 @@ void psxMFC0() { if (!_Rt_) return; _i32(_rRt_) = (int)_rFs_; } void psxCFC0() { if (!_Rt_) return; _i32(_rRt_) = (int)_rFs_; } void psxTestSWInts() { - // the next code is untested, if u know please - // tell me if it works ok or not (linuzappz) if (psxRegs.CP0.n.Cause & psxRegs.CP0.n.Status & 0x0300 && - psxRegs.CP0.n.Status & 0x1) { + psxRegs.CP0.n.Status & 0x1) { + psxRegs.CP0.n.Cause &= ~0x7c; psxException(psxRegs.CP0.n.Cause, branch); } } -__inline void MTC0(int reg, u32 val) { +void MTC0(int reg, u32 val) { // SysPrintf("MTC0 %d: %x\n", reg, val); switch (reg) { case 12: // Status @@ -796,7 +796,8 @@ __inline void MTC0(int reg, u32 val) { break; case 13: // Cause - psxRegs.CP0.n.Cause = val & ~(0xfc00); + psxRegs.CP0.n.Cause &= ~0x0300; + psxRegs.CP0.n.Cause |= val & 0x0300; psxTestSWInts(); break; @@ -832,10 +833,10 @@ void psxCOP0() { } void psxCOP2() { - psxCP2[_Funct_](); + psxCP2[_Funct_]((struct psxCP2Regs *)&psxRegs.CP2D); } -void psxBASIC() { +void psxBASIC(struct psxCP2Regs *regs) { psxCP2BSC[_Rs_](); } @@ -881,7 +882,7 @@ void (*psxCP0[32])() = { psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL, psxNULL }; -void (*psxCP2[64])() = { +void (*psxCP2[64])(struct psxCP2Regs *regs) = { psxBASIC, gteRTPS , psxNULL , psxNULL, psxNULL, psxNULL , gteNCLIP, psxNULL, // 00 psxNULL , psxNULL , psxNULL , psxNULL, gteOP , psxNULL , psxNULL , psxNULL, // 08 gteDPCS , gteINTPL, gteMVMVA, gteNCDS, gteCDP , psxNULL , gteNCDT , psxNULL, // 10 @@ -927,7 +928,7 @@ static void intShutdown() { } // interpreter execution -inline void execI() { +void execI() { u32 *code = (u32 *)PSXM(psxRegs.pc); psxRegs.code = ((code == NULL) ? 0 : SWAP32(*code));