diff options
Diffstat (limited to 'src/mame/drivers/vega.c')
-rw-r--r-- | src/mame/drivers/vega.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/mame/drivers/vega.c b/src/mame/drivers/vega.c index f16957ae4f4..817230ff65d 100644 --- a/src/mame/drivers/vega.c +++ b/src/mame/drivers/vega.c @@ -157,7 +157,7 @@ public: virtual void machine_start(); virtual void machine_reset(); - virtual void palette_init(); + DECLARE_PALETTE_INIT(vega); UINT32 screen_update_vega(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; @@ -481,13 +481,13 @@ INPUT_PORTS_END -void vega_state::palette_init() +PALETTE_INIT_MEMBER(vega_state, vega) { int i; for(i=0;i<8;++i) { - palette_set_color( machine(),2*i, rgb_t(0x00, 0x00, 0x00) ); - palette_set_color( machine(),2*i+1, rgb_t( (i&1)?0xff:0x00, (i&2)?0xff:0x00, (i&4)?0xff:0x00) ); + palette.set_pen_color( 2*i, rgb_t(0x00, 0x00, 0x00) ); + palette.set_pen_color( 2*i+1, rgb_t( (i&1)?0xff:0x00, (i&2)?0xff:0x00, (i&4)?0xff:0x00) ); } } @@ -531,7 +531,7 @@ static void draw_tilemap(vega_state *state, screen_device& screen, bitmap_ind16& { //for(int x=0;x<4;++x) { - state->m_gfxdecode->gfx(1)->transpen(bitmap,cliprect, num, 0, 1,flip?1:0, x*4+x0-offset_x, (flip?(3-y):y)*8+y0-offset_y, 0); + state->m_gfxdecode->gfx(1)->transpen(state->m_palette,bitmap,cliprect, num, 0, 1,flip?1:0, x*4+x0-offset_x, (flip?(3-y):y)*8+y0-offset_y, 0); ++num; } } @@ -580,7 +580,7 @@ UINT32 vega_state::screen_update_vega(screen_device &screen, bitmap_ind16 &bitma // if(color==0) color=0xf; - m_gfxdecode->gfx(0)->transpen(bitmap,cliprect, character, color, 0, 0, x*7, y*10,0); + m_gfxdecode->gfx(0)->transpen(m_palette,bitmap,cliprect, character, color, 0, 0, x*7, y*10,0); ++idx; } @@ -601,7 +601,7 @@ UINT32 vega_state::screen_update_vega(screen_device &screen, bitmap_ind16 &bitma { //for(int x=0;x<4;++x) { - m_gfxdecode->gfx(2)->transpen(bitmap,cliprect, num, 0, 1, flip?1:0, x*4+x0, (flip?(3-y):y)*8+y0, 0); + m_gfxdecode->gfx(2)->transpen(m_palette,bitmap,cliprect, num, 0, 1, flip?1:0, x*4+x0, (flip?(3-y):y)*8+y0, 0); ++num; } } @@ -641,7 +641,7 @@ UINT32 vega_state::screen_update_vega(screen_device &screen, bitmap_ind16 &bitma for(int y=0;y<4;++y) { - m_gfxdecode->gfx(3)->transpen(bitmap,cliprect, strip_num, 0, !xor_line, 0, x*4+x0, y*8+y0, 0); + m_gfxdecode->gfx(3)->transpen(m_palette,bitmap,cliprect, strip_num, 0, !xor_line, 0, x*4+x0, y*8+y0, 0); ++strip_num; } } @@ -851,7 +851,8 @@ static MACHINE_CONFIG_START( vega, vega_state ) MCFG_SCREEN_VISIBLE_AREA(0*8, 280, 0*8, 239) MCFG_SCREEN_UPDATE_DRIVER(vega_state, screen_update_vega) - MCFG_PALETTE_LENGTH(0x100) + MCFG_PALETTE_ADD("palette", 0x100) + MCFG_PALETTE_INIT_OWNER(vega_state, vega) MCFG_GFXDECODE_ADD("gfxdecode", test_decode) |