diff options
| author | Paul Duncan <pabs@pablotron.org> | 2018-06-19 21:02:17 -0400 |
|---|---|---|
| committer | Paul Duncan <pabs@pablotron.org> | 2018-06-19 21:02:17 -0400 |
| commit | f28380cc5c2c82da4120035009ae6e368cdbae16 (patch) | |
| tree | 083e041fa864663000c7d3741902ffb04cd8faeb | |
| parent | 3890aae0d46d13896c645325b3156c807fe49711 (diff) | |
| download | gb-c-f28380cc5c2c82da4120035009ae6e368cdbae16.tar.xz gb-c-f28380cc5c2c82da4120035009ae6e368cdbae16.zip | |
add comment about HALT
| -rw-r--r-- | ops.yaml | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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); |
