BigEndian fixes for Cave from lantus

This commit is contained in:
Barry Harris 2012-01-24 20:26:13 +00:00
parent 12a132aa32
commit 1167a05fcf
6 changed files with 87 additions and 87 deletions

View File

@ -62,7 +62,7 @@ INT32 CavePalUpdate4Bit(INT32 nOffset, INT32 nNumPalettes)
c = *ps;
*pc = c;
*pd = CalcCol(c);
*pd = CalcCol(BURN_ENDIAN_SWAP_INT16(c));
}
}
@ -82,7 +82,7 @@ INT32 CavePalUpdate4Bit(INT32 nOffset, INT32 nNumPalettes)
c = *ps;
if (*pc != c) {
*pc = c;
*pd = CalcCol(c);
*pd = CalcCol(BURN_ENDIAN_SWAP_INT16(c));
}
}
@ -111,7 +111,7 @@ INT32 CavePalUpdate8Bit(INT32 nOffset, INT32 nNumPalettes)
c = *ps;
*pc = c;
*pd = CalcCol(c);
*pd = CalcCol(BURN_ENDIAN_SWAP_INT16(c));
}
}
@ -138,7 +138,7 @@ void CavePalWriteWord(UINT32 nAddress, UINT16 wordValue)
{
nAddress >>= 1;
((UINT16*)CavePalSrc)[nAddress] = wordValue; // write word
((UINT16*)CavePalSrc)[nAddress] = BURN_ENDIAN_SWAP_INT16(wordValue); // write word
if (CavePalCopy[nAddress] != wordValue) {
CavePalCopy[nAddress] = wordValue;

View File

@ -357,7 +357,7 @@ static INT32 CaveSpriteBuffer_NoZoom()
for (INT32 i = 0, z = 0; i < 0x0400; i++, pSprite += 8) {
word = pSprite[4];
word = BURN_ENDIAN_SWAP_INT16(pSprite[4]);
xs = (word >> 4) & 0x01F0;
ys = (word << 4) & 0x01F0;
@ -366,9 +366,9 @@ static INT32 CaveSpriteBuffer_NoZoom()
}
#if 0
x = (pSprite[2] + nCaveExtraXOffset) & 0x03FF;
x = (BURN_ENDIAN_SWAP_INT16(pSprite[2]) + nCaveExtraXOffset) & 0x03FF;
#else
x = (pSprite[2] + CaveSpriteVisibleXOffset) & 0x03FF;
x = (BURN_ENDIAN_SWAP_INT16(pSprite[2]) + CaveSpriteVisibleXOffset) & 0x03FF;
#endif
if (x >= 320) {
if (x + xs <= 0x0400) {
@ -377,9 +377,9 @@ static INT32 CaveSpriteBuffer_NoZoom()
}
#if 0
y = (pSprite[3] + nCaveExtraYOffset) & 0x03FF;
y = (BURN_ENDIAN_SWAP_INT16(pSprite[3]) + nCaveExtraYOffset) & 0x03FF;
#else
y = pSprite[3] & 0x03FF;
y = BURN_ENDIAN_SWAP_INT16(pSprite[3]) & 0x03FF;
#endif
if (y >= 240) {
if (y + ys <= 0x0400) {
@ -389,7 +389,7 @@ static INT32 CaveSpriteBuffer_NoZoom()
// Sprite is both active and onscreen, so add it to the buffer
word = pSprite[0];
word = BURN_ENDIAN_SWAP_INT16(pSprite[0]);
nPriority = (word >> 4) & 0x03;
if (nLastSprite[nPriority] == -1) {
@ -402,7 +402,7 @@ static INT32 CaveSpriteBuffer_NoZoom()
pBuffer->flip = (word >> 2) & 0x03;
pBuffer->palette = word & 0x3F00;
pBuffer->address = pSprite[1] | ((word & 3) << 16);
pBuffer->address = BURN_ENDIAN_SWAP_INT16(pSprite[1]) | ((word & 3) << 16);
pBuffer->x = x;
pBuffer->y = y;
@ -439,7 +439,7 @@ static INT32 CaveSpriteBuffer_ZoomA()
for (INT32 i = 0, z = 0; i < 0x0400; i++, pSprite += 8) {
word = pSprite[6];
word = BURN_ENDIAN_SWAP_INT16(pSprite[6]);
xs = (word >> 4) & 0x01F0;
ys = (word << 4) & 0x01F0;
@ -447,18 +447,18 @@ static INT32 CaveSpriteBuffer_ZoomA()
continue;
}
word = pSprite[2];
word = BURN_ENDIAN_SWAP_INT16(pSprite[2]);
nPriority = (word >> 4) & 0x03;
x = ((pSprite[0] >> 6) + CaveSpriteVisibleXOffset) & 0x03FF;
x = ((BURN_ENDIAN_SWAP_INT16(pSprite[0]) >> 6) + CaveSpriteVisibleXOffset) & 0x03FF;
#if 0
y = ((pSprite[1] >> 6) + nCaveExtraYOffset) & 0x03FF;
y = ((BURN_ENDIAN_SWAP_INT16(pSprite[1]) >> 6) + nCaveExtraYOffset) & 0x03FF;
#else
y = (pSprite[1] >> 6) & 0x03FF;
y = (BURN_ENDIAN_SWAP_INT16(pSprite[1]) >> 6) & 0x03FF;
#endif
if (pSprite[4] <= 0x0100 && pSprite[5] <= 0x0100) {
if (BURN_ENDIAN_SWAP_INT16(pSprite[4]) <= 0x0100 && BURN_ENDIAN_SWAP_INT16(pSprite[5]) <= 0x0100) {
if (x >= 320) {
if (x + xs <= 0x0400) {
continue;
@ -480,8 +480,8 @@ static INT32 CaveSpriteBuffer_ZoomA()
pBuffer->priority = 8 >> nPriority;
pBuffer->xzoom = pSprite[4];
pBuffer->yzoom = pSprite[5];
pBuffer->xzoom = BURN_ENDIAN_SWAP_INT16(pSprite[4]);
pBuffer->yzoom = BURN_ENDIAN_SWAP_INT16(pSprite[5]);
pBuffer->xsize = xs;
pBuffer->ysize = ys;
@ -492,7 +492,7 @@ static INT32 CaveSpriteBuffer_ZoomA()
pBuffer->flip = (word >> 2) & 0x03;
pBuffer->palette = word & 0x3F00;
pBuffer->address = pSprite[3] | ((word & 3) << 16);
pBuffer->address = BURN_ENDIAN_SWAP_INT16(pSprite[3]) | ((word & 3) << 16);
pBuffer++;
z++;
@ -523,7 +523,7 @@ static INT32 CaveSpriteBuffer_ZoomB()
for (INT32 i = 0, z = 0; i < 0x0400; i++, pSprite += 8) {
word = pSprite[6];
word = BURN_ENDIAN_SWAP_INT16(pSprite[6]);
xs = (word >> 4) & 0x01F0;
ys = (word << 4) & 0x01F0;
@ -531,22 +531,22 @@ static INT32 CaveSpriteBuffer_ZoomB()
continue;
}
word = pSprite[2];
word = BURN_ENDIAN_SWAP_INT16(pSprite[2]);
nPriority = (word >> 4) & 0x03;
#if 0
x = (pSprite[0] + nCaveExtraXOffset) & 0x03FF;
x = (BURN_ENDIAN_SWAP_INT16(pSprite[0]) + nCaveExtraXOffset) & 0x03FF;
# else
x = (pSprite[0] + CaveSpriteVisibleXOffset) & 0x03FF;
x = (BURN_ENDIAN_SWAP_INT16(pSprite[0]) + CaveSpriteVisibleXOffset) & 0x03FF;
#endif
#if 0
y = (pSprite[1] + nCaveExtraYOffset) & 0x03FF;
y = (BURN_ENDIAN_SWAP_INT16(pSprite[1]) + nCaveExtraYOffset) & 0x03FF;
#else
y = pSprite[1] & 0x03FF;
y = BURN_ENDIAN_SWAP_INT16(pSprite[1]) & 0x03FF;
#endif
if (pSprite[4] <= 0x0100 && pSprite[5] <= 0x0100) {
if (BURN_ENDIAN_SWAP_INT16(pSprite[4]) <= 0x0100 && BURN_ENDIAN_SWAP_INT16(pSprite[5]) <= 0x0100) {
if (x >= nCaveXSize) {
if (x + xs <= 0x0400) {
continue;
@ -568,8 +568,8 @@ static INT32 CaveSpriteBuffer_ZoomB()
pBuffer->priority = 8 >> nPriority;
pBuffer->xzoom = pSprite[4];
pBuffer->yzoom = pSprite[5];
pBuffer->xzoom = BURN_ENDIAN_SWAP_INT16(pSprite[4]);
pBuffer->yzoom = BURN_ENDIAN_SWAP_INT16(pSprite[5]);
pBuffer->xsize = xs;
pBuffer->ysize = ys;
@ -580,7 +580,7 @@ static INT32 CaveSpriteBuffer_ZoomB()
pBuffer->flip = (word >> 2) & 0x03;
pBuffer->palette = word & 0x3F00;
pBuffer->address = pSprite[3] | ((word & 3) << 16);
pBuffer->address = BURN_ENDIAN_SWAP_INT16(pSprite[3]) | ((word & 3) << 16);
pBuffer++;
z++;
@ -611,7 +611,7 @@ static INT32 CaveSpriteBuffer_PowerInstinct()
for (INT32 i = 0, z = 0; i < 0x0400; i++, pSprite += 8) {
word = pSprite[4];
word = BURN_ENDIAN_SWAP_INT16(pSprite[4]);
xs = (word >> 4) & 0x01F0;
ys = (word << 4) & 0x01F0;
@ -619,14 +619,14 @@ static INT32 CaveSpriteBuffer_PowerInstinct()
continue;
}
x = (pSprite[2] + nCaveExtraXOffset) & 0x03FF;
x = (BURN_ENDIAN_SWAP_INT16(pSprite[2]) + nCaveExtraXOffset) & 0x03FF;
if (x >= 320) {
if (x + xs <= 0x0400) {
continue;
}
}
y = (pSprite[3] + nCaveExtraYOffset) & 0x03FF;
y = (BURN_ENDIAN_SWAP_INT16(pSprite[3]) + nCaveExtraYOffset) & 0x03FF;
if (y >= 240) {
if (y + ys <= 0x0400) {
continue;
@ -635,7 +635,7 @@ static INT32 CaveSpriteBuffer_PowerInstinct()
// Sprite is both active and onscreen, so add it to the buffer
word = pSprite[0];
word = BURN_ENDIAN_SWAP_INT16(pSprite[0]);
nPriority = ((word >> 4) & 0x01) | 2;
if (nLastSprite[nPriority] == -1) {
@ -648,7 +648,7 @@ static INT32 CaveSpriteBuffer_PowerInstinct()
pBuffer->flip = (word >> 2) & 0x03;
pBuffer->palette = ((word >> 4) & 0x03F0) + ((word << 5) & 0xC00);
pBuffer->address = pSprite[1] | ((word & 3) << 16);
pBuffer->address = BURN_ENDIAN_SWAP_INT16(pSprite[1]) | ((word & 3) << 16);
pBuffer->x = x;
pBuffer->y = y;

View File

@ -188,67 +188,67 @@ static void FUNCTIONNAME(BPP,XSIZE,ROT,FLIP,ZOOMMODE,ZBUF,DEPTH)()
#if EIGHTBIT == 0
if (nColumn >= 0 && nColumn < (XSIZE - 16)) {
#if XFLIP == 0
nColour = pSpriteData[x];
nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x]);
PLOT8_NOCLIP(0);
nColour = pSpriteData[x + 1];
nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x + 1]);
PLOT8_NOCLIP(8);
#else
nColour = pSpriteData[x + 1];
nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x + 1]);
PLOT8_NOCLIP(8);
nColour = pSpriteData[x];
nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x]);
PLOT8_NOCLIP(0);
#endif
} else {
#if XFLIP == 0
nColour = pSpriteData[x];
nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x]);
PLOT8_CLIP(0);
nColour = pSpriteData[x + 1];
nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x + 1]);
PLOT8_CLIP(8);
#else
nColour = pSpriteData[x + 1];
nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x + 1]);
PLOT8_CLIP(8);
nColour = pSpriteData[x];
nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x]);
PLOT8_CLIP(0);
#endif
#else
if (nColumn >= 0 && nColumn < (XSIZE - 16)) {
#if XFLIP == 0
nColour = pSpriteData[x];
nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x]);
PLOT4_NOCLIP(0);
nColour = pSpriteData[x + 1];
nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x + 1]);
PLOT4_NOCLIP(4);
nColour = pSpriteData[x + 2];
nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x + 2]);
PLOT4_NOCLIP(8);
nColour = pSpriteData[x + 3];
nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x + 3]);
PLOT4_NOCLIP(12);
#else
nColour = pSpriteData[x + 3];
nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x + 3]);
PLOT4_NOCLIP(12);
nColour = pSpriteData[x + 2];
nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x + 2]);
PLOT4_NOCLIP(8);
nColour = pSpriteData[x + 1];
nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x + 1]);
PLOT4_NOCLIP(4);
nColour = pSpriteData[x];
nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x]);
PLOT4_NOCLIP(0);
#endif
} else {
#if XFLIP == 0
nColour = pSpriteData[x];
nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x]);
PLOT4_CLIP(0);
nColour = pSpriteData[x + 1];
nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x + 1]);
PLOT4_CLIP(4);
nColour = pSpriteData[x + 2];
nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x + 2]);
PLOT4_CLIP(8);
nColour = pSpriteData[x + 3];
nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x + 3]);
PLOT4_CLIP(12);
#else
nColour = pSpriteData[x + 3];
nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x + 3]);
PLOT4_CLIP(12);
nColour = pSpriteData[x + 2];
nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x + 2]);
PLOT4_CLIP(8);
nColour = pSpriteData[x + 1];
nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x + 1]);
PLOT4_CLIP(4);
nColour = pSpriteData[x];
nColour = BURN_ENDIAN_SWAP_INT32(pSpriteData[x]);
PLOT4_CLIP(0);
#endif
#endif

View File

@ -81,8 +81,8 @@ static void CaveQueue8x8Layer_Normal(INT32 nLayer)
for (x = mx; x >= 0; x -= (1 << 2)) {
nTileColumn = (cx + x) & (0x3F << 2);
nTileNumber = *((UINT16*)(pTileRAM + 0x4000 + nTileRow + nTileColumn)) << 16;
nTileNumber |= *((UINT16*)(pTileRAM + 0x4002 + nTileRow + nTileColumn));
nTileNumber = BURN_ENDIAN_SWAP_INT16(*((UINT16*)(pTileRAM + 0x4000 + nTileRow + nTileColumn))) << 16;
nTileNumber |= BURN_ENDIAN_SWAP_INT16(*((UINT16*)(pTileRAM + 0x4002 + nTileRow + nTileColumn)));
nTileNumber |= nTileOffset;
@ -177,7 +177,7 @@ static void Cave8x8Layer_RowScroll(INT32 nLayer, UINT32 nPriority)
INT32 dy = CaveTileReg[nLayer][1] + 0x12 - nCaveRowModeOffset;
for (y = 0; y < nCaveYSize; y++) {
rowscroll[y] = *((UINT16*)(pTileRAM + 0x1000 + (((dy + y) & 0x01FF) << 2))) + bx;
rowscroll[y] = BURN_ENDIAN_SWAP_INT16(*((UINT16*)(pTileRAM + 0x1000 + (((dy + y) & 0x01FF) << 2)))) + bx;
}
}
@ -189,11 +189,11 @@ static void Cave8x8Layer_RowScroll(INT32 nLayer, UINT32 nPriority)
for (x = 0; x < (64 << 2); x += (1 << 2)) {
nTileColumn = x & (0x3F << 2);
nTileNumber = *((UINT16*)(pTileRAM + 0x4000 + nTileRow + nTileColumn)) << 16;
nTileNumber = BURN_ENDIAN_SWAP_INT16(*((UINT16*)(pTileRAM + 0x4000 + nTileRow + nTileColumn))) << 16;
if ((nTileNumber >> 30) != nPriority) {
continue;
}
nTileNumber |= *((UINT16*)(pTileRAM + 0x4002 + nTileRow + nTileColumn));
nTileNumber |= BURN_ENDIAN_SWAP_INT16(*((UINT16*)(pTileRAM + 0x4002 + nTileRow + nTileColumn)));
pTilePalette = pPalette + ((nTileNumber & 0x3F000000) >> nPaletteShift);
nTileNumber |= nTileOffset;
@ -265,8 +265,8 @@ static void CaveQueue16x16Layer_Normal(INT32 nLayer)
for (x = mx; x >= 0; x -= (1 << 2)) {
nTileColumn = (cx + x) & (0x1F << 2);
nTileNumber = *((UINT16*)(pTileRAM + 0x0000 + nTileRow + nTileColumn)) << 16;
nTileNumber |= *((UINT16*)(pTileRAM + 0x0002 + nTileRow + nTileColumn));
nTileNumber = BURN_ENDIAN_SWAP_INT16(*((UINT16*)(pTileRAM + 0x0000 + nTileRow + nTileColumn))) << 16;
nTileNumber |= BURN_ENDIAN_SWAP_INT16(*((UINT16*)(pTileRAM + 0x0002 + nTileRow + nTileColumn)));
if (*((UINT32*)(CaveTileAttrib[nLayer] + ((nTileNumber << 2) & nTileMask[nLayer]))) == 0x01010101) {
continue;
@ -309,7 +309,7 @@ static void Cave16x16Layer_Normal(INT32 nLayer, UINT32 nPriority)
nTileNumber <<= 2;
nTileNumber &= nTileMask[nLayer];
nAttrib = *((UINT32*)(CaveTileAttrib[nLayer] + nTileNumber));
nAttrib = BURN_ENDIAN_SWAP_INT32(*((UINT32*)(CaveTileAttrib[nLayer] + nTileNumber)));
pTile = pBurnDraw + (nTileYPos * nBurnPitch) + (nTileXPos * nBurnBpp);
@ -436,7 +436,7 @@ static void Cave16x16Layer_RowScroll(INT32 nLayer, UINT32 nPriority)
INT32 dy = CaveTileReg[nLayer][1] + 0x12 - nCaveRowModeOffset;
for (y = 0; y < nCaveYSize; y++) {
rowscroll[y] = *((UINT16*)(pTileRAM + 0x1000 + (((dy + y) & 0x01FF) << 2))) + bx;
rowscroll[y] = BURN_ENDIAN_SWAP_INT16(*((UINT16*)(pTileRAM + 0x1000 + (((dy + y) & 0x01FF) << 2)))) + bx;
}
}
@ -448,18 +448,18 @@ static void Cave16x16Layer_RowScroll(INT32 nLayer, UINT32 nPriority)
for (x = 0; x < (32 << 2); x += (1 << 2)) {
nTileColumn = x & (0x1F << 2);
nTileNumber = *((UINT16*)(pTileRAM + 0x0000 + nTileRow + nTileColumn)) << 16;
nTileNumber = BURN_ENDIAN_SWAP_INT16(*((UINT16*)(pTileRAM + 0x0000 + nTileRow + nTileColumn))) << 16;
if ((nTileNumber >> 30) != nPriority) {
continue;
}
nTileNumber |= *((UINT16*)(pTileRAM + 0x0002 + nTileRow + nTileColumn));
nTileNumber |= BURN_ENDIAN_SWAP_INT16(*((UINT16*)(pTileRAM + 0x0002 + nTileRow + nTileColumn)));
pTilePalette = pPalette + ((nTileNumber & nPaletteMask) >> nPaletteShift);
nTileNumber <<= 2;
nTileNumber &= nTileMask[nLayer];
count++;
nAttrib = *((UINT32*)(CaveTileAttrib[nLayer] + nTileNumber));
nAttrib = BURN_ENDIAN_SWAP_INT32(*((UINT32*)(CaveTileAttrib[nLayer] + nTileNumber)));
if (nAttrib == 0x01010101) {
continue;
}
@ -600,12 +600,12 @@ static void Cave16x16Layer_RowSelect(INT32 nLayer, UINT32 nPriority)
if (CaveTileReg[nLayer][0] & 0x4000) { // Row-scroll mode
for (y = 0; y < nCaveYSize; y++) {
rowselect[y] = *((UINT16*)(pTileRAM + 0x1002 + (((cy + y) & 0x01FF) << 2)));
rowscroll[y] = *((UINT16*)(pTileRAM + 0x1000 + (((cy + y) & 0x01FF) << 2))) + bx;
rowselect[y] = BURN_ENDIAN_SWAP_INT16(*((UINT16*)(pTileRAM + 0x1002 + (((cy + y) & 0x01FF) << 2))));
rowscroll[y] = BURN_ENDIAN_SWAP_INT16(*((UINT16*)(pTileRAM + 0x1000 + (((cy + y) & 0x01FF) << 2)))) + bx;
}
} else {
for (y = 0; y < nCaveYSize; y++) {
rowselect[y] = *((UINT16*)(pTileRAM + 0x1002 + (((cy + y) & 0x01FF) << 2)));
rowselect[y] = BURN_ENDIAN_SWAP_INT16(*((UINT16*)(pTileRAM + 0x1002 + (((cy + y) & 0x01FF) << 2))));
}
}
}
@ -622,11 +622,11 @@ static void Cave16x16Layer_RowSelect(INT32 nLayer, UINT32 nPriority)
for (x = 0; x <= mx; x++) {
nTileColumn = (((rx >> 4) + x) & 0x1F) << 2;
nTileNumber = *((UINT16*)(pTileRAM + 0x0000 + nTileRow + nTileColumn)) << 16;
nTileNumber = BURN_ENDIAN_SWAP_INT16(*((UINT16*)(pTileRAM + 0x0000 + nTileRow + nTileColumn))) << 16;
if ((nTileNumber >> 30) != nPriority) {
continue;
}
nTileNumber |= *((UINT16*)(pTileRAM + 0x0002 + nTileRow + nTileColumn));
nTileNumber |= BURN_ENDIAN_SWAP_INT16(*((UINT16*)(pTileRAM + 0x0002 + nTileRow + nTileColumn)));
pTilePalette = pPalette + ((nTileNumber & nPaletteMask) >> nPaletteShift);
nTileNumber &= nTileMask[nLayer];
@ -670,13 +670,13 @@ static void Cave16x16Layer_RowSelect(INT32 nLayer, UINT32 nPriority)
for (x = 0; x <= mx; x++) {
nTileColumn = (((bx >> 4) + x) & 0x1F) << 2;
nTileNumber = *((UINT16*)(pTileRAM + 0x0000 + nTileRow + nTileColumn)) << 16;
nTileNumber = BURN_ENDIAN_SWAP_INT16(*((UINT16*)(pTileRAM + 0x0000 + nTileRow + nTileColumn))) << 16;
if ((nTileNumber >> 30) != nPriority) {
nTileXPos += 16;
pTile += (nBurnBpp << 4);
continue;
}
nTileNumber |= *((UINT16*)(pTileRAM + 0x0002 + nTileRow + nTileColumn));
nTileNumber |= BURN_ENDIAN_SWAP_INT16(*((UINT16*)(pTileRAM + 0x0002 + nTileRow + nTileColumn)));
pTilePalette = pPalette + ((nTileNumber & nPaletteMask) >> nPaletteShift);
nTileNumber &= nTileMask[nLayer];

View File

@ -150,7 +150,7 @@ static void FUNCTIONNAME(BPP,XSIZE,ROT,FLIP,SCROLL,SELECT,CLIP,DEPTH)()
#if EIGHTBIT == 0
#if DOCLIP == 1 || ROWSCROLL == 1
nColour = *pTileData++;
nColour = BURN_ENDIAN_SWAP_INT32(*pTileData++);
if (XPOS <= (XSIZE - 8)) {
if (XPOS < 0) {
@ -216,7 +216,7 @@ static void FUNCTIONNAME(BPP,XSIZE,ROT,FLIP,SCROLL,SELECT,CLIP,DEPTH)()
}
#else
nColour = *pTileData++;
nColour = BURN_ENDIAN_SWAP_INT32(*pTileData++);
PLOTPIXEL(nColour & 0x0F);
ADVANCECOLUMN;
nColour >>= 4;
@ -245,12 +245,12 @@ static void FUNCTIONNAME(BPP,XSIZE,ROT,FLIP,SCROLL,SELECT,CLIP,DEPTH)()
#endif
#else
#if DOCLIP == 1 || ROWSCROLL == 1
nColour = pTileData[0];
nColour = BURN_ENDIAN_SWAP_INT32(pTileData[0]);
if (XPOS <= (XSIZE - 8)) {
if (XPOS < 0) {
if (XPOS < -3) {
nColour = pTileData[1];
nColour = BURN_ENDIAN_SWAP_INT32(pTileData[1]);
}
nColour >>= (-XPOS & 3) * 8;
pPixel += -XPOS * (BPP >> 3);
@ -272,7 +272,7 @@ static void FUNCTIONNAME(BPP,XSIZE,ROT,FLIP,SCROLL,SELECT,CLIP,DEPTH)()
case 3:
PLOTPIXEL(nColour & 0xFF);
ADVANCECOLUMN;
nColour = pTileData[1];
nColour = BURN_ENDIAN_SWAP_INT32(pTileData[1]);
case 4:
PLOTPIXEL(nColour & 0xFF);
ADVANCECOLUMN;
@ -302,7 +302,7 @@ static void FUNCTIONNAME(BPP,XSIZE,ROT,FLIP,SCROLL,SELECT,CLIP,DEPTH)()
nColour >>= 8;
CLIPPIXEL(3, PLOTPIXEL(nColour & 0xFF));
ADVANCECOLUMN;
nColour = pTileData[1];
nColour = BURN_ENDIAN_SWAP_INT32(pTileData[1]);
CLIPPIXEL(4, PLOTPIXEL(nColour & 0xFF));
ADVANCECOLUMN;
nColour >>= 8;
@ -317,7 +317,7 @@ static void FUNCTIONNAME(BPP,XSIZE,ROT,FLIP,SCROLL,SELECT,CLIP,DEPTH)()
pTileData += 2;
#else
nColour = *pTileData++;
nColour = BURN_ENDIAN_SWAP_INT32(*pTileData++);
PLOTPIXEL(nColour & 0xFF);
ADVANCECOLUMN;
nColour >>= 8;
@ -331,7 +331,7 @@ static void FUNCTIONNAME(BPP,XSIZE,ROT,FLIP,SCROLL,SELECT,CLIP,DEPTH)()
PLOTPIXEL(nColour & 0xFF);
ADVANCECOLUMN;
nColour = *pTileData++;
nColour = BURN_ENDIAN_SWAP_INT32(*pTileData++);
PLOTPIXEL(nColour & 0xFF);
ADVANCECOLUMN;
nColour >>= 8;

View File

@ -503,7 +503,7 @@ static void DrvCalcPalette()
UINT32* pd;
for (i = 0, ps = (UINT16*)CavePalSrc, pd = CavePalette; i < 0x2800; i++, ps++, pd++) {
*pd = CalcCol(*ps);
*pd = CalcCol(BURN_ENDIAN_SWAP_INT16(*ps));
}
}