summaryrefslogtreecommitdiff
path: root/libpcsxcore
diff options
context:
space:
mode:
Diffstat (limited to 'libpcsxcore')
-rwxr-xr-xlibpcsxcore/ix86/iR3000A.c21
-rwxr-xr-xlibpcsxcore/ix86_64/iR3000A-64.c20
2 files changed, 23 insertions, 18 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
diff --git a/libpcsxcore/ix86_64/iR3000A-64.c b/libpcsxcore/ix86_64/iR3000A-64.c
index 0dccf8bf..0d07ed55 100755
--- a/libpcsxcore/ix86_64/iR3000A-64.c
+++ b/libpcsxcore/ix86_64/iR3000A-64.c
@@ -110,10 +110,13 @@ static void iFlushRegs() {
}
}
-static void iRet() {
- /* store cycle */
+static void iStoreCycle() {
count = ((pc - pcold) / 4) * BIAS;
ADD32ItoM((uptr)&psxRegs.cycle, count);
+}
+
+static void iRet() {
+ iStoreCycle();
StackRes();
RET();
}
@@ -179,11 +182,13 @@ static void SetBranch() {
recBSC[psxRegs.code>>26]();
iFlushRegs();
+ iStoreCycle();
MOV32MtoR(EAX, (uptr)&target);
MOV32RtoM((uptr)&psxRegs.pc, EAX);
CALLFunc((uptr)psxBranchTest);
- iRet();
+ StackRes();
+ RET();
}
static void iJump(u32 branchPC) {
@@ -212,11 +217,10 @@ static void iJump(u32 branchPC) {
recBSC[psxRegs.code>>26]();
iFlushRegs();
+ iStoreCycle();
MOV32ItoM((uptr)&psxRegs.pc, branchPC);
CALLFunc((uptr)psxBranchTest);
- /* store cycle */
- count = ((pc - pcold) / 4) * BIAS;
- ADD32ItoM((uptr)&psxRegs.cycle, count);
+
StackRes();
RET();
@@ -277,11 +281,9 @@ static void iBranch(u32 branchPC, int savectx) {
recBSC[psxRegs.code>>26]();
iFlushRegs();
+ iStoreCycle();
MOV32ItoM((uptr)&psxRegs.pc, branchPC);
CALLFunc((uptr)psxBranchTest);
- /* store cycle */
- count = ((pc - pcold) / 4) * BIAS;
- ADD32ItoM((uptr)&psxRegs.cycle, count);
StackRes();