diff options
-rw-r--r-- | m68k_to_x86.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/m68k_to_x86.c b/m68k_to_x86.c index aabf407..13c7ea7 100644 --- a/m68k_to_x86.c +++ b/m68k_to_x86.c @@ -2037,9 +2037,30 @@ uint8_t * translate_m68k(uint8_t * dst, m68kinst * inst, x86_68k_options * opts) dst = mov_ir(dst, 0, FLAG_V, SZ_B); dst = m68k_save_result(inst, dst, opts); break; - /*case M68K_ORI_CCR: + case M68K_ORI_CCR: case M68K_ORI_SR: - case M68K_PEA: + dst = cycles(dst, 20); + //TODO: If ANDI to SR, trap if not in supervisor mode + if (inst->src.params.immed & 0x1) { + dst = mov_ir(dst, 1, FLAG_C, SZ_B); + } + if (inst->src.params.immed & 0x2) { + dst = mov_ir(dst, 1, FLAG_V, SZ_B); + } + if (inst->src.params.immed & 0x4) { + dst = mov_ir(dst, 1, FLAG_Z, SZ_B); + } + if (inst->src.params.immed & 0x8) { + dst = mov_ir(dst, 1, FLAG_N, SZ_B); + } + if (inst->src.params.immed & 0x10) { + dst = mov_irind(dst, 1, CONTEXT, SZ_B); + } + if (inst->op == M68K_ANDI_SR) { + dst = or_irdisp8(dst, inst->src.params.immed >> 8, CONTEXT, offsetof(m68k_context, status), SZ_B); + } + break; + /*case M68K_PEA: case M68K_RESET: case M68K_ROL: case M68K_ROR: |