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; } } }
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 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 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)); } }
// 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)); } }