From 5eea09129b99796258ca62081696b4d303ceea73 Mon Sep 17 00:00:00 2001 From: dinkc64 <12570148+dinkc64@users.noreply.github.com> Date: Thu, 24 Sep 2015 22:19:38 +0000 Subject: [PATCH] d_gng.cpp: Ghouls n Ghosts: buffer the sprites at the right time to fix sprite lag (notice the gravestones while walking), on first boot: fill the palette with something to see the boot messages --- src/burn/drv/pre90s/d_gng.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/burn/drv/pre90s/d_gng.cpp b/src/burn/drv/pre90s/d_gng.cpp index f61478400..0200e07fb 100644 --- a/src/burn/drv/pre90s/d_gng.cpp +++ b/src/burn/drv/pre90s/d_gng.cpp @@ -716,7 +716,7 @@ static INT32 DrvDoReset() BurnYM2203Reset(); HiscoreReset(); - + DrvRomBank = 0; DrvBgScrollX[0] = DrvBgScrollX[1] = 0; DrvBgScrollY[0] = DrvBgScrollY[1] = 0; @@ -862,6 +862,16 @@ void __fastcall DrvGngZ80Write(UINT16 a, UINT8 d) } } +static void DrvRandPalette() +{ // On first boot we fill the palette with some arbatrary values to see the boot-up messages + DrvPaletteRam1[0] = 0x00; + DrvPaletteRam2[0] = 0x00; + for (INT32 i = 1; i < 0x100; i++) { + DrvPaletteRam1[i] = 0xaf; + DrvPaletteRam2[i] = 0x5a; + } +} + static INT32 CharPlaneOffsets[2] = { 4, 0 }; static INT32 CharXOffsets[8] = { 0, 1, 2, 3, 8, 9, 10, 11 }; static INT32 CharYOffsets[8] = { 0, 16, 32, 48, 64, 80, 96, 112 }; @@ -977,6 +987,7 @@ static INT32 DrvInit() BurnYM2203SetRoute(1, BURN_SND_YM2203_AY8910_ROUTE_3, 0.40, BURN_SND_ROUTE_BOTH); GenericTilesInit(); + DrvRandPalette(); // Reset the driver DrvDoReset(); @@ -1247,7 +1258,7 @@ static void DrvRenderSprites() INT32 yFlip = Attr & 0x08; INT32 Code = DrvSpriteRamBuffer[Offs + 0] + ((Attr << 2) & 0x300); INT32 Colour = (Attr >> 4) & 3; - + if (sx > 16 && sx < 240 && sy > 16 && sy < 208) { if (xFlip) { if (yFlip) { @@ -1371,6 +1382,7 @@ static INT32 DrvFrame() nCyclesSegment = nNext - nCyclesDone[nCurrentCPU]; nCyclesDone[nCurrentCPU] += M6809Run(nCyclesSegment); if (i == 22) { + memcpy(DrvSpriteRamBuffer, DrvSpriteRam, 0x200); M6809SetIRQLine(0, CPU_IRQSTATUS_AUTO); } M6809Close(); @@ -1393,8 +1405,6 @@ static INT32 DrvFrame() ZetClose(); if (pBurnDraw) DrvDraw(); - - memcpy(DrvSpriteRamBuffer, DrvSpriteRam, 0x200); return 0; }