summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Dirk Best <mail@dirk-best.de>2015-07-30 11:53:47 +0200
committer Dirk Best <mail@dirk-best.de>2015-07-30 12:10:45 +0200
commitd5ddb846e80e7fbf1e0b914ec17eef778099d935 (patch)
tree7bae07b6281051ecf1fc3ee6ede9b655ff0300cb
parenta796d0e8ad60d9338ec7e20bbda54aaf897a7f91 (diff)
astinvad: use standard 3-bit rbg palette
-rw-r--r--src/mame/drivers/astinvad.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/mame/drivers/astinvad.c b/src/mame/drivers/astinvad.c
index 4e4fe8e092d..0d91accbfdb 100644
--- a/src/mame/drivers/astinvad.c
+++ b/src/mame/drivers/astinvad.c
@@ -57,6 +57,7 @@ public:
m_maincpu(*this, "maincpu"),
m_ppi8255_0(*this, "ppi8255_0"),
m_ppi8255_1(*this, "ppi8255_1"),
+ m_palette(*this, "palette"),
m_videoram(*this, "videoram"),
m_samples(*this, "samples"),
m_screen(*this, "screen"){ }
@@ -64,6 +65,7 @@ public:
required_device<cpu_device> m_maincpu;
optional_device<i8255_device> m_ppi8255_0;
optional_device<i8255_device> m_ppi8255_1;
+ required_device<palette_device> m_palette;
required_shared_ptr<UINT8> m_videoram;
UINT8 * m_colorram;
@@ -144,17 +146,16 @@ WRITE8_MEMBER(astinvad_state::spaceint_videoram_w)
void astinvad_state::plot_byte( bitmap_rgb32 &bitmap, UINT8 y, UINT8 x, UINT8 data, UINT8 color )
{
- pen_t fore_pen = rgb_t(pal1bit(color >> 0), pal1bit(color >> 2), pal1bit(color >> 1));
UINT8 flip_xor = m_screen_flip & 7;
- bitmap.pix32(y, x + (0 ^ flip_xor)) = (data & 0x01) ? fore_pen : 0;
- bitmap.pix32(y, x + (1 ^ flip_xor)) = (data & 0x02) ? fore_pen : 0;
- bitmap.pix32(y, x + (2 ^ flip_xor)) = (data & 0x04) ? fore_pen : 0;
- bitmap.pix32(y, x + (3 ^ flip_xor)) = (data & 0x08) ? fore_pen : 0;
- bitmap.pix32(y, x + (4 ^ flip_xor)) = (data & 0x10) ? fore_pen : 0;
- bitmap.pix32(y, x + (5 ^ flip_xor)) = (data & 0x20) ? fore_pen : 0;
- bitmap.pix32(y, x + (6 ^ flip_xor)) = (data & 0x40) ? fore_pen : 0;
- bitmap.pix32(y, x + (7 ^ flip_xor)) = (data & 0x80) ? fore_pen : 0;
+ bitmap.pix32(y, x + (0 ^ flip_xor)) = (data & 0x01) ? m_palette->pen_color(color) : rgb_t::black;
+ bitmap.pix32(y, x + (1 ^ flip_xor)) = (data & 0x02) ? m_palette->pen_color(color) : rgb_t::black;
+ bitmap.pix32(y, x + (2 ^ flip_xor)) = (data & 0x04) ? m_palette->pen_color(color) : rgb_t::black;
+ bitmap.pix32(y, x + (3 ^ flip_xor)) = (data & 0x08) ? m_palette->pen_color(color) : rgb_t::black;
+ bitmap.pix32(y, x + (4 ^ flip_xor)) = (data & 0x10) ? m_palette->pen_color(color) : rgb_t::black;
+ bitmap.pix32(y, x + (5 ^ flip_xor)) = (data & 0x20) ? m_palette->pen_color(color) : rgb_t::black;
+ bitmap.pix32(y, x + (6 ^ flip_xor)) = (data & 0x40) ? m_palette->pen_color(color) : rgb_t::black;
+ bitmap.pix32(y, x + (7 ^ flip_xor)) = (data & 0x80) ? m_palette->pen_color(color) : rgb_t::black;
}
@@ -651,6 +652,8 @@ static MACHINE_CONFIG_START( kamikaze, astinvad_state )
MCFG_SCREEN_RAW_PARAMS(VIDEO_CLOCK, 320, 0, 256, 256, 32, 256)
MCFG_SCREEN_UPDATE_DRIVER(astinvad_state, screen_update_astinvad)
+ MCFG_PALETTE_ADD_3BIT_RBG("palette")
+
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -695,6 +698,8 @@ static MACHINE_CONFIG_START( spaceint, astinvad_state )
MCFG_SCREEN_REFRESH_RATE(60)
MCFG_SCREEN_UPDATE_DRIVER(astinvad_state, screen_update_spaceint)
+ MCFG_PALETTE_ADD_3BIT_RBG("palette")
+
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")