diff options
| author | 2018-05-06 13:44:04 +0200 | |
|---|---|---|
| committer | 2018-05-06 15:36:57 +0200 | |
| commit | 46d25bad21d5abd99ab7e2aa66de7bf3d2599a56 (patch) | |
| tree | ff435fcf64b886571e25b8840e8ed21643ee375c | |
| parent | 93ae59e6537156662aa960ce8b43adc9520deaf7 (diff) | |
supbtime.cpp: split into video and includes (nw)
| -rw-r--r-- | scripts/target/mame/arcade.lua | 4 | ||||
| -rw-r--r-- | src/mame/drivers/supbtime.cpp | 120 | ||||
| -rw-r--r-- | src/mame/includes/supbtime.h | 60 | ||||
| -rw-r--r-- | src/mame/video/supbtime.cpp | 52 |
4 files changed, 131 insertions, 105 deletions
diff --git a/scripts/target/mame/arcade.lua b/scripts/target/mame/arcade.lua index f93a376cc1c..c0f547fca74 100644 --- a/scripts/target/mame/arcade.lua +++ b/scripts/target/mame/arcade.lua @@ -1638,6 +1638,8 @@ files { MAME_DIR .. "src/mame/includes/stadhero.h", MAME_DIR .. "src/mame/video/stadhero.cpp", MAME_DIR .. "src/mame/drivers/supbtime.cpp", + MAME_DIR .. "src/mame/includes/supbtime.h", + MAME_DIR .. "src/mame/video/supbtime.cpp", MAME_DIR .. "src/mame/drivers/tryout.cpp", MAME_DIR .. "src/mame/includes/tryout.h", MAME_DIR .. "src/mame/video/tryout.cpp", @@ -1759,8 +1761,8 @@ files { MAME_DIR .. "src/mame/video/excellent_spr.cpp", MAME_DIR .. "src/mame/video/excellent_spr.h", MAME_DIR .. "src/mame/drivers/lastbank.cpp", - MAME_DIR .. "src/mame/includes/witch.h", MAME_DIR .. "src/mame/drivers/witch.cpp", + MAME_DIR .. "src/mame/includes/witch.h", } createMAMEProjects(_target, _subtarget, "exidy") diff --git a/src/mame/drivers/supbtime.cpp b/src/mame/drivers/supbtime.cpp index 25848a0ee39..d6a3d6505f9 100644 --- a/src/mame/drivers/supbtime.cpp +++ b/src/mame/drivers/supbtime.cpp @@ -60,58 +60,11 @@ Stephh's notes (based on the games M68000 code and some tests) : ***************************************************************************/ #include "emu.h" -#include "cpu/m68000/m68000.h" -#include "cpu/h6280/h6280.h" -#include "machine/decocrpt.h" -#include "machine/gen_latch.h" -#include "video/decospr.h" -#include "video/deco16ic.h" -#include "sound/ym2151.h" -#include "sound/okim6295.h" -#include "screen.h" -#include "speaker.h" - +#include "includes/supbtime.h" #define TUMBLEP_HACK 0 -class supbtime_state : public driver_device -{ -public: - supbtime_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_spriteram(*this, "spriteram"), - m_pf1_rowscroll(*this, "pf1_rowscroll"), - m_pf2_rowscroll(*this, "pf2_rowscroll"), - m_maincpu(*this, "maincpu"), - m_deco_tilegen1(*this, "tilegen1"), - m_sprgen(*this, "spritegen") - { } - - DECLARE_DRIVER_INIT(tumblep); - - DECLARE_WRITE_LINE_MEMBER(vblank_w); - DECLARE_READ16_MEMBER(vblank_ack_r); - uint32_t screen_update_supbtime(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - uint32_t screen_update_tumblep(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - - void chinatwn(machine_config &config); - void supbtime(machine_config &config); - void tumblep(machine_config &config); - void chinatwn_map(address_map &map); - void sound_map(address_map &map); - void supbtime_map(address_map &map); - void tumblep_map(address_map &map); -private: - required_shared_ptr<uint16_t> m_spriteram; - required_shared_ptr<uint16_t> m_pf1_rowscroll; - required_shared_ptr<uint16_t> m_pf2_rowscroll; - required_device<cpu_device> m_maincpu; - required_device<deco16ic_device> m_deco_tilegen1; - required_device<decospr_device> m_sprgen; -}; - - //************************************************************************** // ADDRESS MAPS //************************************************************************** @@ -210,61 +163,6 @@ READ16_MEMBER( supbtime_state::vblank_ack_r ) return 0xffff; } -// End sequence uses rowscroll '98 c0' on pf1 (jmp to 1d61a on supbtimj) -uint32_t supbtime_state::screen_update_supbtime(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - address_space &space = machine().dummy_space(); - uint16_t flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff); - - flip_screen_set(BIT(flip, 7)); - m_sprgen->set_flip_screen(BIT(flip, 7)); - m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll); - - bitmap.fill(768, cliprect); - - m_deco_tilegen1->tilemap_2_draw(screen, bitmap, cliprect, 0, 0); - m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram, 0x400); - m_deco_tilegen1->tilemap_1_draw(screen, bitmap, cliprect, 0, 0); - - return 0; -} - -// Tumblepop is one of few games to take advantage of the playfields ability -// to switch between 8*8 tiles and 16*16 tiles. -uint32_t supbtime_state::screen_update_tumblep(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - address_space &space = machine().dummy_space(); - uint16_t flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff); - - flip_screen_set(BIT(flip, 7)); - m_sprgen->set_flip_screen(BIT(flip, 7)); - m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll); - - bitmap.fill(256+512, cliprect); // not verified - - m_deco_tilegen1->tilemap_2_draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); - m_deco_tilegen1->tilemap_1_draw(screen, bitmap, cliprect, 0, 0); - m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram, 0x400); - - return 0; -} - - -//************************************************************************** -// MACHINE -//************************************************************************** - -DRIVER_INIT_MEMBER( supbtime_state, tumblep ) -{ - deco56_decrypt_gfx(machine(), "tiles"); - -#if TUMBLEP_HACK - uint16_t *RAM = (uint16_t *)memregion("maincpu")->base(); - RAM[(offset + 0)/2] = 0x0240; - RAM[(offset + 2)/2] = 0xffff; // andi.w #$f3ff, D0 -#endif -} - //************************************************************************** // INPUT DEFINITIONS @@ -636,10 +534,24 @@ ROM_END //************************************************************************** +// MACHINE +//************************************************************************** + +DRIVER_INIT_MEMBER( supbtime_state, tumblep ) +{ + deco56_decrypt_gfx(machine(), "tiles"); + +#if TUMBLEP_HACK + uint16_t *RAM = (uint16_t *)memregion("maincpu")->base(); + RAM[(offset + 0)/2] = 0x0240; + RAM[(offset + 2)/2] = 0xffff; // andi.w #$f3ff, D0 +#endif +} + +//************************************************************************** // SYSTEM DRIVERS //************************************************************************** -// YEAR NAME PARENT MACHINE INPUT CLASS INIT ROT COMPANY FULLNAME FLAGS GAME( 1990, supbtime, 0, supbtime, supbtime, supbtime_state, 0, ROT0, "Data East Corporation", "Super Burger Time (World, set 1)", MACHINE_SUPPORTS_SAVE ) GAME( 1990, supbtimea, supbtime, supbtime, supbtime, supbtime_state, 0, ROT0, "Data East Corporation", "Super Burger Time (World, set 2)", MACHINE_SUPPORTS_SAVE ) GAME( 1990, supbtimej, supbtime, supbtime, supbtime, supbtime_state, 0, ROT0, "Data East Corporation", "Super Burger Time (Japan)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/includes/supbtime.h b/src/mame/includes/supbtime.h new file mode 100644 index 00000000000..e48406ae52b --- /dev/null +++ b/src/mame/includes/supbtime.h @@ -0,0 +1,60 @@ +// license: BSD-3-Clause +// copyright-holders: Bryan McPhail, David Haywood, Dirk Best +/*************************************************************************** + + Super Burger Time + +***************************************************************************/ + +#ifndef MAME_INCLUDES_SUPBTIME_H +#define MAME_INCLUDES_SUPBTIME_H + +#include "cpu/m68000/m68000.h" +#include "cpu/h6280/h6280.h" +#include "machine/decocrpt.h" +#include "machine/gen_latch.h" +#include "video/decospr.h" +#include "video/deco16ic.h" +#include "sound/ym2151.h" +#include "sound/okim6295.h" +#include "screen.h" +#include "speaker.h" + +class supbtime_state : public driver_device +{ +public: + supbtime_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag), + m_spriteram(*this, "spriteram"), + m_pf1_rowscroll(*this, "pf1_rowscroll"), + m_pf2_rowscroll(*this, "pf2_rowscroll"), + m_maincpu(*this, "maincpu"), + m_deco_tilegen1(*this, "tilegen1"), + m_sprgen(*this, "spritegen") + { } + + DECLARE_DRIVER_INIT(tumblep); + + DECLARE_WRITE_LINE_MEMBER(vblank_w); + DECLARE_READ16_MEMBER(vblank_ack_r); + uint32_t screen_update_supbtime(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_tumblep(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + void chinatwn(machine_config &config); + void supbtime(machine_config &config); + void tumblep(machine_config &config); + void chinatwn_map(address_map &map); + void sound_map(address_map &map); + void supbtime_map(address_map &map); + void tumblep_map(address_map &map); +private: + required_shared_ptr<uint16_t> m_spriteram; + required_shared_ptr<uint16_t> m_pf1_rowscroll; + required_shared_ptr<uint16_t> m_pf2_rowscroll; + required_device<cpu_device> m_maincpu; + required_device<deco16ic_device> m_deco_tilegen1; + required_device<decospr_device> m_sprgen; +}; + + +#endif diff --git a/src/mame/video/supbtime.cpp b/src/mame/video/supbtime.cpp new file mode 100644 index 00000000000..683a3bfd6f0 --- /dev/null +++ b/src/mame/video/supbtime.cpp @@ -0,0 +1,52 @@ +// license: BSD-3-Clause +// copyright-holders: Bryan McPhail, David Haywood, Dirk Best +/*************************************************************************** + + Super Burger Time + + Video mixing + +***************************************************************************/ + +#include "emu.h" +#include "includes/supbtime.h" + +// End sequence uses rowscroll '98 c0' on pf1 (jmp to 1d61a on supbtimej) +uint32_t supbtime_state::screen_update_supbtime(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + address_space &space = machine().dummy_space(); + uint16_t flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff); + + flip_screen_set(BIT(flip, 7)); + m_sprgen->set_flip_screen(BIT(flip, 7)); + m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll); + + bitmap.fill(768, cliprect); + + m_deco_tilegen1->tilemap_2_draw(screen, bitmap, cliprect, 0, 0); + m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram, 0x400); + m_deco_tilegen1->tilemap_1_draw(screen, bitmap, cliprect, 0, 0); + + return 0; +} + +// Tumblepop is one of few games to take advantage of the playfields ability +// to switch between 8*8 tiles and 16*16 tiles. +uint32_t supbtime_state::screen_update_tumblep(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + address_space &space = machine().dummy_space(); + uint16_t flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff); + + flip_screen_set(BIT(flip, 7)); + m_sprgen->set_flip_screen(BIT(flip, 7)); + m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll); + + bitmap.fill(256+512, cliprect); // not verified + + m_deco_tilegen1->tilemap_2_draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); + m_deco_tilegen1->tilemap_1_draw(screen, bitmap, cliprect, 0, 0); + m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram, 0x400); + + return 0; +} + |
