Unverified Commit b9622a9c authored by Ignacio Sanchez Gines's avatar Ignacio Sanchez Gines
Browse files

Fix minor bug in debugger step

parent 5b538bf2
......@@ -155,9 +155,9 @@ bool GearsystemCore::LoadROM(const char* szFilePath, Cartridge::ForceConfigurati
m_pMemory->ResetDisassembledMemory();
m_pMemory->LoadSlotsFromROM(m_pCartridge->GetROM(), m_pCartridge->GetROMSize());
bool romTypeOK = AddMemoryRules();
#ifndef GEARSYSTEM_DISABLE_DISASSEMBLER
m_pProcessor->Disassemble(m_pProcessor->GetState()->PC->GetValue());
#endif
m_pProcessor->DisassembleNextOpcode();
if (!romTypeOK)
{
Log("There was a problem with the cartridge header. File: %s...", szFilePath);
......@@ -180,6 +180,8 @@ bool GearsystemCore::LoadROMFromBuffer(const u8* buffer, int size, Cartridge::Fo
m_pMemory->LoadSlotsFromROM(m_pCartridge->GetROM(), m_pCartridge->GetROMSize());
bool romTypeOK = AddMemoryRules();
m_pProcessor->DisassembleNextOpcode();
if (!romTypeOK)
{
Log("There was a problem with the cartridge header.");
......@@ -330,9 +332,9 @@ void GearsystemCore::ResetROM(Cartridge::ForceConfiguration* config)
Reset();
m_pMemory->LoadSlotsFromROM(m_pCartridge->GetROM(), m_pCartridge->GetROMSize());
AddMemoryRules();
#ifndef GEARSYSTEM_DISABLE_DISASSEMBLER
m_pProcessor->Disassemble(m_pProcessor->GetState()->PC->GetValue());
#endif
// #ifndef GEARSYSTEM_DISABLE_DISASSEMBLER
// m_pProcessor->Disassemble(m_pProcessor->GetState()->PC->GetValue());
// #endif
}
}
......
......@@ -143,6 +143,7 @@ unsigned int Processor::RunFor(u8 tstates)
m_iTStates += 11;
IncreaseR();
WZ.SetValue(PC.GetValue());
DisassembleNextOpcode();
return m_iTStates;
}
else if (m_bIFF1 && m_bINTRequested && !m_bAfterEI)
......@@ -156,6 +157,7 @@ unsigned int Processor::RunFor(u8 tstates)
IncreaseR();
WZ.SetValue(PC.GetValue());
UpdateProActionReplay();
DisassembleNextOpcode();
return m_iTStates;
}
......@@ -163,11 +165,7 @@ unsigned int Processor::RunFor(u8 tstates)
}
ExecuteOPCode();
#ifndef GEARSYSTEM_DISABLE_DISASSEMBLER
if (Disassemble(PC.GetValue()) || m_bRequestMemBreakpoint)
m_bBreakpointHit = true;
#endif
DisassembleNextOpcode();
executed += m_iTStates;
}
......@@ -315,6 +313,14 @@ void Processor::UndocumentedOPCode()
#endif
}
void Processor::DisassembleNextOpcode()
{
#ifndef GEARCOLECO_DISABLE_DISASSEMBLER
if (Disassemble(PC.GetValue()) || m_bRequestMemBreakpoint)
m_bBreakpointHit = true;
#endif
}
bool Processor::Disassemble(u16 address)
{
Memory::stDisassembleRecord** memoryMap = m_pMemory->GetDisassembledMemoryMap();
......
......@@ -70,6 +70,7 @@ public:
void ClearProActionReplayCheats();
ProcessorState* GetState();
bool Disassemble(u16 address);
void DisassembleNextOpcode();
bool BreakpointHit();
void RequestMemoryBreakpoint();
bool Halted();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment