From 3a61ed0a917ee3e41a62733af7433c7bde82794c Mon Sep 17 00:00:00 2001 From: StapleButter Date: Fri, 31 Mar 2017 02:20:29 +0200 Subject: allow crapoed THUMB hireg ADD/CMP/MOV --- src/ARMInterpreter_ALU.cpp | 3 +++ src/ARM_InstrTable.h | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/ARMInterpreter_ALU.cpp b/src/ARMInterpreter_ALU.cpp index d6c5abd..822bf49 100644 --- a/src/ARMInterpreter_ALU.cpp +++ b/src/ARMInterpreter_ALU.cpp @@ -1384,6 +1384,9 @@ void T_MVN_REG(ARM* cpu) } +// TODO: check those when MSBs and MSBd are cleared +// GBAtek says it's not allowed, but it works atleast on the ARM9 + void T_ADD_HIREG(ARM* cpu) { u32 rd = (cpu->CurInstr & 0x7) | ((cpu->CurInstr >> 4) & 0x8); diff --git a/src/ARM_InstrTable.h b/src/ARM_InstrTable.h index 830a2d0..47b3e1c 100644 --- a/src/ARM_InstrTable.h +++ b/src/ARM_InstrTable.h @@ -1692,9 +1692,9 @@ INSTRFUNC_PROTO(THUMBInstrTable[1024]) = T_ORR_REG, T_MUL_REG, T_BIC_REG, T_MVN_REG, // 0100 0100 00 - T_UNK, T_ADD_HIREG, T_ADD_HIREG, T_ADD_HIREG, - T_UNK, T_CMP_HIREG, T_CMP_HIREG, T_CMP_HIREG, - T_UNK, T_MOV_HIREG, T_MOV_HIREG, T_MOV_HIREG, + T_ADD_HIREG, T_ADD_HIREG, T_ADD_HIREG, T_ADD_HIREG, + T_CMP_HIREG, T_CMP_HIREG, T_CMP_HIREG, T_CMP_HIREG, + T_MOV_HIREG, T_MOV_HIREG, T_MOV_HIREG, T_MOV_HIREG, T_BX, T_BX, T_BLX_REG, T_BLX_REG, // 0100 1000 00 -- cgit v1.2.3