示例#1
0
文件: gb.cpp 项目: PugsyMAME/mame
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));
	}
}
示例#2
0
文件: albazc.c 项目: vikke/mame_0145
static PALETTE_INIT( hanaroku )
{
	int i;
	int r, g, b;

	for (i = 0; i < 0x200; i++)
	{
		b = (color_prom[i * 2 + 1] & 0x1f);
		g = ((color_prom[i * 2 + 1] & 0xe0) | ((color_prom[i * 2 + 0]& 0x03) <<8)) >> 5;
		r = (color_prom[i * 2 + 0] & 0x7c) >> 2;

		palette_set_color_rgb(machine, i, pal5bit(r), pal5bit(g), pal5bit(b));
	}
}
static PALETTE_INIT( hanaroku )
{
	const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
	int i;
	int r, g, b;

	for (i = 0; i < 0x200; i++)
	{
		b = (color_prom[i * 2 + 1] & 0x1f);
		g = ((color_prom[i * 2 + 1] & 0xe0) | ((color_prom[i * 2 + 0]& 0x03) <<8)) >> 5;
		r = (color_prom[i * 2 + 0] & 0x7c) >> 2;

		palette_set_color_rgb(machine, i, pal5bit(r), pal5bit(g), pal5bit(b));
	}
}
示例#4
0
文件: albazc.cpp 项目: ursine/mame
PALETTE_INIT_MEMBER(albazc_state, albazc)
{
	const UINT8 *color_prom = memregion("proms")->base();
	int i;
	int r, g, b;

	for (i = 0; i < 0x200; i++)
	{
		b = (color_prom[i * 2 + 1] & 0x1f);
		g = ((color_prom[i * 2 + 1] & 0xe0) | ((color_prom[i * 2 + 0]& 0x03) <<8)) >> 5;
		r = (color_prom[i * 2 + 0] & 0x7c) >> 2;

		palette.set_pen_color(i, pal5bit(r), pal5bit(g), pal5bit(b));
	}
}
示例#5
0
文件: dynax.c 项目: crazii/mameplus
/* x B01234 G01234 R01234 */
PALETTE_INIT_MEMBER(dynax_state,sprtmtch)
{
	const UINT8 *color_prom = memregion("proms")->base();
	if (!color_prom)
		return;

	for (int i = 0; i < palette.entries(); i++)
	{
		int x = (color_prom[i] << 8) + color_prom[0x200 + i];
		/* The bits are in reverse order! */
		int r = BITSWAP8((x >>  0) & 0x1f, 7, 6, 5, 0, 1, 2, 3, 4);
		int g = BITSWAP8((x >>  5) & 0x1f, 7, 6, 5, 0, 1, 2, 3, 4);
		int b = BITSWAP8((x >> 10) & 0x1f, 7, 6, 5, 0, 1, 2, 3, 4);
		palette.set_pen_color(i, pal5bit(r), pal5bit(g), pal5bit(b));
	}
}
示例#6
0
文件: suprgolf.c 项目: poliva/mame-rr
static WRITE8_HANDLER( suprgolf_videoram_w )
{
	suprgolf_state *state = space->machine().driver_data<suprgolf_state>();

	if(state->m_palette_switch)
	{
		int r,g,b,datax;
		state->m_paletteram[offset] = data;
		offset>>=1;
		datax = state->m_paletteram[offset*2] + 256*state->m_paletteram[offset*2 + 1];

		b = (datax & 0x8000) ? 0 : ((datax)&0x001f)>>0;
		g = (datax & 0x8000) ? 0 : ((datax)&0x03e0)>>5;
		r = (datax & 0x8000) ? 0 : ((datax)&0x7c00)>>10;

		palette_set_color_rgb(space->machine(), offset, pal5bit(r), pal5bit(g), pal5bit(b));
	}
示例#7
0
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));
	}
}