summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/video/poolshrk.cpp
blob: d87c7028eb3bdc4ad1071123e76cf0c1a91e41d7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// license:BSD-3-Clause
// copyright-holders:Stefan Jokisch
/***************************************************************************

Atari Poolshark video emulation

***************************************************************************/

#include "emu.h"
#include "includes/poolshrk.h"




TILE_GET_INFO_MEMBER(poolshrk_state::get_tile_info)
{
	tileinfo.set(1, m_playfield_ram[tile_index] & 0x3f, 0, 0);
}


void poolshrk_state::video_start()
{
	m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(poolshrk_state::get_tile_info)), TILEMAP_SCAN_ROWS,
			8, 8, 32, 32);

	m_bg_tilemap->set_transparent_pen(0);
}


uint32_t poolshrk_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	m_bg_tilemap->mark_all_dirty();

	bitmap.fill(0, cliprect);

	/* draw sprites */

	for (int i = 0; i < 16; i++)
	{
		int hpos = m_hpos_ram[i];
		int vpos = m_vpos_ram[i];

		m_gfxdecode->gfx(0)->transpen(bitmap,cliprect, i, (i == 0) ? 0 : 1, 0, 0,
			248 - hpos, vpos - 15, 0);
	}

	/* draw playfield */

	m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
	return 0;
}