diff options
author | Curt Coder <curtcoder@mail.com> | 2012-09-12 17:09:38 +0000 |
---|---|---|
committer | Curt Coder <curtcoder@mail.com> | 2012-09-12 17:09:38 +0000 |
commit | e634c5b4e564ab197e698e10919afa0161ab1516 (patch) | |
tree | 5b3fc1500f2a2395fd1b23a6d45623079efd601d /src | |
parent | 6ca3d41fb2e966060f6fa4a0db89a98c80b94d3a (diff) |
(MESS) Death to palettes. (nw)
Diffstat (limited to 'src')
59 files changed, 255 insertions, 404 deletions
diff --git a/src/emu/sound/cdp1864.c b/src/emu/sound/cdp1864.c index 91ae48a0989..ffb3a69d673 100644 --- a/src/emu/sound/cdp1864.c +++ b/src/emu/sound/cdp1864.c @@ -83,7 +83,7 @@ inline void cdp1864_device::initialize_palette() int g = (i & 1) ? luma : 0; int b = (i & 2) ? luma : 0; - palette_set_color_rgb(machine(), i, r, g, b); + m_palette[i] = MAKE_RGB(r, g, b); } } @@ -422,7 +422,7 @@ WRITE8_MEMBER( cdp1864_device::dma_w ) color = (gdata << 2) | (bdata << 1) | rdata; } - m_bitmap.pix16(y, sx + x) = color; + m_bitmap.pix32(y, sx + x) = m_palette[color]; data <<= 1; } @@ -470,7 +470,7 @@ WRITE_LINE_MEMBER( cdp1864_device::evs_w ) // update_screen - //------------------------------------------------- -UINT32 cdp1864_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 cdp1864_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { if (m_disp) { diff --git a/src/emu/sound/cdp1864.h b/src/emu/sound/cdp1864.h index 6d2193840d7..5e083d0f221 100644 --- a/src/emu/sound/cdp1864.h +++ b/src/emu/sound/cdp1864.h @@ -155,7 +155,7 @@ public: DECLARE_WRITE_LINE_MEMBER( aoe_w ); DECLARE_WRITE_LINE_MEMBER( evs_w ); - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: // device-level overrides @@ -186,10 +186,11 @@ private: cpu_device *m_cpu; screen_device *m_screen; // screen - bitmap_ind16 m_bitmap; // bitmap + bitmap_rgb32 m_bitmap; // bitmap sound_stream *m_stream; // sound output // video state + rgb_t m_palette[16]; int m_disp; // display on int m_dmaout; // DMA request active int m_bgcolor; // background color diff --git a/src/emu/sound/cdp1869.c b/src/emu/sound/cdp1869.c index f3bce9dbb75..6aa78288255 100644 --- a/src/emu/sound/cdp1869.c +++ b/src/emu/sound/cdp1869.c @@ -461,7 +461,7 @@ void cdp1869_device::initialize_palette() for (i = 0; i < 8; i++) { - palette_set_color(machine(), i, get_rgb(i, i, 15)); + m_palette[i] = get_rgb(i, i, 15); } // tone-on-tone display (CFC=1) @@ -469,7 +469,7 @@ void cdp1869_device::initialize_palette() { for (int l = 0; l < 8; l++) { - palette_set_color(machine(), i, get_rgb(i, c, l)); + m_palette[i] = get_rgb(i, c, l); i++; } } @@ -544,7 +544,7 @@ void cdp1869_device::sound_stream_update(sound_stream &stream, stream_sample_t * // draw_line - draw character line //------------------------------------------------- -void cdp1869_device::draw_line(bitmap_ind16 &bitmap, const rectangle &rect, int x, int y, UINT8 data, int color) +void cdp1869_device::draw_line(bitmap_rgb32 &bitmap, const rectangle &rect, int x, int y, UINT8 data, int color) { int i; @@ -554,20 +554,20 @@ void cdp1869_device::draw_line(bitmap_ind16 &bitmap, const rectangle &rect, int { if (data & 0x80) { - bitmap.pix16(y, x) = color; + bitmap.pix32(y, x) = m_palette[color]; if (!m_fresvert) { - bitmap.pix16(y + 1, x) = color; + bitmap.pix32(y + 1, x) = m_palette[color]; } if (!m_freshorz) { - bitmap.pix16(y, x + 1) = color; + bitmap.pix32(y, x + 1) = m_palette[color]; if (!m_fresvert) { - bitmap.pix16(y + 1, x + 1) = color; + bitmap.pix32(y + 1, x + 1) = m_palette[color]; } } } @@ -588,7 +588,7 @@ void cdp1869_device::draw_line(bitmap_ind16 &bitmap, const rectangle &rect, int // draw_char - draw character //------------------------------------------------- -void cdp1869_device::draw_char(bitmap_ind16 &bitmap, const rectangle &rect, int x, int y, UINT16 pma) +void cdp1869_device::draw_char(bitmap_rgb32 &bitmap, const rectangle &rect, int x, int y, UINT16 pma) { UINT8 pmd = read_page_ram_byte(pma); @@ -912,7 +912,7 @@ READ_LINE_MEMBER( cdp1869_device::pal_ntsc_r ) // update_screen - update screen //------------------------------------------------- -UINT32 cdp1869_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 cdp1869_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { rectangle screen_rect, outer; diff --git a/src/emu/sound/cdp1869.h b/src/emu/sound/cdp1869.h index b56f82f76d6..ed696be2376 100644 --- a/src/emu/sound/cdp1869.h +++ b/src/emu/sound/cdp1869.h @@ -145,14 +145,12 @@ #define MCFG_CDP1869_SCREEN_PAL_ADD(_cdptag, _tag, _clock) \ MCFG_SCREEN_ADD(_tag, RASTER) \ MCFG_SCREEN_UPDATE_DEVICE(_cdptag, cdp1869_device, screen_update) \ - MCFG_SCREEN_RAW_PARAMS(_clock, CDP1869_SCREEN_WIDTH, CDP1869_HBLANK_END, CDP1869_HBLANK_START, CDP1869_TOTAL_SCANLINES_PAL, CDP1869_SCANLINE_VBLANK_END_PAL, CDP1869_SCANLINE_VBLANK_START_PAL) \ - MCFG_PALETTE_LENGTH(8+64) + MCFG_SCREEN_RAW_PARAMS(_clock, CDP1869_SCREEN_WIDTH, CDP1869_HBLANK_END, CDP1869_HBLANK_START, CDP1869_TOTAL_SCANLINES_PAL, CDP1869_SCANLINE_VBLANK_END_PAL, CDP1869_SCANLINE_VBLANK_START_PAL) #define MCFG_CDP1869_SCREEN_NTSC_ADD(_cdptag, _tag, _clock) \ MCFG_SCREEN_ADD(_tag, RASTER) \ MCFG_SCREEN_UPDATE_DEVICE(_cdptag, cdp1869_device, screen_update) \ - MCFG_SCREEN_RAW_PARAMS(_clock, CDP1869_SCREEN_WIDTH, CDP1869_HBLANK_END, CDP1869_HBLANK_START, CDP1869_TOTAL_SCANLINES_NTSC, CDP1869_SCANLINE_VBLANK_END_NTSC, CDP1869_SCANLINE_VBLANK_START_NTSC) \ - MCFG_PALETTE_LENGTH(8+64) + MCFG_SCREEN_RAW_PARAMS(_clock, CDP1869_SCREEN_WIDTH, CDP1869_HBLANK_END, CDP1869_HBLANK_START, CDP1869_TOTAL_SCANLINES_NTSC, CDP1869_SCANLINE_VBLANK_END_NTSC, CDP1869_SCANLINE_VBLANK_START_NTSC) #define CDP1869_INTERFACE(_name) \ const cdp1869_interface (_name) = @@ -231,7 +229,7 @@ public: DECLARE_READ_LINE_MEMBER( predisplay_r ); DECLARE_READ_LINE_MEMBER( pal_ntsc_r ); - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: // device-level overrides @@ -260,8 +258,8 @@ protected: inline int get_pen(int ccb0, int ccb1, int pcb); void initialize_palette(); - void draw_line(bitmap_ind16 &bitmap, const rectangle &rect, int x, int y, UINT8 data, int color); - void draw_char(bitmap_ind16 &bitmap, const rectangle &rect, int x, int y, UINT16 pma); + void draw_line(bitmap_rgb32 &bitmap, const rectangle &rect, int x, int y, UINT8 data, int color); + void draw_char(bitmap_rgb32 &bitmap, const rectangle &rect, int x, int y, UINT16 pma); private: devcb_resolved_read_line m_in_pal_ntsc_func; @@ -276,6 +274,7 @@ private: sound_stream *m_stream; // video state + rgb_t m_palette[8+64]; int m_prd; // predisplay int m_dispoff; // display off int m_fresvert; // full resolution vertical diff --git a/src/emu/video/cdp1861.c b/src/emu/video/cdp1861.c index c071562bd98..6e50a5ebd8f 100644 --- a/src/emu/video/cdp1861.c +++ b/src/emu/video/cdp1861.c @@ -214,7 +214,7 @@ WRITE8_MEMBER( cdp1861_device::dma_w ) for (x = 0; x < 8; x++) { int color = BIT(data, 7); - m_bitmap.pix16(y, sx + x) = color; + m_bitmap.pix32(y, sx + x) = RGB_MONOCHROME_WHITE[color]; data <<= 1; } } @@ -251,7 +251,7 @@ WRITE_LINE_MEMBER( cdp1861_device::disp_off_w ) // screen_update - //------------------------------------------------- -UINT32 cdp1861_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 cdp1861_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { if (m_disp) { @@ -259,7 +259,7 @@ UINT32 cdp1861_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap } else { - bitmap.fill(get_black_pen(machine()), cliprect); + bitmap.fill(RGB_BLACK, cliprect); } return 0; } diff --git a/src/emu/video/cdp1861.h b/src/emu/video/cdp1861.h index f63b1d1d7d9..dfc9c341597 100644 --- a/src/emu/video/cdp1861.h +++ b/src/emu/video/cdp1861.h @@ -113,7 +113,7 @@ public: DECLARE_WRITE_LINE_MEMBER( disp_on_w ); DECLARE_WRITE_LINE_MEMBER( disp_off_w ); - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: // device-level overrides @@ -132,7 +132,7 @@ private: devcb_resolved_write_line m_out_efx_func; screen_device *m_screen; // screen - bitmap_ind16 m_bitmap; // bitmap + bitmap_rgb32 m_bitmap; // bitmap int m_disp; // display enabled int m_dispon; // display on latch diff --git a/src/emu/video/cdp1862.c b/src/emu/video/cdp1862.c index 7ec4f31802b..773db369cd5 100644 --- a/src/emu/video/cdp1862.c +++ b/src/emu/video/cdp1862.c @@ -66,7 +66,7 @@ inline void cdp1862_device::initialize_palette() g = (i & 1) ? luma : 0; b = (i & 2) ? luma : 0; - palette_set_color_rgb(machine(), i, r, g, b); + m_palette[i] = MAKE_RGB(r, g, b); } } @@ -171,7 +171,7 @@ WRITE8_MEMBER( cdp1862_device::dma_w ) color = (gd << 2) | (bd << 1) | rd; } - m_bitmap.pix16(y, sx + x) = color; + m_bitmap.pix32(y, sx + x) = m_palette[color]; data <<= 1; } @@ -213,9 +213,11 @@ WRITE_LINE_MEMBER( cdp1862_device::con_w ) // screen_update - //------------------------------------------------- -UINT32 cdp1862_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 cdp1862_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { copybitmap(bitmap, m_bitmap, 0, 0, 0, 0, cliprect); - m_bitmap.fill(CDP1862_BACKGROUND_COLOR_SEQUENCE[m_bgcolor] + 8, cliprect); + + m_bitmap.fill(m_palette[CDP1862_BACKGROUND_COLOR_SEQUENCE[m_bgcolor] + 8], cliprect); + return 0; } diff --git a/src/emu/video/cdp1862.h b/src/emu/video/cdp1862.h index dd7850e6086..98d1670f60f 100644 --- a/src/emu/video/cdp1862.h +++ b/src/emu/video/cdp1862.h @@ -94,7 +94,7 @@ public: DECLARE_WRITE_LINE_MEMBER( bkg_w ); DECLARE_WRITE_LINE_MEMBER( con_w ); - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: // device-level overrides @@ -110,8 +110,9 @@ private: devcb_resolved_read_line m_in_gd_func; screen_device *m_screen; // screen - bitmap_ind16 m_bitmap; // bitmap + bitmap_rgb32 m_bitmap; // bitmap + rgb_t m_palette[16]; int m_bgcolor; // background color int m_con; // color on }; diff --git a/src/emu/video/crt9021.c b/src/emu/video/crt9021.c index 7613014eac1..d6ed7ba6aec 100644 --- a/src/emu/video/crt9021.c +++ b/src/emu/video/crt9021.c @@ -222,7 +222,7 @@ WRITE_LINE_MEMBER( crt9021_device::vsync_w ) // screen_update - update screen //------------------------------------------------- -UINT32 crt9021_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 crt9021_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/emu/video/crt9021.h b/src/emu/video/crt9021.h index bfa7ab03528..14ca455b46c 100644 --- a/src/emu/video/crt9021.h +++ b/src/emu/video/crt9021.h @@ -88,7 +88,7 @@ public: DECLARE_WRITE_LINE_MEMBER( retbl_w ); DECLARE_WRITE_LINE_MEMBER( vsync_w ); - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: // device-level overrides diff --git a/src/emu/video/generic.c b/src/emu/video/generic.c index ea5d97a6040..063af07acb6 100644 --- a/src/emu/video/generic.c +++ b/src/emu/video/generic.c @@ -125,6 +125,12 @@ PALETTE_INIT( black_and_white ) palette_set_color(machine,1,RGB_WHITE); /* white */ } +const rgb_t RGB_MONOCHROME_WHITE[] = +{ + RGB_BLACK, + RGB_WHITE +}; + /*------------------------------------------------- monochrome_amber - 2-color black & amber @@ -136,6 +142,12 @@ PALETTE_INIT( monochrome_amber ) palette_set_color_rgb(machine, 1, 0xf7, 0xaa, 0x00); /* amber */ } +const rgb_t RGB_MONOCHROME_AMBER[] = +{ + RGB_BLACK, + MAKE_RGB(0xf7, 0xaa, 0x00) +}; + /*------------------------------------------------- monochrome_green - 2-color black & green @@ -147,6 +159,23 @@ PALETTE_INIT( monochrome_green ) palette_set_color_rgb(machine, 1, 0x00, 0xff, 0x00); /* green */ } +const rgb_t RGB_MONOCHROME_GREEN[] = +{ + RGB_BLACK, + MAKE_RGB(0x00, 0xff, 0x00) +}; + + +/*------------------------------------------------- + monochrome_yellow - 2-color black & yellow +-------------------------------------------------*/ + +const rgb_t RGB_MONOCHROME_YELLOW[] = +{ + RGB_BLACK, + MAKE_RGB(0xff, 0xff, 0x00) +}; + /*------------------------------------------------- RRRR_GGGG_BBBB - standard 4-4-4 palette, diff --git a/src/emu/video/generic.h b/src/emu/video/generic.h index 196d5665708..b3741f681c7 100644 --- a/src/emu/video/generic.h +++ b/src/emu/video/generic.h @@ -46,5 +46,9 @@ PALETTE_INIT( RRRRR_GGGGG_BBBBB ); PALETTE_INIT( BBBBB_GGGGG_RRRRR ); PALETTE_INIT( RRRRR_GGGGGG_BBBBB ); +extern const rgb_t RGB_MONOCHROME_WHITE[]; +extern const rgb_t RGB_MONOCHROME_AMBER[]; +extern const rgb_t RGB_MONOCHROME_GREEN[]; +extern const rgb_t RGB_MONOCHROME_YELLOW[]; #endif /* __VIDEO_GENERIC_H__ */ diff --git a/src/emu/video/upd3301.c b/src/emu/video/upd3301.c index ae51f364486..4b512221280 100644 --- a/src/emu/video/upd3301.c +++ b/src/emu/video/upd3301.c @@ -615,7 +615,7 @@ void upd3301_device::draw_scanline() // update_screen - //------------------------------------------------- -UINT32 upd3301_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 upd3301_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { if (m_status & STATUS_VE) { diff --git a/src/emu/video/upd3301.h b/src/emu/video/upd3301.h index 7f9c82759fe..e259a634be2 100644 --- a/src/emu/video/upd3301.h +++ b/src/emu/video/upd3301.h @@ -66,8 +66,8 @@ // ======================> upd3301_display_pixels_func -typedef void (*upd3301_display_pixels_func)(device_t *device, bitmap_ind16 &bitmap, int y, int sx, UINT8 cc, UINT8 lc, int hlgt, int rvv, int vsp, int sl0, int sl12, int csr, int gpa); -#define UPD3301_DISPLAY_PIXELS(name) void name(device_t *device, bitmap_ind16 &bitmap, int y, int sx, UINT8 cc, UINT8 lc, int hlgt, int rvv, int vsp, int sl0, int sl12, int csr, int gpa) +typedef void (*upd3301_display_pixels_func)(device_t *device, bitmap_rgb32 &bitmap, int y, int sx, UINT8 cc, UINT8 lc, int hlgt, int rvv, int vsp, int sl0, int sl12, int csr, int gpa); +#define UPD3301_DISPLAY_PIXELS(name) void name(device_t *device, bitmap_rgb32 &bitmap, int y, int sx, UINT8 cc, UINT8 lc, int hlgt, int rvv, int vsp, int sl0, int sl12, int csr, int gpa) // ======================> upd3301_interface @@ -103,7 +103,7 @@ public: DECLARE_READ_LINE_MEMBER( hrtc_r ); DECLARE_READ_LINE_MEMBER( vrtc_r ); - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: // device-level overrides @@ -136,7 +136,7 @@ private: screen_device *m_screen; // screen drawing - bitmap_ind16 *m_bitmap; // bitmap + bitmap_rgb32 *m_bitmap; // bitmap int m_y; // current scanline int m_hrtc; // horizontal retrace int m_vrtc; // vertical retrace diff --git a/src/mess/drivers/cosmicos.c b/src/mess/drivers/cosmicos.c index b2a4f260050..449c7dcdc02 100644 --- a/src/mess/drivers/cosmicos.c +++ b/src/mess/drivers/cosmicos.c @@ -575,8 +575,6 @@ static MACHINE_CONFIG_START( cosmicos, cosmicos_state ) MCFG_CDP1864_SCREEN_ADD(SCREEN_TAG, XTAL_1_75MHz) MCFG_SCREEN_UPDATE_DEVICE(CDP1864_TAG, cdp1864_device, screen_update) - MCFG_PALETTE_LENGTH(8+8) - /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mess/drivers/elf.c b/src/mess/drivers/elf.c index 01690d9b360..c5ce44a1be8 100644 --- a/src/mess/drivers/elf.c +++ b/src/mess/drivers/elf.c @@ -307,9 +307,6 @@ static MACHINE_CONFIG_START( elf2, elf2_state ) MCFG_SCREEN_UPDATE_DEVICE(CDP1861_TAG, cdp1861_device, screen_update) MCFG_SCREEN_RAW_PARAMS(XTAL_3_579545MHz/2, CDP1861_SCREEN_WIDTH, CDP1861_HBLANK_END, CDP1861_HBLANK_START, CDP1861_TOTAL_SCANLINES, CDP1861_SCANLINE_VBLANK_END, CDP1861_SCANLINE_VBLANK_START) - MCFG_PALETTE_LENGTH(2) - MCFG_PALETTE_INIT(black_and_white) - MCFG_MM74C923_ADD(MM74C923_TAG, keyboard_intf) MCFG_DM9368_ADD(DM9368_H_TAG, led_h_intf) MCFG_DM9368_ADD(DM9368_L_TAG, led_l_intf) diff --git a/src/mess/drivers/eti660.c b/src/mess/drivers/eti660.c index bc22edc99d7..c854f86421b 100644 --- a/src/mess/drivers/eti660.c +++ b/src/mess/drivers/eti660.c @@ -260,8 +260,6 @@ static MACHINE_CONFIG_START( eti660, eti660_state ) MCFG_CDP1864_SCREEN_ADD(SCREEN_TAG, XTAL_8_867238MHz/5) MCFG_SCREEN_UPDATE_DEVICE(CDP1864_TAG, cdp1864_device, screen_update) - MCFG_PALETTE_LENGTH(8+8) - /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_CDP1864_ADD(CDP1864_TAG, XTAL_8_867238MHz/5, eti660_cdp1864_intf) diff --git a/src/mess/drivers/pc8001.c b/src/mess/drivers/pc8001.c index a829bd3f982..a575178d57a 100644 --- a/src/mess/drivers/pc8001.c +++ b/src/mess/drivers/pc8001.c @@ -340,10 +340,6 @@ INPUT_PORTS_END /* Video */ -static PALETTE_INIT( pc8001 ) -{ -} - void pc8001_state::video_start() { // find memory regions @@ -352,6 +348,18 @@ void pc8001_state::video_start() /* uPD3301 Interface */ +static const rgb_t PALETTE[] = +{ + RGB_BLACK, + MAKE_RGB(0x00, 0x00, 0x00), + MAKE_RGB(0x00, 0x00, 0x00), + MAKE_RGB(0x00, 0x00, 0x00), + MAKE_RGB(0x00, 0x00, 0x00), + MAKE_RGB(0x00, 0x00, 0x00), + MAKE_RGB(0x00, 0x00, 0x00), + RGB_WHITE +}; + static UPD3301_DISPLAY_PIXELS( pc8001_display_pixels ) { pc8001_state *state = device->machine().driver_data<pc8001_state>(); @@ -368,7 +376,7 @@ static UPD3301_DISPLAY_PIXELS( pc8001_display_pixels ) { int color = BIT(data, 7) ^ rvv; - bitmap.pix16(y, (sx * 8) + i) = color ? 7 : 0; + bitmap.pix32(y, (sx * 8) + i) = PALETTE[color ? 7 : 0]; data <<= 1; } @@ -381,8 +389,8 @@ static UPD3301_DISPLAY_PIXELS( pc8001_display_pixels ) { int color = BIT(data, 7) ^ rvv; - bitmap.pix16(y, (sx/2 * 16) + (i * 2)) = color ? 7 : 0; - bitmap.pix16(y, (sx/2 * 16) + (i * 2) + 1) = color ? 7 : 0; + bitmap.pix32(y, (sx/2 * 16) + (i * 2)) = PALETTE[color ? 7 : 0]; + bitmap.pix32(y, (sx/2 * 16) + (i * 2) + 1) = PALETTE[color ? 7 : 0]; data <<= 1; } @@ -560,9 +568,6 @@ static MACHINE_CONFIG_START( pc8001, pc8001_state ) MCFG_SCREEN_SIZE(640, 220) MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 200-1) - MCFG_PALETTE_LENGTH(8) - MCFG_PALETTE_INIT(pc8001) - /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD(SPEAKER_TAG, SPEAKER_SOUND, 0) @@ -597,9 +602,6 @@ static MACHINE_CONFIG_START( pc8001mk2, pc8001mk2_state ) MCFG_SCREEN_SIZE(640, 220) MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 200-1) - MCFG_PALETTE_LENGTH(8) - MCFG_PALETTE_INIT(pc8001) - /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD(SPEAKER_TAG, SPEAKER_SOUND, 0) diff --git a/src/mess/drivers/ql.c b/src/mess/drivers/ql.c index 74c035416e7..96488294d6e 100644 --- a/src/mess/drivers/ql.c +++ b/src/mess/drivers/ql.c @@ -702,40 +702,6 @@ INPUT_PORTS_END //************************************************************************** -// VIDEO -//************************************************************************** - -//------------------------------------------------- -// PALETTE_INIT( ql ) -//------------------------------------------------- - -static PALETTE_INIT( ql ) -{ - palette_set_color_rgb(machine, 0, 0x00, 0x00, 0x00 ); // black - palette_set_color_rgb(machine, 1, 0x00, 0x00, 0xff ); // blue - palette_set_color_rgb(machine, 2, 0xff, 0x00, 0x00 ); // red - palette_set_color_rgb(machine, 3, 0xff, 0x00, 0xff ); // magenta - palette_set_color_rgb(machine, 4, 0x00, 0xff, 0x00 ); // green - palette_set_color_rgb(machine, 5, 0x00, 0xff, 0xff ); // cyan - palette_set_color_rgb(machine, 6, 0xff, 0xff, 0x00 ); // yellow - palette_set_color_rgb(machine, 7, 0xff, 0xff, 0xff ); // white -} - - -//------------------------------------------------- -// SCREEN_UPDATE_IND16( ql ) -//------------------------------------------------- - -UINT32 ql_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - m_zx8301->update_screen(bitmap, cliprect); - - return 0; -} - - - -//************************************************************************** // DEVICE CONFIGURATION //************************************************************************** @@ -1014,13 +980,10 @@ static MACHINE_CONFIG_START( ql, ql_state ) MCFG_SCREEN_ADD(SCREEN_TAG, RASTER) MCFG_SCREEN_REFRESH_RATE(50.08) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) // not accurate - MCFG_SCREEN_UPDATE_DRIVER(ql_state, screen_update) + MCFG_SCREEN_UPDATE_DEVICE(ZX8301_TAG, zx8301_device, screen_update) MCFG_SCREEN_SIZE(960, 312) MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 0, 256-1) - MCFG_PALETTE_LENGTH(8) - MCFG_PALETTE_INIT(ql) - // sound hardware MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD(SPEAKER_TAG, SPEAKER_SOUND, 0) diff --git a/src/mess/drivers/studio2.c b/src/mess/drivers/studio2.c index 1addbbf6cc4..f13f3d6eeec 100644 --- a/src/mess/drivers/studio2.c +++ b/src/mess/drivers/studio2.c @@ -305,13 +305,13 @@ static CDP1861_INTERFACE( studio2_cdp1861_intf ) DEVCB_CPU_INPUT_LINE(CDP1802_TAG, COSMAC_INPUT_LINE_EF1) }; -static PALETTE_INIT( visicom ) +static const rgb_t VISICOM_PALETTE[] = { - palette_set_color_rgb(machine, 0, 0x00, 0x80, 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, 0xff, 0x00, 0x00); -} + MAKE_RGB(0x00, 0x80, 0x00), + MAKE_RGB(0x00, 0x00, 0xff), + MAKE_RGB(0x00, 0xff, 0x00), + MAKE_RGB(0xff, 0x00, 0x00) +}; READ_LINE_MEMBER( mpt02_state::rdata_r ) { @@ -465,10 +465,6 @@ static MACHINE_CONFIG_START( studio2, studio2_state ) /* video hardware */ MCFG_CDP1861_SCREEN_ADD(CDP1861_TAG, SCREEN_TAG, 1760000) - - MCFG_PALETTE_LENGTH(2) - MCFG_PALETTE_INIT(black_and_white) - MCFG_CDP1861_ADD(CDP1861_TAG, 1760000, studio2_cdp1861_intf) /* sound hardware */ @@ -488,10 +484,6 @@ static MACHINE_CONFIG_START( visicom, visicom_state ) /* video hardware */ MCFG_CDP1861_SCREEN_ADD(CDP1861_TAG, SCREEN_TAG, XTAL_3_579545MHz/2) - - MCFG_PALETTE_LENGTH(4) - MCFG_PALETTE_INIT(visicom) - MCFG_CDP1861_ADD(CDP1861_TAG, XTAL_3_579545MHz/2/8, studio2_cdp1861_intf) /* sound hardware */ @@ -513,8 +505,6 @@ static MACHINE_CONFIG_START( mpt02, mpt02_state ) MCFG_CDP1864_SCREEN_ADD(SCREEN_TAG, CDP1864_CLOCK) MCFG_SCREEN_UPDATE_DEVICE(CDP1864_TAG, cdp1864_device, screen_update) - MCFG_PALETTE_LENGTH(8+8) - /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD(BEEPER_TAG, BEEP, 0) diff --git a/src/mess/drivers/tandy2k.c b/src/mess/drivers/tandy2k.c index 4a7cc1d7641..12cf5238dde 100644 --- a/src/mess/drivers/tandy2k.c +++ b/src/mess/drivers/tandy2k.c @@ -306,7 +306,7 @@ INPUT_PORTS_END // Video -UINT32 tandy2k_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 tandy2k_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { if (m_vidouts) { @@ -713,9 +713,6 @@ static MACHINE_CONFIG_START( tandy2k, tandy2k_state ) MCFG_SCREEN_SIZE(640, 480) MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) - MCFG_PALETTE_LENGTH(2) - MCFG_PALETTE_INIT(black_and_white) - MCFG_CRT9007_ADD(CRT9007_TAG, XTAL_16MHz*28/16, vpac_intf, vpac_mem) MCFG_CRT9212_ADD(CRT9212_0_TAG, drb0_intf) MCFG_CRT9212_ADD(CRT9212_1_TAG, drb1_intf) diff --git a/src/mess/drivers/tmc2000e.c b/src/mess/drivers/tmc2000e.c index 407a695ec4c..4d78dfbab25 100644 --- a/src/mess/drivers/tmc2000e.c +++ b/src/mess/drivers/tmc2000e.c @@ -258,8 +258,6 @@ static MACHINE_CONFIG_START( tmc2000e, tmc2000e_state ) MCFG_CDP1864_SCREEN_ADD(SCREEN_TAG, XTAL_1_75MHz) MCFG_SCREEN_UPDATE_DEVICE(CDP1864_TAG, cdp1864_device, screen_update) - MCFG_PALETTE_LENGTH(8) - // sound hardware MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_CDP1864_ADD(CDP1864_TAG, XTAL_1_75MHz, tmc2000e_cdp1864_intf) diff --git a/src/mess/drivers/vip.c b/src/mess/drivers/vip.c index 0bfee806247..14a6c97200e 100644 --- a/src/mess/drivers/vip.c +++ b/src/mess/drivers/vip.c @@ -555,7 +555,7 @@ static CDP1861_INTERFACE( vdc_intf ) DEVCB_DRIVER_LINE_MEMBER(vip_state, vdc_ef1_w) }; -UINT32 vip_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 vip_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { m_vdc->screen_update(screen, bitmap, cliprect); @@ -774,9 +774,6 @@ static MACHINE_CONFIG_START( vip, vip_state ) MCFG_CDP1861_SCREEN_ADD(CDP1861_TAG, SCREEN_TAG, XTAL_3_52128MHz/2) MCFG_SCREEN_UPDATE_DRIVER(vip_state, screen_update) - MCFG_PALETTE_LENGTH(16) - MCFG_PALETTE_INIT(black_and_white) - MCFG_CDP1861_ADD(CDP1861_TAG, XTAL_3_52128MHz/2, vdc_intf) // sound hardware diff --git a/src/mess/includes/abc80.h b/src/mess/includes/abc80.h index ed3a2894679..6ee641ab7e5 100644 --- a/src/mess/includes/abc80.h +++ b/src/mess/includes/abc80.h @@ -100,9 +100,9 @@ public: virtual void machine_start(); virtual void video_start(); - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - void update_screen(bitmap_ind16 &bitmap, const rectangle &cliprect); + void update_screen(bitmap_rgb32 &bitmap, const rectangle &cliprect); void scan_keyboard(); diff --git a/src/mess/includes/abc80x.h b/src/mess/includes/abc80x.h index 1acd98d75d4..8b5d3d6d492 100644 --- a/src/mess/includes/abc80x.h +++ b/src/mess/includes/abc80x.h @@ -187,7 +187,7 @@ public: m_trom(*this, SAA5052_TAG) { } - required_device<device_t> m_trom; + required_device<saa5050_device> m_trom; DECLARE_DRIVER_INIT(driver_init); diff --git a/src/mess/includes/cgc7900.h b/src/mess/includes/cgc7900.h index 7fa003e4fc1..00374e7047f 100644 --- a/src/mess/includes/cgc7900.h +++ b/src/mess/includes/cgc7900.h @@ -49,7 +49,7 @@ public: virtual void machine_reset(); virtual void video_start(); - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_READ16_MEMBER( keyboard_r ); DECLARE_WRITE16_MEMBER( keyboard_w ); @@ -64,13 +64,14 @@ public: DECLARE_READ16_MEMBER( sync_r ); void update_clut(); - void draw_bitmap(screen_device *screen, bitmap_ind16 &bitmap); - void draw_overlay(screen_device *screen, bitmap_ind16 &bitmap); + void draw_bitmap(screen_device *screen, bitmap_rgb32 &bitmap); + void draw_overlay(screen_device *screen, bitmap_rgb32 &bitmap); /* interrupt state */ UINT16 m_int_mask; /* video state */ + rgb_t m_clut[256]; required_shared_ptr<UINT16> m_chrom_ram; required_shared_ptr<UINT16> m_plane_ram; required_shared_ptr<UINT16> m_clut_ram; diff --git a/src/mess/includes/comx35.h b/src/mess/includes/comx35.h index f9b658a127d..a88e96c68ce 100644 --- a/src/mess/includes/comx35.h +++ b/src/mess/includes/comx35.h @@ -63,7 +63,6 @@ public: virtual void machine_reset(); virtual void video_start(); - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); enum { diff --git a/src/mess/includes/newbrain.h b/src/mess/includes/newbrain.h index 02f982fbcda..b0a036bf245 100644 --- a/src/mess/includes/newbrain.h +++ b/src/mess/includes/newbrain.h @@ -75,7 +75,7 @@ public: virtual void machine_reset(); virtual void video_start(); - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); enum { @@ -113,7 +113,7 @@ public: void tvram_w(UINT8 data, int a6); inline int get_reset_t(); inline int get_pwrup_t(); - void screen_update(bitmap_ind16 &bitmap, const rectangle &cliprect); + void screen_update(bitmap_rgb32 &bitmap, const rectangle &cliprect); // processor state int m_pwrup; // power up diff --git a/src/mess/includes/pc1512.h b/src/mess/includes/pc1512.h index baf49230a0e..1a1598746b6 100644 --- a/src/mess/includes/pc1512.h +++ b/src/mess/includes/pc1512.h @@ -111,9 +111,9 @@ public: int get_display_mode(UINT8 mode); offs_t get_char_rom_offset(); int get_color(UINT8 data); - void draw_alpha(mc6845_device *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param); - void draw_graphics_1(mc6845_device *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param); - void draw_graphics_2(mc6845_device *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param); + void draw_alpha(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param); + void draw_graphics_1(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param); + void draw_graphics_2(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param); DECLARE_READ8_MEMBER( video_ram_r ); DECLARE_WRITE8_MEMBER( video_ram_w ); diff --git a/src/mess/includes/tandy2k.h b/src/mess/includes/tandy2k.h index 6b139b852c9..f835590f879 100644 --- a/src/mess/includes/tandy2k.h +++ b/src/mess/includes/tandy2k.h @@ -81,7 +81,7 @@ public: virtual void machine_start(); - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void speaker_update(); void dma_request(int line, int state); diff --git a/src/mess/includes/tmc1800.h b/src/mess/includes/tmc1800.h index 8344e3ec6e0..2a492efa7c1 100644 --- a/src/mess/includes/tmc1800.h +++ b/src/mess/includes/tmc1800.h @@ -38,8 +38,6 @@ public: virtual void machine_start(); virtual void machine_reset(); - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - DECLARE_WRITE8_MEMBER( keylatch_w ); DECLARE_READ8_MEMBER( dispon_r ); DECLARE_WRITE8_MEMBER( dispoff_w ); @@ -68,7 +66,7 @@ public: virtual void machine_start(); virtual void machine_reset(); - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_WRITE8_MEMBER( keylatch_w ); DECLARE_READ_LINE_MEMBER( clear_r ); @@ -99,8 +97,6 @@ public: virtual void machine_start(); virtual void machine_reset(); - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - DECLARE_WRITE8_MEMBER( keylatch_w ); DECLARE_WRITE8_MEMBER( bankswitch_w ); DECLARE_READ_LINE_MEMBER( clear_r ); @@ -147,8 +143,6 @@ public: virtual void machine_start(); virtual void machine_reset(); - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - enum { TIMER_ID_EF4 diff --git a/src/mess/includes/vip.h b/src/mess/includes/vip.h index b7533b36dd6..3ffadf1664f 100644 --- a/src/mess/includes/vip.h +++ b/src/mess/includes/vip.h @@ -56,7 +56,7 @@ public: virtual void machine_start(); virtual void machine_reset(); - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void update_interrupts(); diff --git a/src/mess/machine/comx_eb.c b/src/mess/machine/comx_eb.c index 8bb8ebc7d0b..4221558db2a 100644 --- a/src/mess/machine/comx_eb.c +++ b/src/mess/machine/comx_eb.c @@ -383,23 +383,3 @@ void comx_eb_device::comx_io_w(offs_t offset, UINT8 data) } } } - - -//------------------------------------------------- -// comx_screen_update - screen update -//------------------------------------------------- - -UINT32 comx_eb_device::comx_screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - bool value = false; - - for (int slot = 0; slot < MAX_EB_SLOTS; slot++) - { - if (BIT(m_select, slot) && m_expansion_slot[slot] != NULL) - { - m_expansion_slot[slot]->screen_update(screen, bitmap, cliprect); - } - } - - return value; -} diff --git a/src/mess/machine/comx_eb.h b/src/mess/machine/comx_eb.h index e15a4880439..99ded642f64 100644 --- a/src/mess/machine/comx_eb.h +++ b/src/mess/machine/comx_eb.h @@ -66,7 +66,6 @@ protected: virtual void comx_mwr_w(offs_t offset, UINT8 data); virtual UINT8 comx_io_r(offs_t offset); virtual void comx_io_w(offs_t offset, UINT8 data); - virtual UINT32 comx_screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); private: UINT8 *m_rom; // program ROM diff --git a/src/mess/machine/comxexp.c b/src/mess/machine/comxexp.c index a6fd487221c..27cfa7f4298 100644 --- a/src/mess/machine/comxexp.c +++ b/src/mess/machine/comxexp.c @@ -205,23 +205,6 @@ WRITE_LINE_MEMBER( comx_expansion_slot_device::q_w ) } -//------------------------------------------------- -// screen_update - -//------------------------------------------------- - -UINT32 comx_expansion_slot_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - bool value = false; - - if (m_card != NULL) - { - value = m_card->comx_screen_update(screen, bitmap, cliprect); - } - - return value; -} - - WRITE_LINE_MEMBER( comx_expansion_slot_device::int_w ) { m_out_int_func(state); } WRITE_LINE_MEMBER( comx_expansion_slot_device::ef4_w ) { m_out_ef4_func(state); } WRITE_LINE_MEMBER( comx_expansion_slot_device::wait_w ) { m_out_wait_func(state); } diff --git a/src/mess/machine/comxexp.h b/src/mess/machine/comxexp.h index 354a30fad58..19d9f03f9b7 100644 --- a/src/mess/machine/comxexp.h +++ b/src/mess/machine/comxexp.h @@ -148,9 +148,6 @@ protected: virtual UINT8 comx_io_r(offs_t offset) { return 0; }; virtual void comx_io_w(offs_t offset, UINT8 data) { }; - // video - virtual UINT32 comx_screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return false; } - comx_expansion_slot_device *m_slot; }; diff --git a/src/mess/machine/vip_exp.c b/src/mess/machine/vip_exp.c index 4c1330a9b6d..339cf077af3 100644 --- a/src/mess/machine/vip_exp.c +++ b/src/mess/machine/vip_exp.c @@ -210,7 +210,7 @@ void vip_expansion_slot_device::dma_w(address_space &space, offs_t offset, UINT8 // screen_update - //------------------------------------------------- -UINT32 vip_expansion_slot_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 vip_expansion_slot_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { bool value = false; diff --git a/src/mess/machine/vip_exp.h b/src/mess/machine/vip_exp.h index 981d8de4e9b..815236572fe 100644 --- a/src/mess/machine/vip_exp.h +++ b/src/mess/machine/vip_exp.h @@ -98,7 +98,7 @@ public: void io_w(address_space &space, offs_t offset, UINT8 data); UINT8 dma_r(address_space &space, offs_t offset); void dma_w(address_space &space, offs_t offset, UINT8 data); - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_READ_LINE_MEMBER( ef1_r ); DECLARE_READ_LINE_MEMBER( ef3_r ); DECLARE_READ_LINE_MEMBER( ef4_r ); @@ -146,7 +146,7 @@ protected: virtual UINT8 vip_dma_r(address_space &space, offs_t offset) { return 0xff; }; virtual void vip_dma_w(address_space &space, offs_t offset, UINT8 data) { }; - virtual UINT32 vip_screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } + virtual UINT32 vip_screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return 0; } virtual int vip_ef1_r() { return CLEAR_LINE; } virtual int vip_ef3_r() { return CLEAR_LINE; } diff --git a/src/mess/machine/vp575.c b/src/mess/machine/vp575.c index 818adb6388b..582b5c83a31 100644 --- a/src/mess/machine/vp575.c +++ b/src/mess/machine/vp575.c @@ -249,7 +249,7 @@ void vp575_device::vip_dma_w(address_space &space, offs_t offset, UINT8 data) // vip_screen_update - screen update //------------------------------------------------- -UINT32 vp575_device::vip_screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 vp575_device::vip_screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { UINT32 data = 0; diff --git a/src/mess/machine/vp575.h b/src/mess/machine/vp575.h index 103b426ae58..e7e65bbba30 100644 --- a/src/mess/machine/vp575.h +++ b/src/mess/machine/vp575.h @@ -72,7 +72,7 @@ protected: virtual void vip_io_w(address_space &space, offs_t offset, UINT8 data); virtual UINT8 vip_dma_r(address_space &space, offs_t offset); virtual void vip_dma_w(address_space &space, offs_t offset, UINT8 data); - virtual UINT32 vip_screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + virtual UINT32 vip_screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); virtual int vip_ef1_r(); virtual int vip_ef3_r(); virtual int vip_ef4_r(); diff --git a/src/mess/machine/vp590.c b/src/mess/machine/vp590.c index cc66a74d956..65497b00b62 100644 --- a/src/mess/machine/vp590.c +++ b/src/mess/machine/vp590.c @@ -241,7 +241,7 @@ void vp590_device::vip_dma_w(address_space &space, offs_t offset, UINT8 data) // vip_screen_update - screen update //------------------------------------------------- -UINT32 vp590_device::vip_screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 vp590_device::vip_screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { m_cgc->screen_update(screen, bitmap, cliprect); diff --git a/src/mess/machine/vp590.h b/src/mess/machine/vp590.h index f3173602d57..56e2148c9f0 100644 --- a/src/mess/machine/vp590.h +++ b/src/mess/machine/vp590.h @@ -50,7 +50,7 @@ protected: virtual void vip_program_w(address_space &space, offs_t offset, UINT8 data, int cdef, int *minh); virtual void vip_io_w(address_space &space, offs_t offset, UINT8 data); virtual void vip_dma_w(address_space &space, offs_t offset, UINT8 data); - virtual UINT32 vip_screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + virtual UINT32 vip_screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); virtual int vip_ef3_r(); virtual int vip_ef4_r(); diff --git a/src/mess/machine/wangpc_lvc.c b/src/mess/machine/wangpc_lvc.c index 30671a66019..2117687971e 100644 --- a/src/mess/machine/wangpc_lvc.c +++ b/src/mess/machine/wangpc_lvc.c @@ -54,8 +54,6 @@ const device_type WANGPC_LVC = &device_creator<wangpc_lvc_device>; void wangpc_lvc_device::crtc_update_row(mc6845_device *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param) { - const rgb_t *palette = palette_entry_list_raw(bitmap.palette()); - offs_t scroll_y = (((m_scroll >> 8) + 0x15) & 0xff) * 0x80; if (OPTION_80_COL) @@ -72,7 +70,7 @@ void wangpc_lvc_device::crtc_update_row(mc6845_device *device, bitmap_rgb32 &bit if (column == cursor_x) color = 0x03; - bitmap.pix32(y, x) = palette[color]; + bitmap.pix32(y, x) = m_palette[color]; data <<= 1; } @@ -94,7 +92,7 @@ void wangpc_lvc_device::crtc_update_row(mc6845_device *device, bitmap_rgb32 &bit if (column == cursor_x) color = 0x03; - bitmap.pix32(y, x) = palette[color]; + bitmap.pix32(y, x) = m_palette[color]; data <<= 1; } @@ -146,8 +144,6 @@ static MACHINE_CONFIG_FRAGMENT( wangpc_lvc ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) MCFG_SCREEN_REFRESH_RATE(60) - MCFG_PALETTE_LENGTH(16) - MCFG_MC6845_ADD(MC6845_TAG, MC6845_1, XTAL_14_31818MHz/16, crtc_intf) MACHINE_CONFIG_END @@ -351,7 +347,7 @@ void wangpc_lvc_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, U int g = BIT(data, 7) ? (i ? 0xff : 0x80) : 0; int b = BIT(data, 3) ? (i ? 0xff : 0x80) : 0; - palette_set_color_rgb(machine(), index, r, g, b); + m_palette[index] = MAKE_RGB(r, g, b); } break; diff --git a/src/mess/machine/wangpc_lvc.h b/src/mess/machine/wangpc_lvc.h index 7e604090d58..1625fac148a 100644 --- a/src/mess/machine/wangpc_lvc.h +++ b/src/mess/machine/wangpc_lvc.h @@ -57,6 +57,7 @@ private: // internal state required_device<mc6845_device> m_crtc; + rgb_t m_palette[16]; UINT16 *m_video_ram; UINT8 m_option; UINT16 m_scroll; diff --git a/src/mess/machine/wangpc_mvc.c b/src/mess/machine/wangpc_mvc.c index 32a6546113d..ff49c1a2365 100644 --- a/src/mess/machine/wangpc_mvc.c +++ b/src/mess/machine/wangpc_mvc.c @@ -47,6 +47,13 @@ #define ATTR_SUBSCRIPT BIT(attr, 6) #define ATTR_SUPERSCRIPT BIT(attr, 7) +static const rgb_t PALETTE[] = +{ + RGB_BLACK, + MAKE_RGB(0x00, 0x80, 0x00), + MAKE_RGB(0x00, 0xff, 0x00) +}; + //************************************************************************** @@ -62,8 +69,6 @@ const device_type WANGPC_MVC = &device_creator<wangpc_mvc_device>; void wangpc_mvc_device::crtc_update_row(mc6845_device *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param) { - const rgb_t *palette = palette_entry_list_raw(bitmap.palette()); - for (int sx = 0; sx < 50; sx++) { offs_t addr = (y * 50) + sx; @@ -74,7 +79,7 @@ void wangpc_mvc_device::crtc_update_row(mc6845_device *device, bitmap_rgb32 &bit int x = (sx * 16) + bit; int color = BIT(data, 15); - bitmap.pix32(y, x) = palette[color]; + bitmap.pix32(y, x) = PALETTE[color]; data <<= 1; } @@ -110,7 +115,7 @@ void wangpc_mvc_device::crtc_update_row(mc6845_device *device, bitmap_rgb32 &bit int color = ((BIT(data, 9) & !ATTR_BLANK) ^ ATTR_REVERSE); if ((color | bitmap.pix32(y, x)) & ATTR_BOLD) color = 2; - if (color) bitmap.pix32(y, x) = palette[color]; + if (color) bitmap.pix32(y, x) = PALETTE[color]; data <<= 1; } @@ -159,8 +164,6 @@ static MACHINE_CONFIG_FRAGMENT( wangpc_mvc ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) MCFG_SCREEN_REFRESH_RATE(60) - MCFG_PALETTE_LENGTH(3) - MCFG_MC6845_ADD(MC6845_TAG, MC6845_1, XTAL_14_31818MHz/16, crtc_intf) MACHINE_CONFIG_END @@ -223,11 +226,6 @@ void wangpc_mvc_device::device_start() m_char_ram = auto_alloc_array(machine(), UINT16, CHAR_RAM_SIZE); m_bitmap_ram = auto_alloc_array(machine(), UINT16, BITMAP_RAM_SIZE); - // initialize palette - palette_set_color_rgb(machine(), 0, 0, 0, 0); - palette_set_color_rgb(machine(), 1, 0, 0x80, 0); - palette_set_color_rgb(machine(), 2, 0, 0xff, 0); - // state saving save_pointer(NAME(m_video_ram), VIDEO_RAM_SIZE); save_pointer(NAME(m_char_ram), CHAR_RAM_SIZE); diff --git a/src/mess/video/abc1600.c b/src/mess/video/abc1600.c index bdfc54b5d74..6e95b7d0b99 100644 --- a/src/mess/video/abc1600.c +++ b/src/mess/video/abc1600.c @@ -991,7 +991,6 @@ void abc1600_state::crtc_update_row(device_t *device, bitmap_rgb32 &bitmap, cons { if (y > 0x3ff) return; - const rgb_t *palette = palette_entry_list_raw(bitmap.palette()); int x = HFP; for (int column = 0; column < x_count; column += 2) @@ -1007,7 +1006,7 @@ void abc1600_state::crtc_update_row(device_t *device, bitmap_rgb32 &bitmap, cons { int color = (BIT(data, 15) ^ PIX_POL) & !BLANK; - bitmap.pix32(y + VFP, x++) = palette[color]; + bitmap.pix32(y + VFP, x++) = RGB_MONOCHROME_GREEN[color]; data <<= 1; } @@ -1124,7 +1123,6 @@ MACHINE_CONFIG_FRAGMENT( abc1600_video ) MCFG_SCREEN_UPDATE_DRIVER(abc1600_state, screen_update) MCFG_SCREEN_SIZE(958, 1067) MCFG_SCREEN_VISIBLE_AREA(0, 958-1, 0, 1067-1) - MCFG_PALETTE_LENGTH(2) - MCFG_PALETTE_INIT(monochrome_green) + MCFG_MC6845_ADD(SY6845E_TAG, SY6845E, XTAL_64MHz/32, crtc_intf) MACHINE_CONFIG_END diff --git a/src/mess/video/abc80.c b/src/mess/video/abc80.c index 817e646a4c8..be7ede0f0cd 100644 --- a/src/mess/video/abc80.c +++ b/src/mess/video/abc80.c @@ -39,7 +39,7 @@ GFXDECODE_END // update_screen - //------------------------------------------------- -void abc80_state::update_screen(bitmap_ind16 &bitmap, const rectangle &cliprect) +void abc80_state::update_screen(bitmap_rgb32 &bitmap, const rectangle &cliprect) { int c = 0; int r = 0; @@ -135,7 +135,7 @@ void abc80_state::update_screen(bitmap_ind16 &bitmap, const rectangle &cliprect) color ^= (cursor & m_blink); color &= blank; - bitmap.pix16(y, x) = color; + bitmap.pix32(y, x) = RGB_MONOCHROME_WHITE[color]; data <<= 1; } @@ -199,7 +199,7 @@ void abc80_state::video_start() // SCREEN_UPDATE_IND16( abc80 ) //------------------------------------------------- -UINT32 abc80_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 abc80_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { update_screen(bitmap, cliprect); @@ -217,8 +217,5 @@ MACHINE_CONFIG_FRAGMENT( abc80_video ) MCFG_GFXDECODE(abc80) - MCFG_PALETTE_LENGTH(2) - MCFG_PALETTE_INIT(black_and_white) - MCFG_SCREEN_RAW_PARAMS(XTAL_11_9808MHz/2, ABC80_HTOTAL, ABC80_HBEND, ABC80_HBSTART, ABC80_VTOTAL, ABC80_VBEND, ABC80_VBSTART) MACHINE_CONFIG_END diff --git a/src/mess/video/abc800.c b/src/mess/video/abc800.c index 1377620aee0..e7b32bdaa9a 100644 --- a/src/mess/video/abc800.c +++ b/src/mess/video/abc800.c @@ -229,23 +229,11 @@ MACHINE_CONFIG_END //************************************************************************** //------------------------------------------------- -// PALETTE_INIT( abc800m ) -//------------------------------------------------- - -static PALETTE_INIT( abc800m ) -{ - palette_set_color_rgb(machine, 0, 0x00, 0x00, 0x00); // black - palette_set_color_rgb(machine, 1, 0xff, 0xff, 0x00); // yellow -} - - -//------------------------------------------------- // hr_update - high resolution screen update //------------------------------------------------- void abc800m_state::hr_update(bitmap_rgb32 &bitmap, const rectangle &cliprect) { - const rgb_t *palette = palette_entry_list_raw(bitmap.palette()); UINT16 addr = 0; for (int y = m_hrs + VERTICAL_PORCH_HACK; y < MIN(cliprect.max_y + 1, m_hrs + VERTICAL_PORCH_HACK + 240); y++) @@ -261,8 +249,8 @@ void abc800m_state::hr_update(bitmap_rgb32 &bitmap, const rectangle &cliprect) UINT16 fgctl_addr = ((m_fgctl & 0x7f) << 2) | ((data >> 6) & 0x03); int color = (m_fgctl_prom[fgctl_addr] & 0x07) ? 1 : 0; - bitmap.pix32(y, x++) = palette[color]; - bitmap.pix32(y, x++) = palette[color]; + bitmap.pix32(y, x++) = RGB_MONOCHROME_YELLOW[color]; + bitmap.pix32(y, x++) = RGB_MONOCHROME_YELLOW[color]; data <<= 2; } @@ -278,7 +266,6 @@ void abc800m_state::hr_update(bitmap_rgb32 &bitmap, const rectangle &cliprect) static MC6845_UPDATE_ROW( abc800m_update_row ) { abc800m_state *state = device->machine().driver_data<abc800m_state>(); - const rgb_t *palette = palette_entry_list_raw(bitmap.palette()); int column; @@ -307,7 +294,7 @@ static MC6845_UPDATE_ROW( abc800m_update_row ) if (BIT(data, 7)) { - bitmap.pix32(y, x) = palette[1]; + bitmap.pix32(y, x) = RGB_MONOCHROME_YELLOW[1]; } data <<= 1; @@ -374,7 +361,4 @@ MACHINE_CONFIG_FRAGMENT( abc800m_video ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) MCFG_SCREEN_SIZE(768, 312) MCFG_SCREEN_VISIBLE_AREA(0,768-1, 0, 312-1) - - MCFG_PALETTE_LENGTH(2) - MCFG_PALETTE_INIT(abc800m) MACHINE_CONFIG_END diff --git a/src/mess/video/abc802.c b/src/mess/video/abc802.c index 6e15fe92ee6..5e0b8a2207d 100644 --- a/src/mess/video/abc802.c +++ b/src/mess/video/abc802.c @@ -61,7 +61,6 @@ static MC6845_UPDATE_ROW( abc802_update_row ) */ abc802_state *state = device->machine().driver_data<abc802_state>(); - const rgb_t *palette = palette_entry_list_raw(bitmap.palette()); int rf = 0, rc = 0, rg = 0; @@ -134,7 +133,7 @@ static MC6845_UPDATE_ROW( abc802_update_row ) int x = HORIZONTAL_PORCH_HACK + ((column + 3) * ABC800_CHAR_WIDTH) + bit; int color = BIT(data, 7) ^ ri; - bitmap.pix32(y, x) = palette[color]; + bitmap.pix32(y, x) = RGB_MONOCHROME_AMBER[color]; data <<= 1; } @@ -146,8 +145,8 @@ static MC6845_UPDATE_ROW( abc802_update_row ) int x = HORIZONTAL_PORCH_HACK + ((column + 3) * ABC800_CHAR_WIDTH) + (bit << 1); int color = BIT(data, 7) ^ ri; - bitmap.pix32(y, x) = palette[color]; - bitmap.pix32(y, x + 1) = palette[color]; + bitmap.pix32(y, x) = RGB_MONOCHROME_AMBER[color]; + bitmap.pix32(y, x + 1) = RGB_MONOCHROME_AMBER[color]; data <<= 1; } @@ -249,7 +248,4 @@ MACHINE_CONFIG_FRAGMENT( abc802_video ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) MCFG_SCREEN_SIZE(768, 312) MCFG_SCREEN_VISIBLE_AREA(0,768-1, 0, 312-1) - - MCFG_PALETTE_LENGTH(2) - MCFG_PALETTE_INIT(monochrome_amber) MACHINE_CONFIG_END diff --git a/src/mess/video/abc806.c b/src/mess/video/abc806.c index 0c354474be1..9a9b49e6487 100644 --- a/src/mess/video/abc806.c +++ b/src/mess/video/abc806.c @@ -24,22 +24,17 @@ #define VERTICAL_PORCH_HACK 27 - -//------------------------------------------------- -// PALETTE_INIT( abc806 ) -//------------------------------------------------- - -static PALETTE_INIT( abc806 ) +static const rgb_t PALETTE[] = { - palette_set_color_rgb(machine, 0, 0x00, 0x00, 0x00); // black - palette_set_color_rgb(machine, 1, 0xff, 0x00, 0x00); // red - palette_set_color_rgb(machine, 2, 0x00, 0xff, 0x00); // green - palette_set_color_rgb(machine, 3, 0xff, 0xff, 0x00); // yellow - palette_set_color_rgb(machine, 4, 0x00, 0x00, 0xff); // blue - palette_set_color_rgb(machine, 5, 0xff, 0x00, 0xff); // magenta - palette_set_color_rgb(machine, 6, 0x00, 0xff, 0xff); // cyan - palette_set_color_rgb(machine, 7, 0xff, 0xff, 0xff); // white -} + RGB_BLACK, // black + MAKE_RGB(0xff, 0x00, 0x00), // red + MAKE_RGB(0x00, 0xff, 0x00), // green + MAKE_RGB(0xff, 0xff, 0x00), // yellow + MAKE_RGB(0x00, 0x00, 0xff), // blue + MAKE_RGB(0xff, 0x00, 0xff), // magenta + MAKE_RGB(0x00, 0xff, 0xff), // cyan + RGB_WHITE // white +}; //------------------------------------------------- @@ -242,7 +237,6 @@ WRITE8_MEMBER( abc806_state::sso_w ) static MC6845_UPDATE_ROW( abc806_update_row ) { abc806_state *state = device->machine().driver_data<abc806_state>(); - const rgb_t *palette = palette_entry_list_raw(bitmap.palette()); // UINT8 old_data = 0xff; int fg_color = 7; @@ -333,11 +327,11 @@ static MC6845_UPDATE_ROW( abc806_update_row ) { int color = BIT(chargen_data, 7) ? fg_color : bg_color; - bitmap.pix32(y, x++) = palette[color]; + bitmap.pix32(y, x++) = PALETTE[color]; if (e5 || e6) { - bitmap.pix32(y, x++) = palette[color]; + bitmap.pix32(y, x++) = PALETTE[color]; } chargen_data <<= 1; @@ -436,7 +430,6 @@ static const mc6845_interface crtc_intf = void abc806_state::hr_update(bitmap_rgb32 &bitmap, const rectangle &cliprect) { - const rgb_t *palette = palette_entry_list_raw(bitmap.palette()); UINT32 addr = (m_hrs & 0x0f) << 15; for (int y = m_sync + VERTICAL_PORCH_HACK; y < MIN(cliprect.max_y + 1, m_sync + VERTICAL_PORCH_HACK + 240); y++) @@ -450,9 +443,9 @@ void abc806_state::hr_update(bitmap_rgb32 &bitmap, const rectangle &cliprect) { int x = HORIZONTAL_PORCH_HACK + (ABC800_CHAR_WIDTH * 4) - 16 + (sx * 4) + pixel; - if (BIT(dot, 15) || bitmap.pix32(y, x) == palette[0]) + if (BIT(dot, 15) || (bitmap.pix32(y, x) == RGB_BLACK)) { - bitmap.pix32(y, x) = palette[(dot >> 12) & 0x07]; + bitmap.pix32(y, x) = PALETTE[(dot >> 12) & 0x07]; } dot <<= 4; @@ -547,8 +540,4 @@ MACHINE_CONFIG_FRAGMENT( abc806_video ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) MCFG_SCREEN_SIZE(768, 312) MCFG_SCREEN_VISIBLE_AREA(0, 768-1, 0, 312-1) - - MCFG_PALETTE_LENGTH(8) - - MCFG_PALETTE_INIT(abc806) MACHINE_CONFIG_END 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 diff --git a/src/mess/video/comx35.c b/src/mess/video/comx35.c index 4b8cd7a4525..d75da727c28 100644 --- a/src/mess/video/comx35.c +++ b/src/mess/video/comx35.c @@ -109,20 +109,6 @@ void comx35_state::video_start() save_pointer(NAME(m_charram), COMX35_CHARRAM_SIZE); } -UINT32 comx35_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - if (screen.width() == CDP1869_SCREEN_WIDTH) - { - m_vis->screen_update(screen, bitmap, cliprect); - } - else - { - m_expansion->screen_update(screen, bitmap, cliprect); - } - - return 0; -} - /* Machine Drivers */ MACHINE_CONFIG_FRAGMENT( comx35_pal_video ) diff --git a/src/mess/video/newbrain.c b/src/mess/video/newbrain.c index 221ea918c27..fd74238d029 100644 --- a/src/mess/video/newbrain.c +++ b/src/mess/video/newbrain.c @@ -13,7 +13,7 @@ void newbrain_state::video_start() save_item(NAME(m_segment_data)); } -void newbrain_state::screen_update(bitmap_ind16 &bitmap, const rectangle &cliprect) +void newbrain_state::screen_update(bitmap_rgb32 &bitmap, const rectangle &cliprect) { address_space *program = m_maincpu->space(AS_PROGRAM); @@ -67,11 +67,11 @@ void newbrain_state::screen_update(bitmap_ind16 &bitmap, const rectangle &clipre { int color = BIT(charrom_data, 7) ^ rv; - bitmap.pix16(y, x++) = color; + bitmap.pix32(y, x++) = RGB_MONOCHROME_WHITE[color]; if (columns == 40) { - bitmap.pix16(y, x++) = color; + bitmap.pix32(y, x++) = RGB_MONOCHROME_WHITE[color]; } charrom_data <<= 1; @@ -101,7 +101,7 @@ void newbrain_state::screen_update(bitmap_ind16 &bitmap, const rectangle &clipre } } -UINT32 newbrain_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 newbrain_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { if (m_enrg1 & NEWBRAIN_ENRG1_TVP) { @@ -109,7 +109,7 @@ UINT32 newbrain_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap } else { - bitmap.fill(get_black_pen(machine()), cliprect); + bitmap.fill(RGB_BLACK, cliprect); } return 0; @@ -126,7 +126,4 @@ MACHINE_CONFIG_FRAGMENT( newbrain_video ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ MCFG_SCREEN_SIZE(640, 250) MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 249) - - MCFG_PALETTE_LENGTH(2) - MCFG_PALETTE_INIT(black_and_white) MACHINE_CONFIG_END diff --git a/src/mess/video/pc1512.c b/src/mess/video/pc1512.c index 07aaa83c529..e394a281499 100644 --- a/src/mess/video/pc1512.c +++ b/src/mess/video/pc1512.c @@ -9,6 +9,26 @@ #define LOG 0 +static const rgb_t PALETTE[] = +{ + RGB_BLACK, + MAKE_RGB(0x00, 0x00, 0xaa), + MAKE_RGB(0x00, 0xaa, 0x00), + MAKE_RGB(0x00, 0xaa, 0xaa), + MAKE_RGB(0xaa, 0x00, 0x00), + MAKE_RGB(0xaa, 0x00, 0xaa), + MAKE_RGB(0xaa, 0x55, 0x00), + MAKE_RGB(0xaa, 0xaa, 0xaa), + MAKE_RGB(0x55, 0x55, 0x55), + MAKE_RGB(0x55, 0x55, 0xff), + MAKE_RGB(0x55, 0xff, 0x55), + MAKE_RGB(0x55, 0xff, 0xff), + MAKE_RGB(0xff, 0x55, 0x55), + MAKE_RGB(0xff, 0x55, 0xff), + MAKE_RGB(0xff, 0xff, 0x55), + RGB_WHITE +}; + static const int PALETTE_0[] = { 0, 3, 5, 7 }; static const int PALETTE_1[] = { 0, 2, 4, 6 }; static const int PALETTE_2[] = { 0, 3, 4, 7 }; @@ -43,36 +63,6 @@ enum //************************************************************************** -// PALETTE -//************************************************************************** - -//------------------------------------------------- -// PALETTE_INIT( pc1512 ) -//------------------------------------------------- - -static PALETTE_INIT( pc1512 ) -{ - palette_set_color_rgb(machine, 0, 0x00, 0x00, 0x00); - palette_set_color_rgb(machine, 1, 0x00, 0x00, 0xaa); - palette_set_color_rgb(machine, 2, 0x00, 0xaa, 0x00); - palette_set_color_rgb(machine, 3, 0x00, 0xaa, 0xaa); - palette_set_color_rgb(machine, 4, 0xaa, 0x00, 0x00); - palette_set_color_rgb(machine, 5, 0xaa, 0x00, 0xaa); - palette_set_color_rgb(machine, 6, 0xaa, 0x55, 0x00); - palette_set_color_rgb(machine, 7, 0xaa, 0xaa, 0xaa); - palette_set_color_rgb(machine, 8, 0x55, 0x55, 0x55); - palette_set_color_rgb(machine, 9, 0x55, 0x55, 0xff); - palette_set_color_rgb(machine, 10, 0x55, 0xff, 0x55); - palette_set_color_rgb(machine, 11, 0x55, 0xff, 0xff); - palette_set_color_rgb(machine, 12, 0xff, 0x55, 0x55); - palette_set_color_rgb(machine, 13, 0xff, 0x55, 0xff); - palette_set_color_rgb(machine, 14, 0xff, 0xff, 0x55); - palette_set_color_rgb(machine, 15, 0xff, 0xff, 0xff); -} - - - -//************************************************************************** // VIDEO RAM ACCESS //************************************************************************** @@ -403,10 +393,9 @@ offs_t pc1512_state::get_char_rom_offset() return ((ioport("LK")->read() >> 5) & 0x03) << 11; } -void pc1512_state::draw_alpha(mc6845_device *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param) +void pc1512_state::draw_alpha(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param) { offs_t char_rom_offset = get_char_rom_offset(); - const rgb_t *palette = palette_entry_list_raw(bitmap.palette()); UINT32 *p = &bitmap.pix32(y + VFP_HIRES, HFP_HIRES); if (get_display_mode(m_vdu_mode) == ALPHA_40) @@ -443,7 +432,7 @@ void pc1512_state::draw_alpha(mc6845_device *device, bitmap_rgb32 &bitmap, const { int color = BIT(data, 7) ? fg : bg; - *p = palette[color]; p++; + *p = PALETTE[color]; p++; data <<= 1; } @@ -473,12 +462,11 @@ int pc1512_state::get_color(UINT8 data) return color; }; -void pc1512_state::draw_graphics_1(mc6845_device *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param) +void pc1512_state::draw_graphics_1(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param) { if (y > 199) return; UINT32 *p = &bitmap.pix32(y + VFP_LORES, HFP_LORES); - const rgb_t *palette = palette_entry_list_raw(bitmap.palette()); for (int column = 0; column < x_count; column++) { @@ -488,18 +476,17 @@ void pc1512_state::draw_graphics_1(mc6845_device *device, bitmap_rgb32 &bitmap, for (int x = 0; x < 8; x++) { - *p = palette[get_color((BIT(b, 15) << 1) | BIT(b, 14))]; p++; + *p = PALETTE[get_color((BIT(b, 15) << 1) | BIT(b, 14))]; p++; b <<= 2; } } } -void pc1512_state::draw_graphics_2(mc6845_device *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param) +void pc1512_state::draw_graphics_2(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param) { if (y > 199) return; UINT32 *p = &bitmap.pix32(y + VFP_HIRES, HFP_HIRES); - const rgb_t *palette = palette_entry_list_raw(bitmap.palette()); for (int column = 0; column < x_count; column++) { @@ -512,7 +499,7 @@ void pc1512_state::draw_graphics_2(mc6845_device *device, bitmap_rgb32 &bitmap, for (int x = 0; x < 16; x++) { - *p = palette[(BIT(i, 15) << 3) | (BIT(r, 15) << 2) | (BIT(g, 15) << 1) | BIT(b, 15)]; p++; + *p = PALETTE[(BIT(i, 15) << 3) | (BIT(r, 15) << 2) | (BIT(g, 15) << 1) | BIT(b, 15)]; p++; i <<= 1; r <<= 1; g <<= 1; b <<= 1; } } @@ -526,15 +513,15 @@ static MC6845_UPDATE_ROW( pc1512_update_row ) { case ALPHA_40: case ALPHA_80: - state->draw_alpha(device, bitmap, cliprect, ma, ra, y, x_count, cursor_x, param); + state->draw_alpha(bitmap, cliprect, ma, ra, y, x_count, cursor_x, param); break; case GRAPHICS_1: - state->draw_graphics_1(device, bitmap, cliprect, ma, ra, y, x_count, cursor_x, param); + state->draw_graphics_1(bitmap, cliprect, ma, ra, y, x_count, cursor_x, param); break; case GRAPHICS_2: - state->draw_graphics_2(device, bitmap, cliprect, ma, ra, y, x_count, cursor_x, param); + state->draw_graphics_2(bitmap, cliprect, ma, ra, y, x_count, cursor_x, param); break; } } @@ -574,7 +561,6 @@ void pc1512_state::video_start() UINT32 pc1512_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - const rgb_t *palette = palette_entry_list_raw(bitmap.palette()); if (m_vdu_mode & MODE_ENABLE_VIDEO) { m_blink_ctr++; @@ -608,11 +594,11 @@ UINT32 pc1512_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, case ALPHA_40: case ALPHA_80: case GRAPHICS_1: - bitmap.fill(palette[m_vdu_color & 0x0f], cliprect); + bitmap.fill(PALETTE[m_vdu_color & 0x0f], cliprect); break; case GRAPHICS_2: - bitmap.fill(palette[m_vdu_border & 0x0f], cliprect); + bitmap.fill(PALETTE[m_vdu_border & 0x0f], cliprect); break; } @@ -620,7 +606,7 @@ UINT32 pc1512_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, } else { - bitmap.fill(palette[0], cliprect); + bitmap.fill(RGB_BLACK, cliprect); } return 0; @@ -639,8 +625,5 @@ MACHINE_CONFIG_FRAGMENT( pc1512_video ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) MCFG_SCREEN_REFRESH_RATE(50) - MCFG_PALETTE_LENGTH(16) - MCFG_PALETTE_INIT(pc1512) - MCFG_MC6845_ADD(AMS40041_TAG, AMS40041, XTAL_28_63636MHz/32, crtc_intf) MACHINE_CONFIG_END diff --git a/src/mess/video/tmc1800.c b/src/mess/video/tmc1800.c index f71a97689f7..aab430f5464 100644 --- a/src/mess/video/tmc1800.c +++ b/src/mess/video/tmc1800.c @@ -73,7 +73,7 @@ static CDP1864_INTERFACE( nano_cdp1864_intf ) /* OSM-200 */ -UINT32 osc1000b_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 osc1000b_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return 0; } @@ -82,10 +82,6 @@ UINT32 osc1000b_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap MACHINE_CONFIG_FRAGMENT( tmc1800_video ) MCFG_CDP1861_SCREEN_ADD(CDP1861_TAG, SCREEN_TAG, XTAL_1_75MHz) - - MCFG_PALETTE_LENGTH(2) - MCFG_PALETTE_INIT(black_and_white) - MCFG_CDP1861_ADD(CDP1861_TAG, XTAL_1_75MHz, tmc1800_cdp1861_intf) MACHINE_CONFIG_END @@ -95,17 +91,12 @@ MACHINE_CONFIG_FRAGMENT( osc1000b_video ) MCFG_SCREEN_REFRESH_RATE(50) MCFG_SCREEN_SIZE(320, 200) MCFG_SCREEN_VISIBLE_AREA(0, 319, 0, 199) - - MCFG_PALETTE_LENGTH(2) - MCFG_PALETTE_INIT(black_and_white) MACHINE_CONFIG_END MACHINE_CONFIG_FRAGMENT( tmc2000_video ) MCFG_CDP1864_SCREEN_ADD(SCREEN_TAG, XTAL_1_75MHz) MCFG_SCREEN_UPDATE_DEVICE(CDP1864_TAG, cdp1864_device, screen_update) - MCFG_PALETTE_LENGTH(8+8) - MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_CDP1864_ADD(CDP1864_TAG, XTAL_1_75MHz, tmc2000_cdp1864_intf) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) @@ -115,8 +106,6 @@ MACHINE_CONFIG_FRAGMENT( nano_video ) MCFG_CDP1864_SCREEN_ADD(SCREEN_TAG, XTAL_1_75MHz) MCFG_SCREEN_UPDATE_DEVICE(CDP1864_TAG, cdp1864_device, screen_update) - MCFG_PALETTE_LENGTH(8+8) - MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_CDP1864_ADD(CDP1864_TAG, XTAL_1_75MHz, nano_cdp1864_intf) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) diff --git a/src/mess/video/uv201.c b/src/mess/video/uv201.c index b38a7223220..51541148794 100644 --- a/src/mess/video/uv201.c +++ b/src/mess/video/uv201.c @@ -81,7 +81,7 @@ ((_y >= cliprect.min_y) && (_y <= cliprect.max_y)) #define DRAW_PIXEL(_scanline, _dot) \ - if (IS_VISIBLE(_scanline)) bitmap.pix16((_scanline), HSYNC_WIDTH + HFP_WIDTH + _dot) = pixel; + if (IS_VISIBLE(_scanline)) bitmap.pix32((_scanline), HSYNC_WIDTH + HFP_WIDTH + _dot) = m_palette[pixel]; @@ -239,14 +239,14 @@ void uv201_device::initialize_palette() onvalue = onhiintensity; } - palette_set_color_rgb(machine(), offset + 0, offvalue, offvalue, offvalue); // black - palette_set_color_rgb(machine(), offset + 1, onvalue, offvalue, offvalue); // red - palette_set_color_rgb(machine(), offset + 2, offvalue, onvalue, offvalue); // green - palette_set_color_rgb(machine(), offset + 3, onvalue, onvalue, offvalue); // red-green - palette_set_color_rgb(machine(), offset + 4, offvalue, offvalue, onvalue); // blue - palette_set_color_rgb(machine(), offset + 5, onvalue, offvalue, onvalue); // red-blue - palette_set_color_rgb(machine(), offset + 6, offvalue, onvalue, onvalue); // green-blue - palette_set_color_rgb(machine(), offset + 7, onvalue, onvalue, onvalue); // white + m_palette[offset + 0] = MAKE_RGB(offvalue, offvalue, offvalue); // black + m_palette[offset + 1] = MAKE_RGB(onvalue, offvalue, offvalue); // red + m_palette[offset + 2] = MAKE_RGB(offvalue, onvalue, offvalue); // green + m_palette[offset + 3] = MAKE_RGB(onvalue, onvalue, offvalue); // red-green + m_palette[offset + 4] = MAKE_RGB(offvalue, offvalue, onvalue); // blue + m_palette[offset + 5] = MAKE_RGB(onvalue, offvalue, onvalue); // red-blue + m_palette[offset + 6] = MAKE_RGB(offvalue, onvalue, onvalue); // green-blue + m_palette[offset + 7] = MAKE_RGB(onvalue, onvalue, onvalue); // white } } @@ -496,7 +496,7 @@ READ_LINE_MEMBER( uv201_device::kbd_r ) // screen_update - //------------------------------------------------- -UINT32 uv201_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 uv201_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { bitmap.fill(get_black_pen(machine()), cliprect); diff --git a/src/mess/video/uv201.h b/src/mess/video/uv201.h index d5914e9a74b..f3fe22eb455 100644 --- a/src/mess/video/uv201.h +++ b/src/mess/video/uv201.h @@ -70,8 +70,7 @@ MCFG_DEVICE_CONFIG(_config) \ MCFG_SCREEN_ADD(_screen_tag, RASTER) \ MCFG_SCREEN_UPDATE_DEVICE(_tag, uv201_device, screen_update) \ - MCFG_SCREEN_RAW_PARAMS(_clock, 232, 18, 232, 262, 21, 262) \ - MCFG_PALETTE_LENGTH(32) + MCFG_SCREEN_RAW_PARAMS(_clock, 232, 18, 232, 262, 21, 262) #define UV201_INTERFACE(name) \ @@ -110,7 +109,7 @@ public: DECLARE_WRITE_LINE_MEMBER( ext_int_w ); DECLARE_READ_LINE_MEMBER( kbd_r ); - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: // device-level overrides @@ -140,6 +139,7 @@ private: screen_device *m_screen; + rgb_t m_palette[32]; UINT8 m_ram[0x90]; UINT8 m_y_int; UINT8 m_fmod; diff --git a/src/mess/video/zx8301.c b/src/mess/video/zx8301.c index c828c0cd12c..426f2202435 100644 --- a/src/mess/video/zx8301.c +++ b/src/mess/video/zx8301.c @@ -33,6 +33,19 @@ static const int ZX8301_COLOR_MODE4[] = { 0, 2, 4, 7 }; +static const rgb_t PALETTE[] = +{ + MAKE_RGB(0x00, 0x00, 0x00), // black + MAKE_RGB(0x00, 0x00, 0xff), // blue + MAKE_RGB(0xff, 0x00, 0x00), // red + MAKE_RGB(0xff, 0x00, 0xff), // magenta + MAKE_RGB(0x00, 0xff, 0x00), // green + MAKE_RGB(0x00, 0xff, 0xff), // cyan + MAKE_RGB(0xff, 0xff, 0x00), // yellow + MAKE_RGB(0xff, 0xff, 0xff) // white +}; + + //************************************************************************** // GLOBAL VARIABLES @@ -254,7 +267,7 @@ WRITE8_MEMBER( zx8301_device::data_w ) // draw_line_mode4 - draw mode 4 line //------------------------------------------------- -void zx8301_device::draw_line_mode4(bitmap_ind16 &bitmap, int y, UINT16 da) +void zx8301_device::draw_line_mode4(bitmap_rgb32 &bitmap, int y, UINT16 da) { int x = 0; @@ -269,7 +282,7 @@ void zx8301_device::draw_line_mode4(bitmap_ind16 &bitmap, int y, UINT16 da) int green = BIT(byte_high, 7); int color = (green << 1) | red; - bitmap.pix16(y, x++) = ZX8301_COLOR_MODE4[color]; + bitmap.pix32(y, x++) = PALETTE[ZX8301_COLOR_MODE4[color]]; byte_high <<= 1; byte_low <<= 1; @@ -282,7 +295,7 @@ void zx8301_device::draw_line_mode4(bitmap_ind16 &bitmap, int y, UINT16 da) // draw_line_mode8 - draw mode 8 line //------------------------------------------------- -void zx8301_device::draw_line_mode8(bitmap_ind16 &bitmap, int y, UINT16 da) +void zx8301_device::draw_line_mode8(bitmap_rgb32 &bitmap, int y, UINT16 da) { int x = 0; @@ -305,8 +318,8 @@ void zx8301_device::draw_line_mode8(bitmap_ind16 &bitmap, int y, UINT16 da) color = 0; } - bitmap.pix16(y, x++) = color; - bitmap.pix16(y, x++) = color; + bitmap.pix32(y, x++) = PALETTE[color]; + bitmap.pix32(y, x++) = PALETTE[color]; byte_high <<= 2; byte_low <<= 2; @@ -316,10 +329,10 @@ void zx8301_device::draw_line_mode8(bitmap_ind16 &bitmap, int y, UINT16 da) //------------------------------------------------- -// update_screen - +// screen_update - //------------------------------------------------- -void zx8301_device::update_screen(bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 zx8301_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { if (!m_dispoff) { @@ -341,6 +354,8 @@ void zx8301_device::update_screen(bitmap_ind16 &bitmap, const rectangle &cliprec } else { - bitmap.fill(get_black_pen(machine()), cliprect); + bitmap.fill(RGB_BLACK, cliprect); } + + return 0; } diff --git a/src/mess/video/zx8301.h b/src/mess/video/zx8301.h index 52be5bf8730..ba776bf3f59 100644 --- a/src/mess/video/zx8301.h +++ b/src/mess/video/zx8301.h @@ -88,7 +88,7 @@ public: DECLARE_READ8_MEMBER( data_r ); DECLARE_WRITE8_MEMBER( data_w ); - void update_screen(bitmap_ind16 &bitmap, const rectangle &cliprect); + UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: // device-level overrides @@ -105,8 +105,8 @@ protected: inline UINT8 readbyte(offs_t address); inline void writebyte(offs_t address, UINT8 data); - void draw_line_mode4(bitmap_ind16 &bitmap, int y, UINT16 da); - void draw_line_mode8(bitmap_ind16 &bitmap, int y, UINT16 da); + void draw_line_mode4(bitmap_rgb32 &bitmap, int y, UINT16 da); + void draw_line_mode8(bitmap_rgb32 &bitmap, int y, UINT16 da); private: static const device_timer_id TIMER_VSYNC = 0; |