Don't count EBREAK twice
aef68e6916a7c688ca33c99698dc75d400e03426c345fdd5d6660dd09fa15cae
1 parent
f640ed27
emulator.c
+3 -2
| 2508 | 2508 | case JIT_EXIT_RET: |
|
| 2509 | 2509 | cpu.running = false; |
|
| 2510 | 2510 | break; |
|
| 2511 | 2511 | ||
| 2512 | 2512 | default: |
|
| 2513 | - | /* ECALL, EBREAK, FAULT -- interpreter handles it. */ |
|
| 2513 | + | /* ECALL, EBREAK, FAULT -- interpreter handles it. |
|
| 2514 | + | * The instruction is already counted above, |
|
| 2515 | + | * so don't increment steps again. */ |
|
| 2514 | 2516 | cpu.pc = next_pc; |
|
| 2515 | 2517 | cpu_execute(&cpu, display, true); |
|
| 2516 | - | steps++; |
|
| 2517 | 2518 | break; |
|
| 2518 | 2519 | } |
|
| 2519 | 2520 | } |
|
| 2520 | 2521 | jit_destroy(&jit); |
|
| 2521 | 2522 | } else { |