summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/video/ironhors.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/video/ironhors.c')
-rw-r--r--src/mame/video/ironhors.c33
1 files changed, 15 insertions, 18 deletions
diff --git a/src/mame/video/ironhors.c b/src/mame/video/ironhors.c
index d7c30004644..afcca391380 100644
--- a/src/mame/video/ironhors.c
+++ b/src/mame/video/ironhors.c
@@ -16,7 +16,7 @@
***************************************************************************/
-void ironhors_state::palette_init()
+PALETTE_INIT_MEMBER(ironhors_state, ironhors)
{
const UINT8 *color_prom = memregion("proms")->base();
static const int resistances[4] = { 2000, 1000, 470, 220 };
@@ -29,9 +29,6 @@ void ironhors_state::palette_init()
4, resistances, gweights, 1000, 0,
4, resistances, bweights, 1000, 0);
- /* allocate the colortable */
- machine().colortable = colortable_alloc(machine(), 0x100);
-
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
{
@@ -59,7 +56,7 @@ void ironhors_state::palette_init()
bit3 = (color_prom[i + 0x200] >> 3) & 0x01;
b = combine_4_weights(bweights, bit0, bit1, bit2, bit3);
- 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,*/
@@ -74,7 +71,7 @@ void ironhors_state::palette_init()
for (j = 0; j < 8; j++)
{
UINT8 ctabentry = (j << 5) | ((~i & 0x100) >> 4) | (color_prom[i] & 0x0f);
- colortable_entry_set_value(machine().colortable, ((i & 0x100) << 3) | (j << 8) | (i & 0xff), ctabentry);
+ palette.set_pen_indirect(((i & 0x100) << 3) | (j << 8) | (i & 0xff), ctabentry);
}
}
}
@@ -181,7 +178,7 @@ void ironhors_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &clipre
switch (sr[offs + 4] & 0x0c)
{
case 0x00: /* 16x16 */
- m_gfxdecode->gfx(1)->transpen(bitmap,cliprect,
+ m_gfxdecode->gfx(1)->transpen(m_palette,bitmap,cliprect,
code/4,
color,
flipx,flipy,
@@ -192,12 +189,12 @@ void ironhors_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &clipre
{
if (flip_screen()) sy += 8; // this fixes the train wheels' position
- m_gfxdecode->gfx(2)->transpen(bitmap,cliprect,
+ m_gfxdecode->gfx(2)->transpen(m_palette,bitmap,cliprect,
code & ~1,
color,
flipx,flipy,
flipx?sx+8:sx,sy,0);
- m_gfxdecode->gfx(2)->transpen(bitmap,cliprect,
+ m_gfxdecode->gfx(2)->transpen(m_palette,bitmap,cliprect,
code | 1,
color,
flipx,flipy,
@@ -207,12 +204,12 @@ void ironhors_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &clipre
case 0x08: /* 8x16 */
{
- m_gfxdecode->gfx(2)->transpen(bitmap,cliprect,
+ m_gfxdecode->gfx(2)->transpen(m_palette,bitmap,cliprect,
code & ~2,
color,
flipx,flipy,
sx,flipy?sy+8:sy,0);
- m_gfxdecode->gfx(2)->transpen(bitmap,cliprect,
+ m_gfxdecode->gfx(2)->transpen(m_palette,bitmap,cliprect,
code | 2,
color,
flipx,flipy,
@@ -222,7 +219,7 @@ void ironhors_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &clipre
case 0x0c: /* 8x8 */
{
- m_gfxdecode->gfx(2)->transpen(bitmap,cliprect,
+ m_gfxdecode->gfx(2)->transpen(m_palette,bitmap,cliprect,
code,
color,
flipx,flipy,
@@ -290,7 +287,7 @@ void ironhors_state::farwest_draw_sprites( bitmap_ind16 &bitmap, const rectangle
switch (sr[offs + 3] & 0x0c)
{
case 0x00: /* 16x16 */
- m_gfxdecode->gfx(1)->transpen(bitmap,cliprect,
+ m_gfxdecode->gfx(1)->transpen(m_palette,bitmap,cliprect,
code/4,
color,
flipx,flipy,
@@ -301,12 +298,12 @@ void ironhors_state::farwest_draw_sprites( bitmap_ind16 &bitmap, const rectangle
{
if (flip_screen()) sy += 8; // this fixes the train wheels' position
- m_gfxdecode->gfx(2)->transpen(bitmap,cliprect,
+ m_gfxdecode->gfx(2)->transpen(m_palette,bitmap,cliprect,
code & ~1,
color,
flipx,flipy,
flipx?sx+8:sx,sy,0);
- m_gfxdecode->gfx(2)->transpen(bitmap,cliprect,
+ m_gfxdecode->gfx(2)->transpen(m_palette,bitmap,cliprect,
code | 1,
color,
flipx,flipy,
@@ -316,12 +313,12 @@ void ironhors_state::farwest_draw_sprites( bitmap_ind16 &bitmap, const rectangle
case 0x08: /* 8x16 */
{
- m_gfxdecode->gfx(2)->transpen(bitmap,cliprect,
+ m_gfxdecode->gfx(2)->transpen(m_palette,bitmap,cliprect,
code & ~2,
color,
flipx,flipy,
sx,flipy?sy+8:sy,0);
- m_gfxdecode->gfx(2)->transpen(bitmap,cliprect,
+ m_gfxdecode->gfx(2)->transpen(m_palette,bitmap,cliprect,
code | 2,
color,
flipx,flipy,
@@ -331,7 +328,7 @@ void ironhors_state::farwest_draw_sprites( bitmap_ind16 &bitmap, const rectangle
case 0x0c: /* 8x8 */
{
- m_gfxdecode->gfx(2)->transpen(bitmap,cliprect,
+ m_gfxdecode->gfx(2)->transpen(m_palette,bitmap,cliprect,
code,
color,
flipx,flipy,