1185 to bgklink

git-svn-id: https://svn.code.sf.net/p/vbam/code/branches/bgk-link@1186 a31d4220-a93d-0410-bf67-fe4944624d44
This commit is contained in:
squall-leonhart 2013-03-30 06:15:04 +00:00
parent 0fd97d915f
commit 6b18cf174f
2 changed files with 26 additions and 12 deletions

View File

@ -2698,7 +2698,7 @@ static insnfunc_t armInsnTable[4096] = {
arm0D0,arm0D1,arm0D2,arm0D3,arm0D4,arm0D5,arm0D6,arm0D7, // 0D0
arm0D0,arm0D9,arm0D2,arm0DB,arm0D4,arm0DD,arm0D6,arm0DF, // 0D8
arm0E0,arm0E1,arm0E2,arm0E3,arm0E4,arm0E5,arm0E6,arm0E7, // 0E0
arm0E0,arm0E9,arm0E2,arm_UI,arm0E4,arm_UI,arm0E6,arm_UI, // 0E8
arm0E0,arm0E9,arm0E2,arm0CB,arm0E4,arm_UI,arm0E6,arm_UI, // 0E8
arm0F0,arm0F1,arm0F2,arm0F3,arm0F4,arm0F5,arm0F6,arm0F7, // 0F0
arm0F0,arm0F9,arm0F2,arm_UI,arm0F4,arm0DD,arm0F6,arm0DF, // 0F8

View File

@ -284,9 +284,10 @@ unreadable:
value = cpuDmaLast & 0xFFFF;
} else {
if(armState) {
value = CPUReadHalfWordQuick(reg[15].I + (address & 2));
value = CPUReadMemoryQuick(reg[15].I);
} else {
value = CPUReadHalfWordQuick(reg[15].I);
value = CPUReadHalfWordQuick(reg[15].I) |
CPUReadHalfWordQuick(reg[15].I) << 16;
}
}
return value;
@ -307,9 +308,21 @@ unreadable:
static inline u16 CPUReadHalfWordSigned(u32 address)
{
u32 oldAddress = address;
if(address & 1) {
address &= ~0x01;
}
u16 value = CPUReadHalfWord(address);
if((address & 1))
if((oldAddress & 1))
{
value = (s8)value;
#ifdef GBA_LOGGING
if(systemVerbose & VERBOSE_UNALIGNED_MEMORY) {
log("Unaligned signed halfword read from: %08x at %08x (%08x)\n", oldAddress, armMode ?
armNextPC - 4 : armNextPC - 2, value);
}
#endif
}
return value;
}
@ -386,9 +399,10 @@ unreadable:
return cpuDmaLast & 0xFF;
} else {
if(armState) {
return CPUReadByteQuick(reg[15].I+(address & 3));
return CPUReadMemoryQuick(reg[15].I);
} else {
return CPUReadByteQuick(reg[15].I+(address & 1));
return CPUReadHalfWordQuick(reg[15].I) |
CPUReadHalfWordQuick(reg[15].I) << 16;
}
}
break;