Skip to content

Commit

Permalink
punchout, fix some missing sounds
Browse files Browse the repository at this point in the history
  • Loading branch information
dinkc64 committed Aug 17, 2024
1 parent 3bd9f6f commit 48c94b0
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/burn/drv/pre90s/d_dkong.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2003,6 +2003,7 @@ static INT32 Dkong3Init()

nesapuInit(0, 1789773, 0, dkong3_nesapu_sync, 0);
nesapuSetAllRoutes(0, 0.95, BURN_SND_ROUTE_BOTH);
nesapuSetArcade(1);

nesapuInit(1, 1789773, 0, dkong3_nesapu_sync, 1);
nesapuSetAllRoutes(1, 0.95, BURN_SND_ROUTE_BOTH);
Expand Down
25 changes: 17 additions & 8 deletions src/burn/drv/pre90s/d_punchout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ static UINT8 DrvInputs[2];
static UINT8 DrvDips[2];
static UINT8 DrvReset;

static INT32 nExtraCycles;

static struct BurnInputInfo PunchoutInputList[] = {
{"P1 Coin", BIT_DIGITAL, DrvJoy2 + 7, "p1 coin" },
{"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" },
Expand Down Expand Up @@ -506,9 +508,12 @@ static INT32 DrvDoReset()
M6502Close();

vlm5030Reset(0);
nesapuReset();

spunchout_prot_mode = 0;

nExtraCycles = 0;

HiscoreReset();

return 0;
Expand Down Expand Up @@ -675,10 +680,11 @@ static INT32 CommonInit(INT32 (*pInitCallback)(), INT32 punchout, INT32 reverse_
M6502Close();

vlm5030Init(0, 3580000, punchout_vlm_sync, DrvVLMROM, 0x4000, 1);
vlm5030SetAllRoutes(0, 0.50, BURN_SND_ROUTE_BOTH);
vlm5030SetAllRoutes(0, 0.70, BURN_SND_ROUTE_BOTH);

nesapuInit(0, 1789773, 0, punchout_nesapu_sync, 0);
nesapuSetAllRoutes(0, 0.50, BURN_SND_ROUTE_BOTH);
nesapuSetAllRoutes(0, 0.70, BURN_SND_ROUTE_BOTH);
nesapuSetArcade(1);

GenericTilesInit();

Expand Down Expand Up @@ -1050,9 +1056,9 @@ static INT32 DrvFrame()
}
}

INT32 nInterleave = 10;
INT32 nInterleave = 32;
INT32 nCyclesTotal[2] = { 4000000 / 60, 1789773 / 60 };
INT32 nCyclesDone[2] = { 0, 0 };
INT32 nCyclesDone[2] = { nExtraCycles, 0 };

ZetNewFrame();
M6502NewFrame();
Expand All @@ -1063,19 +1069,20 @@ static INT32 DrvFrame()
for (INT32 i = 0; i < nInterleave; i++)
{
CPU_RUN(0, Zet);
if (i == (nInterleave - 1) && *interrupt_enable) ZetNmi();

CPU_RUN(1, M6502);
if (i == (nInterleave - 1)) M6502SetIRQLine(M6502_INPUT_LINE_NMI, CPU_IRQSTATUS_AUTO);
}

if (*interrupt_enable) ZetNmi();

M6502SetIRQLine(M6502_INPUT_LINE_NMI, CPU_IRQSTATUS_AUTO);

nesapuUpdate(0, pBurnSoundOut, nBurnSoundLen);
vlm5030Update(0, pBurnSoundOut, nBurnSoundLen);

M6502Close();
ZetClose();

nExtraCycles = nCyclesDone[0] - nCyclesTotal[0];

if (pBurnDraw) {
BurnDrvRedraw();
}
Expand Down Expand Up @@ -1105,6 +1112,8 @@ static INT32 DrvScan(INT32 nAction, INT32 *pnMin)
nesapuScan(nAction, pnMin);

SCAN_VAR(spunchout_prot_mode);

SCAN_VAR(nExtraCycles);
}

if (nAction & ACB_NVRAM) {
Expand Down
2 changes: 2 additions & 0 deletions src/burn/snd/nes_apu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1111,6 +1111,8 @@ void nesapuExit()
BurnFree(nes_ext_buffer);
nes_ext_sound_cb = NULL;

nesapuSetArcade(0);

DebugSnd_NESAPUSndInitted = 0;
}

Expand Down

0 comments on commit 48c94b0

Please sign in to comment.