diff z80_to_x86.c @ 315:684e71e9f0d0

Fix return address for RST
author Mike Pavone <pavone@retrodev.com>
date Thu, 09 May 2013 20:09:49 -0700
parents 54c0e5f22198
children 14a937097c2b
line wrap: on
line diff
--- a/z80_to_x86.c	Thu May 09 19:38:28 2013 -0700
+++ b/z80_to_x86.c	Thu May 09 20:09:49 2013 -0700
@@ -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 @@
 		//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);