summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2018-06-19 21:02:17 -0400
committerPaul Duncan <pabs@pablotron.org>2018-06-19 21:02:17 -0400
commitf28380cc5c2c82da4120035009ae6e368cdbae16 (patch)
tree083e041fa864663000c7d3741902ffb04cd8faeb
parent3890aae0d46d13896c645325b3156c807fe49711 (diff)
downloadgb-c-f28380cc5c2c82da4120035009ae6e368cdbae16.tar.bz2
gb-c-f28380cc5c2c82da4120035009ae6e368cdbae16.zip
add comment about HALT
-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);