From cfe00b09cb933ea36bbca2caf02b27102705a393 Mon Sep 17 00:00:00 2001 From: AJR Date: Thu, 11 Jun 2020 11:27:47 -0400 Subject: slapstic: Eliminate address_space argument from legacy read/write handlers (nw) --- src/mame/machine/slapstic.cpp | 13 +++++++------ src/mame/machine/slapstic.h | 5 +++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/mame/machine/slapstic.cpp b/src/mame/machine/slapstic.cpp index f9ea5c6a743..756dbd476ea 100644 --- a/src/mame/machine/slapstic.cpp +++ b/src/mame/machine/slapstic.cpp @@ -210,6 +210,7 @@ atari_slapstic_device::atari_slapstic_device(const machine_config &mconfig, cons add_bank(0), bit_xor(0), m_legacy_configured(false), + m_legacy_space(nullptr), m_legacy_memptr(nullptr), m_legacy_bank(0) { @@ -1189,8 +1190,8 @@ void atari_slapstic_device::legacy_configure(cpu_device &device, offs_t base, of save_item(NAME(m_legacy_bank)); // install the memory handlers - address_space &program = device.space(AS_PROGRAM); - program.install_readwrite_handler(base, base + 0x7fff, 0, mirror, 0, read16_delegate(*this, FUNC(atari_slapstic_device::slapstic_r)), write16_delegate(*this, FUNC(atari_slapstic_device::slapstic_w))); + m_legacy_space = &device.space(AS_PROGRAM); + m_legacy_space->install_readwrite_handler(base, base + 0x7fff, 0, mirror, 0, read16s_delegate(*this, FUNC(atari_slapstic_device::slapstic_r)), write16s_delegate(*this, FUNC(atari_slapstic_device::slapstic_w))); m_legacy_memptr = (u16 *)mem; // allocate memory for a copy of bank 0 @@ -1208,11 +1209,11 @@ void atari_slapstic_device::legacy_configure(cpu_device &device, offs_t base, of // address and do nothing more. //------------------------------------------------- -void atari_slapstic_device::slapstic_w(address_space &space, offs_t offset, u16 data, u16 mem_mask) +void atari_slapstic_device::slapstic_w(offs_t offset, u16 data, u16 mem_mask) { assert(m_legacy_configured); - legacy_update_bank(slapstic_tweak(space, offset)); + legacy_update_bank(slapstic_tweak(*m_legacy_space, offset)); } @@ -1221,7 +1222,7 @@ void atari_slapstic_device::slapstic_w(address_space &space, offs_t offset, u16 // address and then reads a word from the underlying memory. //------------------------------------------------- -u16 atari_slapstic_device::slapstic_r(address_space &space, offs_t offset, u16 mem_mask) +u16 atari_slapstic_device::slapstic_r(offs_t offset, u16 mem_mask) { assert(m_legacy_configured); @@ -1231,7 +1232,7 @@ u16 atari_slapstic_device::slapstic_r(address_space &space, offs_t offset, u16 m if (!machine().side_effects_disabled()) { // then determine the new one - legacy_update_bank(slapstic_tweak(space, offset)); + legacy_update_bank(slapstic_tweak(*m_legacy_space, offset)); } return result; } diff --git a/src/mame/machine/slapstic.h b/src/mame/machine/slapstic.h index 20d5c78dfe0..33a12ba72f7 100644 --- a/src/mame/machine/slapstic.h +++ b/src/mame/machine/slapstic.h @@ -159,10 +159,11 @@ protected: private: // legacy helpers void legacy_update_bank(int bank); - void slapstic_w(address_space &space, offs_t offset, u16 data, u16 mem_mask); - uint16_t slapstic_r(address_space &space, offs_t offset, u16 mem_mask); + void slapstic_w(offs_t offset, u16 data, u16 mem_mask); + uint16_t slapstic_r(offs_t offset, u16 mem_mask); bool m_legacy_configured; + address_space * m_legacy_space; u16 * m_legacy_memptr; u8 m_legacy_bank; std::vector m_legacy_bank0; -- cgit v1.2.3