From 36e5d8d353243e8fb37032bbf3f213bebee9d5bf Mon Sep 17 00:00:00 2001 From: LegendOfDragoon Date: Wed, 18 Feb 2015 18:18:27 -0800 Subject: [PATCH 1/2] Fix problem with IsNextInstructionMmx() It's supposed to check the next instruction, which is PC, rather than the current instruction which is CompilePC. This mistake is what caused graphical errors in RE2. --- Source/RSP/Recompiler Analysis.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/RSP/Recompiler Analysis.c b/Source/RSP/Recompiler Analysis.c index b9766b526..8d9e7d73e 100644 --- a/Source/RSP/Recompiler Analysis.c +++ b/Source/RSP/Recompiler Analysis.c @@ -104,9 +104,9 @@ BOOL IsNextInstructionMmx(DWORD PC) { case RSP_VECTOR_VADD: case RSP_VECTOR_VSUB: /* Requires no accumulator write! & No flags! */ - if (WriteToAccum(Low16BitAccum, CompilePC) == TRUE) { + if (WriteToAccum(Low16BitAccum, PC) == TRUE) { return FALSE; - } else if (UseRspFlags(CompilePC) == TRUE) { + } else if (UseRspFlags(PC) == TRUE) { return FALSE; } else if ((RspOp.rs & 0x0f) >= 2 && (RspOp.rs & 0x0f) <= 7 && IsMmx2Enabled == FALSE) { return FALSE; From 8aa40e411938ad76bb351fa42046162345c5b3e9 Mon Sep 17 00:00:00 2001 From: LegendOfDragoon Date: Wed, 18 Feb 2015 18:34:32 -0800 Subject: [PATCH 2/2] Add some missing instructions to UseRspFlags() This change should get rid of some message box popups when enabling Show Compiler Errors. --- Source/RSP/Recompiler Analysis.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/RSP/Recompiler Analysis.c b/Source/RSP/Recompiler Analysis.c index 8d9e7d73e..956541467 100644 --- a/Source/RSP/Recompiler Analysis.c +++ b/Source/RSP/Recompiler Analysis.c @@ -837,12 +837,14 @@ BOOL UseRspFlags (int PC) { if ((RspOp.rs & 0x10) != 0) { switch (RspOp.funct) { case RSP_VECTOR_VMULF: + case RSP_VECTOR_VMULU: case RSP_VECTOR_VMUDL: case RSP_VECTOR_VMUDM: case RSP_VECTOR_VMUDN: case RSP_VECTOR_VMUDH: break; case RSP_VECTOR_VMACF: + case RSP_VECTOR_VMACU: case RSP_VECTOR_VMADL: case RSP_VECTOR_VMADM: case RSP_VECTOR_VMADN: @@ -860,6 +862,9 @@ BOOL UseRspFlags (int PC) { case RSP_VECTOR_VAND: case RSP_VECTOR_VOR: case RSP_VECTOR_VXOR: + case RSP_VECTOR_VNAND: + case RSP_VECTOR_VNOR: + case RSP_VECTOR_VNXOR: case RSP_VECTOR_VRCPH: case RSP_VECTOR_VRSQL: case RSP_VECTOR_VRSQH: @@ -873,6 +878,7 @@ BOOL UseRspFlags (int PC) { case RSP_VECTOR_VLT: case RSP_VECTOR_VEQ: case RSP_VECTOR_VGE: + case RSP_VECTOR_VNE: case RSP_VECTOR_VMRG: return TRUE;