# HG changeset patch # User Mike Pavone # Date 1368155389 25200 # Node ID 684e71e9f0d081423d1d401dff1463a7f3d9c525 # Parent 54c0e5f2219845fd94440a60314c3046ec3fcdaf Fix return address for RST diff -r 54c0e5f22198 -r 684e71e9f0d0 z80_to_x86.c --- 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);