diff options
Diffstat (limited to 'src/mame/video/champbas.c')
-rw-r--r-- | src/mame/video/champbas.c | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/src/mame/video/champbas.c b/src/mame/video/champbas.c index 78f568a912c..16233d923e8 100644 --- a/src/mame/video/champbas.c +++ b/src/mame/video/champbas.c @@ -34,9 +34,6 @@ PALETTE_INIT_MEMBER(champbas_state,champbas) 3, &resistances_rg[0], gweights, 0, 0, 2, &resistances_b[0], bweights, 0, 0); - /* allocate the colortable */ - machine().colortable = colortable_alloc(machine(), 0x20); - /* create a lookup table for the palette */ for (i = 0; i < 0x20; i++) { @@ -60,7 +57,7 @@ PALETTE_INIT_MEMBER(champbas_state,champbas) bit1 = (color_prom[i] >> 7) & 0x01; b = combine_2_weights(bweights, bit0, bit1); - colortable_palette_set_color(machine().colortable, i, rgb_t(r, g, b)); + palette.set_indirect_color(i, rgb_t(r, g, b)); } color_prom += 0x20; @@ -68,7 +65,7 @@ PALETTE_INIT_MEMBER(champbas_state,champbas) for (i = 0; i < 0x200; i++) { UINT8 ctabentry = (color_prom[i & 0xff] & 0x0f) | ((i & 0x100) >> 4); - colortable_entry_set_value(machine().colortable, i, ctabentry); + palette.set_pen_indirect(i, ctabentry); } } @@ -78,9 +75,6 @@ PALETTE_INIT_MEMBER(champbas_state,exctsccr) const UINT8 *color_prom = memregion("proms")->base(); int i; - /* allocate the colortable */ - machine().colortable = colortable_alloc(machine(), 0x20); - /* create a lookup table for the palette */ for (i = 0; i < 0x20; i++) { @@ -105,7 +99,7 @@ PALETTE_INIT_MEMBER(champbas_state,exctsccr) bit2 = (color_prom[i] >> 7) & 0x01; b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - 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 */ @@ -116,14 +110,14 @@ PALETTE_INIT_MEMBER(champbas_state,exctsccr) { int swapped_i = BITSWAP8(i, 2, 7, 6, 5, 4, 3, 1, 0); UINT8 ctabentry = (color_prom[swapped_i] & 0x0f) | ((i & 0x80) >> 3); - colortable_entry_set_value(machine().colortable, i, ctabentry); + palette.set_pen_indirect(i, ctabentry); } /* sprites (4bpp) */ for (i = 0; i < 0x100; i++) { UINT8 ctabentry = (color_prom[0x100 + i] & 0x0f) | 0x10; - colortable_entry_set_value(machine().colortable, i + 0x100, ctabentry); + palette.set_pen_indirect(i + 0x100, ctabentry); } } @@ -203,19 +197,19 @@ void champbas_state::champbas_draw_sprites( bitmap_ind16 &bitmap, const rectangl int sy = 255 - m_spriteram_2[offs]; - gfx->transmask(bitmap,cliprect, + gfx->transmask(m_palette,bitmap,cliprect, code, color, flipx, flipy, sx, sy, - colortable_get_transpen_mask(machine().colortable, gfx, color, 0)); + m_palette->transpen_mask(*gfx, color, 0)); // wraparound - gfx->transmask(bitmap,cliprect, + gfx->transmask(m_palette,bitmap,cliprect, code, color, flipx, flipy, sx + 256, sy, - colortable_get_transpen_mask(machine().colortable, gfx, color, 0)); + m_palette->transpen_mask(*gfx, color, 0)); } } @@ -241,7 +235,7 @@ void champbas_state::exctsccr_draw_sprites( bitmap_ind16 &bitmap, const rectangl bank = ((obj1[offs + 1] >> 4) & 1); - m_gfxdecode->gfx(1)->transpen(bitmap,cliprect, + m_gfxdecode->gfx(1)->transpen(m_palette,bitmap,cliprect, code + (bank << 6), color, flipx, flipy, @@ -264,12 +258,12 @@ void champbas_state::exctsccr_draw_sprites( bitmap_ind16 &bitmap, const rectangl color = (obj1[offs + 1]) & 0x0f; - m_gfxdecode->gfx(2)->transmask(bitmap,cliprect, + m_gfxdecode->gfx(2)->transmask(m_palette,bitmap,cliprect, code, color, flipx, flipy, sx,sy, - colortable_get_transpen_mask(machine().colortable, m_gfxdecode->gfx(2), color, 0x10)); + m_palette->transpen_mask(*m_gfxdecode->gfx(2), color, 0x10)); } } |