summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Ivan Vangelista <mesgnet@yahoo.it>2022-11-05 08:14:36 +0100
committer Ivan Vangelista <mesgnet@yahoo.it>2022-11-05 08:14:36 +0100
commit4ebe2e80e32ed5ea9421ebbbb1556c0c6175949e (patch)
tree8bc8f8c93da9da9a65577052c3bac079bb9afd1a
parent00309d4a6c225db27a36369ea6349b0a32f0c38e (diff)
- igs/goldstar.cpp: corrected palette for cmfb55 [Ioannis Bampoulas]
- comad/funybubl.cpp, comad/galspnbl.cpp, comad/zerozone.cpp: consolidated drivers in single files
-rw-r--r--src/mame/alpha/equites.cpp2
-rw-r--r--src/mame/comad/funybubl.cpp296
-rw-r--r--src/mame/comad/funybubl.h76
-rw-r--r--src/mame/comad/funybubl_v.cpp102
-rw-r--r--src/mame/comad/galspnbl.cpp286
-rw-r--r--src/mame/comad/galspnbl.h76
-rw-r--r--src/mame/comad/galspnbl_v.cpp98
-rw-r--r--src/mame/comad/zerozone.cpp130
-rw-r--r--src/mame/comad/zerozone.h69
-rw-r--r--src/mame/comad/zerozone_v.cpp48
-rw-r--r--src/mame/igs/goldstar.cpp24
-rw-r--r--src/mame/igs/goldstar.h1
-rw-r--r--src/mame/nintendo/playch10.cpp2
-rw-r--r--src/mame/snk/snk6502.cpp2
-rw-r--r--src/mame/taito/tnzs.cpp2
15 files changed, 580 insertions, 634 deletions
diff --git a/src/mame/alpha/equites.cpp b/src/mame/alpha/equites.cpp
index 16dbda26210..497781b7788 100644
--- a/src/mame/alpha/equites.cpp
+++ b/src/mame/alpha/equites.cpp
@@ -48,7 +48,7 @@ Stephh's notes (based on the games M68000 code and some tests) :
- When in "test mode", press START1 to cycle through next sound, and press START2
to directly test the inputs and the Dip Switches.
- - Bit 1 of Dip Switch is only read in combinaison of bit 0 during P.O.S.T. to
+ - Bit 1 of Dip Switch is only read in combination of bit 0 during P.O.S.T. to
enter the "test mode", but it doesn't add any credit ! That's why I've patched
the inputs, so you can enter the "test mode" by pressing COIN1 during P.O.S.T.
diff --git a/src/mame/comad/funybubl.cpp b/src/mame/comad/funybubl.cpp
index e026e2c6139..78cb31e96f8 100644
--- a/src/mame/comad/funybubl.cpp
+++ b/src/mame/comad/funybubl.cpp
@@ -1,27 +1,24 @@
// license:BSD-3-Clause
-// copyright-holders:David Haywood
+// copyright-holders: David Haywood
+
/*
Funny Bubble ...
It's a Puzzloop (Lup Lup Puzzle) rip-off .. but with two Z80 CPUs
-The program roms say omega 1997
- Omega made Super Lup Lup Puzzle/Lup Lup Puzzle/Puzzle Bang Bang see vamphalf.c
+The program ROMs say omega 1997
+ Omega made Super Lup Lup Puzzle/Lup Lup Puzzle/Puzzle Bang Bang - see misc/vamphalf.cpp
These games copy the game play of Puzzloop but add adult picture backgrounds.
-The gfx roms say 1999
+The gfx ROMs say 1999
Title screen has no date
-( a z80 as the main cpu in 1999 ??! )
+( a z80 as the main CPU in 1999 ??! )
-Did In Chang Electronic Co do the "original" version of Funny Bubble?
+ In Chang Electronic Co did the "original" version of Funny Bubble?
Comad either hacked or licensed it. As "In Chang Electronic" are
- spelled out in the default high score table ;-)
-
-todo :
- convert to tilemaps
-
+ spelled out in the default high score table of the Comad version, too ;-)
+-----------------------------------------+
| 8MHz M6295 SU12 UG1 UG3 |
@@ -49,18 +46,181 @@ Note: SW2, SW3 & SW4 not populated
*/
-
#include "emu.h"
-#include "funybubl.h"
#include "cpu/z80/z80.h"
+#include "machine/gen_latch.h"
+#include "sound/okim6295.h"
+
+#include "emupal.h"
#include "screen.h"
#include "speaker.h"
+#include "tilemap.h"
+
+
+namespace {
+
+class funybubl_state : public driver_device
+{
+public:
+ funybubl_state(const machine_config &mconfig, device_type type, const char *tag) :
+ driver_device(mconfig, type, tag),
+ m_tilemapram(*this, "tilemapram"),
+ m_spriteram(*this, "spriteram"),
+ m_mainbank(*this, "mainbank"),
+ m_okibank(*this, "okibank"),
+ m_vrambank(*this, "vrambank"),
+ m_maincpu(*this, "maincpu"),
+ m_audiocpu(*this, "audiocpu"),
+ m_oki(*this, "oki"),
+ m_gfxdecode(*this, "gfxdecode"),
+ m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch")
+ { }
+
+ void funybubl(machine_config &config);
+
+protected:
+ virtual void machine_start() override;
+ virtual void video_start() override;
+
+private:
+ // memory pointers
+ required_shared_ptr<uint8_t> m_tilemapram;
+ required_shared_ptr<uint8_t> m_spriteram;
+
+ required_memory_bank m_mainbank;
+ required_memory_bank m_okibank;
+ memory_view m_vrambank;
+
+ // video-related
+ tilemap_t *m_tilemap = nullptr;
+
+ // 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<palette_device> m_palette;
+ required_device<generic_latch_8_device> m_soundlatch;
+
+ // memory
+ void vidram_bank_w(uint8_t data);
+ void cpurombank_w(uint8_t data);
+ void oki_bank_w(uint8_t data);
+
+ static rgb_t r6b6g6(uint32_t raw);
+ void tilemap_w(offs_t offset, uint8_t data, uint8_t mem_mask = ~0);
+ TILE_GET_INFO_MEMBER(get_tile_info);
+
+ uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ void main_program_map(address_map &map);
+ void main_io_map(address_map &map);
+ void oki_map(address_map &map);
+ void sound_map(address_map &map);
+ void vrambank_map(address_map &map);
+};
+
+// video
+
+rgb_t funybubl_state::r6b6g6(uint32_t raw)
+{
+ return rgb_t(pal6bit(raw >> 12), pal6bit(raw >> 0), pal6bit(raw >> 6));
+}
+
+void funybubl_state::tilemap_w(offs_t offset, uint8_t data, uint8_t mem_mask)
+{
+ COMBINE_DATA(&m_tilemapram[offset]);
+ m_tilemap->mark_tile_dirty(offset >> 1);
+}
+
+TILE_GET_INFO_MEMBER(funybubl_state::get_tile_info)
+{
+ uint16_t const code = m_tilemapram[tile_index << 1] | (m_tilemapram[(tile_index << 1) | 1] << 8);
+ tileinfo.set(0, code & 0x7fff, BIT(code, 15), 0);
+}
+
+void funybubl_state::video_start()
+{
+ m_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(funybubl_state::get_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+ m_tilemap->set_transparent_pen(0);
+}
+
+void funybubl_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
+{
+ uint8_t *source = &m_spriteram[0x1000 - 0x20];
+ uint8_t const *finish = m_spriteram;
+
+ while (source >= finish)
+ {
+ /* the sprites are in the sprite list twice
+ the first format (in comments) appears to be a buffer, if you use
+ this list you get garbage sprites in 2 player mode
+ the second format (used) seems correct
+
+ */
+/*
+ int ypos = 0xff - source[1 + 0x10];
+ int xpos = source[2 + 0x10];
+ int tile = source[0 + 0x10] | ( (source[3 + 0x10] & 0x0f) <<8);
+ if (source[3 + 0x10] & 0x80) tile += 0x1000;
+ if (source[3 + 0x10] & 0x20) xpos += 0x100;
+ // bits 0x40 (not used?) and 0x10 (just set during transition period of x co-ord 0xff and 0x00) ...
+ xpos -= 8;
+ ypos -= 14;
+
+*/
+ int const ypos = source[2];
+ int xpos = source[3];
+ int tile = source[0] | ( (source[1] & 0x0f) << 8);
+ if (source[1] & 0x80) tile += 0x1000;
+ if (source[1] & 0x20)
+ {
+ if (xpos < 0xe0)
+ xpos += 0x100;
+ }
+
+ // bits 0x40 and 0x10 not used?...
+
+ m_gfxdecode->gfx(1)->transpen(bitmap, cliprect, tile, 0, 0, 0, xpos, ypos, 255);
+ source -= 0x20;
+ }
+}
+
+
+uint32_t funybubl_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+{
+ bitmap.fill(m_palette->black_pen(), cliprect);
+
+ m_tilemap->draw(screen, bitmap, cliprect, 0, 0);
+
+ draw_sprites(bitmap, cliprect);
+
+#if 0
+ if (machine().input().code_pressed_once(KEYCODE_W))
+ {
+ FILE *fp;
+
+ fp = fopen("funnybubsprites", "w+b");
+ if (fp)
+ {
+ fwrite(&m_spriteram[0], 0x1000, 1, fp);
+ fclose(fp);
+ }
+ }
+#endif
+ return 0;
+}
+
+
+// machine
void funybubl_state::vidram_bank_w(uint8_t data)
{
- m_vrambank->set_bank(data & 1);
+ m_vrambank.select(data & 1);
}
void funybubl_state::cpurombank_w(uint8_t data)
@@ -74,34 +234,30 @@ void funybubl_state::oki_bank_w(uint8_t data)
}
-void funybubl_state::funybubl_map(address_map &map)
+void funybubl_state::main_program_map(address_map &map)
{
map(0x0000, 0x7fff).rom();
- map(0x8000, 0xbfff).bankr("mainbank"); // banked port 1?
- map(0xc400, 0xcfff).ram().w(m_palette, FUNC(palette_device::write8)).share("palette"); // palette
- map(0xd000, 0xdfff).m(m_vrambank, FUNC(address_map_bank_device::amap8)); // banked port 0?
+ map(0x8000, 0xbfff).bankr(m_mainbank); // banked port 1?
+ map(0xc400, 0xcfff).ram().w(m_palette, FUNC(palette_device::write8)).share("palette");
+ map(0xd000, 0xdfff).view(m_vrambank); // banked port 0?
+ m_vrambank[0](0xd000, 0xdfff).ram().w(FUNC(funybubl_state::tilemap_w)).share(m_tilemapram);
+ m_vrambank[1](0xd000, 0xdfff).ram().share(m_spriteram);
map(0xe000, 0xffff).ram();
}
-void funybubl_state::io_map(address_map &map)
+void funybubl_state::main_io_map(address_map &map)
{
map.global_mask(0xff);
- map(0x00, 0x00).portr("SYSTEM").w(FUNC(funybubl_state::vidram_bank_w)); // vidram bank
- map(0x01, 0x01).portr("P1").w(FUNC(funybubl_state::cpurombank_w)); // rom bank?
+ map(0x00, 0x00).portr("SYSTEM").w(FUNC(funybubl_state::vidram_bank_w));
+ map(0x01, 0x01).portr("P1").w(FUNC(funybubl_state::cpurombank_w)); // ?
map(0x02, 0x02).portr("P2");
map(0x03, 0x03).portr("DSW").w(m_soundlatch, FUNC(generic_latch_8_device::write));
- map(0x06, 0x06).nopr(); /* Nothing is done with the data read */
- map(0x06, 0x06).nopw(); /* Written directly after IO port 0 */
- map(0x07, 0x07).nopw(); /* Reset something on startup - Sound CPU ?? */
-}
-
-void funybubl_state::vrambank_map(address_map &map)
-{
- map(0x0000, 0x0fff).ram().w(FUNC(funybubl_state::tilemap_w)).share("tilemapram");
- map(0x1000, 0x1fff).ram().share("spriteram");
+ map(0x06, 0x06).nopr(); // Nothing is done with the data read
+ map(0x06, 0x06).nopw(); // Written directly after IO port 0
+ map(0x07, 0x07).nopw(); // Reset something on startup - Sound CPU ??
}
-/* Sound CPU */
+// Sound CPU
void funybubl_state::sound_map(address_map &map)
{
@@ -115,7 +271,7 @@ void funybubl_state::sound_map(address_map &map)
void funybubl_state::oki_map(address_map &map)
{
map(0x00000, 0x1ffff).rom();
- map(0x20000, 0x3ffff).bankr("okibank");
+ map(0x20000, 0x3ffff).bankr(m_okibank);
}
@@ -125,10 +281,10 @@ static INPUT_PORTS_START( funybubl )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 )
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* Maybe unused */
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* Maybe unused */
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* Maybe unused */
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* Maybe unused */
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Maybe unused
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Maybe unused
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Maybe unused
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Maybe unused
PORT_START("P1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
@@ -136,9 +292,9 @@ static INPUT_PORTS_START( funybubl )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* Maybe unused */
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* Maybe unused */
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* Maybe unused */
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Maybe unused
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Maybe unused
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Maybe unused
PORT_START("P2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
@@ -146,9 +302,9 @@ static INPUT_PORTS_START( funybubl )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* Maybe unused */
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* Maybe unused */
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* Maybe unused */
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Maybe unused
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Maybe unused
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Maybe unused
PORT_START("DSW")
PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3")
@@ -202,8 +358,8 @@ static const gfx_layout layout_16x16x8 =
static GFXDECODE_START( gfx_funybubl )
- GFXDECODE_ENTRY( "gfx1", 0, layout_8x8x8, 0x100, 2 )
- GFXDECODE_ENTRY( "gfx2", 0, layout_16x16x8, 0x000, 1 )
+ GFXDECODE_ENTRY( "tiles", 0, layout_8x8x8, 0x100, 2 )
+ GFXDECODE_ENTRY( "sprites", 0, layout_16x16x8, 0x000, 1 )
GFXDECODE_END
@@ -212,25 +368,21 @@ void funybubl_state::machine_start()
{
m_mainbank->configure_entries(0, 0x10, memregion("maincpu")->base(), 0x4000);
m_okibank->configure_entries(0, 2, memregion("oki")->base() + 0x20000, 0x20000);
-
- m_vrambank->set_bank(0);
}
void funybubl_state::funybubl(machine_config &config)
{
- /* basic machine hardware */
- Z80(config, m_maincpu, 12000000/2); /* 6 MHz?? */
- m_maincpu->set_addrmap(AS_PROGRAM, &funybubl_state::funybubl_map);
- m_maincpu->set_addrmap(AS_IO, &funybubl_state::io_map);
+ // basic machine hardware
+ Z80(config, m_maincpu, 12_MHz_XTAL / 2); // 6 MHz?? divider not verified
+ m_maincpu->set_addrmap(AS_PROGRAM, &funybubl_state::main_program_map);
+ m_maincpu->set_addrmap(AS_IO, &funybubl_state::main_io_map);
m_maincpu->set_vblank_int("screen", FUNC(funybubl_state::irq0_line_hold));
- Z80(config, m_audiocpu, 8000000/2); /* 4 MHz?? */
+ Z80(config, m_audiocpu, 8_MHz_XTAL / 2); // 4 MHz?? divider not verified
m_audiocpu->set_addrmap(AS_PROGRAM, &funybubl_state::sound_map);
- ADDRESS_MAP_BANK(config, m_vrambank).set_map(&funybubl_state::vrambank_map).set_options(ENDIANNESS_LITTLE, 8, 13, 0x1000);
-
- /* video hardware */
+ // video hardware
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_refresh_hz(60);
screen.set_vblank_time(ATTOSECONDS_IN_USEC(0));
@@ -241,15 +393,15 @@ void funybubl_state::funybubl(machine_config &config)
screen.set_palette(m_palette);
GFXDECODE(config, m_gfxdecode, m_palette, gfx_funybubl);
- PALETTE(config, m_palette).set_format(4, &funybubl_state::funybubl_R6B6G6, 0xc00/4);
+ PALETTE(config, m_palette).set_format(4, &funybubl_state::r6b6g6, 0xc00 / 4);
- /* sound hardware */
+ // sound hardware
SPEAKER(config, "mono").front_center();
GENERIC_LATCH_8(config, m_soundlatch);
m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, 0);
- OKIM6295(config, m_oki, 8000000/8, okim6295_device::PIN7_HIGH); // clock frequency & pin 7 not verified
+ OKIM6295(config, m_oki, 8_MHz_XTAL / 8, okim6295_device::PIN7_HIGH); // divider & pin 7 not verified
m_oki->set_addrmap(0, &funybubl_state::oki_map);
m_oki->add_route(ALL_OUTPUTS, "mono", 1.0);
}
@@ -257,10 +409,10 @@ void funybubl_state::funybubl(machine_config &config)
ROM_START( funybubl )
- ROM_REGION( 0x40000, "maincpu", 0 ) /* main z80, lots of banked data */
+ ROM_REGION( 0x40000, "maincpu", 0 ) // main z80, lots of banked data
ROM_LOAD( "a.ub16", 0x00000, 0x40000, CRC(4e799cdd) SHA1(c6474fd2f621c27224e847ecb88a1ae17a0dbaf9) )
- ROM_REGION( 0x200000, "gfx1", ROMREGION_INVERT ) // bg gfx 8x8x8
+ ROM_REGION( 0x200000, "tiles", ROMREGION_INVERT ) // 8x8x8
ROM_LOAD( "f.ug13", 0x000000, 0x40000, CRC(64d7163d) SHA1(2619ac96e05779ea23c7f0f71665d284c79ba72f) )
ROM_LOAD( "g.uh13", 0x040000, 0x40000, CRC(6891e2b8) SHA1(ca711019e5c330759d2a90024dbc0e6731b6227f) )
ROM_LOAD( "h.ug15", 0x080000, 0x40000, CRC(ca7f7528) SHA1(6becfe8fabd19443a13b948838f41e10e5c9dc87) )
@@ -270,25 +422,25 @@ ROM_START( funybubl )
ROM_LOAD( "n.ug17", 0x180000, 0x40000, CRC(52398b68) SHA1(522baa8123998e9161fa1ccaf760ac006c5be2dd) )
ROM_LOAD( "o.uh17", 0x1c0000, 0x40000, CRC(446e31b2) SHA1(7f37a7090c83f2c9b07f1993707540fb32bbed35) )
- ROM_REGION( 0x200000, "gfx2", ROMREGION_INVERT )
- ROM_LOAD( "d.ug1", 0x000000, 0x80000, CRC(b7ebbc00) SHA1(92520fda2f8f242b8cd49aeaac21b279f48276bf) ) /* Same as below, different labels */
+ ROM_REGION( 0x200000, "sprites", ROMREGION_INVERT )
+ ROM_LOAD( "d.ug1", 0x000000, 0x80000, CRC(b7ebbc00) SHA1(92520fda2f8f242b8cd49aeaac21b279f48276bf) ) // Same as below, different labels
ROM_LOAD( "e.ug2", 0x080000, 0x80000, CRC(28afc396) SHA1(555d51948ffb237311112dcfd0516a43f603ff03) )
ROM_LOAD( "j.ug3", 0x100000, 0x80000, CRC(9e8687cd) SHA1(42fcba2532ae5028fcfc1df50750d99ad2586820) )
ROM_LOAD( "k.ug4", 0x180000, 0x80000, CRC(63f0e810) SHA1(5c7ed32ee8dc1d9aabc8d136ec370471096356c2) )
- ROM_REGION( 0x08000, "audiocpu", 0 ) /* sound z80 (not much code here ..) */
- ROM_LOAD( "p.su6", 0x00000, 0x08000, CRC(33169d4d) SHA1(0ebc932d15b6df022c7e1f44df884e64b25ba745) ) /* Same as below, different label */
+ ROM_REGION( 0x08000, "audiocpu", 0 ) // sound z80 (not much code here ..)
+ ROM_LOAD( "p.su6", 0x00000, 0x08000, CRC(33169d4d) SHA1(0ebc932d15b6df022c7e1f44df884e64b25ba745) ) // Same as below, different label
ROM_REGION( 0x80000, "oki", 0 )
- ROM_LOAD( "b.su12", 0x00000, 0x20000, CRC(a2d780f4) SHA1(bebba3db21ab9ddde8c6f19db3b67c869df582eb) ) /* Same as below, different label */
- ROM_LOAD( "c.su13", 0x20000, 0x40000, CRC(1f7e9269) SHA1(5c16b49a4e94aec7606d088c2d45a77842ab565b) ) /* Same as below, different label */
+ ROM_LOAD( "b.su12", 0x00000, 0x20000, CRC(a2d780f4) SHA1(bebba3db21ab9ddde8c6f19db3b67c869df582eb) ) // Same as below, different label
+ ROM_LOAD( "c.su13", 0x20000, 0x40000, CRC(1f7e9269) SHA1(5c16b49a4e94aec7606d088c2d45a77842ab565b) ) // Same as below, different label
ROM_END
ROM_START( funybublc )
- ROM_REGION( 0x40000, "maincpu", 0 ) /* main z80, lots of banked data */
+ ROM_REGION( 0x40000, "maincpu", 0 ) // main z80, lots of banked data
ROM_LOAD( "2.ub16", 0x00000, 0x40000, CRC(d684c13f) SHA1(6a58b44dd775f374d6fd476a8fd175c28a83a495) )
- ROM_REGION( 0x200000, "gfx1", ROMREGION_INVERT ) // bg gfx 8x8x8
+ ROM_REGION( 0x200000, "tiles", ROMREGION_INVERT ) // 8x8x8
ROM_LOAD( "7.ug12", 0x000000, 0x40000, CRC(87603d7b) SHA1(21aec4cd011691f8608c3ddab83697bd89634fc8) )
ROM_LOAD( "8.uh13", 0x040000, 0x40000, CRC(ab6031bd) SHA1(557793817f98c07c82caab4293aed7dffa4dbf7b) )
ROM_LOAD( "9.ug15", 0x080000, 0x40000, CRC(0e8352ff) SHA1(29679a7ece2585e1a66296439b68bd56c937e313) )
@@ -298,13 +450,13 @@ ROM_START( funybublc )
ROM_LOAD( "15.ug17", 0x180000, 0x40000, CRC(9a5e66a6) SHA1(cbe727e4f1e9a7072520d2e30eb0047cc67bff1b) )
ROM_LOAD( "16.uh17", 0x1c0000, 0x40000, CRC(218060b3) SHA1(35124afce7f0f998b5c4761bbc888235de4e56ef) )
- ROM_REGION( 0x200000, "gfx2", ROMREGION_INVERT )
+ ROM_REGION( 0x200000, "sprites", ROMREGION_INVERT )
ROM_LOAD( "5.ug1", 0x000000, 0x80000, CRC(b7ebbc00) SHA1(92520fda2f8f242b8cd49aeaac21b279f48276bf) )
ROM_LOAD( "6.ug2", 0x080000, 0x80000, CRC(28afc396) SHA1(555d51948ffb237311112dcfd0516a43f603ff03) )
ROM_LOAD( "11.ug3", 0x100000, 0x80000, CRC(9e8687cd) SHA1(42fcba2532ae5028fcfc1df50750d99ad2586820) )
ROM_LOAD( "12.ug4", 0x180000, 0x80000, CRC(63f0e810) SHA1(5c7ed32ee8dc1d9aabc8d136ec370471096356c2) )
- ROM_REGION( 0x08000, "audiocpu", 0 ) /* sound z80 (not much code here ..) */
+ ROM_REGION( 0x08000, "audiocpu", 0 ) // sound z80 (not much code here ..)
ROM_LOAD( "1.su6", 0x00000, 0x08000, CRC(33169d4d) SHA1(0ebc932d15b6df022c7e1f44df884e64b25ba745) )
ROM_REGION( 0x80000, "oki", 0 )
@@ -312,6 +464,8 @@ ROM_START( funybublc )
ROM_LOAD( "4.su13", 0x20000, 0x40000, CRC(1f7e9269) SHA1(5c16b49a4e94aec7606d088c2d45a77842ab565b) )
ROM_END
+} // anonymous namespace
+
-GAME( 1999, funybubl, 0, funybubl, funybubl, funybubl_state, empty_init, ROT0, "In Chang Electronic Co", "Funny Bubble", MACHINE_SUPPORTS_SAVE )
-GAME( 1999, funybublc,funybubl, funybubl, funybubl, funybubl_state, empty_init, ROT0, "Comad", "Funny Bubble (Comad version)", MACHINE_SUPPORTS_SAVE )
+GAME( 1999, funybubl, 0, funybubl, funybubl, funybubl_state, empty_init, ROT0, "In Chang Electronic Co", "Funny Bubble", MACHINE_SUPPORTS_SAVE )
+GAME( 1999, funybublc,funybubl, funybubl, funybubl, funybubl_state, empty_init, ROT0, "Comad", "Funny Bubble (Comad version)", MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/comad/funybubl.h b/src/mame/comad/funybubl.h
deleted file mode 100644
index 7dcc48ff129..00000000000
--- a/src/mame/comad/funybubl.h
+++ /dev/null
@@ -1,76 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:David Haywood
-#ifndef MAME_INCLUDES_FUNYBUBL_H
-#define MAME_INCLUDES_FUNYBUBL_H
-
-#pragma once
-
-#include "machine/bankdev.h"
-#include "machine/gen_latch.h"
-#include "sound/okim6295.h"
-#include "emupal.h"
-#include "tilemap.h"
-
-class funybubl_state : public driver_device
-{
-public:
- funybubl_state(const machine_config &mconfig, device_type type, const char *tag) :
- driver_device(mconfig, type, tag),
- m_tilemapram(*this, "tilemapram"),
- m_spriteram(*this, "spriteram"),
- m_mainbank(*this, "mainbank"),
- m_okibank(*this, "okibank"),
- m_maincpu(*this, "maincpu"),
- m_audiocpu(*this, "audiocpu"),
- m_oki(*this, "oki"),
- m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette"),
- m_soundlatch(*this, "soundlatch"),
- m_vrambank(*this, "vrambank")
- { }
-
- void funybubl(machine_config &config);
-
-protected:
- virtual void machine_start() override;
- virtual void video_start() override;
-
-private:
- /* memory pointers */
- required_shared_ptr<uint8_t> m_tilemapram;
- required_shared_ptr<uint8_t> m_spriteram;
-
- required_memory_bank m_mainbank;
- required_memory_bank m_okibank;
-
- /* video-related */
- tilemap_t *m_tilemap = nullptr;
-
- /* 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<palette_device> m_palette;
- required_device<generic_latch_8_device> m_soundlatch;
- required_device<address_map_bank_device> m_vrambank;
-
- /* memory */
- void vidram_bank_w(uint8_t data);
- void cpurombank_w(uint8_t data);
- void oki_bank_w(uint8_t data);
-
- static rgb_t funybubl_R6B6G6(uint32_t raw);
- void tilemap_w(offs_t offset, uint8_t data, uint8_t mem_mask = ~0);
- TILE_GET_INFO_MEMBER(get_tile_info);
-
- uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
- void funybubl_map(address_map &map);
- void io_map(address_map &map);
- void oki_map(address_map &map);
- void sound_map(address_map &map);
- void vrambank_map(address_map &map);
-};
-
-#endif // MAME_INCLUDES_FUNYBUBL_H
diff --git a/src/mame/comad/funybubl_v.cpp b/src/mame/comad/funybubl_v.cpp
deleted file mode 100644
index 0f5ff2c324e..00000000000
--- a/src/mame/comad/funybubl_v.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:David Haywood
-/* Funny Bubble Video hardware
-
-todo - convert to tilemap
-
- */
-
-
-#include "emu.h"
-#include "funybubl.h"
-
-rgb_t funybubl_state::funybubl_R6B6G6(uint32_t raw)
-{
- return rgb_t(pal6bit(raw >> 12), pal6bit(raw >> 0), pal6bit(raw >> 6));
-}
-
-void funybubl_state::tilemap_w(offs_t offset, uint8_t data, uint8_t mem_mask)
-{
- COMBINE_DATA(&m_tilemapram[offset]);
- m_tilemap->mark_tile_dirty(offset>>1);
-}
-
-TILE_GET_INFO_MEMBER(funybubl_state::get_tile_info)
-{
- uint16_t const code = m_tilemapram[tile_index << 1] | (m_tilemapram[(tile_index << 1) | 1] << 8);
- tileinfo.set(0, code & 0x7fff, BIT(code, 15), 0);
-}
-
-void funybubl_state::video_start()
-{
- m_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(funybubl_state::get_tile_info)),TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
- m_tilemap->set_transparent_pen(0);
-}
-
-void funybubl_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect )
-{
- uint8_t *source = &m_spriteram[0x1000 - 0x20];
- uint8_t *finish = m_spriteram;
-
- while (source >= finish)
- {
- int xpos, ypos, tile;
-
- /* the sprites are in the sprite list twice
- the first format (in comments) appears to be a buffer, if you use
- this list you get garbage sprites in 2 player mode
- the second format (used) seems correct
-
- */
-/*
- ypos = 0xff - source[1 + 0x10];
- xpos = source[2 + 0x10];
- tile = source[0 + 0x10] | ( (source[3 + 0x10] & 0x0f) <<8);
- if (source[3 + 0x10] & 0x80) tile += 0x1000;
- if (source[3 + 0x10] & 0x20) xpos += 0x100;
- // bits 0x40 (not used?) and 0x10 (just set during transition period of x co-ord 0xff and 0x00) ...
- xpos -= 8;
- ypos -= 14;
-
-*/
- ypos = source[2];
- xpos = source[3];
- tile = source[0] | ( (source[1] & 0x0f) << 8);
- if (source[1] & 0x80) tile += 0x1000;
- if (source[1] & 0x20)
- {
- if (xpos < 0xe0)
- xpos += 0x100;
- }
-
- // bits 0x40 and 0x10 not used?...
-
- m_gfxdecode->gfx(1)->transpen(bitmap,cliprect, tile, 0, 0, 0, xpos, ypos, 255);
- source -= 0x20;
- }
-}
-
-
-uint32_t funybubl_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
-{
- bitmap.fill(m_palette->black_pen(), cliprect);
-
- m_tilemap->draw(screen, bitmap, cliprect, 0, 0);
-
- draw_sprites(bitmap, cliprect);
-
-#if 0
- if ( machine().input().code_pressed_once(KEYCODE_W) )
- {
- FILE *fp;
-
- fp = fopen("funnybubsprites", "w+b");
- if (fp)
- {
- fwrite(&m_spriteram[0], 0x1000, 1, fp);
- fclose(fp);
- }
- }
-#endif
- return 0;
-}
diff --git a/src/mame/comad/galspnbl.cpp b/src/mame/comad/galspnbl.cpp
index cb94eae2e6a..0b7d561164f 100644
--- a/src/mame/comad/galspnbl.cpp
+++ b/src/mame/comad/galspnbl.cpp
@@ -1,5 +1,6 @@
// license:BSD-3-Clause
-// copyright-holders:Nicola Salmoria
+// copyright-holders: Nicola Salmoria
+
/***************************************************************************
Hot Pinball
@@ -11,10 +12,10 @@ Notes:
- to start a 2 or more players game, press the start button multiple times
- the sprite graphics contain a "(c) Tecmo", and the sprite system is
indeed similar to other Tecmo games like Ninja Gaiden.
-- Clearly based on Tecmo's Super Pinball Action (see spbactn.c)
+- Clearly based on Tecmo's Super Pinball Action (see tecmo/spbactn.cpp)
- There seems to be a bug in Hot Pinball's Demo Sounds. If you start the
- game normally you get no demo sounds. However if you select the "Slide
- Show" and run all the way through the game will start with demo sounds.
+ game normally you get no demo sounds. However, if you select the "Slide
+ Show" and run all the way through, the game will start with demo sounds.
Gals Pinball's Demo Sounds works as expected according to DSW setting.
TODO:
@@ -51,48 +52,203 @@ Known undumped games/sets:
***************************************************************************/
#include "emu.h"
-#include "galspnbl.h"
+
+#include "tecmo_spr.h"
#include "cpu/m68000/m68000.h"
#include "cpu/z80/z80.h"
+#include "machine/gen_latch.h"
#include "sound/okim6295.h"
#include "sound/ymopl.h"
+
+#include "emupal.h"
+#include "screen.h"
#include "speaker.h"
-void galspnbl_state::soundcommand_w(offs_t offset, uint16_t data, uint16_t mem_mask)
+namespace {
+
+class galspnbl_state : public driver_device
+{
+public:
+ galspnbl_state(const machine_config &mconfig, device_type type, const char *tag) :
+ driver_device(mconfig, type, tag),
+ m_spriteram(*this, "spriteram"),
+ m_colorram(*this, "colorram"),
+ m_videoram(*this, "videoram"),
+ m_bgvideoram(*this, "bgvideoram"),
+ m_scroll(*this, "scroll"),
+ m_audiocpu(*this, "audiocpu"),
+ m_maincpu(*this, "maincpu"),
+ m_gfxdecode(*this, "gfxdecode"),
+ m_palette(*this, "palette"),
+ m_sprgen(*this, "spritegen"),
+ m_screen(*this, "screen"),
+ m_soundlatch(*this, "soundlatch")
+ { }
+
+ void galspnbl(machine_config &config);
+
+protected:
+ virtual void video_start() override;
+
+private:
+ // memory pointers
+ required_shared_ptr<uint16_t> m_spriteram;
+ required_shared_ptr<uint16_t> m_colorram;
+ required_shared_ptr<uint16_t> m_videoram;
+ required_shared_ptr<uint16_t> m_bgvideoram;
+ required_shared_ptr<uint16_t> m_scroll;
+
+ // devices
+ required_device<cpu_device> m_audiocpu;
+ required_device<cpu_device> m_maincpu;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_device<palette_device> m_palette;
+ required_device<tecmo_spr_device> m_sprgen;
+ required_device<screen_device> m_screen;
+ required_device<generic_latch_8_device> m_soundlatch;
+
+ void soundcommand_w(offs_t offset, uint8_t data);
+ void palette(palette_device &palette) const;
+ uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void draw_background(bitmap_ind16 &bitmap, const rectangle &cliprect);
+ bitmap_ind16 m_sprite_bitmap;
+
+ void mix_sprite_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int pri);
+
+ void audio_map(address_map &map);
+ void main_map(address_map &map);
+};
+
+
+// video
+
+
+void galspnbl_state::palette(palette_device &palette) const
+{
+ // initialize 555 RGB lookup
+ for (int i = 0; i < 32768; i++)
+ palette.set_pen_color(i + 1024, pal5bit(i >> 5), pal5bit(i >> 10), pal5bit(i >> 0));
+}
+
+
+
+void galspnbl_state::draw_background(bitmap_ind16 &bitmap, const rectangle &cliprect)
+{
+// int const screenscroll = 4 - (m_scroll[0] & 0xff);
+
+ for (offs_t offs = 0; offs < 0x20000; offs++)
+ {
+ int const y = offs >> 9;
+ int const x = offs & 0x1ff;
+
+ bitmap.pix(y, x) = 1024 + (m_bgvideoram[offs] >> 1);
+ }
+}
+
+void galspnbl_state::video_start()
+{
+ // allocate bitmaps
+ m_screen->register_screen_bitmap(m_sprite_bitmap);
+}
+
+void galspnbl_state::mix_sprite_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int pri)
+{
+ for (int y = cliprect.top(); y <= cliprect.bottom(); y++)
+ {
+ uint16_t *const dd = &bitmap.pix(y);
+ uint16_t const *const sd2 = &m_sprite_bitmap.pix(y);
+
+ for (int x = cliprect.left(); x <= cliprect.right(); x++)
+ {
+ uint16_t sprpixel = (sd2[x]);
+ //uint16_t const sprpri = (sprpixel >> 8) & 3;
+ uint16_t const sprpri = (sprpixel >> 9) & 1; // only upper priority bit matters on the bootleg hw?
+
+ sprpixel &= 0xff;
+
+ if (sprpixel & 0xf)
+ {
+ if (sprpri == pri)
+ dd[x] = sprpixel;
+ }
+
+ // uint16_t sprbln = (sprpixel >> 10) & 1; // we handle 'blending' from the original as a simple on/off flicker in the bootleg sprite function, I don't think the bootleg hw can blend
+ }
+ }
+}
+
+uint32_t galspnbl_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- if (ACCESSING_BITS_0_7)
+ m_sprite_bitmap.fill(0, cliprect);
+ m_sprgen->gaiden_draw_sprites(screen, m_gfxdecode->gfx(1), cliprect, m_spriteram, 0, 0, flip_screen(), m_sprite_bitmap);
+
+
+ draw_background(bitmap, cliprect);
+
+ mix_sprite_layer(screen, bitmap, cliprect, 0);
+
+ for (int offs = 0; offs < 0x1000 / 2; offs++)
{
- m_soundlatch->write(data & 0xff);
- m_audiocpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero);
+ int const code = m_videoram[offs];
+ int const attr = m_colorram[offs];
+ int const color = (attr & 0x00f0) >> 4;
+ int const sx = offs % 64;
+ int const sy = offs / 64;
+
+ // What is this? A priority/half transparency marker? */ // leftover blend flags from original spbactn game
+ if (!(attr & 0x0008))
+ {
+ m_gfxdecode->gfx(0)->transpen(bitmap, cliprect,
+ code,
+ color,
+ 0, 0,
+// 16 * sx + screenscroll, 8 * sy,
+ 16 * sx, 8 * sy, 0);
+ }
}
+
+ mix_sprite_layer(screen, bitmap, cliprect, 1);
+
+
+ return 0;
+}
+
+
+// machine
+
+void galspnbl_state::soundcommand_w(offs_t offset, uint8_t data)
+{
+ m_soundlatch->write(data);
+ m_audiocpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero);
}
void galspnbl_state::main_map(address_map &map)
{
map(0x000000, 0x3fffff).rom();
- map(0x700000, 0x703fff).ram(); /* galspnbl work RAM */
- map(0x708000, 0x70ffff).ram(); /* galspnbl work RAM, bitmaps are decompressed here */
- map(0x800000, 0x803fff).ram(); /* hotpinbl work RAM */
- map(0x808000, 0x80ffff).ram(); /* hotpinbl work RAM, bitmaps are decompressed here */
- map(0x880000, 0x880fff).ram().share("spriteram");
- map(0x8ff400, 0x8fffff).nopw(); /* ??? */
- map(0x900000, 0x900fff).ram().share("colorram");
- map(0x901000, 0x903fff).nopw(); /* ??? */
- map(0x904000, 0x904fff).ram().share("videoram");
- map(0x905000, 0x907fff).nopw(); /* ??? */
- map(0x980000, 0x9bffff).ram().share("bgvideoram");
- map(0xa00000, 0xa00fff).nopw(); /* more palette ? */
+ map(0x700000, 0x703fff).ram(); // galspnbl work RAM
+ map(0x708000, 0x70ffff).ram(); // galspnbl work RAM, bitmaps are decompressed here
+ map(0x800000, 0x803fff).ram(); // hotpinbl work RAM
+ map(0x808000, 0x80ffff).ram(); // hotpinbl work RAM, bitmaps are decompressed here
+ map(0x880000, 0x880fff).ram().share(m_spriteram);
+ map(0x8ff400, 0x8fffff).nopw(); // ???
+ map(0x900000, 0x900fff).ram().share(m_colorram);
+ map(0x901000, 0x903fff).nopw(); // ???
+ map(0x904000, 0x904fff).ram().share(m_videoram);
+ map(0x905000, 0x907fff).nopw(); // ???
+ map(0x980000, 0x9bffff).ram().share(m_bgvideoram);
+ map(0xa00000, 0xa00fff).nopw(); // more palette ?
map(0xa01000, 0xa017ff).w(m_palette, FUNC(palette_device::write16)).share("palette");
- map(0xa01800, 0xa027ff).nopw(); /* more palette ? */
+ map(0xa01800, 0xa027ff).nopw(); // more palette ?
map(0xa80000, 0xa80001).portr("IN0");
- map(0xa80010, 0xa80011).portr("IN1").w(FUNC(galspnbl_state::soundcommand_w));
- map(0xa80020, 0xa80021).portr("SYSTEM").nopw(); /* w - could be watchdog, but causes resets when picture is shown */
- map(0xa80030, 0xa80031).portr("DSW1").nopw(); /* w - irq ack? */
+ map(0xa80010, 0xa80011).portr("IN1");
+ map(0xa80011, 0xa80011).w(FUNC(galspnbl_state::soundcommand_w));
+ map(0xa80020, 0xa80021).portr("SYSTEM").nopw(); // w - could be watchdog, but causes resets when picture is shown
+ map(0xa80030, 0xa80031).portr("DSW1").nopw(); // w - irq ack?
map(0xa80040, 0xa80041).portr("DSW2");
- map(0xa80050, 0xa80051).writeonly().share("scroll"); /* ??? */
+ map(0xa80050, 0xa80051).writeonly().share(m_scroll); // ???
}
void galspnbl_state::audio_map(address_map &map)
@@ -101,20 +257,20 @@ void galspnbl_state::audio_map(address_map &map)
map(0xf000, 0xf7ff).ram();
map(0xf800, 0xf800).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write));
map(0xf810, 0xf811).w("ymsnd", FUNC(ym3812_device::write));
- map(0xfc00, 0xfc00).noprw(); /* irq ack ?? */
+ map(0xfc00, 0xfc00).noprw(); // irq ack ??
map(0xfc20, 0xfc20).r(m_soundlatch, FUNC(generic_latch_8_device::read));
}
static INPUT_PORTS_START( galspnbl )
PORT_START("IN0")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* tested at 0x0016c6 - doesn't seem tilt related */
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* tested at 0x0016d2 - doesn't seem tilt related */
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) // tested at 0x0016c6 - doesn't seem tilt related
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) // tested at 0x0016d2 - doesn't seem tilt related
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME( "Left Flippers" )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME( "Launch Ball / Shake (Left Side)" )
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* uncalled (?) code at 0x007ed2 ('hotpinbl') or 0x008106 ('galspnbl') */
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) // uncalled (?) code at 0x007ed2 ('hotpinbl') or 0x008106 ('galspnbl')
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("IN1")
@@ -124,21 +280,21 @@ static INPUT_PORTS_START( galspnbl )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME( "Launch Ball / Shake (Right Side)" )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME( "Right Flippers" )
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* uncalled (?) code at 0x007e90 ('hotpinbl') or 0x0080c4 ('galspnbl') */
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) // uncalled (?) code at 0x007e90 ('hotpinbl') or 0x0080c4 ('galspnbl')
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME( "Start" ) /* needed to avoid confusion with # of players. Press mulitple times for multiple players */
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME( "Start" ) // needed to avoid confusion with # of players. Press multiple times for multiple players
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("DSW1") /* 0x700018.b */
- PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2") /* see code at 0x0085c6 ('hotpinbl') or 0x008994 ('galspnbl') */
+ PORT_START("DSW1") // 0x700018.b
+ PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2") // see code at 0x0085c6 ('hotpinbl') or 0x008994 ('galspnbl')
PORT_DIPSETTING( 0x02, DEF_STR( Easy ) )
PORT_DIPSETTING( 0x03, DEF_STR( Normal ) )
PORT_DIPSETTING( 0x01, DEF_STR( Hard ) )
@@ -151,7 +307,7 @@ static INPUT_PORTS_START( galspnbl )
PORT_DIPNAME( 0x10, 0x10, "Hit Difficulty" ) PORT_DIPLOCATION("SW2:5")
PORT_DIPSETTING( 0x10, DEF_STR( Normal ) )
PORT_DIPSETTING( 0x00, DEF_STR( Hard ) )
- PORT_DIPNAME( 0x20, 0x20, "Slide Show" ) PORT_DIPLOCATION("SW2:6") /* Listed as unused on manuals for both games */
+ PORT_DIPNAME( 0x20, 0x20, "Slide Show" ) PORT_DIPLOCATION("SW2:6") // Listed as unused on manuals for both games
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:7")
@@ -159,7 +315,7 @@ static INPUT_PORTS_START( galspnbl )
PORT_DIPSETTING( 0x40, DEF_STR( On ) )
PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW2:8" )
- PORT_START("DSW2") /* 0x700019.b */
+ PORT_START("DSW2") // 0x700019.b
PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3")
PORT_DIPSETTING( 0x02, DEF_STR( 4C_1C ) )
PORT_DIPSETTING( 0x03, DEF_STR( 3C_1C ) )
@@ -218,51 +374,47 @@ static const gfx_layout spritelayout =
};
static GFXDECODE_START( gfx_galspnbl )
- GFXDECODE_ENTRY( "gfx1", 0, tilelayout, 512, 16 )
- GFXDECODE_ENTRY( "gfx2", 0, spritelayout, 0, 16 )
+ GFXDECODE_ENTRY( "tiles", 0, tilelayout, 512, 16 )
+ GFXDECODE_ENTRY( "sprites", 0, spritelayout, 0, 16 )
GFXDECODE_END
-void galspnbl_state::machine_start()
-{
-}
-
void galspnbl_state::galspnbl(machine_config &config)
{
- /* basic machine hardware */
- M68000(config, m_maincpu, XTAL(22'118'400)/2); /* 11.0592 MHz??? - NEEDS VERIFICATION!! */
+ // basic machine hardware
+ M68000(config, m_maincpu, XTAL(22'118'400) / 2); // 11.0592 MHz??? - NEEDS VERIFICATION!!
m_maincpu->set_addrmap(AS_PROGRAM, &galspnbl_state::main_map);
- m_maincpu->set_vblank_int("screen", FUNC(galspnbl_state::irq3_line_hold)); /* also has vector for 6, but it does nothing */
+ m_maincpu->set_vblank_int("screen", FUNC(galspnbl_state::irq3_line_hold)); // also has vector for 6, but it does nothing
- Z80(config, m_audiocpu, XTAL(4'000'000)); /* 4 MHz ??? - Use value from Tecmo's Super Pinball Action - NEEDS VERIFICATION!! */
- m_audiocpu->set_addrmap(AS_PROGRAM, &galspnbl_state::audio_map); /* NMI is caused by the main CPU */
+ Z80(config, m_audiocpu, XTAL(4'000'000)); // 4 MHz ??? - Use value from Tecmo's Super Pinball Action - NEEDS VERIFICATION!!
+ m_audiocpu->set_addrmap(AS_PROGRAM, &galspnbl_state::audio_map); // NMI is caused by the main CPU
- /* video hardware */
+ // video hardware
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
m_screen->set_refresh_hz(60);
m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0));
m_screen->set_size(512, 256);
m_screen->set_visarea(0, 512-1, 16, 240-1);
- m_screen->set_screen_update(FUNC(galspnbl_state::screen_update_galspnbl));
+ m_screen->set_screen_update(FUNC(galspnbl_state::screen_update));
m_screen->set_palette(m_palette);
GFXDECODE(config, m_gfxdecode, m_palette, gfx_galspnbl);
- PALETTE(config, m_palette, FUNC(galspnbl_state::galspnbl_palette)).set_format(palette_device::xBGR_444, 1024 + 32768);
+ PALETTE(config, m_palette, FUNC(galspnbl_state::palette)).set_format(palette_device::xBGR_444, 1024 + 32768);
TECMO_SPRITE(config, m_sprgen, 0);
m_sprgen->set_bootleg(true);
- /* sound hardware */
+ // sound hardware
SPEAKER(config, "mono").front_center();
GENERIC_LATCH_8(config, m_soundlatch);
- ym3812_device &ymsnd(YM3812(config, "ymsnd", XTAL(4'000'000))); /* Use value from Super Pinball Action - NEEDS VERIFICATION!! */
+ ym3812_device &ymsnd(YM3812(config, "ymsnd", XTAL(4'000'000))); // Use value from Super Pinball Action - NEEDS VERIFICATION!!
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(ALL_OUTPUTS, "mono", 1.0);
- /* Use value from Super Pinball Action - clock frequency & pin 7 not verified */
- okim6295_device &oki(OKIM6295(config, "oki", XTAL(4'000'000)/4, okim6295_device::PIN7_HIGH));
+ // Use value from Super Pinball Action - clock frequency & pin 7 not verified
+ okim6295_device &oki(OKIM6295(config, "oki", XTAL(4'000'000) / 4, okim6295_device::PIN7_HIGH));
oki.add_route(ALL_OUTPUTS, "mono", 0.50);
}
@@ -274,7 +426,7 @@ void galspnbl_state::galspnbl(machine_config &config)
***************************************************************************/
ROM_START( galspnbl )
- ROM_REGION( 0x400000, "maincpu", 0 ) /* 68000 code */
+ ROM_REGION( 0x400000, "maincpu", 0 ) // 68000
ROM_LOAD16_BYTE( "7.rom", 0x000000, 0x80000, CRC(ce0189bf) SHA1(06d8cc6f5b819fe2ca536ce553db6986547a15ba) )
ROM_LOAD16_BYTE( "3.rom", 0x000001, 0x80000, CRC(9b0a8744) SHA1(ac80f22b8b2f4c559c225bf203af698bf59699e7) )
ROM_LOAD16_BYTE( "8.rom", 0x100000, 0x80000, CRC(eee2f087) SHA1(37285ae7b49c9d20ad92b3971db89ba593975154) )
@@ -284,23 +436,23 @@ ROM_START( galspnbl )
ROM_LOAD16_BYTE( "10.rom", 0x300000, 0x80000, CRC(3a20e1e5) SHA1(850be621547bc9c7519055211392f2684e440462) )
ROM_LOAD16_BYTE( "6.rom", 0x300001, 0x80000, CRC(94927d20) SHA1(0ea1a179956ad9a93a99cccec92f0490044ad1d3) )
- ROM_REGION( 0x10000, "audiocpu", 0 ) /* Z80 code */
+ ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80
ROM_LOAD( "2.rom", 0x0000, 0x10000, CRC(fae688a7) SHA1(e1ef7abd18f6a820d1a7f0ceb9a9b1a2c7de41f0) )
- ROM_REGION( 0x80000, "gfx1", 0 )
+ ROM_REGION( 0x80000, "tiles", 0 )
ROM_LOAD( "17.rom", 0x00000, 0x40000, CRC(7d435701) SHA1(f6a2241c95f101d09b18f550689d125abd3ea9c4) )
ROM_LOAD( "18.rom", 0x40000, 0x40000, CRC(136adaac) SHA1(5f5e70a66d256cad9fcdbc5a7fff035f9a3279b9) )
- ROM_REGION( 0x40000, "gfx2", 0 )
+ ROM_REGION( 0x40000, "sprites", 0 )
ROM_LOAD( "15.rom", 0x00000, 0x20000, CRC(4beb840d) SHA1(351cd8da361a55794595d2cf7b0fed9233d0a5a0) )
ROM_LOAD( "16.rom", 0x20000, 0x20000, CRC(93d3c610) SHA1(0cf1f311ec2646a436c37e121634731646c06437) )
- ROM_REGION( 0x40000, "oki", 0 ) /* OKIM6295 samples */
+ ROM_REGION( 0x40000, "oki", 0 ) // samples
ROM_LOAD( "1.rom", 0x00000, 0x40000, CRC(93c06d3d) SHA1(8620d274ca7824e7e72a1ad1da3eaa804d550653) )
ROM_END
ROM_START( hotpinbl ) // PCB silkscreened COMAD INDUSTRY CO.,LTD 950804 MADE IN KOREA
- ROM_REGION( 0x400000, "maincpu", 0 ) /* 68000 code */
+ ROM_REGION( 0x400000, "maincpu", 0 ) // 68000 code
ROM_LOAD16_BYTE( "hp_07.bin", 0x000000, 0x80000, CRC(978cc13e) SHA1(0060aaf7259fdeeacb07e9ced01bdf69c27bdfb6) )
ROM_LOAD16_BYTE( "hp_03.bin", 0x000001, 0x80000, CRC(68388726) SHA1(d8dca9050403be70097a0f833ba189bd2fa87e80) )
ROM_LOAD16_BYTE( "hp_08.bin", 0x100000, 0x80000, CRC(bd16be12) SHA1(36e64705efba8ecdc96a62f55d68e959022fb98f) )
@@ -310,21 +462,23 @@ ROM_START( hotpinbl ) // PCB silkscreened COMAD INDUSTRY CO.,LTD 950804 MADE IN
ROM_LOAD16_BYTE( "hp_10.bin", 0x300000, 0x80000, CRC(a5c63e34) SHA1(de27cfe20e09e8c13ee28d6eb42bfab1ebe33149) )
ROM_LOAD16_BYTE( "hp_06.bin", 0x300001, 0x80000, CRC(513eda91) SHA1(14a43c00ad1f55bff525a14cd53913dd78e80f0c) )
- ROM_REGION( 0x10000, "audiocpu", 0 ) /* Z80 code */
+ ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80
ROM_LOAD( "hp_02.bin", 0x0000, 0x10000, CRC(82698269) SHA1(5e27e89f1bdd7c3793d40867c50981f5fac0a7fb) )
- ROM_REGION( 0x80000, "gfx1", 0 )
+ ROM_REGION( 0x80000, "tiles", 0 )
ROM_LOAD( "hp_13.bin", 0x00000, 0x40000, CRC(d53b64b9) SHA1(347b6ec908e23f848e98eed46fb34b49b728556b) )
ROM_LOAD( "hp_14.bin", 0x40000, 0x40000, CRC(2fe3fcee) SHA1(29f96aa3dded6cb0b2fe3d9507fb5638e9778ef3) )
- ROM_REGION( 0x40000, "gfx2", 0 )
+ ROM_REGION( 0x40000, "sprites", 0 )
ROM_LOAD( "hp_11.bin", 0x00000, 0x20000, CRC(deecd7f1) SHA1(752c944d941bfe8f21d32881f32676999ebc5a7f) )
ROM_LOAD( "hp_12.bin", 0x20000, 0x20000, CRC(5fd603c2) SHA1(864686cd1ba5beb6cebfd394b60620106c929abd) )
- ROM_REGION( 0x40000, "oki", 0 ) /* OKIM6295 samples */
+ ROM_REGION( 0x40000, "oki", 0 ) // samples
ROM_LOAD( "hp_01.bin", 0x00000, 0x40000, CRC(93c06d3d) SHA1(8620d274ca7824e7e72a1ad1da3eaa804d550653) )
ROM_END
+} // anonymous namespace
+
-GAME( 1995, hotpinbl, 0, galspnbl, hotpinbl, galspnbl_state, empty_init, ROT90, "Comad & New Japan System", "Hot Pinball", MACHINE_SUPPORTS_SAVE )
-GAME( 1996, galspnbl, 0, galspnbl, galspnbl, galspnbl_state, empty_init, ROT90, "Comad", "Gals Pinball", MACHINE_SUPPORTS_SAVE )
+GAME( 1995, hotpinbl, 0, galspnbl, hotpinbl, galspnbl_state, empty_init, ROT90, "Comad & New Japan System", "Hot Pinball", MACHINE_SUPPORTS_SAVE )
+GAME( 1996, galspnbl, 0, galspnbl, galspnbl, galspnbl_state, empty_init, ROT90, "Comad", "Gals Pinball", MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/comad/galspnbl.h b/src/mame/comad/galspnbl.h
deleted file mode 100644
index a19f1bfcc00..00000000000
--- a/src/mame/comad/galspnbl.h
+++ /dev/null
@@ -1,76 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Nicola Salmoria
-
-/*************************************************************************
-
- Hot Pinball
- Gals Pinball
-
-*************************************************************************/
-#ifndef MAME_INCLUDES_GALSPNBL_H
-#define MAME_INCLUDES_GALSPNBL_H
-
-#pragma once
-
-#include "tecmo_spr.h"
-
-#include "machine/gen_latch.h"
-
-#include "emupal.h"
-#include "screen.h"
-
-class galspnbl_state : public driver_device
-{
-public:
- galspnbl_state(const machine_config &mconfig, device_type type, const char *tag) :
- driver_device(mconfig, type, tag),
- m_spriteram(*this, "spriteram"),
- m_colorram(*this, "colorram"),
- m_videoram(*this, "videoram"),
- m_bgvideoram(*this, "bgvideoram"),
- m_scroll(*this, "scroll"),
- m_audiocpu(*this, "audiocpu"),
- m_maincpu(*this, "maincpu"),
- m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette"),
- m_sprgen(*this, "spritegen"),
- m_screen(*this, "screen"),
- m_soundlatch(*this, "soundlatch")
- { }
-
- void galspnbl(machine_config &config);
-
-protected:
- virtual void video_start() override;
-
-private:
- /* memory pointers */
- required_shared_ptr<uint16_t> m_spriteram;
- required_shared_ptr<uint16_t> m_colorram;
- required_shared_ptr<uint16_t> m_videoram;
- required_shared_ptr<uint16_t> m_bgvideoram;
- required_shared_ptr<uint16_t> m_scroll;
-
- /* devices */
- required_device<cpu_device> m_audiocpu;
- required_device<cpu_device> m_maincpu;
- required_device<gfxdecode_device> m_gfxdecode;
- required_device<palette_device> m_palette;
- required_device<tecmo_spr_device> m_sprgen;
- required_device<screen_device> m_screen;
- required_device<generic_latch_8_device> m_soundlatch;
-
- void soundcommand_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
- virtual void machine_start() override;
- void galspnbl_palette(palette_device &palette) const;
- uint32_t screen_update_galspnbl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- void draw_background( bitmap_ind16 &bitmap, const rectangle &cliprect );
- bitmap_ind16 m_sprite_bitmap;
-
- void mix_sprite_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int pri);
-
- void audio_map(address_map &map);
- void main_map(address_map &map);
-};
-
-#endif // MAME_INCLUDES_GALSPNBL_H
diff --git a/src/mame/comad/galspnbl_v.cpp b/src/mame/comad/galspnbl_v.cpp
deleted file mode 100644
index b15505c1714..00000000000
--- a/src/mame/comad/galspnbl_v.cpp
+++ /dev/null
@@ -1,98 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Nicola Salmoria
-#include "emu.h"
-#include "galspnbl.h"
-
-
-void galspnbl_state::galspnbl_palette(palette_device &palette) const
-{
- // initialize 555 RGB lookup
- for (int i = 0; i < 32768; i++)
- palette.set_pen_color(i + 1024, pal5bit(i >> 5), pal5bit(i >> 10), pal5bit(i >> 0));
-}
-
-
-
-void galspnbl_state::draw_background( bitmap_ind16 &bitmap, const rectangle &cliprect )
-{
-// int const screenscroll = 4 - (m_scroll[0] & 0xff);
-
- for (offs_t offs = 0; offs < 0x20000; offs++)
- {
- int const y = offs >> 9;
- int const x = offs & 0x1ff;
-
- bitmap.pix(y, x) = 1024 + (m_bgvideoram[offs] >> 1);
- }
-}
-
-void galspnbl_state::video_start()
-{
- /* allocate bitmaps */
- m_screen->register_screen_bitmap(m_sprite_bitmap);
-}
-
-void galspnbl_state::mix_sprite_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int pri)
-{
- for (int y = cliprect.top(); y <= cliprect.bottom(); y++)
- {
- uint16_t *const dd = &bitmap.pix(y);
- uint16_t const *const sd2 = &m_sprite_bitmap.pix(y);
-
- for (int x = cliprect.left(); x <= cliprect.right(); x++)
- {
- uint16_t sprpixel = (sd2[x]);
- //uint16_t sprpri = (sprpixel >> 8) & 3;
- uint16_t sprpri = (sprpixel >> 9) & 1; // only upper priority bit matters on the bootleg hw?
-
- sprpixel &= 0xff;
-
- if (sprpixel & 0xf)
- {
- if (sprpri == pri)
- dd[x] = sprpixel;
- }
-
- // uint16_t sprbln = (sprpixel >> 10) & 1; // we handle 'blending' from the original as a simple on/off flicker in the bootleg sprite function, I don't think the bootleg hw can blend
- }
- }
-}
-
-uint32_t galspnbl_state::screen_update_galspnbl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
-{
- int offs;
- m_sprite_bitmap.fill(0, cliprect);
- m_sprgen->gaiden_draw_sprites(screen, m_gfxdecode->gfx(1), cliprect, m_spriteram, 0, 0, flip_screen(), m_sprite_bitmap);
-
-
- draw_background(bitmap, cliprect);
-
- mix_sprite_layer(screen, bitmap, cliprect, 0);
-
- for (offs = 0; offs < 0x1000 / 2; offs++)
- {
- int sx, sy, code, attr, color;
-
- code = m_videoram[offs];
- attr = m_colorram[offs];
- color = (attr & 0x00f0) >> 4;
- sx = offs % 64;
- sy = offs / 64;
-
- /* What is this? A priority/half transparency marker? */ // leftover blend flags from original spbactn game
- if (!(attr & 0x0008))
- {
- m_gfxdecode->gfx(0)->transpen(bitmap,cliprect,
- code,
- color,
- 0,0,
-// 16*sx + screenscroll,8*sy,
- 16*sx,8*sy,0);
- }
- }
-
- mix_sprite_layer(screen, bitmap, cliprect, 1);
-
-
- return 0;
-}
diff --git a/src/mame/comad/zerozone.cpp b/src/mame/comad/zerozone.cpp
index 2afcc9556e5..62e61bb169f 100644
--- a/src/mame/comad/zerozone.cpp
+++ b/src/mame/comad/zerozone.cpp
@@ -1,5 +1,6 @@
// license:BSD-3-Clause
-// copyright-holders:Brad Oliver
+// copyright-holders: Brad Oliver
+
/*********************************************************************************
Zero Zone memory map
@@ -31,14 +32,111 @@
#include "emu.h"
-#include "zerozone.h"
#include "cpu/m68000/m68000.h"
+#include "cpu/z80/z80.h"
+#include "machine/gen_latch.h"
#include "sound/okim6295.h"
+
#include "emupal.h"
#include "screen.h"
#include "speaker.h"
+#include "tilemap.h"
+
+
+namespace {
+
+class zerozone_state : public driver_device
+{
+public:
+ zerozone_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_soundlatch(*this, "soundlatch")
+ , m_gfxdecode(*this, "gfxdecode")
+ , m_vram(*this, "videoram")
+ { }
+
+ void zerozone(machine_config &config);
+
+protected:
+ // driver_device overrides
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+ virtual void video_start() override;
+
+private:
+ // devices
+ required_device<cpu_device> m_maincpu;
+ required_device<z80_device> m_audiocpu;
+ required_device<generic_latch_8_device> m_soundlatch;
+ required_device<gfxdecode_device> m_gfxdecode;
+
+ // shared pointers
+ required_shared_ptr<uint16_t> m_vram;
+
+ // video-related
+ uint8_t m_tilebank = 0;
+ tilemap_t *m_tilemap = nullptr;
+
+ void sound_w(uint8_t data);
+ DECLARE_WRITE_LINE_MEMBER(vblank_w);
+
+ void tilemap_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
+ void tilebank_w(uint8_t data);
+
+ uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ void main_map(address_map &map);
+ void sound_map(address_map &map);
+
+ TILE_GET_INFO_MEMBER(get_tile_info);
+};
+
+
+// video
+
+void zerozone_state::tilemap_w(offs_t offset, uint16_t data, uint16_t mem_mask)
+{
+ COMBINE_DATA(&m_vram[offset]);
+ m_tilemap->mark_tile_dirty(offset);
+}
+
+
+void zerozone_state::tilebank_w(uint8_t data)
+{
+ m_tilebank = data & 0x07;
+ m_tilemap->mark_all_dirty();
+}
+
+TILE_GET_INFO_MEMBER(zerozone_state::get_tile_info)
+{
+ int tileno = m_vram[tile_index] & 0x07ff;
+ int const colour = m_vram[tile_index] & 0xf000;
+
+ if (m_vram[tile_index] & 0x0800)
+ tileno += m_tilebank * 0x800;
+ tileinfo.set(0, tileno, colour >> 12, 0);
+}
+
+void zerozone_state::video_start()
+{
+ // I'm not 100% sure it should be opaque, pink title screen looks strange in Las Vegas Girls
+ // but if it's transparent other things look incorrect
+ m_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(zerozone_state::get_tile_info)), TILEMAP_SCAN_COLS, 8, 8, 64, 32);
+}
+
+uint32_t zerozone_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+{
+ m_tilemap->draw(screen, bitmap, cliprect);
+ return 0;
+}
+
+
+
+// machine
void zerozone_state::sound_w(uint8_t data)
{
@@ -141,20 +239,8 @@ static INPUT_PORTS_START( zerozone )
INPUT_PORTS_END
-static const gfx_layout charlayout =
-{
- 8,8, // 8*8 characters
- RGN_FRAC(1,1), // 4096 characters
- 4, // 4 bits per pixel
- { 0, 1, 2, 3 },
- { 0, 4, 8+0, 8+4, 16+0, 16+4, 24+0, 24+4 },
- { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 },
- 32*8 // every sprite takes 32 consecutive bytes
-};
-
-
static GFXDECODE_START( gfx_zerozone )
- GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 256 ) // sprites & playfield
+ GFXDECODE_ENTRY( "gfx", 0, gfx_8x8x4_packed_msb, 0, 256 ) // sprites & playfield
GFXDECODE_END
@@ -205,7 +291,7 @@ void zerozone_state::zerozone(machine_config &config)
GENERIC_LATCH_8(config, m_soundlatch);
- okim6295_device &oki(OKIM6295(config, "oki", 1056000, okim6295_device::PIN7_HIGH)); // clock frequency & pin 7 not verified
+ okim6295_device &oki(OKIM6295(config, "oki", 1'056'000, okim6295_device::PIN7_HIGH)); // clock frequency & pin 7 not verified
oki.add_route(ALL_OUTPUTS, "mono", 1.0);
}
@@ -218,14 +304,14 @@ void zerozone_state::zerozone(machine_config &config)
***************************************************************************/
ROM_START( zerozone ) // PCB 'COMAD MADE IN KOREA 93 EDIT00', sticker 'COMAD-078'
- ROM_REGION( 0x20000, "maincpu", 0 ) // 128k for 68000 code
+ ROM_REGION( 0x20000, "maincpu", 0 ) // 68000
ROM_LOAD16_BYTE( "zz-4.rom", 0x0000, 0x10000, CRC(83718b9b) SHA1(b3fc6da5816142b9c92a7b8615eb5bcb2c78ea46) )
ROM_LOAD16_BYTE( "zz-5.rom", 0x0001, 0x10000, CRC(18557f41) SHA1(6ef908732b7775c1ea2b33f799635075db5756de) )
ROM_REGION( 0x10000, "audiocpu", 0 )
ROM_LOAD( "zz-1.rom", 0x00000, 0x08000, CRC(223ccce5) SHA1(3aa25ca914960b929dc853d07a958ed874e42fee) )
- ROM_REGION( 0x080000, "gfx1", 0 )
+ ROM_REGION( 0x080000, "gfx", 0 )
ROM_LOAD( "zz-6.rom", 0x00000, 0x80000, CRC(c8b906b9) SHA1(1775d69df6397d6772b20c65751d44556d76c033) )
ROM_REGION( 0x40000, "oki", 0 ) // ADPCM samples
@@ -234,14 +320,14 @@ ROM_START( zerozone ) // PCB 'COMAD MADE IN KOREA 93 EDIT00', sticker 'COMAD-078
ROM_END
ROM_START( lvgirl94 ) // PCB 'COMAD MADE IN KOREA 93 EDIT00', sticker 'COMAD-078'
- ROM_REGION( 0x20000, "maincpu", 0 ) // 128k for 68000 code
+ ROM_REGION( 0x20000, "maincpu", 0 ) // 68000
ROM_LOAD16_BYTE( "rom4", 0x0000, 0x10000, CRC(c4fb449e) SHA1(dd1c567ba2cf951267dd622e2e9af265e742f246) )
ROM_LOAD16_BYTE( "rom5", 0x0001, 0x10000, CRC(5d446a1a) SHA1(2d7ea25e5b86e7cf4eb7f10daa1eaaaed6830a53) )
- ROM_REGION( 0x080000, "gfx1", 0 )
+ ROM_REGION( 0x080000, "gfx", 0 )
ROM_LOAD( "rom6", 0x00000, 0x40000, CRC(eeeb94ba) SHA1(9da09312c090ef2d40f596247d9a7decf3724e54) )
- // sound roms are the same as zerozone
+ // sound ROMs are the same as zerozone
ROM_REGION( 0x10000, "audiocpu", 0 )
ROM_LOAD( "rom1", 0x00000, 0x08000, CRC(223ccce5) SHA1(3aa25ca914960b929dc853d07a958ed874e42fee) )
@@ -250,6 +336,8 @@ ROM_START( lvgirl94 ) // PCB 'COMAD MADE IN KOREA 93 EDIT00', sticker 'COMAD-078
ROM_LOAD( "rom3", 0x20000, 0x20000, CRC(e348ff5e) SHA1(6d2755d9b31366f4c2ddd296790234deb8f821c8) )
ROM_END
+} // anonymous namespace
+
GAME( 1993, zerozone, 0, zerozone, zerozone, zerozone_state, empty_init, ROT0, "Comad", "Zero Zone", MACHINE_SUPPORTS_SAVE )
GAME( 1994, lvgirl94, 0, zerozone, zerozone, zerozone_state, empty_init, ROT0, "Comad", "Las Vegas Girl (Girl '94)", MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/comad/zerozone.h b/src/mame/comad/zerozone.h
deleted file mode 100644
index 104833f37d2..00000000000
--- a/src/mame/comad/zerozone.h
+++ /dev/null
@@ -1,69 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Brad Oliver
-/*************************************************************************
-
- Zero Zone
-
-*************************************************************************/
-#ifndef MAME_INCLUDES_ZEROZONE_H
-#define MAME_INCLUDES_ZEROZONE_H
-
-#pragma once
-
-#include "machine/gen_latch.h"
-#include "cpu/z80/z80.h"
-#include "tilemap.h"
-
-class zerozone_state : public driver_device
-{
-public:
- zerozone_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_soundlatch(*this, "soundlatch")
- , m_vram(*this, "videoram")
- , m_gfxdecode(*this, "gfxdecode")
- { }
-
- void zerozone(machine_config &config);
-
-protected:
- // driver_device overrides
- virtual void machine_start() override;
- virtual void machine_reset() override;
- virtual void video_start() override;
-
-private:
- // in drivers/zerozone.cpp
- void sound_w(uint8_t data);
- DECLARE_WRITE_LINE_MEMBER(vblank_w);
-
- // in video/zerozone.cpp
- void tilemap_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
- void tilebank_w(uint8_t data);
-
- // devices
- required_device<cpu_device> m_maincpu;
- required_device<z80_device> m_audiocpu;
- required_device<generic_latch_8_device> m_soundlatch;
-
- // shared pointers
- required_shared_ptr<uint16_t> m_vram;
- // currently this driver uses generic palette handling
-
- required_device<gfxdecode_device> m_gfxdecode;
-
- // video-related
- uint8_t m_tilebank = 0;
- tilemap_t *m_zz_tilemap = nullptr;
-
- uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
-
- void main_map(address_map &map);
- void sound_map(address_map &map);
-
- TILE_GET_INFO_MEMBER(get_zerozone_tile_info);
-};
-
-#endif // MAME_INCLUDES_ZEROZONE_H
diff --git a/src/mame/comad/zerozone_v.cpp b/src/mame/comad/zerozone_v.cpp
deleted file mode 100644
index 3ca44d55b5c..00000000000
--- a/src/mame/comad/zerozone_v.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Brad Oliver
-/***************************************************************************
-
- video/zerozone.cpp
-
-***************************************************************************/
-
-#include "emu.h"
-#include "zerozone.h"
-
-void zerozone_state::tilemap_w(offs_t offset, uint16_t data, uint16_t mem_mask)
-{
- COMBINE_DATA(&m_vram[offset]);
- m_zz_tilemap->mark_tile_dirty(offset);
-}
-
-
-void zerozone_state::tilebank_w(uint8_t data)
-{
-// popmessage ("Data %04x",data);
- m_tilebank = data & 0x07;
- m_zz_tilemap->mark_all_dirty();
-}
-
-TILE_GET_INFO_MEMBER(zerozone_state::get_zerozone_tile_info)
-{
- int tileno = m_vram[tile_index] & 0x07ff;
- int colour = m_vram[tile_index] & 0xf000;
-
- if (m_vram[tile_index] & 0x0800)
- tileno += m_tilebank * 0x800;
-
- tileinfo.set(0, tileno, colour >> 12, 0);
-}
-
-void zerozone_state::video_start()
-{
- // I'm not 100% sure it should be opaque, pink title screen looks strange in Las Vegas Girls
- // but if it's transparent other things look incorrect
- m_zz_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(zerozone_state::get_zerozone_tile_info)), TILEMAP_SCAN_COLS, 8, 8, 64, 32);
-}
-
-uint32_t zerozone_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
-{
- m_zz_tilemap->draw(screen, bitmap, cliprect);
- return 0;
-}
diff --git a/src/mame/igs/goldstar.cpp b/src/mame/igs/goldstar.cpp
index 3249031891d..dc457c6fcbf 100644
--- a/src/mame/igs/goldstar.cpp
+++ b/src/mame/igs/goldstar.cpp
@@ -11870,11 +11870,14 @@ ROM_START( cmfb55 ) // uses same GFX as pkrmast
ROM_REGION( 0x10000, "user1", 0 )
ROM_LOAD( "c.m.89-005-8.j6", 0x0000, 0x10000, CRC(e92443d3) SHA1(4b6ca4521841610054165f085ae05510e77af191) )
- ROM_REGION( 0x10000, "proms", 0 )
+ ROM_REGION( 0x10000, "palette_rom", 0 )
ROM_LOAD( "cherry master n-5.n5", 0x00000, 0x10000, CRC(2ae7f151) SHA1(b41ec09fddf51895dfcca461d9b0ddb1cdb72506) ) // this uses a big ROM containing the data for the usual PROMs
+ ROM_REGION( 0x200, "proms", ROMREGION_ERASE00 )
+ // filled at init from the "palette_rom" region
+
ROM_REGION( 0x100, "proms2", 0 )
- ROM_COPY( "proms", 0x1000, 0x0000, 0x0100 )
+ ROM_COPY( "palette_rom", 0x1000, 0x0000, 0x0100 )
ROM_END
// the program roms on these are scrambled
@@ -18929,6 +18932,21 @@ void cmaster_state::init_ll3() // verified with ICE dump
}
}
+void cmaster_state::init_cmfb55()
+{
+ // palette is in a ROM with different format, adapt to what MAME expects
+ uint8_t *palette_rom = memregion("palette_rom")->base();
+ uint8_t *proms = memregion("proms")->base();
+
+ for (int i = 0x000; i < 0x100; i++)
+ {
+ proms[i] = palette_rom[i] & 0x0f;
+ proms[i + 0x100] = (palette_rom[i] & 0xf0) >> 4;
+ }
+
+ m_palette->update();
+}
+
void goldstar_state::init_cmast91()
{
uint8_t *rom = memregion("maincpu")->base();
@@ -19920,7 +19938,7 @@ GAMEL( 1991, cmasterk, cmaster, cm, cmasterb, cmaster_state, init_cmv4,
GAMEL( 199?, super7, cmaster, super7, cmaster, cmaster_state, init_super7, ROT0, "bootleg", "Super Seven", MACHINE_NOT_WORKING, layout_cmasterb ) // bad palette, no reels, decryption might be missing something, too
GAME ( 199?, wcat3a, wcat3, chryangl, cmaster, cmaster_state, init_wcat3a, ROT0, "E.A.I.", "Wild Cat 3 (CMV4 hardware)", MACHINE_NOT_WORKING ) // does not boot. Wrong decryption, wrong machine or wrong what?
GAMEL( 199?, ll3, cmaster, cm, cmasterb, cmaster_state, init_ll3, ROT0, "bootleg", "Lucky Line III", MACHINE_NOT_WORKING, layout_cmasterb ) // not looked at yet
-GAMEL( 199?, cmfb55, cmaster, cmfb55, cmaster, cmaster_state, empty_init, ROT0, "bootleg", "Cherry Master (bootleg, Game FB55 Ver.2)", MACHINE_NOT_WORKING, layout_cmv4 ) // wrong palette, inputs not done
+GAMEL( 199?, cmfb55, cmaster, cmfb55, cmaster, cmaster_state, init_cmfb55, ROT0, "bootleg", "Cherry Master (bootleg, Game FB55 Ver.2)", MACHINE_NOT_WORKING, layout_cmv4 ) // inputs not done
GAMEL( 1991, srmagic, cmv4, cm, cmv4, cmaster_state, empty_init, ROT0, "bootleg", "Super Real Magic (V6.3)", MACHINE_NOT_WORKING, layout_cmv4 ) // needs correct I/O
GAMEL( 1991, tonypok, 0, cm, tonypok, cmaster_state, init_tonypok, ROT0, "Corsica", "Poker Master (Tony-Poker V3.A, hack?)", 0 , layout_tonypok )
diff --git a/src/mame/igs/goldstar.h b/src/mame/igs/goldstar.h
index 7c065f9ef9e..ea134c96af5 100644
--- a/src/mame/igs/goldstar.h
+++ b/src/mame/igs/goldstar.h
@@ -195,6 +195,7 @@ public:
void init_cmtetrisc();
void init_cmtetrisd();
void init_ll3();
+ void init_cmfb55();
uint32_t screen_update_amcoe1a(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
diff --git a/src/mame/nintendo/playch10.cpp b/src/mame/nintendo/playch10.cpp
index adeb926e868..366fd811be6 100644
--- a/src/mame/nintendo/playch10.cpp
+++ b/src/mame/nintendo/playch10.cpp
@@ -137,7 +137,7 @@ However, this is effective ONLY if 7 other DSWB (I-O) are OFF !
I add the 32 combinations for coinage.
As I don't know what is the default value for timer speed, and I don't want to write
-the 64 combinaisons, I only put some values ... Feel free to add the other ones ...
+the 64 combinations, I only put some values ... Feel free to add the other ones ...
DSW A DSW B
HGFEDCBA PONMLKJI coin A coin B
diff --git a/src/mame/snk/snk6502.cpp b/src/mame/snk/snk6502.cpp
index 11e31496647..e9fb4625dab 100644
--- a/src/mame/snk/snk6502.cpp
+++ b/src/mame/snk/snk6502.cpp
@@ -144,7 +144,7 @@ Stephh's notes (based on the games M6502 code and some tests) :
ON OFF OFF 1C_2C
ON ON OFF 1C_6C
- The 3 other combinaisons give 1C_1C
+ The 3 other combinations give 1C_1C
- From the manual, it says that DSW bit 6 determines the cost of a game :
* bit 6 = 0 : "25c / game"
* bit 6 = 1 : "50c / game"
diff --git a/src/mame/taito/tnzs.cpp b/src/mame/taito/tnzs.cpp
index 3824255982e..27d47bf00fa 100644
--- a/src/mame/taito/tnzs.cpp
+++ b/src/mame/taito/tnzs.cpp
@@ -448,7 +448,7 @@ Stephh's notes (based on the games Z80 code and some tests) :
* ......1. : No
Notice screen displays "Korea" instead of "Japan".
- Copyright relies on bits 2 and 3 of the region (code at 0x276d),
- but table at 0x2781 is the same for any combinaison :
+ but table at 0x2781 is the same for any combination :
* ....??.. : "NICS CO. LTD. 1992" / "ALL RIGHTS RESERVED"