From 5d7d37b8da7519446d613620e3b0ddeec6c4e80a Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 2 Mar 2014 11:13:40 +0000 Subject: [PATCH] fixed decoding for PALETTE_FORMAT_BBGGRRII (nw) this fixes drivers in xxmissio, superqix and nova2001 --- src/emu/emupal.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/emu/emupal.h b/src/emu/emupal.h index f87b7d65e5d..cc107d5a2a5 100644 --- a/src/emu/emupal.h +++ b/src/emu/emupal.h @@ -146,7 +146,7 @@ #define PALETTE_FORMAT_RRRGGGBB raw_to_rgb_converter(1, &raw_to_rgb_converter::standard_rgb_decoder<3,3,2, 5,2,0>) // standard 2-2-2-2 formats -#define PALETTE_FORMAT_BBGGRRII raw_to_rgb_converter(1, &raw_to_rgb_converter::standard_irgb_decoder<2,2,2,2, 0,2,4,6>) +#define PALETTE_FORMAT_BBGGRRII raw_to_rgb_converter(1, &raw_to_rgb_converter::BBGGRRII_decoder) // standard 4-4-4 formats #define PALETTE_FORMAT_xxxxBBBBGGGGRRRR raw_to_rgb_converter(2, &raw_to_rgb_converter::standard_rgb_decoder<4,4,4, 0,4,8>) @@ -301,6 +301,15 @@ public: UINT8 b = (i * palexpand<_BlueBits>(raw >> _BlueShift)) >> 8; return rgb_t(r, g, b); } + + static rgb_t BBGGRRII_decoder(UINT32 raw) + { + UINT8 i = (raw >> 0) & 3; + UINT8 r = pal4bit(((raw >> 0) & 0x0c) | i); + UINT8 g = pal4bit(((raw >> 2) & 0x0c) | i); + UINT8 b = pal4bit(((raw >> 4) & 0x0c) | i); + return rgb_t(r, g, b); + } // other standard decoders static rgb_t RRRRGGGGBBBBRGBx_decoder(UINT32 raw); // bits 3/2/1 are LSb