Fix messed up logic

This commit is contained in:
Kingcom committed 2013-10-19 02:45:58 +02:00
1 parent 8f698d552b
commit 4abda21699
2 files changed
+15 -13

No files matched your search

-1
View File
@@ -89,7 +89,6 @@ class CtrlDisAsmView
bool searching;
bool dontRedraw;
bool keyTaken;
bool stepScrolling;
void assembleOpcode(u32 address, std::string defaultText);
void disassembleToFile();
+15 -12
View File
@@ -168,27 +168,30 @@ void CDisasm::stepInto()
// If the current PC is on a breakpoint, the user doesn't want to do nothing.
CBreakPoints::SetSkipFirst(currentMIPS->pc);
u32 newAddress = currentPc+cpu->getInstructionSize(0);
MIPSAnalyst::MipsOpcodeInfo info = MIPSAnalyst::GetOpcodeInfo(cpu,cpu->GetPC());
MIPSAnalyst::MipsOpcodeInfo info = MIPSAnalyst::GetOpcodeInfo(cpu,currentPc);
if (info.isBranch)
{
u32 newAddress = currentPc+cpu->getInstructionSize(0);
if (newAddress == windowEnd-4)
ptr->scrollWindow(1);
else if (newAddress == windowEnd)
ptr->scrollWindow(2);
} else {
if (!currentMIPS->inDelaySlot)
bool scroll = true;
if (currentMIPS->inDelaySlot)
{
MIPSAnalyst::MipsOpcodeInfo prevInfo = MIPSAnalyst::GetOpcodeInfo(cpu,cpu->GetPC()-cpu->getInstructionSize(0));
if (!prevInfo.isBranch || (prevInfo.isConditional && !prevInfo.conditionMet))
{
u32 newAddress = currentPc+cpu->getInstructionSize(0);
if (newAddress == windowEnd-4)
ptr->scrollWindow(1);
else if (newAddress == windowEnd)
ptr->scrollWindow(2);
}
MIPSAnalyst::MipsOpcodeInfo prevInfo = MIPSAnalyst::GetOpcodeInfo(cpu,currentPc-cpu->getInstructionSize(0));
if (!prevInfo.isConditional || prevInfo.conditionMet)
scroll = false;
}
if (scroll)
{
if (newAddress == windowEnd-4)
ptr->scrollWindow(1);
else if (newAddress == windowEnd)
ptr->scrollWindow(2);
}
}