diff options
| author | SND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2010-11-05 06:11:21 +0000 |
|---|---|---|
| committer | SND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2010-11-05 06:11:21 +0000 |
| commit | b6a7c5e5bc9f438059e5a71fe7f850410b668210 (patch) | |
| tree | c23cedd8aec77f0e14f38d70641a61423d8f7ade /libpcsxcore/ix86 | |
| parent | fe689494e432a145784ce2330fc0faf683dbf5e0 (diff) | |
| download | pcsxr-b6a7c5e5bc9f438059e5a71fe7f850410b668210.tar.gz | |
ported change in r59193 to dynarec (x86-32).
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@59209 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'libpcsxcore/ix86')
| -rw-r--r-- | libpcsxcore/ix86/iR3000A.c | 48 |
1 files changed, 46 insertions, 2 deletions
diff --git a/libpcsxcore/ix86/iR3000A.c b/libpcsxcore/ix86/iR3000A.c index 19ab6c84..42b7a09b 100644 --- a/libpcsxcore/ix86/iR3000A.c +++ b/libpcsxcore/ix86/iR3000A.c @@ -1083,7 +1083,16 @@ static void recDIV() { // iFlushRegs(); if (IsConst(_Rt_)) { - if (iRegs[_Rt_].k == 0) return; + if (iRegs[_Rt_].k == 0) { + MOV32ItoM((u32)&psxRegs.GPR.n.lo, 0xffffffff); + if (IsConst(_Rs_)) { + MOV32ItoM((u32)&psxRegs.GPR.n.hi, iRegs[_Rs_].k); + } else { + MOV32MtoR(EAX, (u32)&psxRegs.GPR.r[_Rs_]); + MOV32RtoM((u32)&psxRegs.GPR.n.hi, EAX); + } + return; + } MOV32ItoR(ECX, iRegs[_Rt_].k);// printf("divrtk %x\n", iRegs[_Rt_].k); } else { MOV32MtoR(ECX, (u32)&psxRegs.GPR.r[_Rt_]); @@ -1099,8 +1108,21 @@ static void recDIV() { IDIV32R (ECX); MOV32RtoM((u32)&psxRegs.GPR.n.lo, EAX); MOV32RtoM((u32)&psxRegs.GPR.n.hi, EDX); + if (!IsConst(_Rt_)) { + j8Ptr[1] = JMP8(1); + x86SetJ8(j8Ptr[0]); + + MOV32ItoM((u32)&psxRegs.GPR.n.lo, 0xffffffff); + if (IsConst(_Rs_)) { + MOV32ItoM((u32)&psxRegs.GPR.n.hi, iRegs[_Rs_].k); + } else { + MOV32MtoR(EAX, (u32)&psxRegs.GPR.r[_Rs_]); + MOV32RtoM((u32)&psxRegs.GPR.n.hi, EAX); + } + + x86SetJ8(j8Ptr[1]); } } @@ -1110,7 +1132,16 @@ static void recDIVU() { // iFlushRegs(); if (IsConst(_Rt_)) { - if (iRegs[_Rt_].k == 0) return; + if (iRegs[_Rt_].k == 0) { + MOV32ItoM((u32)&psxRegs.GPR.n.lo, 0xffffffff); + if (IsConst(_Rs_)) { + MOV32ItoM((u32)&psxRegs.GPR.n.hi, iRegs[_Rs_].k); + } else { + MOV32MtoR(EAX, (u32)&psxRegs.GPR.r[_Rs_]); + MOV32RtoM((u32)&psxRegs.GPR.n.hi, EAX); + } + return; + } MOV32ItoR(ECX, iRegs[_Rt_].k);// printf("divurtk %x\n", iRegs[_Rt_].k); } else { MOV32MtoR(ECX, (u32)&psxRegs.GPR.r[_Rt_]); @@ -1126,8 +1157,21 @@ static void recDIVU() { DIV32R (ECX); MOV32RtoM((u32)&psxRegs.GPR.n.lo, EAX); MOV32RtoM((u32)&psxRegs.GPR.n.hi, EDX); + if (!IsConst(_Rt_)) { + j8Ptr[1] = JMP8(1); + x86SetJ8(j8Ptr[0]); + + MOV32ItoM((u32)&psxRegs.GPR.n.lo, 0xffffffff); + if (IsConst(_Rs_)) { + MOV32ItoM((u32)&psxRegs.GPR.n.hi, iRegs[_Rs_].k); + } else { + MOV32MtoR(EAX, (u32)&psxRegs.GPR.r[_Rs_]); + MOV32RtoM((u32)&psxRegs.GPR.n.hi, EAX); + } + + x86SetJ8(j8Ptr[1]); } } //#endif |
