summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Dirk Best <mail@dirk-best.de>2015-07-27 17:05:53 +0200
committer Dirk Best <mail@dirk-best.de>2015-07-27 18:20:23 +0200
commit88fad271349851d4bd3e36c4cda358012f5c7d6b (patch)
treef843a91dfd00b0e1f05a4b087827bec8897d08df
parent417a2489ef30d4a24544350ebc5ca487bef02f4b (diff)
kangaroo: use standard 3-bit rgb palette
-rw-r--r--src/mame/drivers/kangaroo.c2
-rw-r--r--src/mame/includes/kangaroo.h4
-rw-r--r--src/mame/video/kangaroo.c9
3 files changed, 7 insertions, 8 deletions
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<UINT8> m_video_control;
@@ -37,4 +38,5 @@ public:
void videoram_write( UINT16 offset, UINT8 data, UINT8 mask );
void blitter_execute( );
required_device<cpu_device> m_maincpu;
+ required_device<palette_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);
}
}