Improved IRQ timing in Sega SystemY driver
This commit is contained in:
parent
cee3344d2c
commit
358f3d9e8e
|
@ -1846,8 +1846,6 @@ static INT32 PdriftInit()
|
||||||
|
|
||||||
INT32 nRet = System16Init();
|
INT32 nRet = System16Init();
|
||||||
|
|
||||||
if (!nRet) YBoardIrq2Scanline = 0;
|
|
||||||
|
|
||||||
UINT8 *pTemp = (UINT8*)BurnMalloc(0x0c0000);
|
UINT8 *pTemp = (UINT8*)BurnMalloc(0x0c0000);
|
||||||
memcpy(pTemp, System16PCMData, 0x0c0000);
|
memcpy(pTemp, System16PCMData, 0x0c0000);
|
||||||
memset(System16PCMData, 0, 0x180000);
|
memset(System16PCMData, 0, 0x180000);
|
||||||
|
|
|
@ -101,7 +101,6 @@ extern bool Shangon;
|
||||||
extern bool Hangon;
|
extern bool Hangon;
|
||||||
extern bool System16Z80Enable;
|
extern bool System16Z80Enable;
|
||||||
|
|
||||||
extern INT32 YBoardIrq2Scanline;
|
|
||||||
extern INT32 System16YM2413IRQInterval;
|
extern INT32 System16YM2413IRQInterval;
|
||||||
|
|
||||||
extern bool System16HasGears;
|
extern bool System16HasGears;
|
||||||
|
|
|
@ -133,8 +133,6 @@ static INT32 nCyclesTotal[4];
|
||||||
static INT32 nCyclesSegment;
|
static INT32 nCyclesSegment;
|
||||||
UINT32 System16ClockSpeed = 0;
|
UINT32 System16ClockSpeed = 0;
|
||||||
|
|
||||||
INT32 YBoardIrq2Scanline = 0;
|
|
||||||
|
|
||||||
INT32 System16YM2413IRQInterval;
|
INT32 System16YM2413IRQInterval;
|
||||||
|
|
||||||
static bool bUseAsm68KCoreOldValue = false;
|
static bool bUseAsm68KCoreOldValue = false;
|
||||||
|
@ -2320,8 +2318,6 @@ INT32 System16Init()
|
||||||
if (System16PCMDataSize) {
|
if (System16PCMDataSize) {
|
||||||
SegaPCMInit(32215900 / 8, BANK_12M | BANK_MASKF8, System16PCMData, System16PCMDataSize);
|
SegaPCMInit(32215900 / 8, BANK_12M | BANK_MASKF8, System16PCMData, System16PCMDataSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
YBoardIrq2Scanline = 170;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GenericTilesInit();
|
GenericTilesInit();
|
||||||
|
@ -2442,8 +2438,6 @@ INT32 System16Exit()
|
||||||
Hangon = false;
|
Hangon = false;
|
||||||
bSystem16BootlegRender = false;
|
bSystem16BootlegRender = false;
|
||||||
|
|
||||||
YBoardIrq2Scanline = 0;
|
|
||||||
|
|
||||||
System16YM2413IRQInterval = 0;
|
System16YM2413IRQInterval = 0;
|
||||||
|
|
||||||
UPD7759BankAddress = 0;
|
UPD7759BankAddress = 0;
|
||||||
|
@ -3102,7 +3096,7 @@ INT32 XBoardFrame()
|
||||||
|
|
||||||
INT32 YBoardFrame()
|
INT32 YBoardFrame()
|
||||||
{
|
{
|
||||||
INT32 nInterleave = 224, i;
|
INT32 nInterleave = 262, i;
|
||||||
|
|
||||||
if (System16Reset) System16DoReset();
|
if (System16Reset) System16DoReset();
|
||||||
|
|
||||||
|
@ -3134,7 +3128,10 @@ INT32 YBoardFrame()
|
||||||
nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave;
|
nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave;
|
||||||
nCyclesSegment = nNext - nSystem16CyclesDone[nCurrentCPU];
|
nCyclesSegment = nNext - nSystem16CyclesDone[nCurrentCPU];
|
||||||
nSystem16CyclesDone[nCurrentCPU] += SekRun(nCyclesSegment);
|
nSystem16CyclesDone[nCurrentCPU] += SekRun(nCyclesSegment);
|
||||||
if (i == YBoardIrq2Scanline) SekSetIRQLine(2, SEK_IRQSTATUS_AUTO);
|
if (i == 170) SekSetIRQLine(2, SEK_IRQSTATUS_ACK);
|
||||||
|
if (i == 171) SekSetIRQLine(2, SEK_IRQSTATUS_NONE);
|
||||||
|
if (i == 223) SekSetIRQLine(4, SEK_IRQSTATUS_ACK);
|
||||||
|
if (i == 224) SekSetIRQLine(4, SEK_IRQSTATUS_NONE);
|
||||||
SekClose();
|
SekClose();
|
||||||
|
|
||||||
// Run 68000 #2
|
// Run 68000 #2
|
||||||
|
@ -3144,7 +3141,10 @@ INT32 YBoardFrame()
|
||||||
nCyclesSegment = nNext - nSystem16CyclesDone[nCurrentCPU];
|
nCyclesSegment = nNext - nSystem16CyclesDone[nCurrentCPU];
|
||||||
nCyclesSegment = SekRun(nCyclesSegment);
|
nCyclesSegment = SekRun(nCyclesSegment);
|
||||||
nSystem16CyclesDone[nCurrentCPU] += nCyclesSegment;
|
nSystem16CyclesDone[nCurrentCPU] += nCyclesSegment;
|
||||||
if (i == YBoardIrq2Scanline) SekSetIRQLine(2, SEK_IRQSTATUS_AUTO);
|
if (i == 170) SekSetIRQLine(2, SEK_IRQSTATUS_ACK);
|
||||||
|
if (i == 171) SekSetIRQLine(2, SEK_IRQSTATUS_NONE);
|
||||||
|
if (i == 223) SekSetIRQLine(4, SEK_IRQSTATUS_ACK);
|
||||||
|
if (i == 224) SekSetIRQLine(4, SEK_IRQSTATUS_NONE);
|
||||||
SekClose();
|
SekClose();
|
||||||
|
|
||||||
// Run 68000 #3
|
// Run 68000 #3
|
||||||
|
@ -3154,7 +3154,10 @@ INT32 YBoardFrame()
|
||||||
nCyclesSegment = nNext - nSystem16CyclesDone[nCurrentCPU];
|
nCyclesSegment = nNext - nSystem16CyclesDone[nCurrentCPU];
|
||||||
nCyclesSegment = SekRun(nCyclesSegment);
|
nCyclesSegment = SekRun(nCyclesSegment);
|
||||||
nSystem16CyclesDone[nCurrentCPU] += nCyclesSegment;
|
nSystem16CyclesDone[nCurrentCPU] += nCyclesSegment;
|
||||||
if (i == YBoardIrq2Scanline) SekSetIRQLine(2, SEK_IRQSTATUS_AUTO);
|
if (i == 170) SekSetIRQLine(2, SEK_IRQSTATUS_ACK);
|
||||||
|
if (i == 171) SekSetIRQLine(2, SEK_IRQSTATUS_NONE);
|
||||||
|
if (i == 223) SekSetIRQLine(4, SEK_IRQSTATUS_ACK);
|
||||||
|
if (i == 224) SekSetIRQLine(4, SEK_IRQSTATUS_NONE);
|
||||||
SekClose();
|
SekClose();
|
||||||
|
|
||||||
// Run Z80
|
// Run Z80
|
||||||
|
@ -3190,12 +3193,6 @@ INT32 YBoardFrame()
|
||||||
SegaPCMUpdate(pSoundBuf, nSegmentLength);
|
SegaPCMUpdate(pSoundBuf, nSegmentLength);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < 3; i++) {
|
|
||||||
SekOpen(i);
|
|
||||||
SekSetIRQLine(4, SEK_IRQSTATUS_AUTO);
|
|
||||||
SekClose();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pBurnDraw) {
|
if (pBurnDraw) {
|
||||||
YBoardRender();
|
YBoardRender();
|
||||||
|
|
Loading…
Reference in New Issue