comparison z80_to_x86.c @ 1225:197cb199a35b

Fix loading of the R register from the in memory context
author Michael Pavone <pavone@retrodev.com>
date Sun, 19 Feb 2017 17:37:25 -0800
parents 15c5be05e6a9
children cad1642baf66
comparison
equal deleted inserted replaced
1224:15c5be05e6a9 1225:197cb199a35b
3275 if (reg == Z80_R) { 3275 if (reg == Z80_R) {
3276 and_ir(code, 0x7F, options->regs[Z80_R], SZ_B); 3276 and_ir(code, 0x7F, options->regs[Z80_R], SZ_B);
3277 or_rrdisp(code, options->regs[Z80_R], options->gen.context_reg, zr_off(Z80_R), SZ_B); 3277 or_rrdisp(code, options->regs[Z80_R], options->gen.context_reg, zr_off(Z80_R), SZ_B);
3278 } else if (options->regs[reg] >= 0) { 3278 } else if (options->regs[reg] >= 0) {
3279 mov_rrdisp(code, options->regs[reg], options->gen.context_reg, zr_off(reg), size); 3279 mov_rrdisp(code, options->regs[reg], options->gen.context_reg, zr_off(reg), size);
3280 if (reg == Z80_R) {
3281 and_irdisp(code, 0x80, options->gen.context_reg, zr_off(reg), SZ_B);
3282 }
3283 } 3280 }
3284 if (size == SZ_W) { 3281 if (size == SZ_W) {
3285 i++; 3282 i++;
3286 } 3283 }
3287 } 3284 }
3308 reg = i; 3305 reg = i;
3309 size = SZ_B; 3306 size = SZ_B;
3310 } 3307 }
3311 if (options->regs[reg] >= 0) { 3308 if (options->regs[reg] >= 0) {
3312 mov_rdispr(code, options->gen.context_reg, offsetof(z80_context, regs) + i, options->regs[reg], size); 3309 mov_rdispr(code, options->gen.context_reg, offsetof(z80_context, regs) + i, options->regs[reg], size);
3310 if (reg == Z80_R) {
3311 and_irdisp(code, 0x80, options->gen.context_reg, zr_off(reg), SZ_B);
3312 }
3313 } 3313 }
3314 if (size == SZ_W) { 3314 if (size == SZ_W) {
3315 i++; 3315 i++;
3316 } 3316 }
3317 } 3317 }