本文整理汇总了C++中palette_device类的典型用法代码示例。如果您正苦于以下问题:C++ palette_device类的具体用法?C++ palette_device怎么用?C++ palette_device使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了palette_device类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
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
}
示例2: subs_palette
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
}
示例3: ettrivia_palette
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));
}
}
示例4: firebatl_palette
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);
}
}
示例5: olibochu_palette
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));
}
}
示例6: canyon_palette
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
}
示例7: yiear_palette
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++;
}
}
示例8: INPUT_PORTS_START
/* 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
//.........这里部分代码省略.........
示例9: gamecom_palette
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
}
示例10: kncljoe_palette
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);
}
}
示例11: lazercmd_palette
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
}
示例12:
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
}
示例13: alphatro_palette
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);
}
示例14: cave_palette
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;
}
}
}
示例15: dmndrby_palette
// 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);
}
}