summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pavone <pavone@retrodev.com>2013-05-09 20:09:49 -0700
committerMike Pavone <pavone@retrodev.com>2013-05-09 20:09:49 -0700
commit94699f380cc235cfe4f89a8f44970bbe5cdbc500 (patch)
tree90e2a217518518d56afa893616ae2cabda2ca880
parent7c1e92cdc17788e59c0aca980caac79e4b9bc643 (diff)
Fix return address for RST
-rw-r--r--z80_to_x86.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/z80_to_x86.c b/z80_to_x86.c
index a04c2a0..19b76ce 100644
--- a/z80_to_x86.c
+++ b/z80_to_x86.c
@@ -15,7 +15,7 @@
#define SCRATCH2 R14
#define CONTEXT RSI
-#define DO_DEBUG_PRINT
+//#define DO_DEBUG_PRINT
#ifdef DO_DEBUG_PRINT
#define dprintf printf
@@ -1576,7 +1576,7 @@ uint8_t * translate_z80inst(z80inst * inst, uint8_t * dst, z80_context * context
//RST is basically CALL to an address in page 0
dst = zcycles(dst, 5);//T States: 5
dst = sub_ir(dst, 2, opts->regs[Z80_SP], SZ_W);
- dst = mov_ir(dst, address + 3, SCRATCH1, SZ_W);
+ dst = mov_ir(dst, address + 1, SCRATCH1, SZ_W);
dst = mov_rr(dst, opts->regs[Z80_SP], SCRATCH2, SZ_W);
dst = call(dst, (uint8_t *)z80_write_word_highfirst);//T States: 3, 3
uint8_t * call_dst = z80_get_native_address(context, inst->immed);