summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2018-06-15 13:56:42 -0400
committerPaul Duncan <pabs@pablotron.org>2018-06-15 13:56:42 -0400
commit83835b229abdee7b4e79156c4f76f854476127f5 (patch)
tree856c2fefad2c5f001aa72278b3b6c490899a190a
parentd5bb94cc655d4410544394478587d36b1041d9d3 (diff)
downloadgb-c-83835b229abdee7b4e79156c4f76f854476127f5.tar.bz2
gb-c-83835b229abdee7b4e79156c4f76f854476127f5.zip
fix RST 18H, populate rst()
-rwxr-xr-x[-rw-r--r--]gen.rb0
-rw-r--r--ops.yaml15
2 files changed, 9 insertions, 6 deletions
diff --git a/gen.rb b/gen.rb
index 6d579ca..6d579ca 100644..100755
--- a/gen.rb
+++ b/gen.rb
diff --git a/ops.yaml b/ops.yaml
index 360fadb..30451df 100644
--- a/ops.yaml
+++ b/ops.yaml
@@ -3349,12 +3349,12 @@ ops:
c: C
code: |
invalid(ctx, old_pc);
- - id: RST 16H
+ - id: RST 18H
hex: 0xDF
cat: "jumps/calls"
op: RST
dst: PC
- addr: "0x16"
+ addr: "0x18"
len: 1
time: 16
flags:
@@ -3363,7 +3363,7 @@ ops:
h:
c:
code: |
- rst(ctx, 0x16);
+ rst(ctx, 0x18);
- id: LDH (a8), A
hex: 0xE0
cat: "8-bit load/store/move"
@@ -8667,10 +8667,13 @@ templates:
static void
rst(
gb_t * const ctx,
- const uint8_t val
+ const uint16_t addr
) {
- UNUSED(ctx);
- UNUSED(val);
+ // push pc
+ push_rw(ctx, RW_PC);
+
+ // jump
+ cpu_ww(ctx, RW_PC, addr);
}
static void