| 864 | } |
| 865 | |
| 866 | static void cpu_halt(void) { |
| 867 | cpu.halted = true; |
| 868 | cpu_restore_next(); |
| 869 | #ifdef DEBUG_SUPPORT |
| 870 | while (cpu.cycles < cpu.next && !cpu.IEF1 && debug.step) { |
| 871 | cpu.haltCycles++; |
| 872 | cpu.cycles++; |
| 873 | debug_open(DBG_FROZEN, cpu.registers.PC); |
| 874 | } |
| 875 | #endif |
| 876 | if (cpu.cycles < cpu.next) { |
| 877 | cpu.haltCycles += cpu.next - cpu.cycles; |
| 878 | cpu.cycles = cpu.next; /* consume all of the cycles */ |
| 879 | } |
| 880 | } |
| 881 | |
| 882 | void cpu_restore_next(void) { |
| 883 | if (cpu.NMI || (cpu.IEF1 && (intrpt->status & intrpt->enabled)) || cpu_check_signals() != CPU_SIGNAL_NONE) { |
no test coverage detected