From f28380cc5c2c82da4120035009ae6e368cdbae16 Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Tue, 19 Jun 2018 21:02:17 -0400 Subject: add comment about HALT --- ops.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'ops.yaml') 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); -- cgit v1.2.3