summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/panicr.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/panicr.c')
-rw-r--r--src/mame/drivers/panicr.c31
1 files changed, 13 insertions, 18 deletions
diff --git a/src/mame/drivers/panicr.c b/src/mame/drivers/panicr.c
index 5c8fbb9031e..f607defcb7e 100644
--- a/src/mame/drivers/panicr.c
+++ b/src/mame/drivers/panicr.c
@@ -108,7 +108,7 @@ public:
TILE_GET_INFO_MEMBER(get_txttile_info);
virtual void video_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(panicr);
UINT32 screen_update_panicr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(panicr_scanline);
void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect );
@@ -131,14 +131,11 @@ public:
***************************************************************************/
-void panicr_state::palette_init()
+PALETTE_INIT_MEMBER(panicr_state, panicr)
{
const UINT8 *color_prom = memregion("proms")->base();
int i;
- /* allocate the colortable */
- machine().colortable = colortable_alloc(machine(), 0x100);
-
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
{
@@ -146,7 +143,7 @@ void panicr_state::palette_init()
int g = pal4bit(color_prom[i + 0x100]);
int b = pal4bit(color_prom[i + 0x200]);
- colortable_palette_set_color(machine().colortable, i, rgb_t(r, g, b));
+ palette.set_indirect_color(i, rgb_t(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -162,7 +159,7 @@ void panicr_state::palette_init()
else
ctabentry = (color_prom[i] & 0x3f) | 0x80;
- colortable_entry_set_value(machine().colortable, i, ctabentry);
+ palette.set_pen_indirect(i, ctabentry);
}
// tile lookup table
@@ -170,9 +167,8 @@ void panicr_state::palette_init()
{
UINT8 ctabentry = (color_prom[i+0x100] & 0x3f) | 0x00;
- colortable_entry_set_value(machine().colortable, ((i&0x0f) + ((i&0xf0)<<1)) +0x200, ctabentry);
- colortable_entry_set_value(machine().colortable, ((i&0x0f) + ((i&0xf0)<<1)) +0x210, ctabentry);
-
+ palette.set_pen_indirect(((i&0x0f) + ((i&0xf0)<<1)) +0x200, ctabentry);
+ palette.set_pen_indirect(((i&0x0f) + ((i&0xf0)<<1)) +0x210, ctabentry);
}
// sprite lookup table
@@ -185,8 +181,7 @@ void panicr_state::palette_init()
else
ctabentry = (color_prom[i+0x200] & 0x3f) | 0x40;
- colortable_entry_set_value(machine().colortable, i+0x100, ctabentry);
-
+ palette.set_pen_indirect(i+0x100, ctabentry);
}
}
@@ -246,7 +241,7 @@ void panicr_state::video_start()
m_infotilemap_2 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(panicr_state::get_infotile_info_2),this),TILEMAP_SCAN_ROWS,16,16,1024,16 );
m_txttilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(panicr_state::get_txttile_info),this),TILEMAP_SCAN_ROWS,8,8,32,32 );
- colortable_configure_tilemap_groups(machine().colortable, m_txttilemap, m_gfxdecode->gfx(0), 0);
+ m_palette->configure_tilemap_groups(*m_txttilemap, *m_gfxdecode->gfx(0), 0);
}
void panicr_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect )
@@ -279,10 +274,10 @@ void panicr_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect )
color = spriteram[offs+1] & 0x0f;
sprite = spriteram[offs+0] | (*m_spritebank << 8);
- m_gfxdecode->gfx(2)->transmask(bitmap,cliprect,
+ m_gfxdecode->gfx(2)->transmask(m_palette,bitmap,cliprect,
sprite,
color,flipx,flipy,x,y,
- colortable_get_transpen_mask(machine().colortable, m_gfxdecode->gfx(2), color, 0));
+ m_palette->transpen_mask(*m_gfxdecode->gfx(2), color, 0));
}
}
@@ -295,7 +290,7 @@ UINT32 panicr_state::screen_update_panicr(screen_device &screen, bitmap_ind16 &b
// m_infotilemap_2->draw(screen, *m_temprender, m_tempbitmap_clip, 0,0);
- bitmap.fill(get_black_pen(machine()), cliprect);
+ bitmap.fill(m_palette->black_pen(), cliprect);
m_txttilemap->mark_all_dirty();
@@ -627,8 +622,8 @@ static MACHINE_CONFIG_START( panicr, panicr_state )
MCFG_SCREEN_UPDATE_DRIVER(panicr_state, screen_update_panicr)
MCFG_GFXDECODE_ADD("gfxdecode", panicr)
- MCFG_PALETTE_LENGTH(256*4)
-
+ MCFG_PALETTE_ADD("palette", 256*4)
+ MCFG_PALETTE_INIT_OWNER(panicr_state, panicr)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")