Core/burn/drv/sega/genesis_vid.cpp
/* draw a horizontally-flipped section of a sprite */
draw a horizontally-flipped section of a sprite
draw a horizontally - flipped section of a sprite
static void draw8pixs_hflip(UINT16 *bmap, INT32 patno, INT32 , INT32 colbase, INT32 patline)
{
	UINT32 tile = *(UINT32 *)&VDP_VRAM_BYTE(patno * 32 + 4 * patline);
	INT32 col;
	if (!tile)
		return;
	if ((colbase & 0x30) != 0x30 || !(GenesisVdpRegs[12] & 0x08))
	{
		col = EXTRACT_PIXEL(tile, 7); if (col) bmap[0] = colbase + col;
		col = EXTRACT_PIXEL(tile, 6); if (col) bmap[1] = colbase + col;
		col = EXTRACT_PIXEL(tile, 5); if (col) bmap[2] = colbase + col;
		col = EXTRACT_PIXEL(tile, 4); if (col) bmap[3] = colbase + col;
		col = EXTRACT_PIXEL(tile, 3); if (col) bmap[4] = colbase + col;
		col = EXTRACT_PIXEL(tile, 2); if (col) bmap[5] = colbase + col;
		col = EXTRACT_PIXEL(tile, 1); if (col) bmap[6] = colbase + col;
		col = EXTRACT_PIXEL(tile, 0); if (col) bmap[7] = colbase + col;
	}
	else
	{
		col = EXTRACT_PIXEL(tile, 7);
		if (col)
		{
			if (col < 0x0e) bmap[0] = colbase + col;
			else bmap[0] = VdpTransLookup[((col & 1) << 11) | (bmap[0] & 0x7ff)];
		}
		col = EXTRACT_PIXEL(tile, 6);
		if (col)
		{
			if (col < 0x0e) bmap[1] = colbase + col;
			else bmap[1] = VdpTransLookup[((col & 1) << 11) | (bmap[1] & 0x7ff)];
		}
		col = EXTRACT_PIXEL(tile, 5);
		if (col)
		{
			if (col < 0x0e) bmap[2] = colbase + col;
			else bmap[2] = VdpTransLookup[((col & 1) << 11) | (bmap[2] & 0x7ff)];
		}
		col = EXTRACT_PIXEL(tile, 4);
		if (col)
		{
			if (col < 0x0e) bmap[3] = colbase + col;
			else bmap[3] = VdpTransLookup[((col & 1) << 11) | (bmap[3] & 0x7ff)];
		}
		col = EXTRACT_PIXEL(tile, 3);
		if (col)
		{
			if (col < 0x0e) bmap[4] = colbase + col;
			else bmap[4] = VdpTransLookup[((col & 1) << 11) | (bmap[4] & 0x7ff)];
		}
		col = EXTRACT_PIXEL(tile, 2);
		if (col)
		{
			if (col < 0x0e) bmap[5] = colbase + col;
			else bmap[5] = VdpTransLookup[((col & 1) << 11) | (bmap[5] & 0x7ff)];
		}
		col = EXTRACT_PIXEL(tile, 1);
		if (col)
		{
			if (col < 0x0e) bmap[6] = colbase + col;
			else bmap[6] = VdpTransLookup[((col & 1) << 11) | (bmap[6] & 0x7ff)];
		}
		col = EXTRACT_PIXEL(tile, 0);
		if (col)
		{
			if (col < 0x0e) bmap[7] = colbase + col;
			else bmap[7] = VdpTransLookup[((col & 1) << 11) | (bmap[7] & 0x7ff)];
		}
	}
}
static void draw8pixs_hflip ( UINT16 * bmap , INT32 patno , INT32 , INT32 colbase , INT32 patline ) { UINT32 tile = * ( UINT32 * ) & VDP_VRAM_BYTE ( patno * 32 + 4 * patline ) ; INT32 col ; if ( ! tile ) return ; if ( ( colbase & 0x30 ) != 0x30 || ! ( GenesisVdpRegs [ 12 ] & 0x08 ) ) { col = EXTRACT_PIXEL ( tile , 7 ) ; if ( col ) bmap [ 0 ] = colbase + col ; col = EXTRACT_PIXEL ( tile , 6 ) ; if ( col ) bmap [ 1 ] = colbase + col ; col = EXTRACT_PIXEL ( tile , 5 ) ; if ( col ) bmap [ 2 ] = colbase + col ; col = EXTRACT_PIXEL ( tile , 4 ) ; if ( col ) bmap [ 3 ] = colbase + col ; col = EXTRACT_PIXEL ( tile , 3 ) ; if ( col ) bmap [ 4 ] = colbase + col ; col = EXTRACT_PIXEL ( tile , 2 ) ; if ( col ) bmap [ 5 ] = colbase + col ; col = EXTRACT_PIXEL ( tile , 1 ) ; if ( col ) bmap [ 6 ] = colbase + col ; col = EXTRACT_PIXEL ( tile , 0 ) ; if ( col ) bmap [ 7 ] = colbase + col ; } else { col = EXTRACT_PIXEL ( tile , 7 ) ; if ( col ) { if ( col < 0x0e ) bmap [ 0 ] = colbase + col ; else bmap [ 0 ] = VdpTransLookup [ ( ( col & 1 ) << 11 ) | ( bmap [ 0 ] & 0x7ff ) ] ; } col = EXTRACT_PIXEL ( tile , 6 ) ; if ( col ) { if ( col < 0x0e ) bmap [ 1 ] = colbase + col ; else bmap [ 1 ] = VdpTransLookup [ ( ( col & 1 ) << 11 ) | ( bmap [ 1 ] & 0x7ff ) ] ; } col = EXTRACT_PIXEL ( tile , 5 ) ; if ( col ) { if ( col < 0x0e ) bmap [ 2 ] = colbase + col ; else bmap [ 2 ] = VdpTransLookup [ ( ( col & 1 ) << 11 ) | ( bmap [ 2 ] & 0x7ff ) ] ; } col = EXTRACT_PIXEL ( tile , 4 ) ; if ( col ) { if ( col < 0x0e ) bmap [ 3 ] = colbase + col ; else bmap [ 3 ] = VdpTransLookup [ ( ( col & 1 ) << 11 ) | ( bmap [ 3 ] & 0x7ff ) ] ; } col = EXTRACT_PIXEL ( tile , 3 ) ; if ( col ) { if ( col < 0x0e ) bmap [ 4 ] = colbase + col ; else bmap [ 4 ] = VdpTransLookup [ ( ( col & 1 ) << 11 ) | ( bmap [ 4 ] & 0x7ff ) ] ; } col = EXTRACT_PIXEL ( tile , 2 ) ; if ( col ) { if ( col < 0x0e ) bmap [ 5 ] = colbase + col ; else bmap [ 5 ] = VdpTransLookup [ ( ( col & 1 ) << 11 ) | ( bmap [ 5 ] & 0x7ff ) ] ; } col = EXTRACT_PIXEL ( tile , 1 ) ; if ( col ) { if ( col < 0x0e ) bmap [ 6 ] = colbase + col ; else bmap [ 6 ] = VdpTransLookup [ ( ( col & 1 ) << 11 ) | ( bmap [ 6 ] & 0x7ff ) ] ; } col = EXTRACT_PIXEL ( tile , 0 ) ; if ( col ) { if ( col < 0x0e ) bmap [ 7 ] = colbase + col ; else bmap [ 7 ] = VdpTransLookup [ ( ( col & 1 ) << 11 ) | ( bmap [ 7 ] & 0x7ff ) ] ; } } }
draw a horizontally-flipped section of a sprite
draw a horizontally - flipped section of a sprite
/*priority*/ /* skip if all-transparent */ /* non-transparent */ /* transparent */