diff options
| author | SND\notaz_cp <SND\notaz_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-01-19 00:51:24 +0000 |
|---|---|---|
| committer | SND\notaz_cp <SND\notaz_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-01-19 00:51:24 +0000 |
| commit | 8093a1645070c5b5413fc5dee0d9917aee178c9d (patch) | |
| tree | bddaba3b8209d5d912a152e41497c86bcbabed64 /libpcsxcore/ix86 | |
| parent | dfedf538eab08dc2ba7142ea07c51858b4ff6067 (diff) | |
| download | pcsxr-8093a1645070c5b5413fc5dee0d9917aee178c9d.tar.gz | |
dynarec: store cycles before psxBranchTest to better match interpreter
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@82380 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'libpcsxcore/ix86')
| -rwxr-xr-x | libpcsxcore/ix86/iR3000A.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/libpcsxcore/ix86/iR3000A.c b/libpcsxcore/ix86/iR3000A.c index 942429b2..9039e069 100755 --- a/libpcsxcore/ix86/iR3000A.c +++ b/libpcsxcore/ix86/iR3000A.c @@ -99,10 +99,13 @@ static void iFlushRegs() { } } -static void iRet() { - /* store cycle */ +static void iStoreCycle() { count = ((pc - pcold) / 4) * BIAS; ADD32ItoM((u32)&psxRegs.cycle, count); +} + +static void iRet() { + iStoreCycle(); if (resp) ADD32ItoR(ESP, resp); RET(); } @@ -181,11 +184,13 @@ static void SetBranch() { } iFlushRegs(); + iStoreCycle(); MOV32MtoR(EAX, (u32)&target); MOV32RtoM((u32)&psxRegs.pc, EAX); CALLFunc((u32)psxBranchTest); - iRet(); + StackRes(); + RET(); } static void iJump(u32 branchPC) { @@ -213,11 +218,10 @@ static void iJump(u32 branchPC) { recBSC[psxRegs.code>>26](); iFlushRegs(); + iStoreCycle(); MOV32ItoM((u32)&psxRegs.pc, branchPC); CALLFunc((u32)psxBranchTest); - /* store cycle */ - count = ((pc - pcold) / 4) * BIAS; - ADD32ItoM((u32)&psxRegs.cycle, count); + if (resp) ADD32ItoR(ESP, resp); // maybe just happened an interruption, check so @@ -270,11 +274,10 @@ static void iBranch(u32 branchPC, int savectx) { recBSC[psxRegs.code>>26](); iFlushRegs(); + iStoreCycle(); MOV32ItoM((u32)&psxRegs.pc, branchPC); CALLFunc((u32)psxBranchTest); - /* store cycle */ - count = ((pc - pcold) / 4) * BIAS; - ADD32ItoM((u32)&psxRegs.cycle, count); + if (resp) ADD32ItoR(ESP, resp); // maybe just happened an interruption, check so |
