From 59190c80e15c2a74a9813fac486b6917def87526 Mon Sep 17 00:00:00 2001 From: AJR Date: Thu, 31 May 2018 14:13:57 -0400 Subject: seta.cpp: Break up the "vregs" handler (nw) --- src/mame/drivers/seta.cpp | 94 ++++++++++++++----------- src/mame/includes/seta.h | 13 ++-- src/mame/video/seta.cpp | 170 +++++++++++++++++----------------------------- 3 files changed, 123 insertions(+), 154 deletions(-) diff --git a/src/mame/drivers/seta.cpp b/src/mame/drivers/seta.cpp index 477f501df75..f08af229961 100644 --- a/src/mame/drivers/seta.cpp +++ b/src/mame/drivers/seta.cpp @@ -1822,7 +1822,7 @@ WRITE8_MEMBER(seta_state::usclssic_lockout_w) machine().tilemap().mark_all_dirty(); m_tiles_offset = tiles_offset; - seta_coin_lockout_w(data); + seta_coin_lockout_w(space, 0, data); } @@ -1887,7 +1887,9 @@ void seta_state::blandia_map(address_map &map) map(0x400000, 0x400001).portr("P1"); // P1 map(0x400002, 0x400003).portr("P2"); // P2 map(0x400004, 0x400005).portr("COINS"); // Coins - map(0x500000, 0x500005).ram().w(this, FUNC(seta_state::seta_vregs_w)).share("vregs"); // (gundhara) Coin Lockout + Video Registers + map(0x500001, 0x500001).w(this, FUNC(seta_state::seta_coin_counter_w)); // Coin Counter (no lockout) + map(0x500003, 0x500003).w(this, FUNC(seta_state::seta_vregs_w)); // Video Registers + map(0x500004, 0x500005).nopw(); map(0x600000, 0x600003).r(this, FUNC(seta_state::seta_dsw_r)); // DSW map(0x700000, 0x7003ff).ram(); // (rezon,jjsquawk) map(0x700400, 0x700fff).ram().share("paletteram1"); // Palette @@ -1923,7 +1925,9 @@ void seta_state::blandiap_map(address_map &map) map(0x400000, 0x400001).portr("P1"); // P1 map(0x400002, 0x400003).portr("P2"); // P2 map(0x400004, 0x400005).portr("COINS"); // Coins - map(0x500000, 0x500005).ram().w(this, FUNC(seta_state::seta_vregs_w)).share("vregs"); // (gundhara) Coin Lockout + Video Registers + map(0x500001, 0x500001).w(this, FUNC(seta_state::seta_coin_counter_w)); // Coin Counter (no lockout) + map(0x500003, 0x500003).w(this, FUNC(seta_state::seta_vregs_w)); // Video Registers + map(0x500004, 0x500005).nopw(); map(0x600000, 0x600003).r(this, FUNC(seta_state::seta_dsw_r)); // DSW map(0x700000, 0x7003ff).ram(); // (rezon,jjsquawk) map(0x700400, 0x700fff).ram().share("paletteram1"); // Palette @@ -1993,7 +1997,9 @@ void seta_state::wrofaero_map(address_map &map) map(0x400002, 0x400003).portr("P2"); // P2 map(0x400004, 0x400005).portr("COINS"); // Coins - map(0x500000, 0x500005).ram().w(this, FUNC(seta_state::seta_vregs_w)).share("vregs"); // (gundhara) Coin Lockout + Video Registers + map(0x500001, 0x500001).w(this, FUNC(seta_state::seta_coin_counter_w)); // Coin Counter (no lockout) + map(0x500003, 0x500003).w(this, FUNC(seta_state::seta_vregs_w)); // Video Registers + map(0x500004, 0x500005).nopw(); map(0x500006, 0x500007).r(this, FUNC(seta_state::extra_r)); // Buttons 4,5,6 (Daioh only) map(0x600000, 0x600003).r(this, FUNC(seta_state::seta_dsw_r)); // DSW @@ -2043,8 +2049,9 @@ void seta_state::zingzipbl_map(address_map &map) // AM_RANGE(0x400002, 0x400003) AM_READ_PORT("P2") // P2 map(0x400002, 0x400003).r(this, FUNC(seta_state::zingzipbl_unknown_r)); // P2 // AM_RANGE(0x400004, 0x400005) AM_READ_PORT("COINS") // Coins - map(0x500000, 0x500005).ram().w(this, FUNC(seta_state::seta_vregs_w)).share("vregs"); // (gundhara) Coin Lockout + Video Registers - + map(0x500001, 0x500001).w(this, FUNC(seta_state::seta_coin_lockout_w)); // Coin Lockout + map(0x500003, 0x500003).w(this, FUNC(seta_state::seta_vregs_w)); // Video Registers + map(0x500004, 0x500005).nopw(); //AM_RANGE(0x600000, 0x600003) AM_READ(seta_dsw_r) // DSW map(0x700000, 0x7003ff).ram(); // (rezon,jjsquawk) map(0x700400, 0x700fff).ram().share("paletteram1"); // Palette @@ -2081,8 +2088,9 @@ void seta_state::jjsquawb_map(address_map &map) map(0x400000, 0x400001).portr("P1"); // P1 map(0x400002, 0x400003).portr("P2"); // P2 map(0x400004, 0x400005).portr("COINS"); // Coins - map(0x500000, 0x500005).ram().w(this, FUNC(seta_state::seta_vregs_w)).share("vregs"); // (gundhara) Coin Lockout + Video Registers - + map(0x500001, 0x500001).w(this, FUNC(seta_state::seta_coin_lockout_w)); // Coin Lockout + map(0x500003, 0x500003).w(this, FUNC(seta_state::seta_vregs_w)); // Video Registers + map(0x500004, 0x500005).nopw(); map(0x600000, 0x600003).r(this, FUNC(seta_state::seta_dsw_r)); // DSW map(0x700000, 0x70b3ff).ram(); // RZ: (rezon,jjsquawk) map(0x70b400, 0x70bfff).ram().share("paletteram1"); // Palette @@ -2234,7 +2242,7 @@ void seta_state::blockcar_map(address_map &map) map(0x100000, 0x100001).nopw(); // ? 1 (start of interrupts, main loop: watchdog?) map(0x200000, 0x200001).nopw(); // ? 0/1 (IRQ acknowledge?) map(0x300000, 0x300003).r(this, FUNC(seta_state::seta_dsw_r)); // DSW - map(0x400000, 0x400001).ram().w(this, FUNC(seta_state::seta_vregs_w)).share("vregs"); // Coin Lockout + Sound Enable (bit 4?) + map(0x400001, 0x400001).w(this, FUNC(seta_state::seta_coin_lockout_w)); // Coin Lockout + Sound Enable (bit 4?) map(0x500000, 0x500001).portr("P1"); // P1 map(0x500002, 0x500003).portr("P2"); // P2 map(0x500004, 0x500005).portr("COINS"); // Coins @@ -2255,7 +2263,7 @@ void seta_state::blockcarb_map(address_map &map) map(0x100000, 0x100001).nopw(); // ? 1 (start of interrupts, main loop: watchdog?) map(0x200000, 0x200001).nopw(); // ? 0/1 (IRQ acknowledge?) map(0x300000, 0x300003).r(this, FUNC(seta_state::seta_dsw_r)); // DSW - map(0x400000, 0x400001).ram().w(this, FUNC(seta_state::seta_vregs_w)).share("vregs"); // Coin Lockout + Sound Enable (bit 4?) + map(0x400001, 0x400001).w(this, FUNC(seta_state::seta_coin_lockout_w)); // Coin Lockout + Sound Enable (bit 4?) map(0x500000, 0x500001).portr("P1"); // P1 map(0x500002, 0x500003).portr("P2"); // P2 map(0x500004, 0x500005).portr("COINS"); // Coins @@ -2280,7 +2288,9 @@ void seta_state::daioh_map(address_map &map) map(0x400000, 0x400001).portr("P1"); // P1 map(0x400002, 0x400003).portr("P2"); // P2 map(0x400004, 0x400005).portr("COINS"); // Coins - map(0x500000, 0x500005).ram().w(this, FUNC(seta_state::seta_vregs_w)).share("vregs"); // Coin Lockout + Video Registers + map(0x500001, 0x500001).w(this, FUNC(seta_state::seta_coin_lockout_w)); // Coin Lockout + map(0x500003, 0x500003).w(this, FUNC(seta_state::seta_vregs_w)); // Video Registers + map(0x500004, 0x500005).nopw(); map(0x500006, 0x500007).portr("EXTRA"); // Buttons 4,5,6 map(0x600000, 0x600003).r(this, FUNC(seta_state::seta_dsw_r)); // DSW map(0x700000, 0x7003ff).ram(); @@ -2315,7 +2325,9 @@ void seta_state::daiohp_map(address_map &map) map(0x400000, 0x400001).portr("P1"); // P1 map(0x400002, 0x400003).portr("P2"); // P2 map(0x400004, 0x400005).portr("COINS"); // Coins - map(0x500000, 0x500005).ram().w(this, FUNC(seta_state::seta_vregs_w)).share("vregs"); // Coin Lockout + Video Registers + map(0x500001, 0x500001).w(this, FUNC(seta_state::seta_coin_lockout_w)); // Coin Lockout + map(0x500003, 0x500003).w(this, FUNC(seta_state::seta_vregs_w)); // Video Registers + map(0x500004, 0x500005).nopw(); map(0x500006, 0x500007).portr("EXTRA"); // Buttons 4,5,6 map(0x600000, 0x600003).r(this, FUNC(seta_state::seta_dsw_r)); // DSW map(0x700000, 0x7003ff).ram(); @@ -2352,7 +2364,8 @@ void seta_state::drgnunit_map(address_map &map) map(0x100000, 0x103fff).rw(m_x1, FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound map(0x200000, 0x200001).nopw(); // Watchdog map(0x300000, 0x300001).nopw(); // ? IRQ Ack - map(0x500000, 0x500001).ram().w(this, FUNC(seta_state::seta_vregs_w)).share("vregs"); // Coin Lockout + Video Registers + map(0x500001, 0x500001).w(this, FUNC(seta_state::seta_coin_lockout_w)); // Coin Lockout + map(0x500003, 0x500003).w(this, FUNC(seta_state::seta_vregs_w)); // Video Registers map(0x600000, 0x600003).r(this, FUNC(seta_state::seta_dsw_r)); // DSW map(0x700000, 0x7003ff).ram().share("paletteram1"); // Palette map(0x800000, 0x800005).ram().share("vctrl_0"); // VRAM Ctrl @@ -2561,7 +2574,8 @@ void seta_state::extdwnhl_map(address_map &map) map(0x400004, 0x400005).portr("COINS"); // Coins map(0x400008, 0x40000b).r(this, FUNC(seta_state::seta_dsw_r)); // DSW map(0x40000c, 0x40000d).rw("watchdog", FUNC(watchdog_timer_device::reset16_r), FUNC(watchdog_timer_device::reset16_w)); // Watchdog (extdwnhl (R) & sokonuke (W) MUST RETURN $FFFF) - map(0x500000, 0x500003).ram().w(this, FUNC(seta_state::seta_vregs_w)).share("vregs"); // Coin Lockout + Video Registers + map(0x500001, 0x500001).w(this, FUNC(seta_state::seta_coin_counter_w)); // Coin Counter (no lockout) + map(0x500003, 0x500003).w(this, FUNC(seta_state::seta_vregs_w)); // Video Registers map(0x500004, 0x500007).noprw(); // IRQ Ack (extdwnhl (R) & sokonuke (W)) map(0x600400, 0x600fff).ram().share("paletteram1"); // Palette map(0x601000, 0x610bff).ram(); // @@ -2593,7 +2607,8 @@ void seta_state::kamenrid_map(address_map &map) map(0x500004, 0x500007).r(this, FUNC(seta_state::seta_dsw_r)); // DSW map(0x500008, 0x500009).portr("COINS"); // Coins map(0x50000c, 0x50000d).rw("watchdog", FUNC(watchdog_timer_device::reset16_r), FUNC(watchdog_timer_device::reset16_w)); // xx Watchdog? (sokonuke) - map(0x600000, 0x600005).ram().w(this, FUNC(seta_state::seta_vregs_w)).share("vregs"); // ? Coin Lockout + Video Registers + map(0x600001, 0x600001).w(this, FUNC(seta_state::seta_coin_counter_w)); // Coin Counter (no lockout) + map(0x600003, 0x600003).w(this, FUNC(seta_state::seta_vregs_w)); // Video Registers map(0x600004, 0x600005).w(this, FUNC(seta_state::ipl1_ack_w)); map(0x600006, 0x600007).w(this, FUNC(seta_state::ipl2_ack_w)); map(0x700000, 0x7003ff).ram(); // Palette RAM (tested) @@ -2624,7 +2639,8 @@ void seta_state::madshark_map(address_map &map) map(0x500004, 0x500005).portr("COINS"); // Coins map(0x500008, 0x50000b).r(this, FUNC(seta_state::seta_dsw_r)); // DSW map(0x50000c, 0x50000d).w("watchdog", FUNC(watchdog_timer_device::reset16_w)); - map(0x600000, 0x600005).ram().w(this, FUNC(seta_state::seta_vregs_w)).share("vregs"); // ? Coin Lockout + Video Registers + map(0x600001, 0x600001).w(this, FUNC(seta_state::seta_coin_lockout_w)); // Coin Lockout + map(0x600003, 0x600003).w(this, FUNC(seta_state::seta_vregs_w)); // Video Registers map(0x600004, 0x600005).w(this, FUNC(seta_state::ipl1_ack_w)); map(0x600006, 0x600007).w(this, FUNC(seta_state::ipl2_ack_w)); map(0x700400, 0x700fff).ram().share("paletteram1"); // Palette @@ -2656,13 +2672,15 @@ WRITE16_MEMBER(seta_state::magspeed_lights_w) void seta_state::magspeed_map(address_map &map) { map(0x000000, 0x07ffff).rom(); // ROM + map(0x1f8000, 0x1f8fff).noprw(); // NVRAM? map(0x200000, 0x20ffff).ram(); // RAM map(0x500000, 0x500001).portr("P1"); // P1 map(0x500002, 0x500003).portr("P2"); // P2 map(0x500004, 0x500005).portr("COINS"); // Coins map(0x500008, 0x50000b).r(this, FUNC(seta_state::seta_dsw_r)); // DSW map(0x50000c, 0x50000d).w("watchdog", FUNC(watchdog_timer_device::reset16_w)); - map(0x500010, 0x500015).ram().w(this, FUNC(seta_state::msgundam_vregs_w)).share("vregs"); // ? Coin Lockout + Video Registers + map(0x500011, 0x500011).w(this, FUNC(seta_state::seta_coin_counter_w)); // Coin Counter (no lockout) + map(0x500015, 0x500015).w(this, FUNC(seta_state::seta_vregs_w)); // Video Registers map(0x500018, 0x500019).w(this, FUNC(seta_state::ipl1_ack_w)); // lev 2 irq ack? map(0x50001c, 0x50001d).w(this, FUNC(seta_state::ipl2_ack_w)); // lev 4 irq ack? map(0x600000, 0x600005).w(this, FUNC(seta_state::magspeed_lights_w)); // Lights @@ -2718,17 +2736,6 @@ void seta_state::krzybowl_map(address_map &map) Mobile Suit Gundam ***************************************************************************/ -WRITE16_MEMBER(seta_state::msgundam_vregs_w) -{ - // swap $500002 with $500004 - switch( offset ) - { - case 1: offset = 2; break; - case 2: offset = 1; break; - } - seta_vregs_w(space,offset,data,mem_mask); -} - /* Mirror RAM is necessary or startup, to clear Work RAM after the test */ void seta_state::msgundam_map(address_map &map) @@ -2741,7 +2748,9 @@ void seta_state::msgundam_map(address_map &map) map(0x400004, 0x400005).portr("COINS"); // Coins map(0x400000, 0x400001).w(this, FUNC(seta_state::ipl1_ack_w)); // Lev 2 IRQ Ack map(0x400004, 0x400005).w(this, FUNC(seta_state::ipl2_ack_w)); // Lev 4 IRQ Ack - map(0x500000, 0x500005).ram().w(this, FUNC(seta_state::msgundam_vregs_w)).share("vregs"); // Coin Lockout + Video Registers + map(0x500001, 0x500001).w(this, FUNC(seta_state::seta_coin_lockout_w)); // Coin Lockout + map(0x500002, 0x500003).nopw(); // ? + map(0x500005, 0x500005).w(this, FUNC(seta_state::seta_vregs_w)); // Video Registers map(0x600000, 0x600003).r(this, FUNC(seta_state::seta_dsw_r)); // DSW map(0x700400, 0x700fff).ram().share("paletteram1"); // Palette map(0x800000, 0x8005ff).ram().rw(m_seta001, FUNC(seta001_device::spriteylow_r16), FUNC(seta001_device::spriteylow_w16)); // Sprites Y @@ -2772,7 +2781,9 @@ void seta_state::oisipuzl_map(address_map &map) map(0x400002, 0x400003).portr("P2"); // P2 map(0x400004, 0x400005).portr("COINS"); // Coins map(0x400000, 0x400001).nopw(); // ? IRQ Ack - map(0x500000, 0x500005).ram().w(this, FUNC(seta_state::seta_vregs_w)).share("vregs"); // Coin Lockout + Video Registers + map(0x500001, 0x500001).w(this, FUNC(seta_state::seta_coin_lockout_w)); // Coin Lockout + map(0x500003, 0x500003).w(this, FUNC(seta_state::seta_vregs_w)); // Video Registers + map(0x500004, 0x500005).nopw(); // ? IRQ Ack map(0x700000, 0x703fff).rw(m_x1, FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound map(0x800000, 0x803fff).ram().w(this, FUNC(seta_state::vram_w<0>)).share("vram_0"); // VRAM 0&1 map(0x880000, 0x883fff).ram().w(this, FUNC(seta_state::vram_w<1>)).share("vram_1"); // VRAM 2&3 @@ -2802,8 +2813,11 @@ void seta_state::triplfun_map(address_map &map) map(0x400002, 0x400003).portr("P2"); // P2 map(0x400004, 0x400005).portr("COINS"); // Coins map(0x400000, 0x400001).nopw(); // ? IRQ Ack - map(0x500000, 0x500005).ram().w(this, FUNC(seta_state::seta_vregs_w)).share("vregs"); // Coin Lockout + Video Registers + map(0x500001, 0x500001).w(this, FUNC(seta_state::seta_coin_lockout_w)); // Coin Lockout + map(0x500003, 0x500003).w(this, FUNC(seta_state::seta_vregs_w)); // Video Registers + map(0x500004, 0x500005).nopw(); // ? IRQ Ack map(0x500007, 0x500007).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // tfun sound + map(0x700000, 0x703fff).noprw(); map(0x800000, 0x803fff).ram().w(this, FUNC(seta_state::vram_w<0>)).share("vram_0"); // VRAM 0&1 map(0x880000, 0x883fff).ram().w(this, FUNC(seta_state::vram_w<1>)).share("vram_1"); // VRAM 2&3 map(0x900000, 0x900005).ram().share("vctrl_0"); // VRAM 0&1 Ctrl @@ -2888,7 +2902,7 @@ void seta_state::thunderl_map(address_map &map) map(0x200000, 0x200001).rw(this, FUNC(seta_state::ipl1_ack_r), FUNC(seta_state::ipl1_ack_w)); map(0x300000, 0x300001).nopw(); // ? map(0x400000, 0x40ffff).w(this, FUNC(seta_state::thunderl_protection_w)); // Protection (not in wits) - map(0x500000, 0x500001).ram().w(this, FUNC(seta_state::seta_vregs_w)).share("vregs"); // Coin Lockout + map(0x500001, 0x500001).w(this, FUNC(seta_state::seta_coin_lockout_w)); // Coin Lockout map(0x600000, 0x600003).r(this, FUNC(seta_state::seta_dsw_r)); // DSW map(0x700000, 0x7003ff).ram().share("paletteram1"); // Palette map(0xb00000, 0xb00001).portr("P1"); // P1 @@ -2913,7 +2927,7 @@ void seta_state::thunderlbl_map(address_map &map) map(0x200000, 0x200001).rw(this, FUNC(seta_state::ipl1_ack_r), FUNC(seta_state::ipl1_ack_w)); map(0x300000, 0x300001).nopw(); // ? // map(0x400000, 0x40ffff).w(this, FUNC(seta_state::thunderl_protection_w)); // Protection (not in wits) - map(0x500000, 0x500001).ram().w(this, FUNC(seta_state::seta_vregs_w)).share("vregs"); // Coin Lockout + map(0x500001, 0x500001).w(this, FUNC(seta_state::seta_coin_lockout_w)); // Coin Lockout map(0x600000, 0x600003).r(this, FUNC(seta_state::seta_dsw_r)); // DSW map(0x700000, 0x7003ff).ram().share("paletteram1"); // Palette map(0xb00000, 0xb00001).portr("P1"); // P1 @@ -2942,7 +2956,7 @@ void seta_state::wiggie_map(address_map &map) map(0x200000, 0x200001).rw(this, FUNC(seta_state::ipl1_ack_r), FUNC(seta_state::ipl1_ack_w)); map(0x300000, 0x300001).nopw(); // ? map(0x400000, 0x40ffff).w(this, FUNC(seta_state::thunderl_protection_w)); // Protection (not in wits) - map(0x500000, 0x500001).ram().w(this, FUNC(seta_state::seta_vregs_w)).share("vregs"); // Coin Lockout + map(0x500001, 0x500001).w(this, FUNC(seta_state::seta_coin_lockout_w)); // Coin Lockout map(0x600000, 0x600003).r(this, FUNC(seta_state::seta_dsw_r)); // DSW map(0x700000, 0x7003ff).ram().share("paletteram1"); // Palette map(0xb00000, 0xb00001).portr("P1"); // P1 @@ -2983,7 +2997,7 @@ void seta_state::umanclub_map(address_map &map) map(0x400004, 0x400005).portr("COINS"); // Coins map(0x400000, 0x400001).nopw(); // ? (end of lev 2) map(0x400004, 0x400005).nopw(); // ? (end of lev 2) - map(0x500000, 0x500001).ram().w(this, FUNC(seta_state::seta_vregs_w)).share("vregs"); // Coin Lockout + Video Registers + map(0x500001, 0x500001).w(this, FUNC(seta_state::seta_coin_lockout_w)); // Coin Lockout map(0x600000, 0x600003).r(this, FUNC(seta_state::seta_dsw_r)); // DSW map(0xa00000, 0xa005ff).ram().rw(m_seta001, FUNC(seta001_device::spriteylow_r16), FUNC(seta001_device::spriteylow_w16)); // Sprites Y map(0xa00600, 0xa00607).ram().rw(m_seta001, FUNC(seta001_device::spritectrl_r16), FUNC(seta001_device::spritectrl_w16)); @@ -3012,7 +3026,8 @@ void seta_state::utoukond_map(address_map &map) map(0x400000, 0x400001).portr("P1"); // P1 map(0x400002, 0x400003).portr("P2"); // P2 map(0x400004, 0x400005).portr("COINS"); // Coins - map(0x500000, 0x500005).ram().w(this, FUNC(seta_state::seta_vregs_w)).share("vregs"); // ? Coin Lockout + Video Registers + map(0x500001, 0x500001).w(this, FUNC(seta_state::seta_coin_lockout_w)); // Coin Lockout + map(0x500003, 0x500003).w(this, FUNC(seta_state::seta_vregs_w)); // Video Registers map(0x600000, 0x600003).r(this, FUNC(seta_state::seta_dsw_r)); // DSW map(0x700400, 0x700fff).ram().share("paletteram1"); // Palette map(0x800000, 0x803fff).ram().w(this, FUNC(seta_state::vram_w<0>)).share("vram_0"); // VRAM 0&1 @@ -3053,7 +3068,7 @@ void seta_state::pairlove_map(address_map &map) map(0x100000, 0x100001).nopw(); // ? 1 (start of interrupts, main loop: watchdog?) map(0x200000, 0x200001).nopw(); // ? 0/1 (IRQ acknowledge?) map(0x300000, 0x300003).r(this, FUNC(seta_state::seta_dsw_r)); // DSW - map(0x400000, 0x400001).ram().w(this, FUNC(seta_state::seta_vregs_w)).share("vregs"); // Coin Lockout + Sound Enable (bit 4?) + map(0x400001, 0x400001).w(this, FUNC(seta_state::seta_coin_lockout_w)); // Coin Lockout + Sound Enable (bit 4?) map(0x500000, 0x500001).portr("P1"); // P1 map(0x500002, 0x500003).portr("P2"); // P2 map(0x500004, 0x500005).portr("COINS"); // Coins @@ -3387,8 +3402,8 @@ WRITE8_MEMBER(seta_state::sub_bankswitch_w) WRITE8_MEMBER(seta_state::sub_bankswitch_lockout_w) { - sub_bankswitch_w(space,offset,data); - seta_coin_lockout_w(data); + m_subbank->set_entry(data >> 4); + seta_coin_lockout_w(space, 0, data); } @@ -12026,7 +12041,6 @@ void seta_state::init_crazyfgt() RAM[0x1078/2] = 0x4e71; // fixed priorities? - m_vregs.allocate(3); init_blandia(); } diff --git a/src/mame/includes/seta.h b/src/mame/includes/seta.h index 3c69b7cdded..a2f08d5fd2c 100644 --- a/src/mame/includes/seta.h +++ b/src/mame/includes/seta.h @@ -59,7 +59,6 @@ public: m_track_x(*this, "TRACK%u_X", 1U), m_track_y(*this, "TRACK%u_Y", 1U), m_sharedram(*this,"sharedram"), - m_vregs(*this,"vregs"), m_vram(*this,"vram_%u", 0U), m_vctrl(*this,"vctrl_%u", 0U), m_paletteram(*this,"paletteram%u", 1U), @@ -90,7 +89,6 @@ public: optional_ioport_array<2> m_track_y; optional_shared_ptr m_sharedram; - optional_shared_ptr m_vregs; optional_shared_ptr_array m_vram; optional_shared_ptr_array m_vctrl; optional_shared_ptr_array m_paletteram; @@ -103,6 +101,8 @@ public: required_device m_gfxdecode; required_device m_palette; + uint8_t m_vregs; + int m_tiles_offset; tilemap_t *m_tilemap[2]; // Max 2 Layers int m_rambank[2]; // 2 Tilemap banks for each layers @@ -114,9 +114,6 @@ public: uPD71054_state m_uPD71054; const game_offset *m_global_offsets; - bool m_coin_lockout_initialized; - int m_coin_lockout; - int m_sub_ctrl_data; uint8_t m_usclssic_port_select; @@ -135,7 +132,9 @@ public: uint16_t m_kiwame_row_select; DECLARE_READ16_MEMBER(metafox_protection_r); - DECLARE_WRITE16_MEMBER(seta_vregs_w); + DECLARE_WRITE8_MEMBER(seta_coin_counter_w); + DECLARE_WRITE8_MEMBER(seta_coin_lockout_w); + DECLARE_WRITE8_MEMBER(seta_vregs_w); template DECLARE_WRITE16_MEMBER(vram_w); DECLARE_WRITE16_MEMBER(twineagl_tilebank_w); DECLARE_WRITE16_MEMBER(timer_regs_w); @@ -155,7 +154,6 @@ public: DECLARE_READ16_MEMBER(keroppi_protection_init_r); DECLARE_READ16_MEMBER(keroppi_coin_r); DECLARE_WRITE16_MEMBER(keroppi_prize_w); - DECLARE_WRITE16_MEMBER(msgundam_vregs_w); DECLARE_WRITE16_MEMBER(kiwame_row_select_w); DECLARE_READ16_MEMBER(kiwame_input_r); DECLARE_READ16_MEMBER(thunderl_protection_r); @@ -232,7 +230,6 @@ public: TIMER_DEVICE_CALLBACK_MEMBER(tndrcade_sub_interrupt); TIMER_DEVICE_CALLBACK_MEMBER(calibr50_interrupt); TIMER_DEVICE_CALLBACK_MEMBER(crazyfgt_interrupt); - void seta_coin_lockout_w(int data); void set_pens(); void usclssic_set_pens(); void draw_tilemap_palette_effect(bitmap_ind16 &bitmap, const rectangle &cliprect, tilemap_t *tilemap, int scrollx, int scrolly, int gfxnum, int flipscreen); diff --git a/src/mame/video/seta.cpp b/src/mame/video/seta.cpp index 1d849f09727..0273228b439 100644 --- a/src/mame/video/seta.cpp +++ b/src/mame/video/seta.cpp @@ -217,124 +217,79 @@ static const game_offset game_offsets[] = }; -/* ---- 3--- Coin #1 Lock Out - ---- -2-- Coin #0 Lock Out - ---- --1- Coin #1 Counter - ---- ---0 Coin #0 Counter */ +/* 76-- ---- + --5- ---- Sound Enable + ---4 ---- toggled in IRQ1 by many games, irq acknowledge? + [original comment for the above: ?? 1 in oisipuzl, sokonuke (layers related)] + ---- 3--- Coin #1 Lock Out + ---- -2-- Coin #0 Lock Out + ---- --1- Coin #1 Counter + ---- ---0 Coin #0 Counter */ + +// some games haven't the coin lockout device (blandia, eightfrc, extdwnhl, gundhara, kamenrid, magspeed, sokonuke, zingzip, zombraid) +WRITE8_MEMBER(seta_state::seta_coin_counter_w) +{ + machine().bookkeeping().coin_counter_w(0, BIT(data, 0)); + machine().bookkeeping().coin_counter_w(1, BIT(data, 1)); + + if (m_x1.found()) + m_x1->enable_w(BIT(data, 6)); +} -void seta_state::seta_coin_lockout_w(int data) +WRITE8_MEMBER(seta_state::seta_coin_lockout_w) { - static const char *const seta_nolockout[] = - { "blandia", "eightfrc", "extdwnhl", "gundhara", "kamenrid", "magspeed", "sokonuke", "zingzip", "zombraid", "zombraidp", "zombraidpj"}; - - /* Only compute seta_coin_lockout when confronted with a new gamedrv */ - if (!m_coin_lockout_initialized) - { - m_coin_lockout_initialized = true; - int i; + seta_coin_counter_w(space, 0, data); - m_coin_lockout = 1; - for (i=0; i> 0) & 1 ); - machine().bookkeeping().coin_counter_w(1, (( data) >> 1) & 1 ); - - /* some games haven't the coin lockout device */ - if ( !m_coin_lockout ) - return; - machine().bookkeeping().coin_lockout_w(0, ((~data) >> 2) & 1 ); - machine().bookkeeping().coin_lockout_w(1, ((~data) >> 3) & 1 ); + machine().bookkeeping().coin_lockout_w(0, !BIT(data, 2)); + machine().bookkeeping().coin_lockout_w(1, !BIT(data, 3)); } -WRITE16_MEMBER(seta_state::seta_vregs_w) +WRITE8_MEMBER(seta_state::seta_vregs_w) { - COMBINE_DATA(&m_vregs[offset]); - switch (offset) - { - case 0/2: - -/* fedc ba98 76-- ---- - ---- ---- --5- ---- Sound Enable - ---- ---- ---4 ---- toggled in IRQ1 by many games, irq acknowledge? - [original comment for the above: ?? 1 in oisipuzl, sokonuke (layers related)] - ---- ---- ---- 3--- Coin #1 Lock Out - ---- ---- ---- -2-- Coin #0 Lock Out - ---- ---- ---- --1- Coin #1 Counter - ---- ---- ---- ---0 Coin #0 Counter */ - if (ACCESSING_BITS_0_7) - { - seta_coin_lockout_w (data & 0x0f); - if (m_x1 != nullptr) - m_x1->enable_w (data & 0x20); - machine().bookkeeping().coin_counter_w(0,data & 0x01); - machine().bookkeeping().coin_counter_w(1,data & 0x02); - } - break; + m_vregs = data; - case 2/2: - if (ACCESSING_BITS_0_7) - { - int new_bank; + /* Partly handled in vh_screenrefresh: - /* Partly handled in vh_screenrefresh: + 76-- ---- + --54 3--- Samples Bank (in blandia, eightfrc, zombraid) + ---- -2-- + ---- --1- Sprites Above Frontmost Layer + ---- ---0 Layer 0 Above Layer 1 + */ - fedc ba98 76-- ---- - ---- ---- --54 3--- Samples Bank (in blandia, eightfrc, zombraid) - ---- ---- ---- -2-- - ---- ---- ---- --1- Sprites Above Frontmost Layer - ---- ---- ---- ---0 Layer 0 Above Layer 1 - */ + int new_bank = (data >> 3) & 0x7; - new_bank = (data >> 3) & 0x7; + if (new_bank != m_samples_bank) + { + if (!m_x1.found()) // triplfun no longer has the hardware, but still writes here + return; - if (new_bank != m_samples_bank) - { - if (memregion("x1snd") == nullptr) // triplfun no longer has the hardware, but still writes here - break; - - uint8_t *rom = memregion("x1snd")->base(); - int samples_len = memregion("x1snd")->bytes(); - int addr; - - m_samples_bank = new_bank; - - if (samples_len == 0x240000) /* blandia, eightfrc */ - { - addr = 0x40000 * new_bank; - if (new_bank >= 3) addr += 0x40000; - - if ( (samples_len > 0x100000) && ((addr+0x40000) <= samples_len) ) - memcpy(&rom[0xc0000],&rom[addr],0x40000); - else - logerror("PC %06X - Invalid samples bank %02X !\n", m_maincpu->pc(), new_bank); - } - else if (samples_len == 0x480000) /* zombraid */ - { - /* bank 1 is never explicitly selected, 0 is used in its place */ - if (new_bank == 0) new_bank = 1; - addr = 0x80000 * new_bank; - if (new_bank > 0) addr += 0x80000; - - memcpy(&rom[0x80000],&rom[addr],0x80000); - } - } + uint8_t *rom = memregion("x1snd")->base(); + int samples_len = memregion("x1snd")->bytes(); + int addr; - } - break; + m_samples_bank = new_bank; + + if (samples_len == 0x240000) /* blandia, eightfrc */ + { + addr = 0x40000 * new_bank; + if (new_bank >= 3) addr += 0x40000; + if ( (samples_len > 0x100000) && ((addr+0x40000) <= samples_len) ) + memcpy(&rom[0xc0000],&rom[addr],0x40000); + else + logerror("PC %06X - Invalid samples bank %02X !\n", m_maincpu->pc(), new_bank); + } + else if (samples_len == 0x480000) /* zombraid */ + { + /* bank 1 is never explicitly selected, 0 is used in its place */ + if (new_bank == 0) new_bank = 1; + addr = 0x80000 * new_bank; + if (new_bank > 0) addr += 0x80000; - case 4/2: // ? - break; + memcpy(&rom[0x80000],&rom[addr],0x80000); + } } } @@ -531,6 +486,9 @@ VIDEO_START_MEMBER(seta_state,seta_no_layers) m_seta001->set_fg_yoffsets( -0x12, 0x0e ); m_seta001->set_bg_yoffsets( 0x1, -0x1 ); save_item(NAME(m_rambank)); + + m_vregs = 0; + save_item(NAME(m_vregs)); } VIDEO_START_MEMBER(seta_state,kyustrkr_no_layers) @@ -880,15 +838,15 @@ void seta_state::seta_layers_update(screen_device &screen, bitmap_ind16 &bitmap, if (msk != 0) layers_ctrl &= msk; if (m_tilemap[1]) - popmessage("VR:%04X-%04X-%04X L0:%04X L1:%04X", - m_vregs[0], m_vregs[1], m_vregs[2], m_vctrl[0][4/2], m_vctrl[1][4/2]); + popmessage("VR:%02X L0:%04X L1:%04X", + m_vregs, m_vctrl[0][4/2], m_vctrl[1][4/2]); else if (m_tilemap[0]) popmessage("L0:%04X", m_vctrl[0][4/2]); } #endif bitmap.fill(0, cliprect); - int const order = m_tilemap[1] ? m_vregs[ 2/2 ] : 0; + int const order = m_tilemap[1] ? m_vregs : 0; if (order & 1) // swap the layers? { if (m_tilemap[1]) -- cgit v1.2.3