summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/progolf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/progolf.c')
-rw-r--r--src/mame/drivers/progolf.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/mame/drivers/progolf.c b/src/mame/drivers/progolf.c
index f07e21766e1..c1cd8cd099d 100644
--- a/src/mame/drivers/progolf.c
+++ b/src/mame/drivers/progolf.c
@@ -89,7 +89,7 @@ public:
DECLARE_WRITE8_MEMBER(progolf_videoram_w);
DECLARE_INPUT_CHANGED_MEMBER(coin_inserted);
virtual void video_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(progolf);
UINT32 screen_update_progolf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
@@ -125,9 +125,9 @@ UINT32 progolf_state::screen_update_progolf(screen_device &screen, bitmap_ind16
{
int tile = videoram[count];
- m_gfxdecode->gfx(0)->opaque(bitmap,cliprect,tile,1,0,0,(256-x*8)+scroll,y*8);
+ m_gfxdecode->gfx(0)->opaque(m_palette,bitmap,cliprect,tile,1,0,0,(256-x*8)+scroll,y*8);
/* wrap-around */
- m_gfxdecode->gfx(0)->opaque(bitmap,cliprect,tile,1,0,0,(256-x*8)+scroll-1024,y*8);
+ m_gfxdecode->gfx(0)->opaque(m_palette,bitmap,cliprect,tile,1,0,0,(256-x*8)+scroll-1024,y*8);
count++;
}
@@ -149,7 +149,7 @@ UINT32 progolf_state::screen_update_progolf(screen_device &screen, bitmap_ind16
color = m_fg_fb[(xi+yi*8)+count*0x40];
if(color != 0 && cliprect.contains(x+yi, 256-y+xi))
- bitmap.pix16(x+yi, 256-y+xi) = machine().pens[(color & 0x7)];
+ bitmap.pix16(x+yi, 256-y+xi) = m_palette->pen((color & 0x7));
}
}
@@ -392,12 +392,12 @@ static MC6845_INTERFACE( mc6845_intf )
};
-void progolf_state::palette_init()
+PALETTE_INIT_MEMBER(progolf_state, progolf)
{
const UINT8 *color_prom = memregion("proms")->base();
int i;
- for (i = 0;i < machine().total_colors();i++)
+ for (i = 0;i < m_palette->entries();i++)
{
int bit0,bit1,bit2,r,g,b;
@@ -417,7 +417,7 @@ void progolf_state::palette_init()
bit2 = (color_prom[i] >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- palette_set_color(machine(),i,rgb_t(r,g,b));
+ m_palette->set_pen_color(i,rgb_t(r,g,b));
}
}
@@ -440,7 +440,8 @@ static MACHINE_CONFIG_START( progolf, progolf_state )
MCFG_SCREEN_UPDATE_DRIVER(progolf_state, screen_update_progolf)
MCFG_GFXDECODE_ADD("gfxdecode", progolf)
- MCFG_PALETTE_LENGTH(32*3)
+ MCFG_PALETTE_ADD("palette", 32*3)
+ MCFG_PALETTE_INIT_OWNER(progolf_state, progolf)
MCFG_MC6845_ADD("crtc", MC6845, "screen", 3000000/4, mc6845_intf) /* hand tuned to get ~57 fps */