From bb4d756ebbab5ee70ac1c03bc13435a5ec494613 Mon Sep 17 00:00:00 2001 From: Nabile Rahmani Date: Mon, 24 Dec 2018 17:29:06 +0100 Subject: [PATCH] Step out should step over other linked jumps. --- DotN64/Diagnostics/Debugger.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/DotN64/Diagnostics/Debugger.cs b/DotN64/Diagnostics/Debugger.cs index 79efe96..c9339b8 100644 --- a/DotN64/Diagnostics/Debugger.cs +++ b/DotN64/Diagnostics/Debugger.cs @@ -119,7 +119,17 @@ namespace DotN64.Diagnostics if (instruction.Special == VR4300.SpecialOpCode.JR && instruction.RS == (byte)VR4300.GPRIndex.RA) break; - nintendo64.CPU.Cycle(); + if (instruction.OP == VR4300.OpCode.JAL || instruction.Special == VR4300.SpecialOpCode.JALR) + { + var target = Cursor + VR4300.Instruction.Size * 2; + + while (Cursor != target) + { + nintendo64.CPU.Cycle(); + } + } + else + nintendo64.CPU.Cycle(); } Disassemble();