summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatarGravatar Alex W. Jackson <alex.w.jackson@gmail.com>2014-12-03 10:37:33 -0500
committerGravatarGravatar Alex W. Jackson <alex.w.jackson@gmail.com>2014-12-03 10:37:33 -0500
commitb605395b0ecacb56848789858ddeff22e5bdace2 (patch) (github)
tree2202f43fdaf4bd2255568eb8200269d9965739fc
parent4476c481f4b0af46fb7d4012184451519b0dbe16 (diff)
downloadmame-b605395b0ecacb56848789858ddeff22e5bdace2.tar.bz2
mame-b605395b0ecacb56848789858ddeff22e5bdace2.zip
raiden2cop.c: Endian safety fix [Alex Jackson]
-rw-r--r--src/mame/machine/raiden2cop.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mame/machine/raiden2cop.c b/src/mame/machine/raiden2cop.c
index c9eebf52f4e..12cc4918257 100644
--- a/src/mame/machine/raiden2cop.c
+++ b/src/mame/machine/raiden2cop.c
@@ -1485,9 +1485,9 @@ void raiden2cop_device::LEGACY_execute_c480(address_space &space, int offset, UI
*/
void raiden2cop_device::LEGACY_execute_d104(address_space &space, int offset, UINT16 data)
{
- UINT8 *ROM = space.machine().root_device().memregion("maincpu")->base();
- UINT32 rom_addr = (m_cop_rom_addr_hi << 16 | m_cop_rom_addr_lo) & ~1;
- UINT16 rom_data = (ROM[rom_addr + 0]) | (ROM[rom_addr + 1] << 8);
+ UINT16 *ROM = (UINT16 *)space.machine().root_device().memregion("maincpu")->base();
+ UINT32 rom_addr = (m_cop_rom_addr_hi << 16 | m_cop_rom_addr_lo);
+ UINT16 rom_data = ROM[rom_addr / 2];
/* writes to some unemulated COP registers, then puts the result in here, adding a parameter taken from ROM */
//space.write_word(cop_regs[0]+(0x44 + offset * 4), rom_data);