From f1a0c788ed81c99652e9394d43ec60b425a66c9d Mon Sep 17 00:00:00 2001 From: zilmar Date: Sat, 3 Nov 2012 12:38:18 +1100 Subject: [PATCH] Fix loop analysis for BGEZ --- .../N64 System/Recompiler/Code Block.cpp | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/Source/Project64/N64 System/Recompiler/Code Block.cpp b/Source/Project64/N64 System/Recompiler/Code Block.cpp index acbca93db..621d539e0 100644 --- a/Source/Project64/N64 System/Recompiler/Code Block.cpp +++ b/Source/Project64/N64 System/Recompiler/Code Block.cpp @@ -412,23 +412,26 @@ bool CCodeBlock::AnalyzeInstruction ( DWORD PC, DWORD & TargetPC, DWORD & Contin TargetPC = PC + ((short)Command.offset << 2) + 4; if (TargetPC == PC + 8) { - _Notify->BreakPoint(__FILE__,__LINE__); - } - IncludeDelaySlot = true; - if (Command.rs != 0) - { - ContinuePC = PC + 8; - } - if (TargetPC == PC) - { - if (Command.rs == 0) + TargetPC = (DWORD)-1; + } else { + if (TargetPC == PC) { - TargetPC = (DWORD)-1; - EndBlock = true; - } else { - //if delay slot effects compare; - _Notify->BreakPoint(__FILE__,__LINE__); + if (Command.rs == 0) + { + TargetPC = (DWORD)-1; + EndBlock = true; + } else { + if (!DelaySlotEffectsCompare(PC,Command.rs,Command.rt)) + { + PermLoop = true; + } + } } + if (Command.rs != 0) + { + ContinuePC = PC + 8; + } + IncludeDelaySlot = true; } break; case R4300i_REGIMM_BLTZL: