summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Wilbert Pol <wilbert@jdg.info>2010-07-24 18:44:30 +0000
committer Wilbert Pol <wilbert@jdg.info>2010-07-24 18:44:30 +0000
commit73de5b8070fdd012271d040d172782a13dc18a82 (patch)
tree91a165858ff7857846f77c037fd3881984e98218
parent2ea263bde2cb6bd52cc474d7db3e0a2ee6a66909 (diff)
arm.c: Fixed word reading from non-aligned address in big endian mode. [Wilbert Pol]
-rw-r--r--src/emu/cpu/arm/arm.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/emu/cpu/arm/arm.c b/src/emu/cpu/arm/arm.c
index b197ac73f7a..385f5feb587 100644
--- a/src/emu/cpu/arm/arm.c
+++ b/src/emu/cpu/arm/arm.c
@@ -619,7 +619,16 @@ static void HandleMemSingle( ARM_REGS* cpustate, UINT32 insn )
}
else
{
- SetRegister(cpustate, rd,READ32(rnv));
+ UINT32 data = READ32(rnv);
+
+ if ( cpustate->endian == ENDIANNESS_BIG )
+ {
+ if ( rnv & 0x02 )
+ data = ( data >> 16 ) | ( data << 16 );
+ if ( rnv & 0x01 )
+ data = ( data >> 24 ) | ( data << 8 );
+ }
+ SetRegister(cpustate, rd, data);
}
}
}