Debugger - Fixed issue with disassembler
This commit is contained in:
parent
6b26c892ac
commit
76f80183d7
2 changed files with 13 additions and 10 deletions
|
@ -90,7 +90,7 @@ private:
|
||||||
|
|
||||||
void DummyRead()
|
void DummyRead()
|
||||||
{
|
{
|
||||||
MemoryRead(_state.PC, MemoryOperationType::ExecOperand);
|
MemoryRead(_state.PC, MemoryOperationType::Read);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t ReadByte()
|
uint8_t ReadByte()
|
||||||
|
|
|
@ -104,18 +104,21 @@ uint32_t Disassembler::BuildCache(uint32_t absoluteAddr, uint16_t memoryAddr)
|
||||||
}
|
}
|
||||||
return memoryAddr;
|
return memoryAddr;
|
||||||
} else {
|
} else {
|
||||||
while(!_disassembleCache[absoluteAddr]) {
|
if(!_disassembleCache[absoluteAddr]) {
|
||||||
|
while(absoluteAddr < _prgSize && !_disassembleCache[absoluteAddr]) {
|
||||||
shared_ptr<DisassemblyInfo> disInfo(new DisassemblyInfo(&_prgROM[absoluteAddr]));
|
shared_ptr<DisassemblyInfo> disInfo(new DisassemblyInfo(&_prgROM[absoluteAddr]));
|
||||||
_disassembleCache[absoluteAddr] = disInfo;
|
_disassembleCache[absoluteAddr] = disInfo;
|
||||||
|
|
||||||
uint8_t opCode = _prgROM[absoluteAddr];
|
uint8_t opCode = _prgROM[absoluteAddr];
|
||||||
|
absoluteAddr += disInfo->GetSize();
|
||||||
if(opCode == 0x10 || opCode == 0x20 || opCode == 0x30 || opCode == 0x40 || opCode == 0x50 || opCode == 0x60 || opCode == 0x70 || opCode == 0x90 || opCode == 0xB0 || opCode == 0xD0 || opCode == 0xF0 || opCode == 0x4C || opCode == 0x6C) {
|
if(opCode == 0x10 || opCode == 0x20 || opCode == 0x30 || opCode == 0x40 || opCode == 0x50 || opCode == 0x60 || opCode == 0x70 || opCode == 0x90 || opCode == 0xB0 || opCode == 0xD0 || opCode == 0xF0 || opCode == 0x4C || opCode == 0x6C) {
|
||||||
//Hit a jump/return instruction, can't assume that what follows is actual code, stop disassembling
|
//Hit a jump/return instruction, can't assume that what follows is actual code, stop disassembling
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
absoluteAddr += disInfo->GetSize();
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
absoluteAddr += _disassembleCache[absoluteAddr]->GetSize();
|
absoluteAddr += _disassembleCache[absoluteAddr]->GetSize();
|
||||||
|
}
|
||||||
return absoluteAddr;
|
return absoluteAddr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue