From fb12a1b3581f8d45ef2a8f8585b2f3786dc92e3b Mon Sep 17 00:00:00 2001 From: Olivier Galibert Date: Thu, 10 Dec 2020 14:01:33 +0100 Subject: [PATCH] xybots: modernize slapstic hookup --- src/mame/drivers/gauntlet.cpp | 2 +- src/mame/drivers/xybots.cpp | 23 ++++++++++++++--------- src/mame/includes/xybots.h | 5 ++++- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/src/mame/drivers/gauntlet.cpp b/src/mame/drivers/gauntlet.cpp index f72195e3ddf..bb9d39be089 100644 --- a/src/mame/drivers/gauntlet.cpp +++ b/src/mame/drivers/gauntlet.cpp @@ -259,7 +259,7 @@ void gauntlet_state::main_map(address_map &map) { map.unmap_value_high(); map(0x000000, 0x037fff).mirror(0x280000).rom(); - map(0x038000, 0x03ffff).mirror(0x280000).bankr(m_slapstic_bank); // slapstic maps here + map(0x038000, 0x039fff).mirror(0x286000).bankr(m_slapstic_bank); // slapstic maps here map(0x040000, 0x07ffff).mirror(0x280000).rom(); // MBUS diff --git a/src/mame/drivers/xybots.cpp b/src/mame/drivers/xybots.cpp index 02c5d0a81a4..dfd8312fa83 100644 --- a/src/mame/drivers/xybots.cpp +++ b/src/mame/drivers/xybots.cpp @@ -69,7 +69,7 @@ void xybots_state::main_map(address_map &map) { map.unmap_value_high(); map(0x000000, 0x007fff).mirror(0x7c0000).rom(); - map(0x008000, 0x00ffff).mirror(0x7c0000).rom(); /* slapstic maps here */ + map(0x008000, 0x009fff).mirror(0x7c6000).bankr(m_slapstic_bank); /* slapstic maps here */ map(0x010000, 0x03ffff).mirror(0x7c0000).rom(); map(0x800000, 0x800fff).mirror(0x7f8000).ram().w(m_alpha_tilemap, FUNC(tilemap_device::write16)).share("alpha"); map(0x801000, 0x802dff).mirror(0x7f8000).ram(); @@ -181,7 +181,8 @@ void xybots_state::xybots(machine_config &config) M68000(config, m_maincpu, 14.318181_MHz_XTAL/2); m_maincpu->set_addrmap(AS_PROGRAM, &xybots_state::main_map); - SLAPSTIC(config, "slapstic", 107, true); + SLAPSTIC(config, m_slapstic, 107, true); + m_slapstic->set_bank(m_slapstic_bank); EEPROM_2804(config, "eeprom").lock_after_write(true); @@ -384,10 +385,14 @@ ROM_END * *************************************/ -void xybots_state::init_xybots() +void xybots_state::machine_start() { + m_slapstic_bank->configure_entries(0, 4, memregion("maincpu")->base() + 0x8000, 0x2000); + m_maincpu->space(AS_PROGRAM).install_readwrite_tap(0x8000, 0xffff, 0x7c0000, "slapstic", + [this](offs_t offset, u16 &data, u16 mem_mask) { m_slapstic->tweak(m_maincpu->space(), offset >> 1); }, + [this](offs_t offset, u16 &data, u16 mem_mask) { m_slapstic->tweak(m_maincpu->space(), offset >> 1); }); + m_h256 = 0x0400; - m_slapstic->legacy_configure(*m_maincpu, 0x008000, 0, memregion("maincpu")->base() + 0x8000); } @@ -398,8 +403,8 @@ void xybots_state::init_xybots() * *************************************/ -GAME( 1987, xybots, 0, xybots, xybots, xybots_state, init_xybots, ROT0, "Atari Games", "Xybots (rev 2)", 0 ) -GAME( 1987, xybotsg, xybots, xybots, xybots, xybots_state, init_xybots, ROT0, "Atari Games", "Xybots (German, rev 3)", 0 ) -GAME( 1987, xybotsf, xybots, xybots, xybots, xybots_state, init_xybots, ROT0, "Atari Games", "Xybots (French, rev 3)", 0 ) -GAME( 1987, xybots1, xybots, xybots, xybots, xybots_state, init_xybots, ROT0, "Atari Games", "Xybots (rev 1)", 0 ) -GAME( 1987, xybots0, xybots, xybots, xybots, xybots_state, init_xybots, ROT0, "Atari Games", "Xybots (rev 0)", 0 ) +GAME( 1987, xybots, 0, xybots, xybots, xybots_state, empty_init, ROT0, "Atari Games", "Xybots (rev 2)", 0 ) +GAME( 1987, xybotsg, xybots, xybots, xybots, xybots_state, empty_init, ROT0, "Atari Games", "Xybots (German, rev 3)", 0 ) +GAME( 1987, xybotsf, xybots, xybots, xybots, xybots_state, empty_init, ROT0, "Atari Games", "Xybots (French, rev 3)", 0 ) +GAME( 1987, xybots1, xybots, xybots, xybots, xybots_state, empty_init, ROT0, "Atari Games", "Xybots (rev 1)", 0 ) +GAME( 1987, xybots0, xybots, xybots, xybots, xybots_state, empty_init, ROT0, "Atari Games", "Xybots (rev 0)", 0 ) diff --git a/src/mame/includes/xybots.h b/src/mame/includes/xybots.h index b8520f4eba3..64e6d10eca6 100644 --- a/src/mame/includes/xybots.h +++ b/src/mame/includes/xybots.h @@ -23,6 +23,7 @@ public: driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_slapstic(*this, "slapstic"), + m_slapstic_bank(*this, "slapstic_bank"), m_jsa(*this, "jsa"), m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), @@ -33,7 +34,8 @@ public: void xybots(machine_config &config); - void init_xybots(); +protected: + virtual void machine_start() override; private: void video_int_ack_w(uint16_t data = 0); @@ -45,6 +47,7 @@ private: required_device m_maincpu; required_device m_slapstic; + required_memory_bank m_slapstic_bank; required_device m_jsa; required_device m_gfxdecode; required_device m_screen;