summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ops.yaml9
1 files changed, 7 insertions, 2 deletions
diff --git a/ops.yaml b/ops.yaml
index a9fde28..27950ac 100644
--- a/ops.yaml
+++ b/ops.yaml
@@ -9212,7 +9212,7 @@ templates:
}
static void
- gb_handle_interrupts(
+ cpu_handle_interrupts(
gb_t * const ctx
) {
if (ctx->cpu.state == STATE_RUN) {
@@ -9253,6 +9253,11 @@ templates:
// has this interrupt been triggered?
if (iv & mask) {
+ // if IME is set, then jump to interrupt handler
+ // if IME is not set, then PC starts at first instruction
+ // after HALT
+ // (TCAGBD.pdf, 4.9)
+
// wake cpu
ctx->cpu.state = STATE_RUN;
@@ -9285,7 +9290,7 @@ templates:
gb_t * const ctx
) {
// handle pending interrupts
- gb_handle_interrupts(ctx);
+ cpu_handle_interrupts(ctx);
// advance cpu
const uint16_t clock = cpu_step(ctx);