all repos — mgba @ b1b5cf8a11d8f19753312b554abc8752708a7347

mGBA Game Boy Advance Emulator

ARM7: Clean up instruction decoding for future expandability
Jeffrey Pfau jeffrey@endrift.com
Mon, 06 Jun 2016 21:26:02 -0700
commit

b1b5cf8a11d8f19753312b554abc8752708a7347

parent

1a42ed2b372c2f7a8a7e84778f67099f40881784

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

jump to
M CHANGESCHANGES

@@ -46,6 +46,7 @@ - ARM7: Flush prefetch cache when loading CPSR via MSR

- Qt: Canonicalize file paths when loading games - OpenGL: Add texSize uniform - Qt: Add refresh button to controller editing + - ARM7: Clean up instruction decoding for future expandability 0.4.0: (2016-02-02) Features:
M src/arm/decoder-arm.csrc/arm/decoder-arm.c

@@ -437,18 +437,12 @@ DECLARE_ARM_EMITTER_BLOCK(_ARMDecode)

}; void ARMDecodeARM(uint32_t opcode, struct ARMInstructionInfo* info) { + memset(info, 0, sizeof(*info)); info->execMode = MODE_ARM; info->opcode = opcode; info->branchType = ARM_BRANCH_NONE; - info->traps = 0; - info->affectsCPSR = 0; info->condition = opcode >> 28; - info->sDataCycles = 0; - info->nDataCycles = 0; info->sInstructionCycles = 1; - info->nInstructionCycles = 0; - info->iCycles = 0; - info->cCycles = 0; ARMDecoder decoder = _armDecoderTable[((opcode >> 16) & 0xFF0) | ((opcode >> 4) & 0x00F)]; decoder(opcode, info); }
M src/arm/decoder-thumb.csrc/arm/decoder-thumb.c

@@ -299,18 +299,12 @@ DECLARE_THUMB_EMITTER_BLOCK(_ThumbDecode)

}; void ARMDecodeThumb(uint16_t opcode, struct ARMInstructionInfo* info) { + memset(info, 0, sizeof(*info)); info->execMode = MODE_THUMB; info->opcode = opcode; info->branchType = ARM_BRANCH_NONE; - info->traps = 0; - info->affectsCPSR = 0; info->condition = ARM_CONDITION_AL; - info->sDataCycles = 0; - info->nDataCycles = 0; info->sInstructionCycles = 1; - info->nInstructionCycles = 0; - info->iCycles = 0; - info->cCycles = 0; ThumbDecoder decoder = _thumbDecoderTable[opcode >> 6]; decoder(opcode, info); }