comparison z80_to_x86.c @ 715:1c2020d3e275

Call z80_handle_deferred after generating an insruction handler so that instructions like rst work correctly
author Michael Pavone <pavone@retrodev.com>
date Sun, 17 May 2015 19:14:41 -0700
parents 382a2b5b70c0
children b707a8ddc202
comparison
equal deleted inserted replaced
714:e29bc2918f69 715:1c2020d3e275
21 #else 21 #else
22 #define dprintf 22 #define dprintf
23 #endif 23 #endif
24 24
25 uint32_t zbreakpoint_patch(z80_context * context, uint16_t address, code_ptr dst); 25 uint32_t zbreakpoint_patch(z80_context * context, uint16_t address, code_ptr dst);
26 void z80_handle_deferred(z80_context * context);
26 27
27 uint8_t z80_size(z80inst * inst) 28 uint8_t z80_size(z80inst * inst)
28 { 29 {
29 uint8_t reg = (inst->reg & 0x1F); 30 uint8_t reg = (inst->reg & 0x1F);
30 if (reg != Z80_UNUSED && reg != Z80_USE_IMMED) { 31 if (reg != Z80_UNUSED && reg != Z80_USE_IMMED) {
1651 translate_z80inst(&inst, context, 0, 1); 1652 translate_z80inst(&inst, context, 0, 1);
1652 mov_rdispr(code, opts->gen.context_reg, offsetof(z80_context, pc), opts->gen.scratch1, SZ_W); 1653 mov_rdispr(code, opts->gen.context_reg, offsetof(z80_context, pc), opts->gen.scratch1, SZ_W);
1653 add_ir(code, after - codebuf, opts->gen.scratch1, SZ_W); 1654 add_ir(code, after - codebuf, opts->gen.scratch1, SZ_W);
1654 call(code, opts->native_addr); 1655 call(code, opts->native_addr);
1655 jmp_r(code, opts->gen.scratch1); 1656 jmp_r(code, opts->gen.scratch1);
1657 z80_handle_deferred(context);
1656 } 1658 }
1657 return context->interp_code[opcode]; 1659 return context->interp_code[opcode];
1658 } 1660 }
1659 1661
1660 code_info z80_make_interp_stub(z80_context * context, uint16_t address) 1662 code_info z80_make_interp_stub(z80_context * context, uint16_t address)