diff options
author | 2017-12-13 21:01:10 -0700 | |
---|---|---|
committer | 2017-12-13 21:01:10 -0700 | |
commit | 54155441e9ba9941e85d80c4834a66376a11e791 (patch) | |
tree | aa44bdaf0035cbe188d64c447f225f10f7d76d8d /src/emu/dirom.cpp | |
parent | f537428e5a40ba6dde8ca9bf0fe9ae6b1f189ac4 (diff) |
Revert "Merge branch 'master' of https://github.com/mamedev/mame"
This reverts commit f537428e5a40ba6dde8ca9bf0fe9ae6b1f189ac4, reversing
changes made to 0d70d798107d4e4e8fb9f230410aeb1e888d65c5.
Diffstat (limited to 'src/emu/dirom.cpp')
-rw-r--r-- | src/emu/dirom.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/emu/dirom.cpp b/src/emu/dirom.cpp index 87461926cf6..3a0ed23692f 100644 --- a/src/emu/dirom.cpp +++ b/src/emu/dirom.cpp @@ -4,9 +4,7 @@ device_rom_interface::device_rom_interface(const machine_config &mconfig, device_t &device, u8 addrwidth, endianness_t endian, u8 datawidth) : device_memory_interface(mconfig, device), m_rom_tag(device.basetag()), - m_rom_config("rom", endian, datawidth, addrwidth), - m_bank(nullptr), - m_cur_bank(-1) + m_rom_config("rom", endian, datawidth, addrwidth) { } @@ -44,14 +42,12 @@ void device_rom_interface::set_rom_bank(int bank) bank = bank % m_bank_count; } - if (m_cur_bank != bank) { - m_cur_bank = bank; - m_bank->set_entry(bank); - rom_bank_updated(); - } + m_cur_bank = bank; + m_bank->set_entry(bank); + rom_bank_updated(); } -void device_rom_interface::interface_post_load() +void device_rom_interface::reset_bank() { if(m_bank) m_bank->set_entry(m_cur_bank); @@ -89,12 +85,12 @@ void device_rom_interface::set_rom(const void *base, u32 size) void device_rom_interface::interface_pre_start() { - if(!has_space(0)) - return; - m_rom_direct = space().direct<0>(); + m_bank = nullptr; + m_cur_bank = -1; device().save_item(NAME(m_cur_bank)); device().save_item(NAME(m_bank_count)); + device().machine().save().register_postload(save_prepost_delegate(FUNC(device_rom_interface::reset_bank), this)); if(!has_configured_map(0)) { memory_region *reg = device().owner()->memregion(m_rom_tag); |