summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/mgames.cpp
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2019-03-26 11:13:37 +1100
committer Vas Crabb <vas@vastheman.com>2019-03-26 11:13:37 +1100
commit97b67170277437131adf6ed4d60139c172529e4f (patch)
tree7a5cbf608f191075f1612b1af15832c206a3fe2d /src/mame/drivers/mgames.cpp
parentb380514764cf857469bae61c11143a19f79a74c5 (diff)
(nw) Clean up the mess on master
This effectively reverts b380514764cf857469bae61c11143a19f79a74c5 and c24473ddff715ecec2e258a6eb38960cf8c8e98e, restoring the state at 598cd5227223c3b04ca31f0dbc1981256d9ea3ff. Before pushing, please check that what you're about to push is sane. Check your local commit log and ensure there isn't anything out-of-place before pushing to mainline. When things like this happen, it wastes everyone's time. I really don't need this in a week when real work™ is busting my balls and I'm behind where I want to be with preparing for MAME release.
Diffstat (limited to 'src/mame/drivers/mgames.cpp')
-rw-r--r--src/mame/drivers/mgames.cpp96
1 files changed, 49 insertions, 47 deletions
diff --git a/src/mame/drivers/mgames.cpp b/src/mame/drivers/mgames.cpp
index f171c7ea4ce..82e504689fc 100644
--- a/src/mame/drivers/mgames.cpp
+++ b/src/mame/drivers/mgames.cpp
@@ -23,7 +23,7 @@
FOR AMUSEMENT ONLY.
The ingenious Match Games offers something for everyone. Four captivating themes
- with brillant graphics, challenging play action, an enticing bonus feature and a
+ with brilliant graphics, challenging play action, an enticing bonus feature and a
host of options to tailor the game to any location.
Match Games is today's perfect alternative in adult video skill games...
@@ -36,19 +36,19 @@
and number combinations. Play appeal stays high as new characters are introduced.
"Wild" characters liven the action even more and build special bonus points, co-
- llected on a 5-way number match. The appeal is irresistable... Players stay hoo-
+ llected on a 5-way number match. The appeal is irresistible... Players stay hoo-
ked in for lot more action (and more earnings) for you!.
GAME THEMES:
- Match Games aknowledges every scoring combination by displaying its own special
+ Match Games acknowledges every scoring combination by displaying its own special
name keyed to each game theme.
Every time 2 "Wild" characters pop up together, special bonus symbols appear,
increasing bonus by 5 points.
- * "THE WHITE KNIGHT" features knights in armor with colores plumes and wild
+ * "THE WHITE KNIGHT" features knights in armor with colored plumes and wild
'White Knights'.
* "THE FROG POND" stars colorful and humorous frogs perched on top of mushrooms.
@@ -238,6 +238,8 @@ public:
void mgames(machine_config &config);
private:
+ tilemap_t *m_tilemap;
+
DECLARE_READ8_MEMBER(mixport_r);
DECLARE_WRITE8_MEMBER(outport0_w);
DECLARE_WRITE8_MEMBER(outport1_w);
@@ -247,12 +249,14 @@ private:
DECLARE_WRITE8_MEMBER(outport5_w);
DECLARE_WRITE8_MEMBER(outport6_w);
DECLARE_WRITE8_MEMBER(outport7_w);
+
void mgames_palette(palette_device &palette) const;
uint32_t screen_update_mgames(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TILE_GET_INFO_MEMBER(tile_info);
+
void main_map(address_map &map);
- virtual void machine_start() override { m_lamps.resolve(); }
- virtual void video_start() override;
+ virtual void machine_start() override;
uint8_t m_output[8];
required_shared_ptr<uint8_t> m_video;
@@ -263,41 +267,40 @@ private:
output_finder<9> m_lamps;
};
+TILE_GET_INFO_MEMBER( mgames_state::tile_info )
+{
+ uint8_t code = m_video[tile_index];
+ uint8_t color = m_video[tile_index + 0x400] & 0x3f;
-void mgames_state::video_start()
+ SET_TILE_INFO_MEMBER(0, code, color, 0);
+}
+
+void mgames_state::machine_start()
{
+ m_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(mgames_state::tile_info), this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+
+ m_lamps.resolve();
}
uint32_t mgames_state::screen_update_mgames(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- gfx_element *const gfx = m_gfxdecode->gfx(0);
+ m_tilemap->mark_all_dirty();
+ m_tilemap->draw(screen, bitmap, cliprect, 0, 0);
- int count = 0;
- for (int y = 0; y < 32; y++)
- {
- for (int x = 0; x < 32; x++)
- {
- uint16_t const dat = m_video[count];
- uint16_t const col = m_video[count + 0x400] & 0x7f;
- gfx->opaque(bitmap, cliprect, dat, col, 0, 0, x * 16, y * 16);
- count++;
- }
- }
return 0;
}
void mgames_state::mgames_palette(palette_device &palette) const
{
- for (int i = 0; i < 0x100; i++)
+ for (int i = 0; i < 64; i++)
{
- rgb_t color;
-
- if (i & 0x01)
- color = rgb_t(pal2bit((i & 0x6) >> 1), pal2bit((i & 0x18) >> 3), pal2bit((i & 0x60) >> 5));
- else
- color = rgb_t::black();
-
- palette.set_pen_color(i, color);
+ palette.set_indirect_color(i, rgb_t(
+ pal2bit((i >> 0) & 3),
+ pal2bit((i >> 2) & 3),
+ pal2bit((i >> 4) & 3)
+ ));
+ palette.set_pen_indirect(i * 2 + 0, 0); // all tiles black background
+ palette.set_pen_indirect(i * 2 + 1, i);
}
}
@@ -622,47 +625,46 @@ static INPUT_PORTS_START( mgames )
INPUT_PORTS_END
-static const gfx_layout tiles16x16_layout =
+static const gfx_layout gfx_16x16x1 =
{
16,16,
RGN_FRAC(1,1),
1,
{ 0 },
- { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },
- { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16,
- 8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16},
+ { STEP16(0,1) },
+ { STEP16(0,16) },
16*16
};
static GFXDECODE_START( gfx_mgames )
- GFXDECODE_ENTRY( "gfx1", 0, tiles16x16_layout, 0, 0x100 )
+ GFXDECODE_ENTRY( "gfx1", 0, gfx_16x16x1, 0, 64 )
GFXDECODE_END
-MACHINE_CONFIG_START(mgames_state::mgames)
+void mgames_state::mgames(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", Z80,MASTER_CLOCK/6) /* 3 MHz? */
- MCFG_DEVICE_PROGRAM_MAP(main_map)
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", mgames_state, irq0_line_hold)
+ Z80(config, m_maincpu, MASTER_CLOCK/6); /* 3 MHz? */
+ m_maincpu->set_addrmap(AS_PROGRAM, &mgames_state::main_map);
+ m_maincpu->set_vblank_int("screen", FUNC(mgames_state::irq0_line_hold));
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_SIZE(512, 256)
- MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 0, 256-1)
- MCFG_SCREEN_UPDATE_DRIVER(mgames_state, screen_update_mgames)
- MCFG_SCREEN_PALETTE(m_palette)
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(60);
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(0));
+ screen.set_size(512, 256);
+ screen.set_visarea(0, 512-1, 0, 256-1);
+ screen.set_screen_update(FUNC(mgames_state::screen_update_mgames));
+ screen.set_palette(m_palette);
GFXDECODE(config, m_gfxdecode, m_palette, gfx_mgames);
- PALETTE(config, m_palette, FUNC(mgames_state::mgames_palette), 0x200);
+ PALETTE(config, m_palette, FUNC(mgames_state::mgames_palette), 128, 64);
/* sound hardware */
// to do...
-
-MACHINE_CONFIG_END
+}
ROM_START( mgames )