Core/burn/drv/toaplan/toaplan.cpp
// This function fills the screen with the first palette entry
This function fills the screen with the first palette entry
This function fills the screen with the first palette entry
void ToaClearScreen(INT32 PalOffset)
{
	if (*ToaPalette) {
		switch (nBurnBpp) {
			case 4: {
				UINT32* pClear = (UINT32*)pBurnDraw;
				UINT32 nColour = ToaPalette[PalOffset];
				for (INT32 i = 0; i < 320 * 240 / 8; i++) {
					*pClear++ = nColour;
					*pClear++ = nColour;
					*pClear++ = nColour;
					*pClear++ = nColour;
					*pClear++ = nColour;
					*pClear++ = nColour;
					*pClear++ = nColour;
					*pClear++ = nColour;
				}
				break;
			}
			case 3: {
				UINT8* pClear = pBurnDraw;
				UINT32 nColour = ToaPalette[PalOffset];
				UINT8 r = nColour & 0xFF;
				UINT8 g = (nColour >> 8) & 0xFF;
				UINT8 b = (nColour >> 16) & 0xFF;
				r &= 0xFF;
				for (INT32 i = 0; i < 320 * 240; i++) {
					*pClear++ = r;
					*pClear++ = g;
					*pClear++ = b;
				}
				break;
			}
			case 2: {
				UINT32* pClear = (UINT32*)pBurnDraw;
				UINT32 nColour = ToaPalette[PalOffset] | ToaPalette[PalOffset] << 16;
				for (INT32 i = 0; i < 320 * 240 / 16; i++) {
					*pClear++ = nColour;
					*pClear++ = nColour;
					*pClear++ = nColour;
					*pClear++ = nColour;
					*pClear++ = nColour;
					*pClear++ = nColour;
					*pClear++ = nColour;
					*pClear++ = nColour;
				}
				break;
			}
		}
	} else {
		memset(pBurnDraw, 0, 320 * 240 * nBurnBpp);
	}
}
void ToaClearScreen ( INT32 PalOffset ) { if ( * ToaPalette ) { switch ( nBurnBpp ) { case 4 : { UINT32 * pClear = ( UINT32 * ) pBurnDraw ; UINT32 nColour = ToaPalette [ PalOffset ] ; for ( INT32 i = 0 ; i < 320 * 240 / 8 ; i ++ ) { * pClear ++ = nColour ; * pClear ++ = nColour ; * pClear ++ = nColour ; * pClear ++ = nColour ; * pClear ++ = nColour ; * pClear ++ = nColour ; * pClear ++ = nColour ; * pClear ++ = nColour ; } break ; } case 3 : { UINT8 * pClear = pBurnDraw ; UINT32 nColour = ToaPalette [ PalOffset ] ; UINT8 r = nColour & 0xFF ; UINT8 g = ( nColour >> 8 ) & 0xFF ; UINT8 b = ( nColour >> 16 ) & 0xFF ; r &= 0xFF ; for ( INT32 i = 0 ; i < 320 * 240 ; i ++ ) { * pClear ++ = r ; * pClear ++ = g ; * pClear ++ = b ; } break ; } case 2 : { UINT32 * pClear = ( UINT32 * ) pBurnDraw ; UINT32 nColour = ToaPalette [ PalOffset ] | ToaPalette [ PalOffset ] << 16 ; for ( INT32 i = 0 ; i < 320 * 240 / 16 ; i ++ ) { * pClear ++ = nColour ; * pClear ++ = nColour ; * pClear ++ = nColour ; * pClear ++ = nColour ; * pClear ++ = nColour ; * pClear ++ = nColour ; * pClear ++ = nColour ; * pClear ++ = nColour ; } break ; } } } else { memset ( pBurnDraw , 0 , 320 * 240 * nBurnBpp ) ; } }
This function fills the screen with the first palette entry
This function fills the screen with the first palette entry