diff --git a/src/mame/drivers/kangaroo.c b/src/mame/drivers/kangaroo.c index d5e2701011b..85b48369257 100644 --- a/src/mame/drivers/kangaroo.c +++ b/src/mame/drivers/kangaroo.c @@ -443,6 +443,8 @@ static MACHINE_CONFIG_START( nomcu, kangaroo_state ) MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK, 320*2, 0*2, 256*2, 260, 8, 248) MCFG_SCREEN_UPDATE_DRIVER(kangaroo_state, screen_update_kangaroo) + MCFG_PALETTE_ADD_3BIT_BGR("palette") + /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("aysnd", AY8910, MASTER_CLOCK/8) diff --git a/src/mame/includes/kangaroo.h b/src/mame/includes/kangaroo.h index 3c87b8866c7..c04c9e03f7e 100644 --- a/src/mame/includes/kangaroo.h +++ b/src/mame/includes/kangaroo.h @@ -14,7 +14,8 @@ public: kangaroo_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_video_control(*this, "video_control"), - m_maincpu(*this, "maincpu") { } + m_maincpu(*this, "maincpu"), + m_palette(*this, "palette") { } /* memory pointers */ required_shared_ptr m_video_control; @@ -37,4 +38,5 @@ public: void videoram_write( UINT16 offset, UINT8 data, UINT8 mask ); void blitter_execute( ); required_device m_maincpu; + required_device m_palette; }; diff --git a/src/mame/video/kangaroo.c b/src/mame/video/kangaroo.c index 87e8db7ea5b..4949a13ebe4 100644 --- a/src/mame/video/kangaroo.c +++ b/src/mame/video/kangaroo.c @@ -141,13 +141,8 @@ UINT32 kangaroo_state::screen_update_kangaroo(screen_device &screen, bitmap_rgb3 UINT8 enab = (m_video_control[9] & 0x04); UINT8 pria = (~m_video_control[9] & 0x02); UINT8 prib = (~m_video_control[9] & 0x01); - rgb_t pens[8]; int x, y; - /* build up the pens arrays */ - for (x = 0; x < 8; x++) - pens[x] = rgb_t(pal1bit(x >> 2), pal1bit(x >> 1), pal1bit(x >> 0)); - /* iterate over pixels */ for (y = cliprect.min_y; y <= cliprect.max_y; y++) { @@ -171,7 +166,7 @@ UINT32 kangaroo_state::screen_update_kangaroo(screen_device &screen, bitmap_rgb3 finalpens |= pixb; /* store the first of two pixels, which is always full brightness */ - dest[x + 0] = pens[finalpens & 7]; + dest[x + 0] = m_palette->pen_color(finalpens & 7); /* KOS1 alternates at 5MHz, offset from the pixel clock by 1/2 clock */ /* when 0, it enables the color mask for pixels with Z = 0 */ @@ -188,7 +183,7 @@ UINT32 kangaroo_state::screen_update_kangaroo(screen_device &screen, bitmap_rgb3 } /* store the second of two pixels, which is affected by KOS1 and the A/B masks */ - dest[x + 1] = pens[finalpens & 7]; + dest[x + 1] = m_palette->pen_color(finalpens & 7); } }