trunk/src/emu/emupal.h
| r242120 | r242121 | |
| 143 | 143 | #define PALETTE_FORMAT_RRRRRGGGGGBBBBBx raw_to_rgb_converter(2, &raw_to_rgb_converter::standard_rgb_decoder<5,5,5, 11,6,1>) |
| 144 | 144 | #define PALETTE_FORMAT_GGGGGRRRRRBBBBBx raw_to_rgb_converter(2, &raw_to_rgb_converter::standard_rgb_decoder<5,5,5, 6,11,1>) |
| 145 | 145 | #define PALETTE_FORMAT_RRRRGGGGBBBBRGBx raw_to_rgb_converter(2, &raw_to_rgb_converter::RRRRGGGGBBBBRGBx_decoder) |
| 146 | | #define PALETTE_FORMAT_xRGBRRRRGGGGBBBB raw_to_rgb_converter(2, &raw_to_rgb_converter::xRGBRRRRGGGGBBBB_decoder) |
| 146 | #define PALETTE_FORMAT_xRGBRRRRGGGGBBBB_bit0 raw_to_rgb_converter(2, &raw_to_rgb_converter::xRGBRRRRGGGGBBBB_bit0_decoder) |
| 147 | #define PALETTE_FORMAT_xRGBRRRRGGGGBBBB_bit4 raw_to_rgb_converter(2, &raw_to_rgb_converter::xRGBRRRRGGGGBBBB_bit4_decoder) |
| 147 | 148 | |
| 148 | 149 | // standard 5-6-5 formats |
| 149 | 150 | #define PALETTE_FORMAT_RRRRRGGGGGGBBBBB raw_to_rgb_converter(2, &raw_to_rgb_converter::standard_rgb_decoder<5,6,5, 11,5,0>) |
| r242120 | r242121 | |
| 307 | 308 | static rgb_t BBGGRRII_decoder(UINT32 raw); |
| 308 | 309 | static rgb_t IRRRRRGGGGGBBBBB_decoder(UINT32 raw); |
| 309 | 310 | static rgb_t RRRRGGGGBBBBRGBx_decoder(UINT32 raw); // bits 3/2/1 are LSb |
| 310 | | static rgb_t xRGBRRRRGGGGBBBB_decoder(UINT32 raw); // bits 14/13/12 are LSb |
| 311 | static rgb_t xRGBRRRRGGGGBBBB_bit0_decoder(UINT32 raw); // bits 14/13/12 are LSb |
| 312 | static rgb_t xRGBRRRRGGGGBBBB_bit4_decoder(UINT32 raw); // bits 14/13/12 are MSb |
| 311 | 313 | |
| 312 | 314 | private: |
| 313 | 315 | // internal data |
trunk/src/mame/drivers/alpha68k.c
| r242120 | r242121 | |
| 2098 | 2098 | |
| 2099 | 2099 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", alpha68k_II) |
| 2100 | 2100 | MCFG_PALETTE_ADD("palette", 2048) |
| 2101 | | MCFG_PALETTE_FORMAT(xRGBRRRRGGGGBBBB) |
| 2101 | MCFG_PALETTE_FORMAT(xRGBRRRRGGGGBBBB_bit0) |
| 2102 | 2102 | |
| 2103 | 2103 | MCFG_VIDEO_START_OVERRIDE(alpha68k_state,alpha68k) |
| 2104 | 2104 | |
| r242120 | r242121 | |
| 2151 | 2151 | |
| 2152 | 2152 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", alpha68k_II) |
| 2153 | 2153 | MCFG_PALETTE_ADD("palette", 2048) |
| 2154 | | MCFG_PALETTE_FORMAT(xRGBRRRRGGGGBBBB) |
| 2154 | MCFG_PALETTE_FORMAT(xRGBRRRRGGGGBBBB_bit0) |
| 2155 | 2155 | |
| 2156 | 2156 | MCFG_VIDEO_START_OVERRIDE(alpha68k_state,alpha68k) |
| 2157 | 2157 | |
| r242120 | r242121 | |
| 2197 | 2197 | |
| 2198 | 2198 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", alpha68k_V) |
| 2199 | 2199 | MCFG_PALETTE_ADD("palette", 4096) |
| 2200 | | MCFG_PALETTE_FORMAT(xRGBRRRRGGGGBBBB) |
| 2200 | MCFG_PALETTE_FORMAT(xRGBRRRRGGGGBBBB_bit0) |
| 2201 | 2201 | |
| 2202 | 2202 | MCFG_VIDEO_START_OVERRIDE(alpha68k_state,alpha68k) |
| 2203 | 2203 | |
| r242120 | r242121 | |
| 2243 | 2243 | |
| 2244 | 2244 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", alpha68k_V) |
| 2245 | 2245 | MCFG_PALETTE_ADD("palette", 4096) |
| 2246 | | MCFG_PALETTE_FORMAT(xRGBRRRRGGGGBBBB) |
| 2246 | MCFG_PALETTE_FORMAT(xRGBRRRRGGGGBBBB_bit0) |
| 2247 | 2247 | |
| 2248 | 2248 | MCFG_VIDEO_START_OVERRIDE(alpha68k_state,alpha68k) |
| 2249 | 2249 | |
trunk/src/mame/drivers/supduck.c
| r242120 | r242121 | |
| 36 | 36 | m_text_videoram(*this, "textvideoram"), |
| 37 | 37 | m_fore_videoram(*this, "forevideoram"), |
| 38 | 38 | m_back_videoram(*this, "backvideoram"), |
| 39 | | m_paletteram(*this, "paletteram"), |
| 40 | 39 | m_gfxdecode(*this, "gfxdecode"), |
| 41 | 40 | m_palette(*this, "palette") |
| 42 | 41 | { } |
| r242120 | r242121 | |
| 50 | 49 | required_shared_ptr<UINT16> m_text_videoram; |
| 51 | 50 | required_shared_ptr<UINT16> m_fore_videoram; |
| 52 | 51 | required_shared_ptr<UINT16> m_back_videoram; |
| 53 | | required_shared_ptr<UINT16> m_paletteram; |
| 54 | 52 | |
| 55 | 53 | required_device<gfxdecode_device> m_gfxdecode; |
| 56 | 54 | required_device<palette_device> m_palette; |
| r242120 | r242121 | |
| 68 | 66 | |
| 69 | 67 | DECLARE_WRITE16_MEMBER(supduck_4000_w); |
| 70 | 68 | DECLARE_WRITE16_MEMBER(supduck_4002_w); |
| 71 | | DECLARE_WRITE16_MEMBER(supduck_paletteram_w); |
| 72 | 69 | |
| 73 | 70 | TILEMAP_MAPPER_MEMBER(supduk_tilemap_scan); |
| 74 | 71 | |
| r242120 | r242121 | |
| 245 | 242 | { |
| 246 | 243 | } |
| 247 | 244 | |
| 248 | | WRITE16_MEMBER(supduck_state::supduck_paletteram_w) |
| 249 | | { |
| 250 | | int r, g, b; |
| 251 | | data = COMBINE_DATA(&m_paletteram[offset]); |
| 252 | 245 | |
| 253 | | r = ((data >> 8) & 0x0f); |
| 254 | | if (data & 0x4000) r |= 0x10; |
| 255 | | |
| 256 | | g = ((data >> 4 ) & 0x0f); |
| 257 | | if (data & 0x2000) g |= 0x10; |
| 258 | | |
| 259 | | b = ((data >> 0 ) & 0x0f); |
| 260 | | if (data & 0x1000) b |= 0x10; |
| 261 | | |
| 262 | | m_palette->set_pen_color (offset, rgb_t(r<<3, g<<3, b<<3)); |
| 263 | | } |
| 264 | | |
| 265 | 246 | WRITE16_MEMBER(supduck_state::supduck_4002_w) |
| 266 | 247 | { |
| 267 | 248 | data &= mem_mask; |
| r242120 | r242121 | |
| 308 | 289 | AM_RANGE(0xfec000, 0xfecfff) AM_RAM_WRITE(text_videoram_w) AM_SHARE("textvideoram") |
| 309 | 290 | AM_RANGE(0xff0000, 0xff3fff) AM_RAM_WRITE(back_videoram_w) AM_SHARE("backvideoram") |
| 310 | 291 | AM_RANGE(0xff4000, 0xff7fff) AM_RAM_WRITE(fore_videoram_w) AM_SHARE("forevideoram") |
| 311 | | AM_RANGE(0xff8000, 0xff87ff) AM_RAM_WRITE(supduck_paletteram_w) AM_SHARE("paletteram") // AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") |
| 292 | AM_RANGE(0xff8000, 0xff87ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") |
| 312 | 293 | AM_RANGE(0xffc000, 0xffffff) AM_RAM /* working RAM */ |
| 313 | 294 | ADDRESS_MAP_END |
| 314 | 295 | |
| r242120 | r242121 | |
| 510 | 491 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", supduck) |
| 511 | 492 | |
| 512 | 493 | MCFG_PALETTE_ADD("palette", 0x800/2) |
| 513 | | // MCFG_PALETTE_FORMAT(xRGBRRRRGGGGBBBB) // can't use this, the RGB bits are the lowest bits with this format, for this game they're the highest bits |
| 494 | MCFG_PALETTE_FORMAT(xRGBRRRRGGGGBBBB_bit4) |
| 514 | 495 | |
| 515 | 496 | /* sound hardware */ |
| 516 | 497 | MCFG_SPEAKER_STANDARD_MONO("mono") |