mirror of https://github.com/mgba-emu/mgba.git
ARM7: Clean up instruction decoding for future expandability
This commit is contained in:
parent
1a42ed2b37
commit
b1b5cf8a11
1
CHANGES
1
CHANGES
|
@ -46,6 +46,7 @@ Misc:
|
|||
- 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:
|
||||
|
|
|
@ -437,18 +437,12 @@ static const ARMDecoder _armDecoderTable[0x1000] = {
|
|||
};
|
||||
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -299,18 +299,12 @@ static const ThumbDecoder _thumbDecoderTable[0x400] = {
|
|||
};
|
||||
|
||||
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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue