From 3a5569ce9dd4cd6ccb146a7cfbca3c8ba05178a3 Mon Sep 17 00:00:00 2001 From: LegendOfDragoon Date: Thu, 24 Sep 2015 15:13:21 -0700 Subject: [PATCH 1/5] Ensure R0 cannot be written to in LB This happens in Castlevania and OOT, although I'm not sure if the code ever gets reached. --- Source/RSP/Recompiler Ops.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/RSP/Recompiler Ops.c b/Source/RSP/Recompiler Ops.c index 4f7117276..1adbbd29e 100644 --- a/Source/RSP/Recompiler Ops.c +++ b/Source/RSP/Recompiler Ops.c @@ -619,6 +619,8 @@ void Compile_COP2 (void) { void Compile_LB ( void ) { int Offset = (short)RSPOpC.offset; + if(RSPOpC.rt == 0) return; + #ifndef Compile_GPRLoads Cheat_r4300iOpcode(RSP_Opcode_LB,"RSP_Opcode_LB"); return; #endif From b6721d1cdc07165aa55717b19fedbdf57bfc8060 Mon Sep 17 00:00:00 2001 From: LegendOfDragoon Date: Thu, 24 Sep 2015 15:29:32 -0700 Subject: [PATCH 2/5] Ensure R0 cannot be written to in LH --- Source/RSP/Recompiler Ops.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/RSP/Recompiler Ops.c b/Source/RSP/Recompiler Ops.c index 1adbbd29e..dd3694f2f 100644 --- a/Source/RSP/Recompiler Ops.c +++ b/Source/RSP/Recompiler Ops.c @@ -651,6 +651,8 @@ void Compile_LH ( void ) { int Offset = (short)RSPOpC.offset; BYTE * Jump[2]; + if(RSPOpC.rt == 0) return; + #ifndef Compile_GPRLoads Cheat_r4300iOpcode(RSP_Opcode_LH,"RSP_Opcode_LH"); return; #endif From fb8db802b396ba0a6c744de35ae628d620e7b9e4 Mon Sep 17 00:00:00 2001 From: LegendOfDragoon Date: Thu, 24 Sep 2015 15:30:34 -0700 Subject: [PATCH 3/5] Ensure R0 cannot be written to in LW --- Source/RSP/Recompiler Ops.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/RSP/Recompiler Ops.c b/Source/RSP/Recompiler Ops.c index dd3694f2f..e49514dee 100644 --- a/Source/RSP/Recompiler Ops.c +++ b/Source/RSP/Recompiler Ops.c @@ -715,6 +715,8 @@ void Compile_LW ( void ) { int Offset = (short)RSPOpC.offset; BYTE * Jump[2]; + if(RSPOpC.rt == 0) return; + #ifndef Compile_GPRLoads Cheat_r4300iOpcode(RSP_Opcode_LW,"RSP_Opcode_LW"); return; #endif From 8bede83fd49c5f4b1ee81eb7362eb3562d6023df Mon Sep 17 00:00:00 2001 From: LegendOfDragoon Date: Thu, 24 Sep 2015 15:31:45 -0700 Subject: [PATCH 4/5] Ensure R0 cannot be written to in LBU --- Source/RSP/Recompiler Ops.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/RSP/Recompiler Ops.c b/Source/RSP/Recompiler Ops.c index e49514dee..19efdcab4 100644 --- a/Source/RSP/Recompiler Ops.c +++ b/Source/RSP/Recompiler Ops.c @@ -792,6 +792,8 @@ void Compile_LW ( void ) { void Compile_LBU ( void ) { int Offset = (short)RSPOpC.offset; + if(RSPOpC.rt == 0) return; + #ifndef Compile_GPRLoads Cheat_r4300iOpcode(RSP_Opcode_LBU,"RSP_Opcode_LBU"); return; #endif From 466c03e27db1e346ec872c4456c1413c4c1d6b0c Mon Sep 17 00:00:00 2001 From: LegendOfDragoon Date: Thu, 24 Sep 2015 15:33:07 -0700 Subject: [PATCH 5/5] Ensure R0 cannot be written to in LHU --- Source/RSP/Recompiler Ops.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/RSP/Recompiler Ops.c b/Source/RSP/Recompiler Ops.c index 19efdcab4..86e8fe43f 100644 --- a/Source/RSP/Recompiler Ops.c +++ b/Source/RSP/Recompiler Ops.c @@ -826,6 +826,8 @@ void Compile_LHU ( void ) { int Offset = (short)RSPOpC.offset; BYTE * Jump[2]; + if(RSPOpC.rt == 0) return; + #ifndef Compile_GPRLoads Cheat_r4300iOpcode(RSP_Opcode_LHU,"RSP_Opcode_LHU"); return; #endif