diff options
Diffstat (limited to 'src')
44 files changed, 187 insertions, 151 deletions
diff --git a/src/emu/bus/c64/xl80.c b/src/emu/bus/c64/xl80.c index 3169479f4f7..e58624a5ea6 100644 --- a/src/emu/bus/c64/xl80.c +++ b/src/emu/bus/c64/xl80.c @@ -83,6 +83,8 @@ const rom_entry *c64_xl80_device::device_rom_region() const void c64_xl80_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 pen_t *pen = m_palette->pens(); + for (int column = 0; column < x_count; column++) { UINT8 code = m_ram[((ma + column) & 0x7ff)]; @@ -99,7 +101,7 @@ void c64_xl80_device::crtc_update_row(mc6845_device *device, bitmap_rgb32 &bitma int x = (column * 8) + bit; int color = BIT(data, 7); - bitmap.pix32(y, x) = RGB_MONOCHROME_WHITE[color]; + bitmap.pix32(y, x) = pen[color]; data <<= 1; } @@ -150,6 +152,7 @@ static MACHINE_CONFIG_FRAGMENT( c64_xl80 ) MCFG_SCREEN_REFRESH_RATE(50) MCFG_GFXDECODE_ADD("gfxdecode", c64_xl80) + MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette") MCFG_MC6845_ADD(HD46505SP_TAG, H46505, MC6845_SCREEN_TAG, XTAL_14_31818MHz, crtc_intf) MACHINE_CONFIG_END @@ -179,6 +182,7 @@ c64_xl80_device::c64_xl80_device(const machine_config &mconfig, const char *tag, device_t(mconfig, C64_XL80, "XL 80", tag, owner, clock, "c64_xl80", __FILE__), device_c64_expansion_card_interface(mconfig, *this), m_crtc(*this, HD46505SP_TAG), + m_palette(*this, "palette"), m_char_rom(*this, HD46505SP_TAG), m_ram(*this, "ram") { diff --git a/src/emu/bus/c64/xl80.h b/src/emu/bus/c64/xl80.h index a8ec1aadb53..c65a87e288c 100644 --- a/src/emu/bus/c64/xl80.h +++ b/src/emu/bus/c64/xl80.h @@ -54,6 +54,7 @@ protected: private: required_device<h46505_device> m_crtc; + required_device<palette_device> m_palette; required_memory_region m_char_rom; optional_shared_ptr<UINT8> m_ram; }; diff --git a/src/emu/bus/comx35/clm.c b/src/emu/bus/comx35/clm.c index ca9af5b1977..45ec4db61c8 100644 --- a/src/emu/bus/comx35/clm.c +++ b/src/emu/bus/comx35/clm.c @@ -116,9 +116,8 @@ void comx_clm_device::crtc_update_row(mc6845_device *device, bitmap_rgb32 &bitma for (int bit = 0; bit < 8; bit++) { int x = (column * 8) + bit; - int color = BIT(data, 7) ? 7 : 0; - bitmap.pix32(y, x) = RGB_MONOCHROME_WHITE[color]; + bitmap.pix32(y, x) = m_palette->pen(BIT(data, 7)); data <<= 1; } @@ -169,6 +168,7 @@ static MACHINE_CONFIG_FRAGMENT( comx_clm ) MCFG_SCREEN_REFRESH_RATE(50) MCFG_GFXDECODE_ADD("gfxdecode", comx_clm) + MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette") MCFG_MC6845_ADD(MC6845_TAG, MC6845, MC6845_SCREEN_TAG, XTAL_14_31818MHz/7, crtc_intf) MACHINE_CONFIG_END @@ -198,6 +198,7 @@ comx_clm_device::comx_clm_device(const machine_config &mconfig, const char *tag, device_t(mconfig, COMX_CLM, "COMX 80 Column Card", tag, owner, clock, "comx_clm", __FILE__), device_comx_expansion_card_interface(mconfig, *this), m_crtc(*this, MC6845_TAG), + m_palette(*this, "palette"), m_rom(*this, "c000"), m_char_rom(*this, MC6845_TAG), m_video_ram(*this, "video_ram") diff --git a/src/emu/bus/comx35/clm.h b/src/emu/bus/comx35/clm.h index 401d7f01f0d..2c6ee128724 100644 --- a/src/emu/bus/comx35/clm.h +++ b/src/emu/bus/comx35/clm.h @@ -52,6 +52,7 @@ protected: private: required_device<mc6845_device> m_crtc; + required_device<palette_device> m_palette; required_memory_region m_rom; required_memory_region m_char_rom; optional_shared_ptr<UINT8> m_video_ram; diff --git a/src/emu/bus/ecbbus/grip.c b/src/emu/bus/ecbbus/grip.c index bc626c73182..e83e0bf4e56 100644 --- a/src/emu/bus/ecbbus/grip.c +++ b/src/emu/bus/ecbbus/grip.c @@ -240,7 +240,7 @@ void grip_device::crtc_update_row(mc6845_device *device, bitmap_rgb32 &bitmap, c int x = (column * 8) + bit; int color = m_flash ? 0 : BIT(data, bit); - bitmap.pix32(y, x) = RGB_MONOCHROME_WHITE[color]; + bitmap.pix32(y, x) = m_palette->pen(color); } } } @@ -551,6 +551,8 @@ static MACHINE_CONFIG_FRAGMENT( grip ) MCFG_SCREEN_SIZE(640, 480) MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) + MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette") + // sound hardware MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0) @@ -686,6 +688,7 @@ grip_device::grip_device(const machine_config &mconfig, const char *tag, device_ m_sti(*this, Z80STI_TAG), m_crtc(*this, MC6845_TAG), m_centronics(*this, CENTRONICS_TAG), + m_palette(*this, "palette"), m_speaker(*this, "speaker"), m_video_ram(*this, "video_ram"), m_j3a(*this, "J3A"), diff --git a/src/emu/bus/ecbbus/grip.h b/src/emu/bus/ecbbus/grip.h index d3378623938..eb08952e2a6 100644 --- a/src/emu/bus/ecbbus/grip.h +++ b/src/emu/bus/ecbbus/grip.h @@ -82,6 +82,7 @@ private: required_device<z80sti_device> m_sti; required_device<mc6845_device> m_crtc; required_device<centronics_device> m_centronics; + required_device<palette_device> m_palette; required_device<speaker_sound_device> m_speaker; optional_shared_ptr<UINT8> m_video_ram; required_ioport m_j3a; diff --git a/src/emu/emupal.c b/src/emu/emupal.c index 7658d875947..d32691f139d 100644 --- a/src/emu/emupal.c +++ b/src/emu/emupal.c @@ -761,18 +761,29 @@ void palette_device::palette_init_monochrome_green(palette_device &palette) /*------------------------------------------------- - palette_init_monochrome_green_highlight - 3-color black & green + monochrome_green_highlight - 3-color black & green -------------------------------------------------*/ void palette_device::palette_init_monochrome_green_highlight(palette_device &palette) { palette.set_pen_color(0, rgb_t::black); // black - palette.set_pen_color(1, rgb_t(0x00, 0x80, 0x00)); // green + palette.set_pen_color(1, rgb_t(0x00, 0xc0, 0x00)); // green palette.set_pen_color(2, rgb_t(0x00, 0xff, 0x00)); // green } /*------------------------------------------------- + monochrome_yellow - 2-color black & yellow +-------------------------------------------------*/ + +void palette_device::palette_init_monochrome_yellow(palette_device &palette) +{ + palette.set_pen_color(0, rgb_t::black); // black + palette.set_pen_color(1, rgb_t(0xff, 0xff, 0x00)); // yellow +} + + +/*------------------------------------------------- RRRR_GGGG_BBBB - standard 4-4-4 palette, assuming the commonly used resistor values: diff --git a/src/emu/emupal.h b/src/emu/emupal.h index de08db83cd6..3a771d3b47e 100644 --- a/src/emu/emupal.h +++ b/src/emu/emupal.h @@ -213,6 +213,10 @@ MCFG_PALETTE_ADD(_tag, 3) \ palette_device::static_set_init(*device, palette_init_delegate(FUNC(palette_device::palette_init_monochrome_green_highlight), downcast<palette_device *>(device))); +#define MCFG_PALETTE_ADD_MONOCHROME_YELLOW(_tag) \ + MCFG_PALETTE_ADD(_tag, 2) \ + palette_device::static_set_init(*device, palette_init_delegate(FUNC(palette_device::palette_init_monochrome_yellow), downcast<palette_device *>(device))); + #define MCFG_PALETTE_ADD_RRRRRGGGGGBBBBB(_tag) \ MCFG_PALETTE_ADD(_tag, 32768) \ palette_device::static_set_init(*device, palette_init_delegate(FUNC(palette_device::palette_init_RRRRRGGGGGBBBBB), downcast<palette_device *>(device))); @@ -231,10 +235,12 @@ MCFG_PALETTE_ADD(_tag, _entries) \ palette_device::static_set_init(*device, palette_init_delegate(FUNC(palette_device::palette_init_RRRRGGGGBBBB_proms), downcast<palette_device *>(device))); +// not implemented yet +#if 0 #define MCFG_PALETTE_ADD_HARDCODED(_tag, _array) \ MCFG_PALETTE_ADD(_tag, sizeof(_array) / 3) \ palette_device::static_set_init(*device, palette_init_delegate(FUNC(palette_device::palette_init_RRRRGGGGBBBB_proms), downcast<palette_device *>(device))); - +#endif @@ -377,6 +383,7 @@ public: void palette_init_monochrome_amber(palette_device &palette); void palette_init_monochrome_green(palette_device &palette); void palette_init_monochrome_green_highlight(palette_device &palette); + void palette_init_monochrome_yellow(palette_device &palette); void palette_init_RRRRGGGGBBBB_proms(palette_device &palette); void palette_init_RRRRRGGGGGBBBBB(palette_device &palette); void palette_init_BBBBBGGGGGRRRRR(palette_device &palette); diff --git a/src/emu/video/cdp1861.c b/src/emu/video/cdp1861.c index 7578875ccf0..9492b863150 100644 --- a/src/emu/video/cdp1861.c +++ b/src/emu/video/cdp1861.c @@ -204,8 +204,8 @@ WRITE8_MEMBER( cdp1861_device::dma_w ) for (x = 0; x < 8; x++) { - int color = BIT(data, 7); - m_bitmap.pix32(y, sx + x) = RGB_MONOCHROME_WHITE[color]; + pen_t color = BIT(data, 7) ? rgb_t::white : rgb_t::black; + m_bitmap.pix32(y, sx + x) = color; data <<= 1; } } diff --git a/src/emu/video/generic.c b/src/emu/video/generic.c index c3dbe69d2a8..6dc40dff0f9 100644 --- a/src/emu/video/generic.c +++ b/src/emu/video/generic.c @@ -93,65 +93,3 @@ const gfx_layout gfx_16x16x4_planar = { STEP16(0,16) }, 16*16 }; - - - -/*************************************************************************** - COMMON PALETTE INITIALIZATION -***************************************************************************/ - -/*------------------------------------------------- - black_and_white - basic 2-color black & white --------------------------------------------------*/ - -const rgb_t RGB_MONOCHROME_WHITE[] = -{ - rgb_t::black, - rgb_t::white -}; - -const rgb_t RGB_MONOCHROME_WHITE_HIGHLIGHT[] = -{ - rgb_t::black, - rgb_t(0xc0, 0xc0, 0xc0), - rgb_t::white -}; - - -/*------------------------------------------------- - monochrome_amber - 2-color black & amber --------------------------------------------------*/ - -const rgb_t RGB_MONOCHROME_AMBER[] = -{ - rgb_t::black, - rgb_t(0xf7, 0xaa, 0x00) -}; - - -/*------------------------------------------------- - monochrome_green - 2-color black & green --------------------------------------------------*/ - -const rgb_t RGB_MONOCHROME_GREEN[] = -{ - rgb_t::black, - rgb_t(0x00, 0xff, 0x00) -}; - -const rgb_t RGB_MONOCHROME_GREEN_HIGHLIGHT[] = -{ - rgb_t::black, - rgb_t(0x00, 0xc0, 0x00), - rgb_t(0x00, 0xff, 0x00) -}; - -/*------------------------------------------------- - monochrome_yellow - 2-color black & yellow --------------------------------------------------*/ - -const rgb_t RGB_MONOCHROME_YELLOW[] = -{ - rgb_t::black, - rgb_t(0xff, 0xff, 0x00) -}; diff --git a/src/emu/video/generic.h b/src/emu/video/generic.h index db3f3fce79b..7108c13b1a7 100644 --- a/src/emu/video/generic.h +++ b/src/emu/video/generic.h @@ -29,17 +29,4 @@ extern const gfx_layout gfx_8x8x6_planar; extern const gfx_layout gfx_16x16x4_planar; - - -/*************************************************************************** - FUNCTION PROTOTYPES -***************************************************************************/ - -extern const rgb_t RGB_MONOCHROME_WHITE[]; -extern const rgb_t RGB_MONOCHROME_WHITE_HIGHLIGHT[]; -extern const rgb_t RGB_MONOCHROME_AMBER[]; -extern const rgb_t RGB_MONOCHROME_GREEN[]; -extern const rgb_t RGB_MONOCHROME_GREEN_HIGHLIGHT[]; -extern const rgb_t RGB_MONOCHROME_YELLOW[]; - #endif /* __VIDEO_GENERIC_H__ */ diff --git a/src/mame/drivers/segahang.c b/src/mame/drivers/segahang.c index 09d2fb7ef90..a33d44100ab 100644 --- a/src/mame/drivers/segahang.c +++ b/src/mame/drivers/segahang.c @@ -15,8 +15,6 @@ ***************************************************************************/ -#define MODERN_DRIVER_INIT - #include "emu.h" #include "includes/segahang.h" #include "machine/segaic16.h" diff --git a/src/mess/drivers/apricot.c b/src/mess/drivers/apricot.c index d27b75b6d82..567b4a001a6 100644 --- a/src/mess/drivers/apricot.c +++ b/src/mess/drivers/apricot.c @@ -49,6 +49,7 @@ public: m_fdc(*this, "ic68"), m_floppy0(*this, "ic68:0"), m_floppy1(*this, "ic68:1"), + m_palette(*this, "palette"), m_screen_buffer(*this, "screen_buffer"), m_data_selector_dtr(1), m_data_selector_rts(1), @@ -71,7 +72,7 @@ public: required_device<wd2793_t> m_fdc; required_device<floppy_connector> m_floppy0; required_device<floppy_connector> m_floppy1; - + required_device<palette_device> m_palette; required_shared_ptr<UINT16> m_screen_buffer; DECLARE_WRITE8_MEMBER( i8089_ca1_w ); @@ -272,6 +273,7 @@ static MC6845_UPDATE_ROW( apricot_update_row ) { apricot_state *state = device->machine().driver_data<apricot_state>(); UINT8 *ram = state->m_ram->pointer(); + const pen_t *pen = state->m_palette->pens(); int i, x; if (state->m_video_mode) @@ -292,7 +294,7 @@ static MC6845_UPDATE_ROW( apricot_update_row ) { int color = fill ? 1 : BIT(data, x); if (BIT(code, 15)) color = !color; // reverse? - bitmap.pix32(y, x + i*10) = RGB_MONOCHROME_GREEN_HIGHLIGHT[color ? 1 + BIT(code, 14) : 0]; + bitmap.pix32(y, x + i*10) = pen[color ? 1 + BIT(code, 14) : 0]; } } } @@ -393,6 +395,8 @@ static MACHINE_CONFIG_START( apricot, apricot_state ) MCFG_SCREEN_REFRESH_RATE(72) MCFG_SCREEN_UPDATE_DRIVER(apricot_state, screen_update_apricot) + MCFG_PALETTE_ADD_MONOCHROME_GREEN_HIGHLIGHT("palette") + MCFG_MC6845_ADD("ic30", MC6845, "screen", XTAL_15MHz / 10, apricot_mc6845_intf) // sound hardware diff --git a/src/mess/drivers/attache.c b/src/mess/drivers/attache.c index 9e845ac1fb0..05106326791 100644 --- a/src/mess/drivers/attache.c +++ b/src/mess/drivers/attache.c @@ -82,6 +82,7 @@ public: m_ctc(*this,"ctc"), m_crtc(*this,"crtc"), m_dma(*this, "dma"), + m_palette(*this, "palette"), m_floppy0(*this, "fdc:0:525dd"), m_floppy1(*this, "fdc:1:525dd"), m_kb_row0(*this, "row0"), @@ -180,6 +181,7 @@ private: required_device<z80ctc_device> m_ctc; required_device<tms9927_device> m_crtc; required_device<am9517a_device> m_dma; + required_device<palette_device> m_palette; required_device<floppy_image_device> m_floppy0; required_device<floppy_image_device> m_floppy1; required_ioport m_kb_row0; @@ -242,6 +244,8 @@ UINT32 attache_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, // Graphics output (if enabled) if(m_gfx_enabled) { + const pen_t *pen = m_palette->pens(); + for(y=0;y<(bitmap.height()-1)/10;y++) { for(x=0;x<(bitmap.width()-1)/8;x++) @@ -250,22 +254,22 @@ UINT32 attache_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, for(scan=0;scan<10;scan+=2) { data = m_gfx_ram[(128*32*(scan/2))+(y*128+x)]; - bitmap.pix32(y*10+scan,x*8) = (BIT(data,7) ? RGB_MONOCHROME_GREEN_HIGHLIGHT[1] : RGB_MONOCHROME_GREEN_HIGHLIGHT[0]); - bitmap.pix32(y*10+scan,x*8+1) = (BIT(data,7) ? RGB_MONOCHROME_GREEN_HIGHLIGHT[1] : RGB_MONOCHROME_GREEN_HIGHLIGHT[0]); - bitmap.pix32(y*10+scan,x*8+2) = (BIT(data,6) ? RGB_MONOCHROME_GREEN_HIGHLIGHT[1] : RGB_MONOCHROME_GREEN_HIGHLIGHT[0]); - bitmap.pix32(y*10+scan,x*8+3) = (BIT(data,6) ? RGB_MONOCHROME_GREEN_HIGHLIGHT[1] : RGB_MONOCHROME_GREEN_HIGHLIGHT[0]); - bitmap.pix32(y*10+scan,x*8+4) = (BIT(data,5) ? RGB_MONOCHROME_GREEN_HIGHLIGHT[1] : RGB_MONOCHROME_GREEN_HIGHLIGHT[0]); - bitmap.pix32(y*10+scan,x*8+5) = (BIT(data,5) ? RGB_MONOCHROME_GREEN_HIGHLIGHT[1] : RGB_MONOCHROME_GREEN_HIGHLIGHT[0]); - bitmap.pix32(y*10+scan,x*8+6) = (BIT(data,4) ? RGB_MONOCHROME_GREEN_HIGHLIGHT[1] : RGB_MONOCHROME_GREEN_HIGHLIGHT[0]); - bitmap.pix32(y*10+scan,x*8+7) = (BIT(data,4) ? RGB_MONOCHROME_GREEN_HIGHLIGHT[1] : RGB_MONOCHROME_GREEN_HIGHLIGHT[0]); - bitmap.pix32(y*10+scan+1,x*8) = (BIT(data,3) ? RGB_MONOCHROME_GREEN_HIGHLIGHT[1] : RGB_MONOCHROME_GREEN_HIGHLIGHT[0]); - bitmap.pix32(y*10+scan+1,x*8+1) = (BIT(data,3) ? RGB_MONOCHROME_GREEN_HIGHLIGHT[1] : RGB_MONOCHROME_GREEN_HIGHLIGHT[0]); - bitmap.pix32(y*10+scan+1,x*8+2) = (BIT(data,2) ? RGB_MONOCHROME_GREEN_HIGHLIGHT[1] : RGB_MONOCHROME_GREEN_HIGHLIGHT[0]); - bitmap.pix32(y*10+scan+1,x*8+3) = (BIT(data,2) ? RGB_MONOCHROME_GREEN_HIGHLIGHT[1] : RGB_MONOCHROME_GREEN_HIGHLIGHT[0]); - bitmap.pix32(y*10+scan+1,x*8+4) = (BIT(data,1) ? RGB_MONOCHROME_GREEN_HIGHLIGHT[1] : RGB_MONOCHROME_GREEN_HIGHLIGHT[0]); - bitmap.pix32(y*10+scan+1,x*8+5) = (BIT(data,1) ? RGB_MONOCHROME_GREEN_HIGHLIGHT[1] : RGB_MONOCHROME_GREEN_HIGHLIGHT[0]); - bitmap.pix32(y*10+scan+1,x*8+6) = (BIT(data,0) ? RGB_MONOCHROME_GREEN_HIGHLIGHT[1] : RGB_MONOCHROME_GREEN_HIGHLIGHT[0]); - bitmap.pix32(y*10+scan+1,x*8+7) = (BIT(data,0) ? RGB_MONOCHROME_GREEN_HIGHLIGHT[1] : RGB_MONOCHROME_GREEN_HIGHLIGHT[0]); + bitmap.pix32(y*10+scan,x*8) = pen[BIT(data,7)]; + bitmap.pix32(y*10+scan,x*8+1) = pen[BIT(data,7)]; + bitmap.pix32(y*10+scan,x*8+2) = pen[BIT(data,6)]; + bitmap.pix32(y*10+scan,x*8+3) = pen[BIT(data,6)]; + bitmap.pix32(y*10+scan,x*8+4) = pen[BIT(data,5)]; + bitmap.pix32(y*10+scan,x*8+5) = pen[BIT(data,5)]; + bitmap.pix32(y*10+scan,x*8+6) = pen[BIT(data,4)]; + bitmap.pix32(y*10+scan,x*8+7) = pen[BIT(data,4)]; + bitmap.pix32(y*10+scan+1,x*8) = pen[BIT(data,3)]; + bitmap.pix32(y*10+scan+1,x*8+1) = pen[BIT(data,3)]; + bitmap.pix32(y*10+scan+1,x*8+2) = pen[BIT(data,2)]; + bitmap.pix32(y*10+scan+1,x*8+3) = pen[BIT(data,2)]; + bitmap.pix32(y*10+scan+1,x*8+4) = pen[BIT(data,1)]; + bitmap.pix32(y*10+scan+1,x*8+5) = pen[BIT(data,1)]; + bitmap.pix32(y*10+scan+1,x*8+6) = pen[BIT(data,0)]; + bitmap.pix32(y*10+scan+1,x*8+7) = pen[BIT(data,0)]; } } } @@ -280,6 +284,7 @@ UINT32 attache_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, { assert(((y*128)+x) >= 0 && ((y*128)+x) < ARRAY_LENGTH(m_char_ram)); UINT8 ch = m_char_ram[(y*128)+x]; + pen_t fg = m_palette->pen(m_attr_ram[(y*128)+x] & 0x08 ? 2 : 1); // brightness if(m_attr_ram[(y*128)+x] & 0x10) // double-size dbl_mode++; else @@ -335,10 +340,7 @@ UINT32 attache_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, { UINT16 xpos = x*8+bit; UINT16 ypos = y*10+scan; - UINT32 fg = RGB_MONOCHROME_GREEN_HIGHLIGHT[1];; - if(m_attr_ram[(y*128)+x] & 0x08) // brightness - fg = RGB_MONOCHROME_GREEN_HIGHLIGHT[2]; if(BIT(data,7-bit)) bitmap.pix32(ypos,xpos) = fg; } @@ -1021,6 +1023,8 @@ static MACHINE_CONFIG_START( attache, attache_state ) MCFG_SCREEN_UPDATE_DRIVER(attache_state, screen_update) MCFG_SCREEN_VBLANK_DRIVER(attache_state, vblank_int) + MCFG_PALETTE_ADD_MONOCHROME_GREEN_HIGHLIGHT("palette") + MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("psg", AY8912, XTAL_8MHz / 4) MCFG_SOUND_CONFIG(ay8912_interface) diff --git a/src/mess/drivers/bw12.c b/src/mess/drivers/bw12.c index a97aacd60fb..e463dce3f95 100644 --- a/src/mess/drivers/bw12.c +++ b/src/mess/drivers/bw12.c @@ -327,7 +327,7 @@ INPUT_PORTS_END static MC6845_UPDATE_ROW( bw12_update_row ) { bw12_state *state = device->machine().driver_data<bw12_state>(); - + const pen_t *pen = state->m_palette->pens(); int column, bit; for (column = 0; column < x_count; column++) @@ -346,7 +346,7 @@ static MC6845_UPDATE_ROW( bw12_update_row ) int x = (column * 8) + bit; int color = BIT(data, 7); - bitmap.pix32(y, x) = RGB_MONOCHROME_AMBER[color]; + bitmap.pix32(y, x) = pen[color]; data <<= 1; } @@ -587,6 +587,7 @@ static MACHINE_CONFIG_START( common, bw12_state ) MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 200-1) MCFG_GFXDECODE_ADD("gfxdecode", bw12) + MCFG_PALETTE_ADD_MONOCHROME_AMBER("palette") MCFG_MC6845_ADD(MC6845_TAG, MC6845, SCREEN_TAG, XTAL_16MHz/8, bw12_mc6845_interface) diff --git a/src/mess/drivers/cbm2.c b/src/mess/drivers/cbm2.c index 55a10a5fe4d..afbc342a928 100644 --- a/src/mess/drivers/cbm2.c +++ b/src/mess/drivers/cbm2.c @@ -1108,6 +1108,7 @@ INPUT_PORTS_END static MC6845_UPDATE_ROW( crtc_update_row ) { cbm2_state *state = device->machine().driver_data<cbm2_state>(); + const pen_t *pen = state->m_palette->pens(); int x = 0; @@ -1122,7 +1123,7 @@ static MC6845_UPDATE_ROW( crtc_update_row ) int color = BIT(data, 7) ^ BIT(code, 7) ^ BIT(ma, 13); if (cursor_x == column) color ^= 1; - bitmap.pix32(y, x++) = RGB_MONOCHROME_GREEN[color]; + bitmap.pix32(y, x++) = pen[color]; if (bit < 8 || !state->m_graphics) data <<= 1; } @@ -2293,6 +2294,8 @@ static MACHINE_CONFIG_START( cbm2lp_ntsc, cbm2_state ) MCFG_SCREEN_SIZE(768, 312) MCFG_SCREEN_VISIBLE_AREA(0, 768-1, 0, 312-1) + MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette") + MCFG_MC6845_ADD(MC68B45_TAG, MC6845, SCREEN_TAG, XTAL_18MHz/9, crtc_intf) // sound hardware diff --git a/src/mess/drivers/compis.c b/src/mess/drivers/compis.c index befe5e3e9a4..ad79c6af7bf 100644 --- a/src/mess/drivers/compis.c +++ b/src/mess/drivers/compis.c @@ -457,9 +457,10 @@ static UPD7220_DISPLAY_PIXELS( hgdc_display_pixels ) { compis_state *state = device->machine().driver_data<compis_state>(); UINT8 i,gfx = state->m_video_ram[address]; + const pen_t *pen = state->m_palette->pens(); for(i=0; i<8; i++) - bitmap.pix32(y, x + i) = RGB_MONOCHROME_GREEN_HIGHLIGHT[BIT(gfx, i)]; + bitmap.pix32(y, x + i) = pen[BIT(gfx, i)]; } static UPD7220_INTERFACE( hgdc_intf ) @@ -723,6 +724,7 @@ static MACHINE_CONFIG_START( compis, compis_state ) MCFG_SCREEN_UPDATE_DEVICE("upd7220", upd7220_device, screen_update) MCFG_UPD7220_ADD("upd7220", XTAL_4_433619MHz/2, hgdc_intf, upd7220_map) //unknown clock MCFG_VIDEO_SET_SCREEN(SCREEN_TAG) + MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette") // devices MCFG_I80130_ADD(I80130_TAG, XTAL_16MHz/2, DEVWRITELINE(I80186_TAG, i80186_cpu_device, int0_w)) diff --git a/src/mess/drivers/huebler.c b/src/mess/drivers/huebler.c index 8ff38421f29..7e078e1a88d 100644 --- a/src/mess/drivers/huebler.c +++ b/src/mess/drivers/huebler.c @@ -212,6 +212,7 @@ INPUT_PORTS_END UINT32 amu880_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int y, sx, x, line; + const pen_t *pen = m_palette->pens(); for (y = 0; y < 240; y++) { @@ -229,7 +230,7 @@ UINT32 amu880_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, { int color = ((line > 7) ? 0 : BIT(data, 7)) ^ BIT(videoram_data, 7); - bitmap.pix32(y, (sx * 6) + x) = RGB_MONOCHROME_WHITE[color]; + bitmap.pix32(y, (sx * 6) + x) = pen[color]; data <<= 1; } @@ -403,6 +404,7 @@ static MACHINE_CONFIG_START( amu880, amu880_state ) MCFG_SCREEN_RAW_PARAMS(9000000, 576, 0*6, 64*6, 320, 0*10, 24*10) MCFG_GFXDECODE_ADD("gfxdecode", amu880) + MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette") /* devices */ MCFG_Z80CTC_ADD(Z80CTC_TAG, XTAL_10MHz/4, ctc_intf) diff --git a/src/mess/drivers/pet.c b/src/mess/drivers/pet.c index 47aea73c120..6031b8ba281 100644 --- a/src/mess/drivers/pet.c +++ b/src/mess/drivers/pet.c @@ -1037,6 +1037,8 @@ TIMER_DEVICE_CALLBACK_MEMBER( pet_state::sync_tick ) UINT32 pet_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { + const pen_t *pen = m_palette->pens(); + for (int y = 0; y < 200; y++) { for (int sx = 0; sx < 40; sx++) @@ -1052,7 +1054,7 @@ UINT32 pet_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, con for (int x = 0; x < 8; x++, data <<= 1) { int color = (BIT(data, 7) ^ BIT(lsd, 7)) && m_blanktv; - bitmap.pix32(y, (sx * 8) + x) = RGB_MONOCHROME_GREEN[color]; + bitmap.pix32(y, (sx * 8) + x) = pen[color]; } } } @@ -1070,6 +1072,7 @@ static MC6845_UPDATE_ROW( pet80_update_row ) pet80_state *state = device->machine().driver_data<pet80_state>(); int x = 0; int char_rom_mask = state->m_char_rom->bytes() - 1; + const pen_t *pen = state->m_palette->pens(); for (int column = 0; column < x_count; column++) { @@ -1089,7 +1092,7 @@ static MC6845_UPDATE_ROW( pet80_update_row ) for (int bit = 0; bit < 8; bit++, data <<= 1) { int video = !((BIT(data, 7) ^ BIT(lsd, 7)) && no_row) ^ invert; - bitmap.pix32(y, x++) = RGB_MONOCHROME_GREEN[video]; + bitmap.pix32(y, x++) = pen[video]; } // odd character @@ -1102,7 +1105,7 @@ static MC6845_UPDATE_ROW( pet80_update_row ) for (int bit = 0; bit < 8; bit++, data <<= 1) { int video = !((BIT(data, 7) ^ BIT(lsd, 7)) && no_row) ^ invert; - bitmap.pix32(y, x++) = RGB_MONOCHROME_GREEN[video]; + bitmap.pix32(y, x++) = pen[video]; } } } @@ -1132,6 +1135,7 @@ static MC6845_UPDATE_ROW( cbm8296_update_row ) pet80_state *state = device->machine().driver_data<pet80_state>(); int x = 0; int char_rom_mask = state->m_char_rom->bytes() - 1; + const pen_t *pen = state->m_palette->pens(); for (int column = 0; column < x_count; column++) { @@ -1153,7 +1157,7 @@ static MC6845_UPDATE_ROW( cbm8296_update_row ) for (int bit = 0; bit < 8; bit++, data <<= 1) { int video = ((BIT(data, 7) ^ BIT(lsd, 7)) && no_row); - bitmap.pix32(y, x++) = RGB_MONOCHROME_GREEN[video]; + bitmap.pix32(y, x++) = pen[video]; } // odd character @@ -1166,7 +1170,7 @@ static MC6845_UPDATE_ROW( cbm8296_update_row ) for (int bit = 0; bit < 8; bit++, data <<= 1) { int video = ((BIT(data, 7) ^ BIT(lsd, 7)) && no_row); - bitmap.pix32(y, x++) = RGB_MONOCHROME_GREEN[video]; + bitmap.pix32(y, x++) = pen[video]; } } } @@ -1379,6 +1383,8 @@ static MACHINE_CONFIG_START( pet, pet_state ) MCFG_SCREEN_UPDATE_DRIVER(pet_state, screen_update) MCFG_TIMER_DRIVER_ADD_PERIODIC("sync_timer", pet_state, sync_tick, attotime::from_hz(120)) + MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette") + // devices MCFG_DEVICE_ADD(M6522_TAG, VIA6522, XTAL_8MHz/8) MCFG_VIA6522_READPB_HANDLER(READ8(pet_state, via_pb_r)) @@ -1689,6 +1695,8 @@ static MACHINE_CONFIG_START( pet80, pet80_state ) MCFG_SCREEN_UPDATE_DEVICE(MC6845_TAG, mc6845_device, screen_update) MCFG_MC6845_ADD(MC6845_TAG, MC6845, SCREEN_TAG, XTAL_16MHz/16, crtc_intf) + MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette") + // sound hardware MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0) diff --git a/src/mess/drivers/trs80m2.c b/src/mess/drivers/trs80m2.c index 46f3681d87c..d7df66a15df 100644 --- a/src/mess/drivers/trs80m2.c +++ b/src/mess/drivers/trs80m2.c @@ -383,6 +383,7 @@ INPUT_PORTS_END static MC6845_UPDATE_ROW( trs80m2_update_row ) { trs80m2_state *state = device->machine().driver_data<trs80m2_state>(); + const pen_t *pen = state->m_palette->pens(); int x = 0; @@ -400,7 +401,7 @@ static MC6845_UPDATE_ROW( trs80m2_update_row ) int dout = BIT(data, 7); int color = dcursor ^ drevid ^ dout; - bitmap.pix32(y, x++) = RGB_MONOCHROME_GREEN[color]; + bitmap.pix32(y, x++) = pen[color]; data <<= 1; } @@ -827,6 +828,8 @@ static MACHINE_CONFIG_START( trs80m2, trs80m2_state ) MCFG_SCREEN_SIZE(640, 480) MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 479) + MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette") + MCFG_MC6845_ADD(MC6845_TAG, MC6845, SCREEN_TAG, XTAL_12_48MHz/8, mc6845_intf) // devices @@ -885,6 +888,8 @@ static MACHINE_CONFIG_START( trs80m16, trs80m16_state ) MCFG_SCREEN_SIZE(640, 480) MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 479) + MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette") + MCFG_MC6845_ADD(MC6845_TAG, MC6845, SCREEN_TAG, XTAL_12_48MHz/8, mc6845_intf) // devices diff --git a/src/mess/drivers/vixen.c b/src/mess/drivers/vixen.c index 0f2bc527855..ad7152196bb 100644 --- a/src/mess/drivers/vixen.c +++ b/src/mess/drivers/vixen.c @@ -411,6 +411,8 @@ void vixen_state::video_start() UINT32 vixen_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { + const pen_t *pen = m_palette->pens(); + for (int txadr = 0; txadr < 26; txadr++) { for (int scan = 0; scan < 10; scan++) @@ -454,7 +456,7 @@ UINT32 vixen_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, c { int color = (BIT(char_data, 7 - x) ^ reverse) & !blank; - bitmap.pix32((txadr * 10) + scan, (chadr * 8) + x) = RGB_MONOCHROME_AMBER[color]; + bitmap.pix32((txadr * 10) + scan, (chadr * 8) + x) = pen[color]; } } } @@ -786,8 +788,11 @@ static MACHINE_CONFIG_START( vixen, vixen_state ) MCFG_SCREEN_ADD(SCREEN_TAG, RASTER) MCFG_SCREEN_UPDATE_DRIVER(vixen_state, screen_update) MCFG_SCREEN_RAW_PARAMS(XTAL_23_9616MHz/2, 96*8, 0*8, 81*8, 27*10, 0*10, 26*10) + MCFG_TIMER_DRIVER_ADD_SCANLINE("vsync", vixen_state, vsync_tick, SCREEN_TAG, 26*10, 27*10) + MCFG_PALETTE_ADD_MONOCHROME_AMBER("palette") + // sound hardware MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD(DISCRETE_TAG, DISCRETE, 0) diff --git a/src/mess/drivers/wicat.c b/src/mess/drivers/wicat.c index 11118562758..a6401a24b7a 100644 --- a/src/mess/drivers/wicat.c +++ b/src/mess/drivers/wicat.c @@ -45,6 +45,7 @@ public: m_videouart1(*this,"videouart1"), m_videouart(*this,"videouart"), m_videosram(*this,"vsram"), + m_palette(*this, "palette"), m_chargen(*this,"g2char"), m_fdc(*this,"fdc") { @@ -105,6 +106,7 @@ public: required_device<mc2661_device> m_videouart1; required_device<im6402_device> m_videouart; required_device<x2210_device> m_videosram; + required_device<palette_device> m_palette; required_memory_region m_chargen; required_device<fd1795_t> m_fdc; @@ -733,16 +735,16 @@ I8275_DISPLAY_PIXELS(wicat_display_pixels) wicat_state *state = device->machine().driver_data<wicat_state>(); UINT8 romdata = state->m_chargen->base()[((charcode << 4) | linecount) + 1]; - int i; + const pen_t *pen = state->m_palette->pens(); - for (i = 0; i < 8; i++) + for (int i = 0; i < 8; i++) { int color = (romdata >> (7-i)) & 0x01; if(linecount > 9) color = 0; - bitmap.pix32(y, x + i) = RGB_MONOCHROME_GREEN_HIGHLIGHT[color]; + bitmap.pix32(y, x + i) = pen[color]; } } @@ -963,6 +965,8 @@ static MACHINE_CONFIG_START( wicat, wicat_state ) MCFG_SCREEN_REFRESH_RATE(60) MCFG_SCREEN_UPDATE_DEVICE("video",i8275x_device,screen_update) + MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette") + MCFG_I8275_ADD("video",XTAL_19_6608MHz/8,9,wicat_display_pixels,DEVWRITELINE("videodma",am9517a_device, dreq0_w)) MCFG_I8275_IRQ_CALLBACK(WRITELINE(wicat_state,crtc_cb)) MCFG_VIDEO_SET_SCREEN("screen") diff --git a/src/mess/drivers/xerox820.c b/src/mess/drivers/xerox820.c index 05bd3590f44..dd4187291d8 100644 --- a/src/mess/drivers/xerox820.c +++ b/src/mess/drivers/xerox820.c @@ -532,6 +532,7 @@ UINT32 xerox820_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap { UINT8 y,ra,chr,gfx; UINT16 sy=0,ma=(m_scroll + 1) * 0x80,x; + const pen_t *pen=m_palette->pens(); m_framecnt++; @@ -560,13 +561,13 @@ UINT32 xerox820_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap gfx = 0xff; /* Display a scanline of a character (7 pixels) */ - *p++ = RGB_MONOCHROME_WHITE[0]; - *p++ = RGB_MONOCHROME_WHITE[BIT(gfx, 4) ^ 1]; - *p++ = RGB_MONOCHROME_WHITE[BIT(gfx, 3) ^ 1]; - *p++ = RGB_MONOCHROME_WHITE[BIT(gfx, 2) ^ 1]; - *p++ = RGB_MONOCHROME_WHITE[BIT(gfx, 1) ^ 1]; - *p++ = RGB_MONOCHROME_WHITE[BIT(gfx, 0) ^ 1]; - *p++ = RGB_MONOCHROME_WHITE[0]; + *p++ = pen[0]; + *p++ = pen[BIT(gfx, 4) ^ 1]; + *p++ = pen[BIT(gfx, 3) ^ 1]; + *p++ = pen[BIT(gfx, 2) ^ 1]; + *p++ = pen[BIT(gfx, 1) ^ 1]; + *p++ = pen[BIT(gfx, 0) ^ 1]; + *p++ = pen[0]; } } ma+=128; @@ -697,6 +698,7 @@ static MACHINE_CONFIG_START( xerox820, xerox820_state ) MCFG_SCREEN_RAW_PARAMS(XTAL_10_69425MHz, 700, 0, 560, 260, 0, 240) MCFG_GFXDECODE_ADD("gfxdecode", xerox820) + MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette") /* devices */ MCFG_Z80PIO_ADD(Z80PIO_KB_TAG, XTAL_20MHz/8, xerox820_kbpio_intf) @@ -749,6 +751,7 @@ static MACHINE_CONFIG_START( xerox820ii, xerox820ii_state ) MCFG_SCREEN_RAW_PARAMS(XTAL_10_69425MHz, 700, 0, 560, 260, 0, 240) MCFG_GFXDECODE_ADD("gfxdecode", xerox820ii) + MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette") /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mess/includes/abc80.h b/src/mess/includes/abc80.h index 43d62add34d..d58d508545f 100644 --- a/src/mess/includes/abc80.h +++ b/src/mess/includes/abc80.h @@ -71,6 +71,7 @@ public: m_kb(*this, ABC80_KEYBOARD_TAG), m_ram(*this, RAM_TAG), m_rs232(*this, RS232_TAG), + m_palette(*this, "palette"), m_rom(*this, Z80_TAG), m_mmu_rom(*this, "mmu"), m_char_rom(*this, "chargen"), @@ -91,6 +92,7 @@ public: required_device<abc80_keyboard_device> m_kb; required_device<ram_device> m_ram; required_device<rs232_port_device> m_rs232; + required_device<palette_device> m_palette; required_memory_region m_rom; required_memory_region m_mmu_rom; required_memory_region m_char_rom; diff --git a/src/mess/includes/abc80x.h b/src/mess/includes/abc80x.h index cbeb582611e..e377b711bb9 100644 --- a/src/mess/includes/abc80x.h +++ b/src/mess/includes/abc80x.h @@ -5,8 +5,6 @@ #ifndef __ABC800__ #define __ABC800__ -#define MODERN_DRIVER_INIT - #include "bus/abcbus/abcbus.h" #include "bus/rs232/rs232.h" #include "cpu/z80/z80.h" @@ -166,11 +164,13 @@ public: abc800m_state(const machine_config &mconfig, device_type type, const char *tag) : abc800_state(mconfig, type, tag), m_crtc(*this, MC6845_TAG), + m_palette(*this, "palette"), m_fgctl_prom(*this, "hru2"), m_char_rom(*this, MC6845_TAG) { } required_device<mc6845_device> m_crtc; + required_device<palette_device> m_palette; required_memory_region m_fgctl_prom; required_memory_region m_char_rom; @@ -214,11 +214,13 @@ public: abc802_state(const machine_config &mconfig, device_type type, const char *tag) : abc800_state(mconfig, type, tag), m_crtc(*this, MC6845_TAG), + m_palette(*this, "palette"), m_char_rom(*this, MC6845_TAG), m_config(*this, "CONFIG") { } required_device<mc6845_device> m_crtc; + required_device<palette_device> m_palette; required_memory_region m_char_rom; required_ioport m_config; diff --git a/src/mess/includes/bw12.h b/src/mess/includes/bw12.h index 6f72259be36..e0ff1e291d3 100644 --- a/src/mess/includes/bw12.h +++ b/src/mess/includes/bw12.h @@ -45,6 +45,7 @@ public: m_kbc(*this, AY3600PRO002_TAG), m_crtc(*this, MC6845_TAG), m_pit(*this, PIT8253_TAG), + m_palette(*this, "palette"), m_centronics(*this, CENTRONICS_TAG), m_ram(*this, RAM_TAG), m_floppy0(*this, UPD765_TAG ":1:525dd"), @@ -63,6 +64,7 @@ public: required_device<ay3600_device> m_kbc; required_device<mc6845_device> m_crtc; required_device<pit8253_device> m_pit; + required_device<palette_device> m_palette; required_device<centronics_device> m_centronics; required_device<ram_device> m_ram; required_device<floppy_image_device> m_floppy0; diff --git a/src/mess/includes/cbm2.h b/src/mess/includes/cbm2.h index 5e75e7ea738..b336e6bfe59 100644 --- a/src/mess/includes/cbm2.h +++ b/src/mess/includes/cbm2.h @@ -59,6 +59,7 @@ public: m_maincpu(*this, M6509_TAG), m_pla1(*this, PLA1_TAG), m_crtc(*this, MC68B45_TAG), + m_palette(*this, "palette"), m_sid(*this, MOS6581_TAG), m_tpi1(*this, MOS6525_1_TAG), m_tpi2(*this, MOS6525_2_TAG), @@ -114,6 +115,7 @@ public: required_device<cpu_device> m_maincpu; required_device<pls100_device> m_pla1; optional_device<mc6845_device> m_crtc; + optional_device<palette_device> m_palette; required_device<mos6581_device> m_sid; required_device<tpi6525_device> m_tpi1; required_device<tpi6525_device> m_tpi2; diff --git a/src/mess/includes/compis.h b/src/mess/includes/compis.h index 195993b4b6d..46e42737712 100644 --- a/src/mess/includes/compis.h +++ b/src/mess/includes/compis.h @@ -61,6 +61,7 @@ public: m_uart(*this, I8251A_TAG), m_rtc(*this, MM58174A_TAG), m_crtc(*this, "upd7220"), + m_palette(*this, "palette"), m_cassette(*this, CASSETTE_TAG), m_isbx0(*this, ISBX_0_TAG), m_isbx1(*this, ISBX_1_TAG), @@ -78,6 +79,7 @@ public: required_device<i8251_device> m_uart; required_device<mm58274c_device> m_rtc; required_device<upd7220_device> m_crtc; + required_device<palette_device> m_palette; required_device<cassette_image_device> m_cassette; required_device<isbx_slot_device> m_isbx0; required_device<isbx_slot_device> m_isbx1; diff --git a/src/mess/includes/huebler.h b/src/mess/includes/huebler.h index 0b2e0315aa8..eb49ae03f07 100644 --- a/src/mess/includes/huebler.h +++ b/src/mess/includes/huebler.h @@ -26,6 +26,7 @@ public: : driver_device(mconfig, type, tag), m_cassette(*this, "cassette"), m_z80sio(*this, Z80SIO_TAG), + m_palette(*this, "palette"), m_kb_rom(*this, "keyboard"), m_char_rom(*this, "chargen"), m_video_ram(*this, "video_ram"), @@ -53,6 +54,7 @@ public: required_device<cassette_image_device> m_cassette; required_device<z80dart_device> m_z80sio; + required_device<palette_device> m_palette; required_memory_region m_kb_rom; required_memory_region m_char_rom; required_shared_ptr<UINT8> m_video_ram; diff --git a/src/mess/includes/mikromik.h b/src/mess/includes/mikromik.h index 0b1981b7f3e..080e0632048 100644 --- a/src/mess/includes/mikromik.h +++ b/src/mess/includes/mikromik.h @@ -44,6 +44,7 @@ public: m_fdc(*this, UPD765_TAG), m_mpsc(*this, UPD7201_TAG), m_hgdc(*this, UPD7220_TAG), + m_palette(*this, "palette"), m_speaker(*this, "speaker"), m_floppy0(*this, UPD765_TAG ":0:525qd"), m_floppy1(*this, UPD765_TAG ":1:525qd"), @@ -82,6 +83,7 @@ public: required_device<upd765a_device> m_fdc; required_device<upd7201_device> m_mpsc; required_device<upd7220_device> m_hgdc; + required_device<palette_device> m_palette; required_device<speaker_sound_device> m_speaker; required_device<floppy_image_device> m_floppy0; required_device<floppy_image_device> m_floppy1; diff --git a/src/mess/includes/newbrain.h b/src/mess/includes/newbrain.h index 309ab0638a1..0d1fe05a8f1 100644 --- a/src/mess/includes/newbrain.h +++ b/src/mess/includes/newbrain.h @@ -61,6 +61,7 @@ public: driver_device(mconfig, type, tag), m_maincpu(*this, Z80_TAG), m_copcpu(*this, COP420_TAG), + m_palette(*this, "palette"), m_cassette1(*this, "cassette"), m_cassette2(*this, "cassette2"), m_rom(*this, Z80_TAG), @@ -137,6 +138,7 @@ protected: required_device<cpu_device> m_maincpu; required_device<cpu_device> m_copcpu; + required_device<palette_device> m_palette; required_device<cassette_image_device> m_cassette1; required_device<cassette_image_device> m_cassette2; required_memory_region m_rom; diff --git a/src/mess/includes/pet.h b/src/mess/includes/pet.h index dac2d6e03ff..976ec69e4a5 100644 --- a/src/mess/includes/pet.h +++ b/src/mess/includes/pet.h @@ -41,6 +41,7 @@ public: m_pia2(*this, M6520_2_TAG), m_crtc(*this, MC6845_TAG), m_ieee(*this, IEEE488_TAG), + m_palette(*this, "palette"), m_cassette(*this, PET_DATASSETTE_PORT_TAG), m_cassette2(*this, PET_DATASSETTE_PORT2_TAG), m_exp(*this, PET_EXPANSION_SLOT_TAG), @@ -79,6 +80,7 @@ public: required_device<pia6821_device> m_pia2; optional_device<mc6845_device> m_crtc; required_device<ieee488_device> m_ieee; + required_device<palette_device> m_palette; required_device<pet_datassette_port_device> m_cassette; required_device<pet_datassette_port_device> m_cassette2; required_device<pet_expansion_slot_device> m_exp; diff --git a/src/mess/includes/trs80m2.h b/src/mess/includes/trs80m2.h index ad115a36d9f..aae71161bb2 100644 --- a/src/mess/includes/trs80m2.h +++ b/src/mess/includes/trs80m2.h @@ -45,6 +45,7 @@ public: m_dmac(*this, Z80DMA_TAG), m_pio(*this, Z80PIO_TAG), m_crtc(*this, MC6845_TAG), + m_palette(*this, "palette"), m_fdc(*this, FD1791_TAG), m_centronics(*this, CENTRONICS_TAG), m_floppy0(*this, FD1791_TAG":0"), @@ -65,6 +66,7 @@ public: required_device<z80dma_device> m_dmac; required_device<z80pio_device> m_pio; required_device<mc6845_device> m_crtc; + required_device<palette_device> m_palette; required_device<fd1791_t> m_fdc; required_device<centronics_device> m_centronics; required_device<floppy_connector> m_floppy0; diff --git a/src/mess/includes/v1050.h b/src/mess/includes/v1050.h index 400fe7f8a65..36df79bc6cb 100644 --- a/src/mess/includes/v1050.h +++ b/src/mess/includes/v1050.h @@ -73,6 +73,7 @@ public: m_uart_sio(*this, I8251A_SIO_TAG), m_fdc(*this, MB8877_TAG), m_crtc(*this, H46505_TAG), + m_palette(*this, "palette"), m_centronics(*this, CENTRONICS_TAG), m_ram(*this, RAM_TAG), m_floppy0(*this, MB8877_TAG":0"), @@ -168,6 +169,7 @@ public: // HACK for MC6845 required_device<i8251_device> m_uart_sio; required_device<mb8877_t> m_fdc; required_device<mc6845_device> m_crtc; + required_device<palette_device> m_palette; required_device<centronics_device> m_centronics; required_device<ram_device> m_ram; required_device<floppy_connector> m_floppy0; diff --git a/src/mess/includes/vixen.h b/src/mess/includes/vixen.h index e0cd2d6e01c..80f782f441c 100644 --- a/src/mess/includes/vixen.h +++ b/src/mess/includes/vixen.h @@ -32,6 +32,7 @@ public: m_usart(*this, P8251A_TAG), m_discrete(*this, DISCRETE_TAG), m_ieee488(*this, IEEE488_TAG), + m_palette(*this, "palette"), m_ram(*this, RAM_TAG), m_floppy0(*this, FDC1797_TAG":0"), m_floppy1(*this, FDC1797_TAG":1"), @@ -62,6 +63,7 @@ public: required_device<i8251_device> m_usart; required_device<discrete_sound_device> m_discrete; required_device<ieee488_device> m_ieee488; + required_device<palette_device> m_palette; required_device<ram_device> m_ram; required_device<floppy_connector> m_floppy0; required_device<floppy_connector> m_floppy1; diff --git a/src/mess/includes/xerox820.h b/src/mess/includes/xerox820.h index 1276305b996..02a96e1b9c5 100644 --- a/src/mess/includes/xerox820.h +++ b/src/mess/includes/xerox820.h @@ -51,6 +51,7 @@ public: m_sio(*this, Z80SIO_TAG), m_fdc(*this, FD1771_TAG), m_ram(*this, RAM_TAG), + m_palette(*this, "palette"), m_floppy0(*this, FD1771_TAG":0"), m_floppy1(*this, FD1771_TAG":1"), m_rom(*this, Z80_TAG), @@ -73,6 +74,7 @@ public: required_device<z80sio0_device> m_sio; required_device<wd_fdc_t> m_fdc; required_device<ram_device> m_ram; + required_device<palette_device> m_palette; required_device<floppy_connector> m_floppy0; required_device<floppy_connector> m_floppy1; required_memory_region m_rom; diff --git a/src/mess/video/abc1600.c b/src/mess/video/abc1600.c index aff7cf19b85..2ed6ff5b958 100644 --- a/src/mess/video/abc1600.c +++ b/src/mess/video/abc1600.c @@ -172,6 +172,7 @@ void abc1600_mover_device::crtc_update_row(device_t *device, bitmap_rgb32 &bitma if (y > 0x3ff) return; int x = HFP; + const pen_t *pen = m_palette->pens(); for (int column = 0; column < x_count; column += 2) { @@ -186,7 +187,7 @@ void abc1600_mover_device::crtc_update_row(device_t *device, bitmap_rgb32 &bitma { int color = (BIT(data, 15) ^ PIX_POL) && !BLANK; - bitmap.pix32(y + VFP, x++) = RGB_MONOCHROME_GREEN[color]; + bitmap.pix32(y + VFP, x++) = pen[color]; data <<= 1; } @@ -234,6 +235,8 @@ static MACHINE_CONFIG_FRAGMENT( abc1600_mover ) MCFG_SCREEN_SIZE(958, 1067) MCFG_SCREEN_VISIBLE_AREA(0, 958-1, 0, 1067-1) + MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette") + MCFG_MC6845_ADD(SY6845E_TAG, SY6845E, SCREEN_TAG, XTAL_64MHz/32, crtc_intf) MACHINE_CONFIG_END @@ -263,6 +266,7 @@ abc1600_mover_device::abc1600_mover_device(const machine_config &mconfig, const device_memory_interface(mconfig, *this), m_space_config("vram", ENDIANNESS_BIG, 16, 18, -1, *ADDRESS_MAP_NAME(mover_map)), m_crtc(*this, SY6845E_TAG), + m_palette(*this, "palette"), m_wrmsk_rom(*this, "wrmsk"), m_shinf_rom(*this, "shinf"), m_drmsk_rom(*this, "drmsk") @@ -1284,7 +1288,7 @@ UINT32 abc1600_mover_device::screen_update(screen_device &screen, bitmap_rgb32 & { if (m_endisp) { - bitmap.fill(RGB_MONOCHROME_GREEN[FRAME_POL], cliprect); + bitmap.fill(m_palette->pen(FRAME_POL), cliprect); m_crtc->screen_update(screen, bitmap, cliprect); } else diff --git a/src/mess/video/abc1600.h b/src/mess/video/abc1600.h index c844486b681..9d340e3ee19 100644 --- a/src/mess/video/abc1600.h +++ b/src/mess/video/abc1600.h @@ -112,6 +112,7 @@ private: const address_space_config m_space_config; required_device<mc6845_device> m_crtc; + required_device<palette_device> m_palette; required_memory_region m_wrmsk_rom; required_memory_region m_shinf_rom; required_memory_region m_drmsk_rom; diff --git a/src/mess/video/abc80.c b/src/mess/video/abc80.c index d5cd9e594bd..f9397bc60e2 100644 --- a/src/mess/video/abc80.c +++ b/src/mess/video/abc80.c @@ -32,8 +32,8 @@ static const gfx_layout charlayout = //------------------------------------------------- static GFXDECODE_START( abc80 ) - GFXDECODE_ENTRY( "chargen", 0, charlayout, 0, 2 ) // normal characters - GFXDECODE_ENTRY( "chargen", 0x500, charlayout, 0, 2 ) // graphics characters + GFXDECODE_ENTRY( "chargen", 0, charlayout, 0, 1 ) // normal characters + GFXDECODE_ENTRY( "chargen", 0x500, charlayout, 0, 1 ) // graphics characters GFXDECODE_END @@ -137,7 +137,7 @@ void abc80_state::update_screen(bitmap_rgb32 &bitmap, const rectangle &cliprect) color ^= (cursor & m_blink); color &= blank; - bitmap.pix32(y, x) = RGB_MONOCHROME_WHITE[color]; + bitmap.pix32(y, x) = m_palette->pen(color); data <<= 1; } @@ -204,5 +204,6 @@ MACHINE_CONFIG_FRAGMENT( abc80_video ) MCFG_SCREEN_RAW_PARAMS(XTAL_11_9808MHz/2, ABC80_HTOTAL, ABC80_HBEND, ABC80_HBSTART, ABC80_VTOTAL, ABC80_VBEND, ABC80_VBSTART) - MCFG_GFXDECODE_ADD("gfxdecode", abc80) + MCFG_GFXDECODE_ADD("gfxdecode", abc80) + MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette") MACHINE_CONFIG_END diff --git a/src/mess/video/abc800.c b/src/mess/video/abc800.c index 84f1918a067..55cc04e2f55 100644 --- a/src/mess/video/abc800.c +++ b/src/mess/video/abc800.c @@ -197,6 +197,8 @@ MACHINE_CONFIG_END void abc800m_state::hr_update(bitmap_rgb32 &bitmap, const rectangle &cliprect) { UINT16 addr = 0; + + const pen_t *pen = m_palette->pens(); for (int y = m_hrs + VERTICAL_PORCH_HACK; y < MIN(cliprect.max_y + 1, m_hrs + VERTICAL_PORCH_HACK + 240); y++) { @@ -211,8 +213,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->base()[fgctl_addr] & 0x07) ? 1 : 0; - bitmap.pix32(y, x++) = RGB_MONOCHROME_YELLOW[color]; - bitmap.pix32(y, x++) = RGB_MONOCHROME_YELLOW[color]; + bitmap.pix32(y, x++) = pen[color]; + bitmap.pix32(y, x++) = pen[color]; data <<= 2; } @@ -230,6 +232,7 @@ static MC6845_UPDATE_ROW( abc800m_update_row ) abc800m_state *state = device->machine().driver_data<abc800m_state>(); int column; + rgb_t fgpen = state->m_palette->pen(1); // prevent wraparound if (y >= 240) return; @@ -256,7 +259,7 @@ static MC6845_UPDATE_ROW( abc800m_update_row ) if (BIT(data, 7)) { - bitmap.pix32(y, x) = RGB_MONOCHROME_YELLOW[1]; + bitmap.pix32(y, x) = fgpen; } data <<= 1; @@ -319,9 +322,10 @@ MACHINE_CONFIG_FRAGMENT( abc800m_video ) MCFG_SCREEN_ADD(SCREEN_TAG, RASTER) MCFG_SCREEN_UPDATE_DRIVER(abc800m_state, screen_update) - MCFG_SCREEN_REFRESH_RATE(60) 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_ADD_MONOCHROME_YELLOW("palette") MACHINE_CONFIG_END diff --git a/src/mess/video/abc802.c b/src/mess/video/abc802.c index 53a1b9e0428..2d634f4b754 100644 --- a/src/mess/video/abc802.c +++ b/src/mess/video/abc802.c @@ -63,6 +63,7 @@ static MC6845_UPDATE_ROW( abc802_update_row ) */ abc802_state *state = device->machine().driver_data<abc802_state>(); + const pen_t *pen = state->m_palette->pens(); int rf = 0, rc = 0, rg = 0; @@ -135,7 +136,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) = RGB_MONOCHROME_AMBER[color]; + bitmap.pix32(y, x) = pen[color]; data <<= 1; } @@ -147,8 +148,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) = RGB_MONOCHROME_AMBER[color]; - bitmap.pix32(y, x + 1) = RGB_MONOCHROME_AMBER[color]; + bitmap.pix32(y, x) = pen[color]; + bitmap.pix32(y, x + 1) = pen[color]; data <<= 1; } @@ -244,4 +245,6 @@ 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_ADD_MONOCHROME_AMBER("palette") MACHINE_CONFIG_END diff --git a/src/mess/video/mikromik.c b/src/mess/video/mikromik.c index 22b16478dc0..71c6af546a7 100644 --- a/src/mess/video/mikromik.c +++ b/src/mess/video/mikromik.c @@ -31,7 +31,7 @@ static I8275_DISPLAY_PIXELS( crtc_display_pixels ) int color = hlt_in ? 2 : (video_in ^ compl_in); - bitmap.pix32(y, x + i) = RGB_MONOCHROME_GREEN_HIGHLIGHT[color]; + bitmap.pix32(y, x + i) = state->m_palette->pen(color); } } @@ -58,7 +58,7 @@ static UPD7220_DISPLAY_PIXELS( hgdc_display_pixels ) for (int i = 0; i < 8; i++) { - if (BIT(data, 7-i)) bitmap.pix32(y, x + i) = RGB_MONOCHROME_GREEN_HIGHLIGHT[1]; + if (BIT(data, 7-i)) bitmap.pix32(y, x + i) = state->m_palette->pen(1); } } @@ -106,7 +106,7 @@ static const gfx_layout charlayout = //------------------------------------------------- static GFXDECODE_START( mm1 ) - GFXDECODE_ENTRY( "chargen", 0, charlayout, 0, 0x100 ) + GFXDECODE_ENTRY( "chargen", 0, charlayout, 0, 1 ) GFXDECODE_END @@ -123,6 +123,7 @@ MACHINE_CONFIG_FRAGMENT( mm1m6_video ) //MCFG_SCREEN_RAW_PARAMS(XTAL_18_720MHz, ...) MCFG_GFXDECODE_ADD("gfxdecode", mm1) + MCFG_PALETTE_ADD_MONOCHROME_GREEN_HIGHLIGHT("palette") MCFG_I8275_ADD(I8275_TAG, XTAL_18_720MHz/8, 8, crtc_display_pixels, DEVWRITELINE(I8237_TAG, am9517a_device, dreq0_w)) MCFG_VIDEO_SET_SCREEN(SCREEN_TAG) diff --git a/src/mess/video/newbrain.c b/src/mess/video/newbrain.c index f3160628587..ae010c0b15c 100644 --- a/src/mess/video/newbrain.c +++ b/src/mess/video/newbrain.c @@ -66,11 +66,11 @@ void newbrain_state::screen_update(bitmap_rgb32 &bitmap, const rectangle &clipre { int color = BIT(charrom_data, 7) ^ rv; - bitmap.pix32(y, x++) = RGB_MONOCHROME_WHITE[color]; + bitmap.pix32(y, x++) = m_palette->pen(color); if (columns == 40) { - bitmap.pix32(y, x++) = RGB_MONOCHROME_WHITE[color]; + bitmap.pix32(y, x++) = m_palette->pen(color); } charrom_data <<= 1; @@ -125,4 +125,6 @@ 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_ADD_BLACK_AND_WHITE("palette") MACHINE_CONFIG_END diff --git a/src/mess/video/v1050.c b/src/mess/video/v1050.c index bddeb890188..5dfacdb17ac 100644 --- a/src/mess/video/v1050.c +++ b/src/mess/video/v1050.c @@ -81,7 +81,7 @@ static MC6845_UPDATE_ROW( v1050_update_row ) /* display blank */ if (attr & V1050_ATTR_BLANK) color = 0; - bitmap.pix32(y, x) = RGB_MONOCHROME_GREEN_HIGHLIGHT[color]; + bitmap.pix32(y, x) = state->m_palette->pen(color); data <<= 1; } @@ -128,9 +128,10 @@ MACHINE_CONFIG_FRAGMENT( v1050_video ) MCFG_SCREEN_ADD(SCREEN_TAG, RASTER) MCFG_SCREEN_UPDATE_DEVICE(H46505_TAG, h46505_device, screen_update) - MCFG_SCREEN_REFRESH_RATE(60) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) MCFG_SCREEN_SIZE(640, 400) MCFG_SCREEN_VISIBLE_AREA(0,640-1, 0, 400-1) + + MCFG_PALETTE_ADD_MONOCHROME_GREEN_HIGHLIGHT("palette") MACHINE_CONFIG_END |