diff --git a/scripts/target/mame/arcade.lua b/scripts/target/mame/arcade.lua index 6d203948ef5..424f6101943 100644 --- a/scripts/target/mame/arcade.lua +++ b/scripts/target/mame/arcade.lua @@ -3813,6 +3813,8 @@ files { MAME_DIR .. "src/mame/includes/simple_st0016.h", MAME_DIR .. "src/mame/video/seta001.cpp", MAME_DIR .. "src/mame/video/seta001.h", + MAME_DIR .. "src/mame/video/x1_012.cpp", + MAME_DIR .. "src/mame/video/x1_012.h", MAME_DIR .. "src/mame/drivers/thedealr.cpp", } diff --git a/src/mame/drivers/cchance.cpp b/src/mame/drivers/cchance.cpp index 33a2ff2e8e3..d630d584e9e 100644 --- a/src/mame/drivers/cchance.cpp +++ b/src/mame/drivers/cchance.cpp @@ -223,10 +223,7 @@ void cchance_state::cchance(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &cchance_state::main_map); m_maincpu->set_vblank_int("screen", FUNC(cchance_state::irq0_line_hold)); - GFXDECODE(config, "gfxdecode", m_palette, gfx_cchance); - - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag("gfxdecode"); + SETA001_SPRITE(config, m_seta001, 16000000, m_palette, gfx_cchance); /* video hardware */ SCREEN(config, m_screen, SCREEN_TYPE_RASTER); diff --git a/src/mame/drivers/champbwl.cpp b/src/mame/drivers/champbwl.cpp index f0e56a9500c..9c2ae091076 100644 --- a/src/mame/drivers/champbwl.cpp +++ b/src/mame/drivers/champbwl.cpp @@ -501,8 +501,7 @@ void champbwl_state::champbwl(machine_config &config) MCFG_MACHINE_START_OVERRIDE(champbwl_state,champbwl) MCFG_MACHINE_RESET_OVERRIDE(champbwl_state,champbwl) - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag("gfxdecode"); + SETA001_SPRITE(config, m_seta001, 16000000, m_palette, gfx_champbwl); /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); @@ -514,7 +513,6 @@ void champbwl_state::champbwl(machine_config &config) screen.screen_vblank().set(FUNC(champbwl_state::screen_vblank_champbwl)); screen.set_palette(m_palette); - GFXDECODE(config, "gfxdecode", m_palette, gfx_champbwl); PALETTE(config, m_palette, FUNC(champbwl_state::champbwl_palette), 512); /* sound hardware */ @@ -562,8 +560,7 @@ void champbwl_state::doraemon(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag("gfxdecode"); + SETA001_SPRITE(config, m_seta001, 14'318'181, m_palette, gfx_champbwl); TICKET_DISPENSER(config, m_hopper, attotime::from_msec(2000), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_LOW ); @@ -579,7 +576,6 @@ void champbwl_state::doraemon(machine_config &config) screen.screen_vblank().set(FUNC(champbwl_state::screen_vblank_doraemon)); screen.set_palette(m_palette); - GFXDECODE(config, "gfxdecode", m_palette, gfx_champbwl); PALETTE(config, m_palette, FUNC(champbwl_state::champbwl_palette), 512); /* sound hardware */ diff --git a/src/mame/drivers/seta.cpp b/src/mame/drivers/seta.cpp index 04417b7542e..d0726219862 100644 --- a/src/mame/drivers/seta.cpp +++ b/src/mame/drivers/seta.cpp @@ -1663,20 +1663,6 @@ WRITE_LINE_MEMBER(seta_state::screen_vblank_seta_buffer_sprites) } -/* - - VRAM Handler - -*/ -template -void seta_state::vram_w(offs_t offset, u16 data, u16 mem_mask) -{ - COMBINE_DATA(&m_vram[Layer][offset]); - if (m_rambank[Layer] == ((offset >> 12) & 1)) - m_tilemap[Layer]->mark_tile_dirty(offset & 0x7ff); -} - - /*************************************************************************** @@ -1783,8 +1769,8 @@ void seta_state::downtown_map(address_map &map) map(0x500001, 0x500001).w(FUNC(seta_state::twineagl_ctrl_w)); map(0x600000, 0x600003).r(FUNC(seta_state::seta_dsw_r)); // DSW map(0x700000, 0x7003ff).ram().share("paletteram1"); // Palette - map(0x800000, 0x800005).writeonly().share("vctrl_0");// VRAM Ctrl - map(0x900000, 0x903fff).ram().w(FUNC(seta_state::vram_w<0>)).share("vram_0"); // VRAM + map(0x800000, 0x800005).w(m_layers[0], FUNC(x1_012_device::vctrl_w));// VRAM Ctrl + map(0x900000, 0x903fff).ram().w(m_layers[0], FUNC(x1_012_device::vram_w)).share("layer1"); // VRAM map(0xa00000, 0xa00007).w(FUNC(seta_state::sub_ctrl_w)).umask16(0x00ff); // Sub CPU Control? map(0xb00000, 0xb00fff).rw(FUNC(seta_state::sharedram_68000_r), FUNC(seta_state::sharedram_68000_w)).umask16(0x00ff); // Shared RAM map(0xc00000, 0xc00001).nopw(); // ? $4000 @@ -1809,8 +1795,8 @@ void seta_state::calibr50_map(address_map &map) map(0x500000, 0x500001).nopw(); // ? map(0x600000, 0x600003).r(FUNC(seta_state::seta_dsw_r)); // DSW map(0x700000, 0x7003ff).ram().share("paletteram1"); // Palette - map(0x800000, 0x800005).writeonly().share("vctrl_0");// VRAM Ctrl - map(0x900000, 0x903fff).ram().w(FUNC(seta_state::vram_w<0>)).share("vram_0"); // VRAM + map(0x800000, 0x800005).w(m_layers[0], FUNC(x1_012_device::vctrl_w));// VRAM Ctrl + map(0x900000, 0x903fff).ram().w(m_layers[0], FUNC(x1_012_device::vram_w)).share("layer1"); // VRAM map(0x904000, 0x904fff).ram(); // map(0xa00000, 0xa00001).portr("P1"); // X1-004 @@ -1859,7 +1845,7 @@ CUSTOM_INPUT_MEMBER(usclssic_state::trackball_y_r) void usclssic_state::lockout_w(u8 data) { - int tiles_offset = BIT(data, 4) ? 0x4000: 0; + u16 tiles_offset = BIT(data, 4) ? 0x4000 : 0; m_port_select = BIT(data, 6); m_buttonmux->select_w(m_port_select); @@ -1868,7 +1854,7 @@ void usclssic_state::lockout_w(u8 data) m_upd4701->resety_w(BIT(data, 7)); if (tiles_offset != m_tiles_offset) - machine().tilemap().mark_all_dirty(); + m_layers[0]->mark_all_dirty(); m_tiles_offset = tiles_offset; seta_coin_lockout_w(data); @@ -1882,7 +1868,7 @@ void usclssic_state::usclssic_map(address_map &map) map(0x800000, 0x8005ff).ram().rw(m_seta001, FUNC(seta001_device::spriteylow_r16), FUNC(seta001_device::spriteylow_w16)); // Sprites Y map(0x800600, 0x800607).ram().rw(m_seta001, FUNC(seta001_device::spritectrl_r16), FUNC(seta001_device::spritectrl_w16)); map(0x900000, 0x900001).ram(); // ? $4000 - map(0xa00000, 0xa00005).ram().share("vctrl_0"); // VRAM Ctrl + map(0xa00000, 0xa00005).rw(m_layers[0], FUNC(x1_012_device::vctrl_r), FUNC(x1_012_device::vctrl_w)); // VRAM Ctrl map(0xb00000, 0xb003ff).ram().share("paletteram1"); // Palette map(0xb40000, 0xb40007).r(m_upd4701, FUNC(upd4701_device::read_xy)).umask16(0x00ff); map(0xb40001, 0xb40001).w(FUNC(usclssic_state::lockout_w)); // Coin Lockout + Tiles Banking @@ -1893,7 +1879,7 @@ void usclssic_state::usclssic_map(address_map &map) map(0xb40018, 0xb40019).w("watchdog", FUNC(watchdog_timer_device::reset16_w)); map(0xb80000, 0xb80001).r(FUNC(usclssic_state::ipl2_ack_r)); map(0xc00000, 0xc03fff).ram().rw(m_seta001, FUNC(seta001_device::spritecode_r16), FUNC(seta001_device::spritecode_w16)); // Sprites Code + X + Attr - map(0xd00000, 0xd03fff).ram().w(FUNC(usclssic_state::vram_w<0>)).share("vram_0"); // VRAM + map(0xd00000, 0xd03fff).ram().w(m_layers[0], FUNC(x1_012_device::vram_w)).share("layer1"); // VRAM map(0xd04000, 0xd04fff).ram(); // map(0xe00000, 0xe00fff).ram(); // NVRAM? (odd bytes) } @@ -1947,11 +1933,11 @@ void seta_state::blandia_map(address_map &map) map(0x800600, 0x800607).ram().rw(m_seta001, FUNC(seta001_device::spritectrl_r16), FUNC(seta001_device::spritectrl_w16)); map(0x880000, 0x880001).ram(); // ? 0xc000 map(0x900000, 0x903fff).ram().rw(m_seta001, FUNC(seta001_device::spritecode_r16), FUNC(seta001_device::spritecode_w16)); // Sprites Code + X + Attr - map(0xa00000, 0xa00005).ram().share("vctrl_0"); // VRAM 0&1 Ctrl - map(0xa80000, 0xa80005).ram().share("vctrl_1"); // VRAM 2&3 Ctrl - map(0xb00000, 0xb03fff).ram().w(FUNC(seta_state::vram_w<0>)).share("vram_0"); // VRAM 0&1 + map(0xa00000, 0xa00005).rw(m_layers[0], FUNC(x1_012_device::vctrl_r), FUNC(x1_012_device::vctrl_w)); // VRAM 0&1 Ctrl + map(0xa80000, 0xa80005).rw(m_layers[1], FUNC(x1_012_device::vctrl_r), FUNC(x1_012_device::vctrl_w)); // VRAM 2&3 Ctrl + map(0xb00000, 0xb03fff).ram().w(m_layers[0], FUNC(x1_012_device::vram_w)).share("layer1"); // VRAM 0&1 map(0xb04000, 0xb0ffff).ram(); // (jjsquawk) - map(0xb80000, 0xb83fff).ram().w(FUNC(seta_state::vram_w<1>)).share("vram_1"); // VRAM 2&3 + map(0xb80000, 0xb83fff).ram().w(m_layers[1], FUNC(x1_012_device::vram_w)).share("layer2"); // VRAM 2&3 map(0xb84000, 0xb8ffff).ram(); // (jjsquawk) map(0xc00000, 0xc03fff).rw(m_x1, FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound map(0xd00000, 0xd00007).nopw(); // ? @@ -1987,12 +1973,12 @@ void seta_state::blandiap_map(address_map &map) map(0x700000, 0x7003ff).ram(); // (rezon,jjsquawk) map(0x700400, 0x700fff).ram().share("paletteram1"); // Palette map(0x703c00, 0x7047ff).ram().share("paletteram2"); // 2nd Palette for the paletteoffseteffect - map(0x800000, 0x803fff).ram().w(FUNC(seta_state::vram_w<0>)).share("vram_0"); // VRAM 0&1 + map(0x800000, 0x803fff).ram().w(m_layers[0], FUNC(x1_012_device::vram_w)).share("layer1"); // VRAM 0&1 map(0x804000, 0x80ffff).ram(); // (jjsquawk) - map(0x880000, 0x883fff).ram().w(FUNC(seta_state::vram_w<1>)).share("vram_1"); // VRAM 2&3 + map(0x880000, 0x883fff).ram().w(m_layers[1], FUNC(x1_012_device::vram_w)).share("layer2"); // VRAM 2&3 map(0x884000, 0x88ffff).ram(); // (jjsquawk) - map(0x900000, 0x900005).ram().share("vctrl_0"); // VRAM 0&1 Ctrl - map(0x980000, 0x980005).ram().share("vctrl_1"); // VRAM 2&3 Ctrl + map(0x900000, 0x900005).rw(m_layers[0], FUNC(x1_012_device::vctrl_r), FUNC(x1_012_device::vctrl_w)); // VRAM 0&1 Ctrl + map(0x980000, 0x980005).rw(m_layers[1], FUNC(x1_012_device::vctrl_r), FUNC(x1_012_device::vctrl_w)); // VRAM 2&3 Ctrl 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)); map(0xa80000, 0xa80001).ram(); // ? 0x4000 @@ -2061,12 +2047,12 @@ void seta_state::wrofaero_map(address_map &map) map(0x700000, 0x7003ff).ram(); // (rezon,jjsquawk) map(0x700400, 0x700fff).ram().share("paletteram1"); // Palette map(0x701000, 0x70ffff).ram(); // - map(0x800000, 0x803fff).ram().w(FUNC(seta_state::vram_w<0>)).share("vram_0"); // VRAM 0&1 + map(0x800000, 0x803fff).ram().w(m_layers[0], FUNC(x1_012_device::vram_w)).share("layer1"); // VRAM 0&1 map(0x804000, 0x80ffff).ram(); // (jjsquawk) - map(0x880000, 0x883fff).ram().w(FUNC(seta_state::vram_w<1>)).share("vram_1"); // VRAM 2&3 + map(0x880000, 0x883fff).ram().w(m_layers[1], FUNC(x1_012_device::vram_w)).share("layer2"); // VRAM 2&3 map(0x884000, 0x88ffff).ram(); // (jjsquawk) - map(0x900000, 0x900005).ram().share("vctrl_0"); // VRAM 0&1 Ctrl - map(0x980000, 0x980005).ram().share("vctrl_1"); // VRAM 2&3 Ctrl + map(0x900000, 0x900005).rw(m_layers[0], FUNC(x1_012_device::vctrl_r), FUNC(x1_012_device::vctrl_w)); // VRAM 0&1 Ctrl + map(0x980000, 0x980005).rw(m_layers[1], FUNC(x1_012_device::vctrl_r), FUNC(x1_012_device::vctrl_w)); // VRAM 2&3 Ctrl 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)); map(0xa80000, 0xa80001).ram(); // ? 0x4000 @@ -2112,14 +2098,14 @@ void seta_state::zingzipbl_map(address_map &map) map(0x500004, 0x500005).nopw(); //map(0x600000, 0x600003).r(FUNC(seta_state::seta_dsw_r)); // DSW map(0x700400, 0x700fff).ram().share("paletteram1"); // Palette - map(0x800000, 0x803fff).ram().w(FUNC(seta_state::vram_w<0>)).share("vram_0"); // VRAM 0&1 - map(0x880000, 0x883fff).ram().w(FUNC(seta_state::vram_w<1>)).share("vram_1"); // VRAM 2&3 - map(0x900000, 0x900005).ram().share("vctrl_0"); // VRAM 0&1 Ctrl + map(0x800000, 0x803fff).ram().w(m_layers[0], FUNC(x1_012_device::vram_w)).share("layer1"); // VRAM 0&1 + map(0x880000, 0x883fff).ram().w(m_layers[1], FUNC(x1_012_device::vram_w)).share("layer2"); // VRAM 2&3 + map(0x900000, 0x900005).rw(m_layers[0], FUNC(x1_012_device::vctrl_r), FUNC(x1_012_device::vctrl_w)); // VRAM 0&1 Ctrl //map(0x902006, 0x902007).w // writes 0 here on start up map(0x902010, 0x902013).r(FUNC(seta_state::zingzipbl_unknown_r)); - map(0x980000, 0x980005).ram().share("vctrl_1"); // VRAM 2&3 Ctrl + map(0x980000, 0x980005).rw(m_layers[1], FUNC(x1_012_device::vctrl_r), FUNC(x1_012_device::vctrl_w)); // VRAM 2&3 Ctrl 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)); map(0xa00608, 0xa00fff).ram(); // zeroed on start up @@ -2152,11 +2138,11 @@ void seta_state::jjsquawb_map(address_map &map) map(0x700000, 0x70b3ff).ram(); // RZ: (rezon,jjsquawk) map(0x70b400, 0x70bfff).ram().share("paletteram1"); // Palette map(0x70c000, 0x70ffff).ram(); // - map(0x800000, 0x803fff).ram().w(FUNC(seta_state::vram_w<0>)).share("vram_0"); // VRAM 0 - map(0x804000, 0x807fff).ram().w(FUNC(seta_state::vram_w<1>)).share("vram_1"); // VRAM 2 + map(0x800000, 0x803fff).ram().w(m_layers[0], FUNC(x1_012_device::vram_w)).share("layer1"); // VRAM 0 + map(0x804000, 0x807fff).ram().w(m_layers[1], FUNC(x1_012_device::vram_w)).share("layer2"); // VRAM 2 map(0x884000, 0x88ffff).ram(); // (jjsquawk) - map(0x908000, 0x908005).ram().share("vctrl_0"); // VRAM 0&1 Ctrl - map(0x909000, 0x909005).ram().share("vctrl_1"); // VRAM 2&3 Ctrl + map(0x908000, 0x908005).rw(m_layers[0], FUNC(x1_012_device::vctrl_r), FUNC(x1_012_device::vctrl_w)); // VRAM 0&1 Ctrl + map(0x909000, 0x909005).rw(m_layers[1], FUNC(x1_012_device::vctrl_r), FUNC(x1_012_device::vctrl_w)); // VRAM 2&3 Ctrl map(0xa0a000, 0xa0a5ff).ram().rw(m_seta001, FUNC(seta001_device::spriteylow_r16), FUNC(seta001_device::spriteylow_w16)); // RZ: Sprites Y map(0xa0a600, 0xa0a607).ram().rw(m_seta001, FUNC(seta001_device::spritectrl_r16), FUNC(seta001_device::spritectrl_w16)); // map(0xa80000, 0xa80001).ram() // ? 0x4000 @@ -2359,12 +2345,12 @@ void seta_state::daioh_map(address_map &map) map(0x700000, 0x7003ff).ram(); map(0x700400, 0x700fff).ram().share("paletteram1"); // Palette map(0x701000, 0x70ffff).ram(); // - map(0x800000, 0x803fff).ram().w(FUNC(seta_state::vram_w<0>)).share("vram_0"); // VRAM 0&1 + map(0x800000, 0x803fff).ram().w(m_layers[0], FUNC(x1_012_device::vram_w)).share("layer1"); // VRAM 0&1 map(0x804000, 0x80ffff).ram(); // - map(0x880000, 0x883fff).ram().w(FUNC(seta_state::vram_w<1>)).share("vram_1"); // VRAM 2&3 + map(0x880000, 0x883fff).ram().w(m_layers[1], FUNC(x1_012_device::vram_w)).share("layer2"); // VRAM 2&3 map(0x884000, 0x88ffff).ram(); // - map(0x900000, 0x900005).ram().share("vctrl_0"); // VRAM 0&1 Ctrl - map(0x980000, 0x980005).ram().share("vctrl_1"); // VRAM 2&3 Ctrl + map(0x900000, 0x900005).rw(m_layers[0], FUNC(x1_012_device::vctrl_r), FUNC(x1_012_device::vctrl_w)); // VRAM 0&1 Ctrl + map(0x980000, 0x980005).rw(m_layers[1], FUNC(x1_012_device::vctrl_r), FUNC(x1_012_device::vctrl_w)); // VRAM 2&3 Ctrl 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)); @@ -2396,12 +2382,12 @@ void seta_state::daiohp_map(address_map &map) map(0x700000, 0x7003ff).ram(); map(0x700400, 0x700fff).ram().share("paletteram1"); // Palette map(0x701000, 0x70ffff).ram(); // - map(0x800000, 0x803fff).ram().w(FUNC(seta_state::vram_w<0>)).share("vram_0"); // VRAM 0&1 + map(0x800000, 0x803fff).ram().w(m_layers[0], FUNC(x1_012_device::vram_w)).share("layer1"); // VRAM 0&1 map(0x804000, 0x80ffff).ram(); // - map(0x880000, 0x883fff).ram().w(FUNC(seta_state::vram_w<1>)).share("vram_1"); // VRAM 2&3 + map(0x880000, 0x883fff).ram().w(m_layers[1], FUNC(x1_012_device::vram_w)).share("layer2"); // VRAM 2&3 map(0x884000, 0x88ffff).ram(); // - map(0x900000, 0x900005).ram().share("vctrl_0"); // VRAM 0&1 Ctrl - map(0x980000, 0x980005).ram().share("vctrl_1"); // VRAM 2&3 Ctrl + map(0x900000, 0x900005).rw(m_layers[0], FUNC(x1_012_device::vctrl_r), FUNC(x1_012_device::vctrl_w)); // VRAM 0&1 Ctrl + map(0x980000, 0x980005).rw(m_layers[1], FUNC(x1_012_device::vctrl_r), FUNC(x1_012_device::vctrl_w)); // VRAM 2&3 Ctrl 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)); @@ -2431,8 +2417,8 @@ void seta_state::drgnunit_map(address_map &map) map(0x500003, 0x500003).w(FUNC(seta_state::seta_vregs_w)); // Video Registers map(0x600000, 0x600003).r(FUNC(seta_state::seta_dsw_r)); // DSW map(0x700000, 0x7003ff).ram().share("paletteram1"); // Palette - map(0x800000, 0x800005).ram().share("vctrl_0"); // VRAM Ctrl - map(0x900000, 0x903fff).ram().w(FUNC(seta_state::vram_w<0>)).share("vram_0"); // VRAM + map(0x800000, 0x800005).rw(m_layers[0], FUNC(x1_012_device::vctrl_r), FUNC(x1_012_device::vctrl_w)); // VRAM Ctrl + map(0x900000, 0x903fff).ram().w(m_layers[0], FUNC(x1_012_device::vram_w)).share("layer1"); // VRAM map(0x904000, 0x90ffff).nopw(); // unused (qzkklogy) map(0xb00000, 0xb00001).portr("P1"); // P1 map(0xb00002, 0xb00003).portr("P2"); // P2 @@ -2612,8 +2598,8 @@ void setaroul_state::setaroul_map(address_map &map) map(0xdc0000, 0xdc3fff).rw(m_x1, FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound - map(0xe00000, 0xe03fff).ram().w(FUNC(setaroul_state::vram_w<0>)).share("vram_0"); - map(0xe40000, 0xe40005).ram().share("vctrl_0"); // VRAM Ctrl + map(0xe00000, 0xe03fff).ram().w(m_layers[0], FUNC(x1_012_device::vram_w)).share("layer1"); + map(0xe40000, 0xe40005).rw(m_layers[0], FUNC(x1_012_device::vctrl_r), FUNC(x1_012_device::vctrl_w)); // VRAM Ctrl map(0xf00000, 0xf03fff).rw(FUNC(setaroul_state::spritecode_r), FUNC(setaroul_state::spritecode_w)); map(0xf40000, 0xf40bff).w(FUNC(setaroul_state::spriteylow_w)); map(0xf40c00, 0xf40c11).w(FUNC(setaroul_state::spritectrl_w)); @@ -2642,12 +2628,12 @@ void seta_state::extdwnhl_map(address_map &map) map(0x500004, 0x500007).noprw(); // IRQ Ack (extdwnhl (R) & sokonuke (W)) map(0x600400, 0x600fff).ram().share("paletteram1"); // Palette map(0x601000, 0x610bff).ram(); // - map(0x800000, 0x803fff).ram().w(FUNC(seta_state::vram_w<0>)).share("vram_0"); // VRAM 0&1 + map(0x800000, 0x803fff).ram().w(m_layers[0], FUNC(x1_012_device::vram_w)).share("layer1"); // VRAM 0&1 map(0x804000, 0x80ffff).ram(); // - map(0x880000, 0x883fff).ram().w(FUNC(seta_state::vram_w<1>)).share("vram_1"); // VRAM 2&3 + map(0x880000, 0x883fff).ram().w(m_layers[1], FUNC(x1_012_device::vram_w)).share("layer2"); // VRAM 2&3 map(0x884000, 0x88ffff).ram(); // - map(0x900000, 0x900005).ram().share("vctrl_0"); // VRAM 0&1 Ctrl - map(0x980000, 0x980005).ram().share("vctrl_1"); // VRAM 2&3 Ctrl + map(0x900000, 0x900005).rw(m_layers[0], FUNC(x1_012_device::vctrl_r), FUNC(x1_012_device::vctrl_w)); // VRAM 0&1 Ctrl + map(0x980000, 0x980005).rw(m_layers[1], FUNC(x1_012_device::vctrl_r), FUNC(x1_012_device::vctrl_w)); // VRAM 2&3 Ctrl 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)); map(0xa80000, 0xa80001).ram(); // ? 0x4000 @@ -2677,12 +2663,12 @@ void seta_state::kamenrid_map(address_map &map) map(0x700000, 0x7003ff).ram(); // Palette RAM (tested) map(0x700400, 0x700fff).ram().share("paletteram1"); // Palette map(0x701000, 0x703fff).ram(); // Palette - map(0x800000, 0x803fff).ram().w(FUNC(seta_state::vram_w<0>)).share("vram_0"); // VRAM 0&1 + map(0x800000, 0x803fff).ram().w(m_layers[0], FUNC(x1_012_device::vram_w)).share("layer1"); // VRAM 0&1 map(0x804000, 0x807fff).ram(); // tested - map(0x880000, 0x883fff).ram().w(FUNC(seta_state::vram_w<1>)).share("vram_1"); // VRAM 2&3 + map(0x880000, 0x883fff).ram().w(m_layers[1], FUNC(x1_012_device::vram_w)).share("layer2"); // VRAM 2&3 map(0x884000, 0x887fff).ram(); // tested - map(0x900000, 0x900005).ram().share("vctrl_0"); // VRAM 0&1 Ctrl - map(0x980000, 0x980005).ram().share("vctrl_1"); // VRAM 2&3 Ctrl + map(0x900000, 0x900005).rw(m_layers[0], FUNC(x1_012_device::vctrl_r), FUNC(x1_012_device::vctrl_w)); // VRAM 0&1 Ctrl + map(0x980000, 0x980005).rw(m_layers[1], FUNC(x1_012_device::vctrl_r), FUNC(x1_012_device::vctrl_w)); // VRAM 2&3 Ctrl 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)); map(0xa80000, 0xa80001).ram(); // ? $4000 @@ -2707,10 +2693,10 @@ void seta_state::madshark_map(address_map &map) map(0x600004, 0x600005).w(FUNC(seta_state::ipl1_ack_w)); map(0x600006, 0x600007).w(FUNC(seta_state::ipl2_ack_w)); map(0x700400, 0x700fff).ram().share("paletteram1"); // Palette - map(0x800000, 0x803fff).ram().w(FUNC(seta_state::vram_w<0>)).share("vram_0"); // VRAM 0&1 - map(0x880000, 0x883fff).ram().w(FUNC(seta_state::vram_w<1>)).share("vram_1"); // VRAM 2&3 - map(0x900000, 0x900005).ram().share("vctrl_0"); // VRAM 0&1 Ctrl - map(0x980000, 0x980005).ram().share("vctrl_1"); // VRAM 2&3 Ctrl + map(0x800000, 0x803fff).ram().w(m_layers[0], FUNC(x1_012_device::vram_w)).share("layer1"); // VRAM 0&1 + map(0x880000, 0x883fff).ram().w(m_layers[1], FUNC(x1_012_device::vram_w)).share("layer2"); // VRAM 2&3 + map(0x900000, 0x900005).rw(m_layers[0], FUNC(x1_012_device::vctrl_r), FUNC(x1_012_device::vctrl_w)); // VRAM 0&1 Ctrl + map(0x980000, 0x980005).rw(m_layers[1], FUNC(x1_012_device::vctrl_r), FUNC(x1_012_device::vctrl_w)); // VRAM 2&3 Ctrl 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)); @@ -2751,12 +2737,12 @@ void seta_state::magspeed_map(address_map &map) map(0x700000, 0x7003ff).ram(); // Palette RAM (tested) map(0x700400, 0x700fff).ram().share("paletteram1"); // Palette map(0x701000, 0x703fff).ram(); // Palette RAM (tested) - map(0x800000, 0x803fff).ram().w(FUNC(seta_state::vram_w<0>)).share("vram_0"); // VRAM 0&1 + map(0x800000, 0x803fff).ram().w(m_layers[0], FUNC(x1_012_device::vram_w)).share("layer1"); // VRAM 0&1 map(0x804000, 0x807fff).ram(); // tested - map(0x880000, 0x883fff).ram().w(FUNC(seta_state::vram_w<1>)).share("vram_1"); // VRAM 2&3 + map(0x880000, 0x883fff).ram().w(m_layers[1], FUNC(x1_012_device::vram_w)).share("layer2"); // VRAM 2&3 map(0x884000, 0x887fff).ram(); // tested - map(0x900000, 0x900005).ram().share("vctrl_0"); // VRAM 0&1 Ctrl - map(0x980000, 0x980005).ram().share("vctrl_1"); // VRAM 2&3 Ctrl + map(0x900000, 0x900005).rw(m_layers[0], FUNC(x1_012_device::vctrl_r), FUNC(x1_012_device::vctrl_w)); // VRAM 0&1 Ctrl + map(0x980000, 0x980005).rw(m_layers[1], FUNC(x1_012_device::vctrl_r), FUNC(x1_012_device::vctrl_w)); // VRAM 2&3 Ctrl 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)); map(0xa80000, 0xa80001).ram(); // ? $4000 @@ -2820,10 +2806,10 @@ void seta_state::msgundam_map(address_map &map) map(0x800600, 0x800607).ram().rw(m_seta001, FUNC(seta001_device::spritectrl_r16), FUNC(seta001_device::spritectrl_w16)); map(0x880000, 0x880001).ram(); // ? 0x4000 map(0x900000, 0x903fff).ram().rw(m_seta001, FUNC(seta001_device::spritecode_r16), FUNC(seta001_device::spritecode_w16)); // Sprites Code + X + Attr - map(0xa00000, 0xa03fff).ram().w(FUNC(seta_state::vram_w<0>)).share("vram_0"); // VRAM 0&1 - map(0xa80000, 0xa83fff).ram().w(FUNC(seta_state::vram_w<1>)).share("vram_1"); // VRAM 2&3 - map(0xb00000, 0xb00005).ram().share("vctrl_0"); // VRAM 0&1 Ctrl - map(0xb80000, 0xb80005).ram().share("vctrl_1"); // VRAM 2&3 Ctrl + map(0xa00000, 0xa03fff).ram().w(m_layers[0], FUNC(x1_012_device::vram_w)).share("layer1"); // VRAM 0&1 + map(0xa80000, 0xa83fff).ram().w(m_layers[1], FUNC(x1_012_device::vram_w)).share("layer2"); // VRAM 2&3 + map(0xb00000, 0xb00005).rw(m_layers[0], FUNC(x1_012_device::vctrl_r), FUNC(x1_012_device::vctrl_w)); // VRAM 0&1 Ctrl + map(0xb80000, 0xb80005).rw(m_layers[1], FUNC(x1_012_device::vctrl_r), FUNC(x1_012_device::vctrl_w)); // VRAM 2&3 Ctrl map(0xc00000, 0xc03fff).rw(m_x1, FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound map(0xd00000, 0xd00007).rw("pit", FUNC(pit8254_device::read), FUNC(pit8254_device::write)).umask16(0x00ff); } @@ -2843,10 +2829,10 @@ void seta_state::msgundamb_map(address_map &map) map(0x500004, 0x500005).nopw(); map(0x600000, 0x600003).r(FUNC(seta_state::seta_dsw_r)); // DSW map(0x700400, 0x700fff).ram().share("paletteram1"); // Palette - map(0x800000, 0x803fff).ram().w(FUNC(seta_state::vram_w<0>)).share("vram_0"); // VRAM 0&1 - map(0x880000, 0x883fff).ram().w(FUNC(seta_state::vram_w<1>)).share("vram_1"); // VRAM 2&3 - map(0x900000, 0x900005).ram().share("vctrl_0"); // VRAM 0&1 Ctrl - map(0x980000, 0x980005).ram().share("vctrl_1"); // VRAM 2&3 Ctrl + map(0x800000, 0x803fff).ram().w(m_layers[0], FUNC(x1_012_device::vram_w)).share("layer1"); // VRAM 0&1 + map(0x880000, 0x883fff).ram().w(m_layers[1], FUNC(x1_012_device::vram_w)).share("layer2"); // VRAM 2&3 + map(0x900000, 0x900005).rw(m_layers[0], FUNC(x1_012_device::vctrl_r), FUNC(x1_012_device::vctrl_w)); // VRAM 0&1 Ctrl + map(0x980000, 0x980005).rw(m_layers[1], FUNC(x1_012_device::vctrl_r), FUNC(x1_012_device::vctrl_w)); // VRAM 2&3 Ctrl 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)); map(0xa80000, 0xa80001).ram(); // ? 0x4000 @@ -2874,10 +2860,10 @@ void seta_state::oisipuzl_map(address_map &map) map(0x500003, 0x500003).w(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(FUNC(seta_state::vram_w<0>)).share("vram_0"); // VRAM 0&1 - map(0x880000, 0x883fff).ram().w(FUNC(seta_state::vram_w<1>)).share("vram_1"); // VRAM 2&3 - map(0x900000, 0x900005).ram().share("vctrl_0"); // VRAM 0&1 Ctrl - map(0x980000, 0x980005).ram().share("vctrl_1"); // VRAM 2&3 Ctrl + map(0x800000, 0x803fff).ram().w(m_layers[0], FUNC(x1_012_device::vram_w)).share("layer1"); // VRAM 0&1 + map(0x880000, 0x883fff).ram().w(m_layers[1], FUNC(x1_012_device::vram_w)).share("layer2"); // VRAM 2&3 + map(0x900000, 0x900005).rw(m_layers[0], FUNC(x1_012_device::vctrl_r), FUNC(x1_012_device::vctrl_w)); // VRAM 0&1 Ctrl + map(0x980000, 0x980005).rw(m_layers[1], FUNC(x1_012_device::vctrl_r), FUNC(x1_012_device::vctrl_w)); // VRAM 2&3 Ctrl 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)); map(0xa80000, 0xa80001).ram(); // ? 0x4000 @@ -2907,10 +2893,10 @@ void seta_state::triplfun_map(address_map &map) 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(FUNC(seta_state::vram_w<0>)).share("vram_0"); // VRAM 0&1 - map(0x880000, 0x883fff).ram().w(FUNC(seta_state::vram_w<1>)).share("vram_1"); // VRAM 2&3 - map(0x900000, 0x900005).ram().share("vctrl_0"); // VRAM 0&1 Ctrl - map(0x980000, 0x980005).ram().share("vctrl_1"); // VRAM 2&3 Ctrl + map(0x800000, 0x803fff).ram().w(m_layers[0], FUNC(x1_012_device::vram_w)).share("layer1"); // VRAM 0&1 + map(0x880000, 0x883fff).ram().w(m_layers[1], FUNC(x1_012_device::vram_w)).share("layer2"); // VRAM 2&3 + map(0x900000, 0x900005).rw(m_layers[0], FUNC(x1_012_device::vctrl_r), FUNC(x1_012_device::vctrl_w)); // VRAM 0&1 Ctrl + map(0x980000, 0x980005).rw(m_layers[1], FUNC(x1_012_device::vctrl_r), FUNC(x1_012_device::vctrl_w)); // VRAM 2&3 Ctrl 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)); map(0xa80000, 0xa80001).ram(); // ? 0x4000 @@ -3109,10 +3095,10 @@ void seta_state::utoukond_map(address_map &map) map(0x500003, 0x500003).w(FUNC(seta_state::seta_vregs_w)); // Video Registers map(0x600000, 0x600003).r(FUNC(seta_state::seta_dsw_r)); // DSW map(0x700400, 0x700fff).ram().share("paletteram1"); // Palette - map(0x800000, 0x803fff).ram().w(FUNC(seta_state::vram_w<0>)).share("vram_0"); // VRAM 0&1 - map(0x880000, 0x883fff).ram().w(FUNC(seta_state::vram_w<1>)).share("vram_1"); // VRAM 2&3 - map(0x900000, 0x900005).writeonly().share("vctrl_0");// VRAM 0&1 Ctrl - map(0x980000, 0x980005).writeonly().share("vctrl_1");// VRAM 2&3 Ctrl + map(0x800000, 0x803fff).ram().w(m_layers[0], FUNC(x1_012_device::vram_w)).share("layer1"); // VRAM 0&1 + map(0x880000, 0x883fff).ram().w(m_layers[1], FUNC(x1_012_device::vram_w)).share("layer2"); // VRAM 2&3 + map(0x900000, 0x900005).w(m_layers[0], FUNC(x1_012_device::vctrl_w));// VRAM 0&1 Ctrl + map(0x980000, 0x980005).w(m_layers[1], FUNC(x1_012_device::vctrl_w));// VRAM 2&3 Ctrl 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)); map(0xb00000, 0xb03fff).ram().rw(m_seta001, FUNC(seta001_device::spritecode_r16), FUNC(seta001_device::spritecode_w16)); // Sprites Code + X + Attr @@ -3179,10 +3165,10 @@ void seta_state::crazyfgt_map(address_map &map) map(0x650000, 0x650003).w("ymsnd", FUNC(ym3812_device::write)).umask16(0x00ff); map(0x658001, 0x658001).w("oki", FUNC(okim6295_device::write)); map(0x670000, 0x670001).nopr(); // watchdog? - map(0x800000, 0x803fff).w(FUNC(seta_state::vram_w<1>)).share("vram_1"); // VRAM 2 - map(0x880000, 0x883fff).w(FUNC(seta_state::vram_w<0>)).share("vram_0"); // VRAM 0 - map(0x900000, 0x900005).ram().share("vctrl_1"); // VRAM 2&3 Ctrl - map(0x980000, 0x980005).ram().share("vctrl_0"); // VRAM 0&1 Ctrl + map(0x800000, 0x803fff).w(m_layers[1], FUNC(x1_012_device::vram_w)).share("layer2"); // VRAM 2 + map(0x880000, 0x883fff).w(m_layers[0], FUNC(x1_012_device::vram_w)).share("layer1"); // VRAM 0 + map(0x900000, 0x900005).rw(m_layers[1], FUNC(x1_012_device::vctrl_r), FUNC(x1_012_device::vctrl_w)); // VRAM 2&3 Ctrl + map(0x980000, 0x980005).rw(m_layers[0], FUNC(x1_012_device::vctrl_r), FUNC(x1_012_device::vctrl_w)); // VRAM 0&1 Ctrl 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)); map(0xa80000, 0xa80001).nopw(); // ? 0x4000 @@ -3368,8 +3354,8 @@ void jockeyc_state::jockeyc_map(address_map &map) map(0x900000, 0x903fff).rw(m_x1, FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound - map(0xa00000, 0xa00005).writeonly().share("vctrl_0"); // VRAM 0&1 Ctrl - map(0xb00000, 0xb03fff).ram().w(FUNC(jockeyc_state::vram_w<0>)).share("vram_0"); // VRAM 0&1 + map(0xa00000, 0xa00005).w(m_layers[0], FUNC(x1_012_device::vctrl_w)); // VRAM 0&1 Ctrl + map(0xb00000, 0xb03fff).ram().w(m_layers[0], FUNC(x1_012_device::vram_w)).share("layer1"); // VRAM 0&1 map(0xb04000, 0xb0ffff).nopw(); // likely left-over map(0xc00000, 0xc00001).ram(); // ? 0x4000 @@ -3451,8 +3437,8 @@ void jockeyc_state::inttoote_map(address_map &map) map(0x900000, 0x903fff).rw(m_x1, FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound - map(0xa00000, 0xa00005).writeonly().share("vctrl_0"); // VRAM 0&1 Ctrl - map(0xb00000, 0xb03fff).ram().w(FUNC(jockeyc_state::vram_w<0>)).share("vram_0"); // VRAM 0&1 + map(0xa00000, 0xa00005).w(m_layers[0], FUNC(x1_012_device::vctrl_w)); // VRAM 0&1 Ctrl + map(0xb00000, 0xb03fff).ram().w(m_layers[0], FUNC(x1_012_device::vram_w)).share("layer1"); // VRAM 0&1 map(0xc00000, 0xc00001).ram(); // ? 0x4000 @@ -7673,12 +7659,14 @@ static const gfx_layout layout_tilemap_6bpp = Blandia ***************************************************************************/ -static GFXDECODE_START( gfx_blandia ) - GFXDECODE_ENTRY( "gfx1", 0, layout_sprites, 0, 32 ) // [0] Sprites - GFXDECODE_ENTRY( "gfx2", 0, layout_tilemap_6bpp, 16*32+64*32*1, 32 ) // [1] Layer 1 - GFXDECODE_ENTRY( "gfx3", 0, layout_tilemap_6bpp, 16*32+64*32*0, 32 ) // [2] Layer 2 - GFXDECODE_ENTRY( "gfx2", 0, layout_tilemap_6bpp, 16*32+64*32*3, 32 ) // [3] Layer 1 - GFXDECODE_ENTRY( "gfx3", 0, layout_tilemap_6bpp, 16*32+64*32*2, 32 ) // [4] Layer 2 +static GFXDECODE_START( gfx_blandia_layer1 ) + GFXDECODE_ENTRY( "gfx2", 0, layout_tilemap_6bpp, 16*32+64*32*1, 32 ) // [0] Layer 1 + GFXDECODE_ENTRY( "gfx2", 0, layout_tilemap_6bpp, 16*32+64*32*3, 32 ) // [1] Layer 1 +GFXDECODE_END + +static GFXDECODE_START( gfx_blandia_layer2 ) + GFXDECODE_ENTRY( "gfx3", 0, layout_tilemap_6bpp, 16*32+64*32*0, 32 ) // [0] Layer 2 + GFXDECODE_ENTRY( "gfx3", 0, layout_tilemap_6bpp, 16*32+64*32*2, 32 ) // [1] Layer 2 GFXDECODE_END /*************************************************************************** @@ -7686,8 +7674,7 @@ GFXDECODE_END ***************************************************************************/ static GFXDECODE_START( gfx_downtown ) - GFXDECODE_ENTRY( "gfx1", 0, layout_sprites, 0, 32 ) // [0] Sprites - GFXDECODE_ENTRY( "gfx2", 0, layout_tilemap, 0, 32 ) // [1] Layer 1 + GFXDECODE_ENTRY( "gfx2", 0, layout_tilemap, 0, 32 ) // [0] Layer 1 GFXDECODE_END /*************************************************************************** @@ -7695,20 +7682,25 @@ GFXDECODE_END ***************************************************************************/ static GFXDECODE_START( gfx_setaroul ) - GFXDECODE_ENTRY( "gfx1", 0, layout_sprites, 0x100, 16 ) // [0] Sprites - GFXDECODE_ENTRY( "gfx2", 0, layout_tilemap_8bpp, 0, 32 ) // [1] Layer 1 + GFXDECODE_ENTRY( "gfx2", 0, layout_tilemap_8bpp, 0, 32 ) // [0] Layer 1 +GFXDECODE_END + +static GFXDECODE_START( gfx_setaroul_sprites ) + GFXDECODE_ENTRY( "gfx1", 0, layout_sprites, 0x100, 16 ) // Sprites GFXDECODE_END /*************************************************************************** J.J.Squawkers ***************************************************************************/ -static GFXDECODE_START( gfx_jjsquawk ) - GFXDECODE_ENTRY( "gfx1", 0, layout_sprites, 0, 32 ) // [0] Sprites - GFXDECODE_ENTRY( "gfx2", 0, layout_tilemap_6bpp, 16*32+64*32*0, 32 ) // [1] Layer 1 - GFXDECODE_ENTRY( "gfx3", 0, layout_tilemap_6bpp, 16*32+64*32*1, 32 ) // [2] Layer 2 - GFXDECODE_ENTRY( "gfx2", 0, layout_tilemap_6bpp, 16*32+64*32*2, 32 ) // [3] Layer 1 - GFXDECODE_ENTRY( "gfx3", 0, layout_tilemap_6bpp, 16*32+64*32*3, 32 ) // [4] Layer 2 +static GFXDECODE_START( gfx_jjsquawk_layer1 ) + GFXDECODE_ENTRY( "gfx2", 0, layout_tilemap_6bpp, 16*32+64*32*0, 32 ) // [0] Layer 1 + GFXDECODE_ENTRY( "gfx2", 0, layout_tilemap_6bpp, 16*32+64*32*2, 32 ) // [1] Layer 1 +GFXDECODE_END + +static GFXDECODE_START( gfx_jjsquawk_layer2 ) + GFXDECODE_ENTRY( "gfx3", 0, layout_tilemap_6bpp, 16*32+64*32*1, 32 ) // [0] Layer 2 + GFXDECODE_ENTRY( "gfx3", 0, layout_tilemap_6bpp, 16*32+64*32*3, 32 ) // [1] Layer 2 GFXDECODE_END /* The bitplanes are packed togheter: 4 bits in one rom, 2 bits in another. @@ -7729,36 +7721,40 @@ static const gfx_layout layout_tilemap_6bpp_jjsquawkb = 16*16*4 }; -static GFXDECODE_START( gfx_jjsquawkb ) - GFXDECODE_ENTRY( "gfx1", 0, layout_sprites, 0, 32 ) // [0] Sprites - GFXDECODE_ENTRY( "gfx2", 0, layout_tilemap_6bpp_jjsquawkb, 16*32+64*32*0, 32 ) // [1] Layer 1 - GFXDECODE_ENTRY( "gfx3", 0, layout_tilemap_6bpp_jjsquawkb, 16*32+64*32*1, 32 ) // [2] Layer 2 - GFXDECODE_ENTRY( "gfx2", 0, layout_tilemap_6bpp_jjsquawkb, 16*32+64*32*2, 32 ) // [3] Layer 1 - GFXDECODE_ENTRY( "gfx3", 0, layout_tilemap_6bpp_jjsquawkb, 16*32+64*32*3, 32 ) // [4] Layer 2 +static GFXDECODE_START( gfx_jjsquawkb_layer1 ) + GFXDECODE_ENTRY( "gfx2", 0, layout_tilemap_6bpp_jjsquawkb, 16*32+64*32*0, 32 ) // [0] Layer 1 + GFXDECODE_ENTRY( "gfx2", 0, layout_tilemap_6bpp_jjsquawkb, 16*32+64*32*2, 32 ) // [1] Layer 1 +GFXDECODE_END + +static GFXDECODE_START( gfx_jjsquawkb_layer2 ) + GFXDECODE_ENTRY( "gfx3", 0, layout_tilemap_6bpp_jjsquawkb, 16*32+64*32*1, 32 ) // [0] Layer 2 + GFXDECODE_ENTRY( "gfx3", 0, layout_tilemap_6bpp_jjsquawkb, 16*32+64*32*3, 32 ) // [1] Layer 2 GFXDECODE_END /*************************************************************************** Mobile Suit Gundam ***************************************************************************/ -static GFXDECODE_START( gfx_msgundam ) - GFXDECODE_ENTRY( "gfx1", 0, layout_sprites, 0, 32 ) // [0] Sprites - GFXDECODE_ENTRY( "gfx2", 0, layout_tilemap, 0x400, 32 ) // [1] Layer 1 - GFXDECODE_ENTRY( "gfx3", 0, layout_tilemap, 0x200, 32 ) // [2] Layer 2 +static GFXDECODE_START( gfx_msgundam_layer1 ) + GFXDECODE_ENTRY( "gfx2", 0, layout_tilemap, 0x400, 32 ) // [0] Layer 1 +GFXDECODE_END + +static GFXDECODE_START( gfx_msgundam_layer2 ) + GFXDECODE_ENTRY( "gfx3", 0, layout_tilemap, 0x200, 32 ) // [0] Layer 2 GFXDECODE_END /*************************************************************************** Thundercade ***************************************************************************/ -static GFXDECODE_START( gfx_tndrcade ) - GFXDECODE_ENTRY( "gfx1", 0, layout_sprites, 0, 32 ) // [0] Sprites +static GFXDECODE_START( gfx_sprites ) + GFXDECODE_ENTRY( "gfx1", 0, layout_sprites, 0, 32 ) // Sprites GFXDECODE_END // TODO: pairlove sets up two identical palette banks at 0-1ff and 0x200-0x3ff in-game, 0x200-0x3ff only in service mode. // Maybe there's a coloroffsetregister to somewhere? static GFXDECODE_START( gfx_pairlove ) - GFXDECODE_ENTRY( "gfx1", 0, layout_sprites, 0x200, 32 ) // [0] Sprites + GFXDECODE_ENTRY( "gfx1", 0, layout_sprites, 0x200, 32 ) // Sprites GFXDECODE_END @@ -7814,9 +7810,8 @@ GFXDECODE_END ***************************************************************************/ static GFXDECODE_START( gfx_usclssic ) - GFXDECODE_ENTRY( "gfx1", 0, layout_sprites, 0, 32 ) // [0] Sprites - GFXDECODE_ENTRY( "gfx2", 0, layout_tilemap_6bpp, 512+64*32*0, 32 ) // [1] Layer 1 - GFXDECODE_ENTRY( "gfx2", 0, layout_tilemap_6bpp, 512+64*32*1, 32 ) // [2] Layer 1 + GFXDECODE_ENTRY( "gfx2", 0, layout_tilemap_6bpp, 512+64*32*0, 32 ) // [0] Layer 1 + GFXDECODE_ENTRY( "gfx2", 0, layout_tilemap_6bpp, 512+64*32*1, 32 ) // [1] Layer 1 GFXDECODE_END @@ -7824,11 +7819,13 @@ GFXDECODE_END Zing Zing Zip ***************************************************************************/ -static GFXDECODE_START( gfx_zingzip ) - GFXDECODE_ENTRY( "gfx1", 0, layout_sprites, 16*32*0, 32 ) // [0] Sprites - GFXDECODE_ENTRY( "gfx2", 0, layout_tilemap_6bpp, 16*32*2, 32 ) // [1] Layer 1 - GFXDECODE_ENTRY( "gfx3", 0, layout_tilemap, 16*32*1, 32 ) // [2] Layer 2 - GFXDECODE_ENTRY( "gfx2", 0, layout_tilemap_6bpp, 16*32*2+64*32*1, 32 ) // [3] Layer 1 +static GFXDECODE_START( gfx_zingzip_layer1 ) + GFXDECODE_ENTRY( "gfx2", 0, layout_tilemap_6bpp, 16*32*2, 32 ) // [0] Layer 1 + GFXDECODE_ENTRY( "gfx2", 0, layout_tilemap_6bpp, 16*32*2+64*32*1, 32 ) // [1] Layer 1 +GFXDECODE_END + +static GFXDECODE_START( gfx_zingzip_layer2 ) + GFXDECODE_ENTRY( "gfx3", 0, layout_tilemap, 16*32*1, 32 ) // [0] Layer 2 GFXDECODE_END static const gfx_layout layout_zzbl = @@ -7854,11 +7851,17 @@ static const gfx_layout layout_zzbl_6bpp = }; -static GFXDECODE_START( gfx_zingzipbl ) +static GFXDECODE_START( gfx_zingzipbl_sprites ) GFXDECODE_ENTRY( "gfx1", 0, layout_zzbl, 16*32*0, 32 ) // [0] Sprites - GFXDECODE_ENTRY( "gfx2", 0, layout_zzbl_6bpp, 16*32*2, 32 ) // [1] Layer 1 - GFXDECODE_ENTRY( "gfx3", 0, layout_zzbl, 16*32*1, 32 ) // [2] Layer 2 - GFXDECODE_ENTRY( "gfx2", 0, layout_zzbl_6bpp, 16*32*2+64*32*1, 32 ) // [3] Layer 1 +GFXDECODE_END + +static GFXDECODE_START( gfx_zingzipbl_layer1 ) + GFXDECODE_ENTRY( "gfx2", 0, layout_zzbl_6bpp, 16*32*2, 32 ) // [0] Layer 1 + GFXDECODE_ENTRY( "gfx2", 0, layout_zzbl_6bpp, 16*32*2+64*32*1, 32 ) // [1] Layer 1 +GFXDECODE_END + +static GFXDECODE_START( gfx_zingzipbl_layer2 ) + GFXDECODE_ENTRY( "gfx3", 0, layout_zzbl, 16*32*1, 32 ) // [0] Layer 2 GFXDECODE_END @@ -7929,8 +7932,7 @@ void seta_state::tndrcade(machine_config &config) m_subcpu->set_addrmap(AS_PROGRAM, &seta_state::tndrcade_sub_map); TIMER(config, "scantimer").configure_scanline(FUNC(seta_state::tndrcade_sub_interrupt), "screen", 0, 1); - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag(m_gfxdecode); + SETA001_SPRITE(config, m_seta001, 16000000, m_palette, gfx_sprites); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback)); /* video hardware */ @@ -7942,10 +7944,9 @@ void seta_state::tndrcade(machine_config &config) screen.set_screen_update(FUNC(seta_state::screen_update_seta_no_layers)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_tndrcade); PALETTE(config, m_palette).set_entries(512); // sprites only - MCFG_VIDEO_START_OVERRIDE(seta_state,seta_no_layers) + MCFG_VIDEO_START_OVERRIDE(seta_state,seta) /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -7981,8 +7982,7 @@ void seta_state::twineagl(machine_config &config) m_subcpu->set_addrmap(AS_PROGRAM, &seta_state::twineagl_sub_map); TIMER(config, "s_scantimer").configure_scanline(FUNC(seta_state::seta_sub_interrupt), "screen", 0, 1); - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag(m_gfxdecode); + SETA001_SPRITE(config, m_seta001, 16000000, m_palette, gfx_sprites); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback)); /* video hardware */ @@ -7994,10 +7994,10 @@ void seta_state::twineagl(machine_config &config) screen.set_screen_update(FUNC(seta_state::screen_update_seta)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_downtown); + X1_012(config, m_layers[0], m_palette, gfx_downtown).set_tile_offset_callback(FUNC(seta_state::twineagl_tile_offset)); PALETTE(config, m_palette).set_entries(512); - MCFG_VIDEO_START_OVERRIDE(seta_state,twineagl_1_layer) + MCFG_VIDEO_START_OVERRIDE(seta_state,seta) /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -8027,8 +8027,7 @@ void seta_state::downtown(machine_config &config) m_subcpu->set_addrmap(AS_PROGRAM, &seta_state::downtown_sub_map); TIMER(config, "s_scantimer").configure_scanline(FUNC(seta_state::seta_sub_interrupt), "screen", 0, 1); - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag(m_gfxdecode); + SETA001_SPRITE(config, m_seta001, 16'000'000, m_palette, gfx_sprites); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback)); /* video hardware */ @@ -8040,10 +8039,10 @@ void seta_state::downtown(machine_config &config) screen.set_screen_update(FUNC(seta_state::screen_update_seta)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_downtown); + X1_012(config, m_layers[0], m_palette, gfx_downtown).set_tile_offset_callback(FUNC(seta_state::twineagl_tile_offset)); PALETTE(config, m_palette).set_entries(512); - MCFG_VIDEO_START_OVERRIDE(seta_state,seta_1_layer) + MCFG_VIDEO_START_OVERRIDE(seta_state,seta) /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -8081,6 +8080,9 @@ TIMER_DEVICE_CALLBACK_MEMBER(seta_state::calibr50_interrupt) void usclssic_state::machine_start() { m_buttonmux->ab_w(0xff); + + save_item(NAME(m_port_select)); + save_item(NAME(m_tiles_offset)); } @@ -8108,8 +8110,7 @@ void usclssic_state::usclssic(machine_config &config) MCFG_MACHINE_RESET_OVERRIDE(usclssic_state,calibr50) - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag(m_gfxdecode); + SETA001_SPRITE(config, m_seta001, 16000000, m_palette, gfx_sprites); m_seta001->set_gfxbank_callback(FUNC(usclssic_state::setac_gfxbank_callback)); /* video hardware */ @@ -8121,10 +8122,10 @@ void usclssic_state::usclssic(machine_config &config) screen.set_screen_update(FUNC(usclssic_state::screen_update_usclssic)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_usclssic); + X1_012(config, m_layers[0], m_palette, gfx_usclssic).set_tile_offset_callback(FUNC(usclssic_state::tile_offset)); PALETTE(config, m_palette, FUNC(usclssic_state::usclssic_palette), 16*32 + 64*32*2, 0x400); // sprites, layer - layer is 6 planes deep - MCFG_VIDEO_START_OVERRIDE(usclssic_state,seta_1_layer) + MCFG_VIDEO_START_OVERRIDE(usclssic_state,seta) /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -8168,8 +8169,7 @@ void seta_state::calibr50(machine_config &config) MCFG_MACHINE_RESET_OVERRIDE(seta_state,calibr50) - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag(m_gfxdecode); + SETA001_SPRITE(config, m_seta001, XTAL(16'000'000), m_palette, gfx_sprites); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback)); /* video hardware */ @@ -8181,10 +8181,10 @@ void seta_state::calibr50(machine_config &config) screen.set_screen_update(FUNC(seta_state::screen_update_seta)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_downtown); + X1_012(config, m_layers[0], m_palette, gfx_downtown); PALETTE(config, m_palette).set_entries(512); - MCFG_VIDEO_START_OVERRIDE(seta_state,seta_1_layer) + MCFG_VIDEO_START_OVERRIDE(seta_state,seta) /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -8217,8 +8217,7 @@ void seta_state::metafox(machine_config &config) m_subcpu->set_addrmap(AS_PROGRAM, &seta_state::metafox_sub_map); TIMER(config, "s_scantimer").configure_scanline(FUNC(seta_state::seta_sub_interrupt), "screen", 0, 1); - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag(m_gfxdecode); + SETA001_SPRITE(config, m_seta001, 16000000, m_palette, gfx_sprites); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback)); /* video hardware */ @@ -8230,10 +8229,10 @@ void seta_state::metafox(machine_config &config) screen.set_screen_update(FUNC(seta_state::screen_update_seta)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_downtown); + X1_012(config, m_layers[0], m_palette, gfx_downtown).set_tile_offset_callback(FUNC(seta_state::twineagl_tile_offset)); PALETTE(config, m_palette).set_entries(512); - MCFG_VIDEO_START_OVERRIDE(seta_state,seta_1_layer) + MCFG_VIDEO_START_OVERRIDE(seta_state,seta) /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -8257,8 +8256,7 @@ void seta_state::atehate(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::atehate_map); TIMER(config, "scantimer").configure_scanline(FUNC(seta_state::seta_interrupt_1_and_2), "screen", 0, 1); - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag(m_gfxdecode); + SETA001_SPRITE(config, m_seta001, 16000000, m_palette, gfx_sprites); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback)); /* video hardware */ @@ -8270,10 +8268,9 @@ void seta_state::atehate(machine_config &config) screen.set_screen_update(FUNC(seta_state::screen_update_seta_no_layers)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_tndrcade); PALETTE(config, m_palette).set_entries(512); // sprites only - MCFG_VIDEO_START_OVERRIDE(seta_state,seta_no_layers) + MCFG_VIDEO_START_OVERRIDE(seta_state,seta) /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -8300,8 +8297,7 @@ void seta_state::blandia(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::blandia_map); TIMER(config, "scantimer").configure_scanline(FUNC(seta_state::seta_interrupt_2_and_4), "screen", 0, 1); - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag(m_gfxdecode); + SETA001_SPRITE(config, m_seta001, 16000000, m_palette, gfx_sprites); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback)); /* video hardware */ @@ -8315,10 +8311,11 @@ void seta_state::blandia(machine_config &config) screen.screen_vblank().set(FUNC(seta_state::screen_vblank_seta_buffer_sprites)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_blandia); + X1_012(config, m_layers[0], m_palette, gfx_blandia_layer1); + X1_012(config, m_layers[1], m_palette, gfx_blandia_layer2); PALETTE(config, m_palette, FUNC(seta_state::blandia_palette), (16*32 + 64*32*4)*2, 0x600*2); // sprites, layer1, layer2, palette effect - layers 1&2 are 6 planes deep - MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) + MCFG_VIDEO_START_OVERRIDE(seta_state,seta) /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -8335,8 +8332,7 @@ void seta_state::blandiap(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::blandiap_map); TIMER(config, "scantimer").configure_scanline(FUNC(seta_state::seta_interrupt_2_and_4), "screen", 0, 1); - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag(m_gfxdecode); + SETA001_SPRITE(config, m_seta001, 16000000, m_palette, gfx_sprites); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback)); /* video hardware */ @@ -8350,10 +8346,11 @@ void seta_state::blandiap(machine_config &config) screen.screen_vblank().set(FUNC(seta_state::screen_vblank_seta_buffer_sprites)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_blandia); + X1_012(config, m_layers[0], m_palette, gfx_blandia_layer1); + X1_012(config, m_layers[1], m_palette, gfx_blandia_layer2); PALETTE(config, m_palette, FUNC(seta_state::blandia_palette), (16*32 + 64*32*4)*2, 0x600*2); // sprites, layer1, layer2, palette effect - layers 1&2 are 6 planes deep - MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) + MCFG_VIDEO_START_OVERRIDE(seta_state,seta) /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -8375,8 +8372,7 @@ void seta_state::blockcar(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::blockcar_map); m_maincpu->set_vblank_int("screen", FUNC(seta_state::irq3_line_hold)); - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag(m_gfxdecode); + SETA001_SPRITE(config, m_seta001, 16000000, m_palette, gfx_sprites); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback)); /* video hardware */ @@ -8388,10 +8384,9 @@ void seta_state::blockcar(machine_config &config) screen.set_screen_update(FUNC(seta_state::screen_update_seta_no_layers)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_tndrcade); PALETTE(config, m_palette).set_entries(512); // sprites only - MCFG_VIDEO_START_OVERRIDE(seta_state,seta_no_layers) + MCFG_VIDEO_START_OVERRIDE(seta_state,seta) /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -8449,8 +8444,7 @@ void seta_state::daioh(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::daioh_map); TIMER(config, "scantimer").configure_scanline(FUNC(seta_state::seta_interrupt_1_and_2), "screen", 0, 1); - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag(m_gfxdecode); + SETA001_SPRITE(config, m_seta001, 16'000'000, m_palette, gfx_sprites); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback)); /* video hardware */ @@ -8462,10 +8456,11 @@ void seta_state::daioh(machine_config &config) screen.set_screen_update(FUNC(seta_state::screen_update_seta)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_msgundam); + X1_012(config, m_layers[0], m_palette, gfx_msgundam_layer1); + X1_012(config, m_layers[1], m_palette, gfx_msgundam_layer2); PALETTE(config, m_palette).set_entries(512 * 3); // sprites, layer1, layer2 - MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) + MCFG_VIDEO_START_OVERRIDE(seta_state,seta) /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -8504,8 +8499,7 @@ void seta_state::drgnunit(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::drgnunit_map); TIMER(config, "scantimer").configure_scanline(FUNC(seta_state::seta_interrupt_1_and_2), "screen", 0, 1); - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag(m_gfxdecode); + SETA001_SPRITE(config, m_seta001, 16000000, m_palette, gfx_sprites); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback)); /* video hardware */ @@ -8518,10 +8512,10 @@ void seta_state::drgnunit(machine_config &config) screen.screen_vblank().set(FUNC(seta_state::screen_vblank_seta_buffer_sprites)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_downtown); + X1_012(config, m_layers[0], m_palette, gfx_downtown); PALETTE(config, m_palette).set_entries(512); - MCFG_VIDEO_START_OVERRIDE(seta_state,seta_1_layer) + MCFG_VIDEO_START_OVERRIDE(seta_state,seta) /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -8569,8 +8563,7 @@ void setaroul_state::setaroul(machine_config &config) MCFG_MACHINE_START_OVERRIDE(setaroul_state, setaroul) MCFG_MACHINE_RESET_OVERRIDE(setaroul_state, setaroul) - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag(m_gfxdecode); + SETA001_SPRITE(config, m_seta001, 16'000'000, m_palette, gfx_setaroul_sprites); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback)); NVRAM(config, "nvram", nvram_device::DEFAULT_RANDOM); @@ -8590,10 +8583,10 @@ void setaroul_state::setaroul(machine_config &config) screen.screen_vblank().set(FUNC(setaroul_state::screen_vblank)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_setaroul); + X1_012(config, m_layers[0], m_palette, gfx_setaroul); PALETTE(config, m_palette, FUNC(setaroul_state::setaroul_palette), 512); - MCFG_VIDEO_START_OVERRIDE(setaroul_state,setaroul_1_layer) + MCFG_VIDEO_START_OVERRIDE(setaroul_state,setaroul) /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); @@ -8620,8 +8613,7 @@ void seta_state::eightfrc(machine_config &config) TIMER(config, "scantimer").configure_scanline(FUNC(seta_state::seta_interrupt_1_and_2), "screen", 0, 1); WATCHDOG_TIMER(config, "watchdog"); - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag(m_gfxdecode); + SETA001_SPRITE(config, m_seta001, 16000000, m_palette, gfx_sprites); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback)); /* video hardware */ @@ -8633,10 +8625,11 @@ void seta_state::eightfrc(machine_config &config) screen.set_screen_update(FUNC(seta_state::screen_update_seta)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_msgundam); + X1_012(config, m_layers[0], m_palette, gfx_msgundam_layer1); + X1_012(config, m_layers[1], m_palette, gfx_msgundam_layer2); PALETTE(config, m_palette).set_entries(512 * 3); // sprites, layer1, layer2 - MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) + MCFG_VIDEO_START_OVERRIDE(seta_state,seta) /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -8664,8 +8657,7 @@ void seta_state::extdwnhl(machine_config &config) TIMER(config, "scantimer").configure_scanline(FUNC(seta_state::seta_interrupt_1_and_2), "screen", 0, 1); WATCHDOG_TIMER(config, "watchdog"); - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag(m_gfxdecode); + SETA001_SPRITE(config, m_seta001, 16000000, m_palette, gfx_sprites); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback)); /* video hardware */ @@ -8677,10 +8669,11 @@ void seta_state::extdwnhl(machine_config &config) screen.set_screen_update(FUNC(seta_state::screen_update_seta)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_zingzip); + X1_012(config, m_layers[0], m_palette, gfx_zingzip_layer1); + X1_012(config, m_layers[1], m_palette, gfx_zingzip_layer2); PALETTE(config, m_palette, FUNC(seta_state::zingzip_palette), 16*32 + 16*32 + 64*32*2, 0x600); // sprites, layer2, layer1 - layer 1 gfx is 6 planes deep - MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) + MCFG_VIDEO_START_OVERRIDE(seta_state,seta) /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); @@ -8729,8 +8722,7 @@ void seta_state::gundhara(machine_config &config) MCFG_MACHINE_START_OVERRIDE(seta_state, wrofaero ) #endif // USE_uPD71054_TIMER - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag(m_gfxdecode); + SETA001_SPRITE(config, m_seta001, 16000000, m_palette, gfx_sprites); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback)); /* video hardware */ @@ -8742,10 +8734,11 @@ void seta_state::gundhara(machine_config &config) screen.set_screen_update(FUNC(seta_state::screen_update_seta)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_jjsquawk); + X1_012(config, m_layers[0], m_palette, gfx_jjsquawk_layer1); + X1_012(config, m_layers[1], m_palette, gfx_jjsquawk_layer2); PALETTE(config, m_palette, FUNC(seta_state::gundhara_palette), 16*32 + 64*32*4, 0x600); // sprites, layer2, layer1 - layers are 6 planes deep (seta_state,but have only 4 palettes) - MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) + MCFG_VIDEO_START_OVERRIDE(seta_state,seta) /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -8798,8 +8791,7 @@ void seta_state::jjsquawk(machine_config &config) TIMER(config, "scantimer").configure_scanline(FUNC(seta_state::seta_interrupt_1_and_2), "screen", 0, 1); WATCHDOG_TIMER(config, "watchdog"); - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag(m_gfxdecode); + SETA001_SPRITE(config, m_seta001, 16000000, m_palette, gfx_sprites); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback)); /* video hardware */ @@ -8811,10 +8803,11 @@ void seta_state::jjsquawk(machine_config &config) screen.set_screen_update(FUNC(seta_state::screen_update_seta)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_jjsquawk); + X1_012(config, m_layers[0], m_palette, gfx_jjsquawk_layer1); + X1_012(config, m_layers[1], m_palette, gfx_jjsquawk_layer2); PALETTE(config, m_palette, FUNC(seta_state::jjsquawk_palette), 16*32 + 64*32*4, 0x600); // sprites, layer2, layer1 - layers are 6 planes deep - MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) + MCFG_VIDEO_START_OVERRIDE(seta_state,seta) /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -8830,8 +8823,7 @@ void seta_state::jjsquawb(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::jjsquawb_map); TIMER(config, "scantimer").configure_scanline(FUNC(seta_state::seta_interrupt_1_and_2), "screen", 0, 1); - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag(m_gfxdecode); + SETA001_SPRITE(config, m_seta001, 16000000, m_palette, gfx_sprites); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback)); /* video hardware */ @@ -8843,10 +8835,11 @@ void seta_state::jjsquawb(machine_config &config) screen.set_screen_update(FUNC(seta_state::screen_update_seta)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_jjsquawkb); + X1_012(config, m_layers[0], m_palette, gfx_jjsquawkb_layer1); + X1_012(config, m_layers[1], m_palette, gfx_jjsquawkb_layer2); PALETTE(config, m_palette, FUNC(seta_state::jjsquawk_palette), 16*32 + 64*32*4, 0x600); // sprites, layer2, layer1 - layers are 6 planes deep - MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) + MCFG_VIDEO_START_OVERRIDE(seta_state,seta) /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -8874,8 +8867,7 @@ void seta_state::kamenrid(machine_config &config) pit.set_clk<0>(16000000/2/8); pit.out_handler<0>().set(FUNC(seta_state::pit_out0)); - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag(m_gfxdecode); + SETA001_SPRITE(config, m_seta001, 16000000, m_palette, gfx_sprites); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback)); /* video hardware */ @@ -8887,10 +8879,11 @@ void seta_state::kamenrid(machine_config &config) screen.set_screen_update(FUNC(seta_state::screen_update_seta)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_msgundam); + X1_012(config, m_layers[0], m_palette, gfx_msgundam_layer1); + X1_012(config, m_layers[1], m_palette, gfx_msgundam_layer2); PALETTE(config, m_palette).set_entries(512 * 3); // sprites, layer1, layer2 - MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) + MCFG_VIDEO_START_OVERRIDE(seta_state,seta) /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -8913,8 +8906,7 @@ void seta_state::orbs(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::orbs_map); TIMER(config, "scantimer").configure_scanline(FUNC(seta_state::seta_interrupt_1_and_2), "screen", 0, 1); - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag(m_gfxdecode); + SETA001_SPRITE(config, m_seta001, 14318180, m_palette, gfx_sprites); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback)); /* video hardware */ @@ -8926,10 +8918,9 @@ void seta_state::orbs(machine_config &config) screen.set_screen_update(FUNC(seta_state::screen_update_seta_no_layers)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_tndrcade); PALETTE(config, m_palette).set_entries(512); // sprites only - MCFG_VIDEO_START_OVERRIDE(seta_state,seta_no_layers) + MCFG_VIDEO_START_OVERRIDE(seta_state,seta) /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); @@ -8954,8 +8945,7 @@ void seta_state::keroppij(machine_config &config) MCFG_MACHINE_START_OVERRIDE(seta_state,keroppi) - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag(m_gfxdecode); + SETA001_SPRITE(config, m_seta001, 14318180, m_palette, gfx_sprites); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback)); /* video hardware */ @@ -8967,10 +8957,9 @@ void seta_state::keroppij(machine_config &config) screen.set_screen_update(FUNC(seta_state::screen_update_seta_no_layers)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_tndrcade); PALETTE(config, m_palette).set_entries(512); // sprites only - MCFG_VIDEO_START_OVERRIDE(seta_state,seta_no_layers) + MCFG_VIDEO_START_OVERRIDE(seta_state,seta) /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); @@ -8984,7 +8973,6 @@ void seta_state::keroppij(machine_config &config) void seta_state::keroppi(machine_config &config) { keroppij(config); - m_gfxdecode->set_info(gfx_tndrcade); } @@ -9007,8 +8995,7 @@ void seta_state::krzybowl(machine_config &config) upd2.set_portx_tag("TRACK2_X"); upd2.set_porty_tag("TRACK2_Y"); - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag(m_gfxdecode); + SETA001_SPRITE(config, m_seta001, 16000000, m_palette, gfx_sprites); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback)); /* video hardware */ @@ -9020,10 +9007,9 @@ void seta_state::krzybowl(machine_config &config) screen.set_screen_update(FUNC(seta_state::screen_update_seta_no_layers)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_tndrcade); PALETTE(config, m_palette).set_entries(512); // sprites only - MCFG_VIDEO_START_OVERRIDE(seta_state,seta_no_layers) + MCFG_VIDEO_START_OVERRIDE(seta_state,seta) /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -9049,8 +9035,7 @@ void seta_state::madshark(machine_config &config) pit.set_clk<0>(16000000/2/8); pit.out_handler<0>().set(FUNC(seta_state::pit_out0)); - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag(m_gfxdecode); + SETA001_SPRITE(config, m_seta001, 16000000, m_palette, gfx_sprites); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback)); WATCHDOG_TIMER(config, "watchdog"); @@ -9064,10 +9049,11 @@ void seta_state::madshark(machine_config &config) screen.set_screen_update(FUNC(seta_state::screen_update_seta)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_jjsquawk); + X1_012(config, m_layers[0], m_palette, gfx_jjsquawk_layer1); + X1_012(config, m_layers[1], m_palette, gfx_jjsquawk_layer2); PALETTE(config, m_palette, FUNC(seta_state::jjsquawk_palette), 16*32 + 64*32*4, 0x600); // sprites, layer2, layer1 - layers are 6 planes deep - MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) + MCFG_VIDEO_START_OVERRIDE(seta_state,seta) /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -9099,8 +9085,7 @@ void seta_state::magspeed(machine_config &config) pit.set_clk<0>(16000000/2/8); pit.out_handler<0>().set(FUNC(seta_state::pit_out0)); - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag(m_gfxdecode); + SETA001_SPRITE(config, m_seta001, 16000000, m_palette, gfx_sprites); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback)); /* video hardware */ @@ -9112,10 +9097,11 @@ void seta_state::magspeed(machine_config &config) screen.set_screen_update(FUNC(seta_state::screen_update_seta)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_msgundam); + X1_012(config, m_layers[0], m_palette, gfx_msgundam_layer1); + X1_012(config, m_layers[1], m_palette, gfx_msgundam_layer2); PALETTE(config, m_palette).set_entries(512 * 3); // sprites, layer1, layer2 - MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) + MCFG_VIDEO_START_OVERRIDE(seta_state,seta) /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -9142,8 +9128,7 @@ void seta_state::msgundam(machine_config &config) pit.set_clk<0>(16000000/2/8); pit.out_handler<0>().set(FUNC(seta_state::pit_out0)); - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag(m_gfxdecode); + SETA001_SPRITE(config, m_seta001, 16000000, m_palette, gfx_sprites); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback)); /* video hardware */ @@ -9156,10 +9141,11 @@ void seta_state::msgundam(machine_config &config) screen.screen_vblank().set(FUNC(seta_state::screen_vblank_seta_buffer_sprites)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_msgundam); + X1_012(config, m_layers[0], m_palette, gfx_msgundam_layer1); + X1_012(config, m_layers[1], m_palette, gfx_msgundam_layer2); PALETTE(config, m_palette).set_entries(512 * 3); // sprites, layer1, layer2 - MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) + MCFG_VIDEO_START_OVERRIDE(seta_state,seta) /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -9186,8 +9172,7 @@ void seta_state::oisipuzl(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::oisipuzl_map); TIMER(config, "scantimer").configure_scanline(FUNC(seta_state::seta_interrupt_1_and_2), "screen", 0, 1); - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag(m_gfxdecode); + SETA001_SPRITE(config, m_seta001, 16000000, m_palette, gfx_sprites); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback)); /* video hardware */ @@ -9199,10 +9184,11 @@ void seta_state::oisipuzl(machine_config &config) screen.set_screen_update(FUNC(seta_state::screen_update_seta)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_msgundam); + X1_012(config, m_layers[0], m_palette, gfx_msgundam_layer1); + X1_012(config, m_layers[1], m_palette, gfx_msgundam_layer2); PALETTE(config, m_palette).set_entries(512 * 3); // sprites, layer1, layer2 - MCFG_VIDEO_START_OVERRIDE(seta_state, oisipuzl_2_layers) // flip is inverted for the tilemaps + MCFG_VIDEO_START_OVERRIDE(seta_state, oisipuzl) // flip is inverted for the tilemaps /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); @@ -9227,8 +9213,7 @@ void seta_state::triplfun(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::triplfun_map); m_maincpu->set_vblank_int("screen", FUNC(seta_state::irq3_line_hold)); - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag(m_gfxdecode); + SETA001_SPRITE(config, m_seta001, 16000000, m_palette, gfx_sprites); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback)); /* video hardware */ @@ -9240,10 +9225,11 @@ void seta_state::triplfun(machine_config &config) screen.set_screen_update(FUNC(seta_state::screen_update_seta)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_msgundam); + X1_012(config, m_layers[0], m_palette, gfx_msgundam_layer1); + X1_012(config, m_layers[1], m_palette, gfx_msgundam_layer2); PALETTE(config, m_palette).set_entries(512 * 3); // sprites, layer1, layer2 - MCFG_VIDEO_START_OVERRIDE(seta_state, oisipuzl_2_layers) // flip is inverted for the tilemaps + MCFG_VIDEO_START_OVERRIDE(seta_state, oisipuzl) // flip is inverted for the tilemaps /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); @@ -9274,8 +9260,7 @@ void kiwame_state::kiwame(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag(m_gfxdecode); + SETA001_SPRITE(config, m_seta001, 16000000, m_palette, gfx_sprites); m_seta001->set_gfxbank_callback(FUNC(kiwame_state::setac_gfxbank_callback)); /* video hardware */ @@ -9288,10 +9273,9 @@ void kiwame_state::kiwame(machine_config &config) screen.screen_vblank().set(FUNC(kiwame_state::kiwame_vblank)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_tndrcade); PALETTE(config, m_palette).set_entries(512); // sprites only - MCFG_VIDEO_START_OVERRIDE(kiwame_state,seta_no_layers) + MCFG_VIDEO_START_OVERRIDE(kiwame_state,seta) /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); @@ -9318,8 +9302,7 @@ void seta_state::rezon(machine_config &config) WATCHDOG_TIMER(config, "watchdog"); - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag(m_gfxdecode); + SETA001_SPRITE(config, m_seta001, 16000000, m_palette, gfx_sprites); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback)); /* video hardware */ @@ -9331,10 +9314,11 @@ void seta_state::rezon(machine_config &config) screen.set_screen_update(FUNC(seta_state::screen_update_seta)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_msgundam); + X1_012(config, m_layers[0], m_palette, gfx_msgundam_layer1); + X1_012(config, m_layers[1], m_palette, gfx_msgundam_layer2); PALETTE(config, m_palette).set_entries(512 * 3); // sprites, layer1, layer2 - MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) + MCFG_VIDEO_START_OVERRIDE(seta_state,seta) /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -9357,8 +9341,7 @@ void seta_state::thunderl(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::thunderl_map); m_maincpu->set_vblank_int("screen", FUNC(seta_state::irq2_line_assert)); - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag(m_gfxdecode); + SETA001_SPRITE(config, m_seta001, 16000000, m_palette, gfx_sprites); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback)); /* video hardware */ @@ -9370,10 +9353,9 @@ void seta_state::thunderl(machine_config &config) screen.set_screen_update(FUNC(seta_state::screen_update_seta_no_layers)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_tndrcade); PALETTE(config, m_palette).set_entries(512); // sprites only - MCFG_VIDEO_START_OVERRIDE(seta_state,seta_no_layers) + MCFG_VIDEO_START_OVERRIDE(seta_state,seta) /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -9431,8 +9413,7 @@ void seta_state::wiggie(machine_config &config) Z80(config, m_audiocpu, 16000000/4); /* 4 MHz */ m_audiocpu->set_addrmap(AS_PROGRAM, &seta_state::wiggie_sound_map); - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag(m_gfxdecode); + SETA001_SPRITE(config, m_seta001, 16000000, m_palette, gfx_wiggie); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback)); /* video hardware */ @@ -9444,10 +9425,9 @@ void seta_state::wiggie(machine_config &config) screen.set_screen_update(FUNC(seta_state::screen_update_seta_no_layers)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_wiggie); PALETTE(config, m_palette).set_entries(512); // sprites only - MCFG_VIDEO_START_OVERRIDE(seta_state,seta_no_layers) + MCFG_VIDEO_START_OVERRIDE(seta_state,seta) /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -9461,7 +9441,7 @@ void seta_state::wiggie(machine_config &config) void seta_state::superbar(machine_config &config) { wiggie(config); - m_gfxdecode->set_info(gfx_superbar); + m_seta001->set_info(gfx_superbar); } void seta_state::wits(machine_config &config) @@ -9471,8 +9451,7 @@ void seta_state::wits(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::thunderl_map); m_maincpu->set_vblank_int("screen", FUNC(seta_state::irq2_line_assert)); - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag(m_gfxdecode); + SETA001_SPRITE(config, m_seta001, 16000000, m_palette, gfx_sprites); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback)); /* video hardware */ @@ -9484,10 +9463,9 @@ void seta_state::wits(machine_config &config) screen.set_screen_update(FUNC(seta_state::screen_update_seta_no_layers)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_tndrcade); PALETTE(config, m_palette).set_entries(512); // sprites only - MCFG_VIDEO_START_OVERRIDE(seta_state,seta_no_layers) + MCFG_VIDEO_START_OVERRIDE(seta_state,seta) /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -9508,8 +9486,7 @@ void seta_state::umanclub(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::umanclub_map); m_maincpu->set_vblank_int("screen", FUNC(seta_state::irq3_line_hold)); - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag(m_gfxdecode); + SETA001_SPRITE(config, m_seta001, 16000000, m_palette, gfx_sprites); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback)); /* video hardware */ @@ -9521,10 +9498,9 @@ void seta_state::umanclub(machine_config &config) screen.set_screen_update(FUNC(seta_state::screen_update_seta_no_layers)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_tndrcade); PALETTE(config, m_palette).set_entries(512); - MCFG_VIDEO_START_OVERRIDE(seta_state,seta_no_layers) + MCFG_VIDEO_START_OVERRIDE(seta_state,seta) /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -9549,8 +9525,7 @@ void seta_state::utoukond(machine_config &config) m_audiocpu->set_addrmap(AS_PROGRAM, &seta_state::utoukond_sound_map); m_audiocpu->set_addrmap(AS_IO, &seta_state::utoukond_sound_io_map); - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag(m_gfxdecode); + SETA001_SPRITE(config, m_seta001, 16000000, m_palette, gfx_sprites); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback)); /* video hardware */ @@ -9562,10 +9537,11 @@ void seta_state::utoukond(machine_config &config) screen.set_screen_update(FUNC(seta_state::screen_update_seta)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_msgundam); + X1_012(config, m_layers[0], m_palette, gfx_msgundam_layer1); + X1_012(config, m_layers[1], m_palette, gfx_msgundam_layer2); PALETTE(config, m_palette).set_entries(512 * 3); // sprites, layer1, layer2 - MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) + MCFG_VIDEO_START_OVERRIDE(seta_state,seta) /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); @@ -9607,8 +9583,7 @@ void seta_state::wrofaero(machine_config &config) MCFG_MACHINE_START_OVERRIDE(seta_state, wrofaero ) #endif // USE_uPD71054_TIMER - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag(m_gfxdecode); + SETA001_SPRITE(config, m_seta001, 16000000, m_palette, gfx_sprites); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback)); /* video hardware */ @@ -9620,10 +9595,11 @@ void seta_state::wrofaero(machine_config &config) screen.set_screen_update(FUNC(seta_state::screen_update_seta)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_msgundam); + X1_012(config, m_layers[0], m_palette, gfx_msgundam_layer1); + X1_012(config, m_layers[1], m_palette, gfx_msgundam_layer2); PALETTE(config, m_palette).set_entries(512 * 3); // sprites, layer1, layer2 - MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) + MCFG_VIDEO_START_OVERRIDE(seta_state,seta) /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -9649,8 +9625,7 @@ void seta_state::zingzip(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::wrofaero_map); m_maincpu->set_vblank_int("screen", FUNC(seta_state::irq3_line_hold)); - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag(m_gfxdecode); + SETA001_SPRITE(config, m_seta001, 16000000, m_palette, gfx_sprites); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback)); WATCHDOG_TIMER(config, "watchdog"); @@ -9664,10 +9639,11 @@ void seta_state::zingzip(machine_config &config) screen.set_screen_update(FUNC(seta_state::screen_update_seta)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_zingzip); + X1_012(config, m_layers[0], m_palette, gfx_zingzip_layer1); + X1_012(config, m_layers[1], m_palette, gfx_zingzip_layer2); PALETTE(config, m_palette, FUNC(seta_state::zingzip_palette), 16*32 + 16*32 + 64*32*2, 0x600); // sprites, layer2, layer1 - layer 1 gfx is 6 planes deep - MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) + MCFG_VIDEO_START_OVERRIDE(seta_state,seta) /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -9680,7 +9656,9 @@ void seta_state::zingzip(machine_config &config) void seta_state::zingzipbl(machine_config &config) { zingzip(config); - m_gfxdecode->set_info(gfx_zingzipbl); + m_seta001->set_info(gfx_zingzipbl_sprites); + m_layers[0]->set_info(gfx_zingzipbl_layer1); + m_layers[1]->set_info(gfx_zingzipbl_layer2); M68000(config.replace(), m_maincpu, 16000000); /* 16 MHz */ m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::zingzipbl_map); @@ -9703,8 +9681,7 @@ void seta_state::pairlove(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::pairlove_map); TIMER(config, "scantimer").configure_scanline(FUNC(seta_state::seta_interrupt_1_and_2), "screen", 0, 1); - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag(m_gfxdecode); + SETA001_SPRITE(config, m_seta001, 16000000, m_palette, gfx_pairlove); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback)); /* video hardware */ @@ -9716,10 +9693,9 @@ void seta_state::pairlove(machine_config &config) screen.set_screen_update(FUNC(seta_state::screen_update_seta_no_layers)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_pairlove); PALETTE(config, m_palette).set_entries(2048); // sprites only - MCFG_VIDEO_START_OVERRIDE(seta_state,seta_no_layers) + MCFG_VIDEO_START_OVERRIDE(seta_state,seta) /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -9751,8 +9727,7 @@ void seta_state::crazyfgt(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::crazyfgt_map); TIMER(config, "scantimer").configure_scanline(FUNC(seta_state::crazyfgt_interrupt), "screen", 0, 1); - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag(m_gfxdecode); + SETA001_SPRITE(config, m_seta001, 16000000, m_palette, gfx_sprites); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback)); /* video hardware */ @@ -9764,10 +9739,11 @@ void seta_state::crazyfgt(machine_config &config) screen.set_screen_update(FUNC(seta_state::screen_update_seta)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_blandia); + X1_012(config, m_layers[0], m_palette, gfx_blandia_layer1); + X1_012(config, m_layers[1], m_palette, gfx_blandia_layer2); PALETTE(config, m_palette, FUNC(seta_state::gundhara_palette), 16*32 + 64*32*4, 0x600); // sprites, layer2, layer1 - layers are 6 planes deep (seta_state,but have only 4 palettes) - MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) + MCFG_VIDEO_START_OVERRIDE(seta_state,seta) /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -9820,8 +9796,7 @@ void jockeyc_state::jockeyc(machine_config &config) WATCHDOG_TIMER(config, "watchdog").set_time(attotime::from_seconds(2.0)); // jockeyc: watchdog test error if over 2.5s - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag(m_gfxdecode); + SETA001_SPRITE(config, m_seta001, 16000000, m_palette, gfx_sprites); m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback)); NVRAM(config, "nvram", nvram_device::DEFAULT_RANDOM); @@ -9842,10 +9817,10 @@ void jockeyc_state::jockeyc(machine_config &config) screen.set_screen_update(FUNC(seta_state::screen_update_seta_layers)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_downtown); + X1_012(config, m_layers[0], m_palette, gfx_downtown); PALETTE(config, m_palette, FUNC(seta_state::palette_init_RRRRRGGGGGBBBBB_proms), 512 * 1); - MCFG_VIDEO_START_OVERRIDE(jockeyc_state,jockeyc_1_layer) + MCFG_VIDEO_START_OVERRIDE(jockeyc_state,jockeyc) /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); diff --git a/src/mame/drivers/srmp2.cpp b/src/mame/drivers/srmp2.cpp index a103ebd2c44..5f4f4c8e928 100644 --- a/src/mame/drivers/srmp2.cpp +++ b/src/mame/drivers/srmp2.cpp @@ -1148,8 +1148,7 @@ void srmp2_state::srmp2(machine_config &config) MCFG_MACHINE_START_OVERRIDE(srmp2_state,srmp2) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag("gfxdecode"); + SETA001_SPRITE(config, m_seta001, 16000000, "palette", gfx_srmp2); /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); @@ -1160,7 +1159,6 @@ void srmp2_state::srmp2(machine_config &config) screen.set_screen_update(FUNC(srmp2_state::screen_update_srmp2)); screen.set_palette("palette"); - GFXDECODE(config, "gfxdecode", "palette", gfx_srmp2); PALETTE(config, "palette", FUNC(srmp2_state::srmp2_palette)).set_format(palette_device::xRGB_555, 1024); // sprites only /* sound hardware */ @@ -1188,8 +1186,7 @@ void srmp2_state::srmp3(machine_config &config) MCFG_MACHINE_START_OVERRIDE(srmp2_state,srmp3) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag("gfxdecode"); + SETA001_SPRITE(config, m_seta001, 16000000, "palette", gfx_srmp3); m_seta001->set_gfxbank_callback(FUNC(srmp2_state::srmp3_gfxbank_callback)); /* video hardware */ @@ -1201,7 +1198,6 @@ void srmp2_state::srmp3(machine_config &config) screen.set_screen_update(FUNC(srmp2_state::screen_update_srmp3)); screen.set_palette("palette"); - GFXDECODE(config, "gfxdecode", "palette", gfx_srmp3); PALETTE(config, "palette", FUNC(srmp2_state::srmp3_palette)).set_format(palette_device::xRGB_555, 512); // sprites only /* sound hardware */ @@ -1240,8 +1236,7 @@ void srmp2_state::mjyuugi(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag("gfxdecode"); + SETA001_SPRITE(config, m_seta001, 16000000, "palette", gfx_srmp3); m_seta001->set_gfxbank_callback(FUNC(srmp2_state::srmp3_gfxbank_callback)); /* video hardware */ @@ -1253,7 +1248,6 @@ void srmp2_state::mjyuugi(machine_config &config) screen.set_screen_update(FUNC(srmp2_state::screen_update_mjyuugi)); screen.set_palette("palette"); - GFXDECODE(config, "gfxdecode", "palette", gfx_srmp3); PALETTE(config, "palette").set_format(palette_device::xRGB_555, 512); // sprites only /* sound hardware */ diff --git a/src/mame/drivers/taito_x.cpp b/src/mame/drivers/taito_x.cpp index 49f5906ad7e..3b3ccb26094 100644 --- a/src/mame/drivers/taito_x.cpp +++ b/src/mame/drivers/taito_x.cpp @@ -826,8 +826,7 @@ void taitox_state::superman(machine_config &config) MCFG_MACHINE_START_OVERRIDE(taitox_state,taitox) - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag(m_gfxdecode); + SETA001_SPRITE(config, m_seta001, 0, m_palette, gfx_taito_x); /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); @@ -838,10 +837,9 @@ void taitox_state::superman(machine_config &config) screen.set_screen_update(FUNC(taitox_state::screen_update_seta_no_layers)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_taito_x); PALETTE(config, m_palette).set_format(palette_device::xRGB_555, 2048); - MCFG_VIDEO_START_OVERRIDE(taitox_state,seta_no_layers) + MCFG_VIDEO_START_OVERRIDE(taitox_state,seta) /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); @@ -873,8 +871,7 @@ void taitox_state::daisenpu(machine_config &config) MCFG_MACHINE_START_OVERRIDE(taitox_state,taitox) - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag(m_gfxdecode); + SETA001_SPRITE(config, m_seta001, 16'000'000, m_palette, gfx_taito_x); /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); @@ -885,10 +882,9 @@ void taitox_state::daisenpu(machine_config &config) screen.set_screen_update(FUNC(taitox_state::screen_update_seta_no_layers)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_taito_x); PALETTE(config, m_palette).set_format(palette_device::xRGB_555, 2048); - MCFG_VIDEO_START_OVERRIDE(taitox_state,seta_no_layers) + MCFG_VIDEO_START_OVERRIDE(taitox_state,seta) /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); @@ -918,8 +914,7 @@ void taitox_state::gigandes(machine_config &config) MCFG_MACHINE_START_OVERRIDE(taitox_state,taitox) - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag(m_gfxdecode); + SETA001_SPRITE(config, m_seta001, 16000000, m_palette, gfx_taito_x); /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); @@ -930,10 +925,9 @@ void taitox_state::gigandes(machine_config &config) screen.set_screen_update(FUNC(taitox_state::screen_update_seta_no_layers)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_taito_x); PALETTE(config, m_palette).set_format(palette_device::xRGB_555, 2048); - MCFG_VIDEO_START_OVERRIDE(taitox_state,seta_no_layers) + MCFG_VIDEO_START_OVERRIDE(taitox_state,seta) /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); @@ -965,8 +959,7 @@ void taitox_state::ballbros(machine_config &config) MCFG_MACHINE_START_OVERRIDE(taitox_state,taitox) - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag(m_gfxdecode); + SETA001_SPRITE(config, m_seta001, 16000000, m_palette, gfx_taito_x); /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); @@ -977,10 +970,9 @@ void taitox_state::ballbros(machine_config &config) screen.set_screen_update(FUNC(taitox_state::screen_update_seta_no_layers)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_taito_x); PALETTE(config, m_palette).set_format(palette_device::xRGB_555, 2048); - MCFG_VIDEO_START_OVERRIDE(taitox_state, kyustrkr_no_layers) + MCFG_VIDEO_START_OVERRIDE(taitox_state, kyustrkr) /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); diff --git a/src/mame/drivers/thedealr.cpp b/src/mame/drivers/thedealr.cpp index 2c25046b753..fa72d9cf20f 100644 --- a/src/mame/drivers/thedealr.cpp +++ b/src/mame/drivers/thedealr.cpp @@ -555,8 +555,7 @@ void thedealr_state::thedealr(machine_config &config) WATCHDOG_TIMER(config, "watchdog"); - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag("gfxdecode"); + SETA001_SPRITE(config, m_seta001, 16'000'000, m_palette, gfx_thedealr); // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); @@ -569,7 +568,6 @@ void thedealr_state::thedealr(machine_config &config) screen.screen_vblank().append_inputline(m_subcpu, INPUT_LINE_NMI); screen.set_palette(m_palette); - GFXDECODE(config, "gfxdecode", m_palette, gfx_thedealr); PALETTE(config, m_palette, FUNC(thedealr_state::thedealr_palette), 512); // sound hardware diff --git a/src/mame/drivers/tnzs.cpp b/src/mame/drivers/tnzs.cpp index 1c7abfefb6b..67a9266d83d 100644 --- a/src/mame/drivers/tnzs.cpp +++ b/src/mame/drivers/tnzs.cpp @@ -1544,8 +1544,7 @@ void tnzs_base_state::tnzs_base(machine_config &config) config.set_perfect_quantum(m_maincpu); /* video hardware */ - SETA001_SPRITE(config, m_seta001, 0); - m_seta001->set_gfxdecode_tag("gfxdecode"); + SETA001_SPRITE(config, m_seta001, 12'000'000, m_palette, gfx_tnzs); SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_refresh_hz(60); @@ -1556,7 +1555,6 @@ void tnzs_base_state::tnzs_base(machine_config &config) m_screen->screen_vblank().set(FUNC(tnzs_base_state::screen_vblank_tnzs)); m_screen->set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_tnzs); PALETTE(config, m_palette).set_format(palette_device::xRGB_555, 512); /* sound hardware */ @@ -1628,7 +1626,7 @@ void insectx_state::insectx(machine_config &config) m_subcpu->set_addrmap(AS_PROGRAM, &insectx_state::insectx_sub_map); /* video hardware */ - m_gfxdecode->set_info(gfx_insectx); + m_seta001->set_info(gfx_insectx); /* sound hardware */ ym2203_device &ymsnd(YM2203(config, "ymsnd", XTAL(12'000'000)/4)); /* verified on pcb */ diff --git a/src/mame/includes/seta.h b/src/mame/includes/seta.h index 524101f5618..dc2999b5bba 100644 --- a/src/mame/includes/seta.h +++ b/src/mame/includes/seta.h @@ -21,6 +21,7 @@ #include "machine/upd4992.h" #include "sound/x1_010.h" #include "video/seta001.h" +#include "video/x1_012.h" #include "emupal.h" #include "tilemap.h" @@ -50,6 +51,7 @@ public: m_audiocpu(*this, "audiocpu"), m_subcpu(*this,"sub"), m_seta001(*this, "spritegen"), + m_layers(*this, "layer%u", 1U), m_x1(*this, "x1snd"), m_soundlatch(*this, "soundlatch%u", 1U), m_dsw(*this, "DSW"), @@ -59,13 +61,10 @@ public: m_coins(*this, "COINS"), m_extra_port(*this, "EXTRA"), m_sharedram(*this,"sharedram"), - m_vram(*this,"vram_%u", 0U), - m_vctrl(*this,"vctrl_%u", 0U), m_paletteram(*this,"paletteram%u", 1U), m_subbank(*this,"subbank"), m_x1_bank(*this,"x1_bank"), m_leds(*this, "led%u", 0U), - m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } @@ -136,6 +135,7 @@ protected: optional_device m_audiocpu; optional_device m_subcpu; required_device m_seta001; + optional_device_array m_layers; optional_device m_x1; optional_device_array m_soundlatch; @@ -147,8 +147,6 @@ protected: optional_ioport m_extra_port; optional_shared_ptr m_sharedram; - optional_shared_ptr_array m_vram; - optional_shared_ptr_array m_vctrl; optional_shared_ptr_array m_paletteram; optional_memory_bank m_subbank; @@ -156,18 +154,12 @@ protected: output_finder<48> m_leds; - required_device m_gfxdecode; required_device m_palette; u8 m_vregs; - int m_tiles_offset; - tilemap_t *m_tilemap[2]; // Max 2 Layers - int m_rambank[2]; // 2 Tilemap banks for each layers int m_tilemaps_flip; int m_samples_bank; - int m_color_mode_shift; - int m_current_tilemap_mode[2]; uPD71054_state m_uPD71054; const game_offset *m_global_offsets; @@ -191,7 +183,6 @@ protected: void seta_coin_counter_w(u8 data); void seta_coin_lockout_w(u8 data); void seta_vregs_w(u8 data); - template void vram_w(offs_t offset, u16 data, u16 mem_mask = ~0); void twineagl_tilebank_w(offs_t offset, u8 data); void timer_regs_w(offs_t offset, u16 data); u8 sharedram_68000_r(offs_t offset); @@ -227,15 +218,11 @@ protected: u8 dsw2_r(); u16 extra_r(); - TILE_GET_INFO_MEMBER(twineagl_get_tile_info); - template TILE_GET_INFO_MEMBER(get_tile_info); - DECLARE_VIDEO_START(seta_no_layers); - DECLARE_VIDEO_START(kyustrkr_no_layers); - DECLARE_VIDEO_START(twineagl_1_layer); - DECLARE_VIDEO_START(seta_1_layer); + DECLARE_VIDEO_START(seta); + DECLARE_VIDEO_START(kyustrkr); DECLARE_MACHINE_RESET(calibr50); + u16 twineagl_tile_offset(u16 code); - DECLARE_VIDEO_START(seta_2_layers); void blandia_palette(palette_device &palette) const; void zingzip_palette(palette_device &palette) const; DECLARE_MACHINE_START(wrofaero); @@ -243,7 +230,7 @@ protected: void jjsquawk_palette(palette_device &palette) const; DECLARE_MACHINE_START(keroppi); DECLARE_MACHINE_START(magspeed); - DECLARE_VIDEO_START(oisipuzl_2_layers); + DECLARE_VIDEO_START(oisipuzl); u32 screen_update_seta_no_layers(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); u32 screen_update_seta(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); @@ -266,7 +253,6 @@ protected: TIMER_DEVICE_CALLBACK_MEMBER(crazyfgt_interrupt); void set_pens(); - void draw_tilemap_palette_effect(bitmap_ind16 &bitmap, const rectangle &cliprect, tilemap_t *tilemap, int scrollx, int scrolly, int gfxnum, int flipscreen); void seta_layers_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int sprite_bank_size); void uPD71054_timer_init(); DECLARE_WRITE_LINE_MEMBER(pit_out0); @@ -327,7 +313,9 @@ public: m_upd4701(*this, "upd4701"), m_buttonmux(*this, "buttonmux"), m_track_x(*this, "TRACK%u_X", 1U), - m_track_y(*this, "TRACK%u_Y", 1U) + m_track_y(*this, "TRACK%u_Y", 1U), + m_port_select(0), + m_tiles_offset(0) { } void usclssic(machine_config &config); @@ -344,6 +332,7 @@ private: void usclssic_palette(palette_device &palette) const; + u16 tile_offset(u16 code); u32 screen_update_usclssic(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void usclssic_set_pens(); @@ -356,6 +345,7 @@ private: required_ioport_array<2> m_track_y; u8 m_port_select; + u16 m_tiles_offset; }; class kiwame_state : public seta_state @@ -453,7 +443,7 @@ private: DECLARE_MACHINE_START(setaroul); DECLARE_MACHINE_RESET(setaroul); - DECLARE_VIDEO_START(setaroul_1_layer); + DECLARE_VIDEO_START(setaroul); void setaroul_palette(palette_device &palette) const; u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); @@ -518,7 +508,7 @@ private: DECLARE_MACHINE_START(jockeyc); DECLARE_MACHINE_START(inttoote); - DECLARE_VIDEO_START(jockeyc_1_layer); + DECLARE_VIDEO_START(jockeyc); TIMER_DEVICE_CALLBACK_MEMBER(interrupt); diff --git a/src/mame/includes/tnzs.h b/src/mame/includes/tnzs.h index a988c8efe9e..ecc37dd8774 100644 --- a/src/mame/includes/tnzs.h +++ b/src/mame/includes/tnzs.h @@ -25,7 +25,6 @@ public: , m_subcpu(*this, "sub") , m_seta001(*this, "spritegen") , m_palette(*this, "palette") - , m_gfxdecode(*this, "gfxdecode") , m_screen(*this, "screen") , m_mainbank(*this, "mainbank") , m_subbank(*this, "subbank") @@ -52,9 +51,8 @@ protected: /* devices */ required_device m_maincpu; optional_device m_subcpu; - optional_device m_seta001; + required_device m_seta001; required_device m_palette; - required_device m_gfxdecode; required_device m_screen; optional_device m_mainbank; /* FIXME: optional because of reuse from cchance.cpp */ optional_memory_bank m_subbank; /* FIXME: optional because of reuse from cchance.cpp */ diff --git a/src/mame/video/seta.cpp b/src/mame/video/seta.cpp index 52f09b2cd98..4ff461c5aba 100644 --- a/src/mame/video/seta.cpp +++ b/src/mame/video/seta.cpp @@ -299,135 +299,54 @@ Offset + 0x4: ***************************************************************************/ -TILE_GET_INFO_MEMBER(seta_state::twineagl_get_tile_info) -{ - const u16 *vram = &m_vram[0][m_rambank[0] ? 0x1000 : 0]; - u16 code = vram[tile_index]; - const u16 attr = vram[tile_index + 0x800]; - if ((code & 0x3e00) == 0x3e00) - code = (code & 0xc07f) | ((m_twineagl_tilebank[(code & 0x0180) >> 7] >> 1) << 7); - tileinfo.set(1, (code & 0x3fff), attr & 0x1f, TILE_FLIPXY((code & 0xc000) >> 14)); -} - -template -TILE_GET_INFO_MEMBER(seta_state::get_tile_info) -{ - int gfx = 1 + Layer; - const u16 *vram = &m_vram[Layer][m_rambank[Layer] ? 0x1000 : 0]; - const u16 *vctrl = m_vctrl[Layer]; - const u16 code = vram[tile_index]; - const u16 attr = vram[tile_index + 0x800]; - - if (m_gfxdecode->gfx(gfx + ((vctrl[4/2] & 0x10) >> m_color_mode_shift)) != nullptr) - { - gfx += (vctrl[4/2] & 0x10) >> m_color_mode_shift; - } - else - { - popmessage("Missing Color Mode = 1 for Layer = %d. Contact MAMETesters.", Layer); - } - - tileinfo.set(gfx, m_tiles_offset + (code & 0x3fff), attr & 0x1f, TILE_FLIPXY((code & 0xc000) >> 14)); -} - - void seta_state::twineagl_tilebank_w(offs_t offset, u8 data) { if (m_twineagl_tilebank[offset] != data) { m_twineagl_tilebank[offset] = data; - machine().tilemap().mark_all_dirty(); + m_layers[0]->mark_all_dirty(); } } - -/* 2 layers */ -VIDEO_START_MEMBER(seta_state,seta_2_layers) +u16 seta_state::twineagl_tile_offset(u16 code) { - VIDEO_START_CALL_MEMBER(seta_no_layers); - - /* Each layer consists of 2 tilemaps: only one can be displayed - at any given time */ - - /* layer 0 */ - m_tilemap[0] = &machine().tilemap().create( - *m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(seta_state::get_tile_info<0>)), TILEMAP_SCAN_ROWS, - 16, 16, 64, 32); - - /* layer 1 */ - m_tilemap[1] = &machine().tilemap().create( - *m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(seta_state::get_tile_info<1>)), TILEMAP_SCAN_ROWS, - 16, 16, 64, 32); - - m_tilemaps_flip = 0; - m_color_mode_shift = 3; - - for (int layer = 0; layer < 2; layer++) - { - m_tilemap[layer]->set_transparent_pen(0); - } + if ((code & 0x3e00) == 0x3e00) + return (code & 0x007f) | ((m_twineagl_tilebank[(code & 0x0180) >> 7] >> 1) << 7); + else + return code; } -VIDEO_START_MEMBER(seta_state,oisipuzl_2_layers) +u16 usclssic_state::tile_offset(u16 code) { - VIDEO_START_CALL_MEMBER(seta_2_layers); + return m_tiles_offset + code; +} + +VIDEO_START_MEMBER(seta_state,oisipuzl) +{ + VIDEO_START_CALL_MEMBER(seta); m_tilemaps_flip = 1; // position kludges m_seta001->set_fg_yoffsets(-0x12, 0x0e); } - -/* 1 layer */ -VIDEO_START_MEMBER(seta_state,seta_1_layer) +VIDEO_START_MEMBER(setaroul_state,setaroul) { - VIDEO_START_CALL_MEMBER(seta_no_layers); - - /* Each layer consists of 2 tilemaps: only one can be displayed - at any given time */ - - /* layer 0 */ - m_tilemap[0] = &machine().tilemap().create( - *m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(seta_state::get_tile_info<0>)), TILEMAP_SCAN_ROWS, - 16, 16, 64, 32); - - m_color_mode_shift = 4; - - m_tilemap[0]->set_transparent_pen(0); -} - -VIDEO_START_MEMBER(setaroul_state,setaroul_1_layer) -{ - VIDEO_START_CALL_MEMBER(seta_1_layer); + VIDEO_START_CALL_MEMBER(seta); // position kludges m_seta001->set_bg_yoffsets(0, -0x1); m_seta001->set_bg_xoffsets(0, 0x2); } -VIDEO_START_MEMBER(jockeyc_state,jockeyc_1_layer) +VIDEO_START_MEMBER(jockeyc_state,jockeyc) { - VIDEO_START_CALL_MEMBER(seta_1_layer); + VIDEO_START_CALL_MEMBER(seta); // position kludges m_seta001->set_fg_yoffsets(-0x12+8, 0x0e); } -VIDEO_START_MEMBER(seta_state,twineagl_1_layer) -{ - VIDEO_START_CALL_MEMBER(seta_no_layers); - - /* Each layer consists of 2 tilemaps: only one can be displayed - at any given time */ - - /* layer 0 */ - m_tilemap[0] = &machine().tilemap().create( - *m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(seta_state::twineagl_get_tile_info)), TILEMAP_SCAN_ROWS, - 16, 16, 64, 32); - - m_tilemap[0]->set_transparent_pen(0); -} - SETA001_SPRITE_GFXBANK_CB_MEMBER(seta_state::setac_gfxbank_callback) { const int bank = (color & 0x06) >> 1; @@ -436,12 +355,8 @@ SETA001_SPRITE_GFXBANK_CB_MEMBER(seta_state::setac_gfxbank_callback) return code; } -/* NO layers, only sprites */ -VIDEO_START_MEMBER(seta_state,seta_no_layers) +VIDEO_START_MEMBER(seta_state,seta) { - m_tilemap[0] = nullptr; - m_tilemap[1] = nullptr; - m_tilemaps_flip = 0; m_global_offsets = game_offsets; @@ -455,15 +370,14 @@ VIDEO_START_MEMBER(seta_state,seta_no_layers) m_seta001->set_fg_xoffsets(m_global_offsets->sprite_offs[1], m_global_offsets->sprite_offs[0]); 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) +VIDEO_START_MEMBER(seta_state,kyustrkr) { - VIDEO_START_CALL_MEMBER(seta_no_layers); + VIDEO_START_CALL_MEMBER(seta); // position kludges m_seta001->set_fg_yoffsets(-0x0a, 0x0e); @@ -569,8 +483,8 @@ void seta_state::palette_init_RRRRRGGGGGBBBBB_proms(palette_device &palette) con void setaroul_state::setaroul_palette(palette_device &palette) const { - m_gfxdecode->gfx(0)->set_granularity(16); - m_gfxdecode->gfx(1)->set_granularity(16); + m_seta001->gfx(0)->set_granularity(16); + m_layers[0]->gfx(0)->set_granularity(16); palette_init_RRRRRGGGGGBBBBB_proms(palette); } @@ -649,50 +563,6 @@ void usclssic_state::usclssic_set_pens() } -void seta_state::draw_tilemap_palette_effect(bitmap_ind16 &bitmap, const rectangle &cliprect, tilemap_t *tilemap, int scrollx, int scrolly, int gfxnum, int flipscreen) -{ - gfx_element *gfx_tilemap = m_gfxdecode->gfx(gfxnum); - const bitmap_ind16 &src_bitmap = tilemap->pixmap(); - const int opaque_mask = gfx_tilemap->granularity() - 1; - const int pixel_effect_mask = gfx_tilemap->colorbase() + (gfx_tilemap->colors() - 1) * gfx_tilemap->granularity(); - - const int width_mask = src_bitmap.width() - 1; - const int height_mask = src_bitmap.height() - 1; - - for (int y = cliprect.min_y; y <= cliprect.max_y; y++) - { - u16 *const dest = &bitmap.pix(y); - - for (int x = cliprect.min_x; x <= cliprect.max_x; x++) - { - int p; - if (!flipscreen) - { - p = src_bitmap.pix((y + scrolly) & height_mask, (x + scrollx) & width_mask); - } - else - { - p = src_bitmap.pix((y - scrolly - 256) & height_mask, (x - scrollx - 512) & width_mask); - } - - // draw not transparent pixels - if (p & opaque_mask) - { - // pixels with the last color are not drawn and the 2nd palette is added to the current bitmap color - if ((p & pixel_effect_mask) == pixel_effect_mask) - { - dest[x] = m_palette->entries() / 2 + dest[x]; - } - else - { - dest[x] = m_palette->pen(p); - } - } - } - } -} - - /*************************************************************************** @@ -719,40 +589,16 @@ void seta_state::seta_layers_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &visarea = screen.visible_area(); const int vis_dimy = visarea.max_y - visarea.min_y + 1; - // check tilemaps color modes - - for (int layer = 0; layer < 2; layer++) - { - if (m_tilemap[layer]) - { - if (m_current_tilemap_mode[layer] != (m_vctrl[layer][4/2] & 0x10)) - { - m_current_tilemap_mode[layer] = m_vctrl[layer][4/2] & 0x10; - m_tilemap[layer]->mark_all_dirty(); - } - } - } - const int flip = m_seta001->is_flipped() ^ m_tilemaps_flip; - machine().tilemap().set_flip_all(flip ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0); + for (int layer = 0; layer < 2; layer++) + if (m_layers[layer].found()) + m_layers[layer]->set_flip(flip ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0); - int bank[2]{ 0, 0 }, x[2]{ 0, 0 }, y[2]{ 0, 0 }; + int x[2]{ 0, 0 }, y[2]{ 0, 0 }; for (int layer = 0; layer < 2; layer++) { - if (m_tilemap[layer]) + if (m_layers[layer].found()) { - x[layer] = m_vctrl[layer][0/2]; - y[layer] = m_vctrl[layer][2/2]; - bank[layer] = m_vctrl[layer][4/2]; - bank[layer] = (bank[layer] & 0x0008) ? 1 : 0; /*&& (bank[layer] & 0x0001)*/ - - /* Select tilemap bank, Only one tilemap bank per layer is enabled */ - if (m_rambank[layer] != bank[layer]) - { - m_rambank[layer] = bank[layer]; - m_tilemap[layer]->mark_all_dirty(); - } - /* the hardware wants different scroll values when flipped */ /* bg x scroll flip @@ -761,16 +607,7 @@ void seta_state::seta_layers_update(screen_device &screen, bitmap_ind16 &bitmap, fff0 0260 = -$10, $400-$190 -$10 ffe8 0272 = -$18, $400-$190 -$18 + $1a */ - x[layer] += 0x10 - m_global_offsets->tilemap_offs[flip ? 1 : 0]; - y[layer] -= (256 - vis_dimy)/2; - if (flip) - { - x[layer] = -x[layer] - 512; - y[layer] = y[layer] - vis_dimy; - } - - m_tilemap[layer]->set_scrollx(0, x[layer]); - m_tilemap[layer]->set_scrolly(0, y[layer]); + m_layers[layer]->update_scroll(m_global_offsets->tilemap_offs[flip ? 1 : 0], vis_dimy, flip); } else { @@ -788,21 +625,22 @@ void seta_state::seta_layers_update(screen_device &screen, bitmap_ind16 &bitmap, if (screen.machine().input().code_pressed(KEYCODE_A)) msk |= 8; if (msk != 0) layers_ctrl &= msk; - if (m_tilemap[1]) + if (m_layers[1].found()) 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]); + m_vregs, m_layers[0]->vctrl(2), m_layers[1]->vctrl(2)); + else if (m_layers[0].found()) + popmessage("L0:%04X", m_layers[0]->vctrl(2)); } #endif bitmap.fill(0, cliprect); - const int order = m_tilemap[1] ? m_vregs : 0; + const int order = m_layers[1].found() ? m_vregs : 0; if (order & 1) // swap the layers? { - if (m_tilemap[1]) + if (m_layers[1].found()) { - if (layers_ctrl & 2) m_tilemap[1]->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); + if (layers_ctrl & 2) m_layers[1]->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); } if (order & 2) // layer-sprite priority? @@ -814,7 +652,7 @@ void seta_state::seta_layers_update(screen_device &screen, bitmap_ind16 &bitmap, popmessage("Missing palette effect. Contact MAMETesters."); } - if (layers_ctrl & 1) m_tilemap[0]->draw(screen, bitmap, cliprect, 0, 0); + if (layers_ctrl & 1) m_layers[0]->draw(screen, bitmap, cliprect, 0, 0); } else { @@ -823,14 +661,14 @@ void seta_state::seta_layers_update(screen_device &screen, bitmap_ind16 &bitmap, popmessage("Missing palette effect. Contact MAMETesters."); } - if (layers_ctrl & 1) m_tilemap[0]->draw(screen, bitmap, cliprect, 0, 0); + if (layers_ctrl & 1) m_layers[0]->draw(screen, bitmap, cliprect, 0, 0); if (layers_ctrl & 8) m_seta001->draw_sprites(screen, bitmap,cliprect,sprite_bank_size); } } else { - if (layers_ctrl & 1) m_tilemap[0]->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); + if (layers_ctrl & 1) m_layers[0]->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); if (order & 2) // layer-sprite priority? { @@ -838,7 +676,7 @@ void seta_state::seta_layers_update(screen_device &screen, bitmap_ind16 &bitmap, if ((order & 4) && m_paletteram[1] != nullptr) { - draw_tilemap_palette_effect(bitmap, cliprect, m_tilemap[1], x[1], y[1], 2 + ((m_vctrl[1][4/2] & 0x10) >> m_color_mode_shift), flip); + m_layers[1]->draw_tilemap_palette_effect(bitmap, cliprect, flip); } else { @@ -847,9 +685,9 @@ void seta_state::seta_layers_update(screen_device &screen, bitmap_ind16 &bitmap, popmessage("Missing palette effect. Contact MAMETesters."); } - if (m_tilemap[1]) + if (m_layers[1].found()) { - if (layers_ctrl & 2) m_tilemap[1]->draw(screen, bitmap, cliprect, 0, 0); + if (layers_ctrl & 2) m_layers[1]->draw(screen, bitmap, cliprect, 0, 0); } } } @@ -857,7 +695,7 @@ void seta_state::seta_layers_update(screen_device &screen, bitmap_ind16 &bitmap, { if ((order & 4) && m_paletteram[1] != nullptr) { - draw_tilemap_palette_effect(bitmap, cliprect, m_tilemap[1], x[1], y[1], 2 + ((m_vctrl[1][4/2] & 0x10) >> m_color_mode_shift), flip); + m_layers[1]->draw_tilemap_palette_effect(bitmap, cliprect, flip); } else { @@ -866,9 +704,9 @@ void seta_state::seta_layers_update(screen_device &screen, bitmap_ind16 &bitmap, popmessage("Missing palette effect. Contact MAMETesters."); } - if (m_tilemap[1]) + if (m_layers[1].found()) { - if (layers_ctrl & 2) m_tilemap[1]->draw(screen, bitmap, cliprect, 0, 0); + if (layers_ctrl & 2) m_layers[1]->draw(screen, bitmap, cliprect, 0, 0); } } diff --git a/src/mame/video/seta001.cpp b/src/mame/video/seta001.cpp index d90362b92a7..44c00f3960e 100644 --- a/src/mame/video/seta001.cpp +++ b/src/mame/video/seta001.cpp @@ -30,6 +30,8 @@ appear to have 0x800 bytes of RAM that isn't connected to the sprite chip between the banks. + This should implement device_video_interface, since it generates the vertical + and horizontal blanking and sync signals from a master clock. */ #include "emu.h" @@ -41,7 +43,7 @@ DEFINE_DEVICE_TYPE(SETA001_SPRITE, seta001_device, "seta001", "Seta SETA001 Spri seta001_device::seta001_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SETA001_SPRITE, tag, owner, clock) - , m_gfxdecode(*this, finder_base::DUMMY_TAG) + , device_gfx_interface(mconfig, *this) , m_gfxbank_cb(*this) { } @@ -251,7 +253,7 @@ void seta001_device::draw_background( bitmap_ind16 &bitmap, const rectangle &cli int offs, col; int xoffs, yoffs; - int const total_color_codes = m_gfxdecode->gfx(0)->colors(); + int const total_color_codes = gfx(0)->colors(); int const ctrl = m_spritectrl[0]; int const ctrl2 = m_spritectrl[1]; @@ -322,28 +324,28 @@ void seta001_device::draw_background( bitmap_ind16 &bitmap, const rectangle &cli color = ( color >> (16-5) ) % total_color_codes; code &= 0x3fff; - m_gfxdecode->gfx(0)->transpen(bitmap,cliprect, + gfx(0)->transpen(bitmap,cliprect, code, color, flipx,flipy, ((sx) & 0x1ff),((sy) & 0x0ff), transpen); - m_gfxdecode->gfx(0)->transpen(bitmap,cliprect, + gfx(0)->transpen(bitmap,cliprect, code, color, flipx,flipy, ((sx) & 0x1ff)-512,((sy) & 0x0ff), transpen); - m_gfxdecode->gfx(0)->transpen(bitmap,cliprect, + gfx(0)->transpen(bitmap,cliprect, code, color, flipx,flipy, ((sx) & 0x1ff),((sy) & 0x0ff)-256, transpen); - m_gfxdecode->gfx(0)->transpen(bitmap,cliprect, + gfx(0)->transpen(bitmap,cliprect, code, color, flipx,flipy, @@ -362,7 +364,7 @@ void seta001_device::draw_foreground( screen_device &screen, bitmap_ind16 &bitma int const ctrl2 = m_spritectrl[1]; int xoffs, yoffs; - int const total_color_codes = m_gfxdecode->gfx(0)->colors(); + int const total_color_codes = gfx(0)->colors(); uint8_t *char_pointer = &m_spritecodelow[0x0000]; uint8_t *x_pointer = &m_spritecodelow[0x0200]; @@ -409,7 +411,7 @@ void seta001_device::draw_foreground( screen_device &screen, bitmap_ind16 &bitma flipy = !flipy; } - m_gfxdecode->gfx(0)->transpen(bitmap,cliprect, + gfx(0)->transpen(bitmap,cliprect, code, color, flipx,flipy, @@ -417,7 +419,7 @@ void seta001_device::draw_foreground( screen_device &screen, bitmap_ind16 &bitma max_y - ((sy + yoffs) & 0x0ff),m_transpen); /* wrap around x */ - m_gfxdecode->gfx(0)->transpen(bitmap,cliprect, + gfx(0)->transpen(bitmap,cliprect, code, color, flipx,flipy, @@ -425,7 +427,7 @@ void seta001_device::draw_foreground( screen_device &screen, bitmap_ind16 &bitma max_y - ((sy + yoffs) & 0x0ff),m_transpen); - m_gfxdecode->gfx(0)->transpen(bitmap,cliprect, + gfx(0)->transpen(bitmap,cliprect, code, color, flipx,flipy, @@ -433,7 +435,7 @@ void seta001_device::draw_foreground( screen_device &screen, bitmap_ind16 &bitma max_y - ((sy + yoffs) & 0x0ff)-256,m_transpen); /* wrap around x */ - m_gfxdecode->gfx(0)->transpen(bitmap,cliprect, + gfx(0)->transpen(bitmap,cliprect, code, color, flipx,flipy, diff --git a/src/mame/video/seta001.h b/src/mame/video/seta001.h index f51a9cb06c8..a281999179e 100644 --- a/src/mame/video/seta001.h +++ b/src/mame/video/seta001.h @@ -9,13 +9,18 @@ typedef device_delegate gfxbank_cb_delegate; #define SETA001_SPRITE_GFXBANK_CB_MEMBER(_name) int _name(uint16_t code, uint8_t color) -class seta001_device : public device_t +class seta001_device : public device_t, public device_gfx_interface { public: seta001_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + template seta001_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&palette_tag, const gfx_decode_entry *gfxinfo) + : seta001_device(mconfig, tag, owner, clock) + { + set_info(gfxinfo); + set_palette(std::forward(palette_tag)); + } // configuration - template void set_gfxdecode_tag(T &&tag) { m_gfxdecode.set_tag(std::forward(tag)); } template void set_gfxbank_callback(T &&... args) { m_gfxbank_cb.set(std::forward(args)...); } void spritebgflag_w8(uint8_t data); @@ -61,7 +66,6 @@ protected: private: void draw_background(bitmap_ind16 &bitmap, const rectangle &cliprect, int bank_size); void draw_foreground(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int bank_size); - required_device m_gfxdecode; gfxbank_cb_delegate m_gfxbank_cb; diff --git a/src/mame/video/x1_012.cpp b/src/mame/video/x1_012.cpp new file mode 100644 index 00000000000..94ff7f26701 --- /dev/null +++ b/src/mame/video/x1_012.cpp @@ -0,0 +1,172 @@ +// license:BSD-3-Clause +// copyright-holders:Luca Elia +/*************************************************************************** + + Seta (or Allumer) X1-012 (+ X1-011) tile layer generator + + Each layer consists of 2 tilemaps: only one can be displayed + at any given time. + +***************************************************************************/ + +#include "emu.h" +#include "x1_012.h" + + +DEFINE_DEVICE_TYPE(X1_012, x1_012_device, "x1_012", "Seta X1-012 Tile Layer") + +x1_012_device::x1_012_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, X1_012, tag, owner, clock) + , device_gfx_interface(mconfig, *this) + , m_tile_offset_callback(*this) + , m_vram(*this, DEVICE_SELF) + , m_tilemap(nullptr) + , m_rambank(0) +{ + std::fill(std::begin(m_vctrl), std::end(m_vctrl), 0); +} + +TILE_GET_INFO_MEMBER(x1_012_device::get_tile_info) +{ + const u16 *const vram = &m_vram[m_rambank ? 0x1000 : 0]; + u16 code = vram[tile_index] & 0x3fff; + const u16 flip = TILE_FLIPXY((vram[tile_index] & 0xc000) >> 14); + const u16 attr = vram[tile_index + 0x800]; + + int gfx = (m_vctrl[2] & 0x10) >> 4; + if (gfx == 1 && this->gfx(1) == nullptr) + { + popmessage("Missing Color Mode = 1 for Layer = %s. Contact MAMETesters.", tag()); + gfx = 0; + } + + if (!m_tile_offset_callback.isnull()) + code = m_tile_offset_callback(code); + + tileinfo.set(gfx, code, attr & 0x1f, flip); +} + +void x1_012_device::device_resolve_objects() +{ + m_tile_offset_callback.resolve(); +} + +void x1_012_device::device_start() +{ + m_tilemap = &machine().tilemap().create( + *this, tilemap_get_info_delegate(*this, FUNC(x1_012_device::get_tile_info)), TILEMAP_SCAN_ROWS, + 16, 16, 64, 32); + m_tilemap->set_transparent_pen(0); + + save_item(NAME(m_vctrl)); + save_item(NAME(m_rambank)); +} + +void x1_012_device::vram_w(offs_t offset, u16 data, u16 mem_mask) +{ + COMBINE_DATA(&m_vram[offset]); + if (m_rambank == ((offset >> 12) & 1)) + m_tilemap->mark_tile_dirty(offset & 0x7ff); +} + +u16 x1_012_device::vctrl_r(offs_t offset, u16 mem_mask) +{ + return m_vctrl[offset]; +} + +void x1_012_device::vctrl_w(offs_t offset, u16 data, u16 mem_mask) +{ + // Select tilemap bank. Only one tilemap bank per layer is enabled. + if (offset == 2 && ACCESSING_BITS_0_7) + { + if ((data & 0x0008) != (m_vctrl[2] & 0x0008)) + { + m_rambank = (data & 0x0008) ? 1 : 0; + m_tilemap->mark_all_dirty(); + } + + // Check tilemap color mode + if ((data & 0x0010) != (m_vctrl[2] & 0x0010)) + m_tilemap->mark_all_dirty(); + } + + COMBINE_DATA(&m_vctrl[offset]); +} + + +void x1_012_device::update_scroll(int xoffset, int vis_dimy, bool flip) +{ + int x = m_vctrl[0]; + int y = m_vctrl[1]; + + /* the hardware wants different scroll values when flipped */ + + /* bg x scroll flip + metafox 0000 025d = 0, $400-$1a3 = $400 - $190 - $13 + eightfrc ffe8 0272 + fff0 0260 = -$10, $400-$190 -$10 + ffe8 0272 = -$18, $400-$190 -$18 + $1a */ + + x += 0x10 - xoffset; + y -= (256 - vis_dimy)/2; + if (flip) + { + x = -x - 512; + y = y - vis_dimy; + } + + m_tilemap->set_scrollx(0, x); + m_tilemap->set_scrolly(0, y); +} + + +void x1_012_device::draw(screen_device &screen, bitmap_ind16 &dest, const rectangle &cliprect, u32 flags, u8 priority, u8 priority_mask) +{ + m_tilemap->draw(screen, dest, cliprect, flags, priority, priority_mask); +} + +void x1_012_device::draw_tilemap_palette_effect(bitmap_ind16 &bitmap, const rectangle &cliprect, bool flipscreen) +{ + const int scrollx = m_tilemap->scrollx(0); + const int scrolly = m_tilemap->scrolly(0); + const gfx_element *const gfx_tilemap = gfx((m_vctrl[2] & 0x10) >> 4); + const bitmap_ind16 &src_bitmap = m_tilemap->pixmap(); + const int opaque_mask = gfx_tilemap->granularity() - 1; + const int pixel_effect_mask = gfx_tilemap->colorbase() + (gfx_tilemap->colors() - 1) * gfx_tilemap->granularity(); + + const int width_mask = src_bitmap.width() - 1; + const int height_mask = src_bitmap.height() - 1; + + for (int y = cliprect.min_y; y <= cliprect.max_y; y++) + { + u16 *const dest = &bitmap.pix(y); + + for (int x = cliprect.min_x; x <= cliprect.max_x; x++) + { + int p; + if (!flipscreen) + { + p = src_bitmap.pix((y + scrolly) & height_mask, (x + scrollx) & width_mask); + } + else + { + p = src_bitmap.pix((y - scrolly - 256) & height_mask, (x - scrollx - 512) & width_mask); + } + + // draw not transparent pixels + if (p & opaque_mask) + { + // pixels with the last color are not drawn and the 2nd palette is added to the current bitmap color + if ((p & pixel_effect_mask) == pixel_effect_mask) + { + dest[x] = palette().entries() / 2 + dest[x]; + } + else + { + dest[x] = palette().pen(p); + } + } + } + } +} + diff --git a/src/mame/video/x1_012.h b/src/mame/video/x1_012.h new file mode 100644 index 00000000000..2828ffb9bfe --- /dev/null +++ b/src/mame/video/x1_012.h @@ -0,0 +1,57 @@ +// license:BSD-3-Clause +// copyright-holders:Luca Elia +#ifndef MAME_VIDEO_X1_012_H +#define MAME_VIDEO_X1_012_H + +#pragma once + +#include "tilemap.h" + +class x1_012_device : public device_t, public device_gfx_interface +{ +public: + x1_012_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + template x1_012_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&palette_tag, const gfx_decode_entry *gfxinfo) + : x1_012_device(mconfig, tag, owner, u32(0)) + { + set_info(gfxinfo); + set_palette(std::forward(palette_tag)); + } + + // configuration + template void set_tile_offset_callback(T &&... args) { m_tile_offset_callback.set(std::forward(args)...); } + + void vram_w(offs_t offset, u16 data, u16 mem_mask = 0xffff); + u16 vctrl_r(offs_t offset, u16 mem_mask = 0xffff); + void vctrl_w(offs_t offset, u16 data, u16 mem_mask = 0xffff); + + u16 vctrl(int index) const { return m_vctrl[index]; } + void update_scroll(int xoffset, int vis_dimy, bool flip); + + void set_flip(u32 flip) { m_tilemap->set_flip(flip); } + void mark_all_dirty() { m_tilemap->mark_all_dirty(); } + + void draw(screen_device &screen, bitmap_ind16 &dest, const rectangle &cliprect, u32 flags = TILEMAP_DRAW_ALL_CATEGORIES, u8 priority = 0, u8 priority_mask = 0xff); + void draw_tilemap_palette_effect(bitmap_ind16 &bitmap, const rectangle &cliprect, bool flipscreen); + +protected: + virtual void device_resolve_objects() override; + virtual void device_start() override; + +private: + TILE_GET_INFO_MEMBER(get_tile_info); + + device_delegate m_tile_offset_callback; + + required_shared_ptr m_vram; + + tilemap_t *m_tilemap; + + u16 m_vctrl[3]; + u8 m_rambank; +}; + +DECLARE_DEVICE_TYPE(X1_012, x1_012_device) + +#endif // MAME_VIDEO_X1_012_H +