all repos — mgba @ ec14557a1e90314c47b0642079e0408ec3153aa8

mGBA Game Boy Advance Emulator

ARM7: Make illegal instruction decoding consistent between ARM and Thumb
Jeffrey Pfau jeffrey@endrift.com
Sat, 09 May 2015 00:23:56 -0700
commit

ec14557a1e90314c47b0642079e0408ec3153aa8

parent

262e46b8a6a430e3cc104a58b8fffedb1afa186f

3 files changed, 14 insertions(+), 4 deletions(-)

jump to
M CHANGESCHANGES

@@ -48,6 +48,7 @@ - SDL: Allocate properly sized input maps

- ARM7: Handle writeback for PC in addressing modes 2 and 3 - GBA: Handle out-of-bounds I/O access - GBA: Fix bounds-checking on EEPROM access + - ARM7: Make illegal instruction decoding consistent between ARM and Thumb Misc: - Qt: Show multiplayer numbers in window title - Qt: Handle saving input settings better
M src/arm/decoder-arm.csrc/arm/decoder-arm.c

@@ -380,8 +380,12 @@ DEFINE_DECODER_ARM(MRC, ILL, info->operandFormat = ARM_OPERAND_NONE;)

// Begin miscellaneous definitions -DEFINE_DECODER_ARM(BKPT, BKPT, info->operandFormat = ARM_OPERAND_NONE;) // Not strictly in ARMv4T, but here for convenience -DEFINE_DECODER_ARM(ILL, ILL, info->operandFormat = ARM_OPERAND_NONE;) // Illegal opcode +DEFINE_DECODER_ARM(BKPT, BKPT, + info->operandFormat = ARM_OPERAND_NONE; + info->traps = 1;) // Not strictly in ARMv4T, but here for convenience +DEFINE_DECODER_ARM(ILL, ILL, + info->operandFormat = ARM_OPERAND_NONE; + info->traps = 1;) // Illegal opcode DEFINE_DECODER_ARM(MSR, MSR, info->affectsCPSR = 1;
M src/arm/decoder-thumb.csrc/arm/decoder-thumb.c

@@ -281,8 +281,13 @@ DEFINE_LOAD_STORE_MULTIPLE_EX_THUMB(POPR, ARM_SP, LDM, ARM_MEMORY_INCREMENT_AFTER, 1 << ARM_PC)

DEFINE_LOAD_STORE_MULTIPLE_EX_THUMB(PUSH, ARM_SP, STM, ARM_MEMORY_DECREMENT_BEFORE, 0) DEFINE_LOAD_STORE_MULTIPLE_EX_THUMB(PUSHR, ARM_SP, STM, ARM_MEMORY_DECREMENT_BEFORE, 1 << ARM_LR) -DEFINE_THUMB_DECODER(ILL, ILL, info->traps = 1;) -DEFINE_THUMB_DECODER(BKPT, BKPT, info->traps = 1;) +DEFINE_THUMB_DECODER(ILL, ILL, + info->operandFormat = ARM_OPERAND_NONE; + info->traps = 1;) + +DEFINE_THUMB_DECODER(BKPT, BKPT, + info->operandFormat = ARM_OPERAND_NONE; + info->traps = 1;) DEFINE_THUMB_DECODER(B, B, int16_t immediate = (opcode & 0x07FF) << 5;