diff options
author | 2024-10-22 21:14:19 +0200 | |
---|---|---|
committer | 2024-10-22 21:14:19 +0200 | |
commit | 652dbc852e6ef2ac50e1617b89cbf7c876464fdb (patch) | |
tree | 17a283a25de95b69c526b05d22663862a16e10c6 | |
parent | b19cb43cc9daeba557aeddbfe6c49aeacea602d6 (diff) |
dataeast/supbtime.cpp, fuuki/fuukifg2.cpp, fuuki/fuukifg3.cpp: consolidated drivers into single files
-rw-r--r-- | src/mame/cirsa/cirsa2080606.cpp | 2 | ||||
-rw-r--r-- | src/mame/dataeast/supbtime.cpp | 156 | ||||
-rw-r--r-- | src/mame/dataeast/supbtime.h | 64 | ||||
-rw-r--r-- | src/mame/dataeast/supbtime_v.cpp | 73 | ||||
-rw-r--r-- | src/mame/fuuki/fuukifg.cpp | 21 | ||||
-rw-r--r-- | src/mame/fuuki/fuukifg.h | 10 | ||||
-rw-r--r-- | src/mame/fuuki/fuukifg2.cpp | 435 | ||||
-rw-r--r-- | src/mame/fuuki/fuukifg2.h | 92 | ||||
-rw-r--r-- | src/mame/fuuki/fuukifg2_v.cpp | 201 | ||||
-rw-r--r-- | src/mame/fuuki/fuukifg3.cpp | 476 | ||||
-rw-r--r-- | src/mame/fuuki/fuukifg3.h | 108 | ||||
-rw-r--r-- | src/mame/fuuki/fuukifg3_v.cpp | 228 | ||||
-rw-r--r-- | src/mame/igs/igspoker.cpp | 6 | ||||
-rw-r--r-- | src/mame/igs/spoker.cpp | 2 | ||||
-rw-r--r-- | src/mame/sega/segas32.cpp | 2 |
15 files changed, 918 insertions, 958 deletions
diff --git a/src/mame/cirsa/cirsa2080606.cpp b/src/mame/cirsa/cirsa2080606.cpp index 417df8e303a..edf06539861 100644 --- a/src/mame/cirsa/cirsa2080606.cpp +++ b/src/mame/cirsa/cirsa2080606.cpp @@ -170,7 +170,7 @@ ROM_START( maquinati ) ROM_LOAD( "la_maquina_del_tiempo_graf-es_bg2-2-3_g-2f119.u1", 0x4000000, 0x2000000, CRC(4d76a943) SHA1(f8819b509c416a29f6f3d41561e74c62ca7448e1) ) ROM_LOAD( "la_maquina_del_tiempo_graf-es_bg2-2-3_g-2f119.u2", 0x6000000, 0x2000000, CRC(19d3040e) SHA1(c174dce45755d918d62f116aaee06cabef8021f8) ) ROM_LOAD( "la_maquina_del_tiempo_graf-es_bg1-3-3_g-3f119.u1", 0x8000000, 0x2000000, CRC(067cf5f6) SHA1(3094d1b6f508def383b52a77007efd7a09c90ce1) ) - ROM_LOAD( "la_maquina_del_tiempo_graf-es_bg1-3-3_g-3f119.u2", 0xA000000, 0x2000000, CRC(c017126c) SHA1(7ba628037da96874894317e72f62bc7b1878520d) ) + ROM_LOAD( "la_maquina_del_tiempo_graf-es_bg1-3-3_g-3f119.u2", 0xa000000, 0x2000000, CRC(c017126c) SHA1(7ba628037da96874894317e72f62bc7b1878520d) ) // Reels PCB 2050104-2 ROM_REGION( 0x8000, "reels", 0 ) diff --git a/src/mame/dataeast/supbtime.cpp b/src/mame/dataeast/supbtime.cpp index 5b37d740fa8..8ed66609e7d 100644 --- a/src/mame/dataeast/supbtime.cpp +++ b/src/mame/dataeast/supbtime.cpp @@ -1,5 +1,6 @@ // license: BSD-3-Clause // copyright-holders: Bryan McPhail, David Haywood, Dirk Best + /*************************************************************************** Super Burger Time © 1990 Data East Corporation @@ -8,7 +9,7 @@ These games all run on the DE-0343 board. - Sound: Ym2151, Oki adpcm - NOTE! The sound program writes to the address + Sound: YM2151, Oki ADPCM - NOTE! The sound program writes to the address of a YM2203 and a 2nd Oki chip but the board does _not_ have them. The sound program is simply the 'generic' Data East sound program unmodified for this cut down hardware (it doesn't write any good sound data btw, mostly zeros). @@ -47,7 +48,7 @@ Stephh's notes (based on the games M68000 code and some tests) : 8 Stratosphere 9 Space - * As levels x-9 and 9-x are only constitued of a "big boss", you can't + * As levels x-9 and 9-x are only constituted of a "big boss", you can't edit them ! * All data is stored within the range 0x02b8c8-0x02d2c9, but it should be extended to 0x02ebeb (and perhaps 0x02ffff). TO BE CONFIRMED ! @@ -60,8 +61,130 @@ Stephh's notes (based on the games M68000 code and some tests) : ***************************************************************************/ #include "emu.h" -#include "supbtime.h" + +#include "deco16ic.h" +#include "decocrpt.h" +#include "decospr.h" + +#include "cpu/h6280/h6280.h" +#include "cpu/m68000/m68000.h" +#include "machine/gen_latch.h" +#include "sound/okim6295.h" +#include "sound/ymopm.h" + #include "emupal.h" +#include "screen.h" +#include "speaker.h" + + +namespace { + +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_pf_rowscroll(*this, "pf%u_rowscroll", 1U) + , m_maincpu(*this, "maincpu") + , m_audiocpu(*this, "audiocpu") + , m_deco_tilegen(*this, "tilegen") + , m_sprgen(*this, "spritegen") + { } + + void chinatwn(machine_config &config); + void supbtime(machine_config &config); + void tumblep(machine_config &config); + + void init_tumblep(); + +private: + required_shared_ptr<uint16_t> m_spriteram; + required_shared_ptr_array<uint16_t, 2> m_pf_rowscroll; + required_device<cpu_device> m_maincpu; + required_device<h6280_device> m_audiocpu; + required_device<deco16ic_device> m_deco_tilegen; + required_device<decospr_device> m_sprgen; + + void vblank_w(int state); + uint16_t vblank_ack_r(); + uint32_t screen_update_common(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, bool use_offsets); + uint32_t screen_update_chinatwn(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + 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_map(address_map &map) ATTR_COLD; + void sound_map(address_map &map) ATTR_COLD; + void supbtime_map(address_map &map) ATTR_COLD; + void tumblep_map(address_map &map) ATTR_COLD; +}; + + +/*************************************************************************** + + Video mixing + + - are there priority registers / bits in the sprites that would allow + this to be collapsed further? + +***************************************************************************/ + +uint32_t supbtime_state::screen_update_common(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, bool use_offsets) +{ + uint16_t const flip = m_deco_tilegen->pf_control_r(0); + + flip_screen_set(BIT(flip, 7)); + m_sprgen->set_flip_screen(BIT(flip, 7)); + m_deco_tilegen->pf_update(m_pf_rowscroll[0], m_pf_rowscroll[1]); + + bitmap.fill(768, cliprect); + + if (use_offsets) + { + // chinatwn and tumblep are verified as needing a 1 pixel offset on the tilemaps to match original hardware (supbtime appears to not want them) + m_deco_tilegen->set_scrolldx(0, 0, 1, -1); + m_deco_tilegen->set_scrolldx(0, 1, 1, -1); + m_deco_tilegen->set_scrolldx(1, 0, 1, -1); + m_deco_tilegen->set_scrolldx(1, 1, 1, -1); + } + + return 0; +} + +// 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) +{ + screen_update_common(screen, bitmap, cliprect, false); + + m_deco_tilegen->tilemap_2_draw(screen, bitmap, cliprect, 0, 0); + m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram, 0x400); + m_deco_tilegen->tilemap_1_draw(screen, bitmap, cliprect, 0, 0); + + return 0; +} + +uint32_t supbtime_state::screen_update_chinatwn(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + screen_update_common(screen, bitmap, cliprect, true); + + m_deco_tilegen->tilemap_2_draw(screen, bitmap, cliprect, 0, 0); + m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram, 0x400); + m_deco_tilegen->tilemap_1_draw(screen, bitmap, cliprect, 0, 0); + + return 0; +} + +uint32_t supbtime_state::screen_update_tumblep(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + screen_update_common(screen, bitmap, cliprect, true); + + m_deco_tilegen->tilemap_2_draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); + m_deco_tilegen->tilemap_1_draw(screen, bitmap, cliprect, 0, 0); + m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram, 0x400); + + return 0; +} + #define TUMBLEP_HACK 0 @@ -74,9 +197,9 @@ void supbtime_state::supbtime_map(address_map &map) { map(0x000000, 0x03ffff).rom(); map(0x100000, 0x103fff).ram(); - map(0x104000, 0x11ffff).nopw(); // Nothing there - map(0x120000, 0x1207ff).ram().share("spriteram"); - map(0x120800, 0x13ffff).nopw(); // Nothing there + map(0x104000, 0x11ffff).nopw(); // Nothing here + map(0x120000, 0x1207ff).ram().share(m_spriteram); + map(0x120800, 0x13ffff).nopw(); // Nothing here map(0x140000, 0x1407ff).ram().w("palette", FUNC(palette_device::write16)).share("palette"); map(0x180000, 0x180001).portr("INPUTS"); map(0x180002, 0x180003).portr("DSW"); @@ -87,15 +210,15 @@ void supbtime_state::supbtime_map(address_map &map) map(0x300000, 0x30000f).rw(m_deco_tilegen, FUNC(deco16ic_device::pf_control_r), FUNC(deco16ic_device::pf_control_w)); map(0x320000, 0x321fff).rw(m_deco_tilegen, FUNC(deco16ic_device::pf1_data_r), FUNC(deco16ic_device::pf1_data_w)); map(0x322000, 0x323fff).rw(m_deco_tilegen, FUNC(deco16ic_device::pf2_data_r), FUNC(deco16ic_device::pf2_data_w)); - map(0x340000, 0x3407ff).ram().share("pf1_rowscroll"); - map(0x342000, 0x3427ff).ram().share("pf2_rowscroll"); + map(0x340000, 0x3407ff).ram().share(m_pf_rowscroll[0]); + map(0x342000, 0x3427ff).ram().share(m_pf_rowscroll[1]); } void supbtime_state::chinatwn_map(address_map &map) { map(0x000000, 0x03ffff).rom(); map(0x100001, 0x100001).w("soundlatch", FUNC(generic_latch_8_device::write)); - map(0x120000, 0x1207ff).ram().share("spriteram"); + map(0x120000, 0x1207ff).ram().share(m_spriteram); map(0x140000, 0x1407ff).ram().w("palette", FUNC(palette_device::write16)).share("palette"); map(0x180000, 0x180001).portr("INPUTS"); map(0x180002, 0x180003).portr("DSW"); @@ -106,8 +229,8 @@ void supbtime_state::chinatwn_map(address_map &map) map(0x300000, 0x30000f).rw(m_deco_tilegen, FUNC(deco16ic_device::pf_control_r), FUNC(deco16ic_device::pf_control_w)); map(0x320000, 0x321fff).rw(m_deco_tilegen, FUNC(deco16ic_device::pf1_data_r), FUNC(deco16ic_device::pf1_data_w)); map(0x322000, 0x323fff).rw(m_deco_tilegen, FUNC(deco16ic_device::pf2_data_r), FUNC(deco16ic_device::pf2_data_w)); - map(0x340000, 0x3407ff).ram().share("pf1_rowscroll"); // unused - map(0x342000, 0x3427ff).ram().share("pf2_rowscroll"); // unused + map(0x340000, 0x3407ff).ram().share(m_pf_rowscroll[0]); // unused + map(0x342000, 0x3427ff).ram().share(m_pf_rowscroll[1]); // unused } void supbtime_state::tumblep_map(address_map &map) @@ -124,12 +247,12 @@ void supbtime_state::tumblep_map(address_map &map) map(0x180008, 0x180009).portr("SYSTEM"); map(0x18000a, 0x18000b).r(FUNC(supbtime_state::vblank_ack_r)); map(0x18000a, 0x18000d).nopw(); // ? - map(0x1a0000, 0x1a07ff).ram().share("spriteram"); + map(0x1a0000, 0x1a07ff).ram().share(m_spriteram); map(0x300000, 0x30000f).w(m_deco_tilegen, FUNC(deco16ic_device::pf_control_w)); map(0x320000, 0x320fff).rw(m_deco_tilegen, FUNC(deco16ic_device::pf1_data_r), FUNC(deco16ic_device::pf1_data_w)); map(0x322000, 0x322fff).rw(m_deco_tilegen, FUNC(deco16ic_device::pf2_data_r), FUNC(deco16ic_device::pf2_data_w)); - map(0x340000, 0x3407ff).writeonly().share("pf1_rowscroll"); // unused - map(0x342000, 0x3427ff).writeonly().share("pf2_rowscroll"); // unused + map(0x340000, 0x3407ff).writeonly().share(m_pf_rowscroll[0]); // unused + map(0x342000, 0x3427ff).writeonly().share(m_pf_rowscroll[1]); // unused } // Physical memory map (21 bits) @@ -421,7 +544,7 @@ ROM_START( supbtime ) ROM_LOAD("tg5.j1", 0x514, 0x104, CRC(21d02af7) SHA1(4b221a478cb3381e9551de770df7c491c5e59c90)) // PAL16L8 ROM_END -ROM_START( supbtimea ) // this set has no backgrounds ingame for most stages, but has been verifeid as good on multiple PCBs, design choice +ROM_START( supbtimea ) // this set has no backgrounds ingame for most stages, but has been verified as good on multiple PCBs, design choice ROM_REGION( 0x40000, "maincpu", 0 ) ROM_LOAD16_BYTE("3.11f", 0x00000, 0x20000, CRC(98b5f263) SHA1(ee4b0d2fcdc95aba0e78d066bd6c4d553a902848)) ROM_LOAD16_BYTE("4.12f", 0x00001, 0x20000, CRC(937e68b9) SHA1(4779e150518b9014c2154f33d38767c6a7447334)) @@ -532,6 +655,9 @@ void supbtime_state::init_tumblep() #endif } +} // anonymous namespace + + //************************************************************************** // SYSTEM DRIVERS //************************************************************************** diff --git a/src/mame/dataeast/supbtime.h b/src/mame/dataeast/supbtime.h deleted file mode 100644 index b03c75e4e92..00000000000 --- a/src/mame/dataeast/supbtime.h +++ /dev/null @@ -1,64 +0,0 @@ -// license: BSD-3-Clause -// copyright-holders: Bryan McPhail, David Haywood, Dirk Best -/*************************************************************************** - - Super Burger Time - -***************************************************************************/ - -#ifndef MAME_DATAEAST_SUPBTIME_H -#define MAME_DATAEAST_SUPBTIME_H - -#include "cpu/m68000/m68000.h" -#include "cpu/h6280/h6280.h" -#include "decocrpt.h" -#include "machine/gen_latch.h" -#include "decospr.h" -#include "deco16ic.h" -#include "sound/okim6295.h" -#include "sound/ymopm.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_pf_rowscroll(*this, "pf%u_rowscroll", 1U) - , m_maincpu(*this, "maincpu") - , m_audiocpu(*this, "audiocpu") - , m_deco_tilegen(*this, "tilegen") - , m_sprgen(*this, "spritegen") - { } - - void chinatwn(machine_config &config); - void supbtime(machine_config &config); - void tumblep(machine_config &config); - - void init_tumblep(); - -private: - void vblank_w(int state); - uint16_t vblank_ack_r(); - uint32_t screen_update_common(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, bool use_offsets); - uint32_t screen_update_chinatwn(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - 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_map(address_map &map) ATTR_COLD; - void sound_map(address_map &map) ATTR_COLD; - void supbtime_map(address_map &map) ATTR_COLD; - void tumblep_map(address_map &map) ATTR_COLD; - - required_shared_ptr<uint16_t> m_spriteram; - required_shared_ptr_array<uint16_t, 2> m_pf_rowscroll; - required_device<cpu_device> m_maincpu; - required_device<h6280_device> m_audiocpu; - required_device<deco16ic_device> m_deco_tilegen; - required_device<decospr_device> m_sprgen; -}; - - -#endif // MAME_DATAEAST_SUPBTIME_H diff --git a/src/mame/dataeast/supbtime_v.cpp b/src/mame/dataeast/supbtime_v.cpp deleted file mode 100644 index 738e9c5e474..00000000000 --- a/src/mame/dataeast/supbtime_v.cpp +++ /dev/null @@ -1,73 +0,0 @@ -// license: BSD-3-Clause -// copyright-holders: Bryan McPhail, David Haywood, Dirk Best -/*************************************************************************** - - Super Burger Time - - Video mixing - - - are there priority registers / bits in the sprites that would allow - this to be collapsed further? - -***************************************************************************/ - -#include "emu.h" -#include "supbtime.h" - - -uint32_t supbtime_state::screen_update_common(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, bool use_offsets) -{ - uint16_t flip = m_deco_tilegen->pf_control_r(0); - - flip_screen_set(BIT(flip, 7)); - m_sprgen->set_flip_screen(BIT(flip, 7)); - m_deco_tilegen->pf_update(m_pf_rowscroll[0], m_pf_rowscroll[1]); - - bitmap.fill(768, cliprect); - - if (use_offsets) - { - // chinatwn and tumblep are verified as needing a 1 pixel offset on the tilemaps to match original hardware (supbtime appears to not want them) - m_deco_tilegen->set_scrolldx(0, 0, 1, -1); - m_deco_tilegen->set_scrolldx(0, 1, 1, -1); - m_deco_tilegen->set_scrolldx(1, 0, 1, -1); - m_deco_tilegen->set_scrolldx(1, 1, 1, -1); - } - - return 0; -} - -// 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) -{ - screen_update_common(screen, bitmap, cliprect, false); - - m_deco_tilegen->tilemap_2_draw(screen, bitmap, cliprect, 0, 0); - m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram, 0x400); - m_deco_tilegen->tilemap_1_draw(screen, bitmap, cliprect, 0, 0); - - return 0; -} - -uint32_t supbtime_state::screen_update_chinatwn(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - screen_update_common(screen, bitmap, cliprect, true); - - m_deco_tilegen->tilemap_2_draw(screen, bitmap, cliprect, 0, 0); - m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram, 0x400); - m_deco_tilegen->tilemap_1_draw(screen, bitmap, cliprect, 0, 0); - - return 0; -} - -uint32_t supbtime_state::screen_update_tumblep(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - screen_update_common(screen, bitmap, cliprect, true); - - m_deco_tilegen->tilemap_2_draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); - m_deco_tilegen->tilemap_1_draw(screen, bitmap, cliprect, 0, 0); - m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram, 0x400); - - return 0; -} - diff --git a/src/mame/fuuki/fuukifg.cpp b/src/mame/fuuki/fuukifg.cpp index 2add15d2b8a..f12ad67850b 100644 --- a/src/mame/fuuki/fuukifg.cpp +++ b/src/mame/fuuki/fuukifg.cpp @@ -1,7 +1,6 @@ // license:BSD-3-Clause -// copyright-holders:Luca Elia, David Haywood -/* -*/ +// copyright-holders: Luca Elia, David Haywood + #include "emu.h" #include "fuukifg.h" @@ -23,7 +22,7 @@ fuukivid_device::fuukivid_device(const machine_config &mconfig, const char *tag, void fuukivid_device::device_start() { - /* 16x16x4 */ + // 16x16x4 gfx_layout layout_16x16x4 = { 16,16, @@ -42,10 +41,6 @@ void fuukivid_device::device_start() set_gfx(0, std::make_unique<gfx_element>(&palette(), layout_16x16x4, m_gfx_region->base(), 0, m_colnum, m_colbase)); } -void fuukivid_device::device_reset() -{ -} - /*************************************************************************** @@ -96,7 +91,7 @@ void fuukivid_device::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, if (priority) { start = size - 4; end = -4; inc = -4; } else { start = 0; end = size; inc = +4; } - /* Draw them backwards, for pdrawgfx */ + // Draw them backwards, for pdrawgfx for (int offs = start; offs != end; offs += inc) { const u16 data0 = spriteram[offs + 0]; @@ -146,14 +141,14 @@ void fuukivid_device::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, if (priority) { if (xzoom == (16*8) && yzoom == (16*8)) - gfx(0)->prio_transpen(bitmap,spriteclip, + gfx(0)->prio_transpen(bitmap, spriteclip, code++, colour, flipx, flipy, sx + x * 16, sy + y * 16, screen.priority(), pri_mask, 15); else - gfx(0)->prio_zoom_transpen(bitmap,spriteclip, + gfx(0)->prio_zoom_transpen(bitmap, spriteclip, code++, colour, flipx, flipy, @@ -164,14 +159,14 @@ void fuukivid_device::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, else { if (xzoom == (16*8) && yzoom == (16*8)) - gfx(0)->transpen(bitmap,spriteclip, + gfx(0)->transpen(bitmap, spriteclip, code++, colour, flipx, flipy, sx + x * 16, sy + y * 16, 15); else - gfx(0)->zoom_transpen(bitmap,spriteclip, + gfx(0)->zoom_transpen(bitmap, spriteclip, code++, colour, flipx, flipy, diff --git a/src/mame/fuuki/fuukifg.h b/src/mame/fuuki/fuukifg.h index 21bc4b6c9c6..e4f924bc3be 100644 --- a/src/mame/fuuki/fuukifg.h +++ b/src/mame/fuuki/fuukifg.h @@ -1,7 +1,8 @@ // license:BSD-3-Clause -// copyright-holders:Luca Elia, David Haywood -#ifndef MAME_FUUKI_FUUKIFH_H -#define MAME_FUUKI_FUUKIFH_H +// copyright-holders: Luca Elia, David Haywood + +#ifndef MAME_FUUKI_FUUKIFG_H +#define MAME_FUUKI_FUUKIFG_H #pragma once @@ -23,7 +24,6 @@ public: protected: virtual void device_start() override ATTR_COLD; - virtual void device_reset() override ATTR_COLD; private: tile_delegate m_tile_cb; @@ -35,4 +35,4 @@ private: DECLARE_DEVICE_TYPE(FUUKI_VIDEO, fuukivid_device) -#endif // MAME_FUUKI_FUUKIFH_H +#endif // MAME_FUUKI_FUUKIFG_H diff --git a/src/mame/fuuki/fuukifg2.cpp b/src/mame/fuuki/fuukifg2.cpp index 5219b4cfb11..ed89a42e286 100644 --- a/src/mame/fuuki/fuukifg2.cpp +++ b/src/mame/fuuki/fuukifg2.cpp @@ -1,5 +1,6 @@ // license:BSD-3-Clause -// copyright-holders:Luca Elia,Paul Priest +// copyright-holders: Luca Elia, Paul Priest + /*************************************************************************** -= Fuuki 16 Bit Games =- @@ -26,7 +27,7 @@ Do NOT trust the Service Mode for dipswitch settings for Go Go! Mile Smile: setting of Coin B and only uses the settings for Coin A, except for Coin B "Free Play" The game says Press 1 or 2, and will start the game, but jumps right to the Game Over and "Continue" countdown. -The Service Mode is WAY off on effects of dipswitches for the ealier set!!! It reports +The Service Mode is WAY off on effects of dipswitches for the earlier set!!! It reports the effects of MAME's SW1:3-8 have been moved to SW1:2-7 and Demo Sound has moved to SW2:7. What MAME shows as settings are according to actual game effect and reflect what the manual states. @@ -46,13 +47,293 @@ To Do: ***************************************************************************/ #include "emu.h" -#include "fuukifg2.h" + +#include "fuukifg.h" #include "cpu/z80/z80.h" #include "cpu/m68000/m68000.h" -#include "sound/ymopn.h" +#include "machine/gen_latch.h" +#include "sound/okim6295.h" #include "sound/ymopl.h" +#include "sound/ymopn.h" + +#include "emupal.h" +#include "screen.h" #include "speaker.h" +#include "tilemap.h" + + +namespace { + +class fuuki16_state : public driver_device +{ +public: + fuuki16_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_audiocpu(*this, "audiocpu") + , m_oki(*this, "oki") + , m_gfxdecode(*this, "gfxdecode") + , m_screen(*this, "screen") + , m_palette(*this, "palette") + , m_fuukivid(*this, "fuukivid") + , m_soundlatch(*this, "soundlatch") + , m_spriteram(*this, "spriteram") + , m_vram(*this, "vram.%u", 0) + , m_vregs(*this, "vregs") + , m_unknown(*this, "unknown") + , m_priority(*this, "priority") + , m_soundbank(*this, "soundbank") + { } + + void fuuki16(machine_config &config); + +protected: + virtual void machine_start() override ATTR_COLD; + virtual void machine_reset() override ATTR_COLD; + virtual void video_start() override ATTR_COLD; + +private: + // devices + required_device<cpu_device> m_maincpu; + required_device<cpu_device> m_audiocpu; + required_device<okim6295_device> m_oki; + required_device<gfxdecode_device> m_gfxdecode; + required_device<screen_device> m_screen; + required_device<palette_device> m_palette; + required_device<fuukivid_device> m_fuukivid; + required_device<generic_latch_8_device> m_soundlatch; + + // memory pointers + required_shared_ptr<u16> m_spriteram; + required_shared_ptr_array<u16, 4> m_vram; + required_shared_ptr<u16> m_vregs; + required_shared_ptr<u16> m_unknown; + required_shared_ptr<u16> m_priority; + + required_memory_bank m_soundbank; + + // video-related + tilemap_t *m_tilemap[3]{}; + + // misc + emu_timer *m_level_1_interrupt_timer = nullptr; + emu_timer *m_vblank_interrupt_timer = nullptr; + emu_timer *m_raster_interrupt_timer = nullptr; + + void main_map(address_map &map) ATTR_COLD; + void sound_io_map(address_map &map) ATTR_COLD; + void sound_map(address_map &map) ATTR_COLD; + + TIMER_CALLBACK_MEMBER(level1_interrupt); + TIMER_CALLBACK_MEMBER(vblank_interrupt); + TIMER_CALLBACK_MEMBER(raster_interrupt); + + void vregs_w(offs_t offset, u16 data, u16 mem_mask = ~0); + void sound_command_w(u8 data); + void sound_rombank_w(u8 data); + template<int Layer> void vram_w(offs_t offset, u16 data, u16 mem_mask = ~0); + template<int Layer> void vram_buffered_w(offs_t offset, u16 data, u16 mem_mask = ~0); + void oki_banking_w(u8 data); + + template<int Layer> TILE_GET_INFO_MEMBER(get_tile_info); + + void colpri_cb(u32 &colour, u32 &pri_mask); + u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, u8 i, int flag, u8 pri, u8 primask = 0xff); +}; + + +/*************************************************************************** + + [ 4 Scrolling Layers ] + + [ Layer 0 ] [ Layer 1 ] [ Layer 2 (double-buffered) ] + + Tile Size: 16 x 16 x 4 16 x 16 x 8 8 x 8 x 4 + Layer Size (tiles): 64 x 32 64 x 32 64 x 32 + + [ 1024? Zooming Sprites ] + + Sprites are made of 16 x 16 x 4 tiles. Size can vary from 1 to 16 + tiles both horizontally and vertically. + There is zooming (from full size to half size) and 4 levels of + priority (wrt layers) + + * Note: the game does hardware assisted raster effects * + +***************************************************************************/ + +/*************************************************************************** + + + Tilemaps + + Offset: Bits: Value: + + 0.w Code + + 2.w fedc ba98 ---- ---- + ---- ---- 7--- ---- Flip Y + ---- ---- -6-- ---- Flip X + ---- ---- --54 3210 Color + + +***************************************************************************/ + +template<int Layer> +TILE_GET_INFO_MEMBER(fuuki16_state::get_tile_info) +{ + const int buffer = (Layer < 2) ? 0 : (m_vregs[0x1e / 2] & 0x40) >> 6; + const u16 code = m_vram[Layer|buffer][2 * tile_index + 0]; + const u16 attr = m_vram[Layer|buffer][2 * tile_index + 1]; + tileinfo.set(Layer, code, attr & 0x3f, TILE_FLIPYX((attr >> 6) & 3)); +} + +/*************************************************************************** + + + Video Hardware Init + + +***************************************************************************/ + +// Not used atm, seems to be fine without clearing pens? +#if 0 +void fuuki16_state::fuuki16_palette(palette_device &palette) const +{ + // The game does not initialise the palette at startup. It should be totally black + for (int pen = 0; pen < palette.entries(); pen++) + palette.set_pen_color(pen, rgb_t:black()); +} +#endif + +void fuuki16_state::video_start() +{ + m_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(fuuki16_state::get_tile_info<0>)), TILEMAP_SCAN_ROWS, 16, 16, 64, 32); + m_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(fuuki16_state::get_tile_info<1>)), TILEMAP_SCAN_ROWS, 16, 16, 64, 32); + m_tilemap[2] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(fuuki16_state::get_tile_info<2>)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + + m_tilemap[0]->set_transparent_pen(0x0f); // 4 bits + m_tilemap[1]->set_transparent_pen(0xff); // 8 bits + m_tilemap[2]->set_transparent_pen(0x0f); // 4 bits + + m_gfxdecode->gfx(1)->set_granularity(16); // 256 colour tiles with palette selectable on 16 colour boundaries +} + + +void fuuki16_state::colpri_cb(u32 &colour, u32 &pri_mask) +{ + const u8 priority = (colour >> 6) & 3; + switch (priority) + { + case 3: pri_mask = 0xf0 | 0xcc | 0xaa; break; // behind all layers + case 2: pri_mask = 0xf0 | 0xcc; break; // behind fg + middle layer + case 1: pri_mask = 0xf0; break; // behind fg layer + case 0: + default: pri_mask = 0; // above all + } + colour &= 0x3f; +} + + +/*************************************************************************** + + + Screen Drawing + + Video Registers (vregs): + + 00.w Layer 0 Scroll Y + 02.w Layer 0 Scroll X + 04.w Layer 1 Scroll Y + 06.w Layer 1 Scroll X + 08.w Layer 2 Scroll Y + 0a.w Layer 2 Scroll X + 0c.w Layers Y Offset + 0e.w Layers X Offset + + 10-1a.w ? 0 + 1c.w Trigger a level 5 irq on this raster line + 1e.w ? $3390/$3393 (Flip Screen Off/On), $0040 is buffer for tilemap 2 + + Priority Register (priority): + + fedc ba98 7654 3--- + ---- ---- ---- -210 Layer Order + + + Unknown Registers (unknown): + + 00.w ? $0200/$0201 (Flip Screen Off/On) + 02.w ? $f300/$0330 + +***************************************************************************/ + +// Wrapper to handle bg and bg2 together +void fuuki16_state::draw_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, u8 i, int flag, u8 pri, u8 primask) +{ + m_tilemap[i]->draw(screen, bitmap, cliprect, flag, pri, primask); +} + +u32 fuuki16_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + /* + It's not independent bits causing layers to switch, that wouldn't make sense with 3 bits. + See fuukifg3 for more justification + */ + static const u8 pri_table[6][3] = { + { 0, 1, 2 }, + { 0, 2, 1 }, + { 1, 0, 2 }, + { 1, 2, 0 }, + { 2, 0, 1 }, + { 2, 1, 0 }}; + + const u8 tm_front = pri_table[m_priority[0] & 0x0f][0]; + const u8 tm_middle = pri_table[m_priority[0] & 0x0f][1]; + const u8 tm_back = pri_table[m_priority[0] & 0x0f][2]; + + flip_screen_set(m_vregs[0x1e / 2] & 1); + + // Layers scrolling + + const u16 scrolly_offs = m_vregs[0xc / 2] - (flip_screen() ? 0x103 : 0x1f3); + const u16 scrollx_offs = m_vregs[0xe / 2] - (flip_screen() ? 0x2a7 : 0x3f6); + + const u16 layer0_scrolly = m_vregs[0x0 / 2] + scrolly_offs; + const u16 layer0_scrollx = m_vregs[0x2 / 2] + scrollx_offs; + const u16 layer1_scrolly = m_vregs[0x4 / 2] + scrolly_offs; + const u16 layer1_scrollx = m_vregs[0x6 / 2] + scrollx_offs; + + const u16 layer2_scrolly = m_vregs[0x8 / 2]; + const u16 layer2_scrollx = m_vregs[0xa / 2]; + + m_tilemap[0]->set_scrollx(0, layer0_scrollx); + m_tilemap[0]->set_scrolly(0, layer0_scrolly); + m_tilemap[1]->set_scrollx(0, layer1_scrollx); + m_tilemap[1]->set_scrolly(0, layer1_scrolly); + + m_tilemap[2]->set_scrollx(0, layer2_scrollx + 0x10); + m_tilemap[2]->set_scrolly(0, layer2_scrolly /*+ 0x02*/); + + /* The backmost tilemap decides the background color(s) but sprites can + go below the opaque pixels of that tilemap. We thus need to mark the + transparent pixels of this layer with a different priority value */ +// draw_layer(screen, bitmap, cliprect, tm_back, TILEMAP_DRAW_OPAQUE, 0); + + /* Actually, bg colour is simply the last pen i.e. 0x1fff -pjp */ + bitmap.fill((0x800 * 4) - 1, cliprect); + screen.priority().fill(0, cliprect); + + draw_layer(screen, bitmap, cliprect, tm_back, 0, 1); + draw_layer(screen, bitmap, cliprect, tm_middle, 0, 2); + draw_layer(screen, bitmap, cliprect, tm_front, 0, 4); + + m_fuukivid->draw_sprites(screen, bitmap, cliprect, flip_screen(), m_spriteram, m_spriteram.bytes() / 2); + + return 0; +} //------------------------------------------------- @@ -81,7 +362,7 @@ void fuuki16_state::vregs_w(offs_t offset, u16 data, u16 mem_mask) void fuuki16_state::sound_command_w(u8 data) { - m_soundlatch->write(data & 0xff); + m_soundlatch->write(data); m_audiocpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero); // m_maincpu->spin_until_time(attotime::from_usec(50)); // Allow the other CPU to reply machine().scheduler().perfect_quantum(attotime::from_usec(50)); // Fixes glitching in rasters @@ -105,21 +386,21 @@ void fuuki16_state::vram_buffered_w(offs_t offset, u16 data, u16 mem_mask) void fuuki16_state::main_map(address_map &map) { - map(0x000000, 0x0fffff).rom(); // ROM - map(0x400000, 0x40ffff).ram(); // RAM - map(0x500000, 0x501fff).ram().w(FUNC(fuuki16_state::vram_w<0>)).share("vram.0"); // Layers - map(0x502000, 0x503fff).ram().w(FUNC(fuuki16_state::vram_w<1>)).share("vram.1"); // - map(0x504000, 0x505fff).ram().w(FUNC(fuuki16_state::vram_buffered_w<2>)).share("vram.2"); // - map(0x506000, 0x507fff).ram().w(FUNC(fuuki16_state::vram_buffered_w<3>)).share("vram.3"); // - map(0x600000, 0x601fff).mirror(0x008000).ram().share("spriteram"); // Sprites, mirrored? - map(0x700000, 0x703fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette + map(0x000000, 0x0fffff).rom(); + map(0x400000, 0x40ffff).ram(); + map(0x500000, 0x501fff).ram().w(FUNC(fuuki16_state::vram_w<0>)).share(m_vram[0]); + map(0x502000, 0x503fff).ram().w(FUNC(fuuki16_state::vram_w<1>)).share(m_vram[1]); + map(0x504000, 0x505fff).ram().w(FUNC(fuuki16_state::vram_buffered_w<2>)).share(m_vram[2]); + map(0x506000, 0x507fff).ram().w(FUNC(fuuki16_state::vram_buffered_w<3>)).share(m_vram[3]); + map(0x600000, 0x601fff).mirror(0x008000).ram().share(m_spriteram); // mirrored? + map(0x700000, 0x703fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x800000, 0x800001).portr("SYSTEM"); map(0x810000, 0x810001).portr("P1_P2"); map(0x880000, 0x880001).portr("DSW"); - map(0x8a0001, 0x8a0001).w(FUNC(fuuki16_state::sound_command_w)); // To Sound CPU - map(0x8c0000, 0x8c001f).ram().w(FUNC(fuuki16_state::vregs_w)).share("vregs"); // Video Registers - map(0x8d0000, 0x8d0003).ram().share("unknown"); // - map(0x8e0000, 0x8e0001).ram().share("priority"); // + map(0x8a0001, 0x8a0001).w(FUNC(fuuki16_state::sound_command_w)); + map(0x8c0000, 0x8c001f).ram().w(FUNC(fuuki16_state::vregs_w)).share(m_vregs); + map(0x8d0000, 0x8d0003).ram().share(m_unknown); + map(0x8e0000, 0x8e0001).ram().share(m_priority); } @@ -149,20 +430,20 @@ void fuuki16_state::sound_map(address_map &map) { map(0x0000, 0x5fff).rom(); // ROM map(0x6000, 0x7fff).ram(); // RAM - map(0x8000, 0xffff).bankr("soundbank"); // Banked ROM + map(0x8000, 0xffff).bankr(m_soundbank); // Banked ROM } void fuuki16_state::sound_io_map(address_map &map) { map.global_mask(0xff); - map(0x00, 0x00).w(FUNC(fuuki16_state::sound_rombank_w)); // ROM Bank - map(0x11, 0x11).r(m_soundlatch, FUNC(generic_latch_8_device::read)).nopw(); // From Main CPU / ? To Main CPU ? - map(0x20, 0x20).w(FUNC(fuuki16_state::oki_banking_w)); // Oki Banking + map(0x00, 0x00).w(FUNC(fuuki16_state::sound_rombank_w)); + map(0x11, 0x11).r(m_soundlatch, FUNC(generic_latch_8_device::read)).nopw(); // To Main CPU ? + map(0x20, 0x20).w(FUNC(fuuki16_state::oki_banking_w)); map(0x30, 0x30).nopw(); // ? In the NMI routine map(0x40, 0x41).w("ym1", FUNC(ym2203_device::write)); map(0x50, 0x51).rw("ym2", FUNC(ym3812_device::read), FUNC(ym3812_device::write)); - map(0x60, 0x60).r(m_oki, FUNC(okim6295_device::read)); // M6295 - map(0x61, 0x61).w(m_oki, FUNC(okim6295_device::write)); // M6295 + map(0x60, 0x60).r(m_oki, FUNC(okim6295_device::read)); + map(0x61, 0x61).w(m_oki, FUNC(okim6295_device::write)); } @@ -204,7 +485,7 @@ static INPUT_PORTS_START( gogomile ) PORT_START("DSW") // $880000.w PORT_SERVICE_DIPLOC( 0x0001, IP_ACTIVE_LOW, "SW1:1" ) - PORT_DIPNAME( 0x0002, 0x0002, "Demo Music" ) PORT_DIPLOCATION("SW1:2") /* Game play sounds still play, only effects Music */ + PORT_DIPNAME( 0x0002, 0x0002, "Demo Music" ) PORT_DIPLOCATION("SW1:2") // Game play sounds still play, only effects Music PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0002, DEF_STR( On ) ) PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:3,4") @@ -214,7 +495,7 @@ static INPUT_PORTS_START( gogomile ) PORT_DIPSETTING( 0x0004, DEF_STR( Very_Hard ) ) PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Language ) ) PORT_DIPLOCATION("SW1:5,6") PORT_DIPSETTING( 0x0010, DEF_STR( Chinese ) ) - PORT_DIPSETTING( 0x0030, DEF_STR( Japanese ) ) /* Only setting to give a "For use only in...." Copyright Notice */ + PORT_DIPSETTING( 0x0030, DEF_STR( Japanese ) ) // Only setting to give a "For use only in...." Copyright Notice PORT_DIPSETTING( 0x0000, DEF_STR( Korean ) ) PORT_DIPSETTING( 0x0020, DEF_STR( English ) ) PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:7,8") @@ -226,7 +507,7 @@ static INPUT_PORTS_START( gogomile ) PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:1") PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPUNUSED_DIPLOC( 0x0200, 0x0200, "SW2:2" ) /* Manual states this dip is "Unused" */ + PORT_DIPUNUSED_DIPLOC( 0x0200, 0x0200, "SW2:2" ) // Manual states this dip is "Unused" PORT_DIPNAME( 0x1c00, 0x1c00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW2:3,4,5") PORT_DIPSETTING( 0x0400, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x1400, DEF_STR( 3C_1C ) ) @@ -253,7 +534,7 @@ static INPUT_PORTS_START( gogomile ) INPUT_PORTS_END -static INPUT_PORTS_START( gogomileo ) /* The ealier version has different coinage settings. */ +static INPUT_PORTS_START( gogomileo ) // The earlier version has different coinage settings. PORT_INCLUDE( gogomile ) PORT_MODIFY("DSW") // $880000.w @@ -291,15 +572,15 @@ static INPUT_PORTS_START( pbancho ) PORT_DIPSETTING( 0x0008, DEF_STR( Easiest ) ) // 1 PORT_DIPSETTING( 0x0010, DEF_STR( Easy ) ) // 2 PORT_DIPSETTING( 0x001c, DEF_STR( Normal ) ) // 3 + PORT_DIPSETTING( 0x0000, "Normal, duplicate" ) // 3 + PORT_DIPSETTING( 0x000c, "Normal, duplicate" ) // 3 + PORT_DIPSETTING( 0x0014, "Normal, duplicate" ) // 3 PORT_DIPSETTING( 0x0018, DEF_STR( Hard ) ) // 4 PORT_DIPSETTING( 0x0004, DEF_STR( Hardest ) ) // 5 -// PORT_DIPSETTING( 0x0000, DEF_STR( Normal ) ) // 3 -// PORT_DIPSETTING( 0x000c, DEF_STR( Normal ) ) // 3 -// PORT_DIPSETTING( 0x0014, DEF_STR( Normal ) ) // 3 PORT_DIPNAME( 0x0060, 0x0060, "Lives (Vs Mode)" ) PORT_DIPLOCATION("SW1:6,7") PORT_DIPSETTING( 0x0000, "1" ) // 1 1 PORT_DIPSETTING( 0x0060, "2" ) // 2 3 -// PORT_DIPSETTING( 0x0020, "2" ) // 2 3 + PORT_DIPSETTING( 0x0020, "2, duplicate" ) // 2 3 PORT_DIPSETTING( 0x0040, "3" ) // 3 5 PORT_DIPNAME( 0x0080, 0x0080, "? Senin Mode ?" ) PORT_DIPLOCATION("SW1:8") PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) @@ -337,7 +618,7 @@ INPUT_PORTS_END // graphics layouts //------------------------------------------------- -/* 16x16x8 */ +// 16x16x8 static const gfx_layout layout_16x16x8 = { 16,16, @@ -350,9 +631,9 @@ static const gfx_layout layout_16x16x8 = }; static GFXDECODE_START( gfx_fuuki16 ) - GFXDECODE_ENTRY( "gfx2", 0, gfx_16x16x4_packed_msb, 0x400*0, 0x40 ) // [0] Layer 0 - GFXDECODE_ENTRY( "gfx3", 0, layout_16x16x8, 0x400*1, 0x40 ) // [1] Layer 1 - GFXDECODE_ENTRY( "gfx4", 0, gfx_8x8x4_packed_msb, 0x400*3, 0x40 ) // [2] Layer 2 + GFXDECODE_ENTRY( "tiles_l0", 0, gfx_16x16x4_packed_msb, 0x400*0, 0x40 ) // [0] Layer 0 + GFXDECODE_ENTRY( "tiles_l1", 0, layout_16x16x8, 0x400*1, 0x40 ) // [1] Layer 1 + GFXDECODE_ENTRY( "tiles_l2", 0, gfx_8x8x4_packed_msb, 0x400*3, 0x40 ) // [2] Layer 2 GFXDECODE_END @@ -394,9 +675,9 @@ TIMER_CALLBACK_MEMBER(fuuki16_state::raster_interrupt) void fuuki16_state::machine_start() { - u8 *ROM = memregion("audiocpu")->base(); + u8 *rom = memregion("audiocpu")->base(); - m_soundbank->configure_entries(0, 3, &ROM[0x8000], 0x8000); + m_soundbank->configure_entries(0, 3, &rom[0x8000], 0x8000); m_level_1_interrupt_timer = timer_alloc(FUNC(fuuki16_state::level1_interrupt), this); m_vblank_interrupt_timer = timer_alloc(FUNC(fuuki16_state::vblank_interrupt), this); @@ -416,15 +697,15 @@ void fuuki16_state::machine_reset() void fuuki16_state::fuuki16(machine_config &config) { - /* basic machine hardware */ - M68000(config, m_maincpu, XTAL(32'000'000) / 2); /* 16 MHz */ + // basic machine hardware + M68000(config, m_maincpu, XTAL(32'000'000) / 2); // 16 MHz m_maincpu->set_addrmap(AS_PROGRAM, &fuuki16_state::main_map); - Z80(config, m_audiocpu, XTAL(12'000'000) / 2); /* 6 MHz */ + Z80(config, m_audiocpu, XTAL(12'000'000) / 2); // 6 MHz m_audiocpu->set_addrmap(AS_PROGRAM, &fuuki16_state::sound_map); m_audiocpu->set_addrmap(AS_IO, &fuuki16_state::sound_io_map); - /* video hardware */ + // video hardware SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_refresh_hz(60); m_screen->set_size(320, 256); @@ -439,21 +720,21 @@ void fuuki16_state::fuuki16(machine_config &config) m_fuukivid->set_palette(m_palette); m_fuukivid->set_color_base(0x400*2); m_fuukivid->set_color_num(0x40); - m_fuukivid->set_colpri_callback(FUNC(fuuki16_state::fuuki16_colpri_cb)); + m_fuukivid->set_colpri_callback(FUNC(fuuki16_state::colpri_cb)); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); GENERIC_LATCH_8(config, m_soundlatch); - ym2203_device &ym1(YM2203(config, "ym1", XTAL(28'640'000) / 8)); /* 3.58 MHz */ + ym2203_device &ym1(YM2203(config, "ym1", XTAL(28'640'000) / 8)); // 3.58 MHz ym1.add_route(ALL_OUTPUTS, "mono", 0.15); - ym3812_device &ym2(YM3812(config, "ym2", XTAL(28'640'000) / 8)); /* 3.58 MHz */ + ym3812_device &ym2(YM3812(config, "ym2", XTAL(28'640'000) / 8)); // 3.58 MHz ym2.irq_handler().set_inputline(m_audiocpu, 0); ym2.add_route(ALL_OUTPUTS, "mono", 0.30); - OKIM6295(config, m_oki, XTAL(32'000'000) / 32, okim6295_device::PIN7_HIGH); /* 1 Mhz */ + OKIM6295(config, m_oki, XTAL(32'000'000) / 32, okim6295_device::PIN7_HIGH); // 1 MHz m_oki->add_route(ALL_OUTPUTS, "mono", 0.85); } @@ -509,58 +790,58 @@ YM2203C - 3.58mhz, OSC2 / 8 ***************************************************************************/ ROM_START( gogomile ) - ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 Code */ + ROM_REGION( 0x100000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "fp2n.rom2", 0x000000, 0x080000, CRC(e73583a0) SHA1(05c6ee5cb2c151b32c462e8b920f9a57fb6cce5b) ) ROM_LOAD16_BYTE( "fp1n.rom1", 0x000001, 0x080000, CRC(7b110824) SHA1(980e326d3b9e113ed522be3076663a249da4e739) ) - ROM_REGION( 0x20000, "audiocpu", 0 ) /* Z80 Code */ + ROM_REGION( 0x20000, "audiocpu", 0 ) // Z80 code ROM_LOAD( "fs1.rom24", 0x00000, 0x20000, CRC(4e4bd371) SHA1(429e776135ce8960e147762763d952d16ed3f9d4) ) - ROM_REGION( 0x200000, "fuukivid", 0 ) /* 16x16x4 Sprites */ + ROM_REGION( 0x200000, "fuukivid", 0 ) // 16x16x4 sprites ROM_LOAD16_WORD_SWAP( "lh537k2r.rom20", 0x000000, 0x200000, CRC(525dbf51) SHA1(f21876676cc60ed65bc86884da894b24830826bb) ) - ROM_REGION( 0x200000, "gfx2", 0 ) /* 16x16x4 Tiles */ + ROM_REGION( 0x200000, "tiles_l0", 0 ) // 16x16x4 tiles ROM_LOAD16_WORD_SWAP( "lh5370h6.rom3", 0x000000, 0x200000, CRC(e2ca7107) SHA1(7174c2e1e2106275ad41b53af22651dca492367a) ) // x11xxxxxxxxxxxxxxxxxx = 0xFF - ROM_REGION( 0x800000, "gfx3", 0 ) /* 16x16x8 Tiles */ + ROM_REGION( 0x800000, "tiles_l1", 0 ) // 16x16x8 tiles ROM_LOAD32_WORD_SWAP( "lh5370h7.rom15", 0x000000, 0x200000, CRC(34921680) SHA1(d9862f106caa14ea6ad925174e6bf2d542511593) ) ROM_LOAD32_WORD_SWAP( "lh5370h8.rom11", 0x000002, 0x200000, CRC(9961c925) SHA1(c47b4f19f090527b3e0c04dd046aa9cd51ca0e16) ) ROM_LOAD32_WORD_SWAP( "lh5370h9.rom16", 0x400000, 0x200000, CRC(e0118483) SHA1(36f9068e6c81c171b4426c3794277742bbc926f5) ) ROM_LOAD32_WORD_SWAP( "lh5370ha.rom12", 0x400002, 0x200000, CRC(5f2a87de) SHA1(d7ed8f01b40aaf58126aaeee10ec7d948a144080) ) - ROM_REGION( 0x200000, "gfx4", 0 ) /* 16x16x4 Tiles */ + ROM_REGION( 0x200000, "tiles_l2", 0 ) // 16x16x4 tiles ROM_LOAD16_WORD_SWAP( "lh5370hb.rom19", 0x000000, 0x200000, CRC(bd1e896f) SHA1(075f7600cbced1d285cf32fc196844720eb12671) ) // FIRST AND SECOND HALF IDENTICAL - /* 0x40000 * 4: sounds+speech (japanese), sounds+speech (english) */ - ROM_REGION( 0x100000, "oki", 0 ) /* Samples */ + // 0x40000 * 4: sounds+speech (Japanese), sounds+speech (English) + ROM_REGION( 0x100000, "oki", 0 ) // samples ROM_LOAD( "lh538n1d.rom25", 0x000000, 0x100000, CRC(01622a95) SHA1(8d414bfc6dcfab1cf9cfe5738eb5c2ff31b77df6) ) // 0x40000 * 4 ROM_END ROM_START( gogomileo ) - ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 Code */ + ROM_REGION( 0x100000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "fp2.rom2", 0x000000, 0x080000, CRC(28fd3e4e) SHA1(3303e5759c0781035c74354587e1916719695754) ) // 1xxxxxxxxxxxxxxxxxx = 0xFF ROM_LOAD16_BYTE( "fp1.rom1", 0x000001, 0x080000, CRC(35a5fc45) SHA1(307207791cee7f40e88feffc5805ac25008a8566) ) // 1xxxxxxxxxxxxxxxxxx = 0xFF - ROM_REGION( 0x20000, "audiocpu", 0 ) /* Z80 Code */ + ROM_REGION( 0x20000, "audiocpu", 0 ) // Z80 code ROM_LOAD( "fs1.rom24", 0x00000, 0x20000, CRC(4e4bd371) SHA1(429e776135ce8960e147762763d952d16ed3f9d4) ) - ROM_REGION( 0x200000, "fuukivid", 0 ) /* 16x16x4 Sprites */ + ROM_REGION( 0x200000, "fuukivid", 0 ) // 16x16x4 sprites ROM_LOAD16_WORD_SWAP( "lh537k2r.rom20", 0x000000, 0x200000, CRC(525dbf51) SHA1(f21876676cc60ed65bc86884da894b24830826bb) ) - ROM_REGION( 0x200000, "gfx2", 0 ) /* 16x16x4 Tiles */ + ROM_REGION( 0x200000, "tiles_l0", 0 ) // 16x16x4 tiles ROM_LOAD16_WORD_SWAP( "lh5370h6.rom3", 0x000000, 0x200000, CRC(e2ca7107) SHA1(7174c2e1e2106275ad41b53af22651dca492367a) ) // x11xxxxxxxxxxxxxxxxxx = 0xFF - ROM_REGION( 0x800000, "gfx3", 0 ) /* 16x16x8 Tiles */ + ROM_REGION( 0x800000, "tiles_l1", 0 ) // 16x16x8 tiles ROM_LOAD32_WORD_SWAP( "lh5370h7.rom15", 0x000000, 0x200000, CRC(34921680) SHA1(d9862f106caa14ea6ad925174e6bf2d542511593) ) ROM_LOAD32_WORD_SWAP( "lh5370h8.rom11", 0x000002, 0x200000, CRC(9961c925) SHA1(c47b4f19f090527b3e0c04dd046aa9cd51ca0e16) ) ROM_LOAD32_WORD_SWAP( "lh5370h9.rom16", 0x400000, 0x200000, CRC(e0118483) SHA1(36f9068e6c81c171b4426c3794277742bbc926f5) ) ROM_LOAD32_WORD_SWAP( "lh5370ha.rom12", 0x400002, 0x200000, CRC(5f2a87de) SHA1(d7ed8f01b40aaf58126aaeee10ec7d948a144080) ) - ROM_REGION( 0x200000, "gfx4", 0 ) /* 16x16x4 Tiles */ + ROM_REGION( 0x200000, "tiles_l2", 0 ) // 16x16x4 tiles ROM_LOAD16_WORD_SWAP( "lh5370hb.rom19", 0x000000, 0x200000, CRC(bd1e896f) SHA1(075f7600cbced1d285cf32fc196844720eb12671) ) // FIRST AND SECOND HALF IDENTICAL - /* 0x40000 * 4: sounds+speech (japanese), sounds+speech (english) */ - ROM_REGION( 0x100000, "oki", 0 ) /* Samples */ + // 0x40000 * 4: sounds+speech (Japanese), sounds+speech (English) + ROM_REGION( 0x100000, "oki", 0 ) // samples ROM_LOAD( "lh538n1d.rom25", 0x000000, 0x100000, CRC(01622a95) SHA1(8d414bfc6dcfab1cf9cfe5738eb5c2ff31b77df6) ) // 0x40000 * 4 ROM_END @@ -599,55 +880,57 @@ Mitsubishi M60067-0901FP 452100 (208pin PQFP, GA1) ***************************************************************************/ ROM_START( pbancho ) // ROMs NO1 & NO2 had an addition block dot on labels - ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 Code */ + ROM_REGION( 0x100000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "no1..rom2", 0x000000, 0x080000, CRC(e607eca6) SHA1(be9156d2a336a04fb9ff147b0d0287d8ff2ccfc5) ) // 1xxxxxxxxxxxxxxxxxx = 0xFF ROM_LOAD16_BYTE( "no2..rom1", 0x000001, 0x080000, CRC(ee15b423) SHA1(6da7ba9dd785dfcf919c030e126daf8d6750d072) ) // 1xxxxxxxxxxxxxxxxxx = 0xFF - ROM_REGION( 0x20000, "audiocpu", 0 ) /* Z80 Code */ + ROM_REGION( 0x20000, "audiocpu", 0 ) // Z80 code ROM_LOAD( "no4.rom23", 0x00000, 0x20000, CRC(dfbfdb81) SHA1(84b0cbe843a9bbae43975afdbd029a9b76fd488b) ) - ROM_REGION( 0x200000, "fuukivid", 0 ) /* 16x16x4 Sprites */ + ROM_REGION( 0x200000, "fuukivid", 0 ) // 16x16x4 sprites ROM_LOAD16_WORD_SWAP( "58.rom20", 0x000000, 0x200000, CRC(4dad0a2e) SHA1(a4f70557503110a5457b9096a79a5f249095fa55) ) - ROM_REGION( 0x200000, "gfx2", 0 ) /* 16x16x4 Tiles */ + ROM_REGION( 0x200000, "tiles_l0", 0 ) // 16x16x4 tiles ROM_LOAD16_WORD_SWAP( "60.rom3", 0x000000, 0x200000, CRC(a50a3c1b) SHA1(a2b30f9f83f5dc2e069d7559aefbda9929fc640c) ) - ROM_REGION( 0x400000, "gfx3", 0 ) /* 16x16x8 Tiles */ + ROM_REGION( 0x400000, "tiles_l1", 0 ) // 16x16x8 tiles ROM_LOAD32_WORD_SWAP( "59.rom15", 0x000000, 0x200000, CRC(b83dcb70) SHA1(b0b9df451535d85612fa095b4f694cf2e7930bca) ) ROM_LOAD32_WORD_SWAP( "61.rom11", 0x000002, 0x200000, CRC(7f1213b9) SHA1(f8d6432b270c4d0954602e430ddd26841eb05656) ) - ROM_REGION( 0x200000, "gfx4", 0 ) /* 16x16x4 Tiles */ + ROM_REGION( 0x200000, "tiles_l2", 0 ) // 16x16x4 tiles ROM_LOAD16_WORD_SWAP( "60.rom3", 0x000000, 0x200000, CRC(a50a3c1b) SHA1(a2b30f9f83f5dc2e069d7559aefbda9929fc640c) ) // ?maybe? - ROM_REGION( 0x040000, "oki", 0 ) /* Samples */ + ROM_REGION( 0x040000, "oki", 0 ) // samples ROM_LOAD( "n03.rom25", 0x000000, 0x040000, CRC(a7bfb5ea) SHA1(61937eae4f8855bc09c494aff52d76d41dc3b76a) ) ROM_END ROM_START( pbanchoa ) - ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 Code */ + ROM_REGION( 0x100000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "no1.rom2", 0x000000, 0x080000, CRC(1b4fd178) SHA1(02cf3d2554b29cd253470d68ea959738f3b98dbe) ) // 1xxxxxxxxxxxxxxxxxx = 0xFF ROM_LOAD16_BYTE( "no2.rom1", 0x000001, 0x080000, CRC(9cf510a5) SHA1(08e79b5bbd1c011c32f82dd15fba42d7898861be) ) // 1xxxxxxxxxxxxxxxxxx = 0xFF - ROM_REGION( 0x20000, "audiocpu", 0 ) /* Z80 Code */ + ROM_REGION( 0x20000, "audiocpu", 0 ) // Z80 code ROM_LOAD( "no4.rom23", 0x00000, 0x20000, CRC(dfbfdb81) SHA1(84b0cbe843a9bbae43975afdbd029a9b76fd488b) ) - ROM_REGION( 0x200000, "fuukivid", 0 ) /* 16x16x4 Sprites */ + ROM_REGION( 0x200000, "fuukivid", 0 ) // 16x16x4 sprites ROM_LOAD16_WORD_SWAP( "58.rom20", 0x000000, 0x200000, CRC(4dad0a2e) SHA1(a4f70557503110a5457b9096a79a5f249095fa55) ) - ROM_REGION( 0x200000, "gfx2", 0 ) /* 16x16x4 Tiles */ + ROM_REGION( 0x200000, "tiles_l0", 0 ) // 16x16x4 tiles ROM_LOAD16_WORD_SWAP( "60.rom3", 0x000000, 0x200000, CRC(a50a3c1b) SHA1(a2b30f9f83f5dc2e069d7559aefbda9929fc640c) ) - ROM_REGION( 0x400000, "gfx3", 0 ) /* 16x16x8 Tiles */ + ROM_REGION( 0x400000, "tiles_l1", 0 ) // 16x16x8 tiles ROM_LOAD32_WORD_SWAP( "59.rom15", 0x000000, 0x200000, CRC(b83dcb70) SHA1(b0b9df451535d85612fa095b4f694cf2e7930bca) ) ROM_LOAD32_WORD_SWAP( "61.rom11", 0x000002, 0x200000, CRC(7f1213b9) SHA1(f8d6432b270c4d0954602e430ddd26841eb05656) ) - ROM_REGION( 0x200000, "gfx4", 0 ) /* 16x16x4 Tiles */ + ROM_REGION( 0x200000, "tiles_l2", 0 ) // 16x16x4 tiles ROM_LOAD16_WORD_SWAP( "60.rom3", 0x000000, 0x200000, CRC(a50a3c1b) SHA1(a2b30f9f83f5dc2e069d7559aefbda9929fc640c) ) // ?maybe? - ROM_REGION( 0x040000, "oki", 0 ) /* Samples */ + ROM_REGION( 0x040000, "oki", 0 ) // samples ROM_LOAD( "n03.rom25", 0x000000, 0x040000, CRC(a7bfb5ea) SHA1(61937eae4f8855bc09c494aff52d76d41dc3b76a) ) ROM_END +} // anonymous namespace + //------------------------------------------------- // game drivers diff --git a/src/mame/fuuki/fuukifg2.h b/src/mame/fuuki/fuukifg2.h deleted file mode 100644 index 05f3d9b5171..00000000000 --- a/src/mame/fuuki/fuukifg2.h +++ /dev/null @@ -1,92 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Luca Elia,Paul Priest -#ifndef MAME_FUUKI_FUUKIFG2_H -#define MAME_FUUKI_FUUKIFG2_H - -#pragma once - -#include "machine/gen_latch.h" -#include "sound/okim6295.h" -#include "fuukifg.h" -#include "emupal.h" -#include "screen.h" -#include "tilemap.h" - -class fuuki16_state : public driver_device -{ -public: - fuuki16_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag) - , m_maincpu(*this, "maincpu") - , m_audiocpu(*this, "audiocpu") - , m_oki(*this, "oki") - , m_gfxdecode(*this, "gfxdecode") - , m_screen(*this, "screen") - , m_palette(*this, "palette") - , m_fuukivid(*this, "fuukivid") - , m_soundlatch(*this, "soundlatch") - , m_spriteram(*this, "spriteram") - , m_vram(*this, "vram.%u", 0) - , m_vregs(*this, "vregs") - , m_unknown(*this, "unknown") - , m_priority(*this, "priority") - , m_soundbank(*this, "soundbank") - { } - - void fuuki16(machine_config &config); - -private: - virtual void machine_start() override ATTR_COLD; - virtual void machine_reset() override ATTR_COLD; - virtual void video_start() override ATTR_COLD; - - void main_map(address_map &map) ATTR_COLD; - void sound_io_map(address_map &map) ATTR_COLD; - void sound_map(address_map &map) ATTR_COLD; - - TIMER_CALLBACK_MEMBER(level1_interrupt); - TIMER_CALLBACK_MEMBER(vblank_interrupt); - TIMER_CALLBACK_MEMBER(raster_interrupt); - - void vregs_w(offs_t offset, u16 data, u16 mem_mask = ~0); - void sound_command_w(u8 data); - void sound_rombank_w(u8 data); - template<int Layer> void vram_w(offs_t offset, u16 data, u16 mem_mask = ~0); - template<int Layer> void vram_buffered_w(offs_t offset, u16 data, u16 mem_mask = ~0); - void oki_banking_w(u8 data); - - template<int Layer> TILE_GET_INFO_MEMBER(get_tile_info); - - void fuuki16_colpri_cb(u32 &colour, u32 &pri_mask); - u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void draw_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, u8 i, int flag, u8 pri, u8 primask = 0xff); - - /* devices */ - required_device<cpu_device> m_maincpu; - required_device<cpu_device> m_audiocpu; - required_device<okim6295_device> m_oki; - required_device<gfxdecode_device> m_gfxdecode; - required_device<screen_device> m_screen; - required_device<palette_device> m_palette; - required_device<fuukivid_device> m_fuukivid; - required_device<generic_latch_8_device> m_soundlatch; - - /* memory pointers */ - required_shared_ptr<u16> m_spriteram; - required_shared_ptr_array<u16, 4> m_vram; - required_shared_ptr<u16> m_vregs; - required_shared_ptr<u16> m_unknown; - required_shared_ptr<u16> m_priority; - - required_memory_bank m_soundbank; - - /* video-related */ - tilemap_t *m_tilemap[3]{}; - - /* misc */ - emu_timer *m_level_1_interrupt_timer = nullptr; - emu_timer *m_vblank_interrupt_timer = nullptr; - emu_timer *m_raster_interrupt_timer = nullptr; -}; - -#endif // MAME_FUUKI_FUUKIFG2_H diff --git a/src/mame/fuuki/fuukifg2_v.cpp b/src/mame/fuuki/fuukifg2_v.cpp deleted file mode 100644 index 553333677b1..00000000000 --- a/src/mame/fuuki/fuukifg2_v.cpp +++ /dev/null @@ -1,201 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Luca Elia,Paul Priest -/*************************************************************************** - - -= Fuuki 16 Bit Games (FG-2) =- - - driver by Luca Elia (l.elia@tin.it) - c.f. Fuuki FG-3 - - - [ 4 Scrolling Layers ] - - [ Layer 0 ] [ Layer 1 ] [ Layer 2 (double-buffered) ] - - Tile Size: 16 x 16 x 4 16 x 16 x 8 8 x 8 x 4 - Layer Size (tiles): 64 x 32 64 x 32 64 x 32 - - [ 1024? Zooming Sprites ] - - Sprites are made of 16 x 16 x 4 tiles. Size can vary from 1 to 16 - tiles both horizontally and vertically. - There is zooming (from full size to half size) and 4 levels of - priority (wrt layers) - - * Note: the game does hardware assisted raster effects * - -***************************************************************************/ - -#include "emu.h" -#include "fuukifg2.h" - -/*************************************************************************** - - - Tilemaps - - Offset: Bits: Value: - - 0.w Code - - 2.w fedc ba98 ---- ---- - ---- ---- 7--- ---- Flip Y - ---- ---- -6-- ---- Flip X - ---- ---- --54 3210 Color - - -***************************************************************************/ - -template<int Layer> -TILE_GET_INFO_MEMBER(fuuki16_state::get_tile_info) -{ - const int buffer = (Layer < 2) ? 0 : (m_vregs[0x1e / 2] & 0x40) >> 6; - const u16 code = m_vram[Layer|buffer][2 * tile_index + 0]; - const u16 attr = m_vram[Layer|buffer][2 * tile_index + 1]; - tileinfo.set(Layer, code, attr & 0x3f, TILE_FLIPYX((attr >> 6) & 3)); -} - -/*************************************************************************** - - - Video Hardware Init - - -***************************************************************************/ - -/* Not used atm, seems to be fine without clearing pens? */ -#if 0 -void fuuki16_state::fuuki16_palette(palette_device &palette) const -{ - // The game does not initialise the palette at startup. It should be totally black - for (int pen = 0; pen < palette.entries(); pen++) - palette.set_pen_color(pen, rgb_t:black()); -} -#endif - -void fuuki16_state::video_start() -{ - m_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(fuuki16_state::get_tile_info<0>)), TILEMAP_SCAN_ROWS, 16, 16, 64, 32); - m_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(fuuki16_state::get_tile_info<1>)), TILEMAP_SCAN_ROWS, 16, 16, 64, 32); - m_tilemap[2] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(fuuki16_state::get_tile_info<2>)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - - m_tilemap[0]->set_transparent_pen(0x0f); // 4 bits - m_tilemap[1]->set_transparent_pen(0xff); // 8 bits - m_tilemap[2]->set_transparent_pen(0x0f); // 4 bits - - m_gfxdecode->gfx(1)->set_granularity(16); /* 256 colour tiles with palette selectable on 16 colour boundaries */ -} - - -void fuuki16_state::fuuki16_colpri_cb(u32 &colour, u32 &pri_mask) -{ - const u8 priority = (colour >> 6) & 3; - switch (priority) - { - case 3: pri_mask = 0xf0 | 0xcc | 0xaa; break; // behind all layers - case 2: pri_mask = 0xf0 | 0xcc; break; // behind fg + middle layer - case 1: pri_mask = 0xf0; break; // behind fg layer - case 0: - default: pri_mask = 0; // above all - } - colour &= 0x3f; -} - - -/*************************************************************************** - - - Screen Drawing - - Video Registers (vregs): - - 00.w Layer 0 Scroll Y - 02.w Layer 0 Scroll X - 04.w Layer 1 Scroll Y - 06.w Layer 1 Scroll X - 08.w Layer 2 Scroll Y - 0a.w Layer 2 Scroll X - 0c.w Layers Y Offset - 0e.w Layers X Offset - - 10-1a.w ? 0 - 1c.w Trigger a level 5 irq on this raster line - 1e.w ? $3390/$3393 (Flip Screen Off/On), $0040 is buffer for tilemap 2 - - Priority Register (priority): - - fedc ba98 7654 3--- - ---- ---- ---- -210 Layer Order - - - Unknown Registers (unknown): - - 00.w ? $0200/$0201 (Flip Screen Off/On) - 02.w ? $f300/$0330 - -***************************************************************************/ - -/* Wrapper to handle bg and bg2 ttogether */ -void fuuki16_state::draw_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, u8 i, int flag, u8 pri, u8 primask) -{ - m_tilemap[i]->draw(screen, bitmap, cliprect, flag, pri, primask); -} - -u32 fuuki16_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - /* - It's not independent bits causing layers to switch, that wouldn't make sense with 3 bits. - See fuukifg3 for more justification - */ - static const u8 pri_table[6][3] = { - { 0, 1, 2 }, - { 0, 2, 1 }, - { 1, 0, 2 }, - { 1, 2, 0 }, - { 2, 0, 1 }, - { 2, 1, 0 }}; - - const u8 tm_front = pri_table[m_priority[0] & 0x0f][0]; - const u8 tm_middle = pri_table[m_priority[0] & 0x0f][1]; - const u8 tm_back = pri_table[m_priority[0] & 0x0f][2]; - - flip_screen_set(m_vregs[0x1e / 2] & 1); - - /* Layers scrolling */ - - const u16 scrolly_offs = m_vregs[0xc / 2] - (flip_screen() ? 0x103 : 0x1f3); - const u16 scrollx_offs = m_vregs[0xe / 2] - (flip_screen() ? 0x2a7 : 0x3f6); - - const u16 layer0_scrolly = m_vregs[0x0 / 2] + scrolly_offs; - const u16 layer0_scrollx = m_vregs[0x2 / 2] + scrollx_offs; - const u16 layer1_scrolly = m_vregs[0x4 / 2] + scrolly_offs; - const u16 layer1_scrollx = m_vregs[0x6 / 2] + scrollx_offs; - - const u16 layer2_scrolly = m_vregs[0x8 / 2]; - const u16 layer2_scrollx = m_vregs[0xa / 2]; - - m_tilemap[0]->set_scrollx(0, layer0_scrollx); - m_tilemap[0]->set_scrolly(0, layer0_scrolly); - m_tilemap[1]->set_scrollx(0, layer1_scrollx); - m_tilemap[1]->set_scrolly(0, layer1_scrolly); - - m_tilemap[2]->set_scrollx(0, layer2_scrollx + 0x10); - m_tilemap[2]->set_scrolly(0, layer2_scrolly /*+ 0x02*/); - - /* The backmost tilemap decides the background color(s) but sprites can - go below the opaque pixels of that tilemap. We thus need to mark the - transparent pixels of this layer with a different priority value */ -// draw_layer(screen, bitmap, cliprect, tm_back, TILEMAP_DRAW_OPAQUE, 0); - - /* Actually, bg colour is simply the last pen i.e. 0x1fff -pjp */ - bitmap.fill((0x800 * 4) - 1, cliprect); - screen.priority().fill(0, cliprect); - - draw_layer(screen, bitmap, cliprect, tm_back, 0, 1); - draw_layer(screen, bitmap, cliprect, tm_middle, 0, 2); - draw_layer(screen, bitmap, cliprect, tm_front, 0, 4); - - m_fuukivid->draw_sprites(screen, bitmap, cliprect, flip_screen(), m_spriteram, m_spriteram.bytes() / 2); - - return 0; -} diff --git a/src/mame/fuuki/fuukifg3.cpp b/src/mame/fuuki/fuukifg3.cpp index 1f5ecb8a742..ea70cd80cae 100644 --- a/src/mame/fuuki/fuukifg3.cpp +++ b/src/mame/fuuki/fuukifg3.cpp @@ -1,5 +1,6 @@ // license:BSD-3-Clause -// copyright-holders:Paul Priest, David Haywood, Luca Elia +// copyright-holders: Paul Priest, David Haywood, Luca Elia + /*************************************************************************** -= Fuuki 32 Bit Games (FG-3) =- @@ -18,8 +19,9 @@ Year + Game --------------------------------------------------------------------------- 98 Asura Blade - Sword of Dynasty (Japan) 00 Asura Buster - Eternal Warriors (Japan) +01 Asura Buster - Eternal Warriors (USA) -English versions exist, but are not dumped +English version of Asura Blade also exist, but it isn't dumped --------------------------------------------------------------------------- @@ -164,19 +166,336 @@ There is an Asura Buster known to exist on a FG3-SUB-EP containing all EPROMs ***************************************************************************/ #include "emu.h" -#include "fuukifg3.h" -#include "cpu/z80/z80.h" +#include "fuukifg.h" + #include "cpu/m68000/m68020.h" +#include "cpu/z80/z80.h" #include "sound/ymopl.h" + +#include "emupal.h" +#include "screen.h" #include "speaker.h" +#include "tilemap.h" + + +namespace { + +class fuuki32_state : public driver_device +{ +public: + fuuki32_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_gfxdecode(*this, "gfxdecode") + , m_screen(*this, "screen") + , m_palette(*this, "palette") + , m_fuukivid(*this, "fuukivid") + , m_spriteram(*this, "spriteram", 0x2000, ENDIANNESS_BIG) + , m_vram(*this, "vram.%u", 0) + , m_vregs(*this, "vregs", 0x20, ENDIANNESS_BIG) + , m_priority(*this, "priority") + , m_tilebank(*this, "tilebank") + , m_shared_ram(*this, "shared_ram") + , m_soundbank(*this, "soundbank") + , m_system(*this, "SYSTEM") + , m_inputs(*this, "INPUTS") + , m_dsw1(*this, "DSW1") + , m_dsw2(*this, "DSW2") + { } + + void fuuki32(machine_config &config); + +protected: + virtual void machine_start() override ATTR_COLD; + virtual void machine_reset() override ATTR_COLD; + virtual void video_start() override ATTR_COLD; + +private: + // devices + required_device<cpu_device> m_maincpu; + required_device<gfxdecode_device> m_gfxdecode; + required_device<screen_device> m_screen; + required_device<palette_device> m_palette; + required_device<fuukivid_device> m_fuukivid; + + // memory pointers + memory_share_creator<u16> m_spriteram; + required_shared_ptr_array<u32, 4> m_vram; + memory_share_creator<u16> m_vregs; + required_shared_ptr<u32> m_priority; + required_shared_ptr<u32> m_tilebank; + required_shared_ptr<u8> m_shared_ram; + std::unique_ptr<u16[]> m_buf_spriteram[2]; + + required_memory_bank m_soundbank; + + required_ioport m_system; + required_ioport m_inputs; + required_ioport m_dsw1; + required_ioport m_dsw2; + + // video-related + tilemap_t *m_tilemap[3]{}; + u32 m_spr_buffered_tilebank[2]{}; + + // misc + emu_timer *m_level_1_interrupt_timer = nullptr; + emu_timer *m_vblank_interrupt_timer = nullptr; + emu_timer *m_raster_interrupt_timer = nullptr; + + void main_map(address_map &map) ATTR_COLD; + void sound_io_map(address_map &map) ATTR_COLD; + void sound_map(address_map &map) ATTR_COLD; + + TIMER_CALLBACK_MEMBER(level1_interrupt); + TIMER_CALLBACK_MEMBER(vblank_interrupt); + TIMER_CALLBACK_MEMBER(raster_interrupt); + + u8 snd_020_r(offs_t offset); + void snd_020_w(offs_t offset, u8 data, u8 mem_mask = ~0); + void sprram_w(offs_t offset, u16 data, u16 mem_mask = ~0); + u16 sprram_r(offs_t offset); + u16 vregs_r(offs_t offset); + void vregs_w(offs_t offset, u16 data, u16 mem_mask = ~0); + void sound_bw_w(u8 data); + template<int Layer> void vram_w(offs_t offset, u32 data, u32 mem_mask = ~0); + template<int Layer> void vram_buffered_w(offs_t offset, u32 data, u32 mem_mask = ~0); + + template<int Layer, int ColShift> TILE_GET_INFO_MEMBER(get_tile_info); + + void tile_cb(u32 &code); + void colpri_cb(u32 &colour, u32 &pri_mask); + u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void screen_vblank(int state); + void draw_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, u8 i, int flag, u8 pri, u8 primask = 0xff); +}; + + +/*************************************************************************** + + [ 4 Scrolling Layers ] + + [ Layer 0 ] [ Layer 1 ] [ Layer 2 (double-buffered) ] + + Tile Size: 16 x 16 x 8 16 x 16 x 8 8 x 8 x 4 + Layer Size (tiles): 64 x 32 64 x 32 64 x 32 + + [ 1024? Zooming Sprites ] + + Sprites are made of 16 x 16 x 4 tiles. Size can vary from 1 to 16 + tiles both horizontally and vertically. + There is zooming (from full size to half size) and 4 levels of + priority (wrt layers) + + Per-line raster effects used on many stages + Sprites buffered by two frames + Tilebank buffered by 3 frames? Only 2 in attract + Sprite pens needs to be buffered by 3 frames? Or lazy programming? Probably 2 + +***************************************************************************/ + + +/*************************************************************************** + + + Tilemaps + + Offset: Bits: Value: + + 0.w Code + + 2.w fedc ba98 ---- ---- + ---- ---- 7--- ---- Flip Y + ---- ---- -6-- ---- Flip X + ---- ---- --54 3210 Color + + +***************************************************************************/ + +template<int Layer, int ColShift> +TILE_GET_INFO_MEMBER(fuuki32_state::get_tile_info) +{ + const int buffer = (Layer < 2) ? 0 : (m_vregs[0x1e / 2] & 0x40) >> 6; + const u16 code = (m_vram[Layer|buffer][tile_index] & 0xffff0000) >> 16; + const u16 attr = (m_vram[Layer|buffer][tile_index] & 0x0000ffff); + tileinfo.set(Layer, code, (attr & 0x3f) >> ColShift, TILE_FLIPYX(attr >> 6)); +} + +/*************************************************************************** + + + Video Hardware Init + + +***************************************************************************/ + +void fuuki32_state::video_start() +{ + const u32 spriteram_size = m_spriteram.bytes(); + m_buf_spriteram[0] = make_unique_clear<u16[]>(spriteram_size / 2); + m_buf_spriteram[1] = make_unique_clear<u16[]>(spriteram_size / 2); + + m_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, NAME((&fuuki32_state::get_tile_info<0, 4>))), TILEMAP_SCAN_ROWS, 16, 16, 64, 32); + m_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, NAME((&fuuki32_state::get_tile_info<1, 4>))), TILEMAP_SCAN_ROWS, 16, 16, 64, 32); + m_tilemap[2] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, NAME((&fuuki32_state::get_tile_info<2, 0>))), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + + m_tilemap[0]->set_transparent_pen(0xff); // 8 bits + m_tilemap[1]->set_transparent_pen(0xff); // 8 bits + m_tilemap[2]->set_transparent_pen(0x0f); // 4 bits + + //m_gfxdecode->gfx(0)->set_granularity(16); // 256 colour tiles with palette selectable on 16 colour boundaries + //m_gfxdecode->gfx(1)->set_granularity(16); + + save_pointer(NAME(m_buf_spriteram[0]), spriteram_size / 2); + save_pointer(NAME(m_buf_spriteram[1]), spriteram_size / 2); +} + + +void fuuki32_state::sprram_w(offs_t offset, u16 data, u16 mem_mask) +{ + COMBINE_DATA(&m_spriteram[offset]); +}; + +u16 fuuki32_state::sprram_r(offs_t offset) +{ + return m_spriteram[offset]; +} + +void fuuki32_state::tile_cb(u32 &code) +{ + const u32 bank = (code & 0xc000) >> 14; + + const u32 bank_lookedup = ((m_spr_buffered_tilebank[1] & 0xffff0000) >> (16 + bank * 4)) & 0xf; + code &= 0x3fff; + code += bank_lookedup * 0x4000; +} + +void fuuki32_state::colpri_cb(u32 &colour, u32 &pri_mask) +{ + const u8 priority = (colour >> 6) & 3; + switch (priority) + { + case 3: pri_mask = 0xf0 | 0xcc | 0xaa; break; // behind all layers + case 2: pri_mask = 0xf0 | 0xcc; break; // behind fg + middle layer + case 1: pri_mask = 0xf0; break; // behind fg layer + case 0: + default: pri_mask = 0; // above all + } + colour &= 0x3f; +} + +/*************************************************************************** + + + Screen Drawing + + Video Registers (vregs): + + 00.w Layer 0 Scroll Y + 02.w Layer 0 Scroll X + 04.w Layer 1 Scroll Y + 06.w Layer 1 Scroll X + 08.w Layer 2 Scroll Y + 0a.w Layer 2 Scroll X + 0c.w Layers Y Offset + 0e.w Layers X Offset + + 10-1a.w ? 0 + 1c.w Trigger a level 5 irq on this raster line + 1e.w ? $3390/$3393 (Flip Screen Off/On), $0040 is buffer for tilemap 2 + + Priority Register (priority): + + fedc ba98 7654 3--- + ---- ---- ---- -210 Layer Order + + + Unknown Registers ($de0000.l): + + 00.w ? $0200/$0201 (Flip Screen Off/On) + 02.w ? $f300/$0330 + +***************************************************************************/ + +// Wrapper to handle bg and bg2 together +void fuuki32_state::draw_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, u8 i, int flag, u8 pri, u8 primask) +{ + m_tilemap[i]->draw(screen, bitmap, cliprect, flag, pri, primask); +} + +u32 fuuki32_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + /* + It's not independent bits causing layers to switch, that wouldn't make sense with 3 bits. + */ + + static const u8 pri_table[6][3] = { + { 0, 1, 2 }, // Special moves 0>1, 0>2 (0,1,2 or 0,2,1) + { 0, 2, 1 }, // Two Levels - 0>1 (0,1,2 or 0,2,1 or 2,0,1) + { 1, 0, 2 }, // Most Levels - 2>1 1>0 2>0 (1,0,2) + { 1, 2, 0 }, // Not used? + { 2, 0, 1 }, // Title etc. - 0>1 (0,1,2 or 0,2,1 or 2,0,1) + { 2, 1, 0 }}; // Char Select, prison stage 1>0 (leaves 1,2,0 or 2,1,0) + + const u8 tm_front = pri_table[(m_priority[0] >> 16) & 0x0f][0]; + const u8 tm_middle = pri_table[(m_priority[0] >> 16) & 0x0f][1]; + const u8 tm_back = pri_table[(m_priority[0] >> 16) & 0x0f][2]; + + flip_screen_set(m_vregs[0x1e / 2] & 1); + + // Layers scrolling + + const u16 scrolly_offs = m_vregs[0xc / 2] - (flip_screen() ? 0x103 : 0x1f3); + const u16 scrollx_offs = m_vregs[0xe / 2] - (flip_screen() ? 0x2c7 : 0x3f6); + + const u16 layer0_scrolly = m_vregs[0x0 / 2] + scrolly_offs; + const u16 layer0_scrollx = m_vregs[0x2 / 2] + scrollx_offs; + const u16 layer1_scrolly = m_vregs[0x4 / 2] + scrolly_offs; + const u16 layer1_scrollx = m_vregs[0x6 / 2] + scrollx_offs; + + const u16 layer2_scrolly = m_vregs[0x8 / 2]; + const u16 layer2_scrollx = m_vregs[0xa / 2]; + + m_tilemap[0]->set_scrollx(0, layer0_scrollx); + m_tilemap[0]->set_scrolly(0, layer0_scrolly); + m_tilemap[1]->set_scrollx(0, layer1_scrollx); + m_tilemap[1]->set_scrolly(0, layer1_scrolly); + + m_tilemap[2]->set_scrollx(0, layer2_scrollx); + m_tilemap[2]->set_scrolly(0, layer2_scrolly); + + // The bg colour is the last pen i.e. 0x1fff + bitmap.fill((0x800 * 4) - 1, cliprect); + screen.priority().fill(0, cliprect); + + draw_layer(screen, bitmap, cliprect, tm_back, 0, 1); + draw_layer(screen, bitmap, cliprect, tm_middle, 0, 2); + draw_layer(screen, bitmap, cliprect, tm_front, 0, 4); + + m_fuukivid->draw_sprites(screen, bitmap, cliprect, flip_screen(), m_buf_spriteram[1].get(), m_spriteram.bytes() / 2); + return 0; +} + +void fuuki32_state::screen_vblank(int state) +{ + // rising edge + if (state) + { + // Buffer sprites and tilebank by 2 frames + m_spr_buffered_tilebank[1] = m_spr_buffered_tilebank[0]; + m_spr_buffered_tilebank[0] = m_tilebank[0]; + memcpy(m_buf_spriteram[1].get(), m_buf_spriteram[0].get(), m_spriteram.bytes()); + memcpy(m_buf_spriteram[0].get(), m_spriteram, m_spriteram.bytes()); + } +} //------------------------------------------------- // memory - main CPU //------------------------------------------------- -/* Sound comms */ +// Sound comms u8 fuuki32_state::snd_020_r(offs_t offset) { machine().scheduler().synchronize(); @@ -232,28 +551,28 @@ void fuuki32_state::vram_buffered_w(offs_t offset, u32 data, u32 mem_mask) void fuuki32_state::main_map(address_map &map) { - map(0x000000, 0x1fffff).rom(); // ROM + map(0x000000, 0x1fffff).rom(); map(0x400000, 0x40ffff).ram(); // Work RAM map(0x410000, 0x41ffff).ram(); // Work RAM (used by asurabus) - map(0x500000, 0x501fff).ram().w(FUNC(fuuki32_state::vram_w<0>)).share("vram.0"); // Tilemap 1 - map(0x502000, 0x503fff).ram().w(FUNC(fuuki32_state::vram_w<1>)).share("vram.1"); // Tilemap 2 - map(0x504000, 0x505fff).ram().w(FUNC(fuuki32_state::vram_buffered_w<2>)).share("vram.2"); // Tilemap bg - map(0x506000, 0x507fff).ram().w(FUNC(fuuki32_state::vram_buffered_w<3>)).share("vram.3"); // Tilemap bg2 + map(0x500000, 0x501fff).ram().w(FUNC(fuuki32_state::vram_w<0>)).share(m_vram[0]); // Tilemap 1 + map(0x502000, 0x503fff).ram().w(FUNC(fuuki32_state::vram_w<1>)).share(m_vram[1]); // Tilemap 2 + map(0x504000, 0x505fff).ram().w(FUNC(fuuki32_state::vram_buffered_w<2>)).share(m_vram[2]); // Tilemap bg + map(0x506000, 0x507fff).ram().w(FUNC(fuuki32_state::vram_buffered_w<3>)).share(m_vram[3]); // Tilemap bg2 map(0x508000, 0x517fff).ram(); // More tilemap, or linescroll? Seems to be empty all of the time - map(0x600000, 0x601fff).rw(FUNC(fuuki32_state::sprram_r), FUNC(fuuki32_state::sprram_w)); // Sprites - map(0x700000, 0x703fff).ram().w(m_palette, FUNC(palette_device::write32)).share("palette"); // Palette + map(0x600000, 0x601fff).rw(FUNC(fuuki32_state::sprram_r), FUNC(fuuki32_state::sprram_w)); + map(0x700000, 0x703fff).ram().w(m_palette, FUNC(palette_device::write32)).share("palette"); map(0x800000, 0x800003).lr16(NAME([this] () { return u16(m_system->read()); })).nopw(); // Coin - map(0x810000, 0x810003).lr16(NAME([this] () { return u16(m_inputs->read()); })).nopw(); // Player Inputs - map(0x880000, 0x880003).lr16(NAME([this] () { return u16(m_dsw1->read()); })); // Service + DIPS - map(0x890000, 0x890003).lr16(NAME([this] () { return u16(m_dsw2->read()); })); // More DIPS + map(0x810000, 0x810003).lr16(NAME([this] () { return u16(m_inputs->read()); })).nopw(); // Player inputs + map(0x880000, 0x880003).lr16(NAME([this] () { return u16(m_dsw1->read()); })); // Service + DIPs + map(0x890000, 0x890003).lr16(NAME([this] () { return u16(m_dsw2->read()); })); // More DIPs - map(0x8c0000, 0x8c001f).rw(FUNC(fuuki32_state::vregs_r), FUNC(fuuki32_state::vregs_w)); // Video Registers - map(0x8d0000, 0x8d0003).ram(); // Flipscreen Related - map(0x8e0000, 0x8e0003).ram().share("priority"); // Controls layer order + map(0x8c0000, 0x8c001f).rw(FUNC(fuuki32_state::vregs_r), FUNC(fuuki32_state::vregs_w)); + map(0x8d0000, 0x8d0003).ram(); // Flipscreen related + map(0x8e0000, 0x8e0003).ram().share(m_priority); // Controls layer order map(0x903fe0, 0x903fff).rw(FUNC(fuuki32_state::snd_020_r), FUNC(fuuki32_state::snd_020_w)).umask32(0x00ff00ff); // Shared with Z80 - map(0xa00000, 0xa00003).writeonly().share("tilebank"); // Tilebank + map(0xa00000, 0xa00003).writeonly().share(m_tilebank); } @@ -268,10 +587,10 @@ void fuuki32_state::sound_bw_w(u8 data) void fuuki32_state::sound_map(address_map &map) { - map(0x0000, 0x5fff).rom(); // ROM - map(0x6000, 0x6fff).ram(); // RAM - map(0x7ff0, 0x7fff).ram().share("shared_ram"); - map(0x8000, 0xffff).bankr("soundbank"); // ROM + map(0x0000, 0x5fff).rom(); + map(0x6000, 0x6fff).ram(); + map(0x7ff0, 0x7fff).ram().share(m_shared_ram); + map(0x8000, 0xffff).bankr(m_soundbank); } void fuuki32_state::sound_io_map(address_map &map) @@ -327,7 +646,7 @@ static INPUT_PORTS_START( asurabld ) PORT_DIPSETTING( 0x000c, "Both On" ) PORT_DIPSETTING( 0x0008, "Music Off" ) PORT_DIPSETTING( 0x0004, "Both Off" ) - PORT_DIPSETTING( 0x0000, "Both Off" ) /* Duplicate setting */ + PORT_DIPSETTING( 0x0000, "Both Off" ) // Duplicate setting PORT_DIPNAME( 0x0030, 0x0030, "Timer" ) PORT_DIPLOCATION("SW1:5,6") PORT_DIPSETTING( 0x0000, "Slow" ) PORT_DIPSETTING( 0x0030, DEF_STR( Medium ) ) @@ -336,7 +655,7 @@ static INPUT_PORTS_START( asurabld ) PORT_DIPNAME( 0x00c0, 0x0000, "Coinage Mode" ) PORT_DIPLOCATION("SW1:7,8") PORT_DIPSETTING( 0x00c0, "Split" ) PORT_DIPSETTING( 0x0000, "Joint" ) - PORT_DIPUNUSED_DIPLOC( 0x0100, 0x0100, "SW2:1" ) /* DSW2 bank, not used for either game */ + PORT_DIPUNUSED_DIPLOC( 0x0100, 0x0100, "SW2:1" ) // DSW2 bank, not used for either game PORT_DIPUNUSED_DIPLOC( 0x0200, 0x0200, "SW2:2" ) PORT_DIPUNUSED_DIPLOC( 0x0400, 0x0400, "SW2:3" ) PORT_DIPUNUSED_DIPLOC( 0x0800, 0x0800, "SW2:4" ) @@ -363,12 +682,12 @@ static INPUT_PORTS_START( asurabld ) PORT_DIPSETTING( 0x0030, "100%" ) PORT_DIPSETTING( 0x0010, "125%" ) PORT_DIPSETTING( 0x0000, "150%" ) - PORT_DIPNAME( 0x00c0, 0x00c0, "Max Rounds" ) PORT_DIPLOCATION("SW3:7,8") /* Service Mode shows rounds needed to win the match */ - PORT_DIPSETTING( 0x0000, "1" ) /* Service Mode Shows 1 */ - PORT_DIPSETTING( 0x00c0, "3" ) /* Service Mode Shows 3, Service Mode has 2 & 3 reversed compared to game play */ - PORT_DIPSETTING( 0x0080, "5" ) /* Service Mode Shows 2, Service Mode has 2 & 3 reversed compared to game play */ -// PORT_DIPSETTING( 0x0040, "Error!!" ) /* Service Mode Shows "Error" */ - PORT_DIPNAME( 0xf000, 0xf000, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW4:1,2,3,4") /* Service Mode Shows Player 2 */ + PORT_DIPNAME( 0x00c0, 0x00c0, "Max Rounds" ) PORT_DIPLOCATION("SW3:7,8") // Service Mode shows rounds needed to win the match + PORT_DIPSETTING( 0x0000, "1" ) // Service Mode Shows 1 + PORT_DIPSETTING( 0x00c0, "3" ) // Service Mode Shows 3, Service Mode has 2 & 3 reversed compared to game play + PORT_DIPSETTING( 0x0080, "5" ) // Service Mode Shows 2, Service Mode has 2 & 3 reversed compared to game play + PORT_DIPSETTING( 0x0040, "Error!!" ) // Service Mode Shows "Error" + PORT_DIPNAME( 0xf000, 0xf000, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW4:1,2,3,4") // Service Mode Shows Player 2 PORT_DIPSETTING( 0x8000, DEF_STR( 8C_1C ) ) PORT_DIPSETTING( 0x9000, DEF_STR( 7C_1C ) ) PORT_DIPSETTING( 0xa000, DEF_STR( 6C_1C ) ) @@ -376,17 +695,17 @@ static INPUT_PORTS_START( asurabld ) PORT_DIPSETTING( 0xc000, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0xd000, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0xe000, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( 2C_1C ) ) // Duplicate 2C_1C PORT_DIPSETTING( 0xf000, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x6000, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x5000, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x4000, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x3000, DEF_STR( 1C_5C ) ) PORT_DIPSETTING( 0x2000, "2C Start / 1C Continue" ) -// PORT_DIPSETTING( 0x7000, "Error!!" ) // Causes graphics issues - Service Mode shows "Error" -// PORT_DIPSETTING( 0x1000, DEF_STR( 2C_1C ) ) // Duplicate 2C_1C - PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW2",0x0f00,NOTEQUALS,0x0000) - PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) PORT_CONDITION("DSW2",0x0f00,EQUALS,0x0000) // Set both for Free Play - PORT_DIPNAME( 0x0f00, 0x0f00, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW4:5,6,7,8") /* Service Mode Shows Player 1 */ + PORT_DIPSETTING( 0x7000, "Error!!" ) // Causes graphics issues - Service Mode shows "Error" + PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW2", 0x0f00, NOTEQUALS, 0x0000) + PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) PORT_CONDITION("DSW2", 0x0f00, EQUALS, 0x0000) // Set both for Free Play + PORT_DIPNAME( 0x0f00, 0x0f00, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW4:5,6,7,8") // Service Mode Shows Player 1 PORT_DIPSETTING( 0x0800, DEF_STR( 8C_1C ) ) PORT_DIPSETTING( 0x0900, DEF_STR( 7C_1C ) ) PORT_DIPSETTING( 0x0a00, DEF_STR( 6C_1C ) ) @@ -394,16 +713,16 @@ static INPUT_PORTS_START( asurabld ) PORT_DIPSETTING( 0x0c00, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x0d00, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x0e00, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( 2C_1C ) ) // Duplicate 2C_1C PORT_DIPSETTING( 0x0f00, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x0600, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x0500, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x0400, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x0300, DEF_STR( 1C_5C ) ) PORT_DIPSETTING( 0x0200, "2C Start / 1C Continue" ) -// PORT_DIPSETTING( 0x0700, "Error!!" ) // Causes graphics issues - Service Mode shows "Error" -// PORT_DIPSETTING( 0x0100, DEF_STR( 2C_1C ) ) // Duplicate 2C_1C - PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW2",0xf000,NOTEQUALS,0x0000) - PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) PORT_CONDITION("DSW2",0xf000,EQUALS,0x0000) // Set both for Free Play + PORT_DIPSETTING( 0x0700, "Error!!" ) // Causes graphics issues - Service Mode shows "Error" + PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW2", 0xf000, NOTEQUALS, 0x0000) + PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) PORT_CONDITION("DSW2", 0xf000, EQUALS, 0x0000) // Set both for Free Play INPUT_PORTS_END static INPUT_PORTS_START( asurabus ) @@ -429,7 +748,7 @@ INPUT_PORTS_END // graphics layouts //------------------------------------------------- -/* 16x16x8 */ +// 16x16x8 static const gfx_layout layout_16x16x8 = { 16,16, @@ -442,9 +761,9 @@ static const gfx_layout layout_16x16x8 = }; static GFXDECODE_START( gfx_fuuki32 ) - GFXDECODE_ENTRY( "gfx2", 0, layout_16x16x8, 0x400*0, 0x40 ) // [0] Layer 1 - GFXDECODE_ENTRY( "gfx3", 0, layout_16x16x8, 0x400*1, 0x40 ) // [1] Layer 2 - GFXDECODE_ENTRY( "gfx4", 0, gfx_8x8x4_packed_msb, 0x400*3, 0x40 ) // [2] BG Layer + GFXDECODE_ENTRY( "tiles_l0", 0, layout_16x16x8, 0x400*0, 0x40 ) // [0] Layer 1 + GFXDECODE_ENTRY( "tiles_l1", 0, layout_16x16x8, 0x400*1, 0x40 ) // [1] Layer 2 + GFXDECODE_ENTRY( "tiles_bg", 0, gfx_8x8x4_packed_msb, 0x400*3, 0x40 ) // [2] BG Layer GFXDECODE_END @@ -474,9 +793,9 @@ TIMER_CALLBACK_MEMBER(fuuki32_state::raster_interrupt) void fuuki32_state::machine_start() { - u8 *ROM = memregion("soundcpu")->base(); + u8 *rom = memregion("soundcpu")->base(); - m_soundbank->configure_entries(0, 0x10, &ROM[0], 0x8000); + m_soundbank->configure_entries(0, 0x10, &rom[0], 0x8000); m_level_1_interrupt_timer = timer_alloc(FUNC(fuuki32_state::level1_interrupt), this); m_vblank_interrupt_timer = timer_alloc(FUNC(fuuki32_state::vblank_interrupt), this); @@ -495,17 +814,18 @@ void fuuki32_state::machine_reset() m_raster_interrupt_timer->adjust(m_screen->time_until_pos(0, visarea.max_x + 1)); } + void fuuki32_state::fuuki32(machine_config &config) { - /* basic machine hardware */ - M68EC020(config, m_maincpu, CPU_CLOCK); /* 20MHz verified */ + // basic machine hardware + M68EC020(config, m_maincpu, 40_MHz_XTAL / 2); // 20MHz verified m_maincpu->set_addrmap(AS_PROGRAM, &fuuki32_state::main_map); - z80_device &soundcpu(Z80(config, "soundcpu", SOUND_CPU_CLOCK)); /* 6MHz verified */ + z80_device &soundcpu(Z80(config, "soundcpu", 12_MHz_XTAL / 2)); // 6MHz verified soundcpu.set_addrmap(AS_PROGRAM, &fuuki32_state::sound_map); soundcpu.set_addrmap(AS_IO, &fuuki32_state::sound_io_map); - /* video hardware */ + // video hardware SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_refresh_hz(60); m_screen->set_size(64 * 8, 32 * 8); @@ -524,7 +844,7 @@ void fuuki32_state::fuuki32(machine_config &config) m_fuukivid->set_tile_callback(FUNC(fuuki32_state::tile_cb)); m_fuukivid->set_colpri_callback(FUNC(fuuki32_state::colpri_cb)); - /* sound hardware */ + // sound hardware SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); @@ -551,17 +871,17 @@ Fuuki, 1999 Consists of a FG-3J MAIN-J mainboard & FG-3J ROM-J combo ***************************************************************************/ ROM_START( asurabld ) - ROM_REGION( 0x200000, "maincpu", 0 ) /* M68020 */ + ROM_REGION( 0x200000, "maincpu", 0 ) // M68020 ROM_LOAD32_BYTE( "pgm3.u1", 0x000000, 0x80000, CRC(053e9758) SHA1(c2754d3f0c607c81c8fa33b667b576eb0474fd0b) ) ROM_LOAD32_BYTE( "pgm2.u2", 0x000001, 0x80000, CRC(16b656ca) SHA1(5ffb551ce7dec462d3896f0fed693454496894bc) ) ROM_LOAD32_BYTE( "pgm1.u3", 0x000002, 0x80000, CRC(35104452) SHA1(03cfd81429f8a945d5419c9750925bfa997d0607) ) ROM_LOAD32_BYTE( "pgm0.u4", 0x000003, 0x80000, CRC(68615497) SHA1(de93751f151f195a863dc6fe83b6e7ed8f99430a) ) - ROM_REGION( 0x80000, "soundcpu", 0 ) /* Z80 */ + ROM_REGION( 0x80000, "soundcpu", 0 ) // Z80 ROM_LOAD( "srom.u7", 0x00000, 0x80000, CRC(bb1deb89) SHA1(b1c70abddc0b9a88beb69a592376ff69a7e091eb) ) ROM_REGION( 0x2000000, "fuukivid", 0 ) - /* 0x0000000 - 0x03fffff empty */ /* spXX.uYY - XX is the bank number! */ + // 0x0000000 - 0x03fffff empty */ /* spXX.uYY - XX is the bank number! ROM_LOAD16_WORD_SWAP( "sp23.u14", 0x0400000, 0x400000, CRC(7df492eb) SHA1(30b88a3cd025ffc8c28fef06e0784755be37ef8e) ) ROM_LOAD16_WORD_SWAP( "sp45.u15", 0x0800000, 0x400000, CRC(1890f42a) SHA1(22254fe38fd83f4602a25e1ccba32df16edaf3f9) ) ROM_LOAD16_WORD_SWAP( "sp67.u16", 0x0c00000, 0x400000, CRC(a48f1ef0) SHA1(bf8787f293793291a503af662d3738c007654726) ) @@ -569,15 +889,15 @@ ROM_START( asurabld ) ROM_LOAD16_WORD_SWAP( "spab.u18", 0x1400000, 0x400000, CRC(803d2d8c) SHA1(25df30689e576a0620656c721d92bcc3fbd84844) ) ROM_LOAD16_WORD_SWAP( "spcd.u19", 0x1800000, 0x400000, CRC(42e5c26e) SHA1(b68875d353bdc5d49113bbac02fd83508bce66a5) ) - ROM_REGION( 0x0800000, "gfx2", 0 ) + ROM_REGION( 0x0800000, "tiles_l0", 0 ) ROM_LOAD32_WORD_SWAP( "bg1012.u22", 0x0000002, 0x400000, CRC(d717a0a1) SHA1(007df309dc0650ca07e077b983a2b05730349d0b) ) ROM_LOAD32_WORD_SWAP( "bg1113.u23", 0x0000000, 0x400000, CRC(94338267) SHA1(7848bc57cb0eac216100a508763451eb57a0a082) ) - ROM_REGION( 0x0800000, "gfx3", 0 ) + ROM_REGION( 0x0800000, "tiles_l1", 0 ) ROM_LOAD32_WORD_SWAP( "bg2022.u25", 0x0000002, 0x400000, CRC(ee312cd3) SHA1(2ef9d51928d80375daf8e6b204bb66a8b9cbaee7) ) ROM_LOAD32_WORD_SWAP( "bg2123.u24", 0x0000000, 0x400000, CRC(4acfc469) SHA1(a98d06b967ebb3fa3b4c8aa3d7a05063ec981fb2) ) - ROM_REGION( 0x200000, "gfx4", 0 ) // background tiles + ROM_REGION( 0x200000, "tiles_bg", 0 ) ROM_LOAD16_WORD_SWAP( "map.u5", 0x00000, 0x200000, CRC(e681155e) SHA1(458845b9c86df72685d92d0d4052aacc2fa7d1bd) ) ROM_REGION( 0x400000, "ymf", 0 ) // OPL4 samples @@ -593,13 +913,13 @@ Fuuki, 2000 Consists of a FG-3J MAIN-J mainboard & FG-3J ROM-J combo ***************************************************************************/ ROM_START( asurabus ) - ROM_REGION( 0x200000, "maincpu", 0 ) /* M68020 */ + ROM_REGION( 0x200000, "maincpu", 0 ) // M68020 ROM_LOAD32_BYTE( "uspgm3.u1", 0x000000, 0x80000, CRC(e152cec9) SHA1(af1d93bdabc6732c0ff53972826d67a3753ef785) ) // hand written labels ROM_LOAD32_BYTE( "uspgm2.u2", 0x000001, 0x80000, CRC(b19787db) SHA1(3d6757f38f297c1ee89003173567319b5dae8000) ) ROM_LOAD32_BYTE( "uspgm1.u3", 0x000002, 0x80000, CRC(6588e51a) SHA1(9ab978c80d8ece447697557c8000be95760306f3) ) ROM_LOAD32_BYTE( "uspgm0.u4", 0x000003, 0x80000, CRC(981e6ff1) SHA1(088d26a3cbd2361ffc756c3da8a67b94ae7bbd65) ) - ROM_REGION( 0x80000, "soundcpu", 0 ) /* Z80 */ + ROM_REGION( 0x80000, "soundcpu", 0 ) // Z80 ROM_LOAD( "srom.u7", 0x00000, 0x80000, CRC(368da389) SHA1(1423b709da40bf3033c9032c4bd07658f1a969de) ) ROM_REGION( 0x2000000, "fuukivid", 0 ) @@ -612,15 +932,15 @@ ROM_START( asurabus ) ROM_LOAD16_WORD_SWAP( "spcd.u19", 0x1800000, 0x400000, CRC(99bfbe32) SHA1(926a8afc4a175874f22f53300e76f59331d3b9ba) ) ROM_LOAD16_WORD_SWAP( "spef.u20", 0x1c00000, 0x400000, CRC(c9c799cc) SHA1(01373316700d8688deeea2e9e8f831d5f86c7f17) ) - ROM_REGION( 0x0800000, "gfx2", 0 ) + ROM_REGION( 0x0800000, "tiles_l0", 0 ) ROM_LOAD32_WORD_SWAP( "bg1012.u22", 0x0000002, 0x400000, CRC(e3fb9af0) SHA1(11900cc2873337692f66fb4f1eb9c574e5a967de) ) ROM_LOAD32_WORD_SWAP( "bg1113.u23", 0x0000000, 0x400000, CRC(5f8657e6) SHA1(7c2854dc5d2d4efe55bda01e329da051350e0031) ) - ROM_REGION( 0x0800000, "gfx3", 0 ) + ROM_REGION( 0x0800000, "tiles_l1", 0 ) ROM_LOAD32_WORD_SWAP( "bg2022.u25", 0x0000002, 0x400000, CRC(f46eda52) SHA1(46530016b32a164bd76c4f53e7b53b2beb28db06) ) ROM_LOAD32_WORD_SWAP( "bg2123.u24", 0x0000000, 0x400000, CRC(c4ebb86b) SHA1(a7093e6e02b64566d277cbbd5fa90cd430e7c8a0) ) - ROM_REGION( 0x200000, "gfx4", 0 ) // background tiles + ROM_REGION( 0x200000, "tiles_bg", 0 ) ROM_LOAD16_WORD_SWAP( "map.u5", 0x00000, 0x200000, CRC(bd179dc5) SHA1(ce3fcac573b14fd5365eb5dcec3257e439d2c129) ) ROM_REGION( 0x400000, "ymf", 0 ) // OPL4 samples @@ -628,13 +948,13 @@ ROM_START( asurabus ) ROM_END ROM_START( asurabusj ) - ROM_REGION( 0x200000, "maincpu", 0 ) /* M68020 */ + ROM_REGION( 0x200000, "maincpu", 0 ) // M68020 ROM_LOAD32_BYTE( "pgm3.u1", 0x000000, 0x80000, CRC(2c6b5271) SHA1(188371f1f003823ac719e962e048719d76696b2f) ) ROM_LOAD32_BYTE( "pgm2.u2", 0x000001, 0x80000, CRC(8f8694ec) SHA1(3334df4aecc5ab2f8914ef6748c027a99b39ce26) ) ROM_LOAD32_BYTE( "pgm1.u3", 0x000002, 0x80000, CRC(0a040f0f) SHA1(d5e86d33efcbbde7ee62cfc8dfe867f250a33415) ) ROM_LOAD32_BYTE( "pgm0.u4", 0x000003, 0x80000, CRC(9b71e9d8) SHA1(9b705b5b6fff549f5679890422b481b5cf1d7bd7) ) - ROM_REGION( 0x80000, "soundcpu", 0 ) /* Z80 */ + ROM_REGION( 0x80000, "soundcpu", 0 ) // Z80 ROM_LOAD( "srom.u7", 0x00000, 0x80000, CRC(368da389) SHA1(1423b709da40bf3033c9032c4bd07658f1a969de) ) ROM_REGION( 0x2000000, "fuukivid", 0 ) @@ -647,15 +967,15 @@ ROM_START( asurabusj ) ROM_LOAD16_WORD_SWAP( "spcd.u19", 0x1800000, 0x400000, CRC(99bfbe32) SHA1(926a8afc4a175874f22f53300e76f59331d3b9ba) ) ROM_LOAD16_WORD_SWAP( "spef.u20", 0x1c00000, 0x400000, CRC(c9c799cc) SHA1(01373316700d8688deeea2e9e8f831d5f86c7f17) ) - ROM_REGION( 0x0800000, "gfx2", 0 ) + ROM_REGION( 0x0800000, "tiles_l0", 0 ) ROM_LOAD32_WORD_SWAP( "bg1012.u22", 0x0000002, 0x400000, CRC(e3fb9af0) SHA1(11900cc2873337692f66fb4f1eb9c574e5a967de) ) ROM_LOAD32_WORD_SWAP( "bg1113.u23", 0x0000000, 0x400000, CRC(5f8657e6) SHA1(7c2854dc5d2d4efe55bda01e329da051350e0031) ) - ROM_REGION( 0x0800000, "gfx3", 0 ) + ROM_REGION( 0x0800000, "tiles_l1", 0 ) ROM_LOAD32_WORD_SWAP( "bg2022.u25", 0x0000002, 0x400000, CRC(f46eda52) SHA1(46530016b32a164bd76c4f53e7b53b2beb28db06) ) ROM_LOAD32_WORD_SWAP( "bg2123.u24", 0x0000000, 0x400000, CRC(c4ebb86b) SHA1(a7093e6e02b64566d277cbbd5fa90cd430e7c8a0) ) - ROM_REGION( 0x200000, "gfx4", 0 ) // background tiles + ROM_REGION( 0x200000, "tiles_bg", 0 ) ROM_LOAD16_WORD_SWAP( "map.u5", 0x00000, 0x200000, CRC(bd179dc5) SHA1(ce3fcac573b14fd5365eb5dcec3257e439d2c129) ) ROM_REGION( 0x400000, "ymf", 0 ) // OPL4 samples @@ -663,13 +983,13 @@ ROM_START( asurabusj ) ROM_END ROM_START( asurabusja ) - ROM_REGION( 0x200000, "maincpu", 0 ) /* M68020 */ + ROM_REGION( 0x200000, "maincpu", 0 ) // M68020 ROM_LOAD32_BYTE( "pgm3_583a.u1", 0x000000, 0x80000, CRC(46ab3b0e) SHA1(2d6a57352891a484fe11cda9addbff5b3940c17c) ) // hand written labels with checksums ROM_LOAD32_BYTE( "pgm2_0ff4.u2", 0x000001, 0x80000, CRC(fa7aa289) SHA1(6f82371274c45f889a19a4fdd859015fb6ea249a) ) ROM_LOAD32_BYTE( "pgm1_bac7.u3", 0x000002, 0x80000, CRC(67364e19) SHA1(959b896b201f103ef9189b537139c89bfc7144ea) ) ROM_LOAD32_BYTE( "pgm0_193a.u4", 0x000003, 0x80000, CRC(94d39c64) SHA1(95ca2aa3e19e64bed7add3170653fa3364530fde) ) - ROM_REGION( 0x80000, "soundcpu", 0 ) /* Z80 */ + ROM_REGION( 0x80000, "soundcpu", 0 ) // Z80 ROM_LOAD( "srom.u7", 0x00000, 0x80000, CRC(368da389) SHA1(1423b709da40bf3033c9032c4bd07658f1a969de) ) ROM_REGION( 0x2000000, "fuukivid", 0 ) @@ -682,15 +1002,15 @@ ROM_START( asurabusja ) ROM_LOAD16_WORD_SWAP( "spcd.u19", 0x1800000, 0x400000, CRC(99bfbe32) SHA1(926a8afc4a175874f22f53300e76f59331d3b9ba) ) ROM_LOAD16_WORD_SWAP( "spef.u20", 0x1c00000, 0x400000, CRC(c9c799cc) SHA1(01373316700d8688deeea2e9e8f831d5f86c7f17) ) - ROM_REGION( 0x0800000, "gfx2", 0 ) + ROM_REGION( 0x0800000, "tiles_l0", 0 ) ROM_LOAD32_WORD_SWAP( "bg1012.u22", 0x0000002, 0x400000, CRC(e3fb9af0) SHA1(11900cc2873337692f66fb4f1eb9c574e5a967de) ) ROM_LOAD32_WORD_SWAP( "bg1113.u23", 0x0000000, 0x400000, CRC(5f8657e6) SHA1(7c2854dc5d2d4efe55bda01e329da051350e0031) ) - ROM_REGION( 0x0800000, "gfx3", 0 ) + ROM_REGION( 0x0800000, "tiles_l1", 0 ) ROM_LOAD32_WORD_SWAP( "bg2022.u25", 0x0000002, 0x400000, CRC(f46eda52) SHA1(46530016b32a164bd76c4f53e7b53b2beb28db06) ) ROM_LOAD32_WORD_SWAP( "bg2123.u24", 0x0000000, 0x400000, CRC(c4ebb86b) SHA1(a7093e6e02b64566d277cbbd5fa90cd430e7c8a0) ) - ROM_REGION( 0x200000, "gfx4", 0 ) // background tiles + ROM_REGION( 0x200000, "tiles_bg", 0 ) ROM_LOAD16_WORD_SWAP( "map.u5", 0x00000, 0x200000, CRC(bd179dc5) SHA1(ce3fcac573b14fd5365eb5dcec3257e439d2c129) ) ROM_REGION( 0x400000, "ymf", 0 ) // OPL4 samples @@ -698,13 +1018,13 @@ ROM_START( asurabusja ) ROM_END ROM_START( asurabusjr ) // ARCADIA review build - ROM_REGION( 0x200000, "maincpu", 0 ) /* M68020 */ + ROM_REGION( 0x200000, "maincpu", 0 ) // M68020 ROM_LOAD32_BYTE( "24-31.pgm3", 0x000000, 0x80000, CRC(cfcb9c75) SHA1(51e325d5e60d5bb058429f04a5170dcc17986b7d) ) ROM_LOAD32_BYTE( "16-23.pgm2", 0x000001, 0x80000, CRC(e4d07738) SHA1(c6c949c5b0cbc129917bb8c93707539adabbd336) ) ROM_LOAD32_BYTE( "8-15.pgm1", 0x000002, 0x80000, CRC(1dd67fe7) SHA1(3fd340ccd4a306783ba0ccd3343ae505c9de3a73) ) ROM_LOAD32_BYTE( "0-7.pgm0", 0x000003, 0x80000, CRC(3af08de3) SHA1(1ecc69804693cab6c2c36120acfc6ced094a16e4) ) - ROM_REGION( 0x80000, "soundcpu", 0 ) /* Z80 */ + ROM_REGION( 0x80000, "soundcpu", 0 ) // Z80 ROM_LOAD( "srom.u7", 0x00000, 0x80000, CRC(368da389) SHA1(1423b709da40bf3033c9032c4bd07658f1a969de) ) ROM_REGION( 0x2000000, "fuukivid", 0 ) @@ -717,21 +1037,23 @@ ROM_START( asurabusjr ) // ARCADIA review build ROM_LOAD16_WORD_SWAP( "spcd.u19", 0x1800000, 0x400000, CRC(99bfbe32) SHA1(926a8afc4a175874f22f53300e76f59331d3b9ba) ) ROM_LOAD16_WORD_SWAP( "spef.u20", 0x1c00000, 0x400000, CRC(c9c799cc) SHA1(01373316700d8688deeea2e9e8f831d5f86c7f17) ) - ROM_REGION( 0x0800000, "gfx2", 0 ) + ROM_REGION( 0x0800000, "tiles_l0", 0 ) ROM_LOAD32_WORD_SWAP( "bg1012.u22", 0x0000002, 0x400000, CRC(e3fb9af0) SHA1(11900cc2873337692f66fb4f1eb9c574e5a967de) ) ROM_LOAD32_WORD_SWAP( "bg1113.u23", 0x0000000, 0x400000, CRC(5f8657e6) SHA1(7c2854dc5d2d4efe55bda01e329da051350e0031) ) - ROM_REGION( 0x0800000, "gfx3", 0 ) + ROM_REGION( 0x0800000, "tiles_l1", 0 ) ROM_LOAD32_WORD_SWAP( "bg2022.u25", 0x0000002, 0x400000, CRC(f46eda52) SHA1(46530016b32a164bd76c4f53e7b53b2beb28db06) ) ROM_LOAD32_WORD_SWAP( "bg2123.u24", 0x0000000, 0x400000, CRC(c4ebb86b) SHA1(a7093e6e02b64566d277cbbd5fa90cd430e7c8a0) ) - ROM_REGION( 0x200000, "gfx4", 0 ) // background tiles + ROM_REGION( 0x200000, "tiles_bg", 0 ) ROM_LOAD16_WORD_SWAP( "map.u5", 0x00000, 0x200000, CRC(bd179dc5) SHA1(ce3fcac573b14fd5365eb5dcec3257e439d2c129) ) ROM_REGION( 0x400000, "ymf", 0 ) // OPL4 samples ROM_LOAD( "opm.u6", 0x00000, 0x400000, CRC(31b05be4) SHA1(d0f4f387f84a74591224b0f42b7f5c538a3dc498) ) ROM_END +} // anonymous namespace + //------------------------------------------------- // game drivers diff --git a/src/mame/fuuki/fuukifg3.h b/src/mame/fuuki/fuukifg3.h deleted file mode 100644 index 53e35db5933..00000000000 --- a/src/mame/fuuki/fuukifg3.h +++ /dev/null @@ -1,108 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Paul Priest, David Haywood, Luca Elia -#ifndef MAME_FUUKI_FUUKIFG3_H -#define MAME_FUUKI_FUUKIFG3_H - -#pragma once - -#include "fuukifg.h" -#include "emupal.h" -#include "screen.h" -#include "tilemap.h" - -/* Define clocks based on actual OSC on the PCB */ - -#define CPU_CLOCK (XTAL(40'000'000) / 2) /* clock for 68020 */ -#define SOUND_CPU_CLOCK (XTAL(12'000'000) / 2) /* clock for Z80 sound CPU */ - - -class fuuki32_state : public driver_device -{ -public: - fuuki32_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag) - , m_maincpu(*this, "maincpu") - , m_gfxdecode(*this, "gfxdecode") - , m_screen(*this, "screen") - , m_palette(*this, "palette") - , m_fuukivid(*this, "fuukivid") - , m_spriteram(*this, "spriteram", 0x2000, ENDIANNESS_BIG) - , m_vram(*this, "vram.%u", 0) - , m_vregs(*this, "vregs", 0x20, ENDIANNESS_BIG) - , m_priority(*this, "priority") - , m_tilebank(*this, "tilebank") - , m_shared_ram(*this, "shared_ram") - , m_soundbank(*this, "soundbank") - , m_system(*this, "SYSTEM") - , m_inputs(*this, "INPUTS") - , m_dsw1(*this, "DSW1") - , m_dsw2(*this, "DSW2") - { } - - void fuuki32(machine_config &config); - -private: - virtual void machine_start() override ATTR_COLD; - virtual void machine_reset() override ATTR_COLD; - virtual void video_start() override ATTR_COLD; - - void main_map(address_map &map) ATTR_COLD; - void sound_io_map(address_map &map) ATTR_COLD; - void sound_map(address_map &map) ATTR_COLD; - - TIMER_CALLBACK_MEMBER(level1_interrupt); - TIMER_CALLBACK_MEMBER(vblank_interrupt); - TIMER_CALLBACK_MEMBER(raster_interrupt); - - u8 snd_020_r(offs_t offset); - void snd_020_w(offs_t offset, u8 data, u8 mem_mask = ~0); - void sprram_w(offs_t offset, u16 data, u16 mem_mask = ~0); - u16 sprram_r(offs_t offset); - u16 vregs_r(offs_t offset); - void vregs_w(offs_t offset, u16 data, u16 mem_mask = ~0); - void sound_bw_w(u8 data); - template<int Layer> void vram_w(offs_t offset, u32 data, u32 mem_mask = ~0); - template<int Layer> void vram_buffered_w(offs_t offset, u32 data, u32 mem_mask = ~0); - - template<int Layer, int ColShift> TILE_GET_INFO_MEMBER(get_tile_info); - - void tile_cb(u32 &code); - void colpri_cb(u32 &colour, u32 &pri_mask); - u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void screen_vblank(int state); - void draw_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, u8 i, int flag, u8 pri, u8 primask = 0xff); - - /* devices */ - required_device<cpu_device> m_maincpu; - required_device<gfxdecode_device> m_gfxdecode; - required_device<screen_device> m_screen; - required_device<palette_device> m_palette; - required_device<fuukivid_device> m_fuukivid; - - /* memory pointers */ - memory_share_creator<u16> m_spriteram; - required_shared_ptr_array<u32, 4> m_vram; - memory_share_creator<u16> m_vregs; - required_shared_ptr<u32> m_priority; - required_shared_ptr<u32> m_tilebank; - required_shared_ptr<u8> m_shared_ram; - std::unique_ptr<u16[]> m_buf_spriteram[2]; - - required_memory_bank m_soundbank; - - required_ioport m_system; - required_ioport m_inputs; - required_ioport m_dsw1; - required_ioport m_dsw2; - - /* video-related */ - tilemap_t *m_tilemap[3]{}; - u32 m_spr_buffered_tilebank[2]{}; - - /* misc */ - emu_timer *m_level_1_interrupt_timer = nullptr; - emu_timer *m_vblank_interrupt_timer = nullptr; - emu_timer *m_raster_interrupt_timer = nullptr; -}; - -#endif // MAME_FUUKI_FUUKIFG3_H diff --git a/src/mame/fuuki/fuukifg3_v.cpp b/src/mame/fuuki/fuukifg3_v.cpp deleted file mode 100644 index f972a062ef5..00000000000 --- a/src/mame/fuuki/fuukifg3_v.cpp +++ /dev/null @@ -1,228 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Paul Priest, David Haywood, Luca Elia -/*************************************************************************** - - -= Fuuki 32 Bit Games (FG-3) =- - - driver by Paul Priest and David Haywood - based on fuukifg2 by Luca Elia - - - [ 4 Scrolling Layers ] - - [ Layer 0 ] [ Layer 1 ] [ Layer 2 (double-buffered) ] - - Tile Size: 16 x 16 x 8 16 x 16 x 8 8 x 8 x 4 - Layer Size (tiles): 64 x 32 64 x 32 64 x 32 - - [ 1024? Zooming Sprites ] - - Sprites are made of 16 x 16 x 4 tiles. Size can vary from 1 to 16 - tiles both horizontally and vertically. - There is zooming (from full size to half size) and 4 levels of - priority (wrt layers) - - Per-line raster effects used on many stages - Sprites buffered by two frames - Tilebank buffered by 3 frames? Only 2 in attract - Sprite pens needs to be buffered by 3 frames? Or lazy programming? Probably 2 - -***************************************************************************/ - -#include "emu.h" -#include "fuukifg3.h" - - -/*************************************************************************** - - - Tilemaps - - Offset: Bits: Value: - - 0.w Code - - 2.w fedc ba98 ---- ---- - ---- ---- 7--- ---- Flip Y - ---- ---- -6-- ---- Flip X - ---- ---- --54 3210 Color - - -***************************************************************************/ - -template<int Layer, int ColShift> -TILE_GET_INFO_MEMBER(fuuki32_state::get_tile_info) -{ - const int buffer = (Layer < 2) ? 0 : (m_vregs[0x1e / 2] & 0x40) >> 6; - const u16 code = (m_vram[Layer|buffer][tile_index] & 0xffff0000) >> 16; - const u16 attr = (m_vram[Layer|buffer][tile_index] & 0x0000ffff); - tileinfo.set(Layer, code, (attr & 0x3f) >> ColShift, TILE_FLIPYX(attr >> 6)); -} - -/*************************************************************************** - - - Video Hardware Init - - -***************************************************************************/ - -void fuuki32_state::video_start() -{ - const u32 spriteram_size = m_spriteram.bytes(); - m_buf_spriteram[0] = make_unique_clear<u16[]>(spriteram_size / 2); - m_buf_spriteram[1] = make_unique_clear<u16[]>(spriteram_size / 2); - - m_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, NAME((&fuuki32_state::get_tile_info<0, 4>))), TILEMAP_SCAN_ROWS, 16, 16, 64, 32); - m_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, NAME((&fuuki32_state::get_tile_info<1, 4>))), TILEMAP_SCAN_ROWS, 16, 16, 64, 32); - m_tilemap[2] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, NAME((&fuuki32_state::get_tile_info<2, 0>))), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - - m_tilemap[0]->set_transparent_pen(0xff); // 8 bits - m_tilemap[1]->set_transparent_pen(0xff); // 8 bits - m_tilemap[2]->set_transparent_pen(0x0f); // 4 bits - - //m_gfxdecode->gfx(0)->set_granularity(16); /* 256 colour tiles with palette selectable on 16 colour boundaries */ - //m_gfxdecode->gfx(1)->set_granularity(16); - - save_pointer(NAME(m_buf_spriteram[0]), spriteram_size / 2); - save_pointer(NAME(m_buf_spriteram[1]), spriteram_size / 2); -} - - -void fuuki32_state::sprram_w(offs_t offset, u16 data, u16 mem_mask) -{ - COMBINE_DATA(&m_spriteram[offset]); -}; - -u16 fuuki32_state::sprram_r(offs_t offset) -{ - return m_spriteram[offset]; -} - -void fuuki32_state::tile_cb(u32 &code) -{ - const u32 bank = (code & 0xc000) >> 14; - - const u32 bank_lookedup = ((m_spr_buffered_tilebank[1] & 0xffff0000) >> (16 + bank * 4)) & 0xf; - code &= 0x3fff; - code += bank_lookedup * 0x4000; -} - -void fuuki32_state::colpri_cb(u32 &colour, u32 &pri_mask) -{ - const u8 priority = (colour >> 6) & 3; - switch (priority) - { - case 3: pri_mask = 0xf0 | 0xcc | 0xaa; break; // behind all layers - case 2: pri_mask = 0xf0 | 0xcc; break; // behind fg + middle layer - case 1: pri_mask = 0xf0; break; // behind fg layer - case 0: - default: pri_mask = 0; // above all - } - colour &= 0x3f; -} - -/*************************************************************************** - - - Screen Drawing - - Video Registers (vregs): - - 00.w Layer 0 Scroll Y - 02.w Layer 0 Scroll X - 04.w Layer 1 Scroll Y - 06.w Layer 1 Scroll X - 08.w Layer 2 Scroll Y - 0a.w Layer 2 Scroll X - 0c.w Layers Y Offset - 0e.w Layers X Offset - - 10-1a.w ? 0 - 1c.w Trigger a level 5 irq on this raster line - 1e.w ? $3390/$3393 (Flip Screen Off/On), $0040 is buffer for tilemap 2 - - Priority Register (priority): - - fedc ba98 7654 3--- - ---- ---- ---- -210 Layer Order - - - Unknown Registers ($de0000.l): - - 00.w ? $0200/$0201 (Flip Screen Off/On) - 02.w ? $f300/$0330 - -***************************************************************************/ - -/* Wrapper to handle bg and bg2 ttogether */ -void fuuki32_state::draw_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, u8 i, int flag, u8 pri, u8 primask) -{ - m_tilemap[i]->draw(screen, bitmap, cliprect, flag, pri, primask); -} - -u32 fuuki32_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - /* - It's not independent bits causing layers to switch, that wouldn't make sense with 3 bits. - */ - - static const u8 pri_table[6][3] = { - { 0, 1, 2 }, // Special moves 0>1, 0>2 (0,1,2 or 0,2,1) - { 0, 2, 1 }, // Two Levels - 0>1 (0,1,2 or 0,2,1 or 2,0,1) - { 1, 0, 2 }, // Most Levels - 2>1 1>0 2>0 (1,0,2) - { 1, 2, 0 }, // Not used? - { 2, 0, 1 }, // Title etc. - 0>1 (0,1,2 or 0,2,1 or 2,0,1) - { 2, 1, 0 }}; // Char Select, prison stage 1>0 (leaves 1,2,0 or 2,1,0) - - const u8 tm_front = pri_table[(m_priority[0] >> 16) & 0x0f][0]; - const u8 tm_middle = pri_table[(m_priority[0] >> 16) & 0x0f][1]; - const u8 tm_back = pri_table[(m_priority[0] >> 16) & 0x0f][2]; - - flip_screen_set(m_vregs[0x1e / 2] & 1); - - /* Layers scrolling */ - - const u16 scrolly_offs = m_vregs[0xc / 2] - (flip_screen() ? 0x103 : 0x1f3); - const u16 scrollx_offs = m_vregs[0xe / 2] - (flip_screen() ? 0x2c7 : 0x3f6); - - const u16 layer0_scrolly = m_vregs[0x0 / 2] + scrolly_offs; - const u16 layer0_scrollx = m_vregs[0x2 / 2] + scrollx_offs; - const u16 layer1_scrolly = m_vregs[0x4 / 2] + scrolly_offs; - const u16 layer1_scrollx = m_vregs[0x6 / 2] + scrollx_offs; - - const u16 layer2_scrolly = m_vregs[0x8 / 2]; - const u16 layer2_scrollx = m_vregs[0xa / 2]; - - m_tilemap[0]->set_scrollx(0, layer0_scrollx); - m_tilemap[0]->set_scrolly(0, layer0_scrolly); - m_tilemap[1]->set_scrollx(0, layer1_scrollx); - m_tilemap[1]->set_scrolly(0, layer1_scrolly); - - m_tilemap[2]->set_scrollx(0, layer2_scrollx); - m_tilemap[2]->set_scrolly(0, layer2_scrolly); - - /* The bg colour is the last pen i.e. 0x1fff */ - bitmap.fill((0x800 * 4) - 1, cliprect); - screen.priority().fill(0, cliprect); - - draw_layer(screen, bitmap, cliprect, tm_back, 0, 1); - draw_layer(screen, bitmap, cliprect, tm_middle, 0, 2); - draw_layer(screen, bitmap, cliprect, tm_front, 0, 4); - - m_fuukivid->draw_sprites(screen, bitmap, cliprect, flip_screen(), m_buf_spriteram[1].get(), m_spriteram.bytes() / 2); - return 0; -} - -void fuuki32_state::screen_vblank(int state) -{ - // rising edge - if (state) - { - /* Buffer sprites and tilebank by 2 frames */ - m_spr_buffered_tilebank[1] = m_spr_buffered_tilebank[0]; - m_spr_buffered_tilebank[0] = m_tilebank[0]; - memcpy(m_buf_spriteram[1].get(), m_buf_spriteram[0].get(), m_spriteram.bytes()); - memcpy(m_buf_spriteram[0].get(), m_spriteram, m_spriteram.bytes()); - } -} diff --git a/src/mame/igs/igspoker.cpp b/src/mame/igs/igspoker.cpp index 9f6e160bb14..cca80ac6974 100644 --- a/src/mame/igs/igspoker.cpp +++ b/src/mame/igs/igspoker.cpp @@ -2086,15 +2086,15 @@ ROM_START( stellecu ) ROM_REGION( 0x80000, "gfx1", 0 ) /* seems to be missing half the gfx */ - ROM_LOAD( "u23.bin", 0x0000, 0x40000, BAD_DUMP CRC(9d95757d) SHA1(f7f44d684f1f3a5b1e9c0a82f4377c6d79eb4214) ) - ROM_LOAD( "u25.bin", 0x4000, 0x40000, BAD_DUMP CRC(63094010) SHA1(a781f1c529167dd0ab411c66b72105fc19e32f02) ) + ROM_LOAD( "u23.bin", 0x0000, 0x40000, BAD_DUMP CRC(9d95757d) SHA1(f7f44d684f1f3a5b1e9c0a82f4377c6d79eb4214) ) // 1ST AND 2ND HALF IDENTICAL + ROM_LOAD( "u25.bin", 0x4000, 0x40000, BAD_DUMP CRC(63094010) SHA1(a781f1c529167dd0ab411c66b72105fc19e32f02) ) // 1ST AND 2ND HALF IDENTICAL ROM_REGION( 0x30000, "gfx2", ROMREGION_ERASEFF ) ROM_REGION( 0x40000, "oki", 0 ) /* Oki Samples */ /* missing sample tables at start of rom */ - ROM_LOAD( "u15.bin", 0x0000, 0x40000, BAD_DUMP CRC(72e3e9c1) SHA1(6a8fb93059bee5a4e4b4deb9fee4b5869e53983b) ) + ROM_LOAD( "u15.bin", 0x0000, 0x40000, BAD_DUMP CRC(72e3e9c1) SHA1(6a8fb93059bee5a4e4b4deb9fee4b5869e53983b) ) // 1ST AND 2ND HALF IDENTICAL ROM_END /* Decode a simple PAL encryption diff --git a/src/mame/igs/spoker.cpp b/src/mame/igs/spoker.cpp index 6b5918d6dd9..016ff763466 100644 --- a/src/mame/igs/spoker.cpp +++ b/src/mame/igs/spoker.cpp @@ -537,10 +537,10 @@ void jinhulu2_state::portmap(address_map &map) map(0x4001, 0x4001).portr("DSW2"); map(0x4002, 0x4002).portr("DSW3"); map(0x5001, 0x5001).portr("SERVICE"); + map(0x5010, 0x5010).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); //map(0x5030, 0x5030).w(FUNC()); // TODO: almost surely same protections as seen in igspoker.cpp and igs011.cpp. Probably the IGS003 //map(0x5031, 0x5031).r(FUNC()); // TODO: " map(0x5031, 0x5031).w(FUNC(jinhulu2_state::nmi_w)); - //map(0x????, 0x????).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); map(0x7000, 0x77ff).ram().w(FUNC(jinhulu2_state::fg_tile_w)).share(m_fg_tile_ram); map(0x7800, 0x7fff).ram().w(FUNC(jinhulu2_state::fg_color_w)).share(m_fg_color_ram); } diff --git a/src/mame/sega/segas32.cpp b/src/mame/sega/segas32.cpp index 1d1baf78e5d..0c5659741b7 100644 --- a/src/mame/sega/segas32.cpp +++ b/src/mame/sega/segas32.cpp @@ -6012,7 +6012,7 @@ GAME( 1992, orunnersu, orunners, sega_multi32_analog, orunners, segas32_ne GAME( 1992, orunnersj, orunners, sega_multi32_analog, orunners, segas32_new_state, init_orunners, ROT0, "Sega", "OutRunners (Japan)", MACHINE_IMPERFECT_GRAPHICS ) GAME( 1992, scross, 0, sega_multi32_analog, scross, segas32_new_state, init_scross, ROT0, "Sega", "Stadium Cross (World)", MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1992, scrossa, scross, sega_multi32_analog, scross, segas32_new_state, init_scross, ROT0, "Sega", "Stadium Cross (World, alt)", MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1992, scrossa, scross, sega_multi32_analog, scross, segas32_new_state, init_scross, ROT0, "Sega", "Stadium Cross (World, linkable)", MACHINE_IMPERFECT_GRAPHICS ) GAME( 1992, scrossu, scross, sega_multi32_analog, scross, segas32_new_state, init_scross, ROT0, "Sega", "Stadium Cross (US)", MACHINE_IMPERFECT_GRAPHICS ) GAME( 1992, titlef, 0, sega_multi32, titlef, segas32_new_state, init_titlef, ROT0, "Sega", "Title Fight (World)", MACHINE_IMPERFECT_GRAPHICS ) |