diff --git a/Windows/Debugger/CtrlDisAsmView.h b/Windows/Debugger/CtrlDisAsmView.h index b2a35da413..84581a5f17 100644 --- a/Windows/Debugger/CtrlDisAsmView.h +++ b/Windows/Debugger/CtrlDisAsmView.h @@ -89,6 +89,7 @@ class CtrlDisAsmView bool searching; bool dontRedraw; bool keyTaken; + bool stepScrolling; void assembleOpcode(u32 address, std::string defaultText); void disassembleToFile(); @@ -141,6 +142,8 @@ public: { return debugger; } + + u32 getWindowEnd() { return windowStart+visibleRows*instructionSize; }; void gotoAddr(unsigned int addr) { u32 windowEnd = windowStart+visibleRows*instructionSize; diff --git a/Windows/Debugger/Debugger_Disasm.cpp b/Windows/Debugger/Debugger_Disasm.cpp index 7bf20cbcde..adc6e6f6a8 100644 --- a/Windows/Debugger/Debugger_Disasm.cpp +++ b/Windows/Debugger/Debugger_Disasm.cpp @@ -189,10 +189,12 @@ void CDisasm::stepOver() // If the current PC is on a breakpoint, the user doesn't want to do nothing. CBreakPoints::SetSkipFirst(currentMIPS->pc); + u32 currentPc = cpu->GetPC(); + u32 windowEnd = ptr->getWindowEnd(); MIPSAnalyst::MipsOpcodeInfo info = MIPSAnalyst::GetOpcodeInfo(cpu,cpu->GetPC()); ptr->setDontRedraw(true); - u32 breakpointAddress = cpu->GetPC()+cpu->getInstructionSize(0); + u32 breakpointAddress = currentPc+cpu->getInstructionSize(0); if (info.isBranch) { if (info.isConditional == false) @@ -206,13 +208,24 @@ void CDisasm::stepOver() breakpointAddress = info.branchTarget; } } else { // beq, ... - // set breakpoint at branch target - breakpointAddress = info.branchTarget; - CBreakPoints::AddBreakPoint(breakpointAddress,true); - - // and after the delay slot - breakpointAddress = cpu->GetPC()+2*cpu->getInstructionSize(0); + if (info.conditionMet) + { + breakpointAddress = info.branchTarget; + } else { + breakpointAddress = currentPc+2*cpu->getInstructionSize(0); + if (breakpointAddress == windowEnd-4) + ptr->scrollWindow(1); + else if (breakpointAddress == windowEnd) + ptr->scrollWindow(2); + else if (breakpointAddress == windowEnd+4) + ptr->scrollWindow(3); + } } + } else { + if (breakpointAddress == windowEnd-4) + ptr->scrollWindow(1); + else if (breakpointAddress == windowEnd) + ptr->scrollWindow(2); } SetDebugMode(false, true);