Adding an error message on invalid instructions

This commit is contained in:
Zoe Roux
2021-02-04 12:07:26 +01:00
parent 04f9b9a8fc
commit 845a8c26f0
11 changed files with 78 additions and 17 deletions
+10 -1
View File
@@ -34,6 +34,15 @@ namespace ComSquare
this->apu->update(cycleCount);
}
void SNES::enableCPUDebuggingWithError(const DebuggableError &exception)
{
this->enableCPUDebugging(true);
#ifdef DEBUGGER_ENABLED
auto cpuDebug = std::static_pointer_cast<Debugger::CPUDebug>(this->cpu);
cpuDebug->showError(exception);
#endif
}
void SNES::enableCPUDebugging(bool pause)
{
#ifdef DEBUGGER_ENABLED
@@ -41,7 +50,7 @@ namespace ComSquare
auto cpuDebug = std::static_pointer_cast<Debugger::CPUDebug>(this->cpu);
cpuDebug->focus();
if (pause)
cpuDebug->pause();
cpuDebug->pause(true);
} else {
this->cpu = std::make_shared<Debugger::CPUDebug>(*this->cpu, *this);
this->bus->mapComponents(*this);