diff --git a/src/mame/drivers/vendetta.cpp b/src/mame/drivers/vendetta.cpp index 2b53766ad76..f0cef5a9cb5 100644 --- a/src/mame/drivers/vendetta.cpp +++ b/src/mame/drivers/vendetta.cpp @@ -125,8 +125,8 @@ void vendetta_state::eeprom_w(uint8_t data) m_irq_enabled = (data >> 6) & 1; - m_videobank0->set_bank(BIT(data, 0)); - m_videobank1->set_bank(BIT(data, 0)); + m_videoview0.select(BIT(data, 0)); + m_videoview1.select(BIT(data, 0)); } /********************************************/ @@ -205,7 +205,9 @@ void vendetta_state::main_map(address_map &map) /* what is the desired effect of overlapping these memory regions anyway? */ map(0x4000, 0x7fff).rw(m_k052109, FUNC(k052109_device::read), FUNC(k052109_device::write)); - map(0x4000, 0x4fff).m(m_videobank0, FUNC(address_map_bank_device::amap8)); + map(0x4000, 0x4fff).view(m_videoview0); + m_videoview0[0](0x4000, 0x4fff).rw(m_k052109, FUNC(k052109_device::read), FUNC(k052109_device::write)); + m_videoview0[1](0x4000, 0x4fff).rw(m_k053246, FUNC(k053247_device::k053247_r), FUNC(k053247_device::k053247_w)); map(0x5f80, 0x5f9f).rw(m_k054000, FUNC(k054000_device::read), FUNC(k054000_device::write)); map(0x5fa0, 0x5faf).w(m_k053251, FUNC(k053251_device::write)); map(0x5fb0, 0x5fb7).w(m_k053246, FUNC(k053247_device::k053246_w)); @@ -221,8 +223,9 @@ void vendetta_state::main_map(address_map &map) map(0x5fe6, 0x5fe7).rw("k053260", FUNC(k053260_device::main_read), FUNC(k053260_device::main_write)); map(0x5fe8, 0x5fe9).r(m_k053246, FUNC(k053247_device::k053246_r)); map(0x5fea, 0x5fea).r("watchdog", FUNC(watchdog_timer_device::reset_r)); - map(0x6000, 0x6fff).m(m_videobank1, FUNC(address_map_bank_device::amap8)); - + map(0x6000, 0x6fff).view(m_videoview1); + m_videoview1[0](0x6000, 0x6fff).rw(FUNC(vendetta_state::K052109_r), FUNC(vendetta_state::K052109_w)); + m_videoview1[1](0x6000, 0x6fff).ram().w(m_palette, FUNC(palette_device::write8)).share("palette"); map(0x8000, 0xffff).rom().region("maincpu", 0x38000); } @@ -232,7 +235,9 @@ void vendetta_state::esckids_map(address_map &map) /* what is the desired effect of overlapping these memory regions anyway? */ map(0x2000, 0x5fff).rw(m_k052109, FUNC(k052109_device::read), FUNC(k052109_device::write)); // 052109 (Tilemap) - map(0x2000, 0x2fff).m(m_videobank0, FUNC(address_map_bank_device::amap8)); // 052109 (Tilemap) 0x0000-0x0fff - 052109 (Tilemap) + map(0x2000, 0x2fff).view(m_videoview0); // 052109 (Tilemap) 0x0000-0x0fff - 052109 (Tilemap) + m_videoview0[0](0x2000, 0x2fff).rw(m_k052109, FUNC(k052109_device::read), FUNC(k052109_device::write)); + m_videoview0[1](0x2000, 0x2fff).rw(m_k053246, FUNC(k053247_device::k053247_r), FUNC(k053247_device::k053247_w)); map(0x3f80, 0x3f80).portr("P1"); map(0x3f81, 0x3f81).portr("P2"); map(0x3f82, 0x3f82).portr("P3"); // ??? (But not used) @@ -248,23 +253,13 @@ void vendetta_state::esckids_map(address_map &map) map(0x3fd6, 0x3fd7).rw("k053260", FUNC(k053260_device::main_read), FUNC(k053260_device::main_write)); // Sound map(0x3fd8, 0x3fd9).r(m_k053246, FUNC(k053247_device::k053246_r)); // 053246 (Sprite) map(0x3fda, 0x3fda).nopw(); // Not Emulated (Watchdog ???) - map(0x4000, 0x4fff).m(m_videobank1, FUNC(address_map_bank_device::amap8)); // 0x2000-0x3fff, Tilemap mask ROM bank selector (mask ROM Test) + map(0x4000, 0x4fff).view(m_videoview1); // Tilemap mask ROM bank selector (mask ROM Test) + m_videoview1[0](0x4000, 0x4fff).rw(FUNC(vendetta_state::K052109_r), FUNC(vendetta_state::K052109_w)); + m_videoview1[1](0x4000, 0x4fff).ram().w(m_palette, FUNC(palette_device::write8)).share("palette"); map(0x6000, 0x7fff).bankr("bank1"); // 053248 '975r01' 1M ROM (Banked) map(0x8000, 0xffff).rom().region("maincpu", 0x18000); // 053248 '975r01' 1M ROM (0x18000-0x1ffff) } -void vendetta_state::videobank0_map(address_map &map) -{ - map(0x0000, 0x0fff).rw(m_k052109, FUNC(k052109_device::read), FUNC(k052109_device::write)); - map(0x1000, 0x1fff).rw(m_k053246, FUNC(k053247_device::k053247_r), FUNC(k053247_device::k053247_w)); -} - -void vendetta_state::videobank1_map(address_map &map) -{ - map(0x0000, 0x0fff).rw(FUNC(vendetta_state::K052109_r), FUNC(vendetta_state::K052109_w)); - map(0x1000, 0x1fff).ram().w(m_palette, FUNC(palette_device::write8)).share("palette"); -} - void vendetta_state::sound_map(address_map &map) { map(0x0000, 0xefff).rom(); @@ -433,9 +428,6 @@ void vendetta_state::vendetta(machine_config &config) m_maincpu->set_vblank_int("screen", FUNC(vendetta_state::irq)); m_maincpu->line().set(FUNC(vendetta_state::banking_callback)); - ADDRESS_MAP_BANK(config, "videobank0").set_map(&vendetta_state::videobank0_map).set_options(ENDIANNESS_BIG, 8, 13, 0x1000); - ADDRESS_MAP_BANK(config, "videobank1").set_map(&vendetta_state::videobank1_map).set_options(ENDIANNESS_BIG, 8, 13, 0x1000); - Z80(config, m_audiocpu, XTAL(3'579'545)); /* verified with PCB */ m_audiocpu->set_addrmap(AS_PROGRAM, &vendetta_state::sound_map); /* interrupts are triggered by the main CPU */ diff --git a/src/mame/includes/vendetta.h b/src/mame/includes/vendetta.h index 37769235820..78e8d11bccd 100644 --- a/src/mame/includes/vendetta.h +++ b/src/mame/includes/vendetta.h @@ -11,7 +11,6 @@ #pragma once #include "cpu/m6809/konami.h" // for the callback and the firq irq definition -#include "machine/bankdev.h" #include "machine/k053252.h" #include "video/k052109.h" #include "video/k053246_k053247_k055673.h" @@ -33,13 +32,18 @@ public: m_k053252(*this, "k053252"), m_k054000(*this, "k054000"), m_palette(*this, "palette"), - m_videobank0(*this, "videobank0"), - m_videobank1(*this, "videobank1") + m_videoview0(*this, "videoview0"), + m_videoview1(*this, "videoview1") { } void esckids(machine_config &config); void vendetta(machine_config &config); +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + private: enum { @@ -64,8 +68,9 @@ private: optional_device m_k054000; required_device m_palette; - required_device m_videobank0; - required_device m_videobank1; + // views + memory_view m_videoview0; + memory_view m_videoview1; void eeprom_w(uint8_t data); uint8_t K052109_r(offs_t offset); @@ -75,9 +80,6 @@ private: void z80_irq_w(uint8_t data); uint8_t z80_irq_r(); - virtual void machine_start() override; - virtual void machine_reset() override; - uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(irq); @@ -90,10 +92,6 @@ private: void esckids_map(address_map &map); void main_map(address_map &map); void sound_map(address_map &map); - void videobank0_map(address_map &map); - void videobank1_map(address_map &map); - - virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; }; #endif // MAME_INCLUDES_VENDETTA_H