punisherb graphics loading

This commit is contained in:
Barry Harris 2015-07-08 14:18:50 +00:00
parent 9d4d398a1f
commit 32b0d6c35f
3 changed files with 89 additions and 1 deletions

View File

@ -701,6 +701,86 @@ static INT32 CpsLoadOneWonder3b(UINT8* Tile, INT32 nNum, INT32 nWord, INT32 nShi
return 0;
}
static INT32 CpsLoadPunisherbTiles(UINT8* Tile, INT32 nNum)
{
UINT8 *Rom = (UINT8*)BurnMalloc(0x400000 * sizeof(UINT8));
UINT8 *pt = NULL, *pr = NULL;
INT32 i, j;
if (Rom == NULL) {
return 1;
}
if (BurnLoadRom(Rom + 0x000000, nNum + 0, 2)) {
BurnFree(Rom);
return 1;
}
if (BurnLoadRom(Rom + 0x000001, nNum + 1, 2)) {
BurnFree(Rom);
return 1;
}
if (BurnLoadRom(Rom + 0x100000, nNum + 2, 2)) {
BurnFree(Rom);
return 1;
}
if (BurnLoadRom(Rom + 0x100001, nNum + 3, 2)) {
BurnFree(Rom);
return 1;
}
if (BurnLoadRom(Rom + 0x200000, nNum + 4, 2)) {
BurnFree(Rom);
return 1;
}
if (BurnLoadRom(Rom + 0x200001, nNum + 5, 2)) {
BurnFree(Rom);
return 1;
}
if (BurnLoadRom(Rom + 0x300000, nNum + 6, 2)) {
BurnFree(Rom);
return 1;
}
if (BurnLoadRom(Rom + 0x300001, nNum + 7, 2)) {
BurnFree(Rom);
return 1;
}
INT32 TileOffset[4] = { 0x000000, 0x200000, 0x000004, 0x200004 };
for (j = 0; j < 4; j++) {
for (i = 0, pt = Tile + TileOffset[j], pr = Rom + (0x80000 * j); i < 0x80000; pt += 8) {
UINT32 Pix; // Eight pixels
UINT8 b;
b = *pr++; i++; Pix = SepTable[b];
b = *pr++; i++; Pix |= SepTable[b] << 1;
Pix <<= 0;
*((UINT32 *)pt) |= Pix;
}
for (i = 0, pt = Tile + TileOffset[j], pr = Rom + 0x200000 + (0x80000 * j); i < 0x80000; pt += 8) {
UINT32 Pix; // Eight pixels
UINT8 b;
b = *pr++; i++; Pix = SepTable[b];
b = *pr++; i++; Pix |= SepTable[b] << 1;
Pix <<= 2;
*((UINT32 *)pt) |= Pix;
}
}
BurnFree(Rom);
return 0;
}
static INT32 CpsLoadSf2ceuab3Tiles(UINT8* Tile, INT32 nNum)
{
UINT8 *Rom = (UINT8*)BurnMalloc(0x200000 * sizeof(UINT8));
@ -1329,6 +1409,13 @@ INT32 CpsLoadTilesPang3r1a(INT32 nStart)
return 0;
}
INT32 CpsLoadTilesPunisherb(INT32 nStart)
{
CpsLoadPunisherbTiles(CpsGfx, nStart);
return 0;
}
INT32 CpsLoadStars(UINT8* pStar, INT32 nStart)
{
UINT8* pTemp[2] = { NULL, NULL};

View File

@ -60,6 +60,7 @@ INT32 CpsLoadTilesSlampic(INT32 nStart);
INT32 CpsLoadTilesKodb(INT32 nStart);
INT32 CpsLoadTilesWonder3b(INT32 nStart);
INT32 CpsLoadTilesPang3r1a(INT32 nStart);
INT32 CpsLoadTilesPunisherb(INT32 nStart);
INT32 CpsLoadStars(UINT8 *pStar, INT32 nStart);
INT32 CpsLoadStarsByte(UINT8 *pStar, INT32 nStart);
INT32 CpsLoadStarsForgottnAlt(UINT8 *pStar, INT32 nStart);

View File

@ -14657,7 +14657,7 @@ static INT32 Punipic3Init()
static INT32 PunisherbInit()
{
Cps1GfxLoadCallbackFunction = CpsLoadTilesWonder3b;
Cps1GfxLoadCallbackFunction = CpsLoadTilesPunisherb;
return TwelveMhzInit();
}