From d5432ba6140c06205466a1a3dcd69797a1f34a69 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Thu, 30 Jul 2015 11:19:02 +0200 Subject: nascom avc: use standard 3-bit rgb palette --- src/emu/bus/nasbus/avc.c | 17 ++++------------- src/emu/bus/nasbus/avc.h | 3 +-- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/src/emu/bus/nasbus/avc.c b/src/emu/bus/nasbus/avc.c index 35b86e09420..8960a19573f 100644 --- a/src/emu/bus/nasbus/avc.c +++ b/src/emu/bus/nasbus/avc.c @@ -25,6 +25,8 @@ static MACHINE_CONFIG_FRAGMENT( nascom_avc ) MCFG_SCREEN_RAW_PARAMS(16250000, 1024, 0, 768, 320, 0, 256) MCFG_SCREEN_UPDATE_DEVICE("mc6845", mc6845_device, screen_update) + MCFG_PALETTE_ADD_3BIT_RGB("palette") + MCFG_MC6845_ADD("mc6845", MC6845, "screen", XTAL_16MHz / 8) MCFG_MC6845_SHOW_BORDER_AREA(false) MCFG_MC6845_CHAR_WIDTH(6) @@ -36,18 +38,6 @@ machine_config_constructor nascom_avc_device::device_mconfig_additions() const return MACHINE_CONFIG_NAME( nascom_avc ); } -const rgb_t nascom_avc_device::m_palette[] = -{ - rgb_t::black, - rgb_t(0xff, 0x00, 0x00), - rgb_t(0x00, 0xff, 0x00), - rgb_t(0xff, 0xff, 0x00), - rgb_t(0x00, 0x00, 0xff), - rgb_t(0xff, 0x00, 0xff), - rgb_t(0x00, 0xff, 0xff), - rgb_t::white, -}; - //************************************************************************** // LIVE DEVICE @@ -61,6 +51,7 @@ nascom_avc_device::nascom_avc_device(const machine_config &mconfig, const char * device_t(mconfig, NASCOM_AVC, "Nascom Advanced Video Card", tag, owner, clock, "nascom_avc", __FILE__), device_nasbus_card_interface(mconfig, *this), m_crtc(*this, "mc6845"), + m_palette(*this, "palette"), m_control(0x80) { } @@ -130,7 +121,7 @@ MC6845_UPDATE_ROW( nascom_avc_device::crtc_update_row ) } // plot the pixel - bitmap.pix32(y, x) = m_palette[(b << 2) | (g << 1) | (r << 0)]; + bitmap.pix32(y, x) = m_palette->pen_color((b << 2) | (g << 1) | (r << 0)); } } diff --git a/src/emu/bus/nasbus/avc.h b/src/emu/bus/nasbus/avc.h index bcd22b09050..754781fc70e 100644 --- a/src/emu/bus/nasbus/avc.h +++ b/src/emu/bus/nasbus/avc.h @@ -41,14 +41,13 @@ protected: private: required_device m_crtc; + required_device m_palette; std::vector m_r_ram; std::vector m_g_ram; std::vector m_b_ram; UINT8 m_control; - - static const rgb_t m_palette[]; }; // device type definition -- cgit v1.2.3