diff options
Diffstat (limited to 'src/devices/bus/msx_slot/ram.cpp')
-rw-r--r-- | src/devices/bus/msx_slot/ram.cpp | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/src/devices/bus/msx_slot/ram.cpp b/src/devices/bus/msx_slot/ram.cpp index 835a5551b92..92f9a57929d 100644 --- a/src/devices/bus/msx_slot/ram.cpp +++ b/src/devices/bus/msx_slot/ram.cpp @@ -6,7 +6,7 @@ DEFINE_DEVICE_TYPE(MSX_SLOT_RAM, msx_slot_ram_device, "msx_slot_ram", "MSX Internal RAM") -msx_slot_ram_device::msx_slot_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +msx_slot_ram_device::msx_slot_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, MSX_SLOT_RAM, tag, owner, clock) , msx_internal_slot_interface(mconfig, *this) { @@ -16,21 +16,13 @@ void msx_slot_ram_device::device_start() { m_ram.resize(m_size); save_item(NAME(m_ram)); -} -uint8_t msx_slot_ram_device::read(offs_t offset) -{ - if ( offset >= m_start_address && offset < m_end_address ) - { - return m_ram[ offset - m_start_address ]; - } - return 0xFF; -} - -void msx_slot_ram_device::write(offs_t offset, uint8_t data) -{ - if ( offset >= m_start_address && offset < m_end_address ) + u8 *ram = m_ram.data(); + u32 start_address = m_start_address; + for (int i = m_start_address >> 14; i < 4 && i * 0x4000 < m_end_address; i++) { - m_ram[offset - m_start_address] = data; + page(i)->install_ram(start_address, std::min<u32>((i + 1) * 0x4000, m_end_address) - 1, ram); + start_address += 0x4000; + ram += 0x4000; } } |