diff options
author | Dirk Best <mail@dirk-best.de> | 2015-07-27 13:24:52 +0200 |
---|---|---|
committer | Dirk Best <mail@dirk-best.de> | 2015-07-27 13:37:54 +0200 |
commit | 6187ca5ef0c10dc563c9e401c681edc706a3de3a (patch) | |
tree | 6e0bbc652bc24f28f36f49f9aac1f2eb0da3c698 | |
parent | 59f346c25498e1413d9837d010856980d714ce77 (diff) |
Add a 3-bit BGR variant and use it for unkhorse
-rw-r--r-- | src/emu/emupal.c | 11 | ||||
-rw-r--r-- | src/emu/emupal.h | 5 | ||||
-rw-r--r-- | src/mame/drivers/unkhorse.c | 11 |
3 files changed, 17 insertions, 10 deletions
diff --git a/src/emu/emupal.c b/src/emu/emupal.c index 88a45c8d49a..044a55c7096 100644 --- a/src/emu/emupal.c +++ b/src/emu/emupal.c @@ -827,6 +827,17 @@ void palette_device::palette_init_3bit_rgb(palette_device &palette) /*------------------------------------------------- + 3bit_bgr - 8-color rgb +-------------------------------------------------*/ + +void palette_device::palette_init_3bit_bgr(palette_device &palette) +{ + for (int i = 0; i < 8; i++) + palette.set_pen_color(i, rgb_t(pal1bit(i >> 2), pal1bit(i >> 1), pal1bit(i >> 0))); +} + + +/*------------------------------------------------- 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 e4a5ba17c0b..bf9a43b371c 100644 --- a/src/emu/emupal.h +++ b/src/emu/emupal.h @@ -236,6 +236,10 @@ MCFG_PALETTE_ADD(_tag, 8) \ palette_device::static_set_init(*device, palette_init_delegate(FUNC(palette_device::palette_init_3bit_rgb), downcast<palette_device *>(device))); +#define MCFG_PALETTE_ADD_3BIT_BGR(_tag) \ + MCFG_PALETTE_ADD(_tag, 8) \ + palette_device::static_set_init(*device, palette_init_delegate(FUNC(palette_device::palette_init_3bit_bgr), 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))); @@ -401,6 +405,7 @@ public: void palette_init_monochrome_green_highlight(palette_device &palette); void palette_init_monochrome_yellow(palette_device &palette); void palette_init_3bit_rgb(palette_device &palette); + void palette_init_3bit_bgr(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/mame/drivers/unkhorse.c b/src/mame/drivers/unkhorse.c index 21584b91f23..d57de399ca0 100644 --- a/src/mame/drivers/unkhorse.c +++ b/src/mame/drivers/unkhorse.c @@ -48,7 +48,6 @@ public: DECLARE_WRITE_LINE_MEMBER(timer_out); virtual void machine_start(); - DECLARE_PALETTE_INIT(horse); UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); @@ -67,13 +66,6 @@ void horse_state::machine_start() ***************************************************************************/ -PALETTE_INIT_MEMBER(horse_state, horse) -{ - // palette is simply 3bpp - for (int i = 0; i < 8; i++) - palette.set_pen_color(i, pal1bit(i >> 2), pal1bit(i >> 1), pal1bit(i >> 0)); -} - UINT32 horse_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { for (int y = cliprect.min_y; y <= cliprect.max_y; y++) @@ -223,8 +215,7 @@ static MACHINE_CONFIG_START( horse, horse_state ) MCFG_SCREEN_UPDATE_DRIVER(horse_state, screen_update) MCFG_SCREEN_PALETTE("palette") - MCFG_PALETTE_ADD("palette", 8) - MCFG_PALETTE_INIT_OWNER(horse_state, horse) + MCFG_PALETTE_ADD_3BIT_BGR("palette") /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") |