# HG changeset patch # User Michael Pavone # Date 1431483249 25200 # Node ID 144df1a6d3b99c760a7d9434a6407c314d657c0a # Parent 200ee73c7210f2e72de4ad66d9334cea52a08d40 Save PC to context struct when syncing Z80 at instruction start. This fixes saving savestates and probably the Z80 debugger as well diff -r 200ee73c7210 -r 144df1a6d3b9 z80_to_x86.c --- a/z80_to_x86.c Mon May 11 20:34:33 2015 -0700 +++ b/z80_to_x86.c Tue May 12 19:14:09 2015 -0700 @@ -2121,6 +2121,8 @@ 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);