Core/burn/drv/cave/cave_sprite.cpp
static INT32 CaveSpriteBuffer_NoZoom()
{
	UINT16* pSprite = (UINT16*)(CaveSpriteRAM + (nCaveSpriteBank << 14));
	CaveSprite* pBuffer = pSpriteList;
	INT32 nPriority;

	nFirstSprite[0] = 0x00010000;
	nFirstSprite[1] = 0x00010000;
	nFirstSprite[2] = 0x00010000;
	nFirstSprite[3] = 0x00010000;

	nLastSprite[0] = -1;
	nLastSprite[1] = -1;
	nLastSprite[2] = -1;
	nLastSprite[3] = -1;

	INT16 word;
	INT32 x, y, xs, ys;

	for (INT32 i = 0, z = 0; i < 0x0400; i++, pSprite += 8) {

		word = BURN_ENDIAN_SWAP_INT16(pSprite[4]);

		xs = (word >> 4) & 0x01F0;
		ys = (word << 4) & 0x01F0;
		if (ys == 0 || xs == 0) {
			continue;
		}

#if 0
		x = (BURN_ENDIAN_SWAP_INT16(pSprite[2]) + nCaveExtraXOffset) & 0x03FF;
#else
		x = (BURN_ENDIAN_SWAP_INT16(pSprite[2]) + CaveSpriteVisibleXOffset) & 0x03FF;
#endif
		if (x >= 320) {
			if (x + xs <= 0x0400) {
				continue;
			}
		}

#if 0
		y = (BURN_ENDIAN_SWAP_INT16(pSprite[3]) + nCaveExtraYOffset) & 0x03FF;
#else
		y = BURN_ENDIAN_SWAP_INT16(pSprite[3]) & 0x03FF;
#endif
		if (y >= 240) {
			if (y + ys <= 0x0400) {
				continue;
			}
		}

		// Sprite is both active and onscreen, so add it to the buffer

		word = BURN_ENDIAN_SWAP_INT16(pSprite[0]);

		nPriority = (word >> 4) & 0x03;
		if (nLastSprite[nPriority] == -1) {
			nFirstSprite[nPriority] = z;
		}
		nLastSprite[nPriority] = z;

		pBuffer->priority = 8 >> nPriority;

		pBuffer->flip = (word >> 2) & 0x03;
		pBuffer->palette = word & 0x3F00;

		pBuffer->address = BURN_ENDIAN_SWAP_INT16(pSprite[1]) | ((word & 3) << 16);

		pBuffer->x = x;
		pBuffer->y = y;

		pBuffer->xsize = xs;
		pBuffer->ysize = ys;

		pBuffer++;
		z++;
	}

	return 0;
}
// Donpachi/DoDonpachi sprite format (no zooming)
Donpachi/DoDonpachi sprite format (no zooming)
Donpachi / DoDonpachi sprite format ( no zooming )
static INT32 CaveSpriteBuffer_NoZoom()
{
	UINT16* pSprite = (UINT16*)(CaveSpriteRAM + (nCaveSpriteBank << 14));
	CaveSprite* pBuffer = pSpriteList;
	INT32 nPriority;
	nFirstSprite[0] = 0x00010000;
	nFirstSprite[1] = 0x00010000;
	nFirstSprite[2] = 0x00010000;
	nFirstSprite[3] = 0x00010000;
	nLastSprite[0] = -1;
	nLastSprite[1] = -1;
	nLastSprite[2] = -1;
	nLastSprite[3] = -1;
	INT16 word;
	INT32 x, y, xs, ys;
	for (INT32 i = 0, z = 0; i < 0x0400; i++, pSprite += 8) {
		word = BURN_ENDIAN_SWAP_INT16(pSprite[4]);
		xs = (word >> 4) & 0x01F0;
		ys = (word << 4) & 0x01F0;
		if (ys == 0 || xs == 0) {
			continue;
		}
#if 0
		x = (BURN_ENDIAN_SWAP_INT16(pSprite[2]) + nCaveExtraXOffset) & 0x03FF;
#else
		x = (BURN_ENDIAN_SWAP_INT16(pSprite[2]) + CaveSpriteVisibleXOffset) & 0x03FF;
#endif
		if (x >= 320) {
			if (x + xs <= 0x0400) {
				continue;
			}
		}
#if 0
		y = (BURN_ENDIAN_SWAP_INT16(pSprite[3]) + nCaveExtraYOffset) & 0x03FF;
#else
		y = BURN_ENDIAN_SWAP_INT16(pSprite[3]) & 0x03FF;
#endif
		if (y >= 240) {
			if (y + ys <= 0x0400) {
				continue;
			}
		}
		word = BURN_ENDIAN_SWAP_INT16(pSprite[0]);
		nPriority = (word >> 4) & 0x03;
		if (nLastSprite[nPriority] == -1) {
			nFirstSprite[nPriority] = z;
		}
		nLastSprite[nPriority] = z;
		pBuffer->priority = 8 >> nPriority;
		pBuffer->flip = (word >> 2) & 0x03;
		pBuffer->palette = word & 0x3F00;
		pBuffer->address = BURN_ENDIAN_SWAP_INT16(pSprite[1]) | ((word & 3) << 16);
		pBuffer->x = x;
		pBuffer->y = y;
		pBuffer->xsize = xs;
		pBuffer->ysize = ys;
		pBuffer++;
		z++;
	}
	return 0;
}
static INT32 CaveSpriteBuffer_NoZoom ( ) { UINT16 * pSprite = ( UINT16 * ) ( CaveSpriteRAM + ( nCaveSpriteBank << 14 ) ) ; CaveSprite * pBuffer = pSpriteList ; INT32 nPriority ; nFirstSprite [ 0 ] = 0x00010000 ; nFirstSprite [ 1 ] = 0x00010000 ; nFirstSprite [ 2 ] = 0x00010000 ; nFirstSprite [ 3 ] = 0x00010000 ; nLastSprite [ 0 ] = -1 ; nLastSprite [ 1 ] = -1 ; nLastSprite [ 2 ] = -1 ; nLastSprite [ 3 ] = -1 ; INT16 word ; INT32 x , y , xs , ys ; for ( INT32 i = 0 , z = 0 ; i < 0x0400 ; i ++ , pSprite += 8 ) { word = BURN_ENDIAN_SWAP_INT16 ( pSprite [ 4 ] ) ; xs = ( word >> 4 ) & 0x01F0 ; ys = ( word << 4 ) & 0x01F0 ; if ( ys == 0 || xs == 0 ) { continue ; } #if 0 x = ( BURN_ENDIAN_SWAP_INT16 ( pSprite [ 2 ] ) + nCaveExtraXOffset ) & 0x03FF ; #else x = ( BURN_ENDIAN_SWAP_INT16 ( pSprite [ 2 ] ) + CaveSpriteVisibleXOffset ) & 0x03FF ; #endif if ( x >= 320 ) { if ( x + xs <= 0x0400 ) { continue ; } } #if 0 y = ( BURN_ENDIAN_SWAP_INT16 ( pSprite [ 3 ] ) + nCaveExtraYOffset ) & 0x03FF ; #else y = BURN_ENDIAN_SWAP_INT16 ( pSprite [ 3 ] ) & 0x03FF ; #endif if ( y >= 240 ) { if ( y + ys <= 0x0400 ) { continue ; } } word = BURN_ENDIAN_SWAP_INT16 ( pSprite [ 0 ] ) ; nPriority = ( word >> 4 ) & 0x03 ; if ( nLastSprite [ nPriority ] == -1 ) { nFirstSprite [ nPriority ] = z ; } nLastSprite [ nPriority ] = z ; pBuffer -> priority = 8 >> nPriority ; pBuffer -> flip = ( word >> 2 ) & 0x03 ; pBuffer -> palette = word & 0x3F00 ; pBuffer -> address = BURN_ENDIAN_SWAP_INT16 ( pSprite [ 1 ] ) | ( ( word & 3 ) << 16 ) ; pBuffer -> x = x ; pBuffer -> y = y ; pBuffer -> xsize = xs ; pBuffer -> ysize = ys ; pBuffer ++ ; z ++ ; } return 0 ; }
Donpachi/DoDonpachi sprite format (no zooming)
Donpachi / DoDonpachi sprite format ( no zooming )
// Sprite is both active and onscreen, so add it to the buffer