Fix yet another oversight in the unaligned read code.

Implemented missing thumb opcode (Which is invalid according to gbatek but Moto GP seems to use it)
This commit is contained in:
normmatt234 2013-03-28 16:24:14 +00:00
parent 1ff3ce6378
commit cf4e7eb148
2 changed files with 8 additions and 3 deletions

View File

@ -1417,6 +1417,12 @@ static INSN_REGPARM void thumb45_3(u32 opcode)
CMP_RD_RS;
}
// MOV Rd, Rs
static INSN_REGPARM void thumb46_0(u32 opcode)
{
reg[opcode&7].I = reg[((opcode>>3)&7)].I;
}
// MOV Rd, Hs
static INSN_REGPARM void thumb46_1(u32 opcode)
{
@ -2185,7 +2191,7 @@ static insnfunc_t thumbInsnTable[1024] = {
thumb40_0,thumb40_1,thumb40_2,thumb40_3,thumb41_0,thumb41_1,thumb41_2,thumb41_3, // 40
thumb42_0,thumb42_1,thumb42_2,thumb42_3,thumb43_0,thumb43_1,thumb43_2,thumb43_3,
thumbUI,thumb44_1,thumb44_2,thumb44_3,thumbUI,thumb45_1,thumb45_2,thumb45_3,
thumbUI,thumb46_1,thumb46_2,thumb46_3,thumb47,thumb47,thumbUI,thumbUI,
thumb46_0,thumb46_1,thumb46_2,thumb46_3,thumb47,thumb47,thumbUI,thumbUI,
thumb48,thumb48,thumb48,thumb48,thumb48,thumb48,thumb48,thumb48, // 48
thumb48,thumb48,thumb48,thumb48,thumb48,thumb48,thumb48,thumb48,
thumb48,thumb48,thumb48,thumb48,thumb48,thumb48,thumb48,thumb48,

View File

@ -149,9 +149,8 @@ unreadable:
break;
}
if(address & 3) {
if(oldAddress & 3) {
#ifdef C_CORE
int shift = (address & 3) << 3;
value = (value >> shift) | (value << (32 - shift));
#else
#ifdef __GNUC__