summaryrefslogtreecommitdiffstatshomepage
path: root/src/mess/video/cgc7900.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mess/video/cgc7900.c')
-rw-r--r--src/mess/video/cgc7900.c45
1 files changed, 19 insertions, 26 deletions
diff --git a/src/mess/video/cgc7900.c b/src/mess/video/cgc7900.c
index db253e1ab69..779951bf6f0 100644
--- a/src/mess/video/cgc7900.c
+++ b/src/mess/video/cgc7900.c
@@ -22,6 +22,18 @@
#define OVERLAY_CURSOR_BLINK BIT(m_roll_overlay[0], 12)
#define OVERLAY_CHARACTER_BLINK BIT(m_roll_overlay[0], 11)
+static const rgb_t PALETTE[] =
+{
+ RGB_BLACK,
+ MAKE_RGB(0x00, 0x00, 0xff),
+ MAKE_RGB(0x00, 0xff, 0x00),
+ MAKE_RGB(0x00, 0xff, 0xff),
+ MAKE_RGB(0xff, 0x00, 0x00),
+ MAKE_RGB(0xff, 0x00, 0xff),
+ MAKE_RGB(0xff, 0xff, 0x00),
+ RGB_WHITE
+};
+
/***************************************************************************
READ/WRITE HANDLERS
***************************************************************************/
@@ -101,7 +113,7 @@ void cgc7900_state::update_clut()
UINT8 g = (data >> 8) & 0xff;
UINT8 r = (data >> 16) & 0xff;
- palette_set_color_rgb(machine(), i + 8, r, g, b);
+ m_clut[i] = MAKE_RGB(r, g, b);
}
}
@@ -109,7 +121,7 @@ void cgc7900_state::update_clut()
draw_bitmap - draw bitmap image
-------------------------------------------------*/
-void cgc7900_state::draw_bitmap(screen_device *screen, bitmap_ind16 &bitmap)
+void cgc7900_state::draw_bitmap(screen_device *screen, bitmap_rgb32 &bitmap)
{
}
@@ -117,7 +129,7 @@ void cgc7900_state::draw_bitmap(screen_device *screen, bitmap_ind16 &bitmap)
draw_overlay - draw text overlay
-------------------------------------------------*/
-void cgc7900_state::draw_overlay(screen_device *screen, bitmap_ind16 &bitmap)
+void cgc7900_state::draw_overlay(screen_device *screen, bitmap_rgb32 &bitmap)
{
for (int y = 0; y < 768; y++)
{
@@ -138,18 +150,18 @@ void cgc7900_state::draw_overlay(screen_device *screen, bitmap_ind16 &bitmap)
{
if (!OVERLAY_CURSOR_BLINK || m_blink)
{
- bitmap.pix16(y, (sx * 8) + x) = 7;
+ bitmap.pix32(y, (sx * 8) + x) = PALETTE[7];
}
}
else
{
if (BIT(data, x) && (!OVERLAY_CHARACTER_BLINK || m_blink))
{
- if (OVERLAY_VF) bitmap.pix16(y, (sx * 8) + x) = fg;
+ if (OVERLAY_VF) bitmap.pix32(y, (sx * 8) + x) = PALETTE[fg];
}
else
{
- if (OVERLAY_VB) bitmap.pix16(y, (sx * 8) + x) = bg;
+ if (OVERLAY_VB) bitmap.pix32(y, (sx * 8) + x) = PALETTE[bg];
}
}
}
@@ -169,22 +181,6 @@ static TIMER_DEVICE_CALLBACK( blink_tick )
}
/*-------------------------------------------------
- PALETTE_INIT( cgc7900 )
--------------------------------------------------*/
-
-static PALETTE_INIT( cgc7900 )
-{
- palette_set_color_rgb(machine, 0, 0x00, 0x00, 0x00 );
- palette_set_color_rgb(machine, 1, 0x00, 0x00, 0xff );
- palette_set_color_rgb(machine, 2, 0x00, 0xff, 0x00 );
- palette_set_color_rgb(machine, 3, 0x00, 0xff, 0xff );
- palette_set_color_rgb(machine, 4, 0xff, 0x00, 0x00 );
- palette_set_color_rgb(machine, 5, 0xff, 0x00, 0xff );
- palette_set_color_rgb(machine, 6, 0xff, 0xff, 0x00 );
- palette_set_color_rgb(machine, 7, 0xff, 0xff, 0xff );
-}
-
-/*-------------------------------------------------
VIDEO_START( cgc7900 )
-------------------------------------------------*/
@@ -198,7 +194,7 @@ void cgc7900_state::video_start()
SCREEN_UPDATE_IND16( cgc7900 )
-------------------------------------------------*/
-UINT32 cgc7900_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+UINT32 cgc7900_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
update_clut();
draw_bitmap(&screen, bitmap);
@@ -248,8 +244,5 @@ MACHINE_CONFIG_FRAGMENT( cgc7900_video )
MCFG_GFXDECODE(cgc7900)
- MCFG_PALETTE_LENGTH(8+256) /* 8 overlay colors + 256 bitmap colors */
- MCFG_PALETTE_INIT(cgc7900)
-
MCFG_TIMER_ADD_PERIODIC("blink", blink_tick, attotime::from_hz(XTAL_28_48MHz/7500000))
MACHINE_CONFIG_END