diff --git a/pcsx2/Interpreter.c b/pcsx2/Interpreter.c index 6bbcec0fc4..91b9cae25b 100644 --- a/pcsx2/Interpreter.c +++ b/pcsx2/Interpreter.c @@ -90,7 +90,7 @@ static u32 branchPC; #define debugI() #endif -void execI() { +static __forceinline void execI() { cpuRegs.cycle++; //cpuRegs.CP0.n.Count++; /*count every cycles.*/ @@ -101,16 +101,12 @@ void execI() { #else cpuRegs.code = *(u32 *)PSM(cpuRegs.pc); #endif - - + cpuRegs.pc+= 4; -// if((cpuRegs.PERF.n.pccr & 0x80000020) == 0x80000020) cpuRegs.PERF.n.pcr0++; -// if((cpuRegs.PERF.n.pccr & 0x80008000) == 0x80008000) cpuRegs.PERF.n.pcr1++; - Int_OpcodePrintTable[cpuRegs.code >> 26](); } -__inline void doBranch(u32 tar) { +static void doBranch(u32 tar) { branch2 = cpuRegs.branch = 1; branchPC = tar; execI(); diff --git a/pcsx2/PsxInterpreter.c b/pcsx2/PsxInterpreter.c index 2ecae56394..4ae4d639c8 100644 --- a/pcsx2/PsxInterpreter.c +++ b/pcsx2/PsxInterpreter.c @@ -27,41 +27,7 @@ static int branch = 0; static int branch2 = 0; static u32 branchPC; -// These macros are used to assemble the repassembler functions - -#ifdef _DEBUG -#define execI() { \ - psxRegs.code = PSXMu32(psxRegs.pc); \ - \ - if (Log) { \ - PSXCPU_LOG("%s\n", disR3000AF(psxRegs.code, psxRegs.pc)); \ - } \ - psxRegs.pc+= 4; \ - psxRegs.cycle++; \ - \ - psxBSC[psxRegs.code >> 26](); \ -} -#else -#define execI() { \ - psxRegs.code = PSXMu32(psxRegs.pc); \ - \ - psxRegs.pc+= 4; \ - psxRegs.cycle++; \ - \ - psxBSC[psxRegs.code >> 26](); \ -} -#endif - - -#define doBranch(tar) { \ - branch2 = branch = 1; \ - branchPC = tar; \ - execI(); \ - branch = 0; \ - psxRegs.pc = branchPC; \ - \ - psxBranchTest(); \ -} +static void doBranch(tar); // forward declared prototype // Subsets extern void (*psxBSC[64])(); @@ -755,6 +721,31 @@ void (*psxCP2BSC[32])() = { /////////////////////////////////////////// +// These macros are used to assemble the repassembler functions + +static __forceinline void execI() { + psxRegs.code = PSXMu32(psxRegs.pc); + + PSXCPU_LOG("%s\n", disR3000AF(psxRegs.code, psxRegs.pc)); + + psxRegs.pc+= 4; + psxRegs.cycle++; + psxCycleEE-=8; + + psxBSC[psxRegs.code >> 26](); +} + + +static void doBranch(tar) { + branch2 = branch = 1; + branchPC = tar; + execI(); + branch = 0; + psxRegs.pc = branchPC; + + psxBranchTest(); +} + static int intInit() { return 0; } @@ -775,7 +766,7 @@ static void intExecuteBlock() { psxBreak = 0; psxCycleEE = EEsCycle; - while (psxCycleEE >= 0){ + while (psxCycleEE > 0){ branch2 = 0; while (!branch2) { execI();