diff options
author | 2017-10-27 19:59:52 +0200 | |
---|---|---|
committer | 2017-10-27 20:00:02 +0200 | |
commit | fd87961fdc6bc5c88d5de8a6e41a5364ea02d86e (patch) | |
tree | 0e092600408ca9273a41d40de21c03ff7cc93090 | |
parent | 218c8ce829dfe14d91736f034bdc6800e25ff6e3 (diff) |
eeprom: revert endian changes, uncomfortable that i have no means to test it on a big endian cpu (nw)
-rw-r--r-- | src/devices/machine/eeprom.cpp | 10 |
1 files 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<u16 *>(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<u16 *>(m_data.get())[address] = data; - else + { + m_data[address * 2] = data; + m_data[address * 2 + 1] = data >> 8; + } else m_data[address] = data; } |