Simplify bootleg sprite rendering, fix sprites in punipic sets (now working, with glitches in intro, which may happen on hardware?)
This commit is contained in:
parent
f7f0bd95d8
commit
80ef73ac63
|
@ -541,18 +541,15 @@ INT32 FcrashObjDraw(INT32 nLevelFrom,INT32 nLevelTo)
|
|||
|
||||
// Go through all the Objs
|
||||
for (i=0; i<pof->nCount; i++,ps+=nPsAdd) {
|
||||
INT32 x,y,n,a,bx,by,dx,dy; INT32 nFlip;
|
||||
INT32 x,y,n,a; INT32 nFlip;
|
||||
|
||||
n = BURN_ENDIAN_SWAP_INT16(ps[0]);
|
||||
y = BURN_ENDIAN_SWAP_INT16(ps[-1]);
|
||||
x = BURN_ENDIAN_SWAP_INT16(ps[2]);
|
||||
a = BURN_ENDIAN_SWAP_INT16(ps[1]);
|
||||
|
||||
bx = 1;
|
||||
by = 1;
|
||||
|
||||
x &= 0x1ff;
|
||||
y &= 0xff;
|
||||
y &= 0x1ff;
|
||||
|
||||
x -= 16;
|
||||
y = 224 - y;
|
||||
|
@ -563,29 +560,19 @@ INT32 FcrashObjDraw(INT32 nLevelFrom,INT32 nLevelTo)
|
|||
nFlip=(a>>5)&3;
|
||||
|
||||
// Take care with tiles if the sprite goes off the screen
|
||||
if (x<0 || y<0 || x+(bx<<4)>384 || y+(by<<4)>224) {
|
||||
if (x<0 || y<0 || x+(1<<4)>384 || y+(1<<4)>224) {
|
||||
nCpstType=CTT_16X16 | CTT_CARE;
|
||||
} else {
|
||||
nCpstType=CTT_16X16;
|
||||
}
|
||||
|
||||
nCpstFlip=nFlip;
|
||||
for (dy=0;dy<by;dy++) {
|
||||
for (dx=0;dx<bx;dx++) {
|
||||
INT32 ex,ey;
|
||||
if (nFlip&1) ex=(bx-dx-1);
|
||||
else ex=dx;
|
||||
if (nFlip&2) ey=(by-dy-1);
|
||||
else ey=dy;
|
||||
|
||||
nCpstX=x;
|
||||
nCpstY=y;
|
||||
nCpstTile = n;
|
||||
nCpstTile <<= 7;
|
||||
CpstOneObjDoX[0]();
|
||||
}
|
||||
}
|
||||
|
||||
nCpstX=x;
|
||||
nCpstY=y;
|
||||
nCpstTile = n;
|
||||
nCpstTile <<= 7;
|
||||
CpstOneObjDoX[0]();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -11668,11 +11668,10 @@ static INT32 PunipicInit()
|
|||
CpsLoadTilesBootleg(CpsGfx + 0x000000, 4);
|
||||
CpsLoadTilesBootleg(CpsGfx + 0x200000, 8);
|
||||
|
||||
CpsBootlegSpriteRam = (UINT8*)BurnMalloc(0x2000);
|
||||
CpsBootlegSpriteRam = (UINT8*)BurnMalloc(0x4000);
|
||||
|
||||
SekOpen(0);
|
||||
SekMapMemory(CpsBootlegSpriteRam, 0x990000, 0x991fff, SM_RAM);
|
||||
SekMapMemory(CpsBootlegSpriteRam, 0x992000, 0x993fff, SM_RAM);
|
||||
SekMapMemory(CpsBootlegSpriteRam, 0x990000, 0x993fff, SM_RAM);
|
||||
SekMapHandler(1, 0xf18000, 0xf19fff, SM_READ);
|
||||
SekSetReadByteHandler(1, PunipicF18Read);
|
||||
SekMapHandler(2, 0x980000, 0x980fff, SM_WRITE);
|
||||
|
@ -11696,11 +11695,10 @@ static INT32 Punipic2Init()
|
|||
memset(CpsGfx, 0, nCpsGfxLen);
|
||||
CpsLoadTilesPunipic2(CpsGfx, 4);
|
||||
|
||||
CpsBootlegSpriteRam = (UINT8*)BurnMalloc(0x2000);
|
||||
CpsBootlegSpriteRam = (UINT8*)BurnMalloc(0x4000);
|
||||
|
||||
SekOpen(0);
|
||||
SekMapMemory(CpsBootlegSpriteRam, 0x990000, 0x991fff, SM_RAM);
|
||||
SekMapMemory(CpsBootlegSpriteRam, 0x992000, 0x993fff, SM_RAM);
|
||||
SekMapMemory(CpsBootlegSpriteRam, 0x990000, 0x993fff, SM_RAM);
|
||||
SekMapHandler(1, 0xf18000, 0xf19fff, SM_READ);
|
||||
SekSetReadByteHandler(1, PunipicF18Read);
|
||||
SekMapHandler(2, 0x980000, 0x980fff, SM_WRITE);
|
||||
|
@ -11724,11 +11722,10 @@ static INT32 Punipic3Init()
|
|||
memset(CpsGfx, 0, nCpsGfxLen);
|
||||
CpsLoadTilesHack160(CpsGfx, 4);
|
||||
|
||||
CpsBootlegSpriteRam = (UINT8*)BurnMalloc(0x2000);
|
||||
CpsBootlegSpriteRam = (UINT8*)BurnMalloc(0x4000);
|
||||
|
||||
SekOpen(0);
|
||||
SekMapMemory(CpsBootlegSpriteRam, 0x990000, 0x991fff, SM_RAM);
|
||||
SekMapMemory(CpsBootlegSpriteRam, 0x992000, 0x993fff, SM_RAM);
|
||||
SekMapMemory(CpsBootlegSpriteRam, 0x990000, 0x993fff, SM_RAM);
|
||||
SekMapHandler(1, 0xf18000, 0xf19fff, SM_READ);
|
||||
SekSetReadByteHandler(1, PunipicF18Read);
|
||||
SekMapHandler(2, 0x980000, 0x980fff, SM_WRITE);
|
||||
|
@ -13893,31 +13890,31 @@ struct BurnDriver BurnDrvCpsPunisherj = {
|
|||
&CpsRecalcPal, 0x1000, 384, 224, 4, 3
|
||||
};
|
||||
|
||||
struct BurnDriverD BurnDrvCpsPunipic = {
|
||||
struct BurnDriver BurnDrvCpsPunipic = {
|
||||
"punipic", "punisher", NULL, NULL, "1993",
|
||||
"The Punisher (bootleg with PIC16c57, set 1)\0", NULL, "bootleg", "CPS1",
|
||||
"The Punisher (bootleg with PIC16c57, set 1)\0", "No sound", "bootleg", "CPS1",
|
||||
NULL, NULL, NULL, NULL,
|
||||
BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0,
|
||||
BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0,
|
||||
NULL, PunipicRomInfo, PunipicRomName, NULL, NULL, PunisherInputInfo, PunisherDIPInfo,
|
||||
PunipicInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan,
|
||||
&CpsRecalcPal, 0x1000, 384, 224, 4, 3
|
||||
};
|
||||
|
||||
struct BurnDriverD BurnDrvCpsPunipic2 = {
|
||||
struct BurnDriver BurnDrvCpsPunipic2 = {
|
||||
"punipic2", "punisher", NULL, NULL, "1993",
|
||||
"The Punisher (bootleg with PIC16c57, set 2)\0", NULL, "bootleg", "CPS1",
|
||||
"The Punisher (bootleg with PIC16c57, set 2)\0", "No sound", "bootleg", "CPS1",
|
||||
NULL, NULL, NULL, NULL,
|
||||
BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0,
|
||||
BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0,
|
||||
NULL, Punipic2RomInfo, Punipic2RomName, NULL, NULL, PunisherInputInfo, PunisherDIPInfo,
|
||||
Punipic2Init, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan,
|
||||
&CpsRecalcPal, 0x1000, 384, 224, 4, 3
|
||||
};
|
||||
|
||||
struct BurnDriverD BurnDrvCpsPunipic3 = {
|
||||
struct BurnDriver BurnDrvCpsPunipic3 = {
|
||||
"punipic3", "punisher", NULL, NULL, "1993",
|
||||
"The Punisher (bootleg with PIC16c57, set 3)\0", NULL, "bootleg", "CPS1",
|
||||
"The Punisher (bootleg with PIC16c57, set 3)\0", "No sound", "bootleg", "CPS1",
|
||||
NULL, NULL, NULL, NULL,
|
||||
BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0,
|
||||
BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_SCRFIGHT, 0,
|
||||
NULL, Punipic3RomInfo, Punipic3RomName, NULL, NULL, PunisherInputInfo, PunisherDIPInfo,
|
||||
Punipic3Init, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan,
|
||||
&CpsRecalcPal, 0x1000, 384, 224, 4, 3
|
||||
|
|
Loading…
Reference in New Issue