示例#1
0
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);

	}
}
示例#2
0
static MACHINE_RESET( gng )
{
	gng_state *state = machine.driver_data<gng_state>();

	state->m_scrollx[0] = 0;
	state->m_scrollx[1] = 0;
	state->m_scrolly[0] = 0;
	state->m_scrolly[1] = 0;

	{
		int i;

		/* TODO: PCB reference clearly shows that the POST has random/filled data on the paletteram.
                 For now let's fill everything with white colors until we have better info about it */
		for(i=0;i<0x100;i+=4)
		{
			machine.generic.paletteram.u8[i] = machine.generic.paletteram2.u8[i] = 0x00;
			machine.generic.paletteram.u8[i+1] = machine.generic.paletteram2.u8[i+1] = 0x55;
			machine.generic.paletteram.u8[i+2] = machine.generic.paletteram2.u8[i+2] = 0xaa;
			machine.generic.paletteram.u8[i+3] = machine.generic.paletteram2.u8[i+3] = 0xff;
			palette_set_color_rgb(machine,i+0,0x00,0x00,0x00);
			palette_set_color_rgb(machine,i+1,0x55,0x55,0x55);
			palette_set_color_rgb(machine,i+2,0xaa,0xaa,0xaa);
			palette_set_color_rgb(machine,i+3,0xff,0xff,0xff);
		}
	}
}
示例#3
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));
	}
}
示例#4
0
PALETTE_INIT_MEMBER(galaxold_state,minefld)
{
	int base = BACKGROUND_COLOR_BASE;
	int i;


	PALETTE_INIT_CALL_MEMBER(galaxold);


	/* set up background colors */

	/* graduated blue */

	for (i = 0; i < 128; i++)
	{
		int r = 0;
		int g = i;
		int b = i * 2;
		palette_set_color_rgb(machine(),base+i,r,g,b);
	}

	/* graduated brown */

	for (i = 0; i < 128; i++)
	{
		int r = i * 1.5;
		int g = i * 0.75;
		int b = i / 2;
		palette_set_color_rgb(machine(),base+128+i,r,g,b);
	}
}
示例#5
0
文件: cdc721.c 项目: antervud/MAMEHub
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 */
}
示例#6
0
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
}
示例#7
0
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 */
}
示例#8
0
/* swapped r/g/b hook-up */
PALETTE_INIT_MEMBER(galaxold_state,dambustr)
{
	const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
	int base = BACKGROUND_COLOR_BASE;
	int i, len;

	/* first, the character/sprite palette */
	len = machine().root_device().memregion("proms")->bytes();

	for (i = 0;i < len;i++)
	{
		int bit0,bit1,bit2,r,g,b;

		/* red component */
		bit0 = BIT(*color_prom,0);
		bit1 = BIT(*color_prom,1);
		bit2 = BIT(*color_prom,2);
		b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
		/* green component */
		bit0 = BIT(*color_prom,3);
		bit1 = BIT(*color_prom,4);
		bit2 = BIT(*color_prom,5);
		r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
		/* blue component */
		bit0 = BIT(*color_prom,6);
		bit1 = BIT(*color_prom,7);
		g = 0x4f * bit0 + 0xa8 * bit1;

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


	galaxold_init_stars(machine(), STARS_COLOR_BASE);


	/* bullets - yellow and white */
	palette_set_color(machine(),BULLETS_COLOR_BASE+0,MAKE_RGB(0xef,0xef,0x00));
	palette_set_color(machine(),BULLETS_COLOR_BASE+1,MAKE_RGB(0xef,0xef,0xef));

	/*
	Assumption (not clear from the schematics):
	The background color generator is connected this way:

	    RED   - 470 ohm resistor
	    GREEN - 470 ohm resistor
	    BLUE  - 470 ohm resistor */


	for (i = 0; i < 8; i++)
	{
		int r = BIT(i,0) * 0x47;
		int g = BIT(i,1) * 0x47;
		int b = BIT(i,2) * 0x4f;
		palette_set_color_rgb(machine(),base+i,r,g,b);
	}
}
示例#9
0
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 */
}
示例#10
0
INPUT_PORTS_END


void cfx9850_state::palette_init()
{
	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 );
}
示例#11
0
文件: cfx9850.c 项目: cdenix/psmame
//  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 );
}
示例#12
0
文件: px8.c 项目: antervud/MAMEHub
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);
}
示例#13
0
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));
}
示例#14
0
文件: c128.c 项目: cdenix/psmame
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]);
	}
}
示例#15
0
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));
}
示例#16
0
文件: ibm_vga.c 项目: poliva/mame-rr
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);
}
示例#17
0
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]);
}
示例#18
0
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;
}
示例#19
0
PALETTE_INIT_MEMBER(galaxold_state,mariner)
{
	int base = BACKGROUND_COLOR_BASE;
	int i;


	PALETTE_INIT_CALL_MEMBER(galaxold);


	/* set up background colors */

	/* 16 shades of blue - the 4 bits are connected to the following resistors:

	    bit 0 -- 4.7 kohm resistor
	          -- 2.2 kohm resistor
	          -- 1   kohm resistor
	    bit 0 -- .47 kohm resistor */

	for (i = 0; i < 16; i++)
	{
		int r,g,b;

		r = 0;
		g = 0;
		b = 0x0e * BIT(i,0) + 0x1f * BIT(i,1) + 0x43 * BIT(i,2) + 0x8f * BIT(i,3);

		palette_set_color_rgb(machine(),base+i,r,g,b);
	}
}
示例#20
0
/***************************************************************************

  Convert the color PROMs into a more useable format.

  Dark Planet has one 32 bytes palette PROM, connected to the RGB output this way:

  bit 5 -- 220 ohm resistor  -- BLUE
        -- 470 ohm resistor  -- BLUE
        -- 1  kohm resistor  -- BLUE
        -- 220 ohm resistor  -- RED
        -- 470 ohm resistor  -- RED
  bit 0 -- 1  kohm resistor  -- RED

  The bullet RGB outputs go through 100 ohm resistors.

  The RGB outputs have a 470 ohm pull-down each.

***************************************************************************/
PALETTE_INIT_MEMBER(galaxold_state,darkplnt)
{
	const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
	int i;


	/* first, the character/sprite palette */

	for (i = 0;i < 32;i++)
	{
		int bit0,bit1,bit2,r,g,b;

		/* red component */
		bit0 = BIT(*color_prom,0);
		bit1 = BIT(*color_prom,1);
		bit2 = BIT(*color_prom,2);
		r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
		/* green component */
		g = 0x00;
		/* blue component */
		bit0 = BIT(*color_prom,3);
		bit1 = BIT(*color_prom,4);
		bit2 = BIT(*color_prom,5);
		b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;

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


	/* bullets - red and blue */
	palette_set_color(machine(),BULLETS_COLOR_BASE+0,MAKE_RGB(0xef,0x00,0x00));
	palette_set_color(machine(),BULLETS_COLOR_BASE+1,MAKE_RGB(0x00,0x00,0xef));
}
示例#21
0
PALETTE_INIT_MEMBER(galaxold_state,rockclim)
{
	const UINT8 *color_prom = machine().root_device().memregion("proms")->base();
	int i, len;


	/* first, the character/sprite palette */
	len = machine().root_device().memregion("proms")->bytes();
	for (i = 0;i < len;i++)
	{
		int bit0,bit1,bit2,r,g,b;

		/* red component */
		bit0 = BIT(*color_prom,0);
		bit1 = BIT(*color_prom,1);
		bit2 = BIT(*color_prom,2);
		r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
		/* green component */
		bit0 = BIT(*color_prom,3);
		bit1 = BIT(*color_prom,4);
		bit2 = BIT(*color_prom,5);
		g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
		/* blue component */
		bit0 = BIT(*color_prom,6);
		bit1 = BIT(*color_prom,7);
		b = 0x4f * bit0 + 0xa8 * bit1;

		palette_set_color_rgb(machine(),i,r,g,b);
		color_prom++;
	}
}
示例#22
0
文件: namcofl.c 项目: kkalmaz/psmame
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;
			}
		}
	}
}
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);
    }
}
示例#24
0
文件: bmcbowl.c 项目: vikke/mame_0145
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;
}
示例#25
0
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] );
	}
}
示例#26
0
void odyssey2_state::palette_init()
{
	for ( int i = 0; i < 16; i++ )
	{
		palette_set_color_rgb( machine(), i, odyssey2_colors[i*3], odyssey2_colors[i*3+1], odyssey2_colors[i*3+2] );
	}
}
示例#27
0
void gamecom_state::palette_init()
{
	int index;
	for ( index = 0; index < 5; index++ )
	{
		palette_set_color_rgb(machine(),  4-index, palette[index*3+0], palette[index*3+1], palette[index*3+2] );
	}
}
示例#28
0
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]);
	}
}
示例#29
0
文件: oric.c 项目: clobber/UME
/* 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]);
	}
}
示例#30
0
PALETTE_INIT_MEMBER(compis_state,compis_gdc)
{
	int i;

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