From fd87961fdc6bc5c88d5de8a6e41a5364ea02d86e Mon Sep 17 00:00:00 2001 From: hap Date: Fri, 27 Oct 2017 19:59:52 +0200 Subject: [PATCH] eeprom: revert endian changes, uncomfortable that i have no means to test it on a big endian cpu (nw) --- src/devices/machine/eeprom.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/devices/machine/eeprom.cpp b/src/devices/machine/eeprom.cpp index 05f5fd04be9..6ce6c7a6caa 100644 --- a/src/devices/machine/eeprom.cpp +++ b/src/devices/machine/eeprom.cpp @@ -302,7 +302,7 @@ void eeprom_base_device::nvram_write(emu_file &file) uint32_t eeprom_base_device::internal_read(offs_t address) { if (m_data_bits == 16) - return reinterpret_cast(m_data.get())[address]; + return m_data[address * 2] | (m_data[address * 2 + 1] << 8); else return m_data[address]; } @@ -313,10 +313,12 @@ uint32_t eeprom_base_device::internal_read(offs_t address) // address //------------------------------------------------- -void eeprom_base_device::internal_write(offs_t address, uint32_t data) +void eeprom_base_device::internal_write(offs_t address, uint32_t data)x { if (m_data_bits == 16) - reinterpret_cast(m_data.get())[address] = data; - else + { + m_data[address * 2] = data; + m_data[address * 2 + 1] = data >> 8; + } else m_data[address] = data; }