CPU: Display clean message when CPU crashes
This commit is contained in:
parent
c3694e16f5
commit
6f6a07b6c9
2 changed files with 8 additions and 2 deletions
|
@ -247,7 +247,7 @@ private:
|
|||
case AddrMode::AbsYW: return GetAbsYAddr(true);
|
||||
default: break;
|
||||
}
|
||||
throw std::runtime_error("invalid addressing mode");
|
||||
throw std::runtime_error("Invalid OP code - CPU crashed");
|
||||
}
|
||||
|
||||
uint16_t GetOperand()
|
||||
|
|
|
@ -215,7 +215,13 @@ void Console::Run()
|
|||
VideoDecoder::GetInstance()->StartThread();
|
||||
|
||||
while(true) {
|
||||
_cpu->Exec();
|
||||
try {
|
||||
_cpu->Exec();
|
||||
} catch(const std::runtime_error &ex) {
|
||||
MessageManager::DisplayMessage("Error", string("Game has crashed. (") + ex.what() + ")");
|
||||
break;
|
||||
}
|
||||
|
||||
uint32_t currentFrameNumber = PPU::GetFrameCount();
|
||||
if(currentFrameNumber != lastFrameNumber) {
|
||||
lastFrameNumber = currentFrameNumber;
|
||||
|
|
Loading…
Add table
Reference in a new issue