• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ palette_set_color_rgb函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中palette_set_color_rgb函数的典型用法代码示例。如果您正苦于以下问题:C++ palette_set_color_rgb函数的具体用法?C++ palette_set_color_rgb怎么用?C++ palette_set_color_rgb使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了palette_set_color_rgb函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: coinmstr_set_pal

static void coinmstr_set_pal(running_machine &machine, UINT32 paldat, int col)
{
	col = col *4;

	{
		int r0, r1, r2, r3;
		int g0, g1, g2, g3;
		int b0, b1, b2, b3;

		r0 = (paldat & 0x1000) >> 12 ;
		g0 = (paldat & 0x0800) >> 11 ;
		b0 = (paldat & 0x0400) >> 10 ;
		r1 = (paldat & 0x0200) >> 9 ;
		g1 = (paldat & 0x0100) >> 8 ;
		b1 = (paldat & 0x0080) >> 7 ;

		r2 = (paldat & 0x0020) >> 5 ;
		g2 = (paldat & 0x0010) >> 4 ;
		b2 = (paldat & 0x0008) >> 3 ;
		r3 = (paldat & 0x0004) >> 2 ;
		g3 = (paldat & 0x0002) >> 1 ;
		b3 = (paldat & 0x0001) >> 0 ;


		palette_set_color_rgb(machine, col+0, (b0 * 255) << 5, (g0 * 255) << 5, (r0 * 255) << 5);
		palette_set_color_rgb(machine, col+2, (b1 * 255) << 5, (g1 * 255) << 5, (r1 * 255) << 5);
		palette_set_color_rgb(machine, col+1, (b2 * 255) << 5, (g2 * 255) << 5, (r2 * 255) << 5);
		palette_set_color_rgb(machine, col+3, (b3 * 255) << 5, (g3 * 255) << 5, (r3 * 255) << 5);

	}
}
开发者ID:antervud,项目名称:MAMEHub,代码行数:31,代码来源:coinmstr.c


示例2: WRITE32_HANDLER

static WRITE32_HANDLER( paletteram32_xRRRRRGGGGGBBBBB_dword_w )
{
	if(ACCESSING_BITS_16_31)
	{
		int r,g,b;
		COMBINE_DATA(&paletteram32[offset]);

		r = (paletteram32[offset] & 0x7c000000) >> (10+16);
		g = (paletteram32[offset] & 0x03e00000) >> (5+16);
		b = (paletteram32[offset] & 0x001f0000) >> (0+16);

		palette_set_color_rgb(space->machine,offset*2,pal5bit(r),pal5bit(g),pal5bit(b));
	}

	if(ACCESSING_BITS_0_15)
	{
		int r,g,b;
		COMBINE_DATA(&paletteram32[offset]);

		r = (paletteram32[offset] & 0x00007c00) >> (10);
		g = (paletteram32[offset] & 0x000003e0) >> (5);
		b = (paletteram32[offset] & 0x0000001f) >> (0);

		palette_set_color_rgb(space->machine,offset*2+1,pal5bit(r),pal5bit(g),pal5bit(b));
	}
}
开发者ID:Paulodx,项目名称:sdl-mame-wii,代码行数:26,代码来源:fuukifg3.c


示例3: PALETTE_INIT_MEMBER

GFXDECODE_END

PALETTE_INIT_MEMBER( cdc721_state, cdc721 )
{
	palette_set_color_rgb( machine(), 0, 0, 0, 0 ); /* Black */
	palette_set_color_rgb( machine(), 1, 0, 255, 0 );   /* Full */
	palette_set_color_rgb( machine(), 2, 0, 128, 0 );   /* Dimmed */
}
开发者ID:antervud,项目名称:MAMEHub,代码行数:8,代码来源:cdc721.c


示例4: palette_set_color

GFXDECODE_END

void vta2000_state::palette_init()
{
	palette_set_color(machine(), 0, RGB_BLACK); // black
	palette_set_color_rgb(machine(), 1, 0x00, 0xc0, 0x00); // green
	palette_set_color_rgb(machine(), 2, 0x00, 0xff, 0x00); // highlight
}
开发者ID:coinhelper,项目名称:jsmess,代码行数:8,代码来源:vta2000.c


示例5: palette_set_color_rgb

INPUT_PORTS_END


void osbexec_state::palette_init()
{
	palette_set_color_rgb( machine(), 0, 0, 0, 0 ); /* Black */
	palette_set_color_rgb( machine(), 1, 0, 255, 0 );   /* Full */
	palette_set_color_rgb( machine(), 2, 0, 128, 0 );   /* Dimmed */
}
开发者ID:thomas41546,项目名称:mame4raspi,代码行数:9,代码来源:osbexec.c


示例6: PALETTE_INIT

INPUT_PORTS_END

/* Video */

static PALETTE_INIT( mm1 )
{
	palette_set_color(machine, 0, RGB_BLACK); /* black */
	palette_set_color_rgb(machine, 1, 0x00, 0xc0, 0x00); /* green */
	palette_set_color_rgb(machine, 2, 0x00, 0xff, 0x00); /* bright green */
}
开发者ID:rogerjowett,项目名称:ClientServerMAME,代码行数:10,代码来源:mikromik.c


示例7: PALETTE_INIT

//  PORT_START( "KO14" )
INPUT_PORTS_END


static PALETTE_INIT( cfx9850 )
{
	palette_set_color_rgb( machine, 0, 0xff, 0xff, 0xff );
	palette_set_color_rgb( machine, 1, 0x00, 0x00, 0xff );
	palette_set_color_rgb( machine, 2, 0x00, 0xff, 0x00 );
	palette_set_color_rgb( machine, 3, 0xff, 0x00, 0x00 );
}
开发者ID:cdenix,项目名称:psmame,代码行数:11,代码来源:cfx9850.c


示例8: palette_set_color_rgb

INPUT_PORTS_END

/***************************************************************************
    VIDEO
***************************************************************************/

void px8_state::palette_init()
{
	palette_set_color_rgb(machine(), 0, 0xa5, 0xad, 0xa5);
	palette_set_color_rgb(machine(), 1, 0x31, 0x39, 0x10);
}
开发者ID:antervud,项目名称:MAMEHub,代码行数:11,代码来源:px8.c


示例9: palette_set_color_rgb

void wangpc_tig_device::device_start()
{
	// initialize palette
	palette_set_color_rgb(machine(), 0, 0, 0, 0);
	palette_set_color_rgb(machine(), 1, 0, 0x80, 0);
	palette_set_color_rgb(machine(), 2, 0, 0xff, 0);

	// state saving
	save_item(NAME(m_option));
	save_item(NAME(m_attr));
	save_item(NAME(m_underline));
}
开发者ID:Ilgrim,项目名称:MAMEHub,代码行数:12,代码来源:wangpc_tig.c


示例10: PALETTE_INIT

static PALETTE_INIT( c128 )
{
	int i;

	for (i = 0; i < sizeof(vic2_palette) / 3; i++)
	{
		palette_set_color_rgb(machine, i, vic2_palette[i * 3], vic2_palette[i * 3 + 1], vic2_palette[i * 3 + 2]);
	}

	for (i = 0; i < sizeof(vdc8563_palette) / 3; i++)
	{
		palette_set_color_rgb(machine, i + sizeof(vic2_palette) / 3, vdc8563_palette[i * 3], vdc8563_palette[i * 3 + 1], vdc8563_palette[i * 3 + 2]);
	}
}
开发者ID:cdenix,项目名称:psmame,代码行数:14,代码来源:c128.c


示例11: set_isa_device

void isa8_pc1640_iga_device::device_start()
{
	astring tempstring;

	set_isa_device();

	for (int i = 0; i < 64; i++ )
	{
		UINT8 r = ( ( i & 0x04 ) ? 0xAA : 0x00 ) + ( ( i & 0x20 ) ? 0x55 : 0x00 );
		UINT8 g = ( ( i & 0x02 ) ? 0xAA : 0x00 ) + ( ( i & 0x10 ) ? 0x55 : 0x00 );
		UINT8 b = ( ( i & 0x01 ) ? 0xAA : 0x00 ) + ( ( i & 0x08 ) ? 0x55 : 0x00 );

		palette_set_color_rgb( machine(), i, r, g, b );
	}

	/* Install 256KB Video ram on our EGA card */
	m_vram = machine().memory().region_alloc(subtag(tempstring,"vram"), 256*1024, 1, ENDIANNESS_LITTLE);

	m_videoram = m_vram->base();
	m_plane[0] = m_videoram + 0x00000;
	memset(m_plane[0], 0, sizeof(UINT8) * 0x10000);
	m_plane[1] = m_videoram + 0x10000;
	memset(m_plane[1], 0, sizeof(UINT8) * 0x10000);
	m_plane[2] = m_videoram + 0x20000;
	memset(m_plane[2], 0, sizeof(UINT8) * 0x10000);
	m_plane[3] = m_videoram + 0x30000;
	memset(m_plane[3], 0, sizeof(UINT8) * 0x10000);

	m_crtc_ega = subdevice<crtc_ega_device>(EGA_CRTC_NAME);

	m_isa->install_rom(this, 0xc0000, 0xc7fff, 0, 0, "ega", "iga");
	m_isa->install_device(0x3b0, 0x3bf, 0, 0, read8_delegate(FUNC(isa8_ega_device::pc_ega8_3b0_r), this), write8_delegate(FUNC(isa8_ega_device::pc_ega8_3b0_w), this));
	m_isa->install_device(0x3c0, 0x3cf, 0, 0, read8_delegate(FUNC(isa8_ega_device::pc_ega8_3c0_r), this), write8_delegate(FUNC(isa8_ega_device::pc_ega8_3c0_w), this));
	m_isa->install_device(0x3d0, 0x3df, 0, 0, read8_delegate(FUNC(isa8_ega_device::pc_ega8_3d0_r), this), write8_delegate(FUNC(isa8_ega_device::pc_ega8_3d0_w), this));
}
开发者ID:antervud,项目名称:MAMEHub,代码行数:35,代码来源:isa_pc1640_iga.c


示例12: memset

void ibm_vga_device::device_reset()
{
	m_misc_out_reg = 0;
	m_feature_ctrl = 0;

	m_seq_idx = 0;
	memset(m_seq_data,0xff,0x1f);

	m_attr_idx = 0;
	memset(m_attr_data,0xff,0x1f);
	m_attr_state = 0;

	m_gc_idx = 0;
	memset(m_gc_data,0xff,0x1f);

	m_dac_mask = 0;
	m_dac_write_idx = 0;
	m_dac_read_idx = 0;
	m_dac_read = 0;
	m_dac_state = 0;
	memset(m_dac_color,0,sizeof(m_dac_color));

	for (int i = 0; i < 0x100; i++)
		palette_set_color_rgb(machine(), i, 0, 0, 0);
}
开发者ID:poliva,项目名称:mame-rr,代码行数:25,代码来源:ibm_vga.c


示例13: palette_set_color_rgb

void ssrj_state::palette_init()
{
	int i, j;
	for(i=0; i<4*4; i++)
		for(j=0; j<8; j++)
			palette_set_color_rgb(machine(), i*8+j, fakecols[i][j][0], fakecols[i][j][1], fakecols[i][j][2]);
}
开发者ID:CJBass,项目名称:mame2013-libretro,代码行数:7,代码来源:ssrj.c


示例14: PALETTE_INIT

static PALETTE_INIT( wolfpack )
{
	int i;

	palette_set_color(machine, 0, MAKE_RGB(0x00, 0x00, 0x00));
	palette_set_color(machine, 1, MAKE_RGB(0xc1, 0xc1, 0xc1));
	palette_set_color(machine, 2, MAKE_RGB(0x81, 0x81, 0x81));
	palette_set_color(machine, 3, MAKE_RGB(0x48, 0x48, 0x48));

	for (i = 0; i < 4; i++)
	{
		rgb_t color = palette_get_color(machine, i);

		palette_set_color_rgb(machine, 4 + i,
			RGB_RED(color) < 0xb8   ? RGB_RED(color)   + 0x48 : 0xff,
			RGB_GREEN(color) < 0xb8 ? RGB_GREEN(color) + 0x48 : 0xff,
			RGB_BLUE(color) < 0xb8  ? RGB_BLUE(color)  + 0x48 : 0xff);
	}

	colortable[0] = 0;
	colortable[1] = 1;
	colortable[2] = 1;
	colortable[3] = 0;
	colortable[4] = 0;
	colortable[5] = 2;
	colortable[6] = 0;
	colortable[7] = 3;
}
开发者ID:broftkd,项目名称:historic-mame,代码行数:28,代码来源:wolfpack.c


示例15: namcofl_install_palette

static void namcofl_install_palette(running_machine &machine)
{
	int pen, page, dword_offset, byte_offset;
	UINT32 r,g,b;
	UINT32 *pSource;

	/* this is unnecessarily expensive.  Better would be to mark palette entries dirty as
     * they are modified, and only process those that have changed.
     */
	pen = 0;
	for( page=0; page<4; page++ )
	{
		pSource = &machine.generic.paletteram.u32[page*0x2000/4];
		for( dword_offset=0; dword_offset<0x800/4; dword_offset++ )
		{
			r = pSource[dword_offset+0x0000/4];
			g = pSource[dword_offset+0x0800/4];
			b = pSource[dword_offset+0x1000/4];

			for( byte_offset=0; byte_offset<4; byte_offset++ )
			{
				palette_set_color_rgb( machine, pen++, r&0xff, g&0xff, b&0xff);
				r>>=8; g>>=8; b>>=8;
			}
		}
	}
}
开发者ID:kkalmaz,项目名称:psmame,代码行数:27,代码来源:namcofl.c


示例16: palette_set_color_rgb

inline void cdp1864_device::initialize_palette()
{
    double res_total = m_res_r + m_res_g + m_res_b + m_res_bkg;

    int weight_r = (m_res_r / res_total) * 100;
    int weight_g = (m_res_g / res_total) * 100;
    int weight_b = (m_res_b / res_total) * 100;
    int weight_bkg = (m_res_bkg / res_total) * 100;

    for (int i = 0; i < 16; i++)
    {
        int luma = 0;

        luma += (i & 4) ? weight_r : 0;
        luma += (i & 1) ? weight_g : 0;
        luma += (i & 2) ? weight_b : 0;
        luma += (i & 8) ? 0 : weight_bkg;

        luma = (luma * 0xff) / 100;

        int r = (i & 4) ? luma : 0;
        int g = (i & 1) ? luma : 0;
        int b = (i & 2) ? luma : 0;

        palette_set_color_rgb(machine(), i, r, g, b);
    }
}
开发者ID:gustavosmk,项目名称:groovyarcade.groovymame,代码行数:27,代码来源:cdp1864.c


示例17: WRITE16_HANDLER

static WRITE16_HANDLER( bmc_RAMDAC_color_w )
{
	bmcbowl_state *state = space->machine().driver_data<bmcbowl_state>();
	state->m_bmc_colorram[state->m_clr_offset]=data;
	palette_set_color_rgb(space->machine(),state->m_clr_offset/3,pal6bit(state->m_bmc_colorram[(state->m_clr_offset/3)*3]),pal6bit(state->m_bmc_colorram[(state->m_clr_offset/3)*3+1]),pal6bit(state->m_bmc_colorram[(state->m_clr_offset/3)*3+2]));
	state->m_clr_offset=(state->m_clr_offset+1)%768;
}
开发者ID:vikke,项目名称:mame_0145,代码行数:7,代码来源:bmcbowl.c


示例18: palette_set_color_rgb

void g7400_state::palette_init()
{
	const UINT8 g7400_colors[] =
	{
	0x00,0x00,0x00, // Black
	0x1A,0x37,0xBE, // Blue
	0x00,0x6D,0x07, // Green
	0x2A,0xAA,0xBE, // Blue-Green
	0x79,0x00,0x00, // Red
	0x94,0x30,0x9F, // Violet
	0x77,0x67,0x0B, // Khaki
	0xCE,0xCE,0xCE, // Lt Grey

	0x67,0x67,0x67, // Grey
	0x5C,0x80,0xF6, // Lt Blue
	0x56,0xC4,0x69, // Lt Green
	0x77,0xE6,0xEB, // Lt Blue-Green
	0xC7,0x51,0x51, // Lt Red
	0xDC,0x84,0xE8, // Lt Violet
	0xC6,0xB8,0x6A, // Lt Yellow
	0xff,0xff,0xff  // White

	};

	for ( int i = 0; i < 16; i++ )
	{
		palette_set_color_rgb( machine(), i, g7400_colors[i*3], g7400_colors[i*3+1], g7400_colors[i*3+2] );
	}
}
开发者ID:CJBass,项目名称:mame2013-libretro,代码行数:29,代码来源:odyssey2.c


示例19: palette_set_color_rgb

void ssystem3_state::palette_init()
{
	int i;

	for ( i = 0; i < sizeof(ssystem3_palette) / 3; i++ ) {
		palette_set_color_rgb(machine(), i, ssystem3_palette[i*3], ssystem3_palette[i*3+1], ssystem3_palette[i*3+2]);
	}
}
开发者ID:CJBass,项目名称:mame2013-libretro,代码行数:8,代码来源:ssystem3.c


示例20: palette_set_color_rgb

/* Initialise the palette */
void oric_state::palette_init()
{
	int i;

	for ( i = 0; i < sizeof(oric_palette) / 3; i++ ) {
		palette_set_color_rgb(machine(), i, oric_palette[i*3], oric_palette[i*3+1], oric_palette[i*3+2]);
	}
}
开发者ID:clobber,项目名称:UME,代码行数:9,代码来源:oric.c



注:本文中的palette_set_color_rgb函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ palloc函数代码示例发布时间:2022-05-30
下一篇:
C++ palette_set_color函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap