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()
|
||||
{
|
||||
MemoryRead(_state.PC, MemoryOperationType::ExecOperand);
|
||||
MemoryRead(_state.PC, MemoryOperationType::Read);
|
||||
}
|
||||
|
||||
uint8_t ReadByte()
|
||||
|
|
|
@ -104,18 +104,21 @@ uint32_t Disassembler::BuildCache(uint32_t absoluteAddr, uint16_t memoryAddr)
|
|||
}
|
||||
return memoryAddr;
|
||||
} else {
|
||||
while(!_disassembleCache[absoluteAddr]) {
|
||||
shared_ptr<DisassemblyInfo> disInfo(new DisassemblyInfo(&_prgROM[absoluteAddr]));
|
||||
_disassembleCache[absoluteAddr] = disInfo;
|
||||
if(!_disassembleCache[absoluteAddr]) {
|
||||
while(absoluteAddr < _prgSize && !_disassembleCache[absoluteAddr]) {
|
||||
shared_ptr<DisassemblyInfo> disInfo(new DisassemblyInfo(&_prgROM[absoluteAddr]));
|
||||
_disassembleCache[absoluteAddr] = disInfo;
|
||||
|
||||
uint8_t opCode = _prgROM[absoluteAddr];
|
||||
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
|
||||
break;
|
||||
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) {
|
||||
//Hit a jump/return instruction, can't assume that what follows is actual code, stop disassembling
|
||||
break;
|
||||
}
|
||||
}
|
||||
absoluteAddr += disInfo->GetSize();
|
||||
} else {
|
||||
absoluteAddr += _disassembleCache[absoluteAddr]->GetSize();
|
||||
}
|
||||
absoluteAddr += _disassembleCache[absoluteAddr]->GetSize();
|
||||
return absoluteAddr;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue