Skip to content

Commit

Permalink
CPU: Stop emulation if CPU is deadlocked.
Browse files Browse the repository at this point in the history
  • Loading branch information
bearoso committed Apr 27, 2024
1 parent 986dd2a commit fdcff01
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cpuexec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,14 @@ void S9xMainLoop (void)
Op = CPU.PCBase[Registers.PCw];
CPU.Cycles += CPU.MemSpeed;
Opcodes = ICPU.S9xOpcodes;

if (CPU.Cycles > 1000000)
{
Settings.StopEmulation = true;
CPU.Flags |= HALTED_FLAG;
S9xMessage(S9X_FATAL_ERROR, 0, "CPU is deadlocked");
return;
}
}
else
{
Expand Down

0 comments on commit fdcff01

Please sign in to comment.