From 42c1cb8c7c5369c88a8e94c083731b1e93b6119a Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Tue, 12 May 2015 19:14:09 -0700 Subject: Save PC to context struct when syncing Z80 at instruction start. This fixes saving savestates and probably the Z80 debugger as well --- z80_to_x86.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'z80_to_x86.c') diff --git a/z80_to_x86.c b/z80_to_x86.c index 17eb40a..313a8bb 100644 --- a/z80_to_x86.c +++ b/z80_to_x86.c @@ -2121,6 +2121,8 @@ void init_z80_opts(z80_options * options, memmap_chunk const * chunks, uint32_t cmp_rdispr(code, options->gen.context_reg, offsetof(z80_context, sync_cycle), options->gen.cycles, SZ_D); code_ptr skip_sync = code->cur + 1; jcc(code, CC_B, skip_sync); + //save PC + mov_rrdisp(code, options->gen.scratch1, options->gen.context_reg, offsetof(z80_context, pc), SZ_D); options->do_sync = code->cur; call(code, options->gen.save_context); pop_rind(code, options->gen.context_reg); -- cgit v1.2.3