From 94699f380cc235cfe4f89a8f44970bbe5cdbc500 Mon Sep 17 00:00:00 2001 From: Mike Pavone Date: Thu, 9 May 2013 20:09:49 -0700 Subject: Fix return address for RST --- z80_to_x86.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'z80_to_x86.c') 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); -- cgit v1.2.3