void p2000m_state::p2000m_palette(palette_device &palette) const { palette.set_pen_color(0, rgb_t::white()); // white palette.set_pen_color(1, rgb_t::black()); // black palette.set_pen_color(2, rgb_t::black()); // black palette.set_pen_color(3, rgb_t::white()); // white }
void subs_state::subs_palette(palette_device &palette) const { palette.set_pen_color(0, rgb_t(0x00, 0x00, 0x00)); // BLACK - modified on video invert palette.set_pen_color(1, rgb_t(0xff, 0xff, 0xff)); // WHITE - modified on video invert palette.set_pen_color(2, rgb_t(0x00, 0x00, 0x00)); // BLACK - modified on video invert palette.set_pen_color(3, rgb_t(0xff, 0xff, 0xff)); // WHITE - modified on video invert }
void ettrivia_state::ettrivia_palette(palette_device &palette) const { uint8_t const *const color_prom = memregion("proms")->base(); static constexpr int resistances[2] = { 270, 130 }; // compute the color output resistor weights double weights[2]; compute_resistor_weights(0, 255, -1.0, 2, resistances, weights, 0, 0, 2, resistances, weights, 0, 0, 0, nullptr, nullptr, 0, 0); for (int i = 0; i < palette.entries(); i++) { int bit0, bit1; // red component bit0 = BIT(color_prom[i], 0); bit1 = BIT(color_prom[i+0x100], 0); int const r = combine_weights(weights, bit0, bit1); // green component bit0 = BIT(color_prom[i], 2); bit1 = BIT(color_prom[i+0x100], 2); int const g = combine_weights(weights, bit0, bit1); // blue component bit0 = BIT(color_prom[i], 1); bit1 = BIT(color_prom[i+0x100], 1); int const b = combine_weights(weights, bit0, bit1); palette.set_pen_color(bitswap<8>(i,5,7,6,2,1,0,4,3), rgb_t(r, g, b)); } }
void clshroad_state::firebatl_palette(palette_device &palette) const { const uint8_t *color_prom = memregion("proms")->base(); // create a lookup table for the palette for (int i = 0; i < 0x100; i++) { int const r = pal4bit(color_prom[i | 0x000]); int const g = pal4bit(color_prom[i | 0x100]); int const b = pal4bit(color_prom[i | 0x200]); palette.set_indirect_color(i, rgb_t(r, g, b)); } // color_prom now points to the beginning of the lookup table color_prom += 0x300; for (int i = 0; i < 0x200; i++) palette.set_pen_indirect(i, i & 0xff); for (int i = 0; i < 0x100; i++) { uint8_t const ctabentry = ((color_prom[i | 0x000] & 0x0f) << 4) | (color_prom[i | 0x100] & 0x0f); palette.set_pen_indirect(i | 0x200, ctabentry); } }
void olibochu_state::olibochu_palette(palette_device &palette) const { uint8_t const *const color_prom = memregion("proms")->base(); for (int i = 0; i < palette.entries(); i++) { int bit0, bit1, bit2; uint8_t const pen = (color_prom[0x20 + i] & 0x0f) | ((i < 0x100) ? 0x10 : 0x00); // red component bit0 = BIT(color_prom[pen], 0); bit1 = BIT(color_prom[pen], 1); bit2 = BIT(color_prom[pen], 2); int const r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; // green component bit0 = BIT(color_prom[pen], 3); bit1 = BIT(color_prom[pen], 4); bit2 = BIT(color_prom[pen], 5); int const g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; // blue component bit0 = BIT(color_prom[pen], 6); bit1 = BIT(color_prom[pen], 7); int const b = 0x4f * bit0 + 0xa8 * bit1; palette.set_pen_color(i, rgb_t(r, g, b)); } }
void canyon_state::canyon_palette(palette_device &palette) const { palette.set_pen_color(0, rgb_t(0x80, 0x80, 0x80)); // GREY palette.set_pen_color(1, rgb_t(0x00, 0x00, 0x00)); // BLACK palette.set_pen_color(2, rgb_t(0x80, 0x80, 0x80)); // GREY palette.set_pen_color(3, rgb_t(0xff, 0xff, 0xff)); // WHITE }
void yiear_state::yiear_palette(palette_device &palette) const { uint8_t const *color_prom = memregion("proms")->base(); for (int i = 0; i < palette.entries(); i++) { int bit0, bit1, bit2; // red component bit0 = BIT(*color_prom, 0); bit1 = BIT(*color_prom, 1); bit2 = BIT(*color_prom, 2); int const r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; // green component bit0 = BIT(*color_prom, 3); bit1 = BIT(*color_prom, 4); bit2 = BIT(*color_prom, 5); int const g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; // blue component bit0 = 0; bit1 = BIT(*color_prom, 6); bit2 = BIT(*color_prom, 7); int const b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; palette.set_pen_color(i, rgb_t(r,g,b)); color_prom++; } }
/* verified from M6502 code */ static INPUT_PORTS_START( progolf ) PORT_START("IN0") PORT_BIT( 0x7f, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") PORT_START("P1") PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START1 ) PORT_START("P2") PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_COCKTAIL PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_COCKTAIL PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START2 ) PORT_START("IN2") PORT_BIT( 0x3f, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_BIT( 0x40, IP_ACTIVE_LOW,IPT_COIN1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, progolf_state,coin_inserted, 0) PORT_BIT( 0x80, IP_ACTIVE_LOW,IPT_COIN2 ) PORT_CHANGED_MEMBER(DEVICE_SELF, progolf_state,coin_inserted, 0) PORT_START("DSW1") PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_B ) ) PORT_DIPSETTING( 0x03, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x02, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00) PORT_DIPSETTING( 0x02, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40) PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coin_A ) ) PORT_DIPSETTING( 0x0c, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x08, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00) PORT_DIPSETTING( 0x08, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40) PORT_DIPNAME( 0x10, 0x10, DEF_STR( Cabinet ) ) PORT_DIPSETTING( 0x10, DEF_STR( Upright ) ) PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) PORT_DIPUNUSED( 0x20, IP_ACTIVE_HIGH ) PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, progolf_state,coin_inserted, 0) /* same coinage as COIN1 */ PORT_SERVICE( 0x80, IP_ACTIVE_HIGH ) PORT_START("DSW2") PORT_DIPNAME( 0x01, 0x00, DEF_STR( Lives ) ) PORT_DIPSETTING( 0x00, "1" ) PORT_DIPSETTING( 0x01, "2" ) PORT_DIPNAME( 0x06, 0x00, DEF_STR( Bonus_Life ) ) /* table at 0xd16e (4 * 3 bytes, LSB first) - no multiple bonus lives */ PORT_DIPSETTING( 0x00, "10000" ) PORT_DIPSETTING( 0x02, "30000" ) PORT_DIPSETTING( 0x04, "50000" ) PORT_DIPSETTING( 0x06, DEF_STR( None ) ) PORT_DIPNAME( 0x08, 0x00, DEF_STR( Difficulty ) ) /* code at 0xd188 */ PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x08, DEF_STR( Hard ) ) PORT_DIPNAME( 0x10, 0x00, "Display Strength and Position" ) PORT_DIPSETTING( 0x10, DEF_STR( No ) ) PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) PORT_DIPNAME( 0x20, 0x00, "Force Coinage = A 1C/3C - B 1C/8C" ) /* SERVICE1 = 2C/1C */ PORT_DIPSETTING( 0x00, DEF_STR( No ) ) PORT_DIPSETTING( 0x20, DEF_STR( Yes ) ) PORT_DIPNAME( 0x40, 0x00, "Coin Mode" ) PORT_DIPSETTING( 0x00, "Mode 1" ) PORT_DIPSETTING( 0x40, "Mode 2" ) PORT_DIPUNUSED( 0x80, IP_ACTIVE_HIGH ) INPUT_PORTS_END static const gfx_layout charlayout = { 8,8, /* 8*8 characters */ RGN_FRAC(1,3), /* 512 characters */ 3, /* 3 bits per pixel */ { RGN_FRAC(2,3), RGN_FRAC(1,3), RGN_FRAC(0,3) }, /* the bitplanes are separated */ { 0, 1, 2, 3, 4, 5, 6, 7 }, { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, 8*8 /* every char takes 8 consecutive bytes */ }; static GFXDECODE_START( gfx_progolf ) GFXDECODE_ENTRY( "gfx1", 0x0000, charlayout, 0, 8 ) /* sprites */ GFXDECODE_END void progolf_state::progolf_palette(palette_device &palette) const { const uint8_t *color_prom = memregion("proms")->base(); for (int i = 0; i < palette.entries(); i++) { int bit0, bit1, bit2; // red component bit0 = BIT(color_prom[i], 0); bit1 = BIT(color_prom[i], 1); bit2 = BIT(color_prom[i], 2); int const r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; // green component bit0 = BIT(color_prom[i], 3); bit1 = BIT(color_prom[i], 4); bit2 = BIT(color_prom[i], 5); int const g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; // blue component bit0 = 0; bit1 = BIT(color_prom[i], 6); bit2 = BIT(color_prom[i], 7); int const b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; palette.set_pen_color(i, rgb_t(r, g, b)); } }
INPUT_PORTS_END void gamecom_state::gamecom_palette(palette_device &palette) const { palette.set_pen_color(0, 0x00, 0x00, 0x00); // Black palette.set_pen_color(1, 0x0f, 0x4f, 0x2f); // Gray 1 palette.set_pen_color(2, 0x6f, 0x8f, 0x4f); // Gray 2 palette.set_pen_color(3, 0x8f, 0xcf, 0x8f); // Grey 3 palette.set_pen_color(4, 0xdf, 0xff, 0x8f); // White }
void kncljoe_state::kncljoe_palette(palette_device &palette) const { uint8_t const *color_prom = memregion("proms")->base(); // create a lookup table for the palette for (int i = 0; i < 0x80; i++) { int const r = pal4bit(color_prom[i + 0x000]); int const g = pal4bit(color_prom[i + 0x100]); int const b = pal4bit(color_prom[i + 0x200]); palette.set_indirect_color(i, rgb_t(r, g, b)); } for (int i = 0; i < 0x10; i++) { int bit0, bit1, bit2; // red component bit0 = 0; bit1 = BIT(color_prom[i + 0x300], 6); bit2 = BIT(color_prom[i + 0x300], 7); int const r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; // green component bit0 = BIT(color_prom[i + 0x300], 3); bit1 = BIT(color_prom[i + 0x300], 4); bit2 = BIT(color_prom[i + 0x300], 5); int const g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; // blue component bit0 = BIT(color_prom[i + 0x300], 0); bit1 = BIT(color_prom[i + 0x300], 1); bit2 = BIT(color_prom[i + 0x300], 2); int const b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; palette.set_indirect_color(i + 0x80, rgb_t(r, g, b)); } // color_prom now points to the beginning of the lookup table color_prom += 0x320; // chars for (int i = 0; i < 0x80; i++) palette.set_pen_indirect(i, i); // sprite lookup table for (int i = 0; i < 0x80; i++) { uint8_t const ctabentry = (color_prom[i] & 0x0f) | 0x80; palette.set_pen_indirect(i + 0x80, ctabentry); } }
GFXDECODE_END void lazercmd_state::lazercmd_palette(palette_device &palette) const { palette.set_pen_color(0, rgb_t(0xb0, 0xb0, 0xb0)); // white palette.set_pen_color(1, rgb_t(0x00, 0x00, 0x00)); // black palette.set_pen_color(2, rgb_t(0x00, 0x00, 0x00)); // black palette.set_pen_color(3, rgb_t(0xb0, 0xb0, 0xb0)); // white palette.set_pen_color(4, rgb_t(0xff, 0xff, 0xff)); // bright white }
INPUT_PORTS_END //************************************************************************** // MACHINE EMULATION //************************************************************************** void cz101_state::cz101_palette(palette_device &palette) const { palette.set_pen_color(0, rgb_t(138, 146, 148)); // background palette.set_pen_color(1, rgb_t( 92, 83, 88)); // lcd pixel on palette.set_pen_color(2, rgb_t(131, 136, 139)); // lcd pixel off }
void alphatro_state::alphatro_palette(palette_device &palette) const { // RGB colours palette.set_pen_color(0, 0x00, 0x00, 0x00); palette.set_pen_color(1, 0x00, 0x00, 0xff); palette.set_pen_color(2, 0xff, 0x00, 0x00); palette.set_pen_color(3, 0xff, 0x00, 0xff); palette.set_pen_color(4, 0x00, 0xff, 0x00); palette.set_pen_color(5, 0x00, 0xff, 0xff); palette.set_pen_color(6, 0xff, 0xff, 0x00); palette.set_pen_color(7, 0xff, 0xff, 0xff); // Amber palette.set_pen_color(8, 0xf7, 0xaa, 0x00); }
void cave_state::cave_palette(palette_device &palette) { for (int chip = 0; chip < 4; chip++) { // create a 1:1 palette map covering everything m_palette_map[chip] = std::make_unique<uint16_t[]>(palette.entries()); int const maxpens = m_paletteram[chip].bytes() / 2; if (maxpens) { for (int pen = 0; pen < palette.entries(); pen++) m_palette_map[chip][pen] = pen % maxpens; } } }
// copied from elsewhere. surely incorrect void dmndrby_state::dmndrby_palette(palette_device &palette) const { const uint8_t *color_prom = memregion("proms")->base(); static constexpr int resistances_rg[3] = { 1000, 470, 220 }; static constexpr int resistances_b [2] = { 470, 220 }; // compute the color output resistor weights double rweights[3], gweights[3], bweights[2]; compute_resistor_weights(0, 255, -1.0, 3, &resistances_rg[0], rweights, 470, 0, 3, &resistances_rg[0], gweights, 470, 0, 2, &resistances_b[0], bweights, 470, 0); // create a lookup table for the palette for (int i = 0; i < 0x20; i++) { int bit0, bit1, bit2; // red component */ bit0 = BIT(color_prom[i], 0); bit1 = BIT(color_prom[i], 1); bit2 = BIT(color_prom[i], 2); int const r = combine_3_weights(rweights, bit0, bit1, bit2); // green component bit0 = BIT(color_prom[i], 3); bit1 = BIT(color_prom[i], 4); bit2 = BIT(color_prom[i], 5); int const g = combine_3_weights(gweights, bit0, bit1, bit2); // blue component bit0 = BIT(color_prom[i], 6); bit1 = BIT(color_prom[i], 7); int const b = combine_2_weights(bweights, bit0, bit1); palette.set_indirect_color(i, rgb_t(r, g, b)); } // color_prom now points to the beginning of the lookup table color_prom = memregion("proms2")->base(); // normal tiles use colors 0-15 for (int i = 0x000; i < 0x300; i++) { uint8_t ctabentry = color_prom[i]; palette.set_pen_indirect(i, ctabentry); } }
void lgp_state::lgp_palette(palette_device &palette) const { uint8_t const *const color_prom = memregion("proms")->base(); for (int i = 0; i < 0x20; i++) { int bit0, bit1, bit2; // red component bit0 = 0; //BIT(color_prom[i], 0); bit1 = BIT(color_prom[i], 0); bit2 = BIT(color_prom[i], 1); int const r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; // green component bit0 = 0; //BIT(color_prom[i], 3); bit1 = BIT(color_prom[i], 2); bit2 = BIT(color_prom[i], 3); int const g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; // blue component bit0 = 0; //BIT(color_prom[i], 5); bit1 = BIT(color_prom[i], 4); bit2 = BIT(color_prom[i], 5); int const b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; palette.set_pen_color(i,rgb_t(r,g,b)); } }
void docastle_state::docastle_palette(palette_device &palette) const { uint8_t const *const color_prom = memregion("proms")->base(); for (int i = 0; i < 256; i++) { int bit0, bit1, bit2; // red component bit0 = BIT(color_prom[i], 5); bit1 = BIT(color_prom[i], 6); bit2 = BIT(color_prom[i], 7); int const r = 0x23 * bit0 + 0x4b * bit1 + 0x91 * bit2; // green component bit0 = BIT(color_prom[i], 2); bit1 = BIT(color_prom[i], 3); bit2 = BIT(color_prom[i], 4); int const g = 0x23 * bit0 + 0x4b * bit1 + 0x91 * bit2; // blue component bit0 = 0; bit1 = BIT(color_prom[i], 0); bit2 = BIT(color_prom[i], 1); int const b = 0x23 * bit0 + 0x4b * bit1 + 0x91 * bit2; /* because the graphics are decoded as 4bpp with the top bit used for transparency or priority, we create matching 3bpp sets of palette entries, which effectively ignores the value of the top bit */ palette.set_pen_color(((i & 0xf8) << 1) | 0x00 | (i & 0x07), rgb_t(r, g, b)); palette.set_pen_color(((i & 0xf8) << 1) | 0x08 | (i & 0x07), rgb_t(r, g, b)); } }
void mogura_state::mogura_palette(palette_device &palette) const { uint8_t const *const color_prom = memregion("proms")->base(); for (int i = 0, j = 0; i < 0x20; i++) { int bit0, bit1, bit2; // red component bit0 = BIT(color_prom[i], 0); bit1 = BIT(color_prom[i], 1); bit2 = BIT(color_prom[i], 2); int const r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; // green component bit0 = BIT(color_prom[i], 3); bit1 = BIT(color_prom[i], 4); bit2 = BIT(color_prom[i], 5); int const g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; // blue component bit0 = 0; bit1 = BIT(color_prom[i], 6); bit2 = BIT(color_prom[i], 7); int const b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; palette.set_pen_color(j, rgb_t(r, g, b)); j += 4; if (j > 31) j -= 31; } }
static void blendbitmaps(palette_device &palette, bitmap_rgb32 &dest,bitmap_ind16 &src1,bitmap_ind16 &src2, const rectangle &cliprect) { int y,x; const pen_t *paldata = palette.pens(); for (y = cliprect.min_y; y <= cliprect.max_y; y++) { UINT32 *dd = &dest.pix32(y); UINT16 *sd1 = &src1.pix16(y); UINT16 *sd2 = &src2.pix16(y); for (x = cliprect.min_x; x <= cliprect.max_x; x++) { if (sd2[x]) { if (sd2[x] & 0x1000) dd[x] = paldata[sd1[x] & 0x07ff] + paldata[sd2[x]]; else dd[x] = paldata[sd2[x]]; } else dd[x] = paldata[sd1[x]]; } } }
void funkybee_state::funkybee_palette(palette_device &palette) const { const uint8_t *color_prom = memregion("proms")->base(); // first, the character/sprite palette for (int i = 0; i < 32; i++) { int bit0, bit1, bit2; // red component bit0 = BIT(*color_prom, 0); bit1 = BIT(*color_prom, 1); bit2 = BIT(*color_prom, 2); int const r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; // green component bit0 = BIT(*color_prom, 3); bit1 = BIT(*color_prom, 4); bit2 = BIT(*color_prom, 5); int const g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; // blue component bit0 = 0; bit1 = BIT(*color_prom, 6); bit2 = BIT(*color_prom, 7); int const b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; palette.set_pen_color(i, rgb_t(r, g, b)); color_prom++; } }
void mermaid_state::rougien_palette(palette_device &palette) const { common_palette(palette); // black background palette.set_indirect_color(0x40, rgb_t(0, 0, 0)); // char/sprite palette for (int i = 0; i < 0x40; i++) palette.set_pen_indirect(i, i); // background palette palette.set_pen_indirect(0x40, 0x40); palette.set_pen_indirect(0x41, 0x00); palette.set_pen_indirect(0x42, 0x00); palette.set_pen_indirect(0x43, 0x02); }
void tagteam_state::tagteam_palette(palette_device &palette) const { uint8_t const *const color_prom = memregion("proms")->base(); std::vector<rgb_t> rgb; compute_res_net_all(rgb, color_prom, tagteam_decode_info, tagteam_net_info); palette.set_pen_colors(0x00, rgb); }
void gb_state::gbc_palette(palette_device &palette) const { for (int i = 0; i < 32768; i++) { int const r = i & 0x1f; int const g = (i >> 5) & 0x1f; int const b = (i >> 10) & 0x1f; palette.set_pen_color(i, pal5bit(r), pal5bit(g), pal5bit(b)); } }
void timeplt_state::timeplt_palette(palette_device &palette) const { const uint8_t *color_prom = memregion("proms")->base(); rgb_t palette_val[32]; for (int i = 0; i < 32; i++) { int bit0, bit1, bit2, bit3, bit4; bit0 = BIT(color_prom[i + 1 * 32], 1); bit1 = BIT(color_prom[i + 1 * 32], 2); bit2 = BIT(color_prom[i + 1 * 32], 3); bit3 = BIT(color_prom[i + 1 * 32], 4); bit4 = BIT(color_prom[i + 1 * 32], 5); int const r = 0x19 * bit0 + 0x24 * bit1 + 0x35 * bit2 + 0x40 * bit3 + 0x4d * bit4; bit0 = BIT(color_prom[i + 1 * 32], 6); bit1 = BIT(color_prom[i + 1 * 32], 7); bit2 = BIT(color_prom[i + 0 * 32], 0); bit3 = BIT(color_prom[i + 0 * 32], 1); bit4 = BIT(color_prom[i + 0 * 32], 2); int const g = 0x19 * bit0 + 0x24 * bit1 + 0x35 * bit2 + 0x40 * bit3 + 0x4d * bit4; bit0 = BIT(color_prom[i + 0 * 32], 3); bit1 = BIT(color_prom[i + 0 * 32], 4); bit2 = BIT(color_prom[i + 0 * 32], 5); bit3 = BIT(color_prom[i + 0 * 32], 6); bit4 = BIT(color_prom[i + 0 * 32], 7); int const b = 0x19 * bit0 + 0x24 * bit1 + 0x35 * bit2 + 0x40 * bit3 + 0x4d * bit4; palette_val[i] = rgb_t(r, g, b); } color_prom += 2*32; // color_prom now points to the beginning of the lookup table // sprites for (int i = 0; i < 64 * 4; i++) palette.set_pen_color(32 * 4 + i, palette_val[*color_prom++ & 0x0f]); // characters for (int i = 0; i < 32 * 4; i++) palette.set_pen_color(i, palette_val[(*color_prom++ & 0x0f) + 0x10]); }
void clshroad_state::clshroad_palette(palette_device &palette) const { const uint8_t *color_prom = memregion("proms")->base(); for (int i = 0; i < 256; i++) { palette.set_pen_color(i, pal4bit(color_prom[i | 0x000]), pal4bit(color_prom[i | 0x100]), pal4bit(color_prom[i | 0x200])); } }
void fastlane_state::fastlane_palette(palette_device &palette) const { uint8_t const *const color_prom = memregion("proms")->base(); for (int pal = 0; pal < 0x10; pal++) { for (int i = 0; i < 0x400; i++) { uint8_t const ctabentry = (i & 0x3f0) | color_prom[(pal << 4) | (i & 0x0f)]; palette.set_pen_indirect((pal << 10) | i, ctabentry); } } }
void mermaid_state::common_palette(palette_device &palette) const { uint8_t const *const color_prom = memregion("proms")->base(); for (int i = 0; i < 0x40; i++) { int const r = 0x21 * BIT(color_prom[i], 0) + 0x47 * BIT(color_prom[i], 1) + 0x97 * BIT(color_prom[i], 2); int const g = 0x21 * BIT(color_prom[i], 3) + 0x47 * BIT(color_prom[i], 4) + 0x97 * BIT(color_prom[i], 5); int const b = 0x47 * BIT(color_prom[i], 6) + 0x97 * BIT(color_prom[i], 7); palette.set_indirect_color(i, rgb_t(r, g, b)); } }
GFXDECODE_END void mrgame_state::mrgame_palette(palette_device &palette) const { static constexpr int resistances[3] = { 1000, 470, 220 }; uint8_t const *const color_prom = machine().root_device().memregion("proms")->base(); // compute the color output resistor weights double rweights[3], gweights[3], bweights[2]; compute_resistor_weights(0, 255, -1.0, 3, &resistances[0], rweights, 0, 0, 3, &resistances[0], gweights, 0, 0, 2, &resistances[1], bweights, 0, 0); // create a lookup table for the palette for (uint8_t i = 0; i < 32; i++) { uint8_t bit0, bit1, bit2; // red component bit0 = BIT(color_prom[i], 0); bit1 = BIT(color_prom[i], 1); bit2 = BIT(color_prom[i], 2); uint8_t const r = combine_3_weights(rweights, bit0, bit1, bit2); // green component bit0 = BIT(color_prom[i], 3); bit1 = BIT(color_prom[i], 4); bit2 = BIT(color_prom[i], 5); uint8_t const g = combine_3_weights(gweights, bit0, bit1, bit2); // blue component bit0 = BIT(color_prom[i], 6); bit1 = BIT(color_prom[i], 7); uint8_t const b = combine_2_weights(bweights, bit0, bit1); palette.set_pen_color(i, rgb_t(r, g, b)); palette.set_pen_color(i + 32, rgb_t(r, g, b)); } }
// guess: use the same resistor values as Crazy Climber (needs checking on the real hardware) void jangou_state::jangou_palette(palette_device &palette) const { uint8_t const *const color_prom = memregion("proms")->base(); static constexpr int resistances_rg[3] = { 1000, 470, 220 }; static constexpr int resistances_b [2] = { 470, 220 }; // compute the color output resistor weights double weights_rg[3], weights_b[2]; compute_resistor_weights(0, 255, -1.0, 3, resistances_rg, weights_rg, 0, 0, 2, resistances_b, weights_b, 0, 0, 0, nullptr, nullptr, 0, 0); for (int i = 0;i < palette.entries(); i++) { int bit0, bit1, bit2; // red component bit0 = BIT(color_prom[i], 0); bit1 = BIT(color_prom[i], 1); bit2 = BIT(color_prom[i], 2); int const r = combine_weights(weights_rg, bit0, bit1, bit2); // green component bit0 = BIT(color_prom[i], 3); bit1 = BIT(color_prom[i], 4); bit2 = BIT(color_prom[i], 5); int const g = combine_weights(weights_rg, bit0, bit1, bit2); // blue component bit0 = BIT(color_prom[i], 6); bit1 = BIT(color_prom[i], 7); int const b = combine_weights(weights_b, bit0, bit1); palette.set_pen_color(i, rgb_t(r, g, b)); } }
void fortecar_state::fortecar_palette(palette_device &palette) const { /* Video resistors... O1 (LS374) R1K RED O2 (LS374) R510 RED O3 (LS374) R220 RED O4 (LS374) R1K GREEN O5 (LS374) R510 GREEN O6 (LS374) R220 GREEN O7 (LS374) R510 BLUE O8 (LS374) R220 BLUE R = 82 Ohms Pull Down. */ static constexpr int resistances_rg[3] = { 1000, 510, 220 }; static constexpr int resistances_b [2] = { 510, 220 }; double weights_r[3], weights_g[3], weights_b[2]; compute_resistor_weights(0, 255, -1.0, 3, resistances_rg, weights_r, 82, 0, 3, resistances_rg, weights_g, 82, 0, 2, resistances_b, weights_b, 82, 0); uint8_t const *const color_prom = memregion("proms")->base(); for (int i = 0; i < 512; i++) { int bit0, bit1, bit2; // red component bit0 = BIT(color_prom[i], 0); bit1 = BIT(color_prom[i], 1); bit2 = BIT(color_prom[i], 2); int const r = combine_weights(weights_r, bit0, bit1, bit2); // green component bit0 = BIT(color_prom[i], 3); bit1 = BIT(color_prom[i], 4); bit2 = BIT(color_prom[i], 5); int const g = combine_weights(weights_g, bit0, bit1, bit2); // blue component bit0 = BIT(color_prom[i], 6); bit1 = BIT(color_prom[i], 7); int const b = combine_weights(weights_b, bit0, bit1); palette.set_pen_color(i, rgb_t(r, g, b)); } }