diff options
Diffstat (limited to 'libpcsxcore')
| -rw-r--r-- | libpcsxcore/cdrom.h | 2 | ||||
| -rw-r--r-- | libpcsxcore/ix86/iR3000A.c | 48 | ||||
| -rw-r--r-- | libpcsxcore/r3000a.c | 2 |
3 files changed, 49 insertions, 3 deletions
diff --git a/libpcsxcore/cdrom.h b/libpcsxcore/cdrom.h index 82afa42c..3ab4336d 100644 --- a/libpcsxcore/cdrom.h +++ b/libpcsxcore/cdrom.h @@ -98,6 +98,8 @@ typedef struct { extern cdrStruct cdr; +void cdrDecodedBufferInterrupt(); + void cdrReset(); void cdrInterrupt(); void cdrReadInterrupt(); 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 diff --git a/libpcsxcore/r3000a.c b/libpcsxcore/r3000a.c index 0fa51fd5..6f766e8b 100644 --- a/libpcsxcore/r3000a.c +++ b/libpcsxcore/r3000a.c @@ -24,8 +24,8 @@ #include "r3000a.h" #include "cdrom.h" #include "mdec.h" +#include "gpu.h" #include "gte.h" - extern u32 *Read_ICache( u32 pc, u32 isolate );
|
