From 021cb0cc11e1bc01b71ef4cb071c1835dce9f5aa Mon Sep 17 00:00:00 2001 From: dinkc64 Date: Thu, 15 Aug 2024 20:48:41 -0400 Subject: [PATCH] punchout power bar fix --- src/burn/drv/pre90s/d_punchout.cpp | 36 +++++++++--------------------- 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/src/burn/drv/pre90s/d_punchout.cpp b/src/burn/drv/pre90s/d_punchout.cpp index 1c2588d044..9edcbdba80 100644 --- a/src/burn/drv/pre90s/d_punchout.cpp +++ b/src/burn/drv/pre90s/d_punchout.cpp @@ -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); @@ -700,7 +695,7 @@ static INT32 DrvExit() vlm5030Exit(); nesapuExit(); - BurnFree (AllMem); + BurnFreeMemIndex(); return 0; } @@ -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; @@ -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); } } @@ -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(); @@ -1099,7 +1083,7 @@ static INT32 DrvFrame() return 0; } -static INT32 DrvScan(INT32 nAction,INT32 *pnMin) +static INT32 DrvScan(INT32 nAction, INT32 *pnMin) { struct BurnArea ba; @@ -1107,7 +1091,7 @@ static INT32 DrvScan(INT32 nAction,INT32 *pnMin) *pnMin = 0x029521; } - if (nAction & ACB_VOLATILE) { + if (nAction & ACB_VOLATILE) { memset(&ba, 0, sizeof(ba)); ba.Data = AllRam;