diff options
author | Michael Pavone <pavone@retrodev.com> | 2017-02-19 17:37:25 -0800 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2017-02-19 17:37:25 -0800 |
commit | d650c23dbc3b48dbee648cccaea4adb013ab3f58 (patch) | |
tree | cf8f1d579610a7bd61c1581facc1fd50678cd17a | |
parent | 739d62d41268a407e8e1c7b85330b349aee92785 (diff) |
Fix loading of the R register from the in memory context
-rw-r--r-- | z80_to_x86.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/z80_to_x86.c b/z80_to_x86.c index 11d7e2d..5303bf2 100644 --- a/z80_to_x86.c +++ b/z80_to_x86.c @@ -3277,9 +3277,6 @@ void init_z80_opts(z80_options * options, memmap_chunk const * chunks, uint32_t or_rrdisp(code, options->regs[Z80_R], options->gen.context_reg, zr_off(Z80_R), SZ_B); } else if (options->regs[reg] >= 0) { mov_rrdisp(code, options->regs[reg], options->gen.context_reg, zr_off(reg), size); - if (reg == Z80_R) { - and_irdisp(code, 0x80, options->gen.context_reg, zr_off(reg), SZ_B); - } } if (size == SZ_W) { i++; @@ -3310,6 +3307,9 @@ void init_z80_opts(z80_options * options, memmap_chunk const * chunks, uint32_t } if (options->regs[reg] >= 0) { mov_rdispr(code, options->gen.context_reg, offsetof(z80_context, regs) + i, options->regs[reg], size); + if (reg == Z80_R) { + and_irdisp(code, 0x80, options->gen.context_reg, zr_off(reg), SZ_B); + } } if (size == SZ_W) { i++; |