show Yie Ar Kung Fu some love. Interlace the SN to get correct sound effects, Init the right chip, trigger IRQ0 on vbl-in intead of vbl-out.

This commit is contained in:
dinkc64 2014-11-03 20:56:17 +00:00
parent eb48be9ad1
commit 171650529f
1 changed files with 19 additions and 4 deletions

View File

@ -340,7 +340,7 @@ static INT32 DrvInit()
M6809SetReadHandler(yiear_read);
M6809Close();
SN76496Init(0, 1536000, 0);
SN76489AInit(0, 1536000, 0);
SN76496SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH);
vlm5030Init(0, 3579545, vlm_sync, DrvVLMROM, 0x2000, 1);
@ -464,6 +464,7 @@ static INT32 DrvFrame()
INT32 nInterleave = 256;
INT32 nCyclesTotal[1] = { 1536000 / 60 };
INT32 nCyclesDone[1] = { 0 };
INT32 nSoundBufferPos = 0;
M6809Open(0);
@ -473,12 +474,26 @@ static INT32 DrvFrame()
if (*nmi_enable && (i & 0x1f) == 0) // copy shao-lin's road
M6809SetIRQLine(0x20, M6809_IRQSTATUS_AUTO); // 480x/second (8x/frame)
if (i == 240) M6809SetIRQLine(0, M6809_IRQSTATUS_AUTO);
// Render Sound Segment
if (pBurnSoundOut) {
INT32 nSegmentLength = nBurnSoundLen / nInterleave;
INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1);
SN76496Update(0, pSoundBuf, nSegmentLength);
nSoundBufferPos += nSegmentLength;
}
}
if (*irq_enable) M6809SetIRQLine(0, M6809_IRQSTATUS_AUTO);
// Make sure the buffer is entirely filled.
if (pBurnSoundOut) {
SN76496Update(0, pBurnSoundOut, nBurnSoundLen);
INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos;
INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1);
if (nSegmentLength) {
SN76496Update(0, pSoundBuf, nSegmentLength);
}
// vlm5030 won't interlace, so just run it at the end of the frame..
vlm5030Update(0, pBurnSoundOut, nBurnSoundLen);
}