d_ladybug: fix sraider animated background and music/sfx - sn* sounds needed to be interlaced. few cleanups
This commit is contained in:
parent
f733f2625d
commit
c425639c91
|
@ -757,20 +757,12 @@ static INT32 DrvInit(INT32 game_select)
|
|||
|
||||
ZetInit(0);
|
||||
ZetOpen(0);
|
||||
ZetMapArea(0x0000, 0x5fff, 0, DrvZ80ROM0);
|
||||
ZetMapArea(0x0000, 0x5fff, 2, DrvZ80Ops0, DrvZ80ROM0);
|
||||
ZetMapArea(0x6000, 0x6fff, 0, DrvZ80RAM0);
|
||||
ZetMapArea(0x6000, 0x6fff, 1, DrvZ80RAM0);
|
||||
ZetMapArea(0x6000, 0x6fff, 2, DrvZ80RAM0);
|
||||
ZetMapArea(0x7000, 0x73ff, 0, DrvSprRAM);
|
||||
ZetMapArea(0x7000, 0x73ff, 1, DrvSprRAM);
|
||||
ZetMapArea(0x7000, 0x73ff, 2, DrvSprRAM);
|
||||
ZetMapArea(0xd000, 0xd3ff, 0, DrvVidRAM);
|
||||
ZetMapArea(0xd000, 0xd3ff, 1, DrvVidRAM);
|
||||
ZetMapArea(0xd000, 0xd3ff, 2, DrvVidRAM);
|
||||
ZetMapArea(0xd400, 0xd7ff, 0, DrvColRAM);
|
||||
ZetMapArea(0xd400, 0xd7ff, 1, DrvColRAM);
|
||||
ZetMapArea(0xd400, 0xd7ff, 2, DrvColRAM);
|
||||
ZetMapMemory(DrvZ80ROM0, 0x0000, 0x5fff, MAP_ROM);
|
||||
ZetMapMemory(DrvZ80Ops0, 0x0000, 0x5fff, MAP_FETCHOP); // dorodon encrypted opcodes
|
||||
ZetMapMemory(DrvZ80RAM0, 0x6000, 0x6fff, MAP_RAM);
|
||||
ZetMapMemory(DrvSprRAM, 0x7000, 0x73ff, MAP_RAM);
|
||||
ZetMapMemory(DrvVidRAM, 0xd000, 0xd3ff, MAP_RAM);
|
||||
ZetMapMemory(DrvColRAM, 0xd400, 0xd7ff, MAP_RAM);
|
||||
ZetSetWriteHandler(ladybug_write);
|
||||
ZetSetReadHandler(ladybug_read);
|
||||
ZetClose();
|
||||
|
@ -824,34 +816,20 @@ static INT32 SraiderInit()
|
|||
|
||||
ZetInit(0);
|
||||
ZetOpen(0);
|
||||
ZetMapArea(0x0000, 0x5fff, 0, DrvZ80ROM0);
|
||||
ZetMapArea(0x0000, 0x5fff, 2, DrvZ80ROM0);
|
||||
ZetMapArea(0x6000, 0x6fff, 0, DrvZ80RAM0);
|
||||
ZetMapArea(0x6000, 0x6fff, 1, DrvZ80RAM0);
|
||||
ZetMapArea(0x6000, 0x6fff, 2, DrvZ80RAM0);
|
||||
ZetMapArea(0x7000, 0x73ff, 0, DrvSprRAM);
|
||||
ZetMapArea(0x7000, 0x73ff, 1, DrvSprRAM);
|
||||
ZetMapArea(0x7000, 0x73ff, 2, DrvSprRAM);
|
||||
ZetMapArea(0xd000, 0xd3ff, 0, DrvVidRAM);
|
||||
ZetMapArea(0xd000, 0xd3ff, 1, DrvVidRAM);
|
||||
ZetMapArea(0xd000, 0xd3ff, 2, DrvVidRAM);
|
||||
ZetMapArea(0xd400, 0xd7ff, 0, DrvColRAM);
|
||||
ZetMapArea(0xd400, 0xd7ff, 1, DrvColRAM);
|
||||
ZetMapArea(0xd400, 0xd7ff, 2, DrvColRAM);
|
||||
ZetMapMemory(DrvZ80ROM0, 0x0000, 0x5fff, MAP_ROM);
|
||||
ZetMapMemory(DrvZ80RAM0, 0x6000, 0x6fff, MAP_RAM);
|
||||
ZetMapMemory(DrvSprRAM, 0x7000, 0x73ff, MAP_RAM);
|
||||
ZetMapMemory(DrvVidRAM, 0xd000, 0xd3ff, MAP_RAM);
|
||||
ZetMapMemory(DrvColRAM, 0xd400, 0xd7ff, MAP_RAM);
|
||||
ZetSetWriteHandler(sraider_main_write);
|
||||
ZetSetReadHandler(ladybug_read);
|
||||
ZetClose();
|
||||
|
||||
ZetInit(1);
|
||||
ZetOpen(1);
|
||||
ZetMapArea(0x0000, 0x5fff, 0, DrvZ80ROM1);
|
||||
ZetMapArea(0x0000, 0x5fff, 2, DrvZ80ROM1);
|
||||
ZetMapArea(0x6000, 0x63ff, 0, DrvZ80RAM1);
|
||||
ZetMapArea(0x6000, 0x63ff, 1, DrvZ80RAM1);
|
||||
ZetMapArea(0x6000, 0x63ff, 2, DrvZ80RAM1);
|
||||
ZetMapArea(0xe000, 0xe0ff, 0, DrvGridRAM);
|
||||
ZetMapArea(0xe000, 0xe0ff, 1, DrvGridRAM);
|
||||
ZetMapArea(0xe000, 0xe0ff, 2, DrvGridRAM);
|
||||
ZetMapMemory(DrvZ80ROM1, 0x0000, 0x5fff, MAP_ROM);
|
||||
ZetMapMemory(DrvZ80RAM1, 0x6000, 0x63ff, MAP_RAM);
|
||||
ZetMapMemory(DrvGridRAM, 0xe000, 0xe0ff, MAP_RAM);
|
||||
ZetSetWriteHandler(sraider_sub_write);
|
||||
ZetSetReadHandler(sraider_sub_read);
|
||||
ZetSetOutHandler(sraider_sub_out);
|
||||
|
@ -862,11 +840,11 @@ static INT32 SraiderInit()
|
|||
SN76489Init(2, 4000000, 1);
|
||||
SN76489Init(3, 4000000, 1);
|
||||
SN76489Init(4, 4000000, 1);
|
||||
SN76496SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH);
|
||||
SN76496SetRoute(1, 1.00, BURN_SND_ROUTE_BOTH);
|
||||
SN76496SetRoute(2, 1.00, BURN_SND_ROUTE_BOTH);
|
||||
SN76496SetRoute(3, 1.00, BURN_SND_ROUTE_BOTH);
|
||||
SN76496SetRoute(4, 1.00, BURN_SND_ROUTE_BOTH);
|
||||
SN76496SetRoute(0, 0.70, BURN_SND_ROUTE_BOTH);
|
||||
SN76496SetRoute(1, 0.70, BURN_SND_ROUTE_BOTH);
|
||||
SN76496SetRoute(2, 0.70, BURN_SND_ROUTE_BOTH);
|
||||
SN76496SetRoute(3, 0.70, BURN_SND_ROUTE_BOTH);
|
||||
SN76496SetRoute(4, 0.70, BURN_SND_ROUTE_BOTH);
|
||||
|
||||
GenericTilesInit();
|
||||
|
||||
|
@ -914,7 +892,20 @@ static void draw_layer()
|
|||
Render8x8Tile_Mask_Clip(pTransDraw, code, sx, (sy * 8) - 32, color, 2, 0, 0, DrvGfxROM0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void boxizer(INT32 x, INT32 y, INT32 w, INT32 h, INT32 pxl) {
|
||||
INT32 t = x;
|
||||
while(h-- > 0) {
|
||||
INT32 c = w; x = t;
|
||||
while(c-- > 0) {
|
||||
if (x < nScreenWidth && y < nScreenHeight)
|
||||
pTransDraw[(y*nScreenWidth) + x] = pxl;
|
||||
x++;
|
||||
}
|
||||
y++;
|
||||
}
|
||||
}
|
||||
|
||||
static void draw_grid()
|
||||
{
|
||||
|
@ -940,6 +931,20 @@ static void draw_grid()
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (INT32 i = 0; i < 0x100; i++)
|
||||
{
|
||||
if (DrvGridRAM[i] != 0)
|
||||
{
|
||||
UINT8 x = i;
|
||||
int height = nScreenHeight;
|
||||
|
||||
if (*flipscreen)
|
||||
x = ~x;
|
||||
|
||||
boxizer(x, 0, 1, height, 0x81);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void draw_sprites()
|
||||
|
@ -958,7 +963,14 @@ static void draw_sprites()
|
|||
if (DrvSprRAM[offs + i + 0] & 0x80)
|
||||
{
|
||||
INT32 size = (DrvSprRAM[offs + i + 0] >> 6) & 0x01;
|
||||
INT32 code = (DrvSprRAM[offs + i + 1] >> 2) + ((DrvSprRAM[offs + i + 2] & 0x10) << (4 >> size));
|
||||
|
||||
INT32 code;
|
||||
if (size) // 16
|
||||
code = ((DrvSprRAM[offs + i + 1] >> 2) + 4 * (DrvSprRAM[offs + i + 2] & 0x10)) & 0x7f;
|
||||
else // 8
|
||||
code = (DrvSprRAM[offs + i + 1] + 16 * (DrvSprRAM[offs + i + 2] & 0x10)) & 0x1ff;
|
||||
|
||||
//INT32 code = (DrvSprRAM[offs + i + 1] >> 2) + ((DrvSprRAM[offs + i + 2] & 0x10) << (4 >> size));
|
||||
INT32 color = (DrvSprRAM[offs + i + 2] & 0x0f) + 8;
|
||||
INT32 flipx = DrvSprRAM[offs + i + 0] & 0x20;
|
||||
INT32 flipy = DrvSprRAM[offs + i + 0] & 0x10;
|
||||
|
@ -1174,8 +1186,10 @@ static INT32 DrvFrame()
|
|||
|
||||
ZetClose();
|
||||
|
||||
SN76496Update(0, pBurnSoundOut, nBurnSoundLen);
|
||||
SN76496Update(1, pBurnSoundOut, nBurnSoundLen);
|
||||
if (pBurnSoundOut) {
|
||||
SN76496Update(0, pBurnSoundOut, nBurnSoundLen);
|
||||
SN76496Update(1, pBurnSoundOut, nBurnSoundLen);
|
||||
}
|
||||
|
||||
if (pBurnDraw) {
|
||||
DrvDraw();
|
||||
|
@ -1200,24 +1214,45 @@ static INT32 SraiderFrame()
|
|||
|
||||
INT32 nInterleave = 100;
|
||||
INT32 nTotalCycles[2] = { 4000000 / 60, 4000000 / 60 };
|
||||
INT32 nSoundBufferPos = 0;
|
||||
|
||||
for (INT32 i = 0; i < nInterleave; i++) {
|
||||
ZetOpen(0);
|
||||
ZetRun(nTotalCycles[0] / nInterleave);
|
||||
if (i == (nInterleave - 1)) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO);
|
||||
if (i == (nInterleave - 1)) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD);
|
||||
ZetClose();
|
||||
|
||||
ZetOpen(1);
|
||||
ZetRun(nTotalCycles[1] / nInterleave);
|
||||
if (i == (nInterleave - 1)) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO);
|
||||
if (i == (nInterleave - 1)) ZetSetIRQLine(0, CPU_IRQSTATUS_HOLD);
|
||||
ZetClose();
|
||||
|
||||
if (pBurnSoundOut) {
|
||||
INT32 nSegmentLength = nBurnSoundLen / nInterleave;
|
||||
INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1);
|
||||
|
||||
SN76496Update(0, pSoundBuf, nSegmentLength);
|
||||
SN76496Update(1, pSoundBuf, nSegmentLength);
|
||||
SN76496Update(2, pSoundBuf, nSegmentLength);
|
||||
SN76496Update(3, pSoundBuf, nSegmentLength);
|
||||
SN76496Update(4, pSoundBuf, nSegmentLength);
|
||||
|
||||
nSoundBufferPos += nSegmentLength;
|
||||
}
|
||||
}
|
||||
|
||||
if (pBurnSoundOut) {
|
||||
INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos;
|
||||
INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1);
|
||||
if (nSegmentLength) {
|
||||
SN76496Update(0, pSoundBuf, nSegmentLength);
|
||||
SN76496Update(1, pSoundBuf, nSegmentLength);
|
||||
SN76496Update(2, pSoundBuf, nSegmentLength);
|
||||
SN76496Update(3, pSoundBuf, nSegmentLength);
|
||||
SN76496Update(4, pSoundBuf, nSegmentLength);
|
||||
}
|
||||
}
|
||||
|
||||
SN76496Update(0, pBurnSoundOut, nBurnSoundLen);
|
||||
SN76496Update(1, pBurnSoundOut, nBurnSoundLen);
|
||||
SN76496Update(2, pBurnSoundOut, nBurnSoundLen);
|
||||
SN76496Update(3, pBurnSoundOut, nBurnSoundLen);
|
||||
SN76496Update(4, pBurnSoundOut, nBurnSoundLen);
|
||||
|
||||
if (pBurnDraw) {
|
||||
SraiderDraw();
|
||||
|
@ -1226,7 +1261,7 @@ static INT32 SraiderFrame()
|
|||
return 0;
|
||||
}
|
||||
|
||||
static INT32 DrvScan(INT32 nAction,INT32 *pnMin)
|
||||
static INT32 DrvScan(INT32 nAction, INT32 *pnMin)
|
||||
{
|
||||
struct BurnArea ba;
|
||||
|
||||
|
@ -1234,7 +1269,7 @@ static INT32 DrvScan(INT32 nAction,INT32 *pnMin)
|
|||
*pnMin = 0x029706;
|
||||
}
|
||||
|
||||
if (nAction & ACB_VOLATILE) {
|
||||
if (nAction & ACB_VOLATILE) {
|
||||
memset(&ba, 0, sizeof(ba));
|
||||
|
||||
ba.Data = AllRam;
|
||||
|
@ -1558,5 +1593,5 @@ struct BurnDriver BurnDrvSraider = {
|
|||
BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_SHOOT, 0,
|
||||
NULL, sraiderRomInfo, sraiderRomName, NULL, NULL, SraiderInputInfo, SraiderDIPInfo,
|
||||
SraiderInit, DrvExit, SraiderFrame, SraiderDraw, DrvScan, &DrvRecalc, 0x82,
|
||||
196, 240, 3, 4
|
||||
192, 240, 3, 4
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue