summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/video/pingpong.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/video/pingpong.c')
-rw-r--r--src/mame/video/pingpong.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/mame/video/pingpong.c b/src/mame/video/pingpong.c
index 4a5a0397d6a..977168e7ae7 100644
--- a/src/mame/video/pingpong.c
+++ b/src/mame/video/pingpong.c
@@ -30,13 +30,13 @@
bit 0 -- 1 kohm resistor -- RED
***************************************************************************/
-PALETTE_INIT( pingpong )
+void pingpong_state::palette_init()
{
- const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
int i;
/* allocate the colortable */
- machine.colortable = colortable_alloc(machine, 0x20);
+ machine().colortable = colortable_alloc(machine(), 0x20);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -62,7 +62,7 @@ PALETTE_INIT( pingpong )
bit2 = (color_prom[i] >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -72,14 +72,14 @@ PALETTE_INIT( pingpong )
for (i = 0; i < 0x100; i++)
{
UINT8 ctabentry = (color_prom[i] & 0x0f) | 0x10;
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
/* sprites */
for (i = 0x100; i < 0x200; i++)
{
UINT8 ctabentry = BITSWAP8(color_prom[i],7,6,5,4,0,1,2,3);
- colortable_entry_set_value(machine.colortable, i, ctabentry);
+ colortable_entry_set_value(machine().colortable, i, ctabentry);
}
}
@@ -105,10 +105,9 @@ TILE_GET_INFO_MEMBER(pingpong_state::get_bg_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, flags);
}
-VIDEO_START( pingpong )
+void pingpong_state::video_start()
{
- pingpong_state *state = machine.driver_data<pingpong_state>();
- state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(pingpong_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(pingpong_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
}
static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )