Skip to content

Commit

Permalink
punchout power bar fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dinkc64 committed Aug 16, 2024
1 parent e8c68b3 commit 021cb0c
Showing 1 changed file with 10 additions and 26 deletions.
36 changes: 10 additions & 26 deletions src/burn/drv/pre90s/d_punchout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -598,12 +598,7 @@ static void DrvPaletteInit(INT32 off, INT32 bank, INT32 reverse)

static INT32 CommonInit(INT32 (*pInitCallback)(), INT32 punchout, INT32 reverse_palette, UINT32 gfx_xor)
{
AllMem = NULL;
MemIndex();
INT32 nLen = MemEnd - (UINT8 *)0;
if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
memset(AllMem, 0, nLen);
MemIndex();
BurnAllocMemIndex();

memset (DrvGfxROM0, 0xff, 0x020000);
memset (DrvGfxROM1, 0xff, 0x020000);
Expand Down Expand Up @@ -700,7 +695,7 @@ static INT32 DrvExit()
vlm5030Exit();
nesapuExit();

BurnFree (AllMem);
BurnFreeMemIndex();

return 0;
}
Expand Down Expand Up @@ -737,7 +732,7 @@ static void predraw_big_sprite(UINT16 *bitmap, UINT8 *ram, UINT8 *rom, INT32 bpp

static void draw_layer(UINT8 *ram, UINT8 *rom, INT32 wide, INT32 paloff, INT32 scroll, INT32 allow_flip)
{
for (INT32 i = wide * 2; i < wide * 30; i++)
for (INT32 i = wide * 2; i < wide * 32; i++)
{
INT32 sx = (i % wide) * 8;
INT32 sy = (i / wide) * 8;
Expand All @@ -755,21 +750,15 @@ static void draw_layer(UINT8 *ram, UINT8 *rom, INT32 wide, INT32 paloff, INT32 s

if (scroll)
{
INT32 scrollx = ram[(sy/8)*2] + ((ram[(sy/8)*2+1] & 0x01) << 8);
INT32 scrollx = ram[2*(sy/8)] + ((ram[2*(sy/8)+1] & 0x01) << 8);

sx -= (56 + scrollx) & 0x1ff;
if (sx < -7) sx += 256;
if (sx < -7) sx += 512;
}

sy -= 16;

if (sx >= nScreenWidth) continue;

if (flipx) {
Render8x8Tile_FlipX_Clip(pTransDraw, code, sx, sy, color, 2, paloff, rom);
} else {
Render8x8Tile_Clip(pTransDraw, code, sx, sy, color, 2, paloff, rom);
}
Draw8x8Tile(pTransDraw, code, sx, sy, flipx, 0, color, 2, paloff, rom);
}
}

Expand Down Expand Up @@ -1073,13 +1062,8 @@ static INT32 DrvFrame()

for (INT32 i = 0; i < nInterleave; i++)
{
INT32 nSegment = nCyclesTotal[0] / nInterleave;

nCyclesDone[0] += ZetRun(nSegment);

nSegment = nCyclesTotal[1] / nInterleave;

nCyclesDone[1] += M6502Run(nSegment);
CPU_RUN(0, Zet);
CPU_RUN(1, M6502);
}

if (*interrupt_enable) ZetNmi();
Expand All @@ -1099,15 +1083,15 @@ static INT32 DrvFrame()
return 0;
}

static INT32 DrvScan(INT32 nAction,INT32 *pnMin)
static INT32 DrvScan(INT32 nAction, INT32 *pnMin)
{
struct BurnArea ba;

if (pnMin) {
*pnMin = 0x029521;
}

if (nAction & ACB_VOLATILE) {
if (nAction & ACB_VOLATILE) {
memset(&ba, 0, sizeof(ba));

ba.Data = AllRam;
Expand Down

0 comments on commit 021cb0c

Please sign in to comment.