aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/cpu.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/cpu.c b/src/cpu.c
index 5b73724..e2f0ad0 100644
--- a/src/cpu.c
+++ b/src/cpu.c
@@ -1,4 +1,5 @@
#include "cpu.h"
+#include <stdio.h>
#define FZ 0x80
#define FN 0x40
@@ -407,7 +408,11 @@ int cpu_step(GB *gb) {
case 0xCB: do_cb(gb); break;
- case 0xED: gb->poweroff = true; break; // (illegal on HW) clean-exit signal
+ case 0xED: gb->poweroff = true; // (illegal on HW) clean-exit signal
+ fprintf(stderr, "[sl0pboy] poweroff opcode $ED at pc=%04X (af=%04X bc=%04X "
+ "de=%04X hl=%04X sp=%04X)\n", (unsigned)(c->pc - 1), c->af, c->bc,
+ c->de, c->hl, c->sp);
+ break;
default:
// 0x40-0xBF block: LD r,r' and ALU A,r