From ffebf4a1a2db04a6db391ae42ca33ce6e0fe1f81 Mon Sep 17 00:00:00 2001 From: Andrei Holub Date: Sun, 26 Jan 2025 09:33:25 -0500 Subject: [PATCH] tsconf: zxbus tidy --- src/mame/sinclair/tsconf.cpp | 16 +++++----------- src/mame/sinclair/tsconf.h | 1 - src/mame/sinclair/tsconf_m.cpp | 6 +----- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/src/mame/sinclair/tsconf.cpp b/src/mame/sinclair/tsconf.cpp index 7ee1fd81138..40e410d965a 100644 --- a/src/mame/sinclair/tsconf.cpp +++ b/src/mame/sinclair/tsconf.cpp @@ -79,13 +79,6 @@ void tsconf_state::tsconf_mem(address_map &map) } void tsconf_state::tsconf_io(address_map &map) -{ - map(0x0000, 0xffff).lrw8( - NAME([this](offs_t offset) { return m_ioext.read_byte((m_beta->dos_io_r() << 16) | offset); }), - NAME([this](offs_t offset, u8 data) { m_ioext.write_byte((m_beta->dos_io_r() << 16) | offset, data); })); -} - -void tsconf_state::tsconf_ioext(address_map &map) { map.unmap_value_high(); map(0x0000, 0x0000).mirror(0x7ffd).w(FUNC(tsconf_state::tsconf_port_7ffd_w)); @@ -104,9 +97,12 @@ void tsconf_state::tsconf_ioext(address_map &map) map(0xc0fd, 0xc0fd).mirror(0x3f00).lr8(NAME([this]() { return m_ay[m_ay_selected]->data_r(); })) .w(FUNC(tsconf_state::tsconf_ay_address_w)); - // IO: Shadow map(0x0000, 0xffff).view(m_io_shadow_view); - m_io_shadow_view[0](0x0000, 0xffff).m(m_beta, FUNC(tsconf_beta_device::tsconf_beta_io)); + m_io_shadow_view[0]; // !Shadow + + // IO: Shadow + m_io_shadow_view[1](0x0000, 0xffff).m(m_beta, FUNC(tsconf_beta_device::tsconf_beta_io)); + subdevice("zxbus")->set_io_space(m_io_shadow_view[0], m_io_shadow_view[1]); } void tsconf_state::tsconf_switch(address_map &map) @@ -177,7 +173,6 @@ void tsconf_state::machine_start() { spectrum_128_state::machine_start(); m_maincpu->space(AS_PROGRAM).specific(m_program); - m_bankio->space(AS_PROGRAM).specific(m_ioext); // reconfigure ROMs memory_region *rom = memregion("maincpu"); @@ -287,7 +282,6 @@ void tsconf_state::tsconf(machine_config &config) m_maincpu->set_vblank_int("screen", FUNC(tsconf_state::tsconf_vblank_interrupt)); - ADDRESS_MAP_BANK(config, m_bankio).set_map(&tsconf_state::tsconf_ioext).set_options(ENDIANNESS_LITTLE, 8, 17, 0); zxbus_device &zxbus(ZXBUS(config, "zxbus", 0)); ZXBUS_SLOT(config, "zxbus1", 0, zxbus, zxbus_cards, nullptr); //ZXBUS_SLOT(config, "zxbus2", 0, zxbus, zxbus_cards, nullptr); diff --git a/src/mame/sinclair/tsconf.h b/src/mame/sinclair/tsconf.h index b1acd78d308..db968afb68e 100644 --- a/src/mame/sinclair/tsconf.h +++ b/src/mame/sinclair/tsconf.h @@ -200,7 +200,6 @@ private: u8 beta_disable_r(offs_t offset); void tsconf_io(address_map &map) ATTR_COLD; - void tsconf_ioext(address_map &map) ATTR_COLD; void tsconf_mem(address_map &map) ATTR_COLD; void tsconf_switch(address_map &map) ATTR_COLD; diff --git a/src/mame/sinclair/tsconf_m.cpp b/src/mame/sinclair/tsconf_m.cpp index c7245423821..da6e87c3b2a 100644 --- a/src/mame/sinclair/tsconf_m.cpp +++ b/src/mame/sinclair/tsconf_m.cpp @@ -73,11 +73,7 @@ void tsconf_state::tsconf_update_bank0() void tsconf_state::update_io(int dos) { - if (dos) - m_io_shadow_view.select(0); - else - m_io_shadow_view.disable(); - + m_io_shadow_view.select(dos ? 1 : 0); tsconf_update_bank0(); }