diff --git a/src/burn/drivers/sega/d_ybrd.cpp b/src/burn/drivers/sega/d_ybrd.cpp index 476eb8fc2..19cfc9b10 100644 --- a/src/burn/drivers/sega/d_ybrd.cpp +++ b/src/burn/drivers/sega/d_ybrd.cpp @@ -1846,8 +1846,6 @@ static INT32 PdriftInit() INT32 nRet = System16Init(); - if (!nRet) YBoardIrq2Scanline = 0; - UINT8 *pTemp = (UINT8*)BurnMalloc(0x0c0000); memcpy(pTemp, System16PCMData, 0x0c0000); memset(System16PCMData, 0, 0x180000); diff --git a/src/burn/drivers/sega/sys16.h b/src/burn/drivers/sega/sys16.h index bc619d5ec..6db6c228e 100644 --- a/src/burn/drivers/sega/sys16.h +++ b/src/burn/drivers/sega/sys16.h @@ -101,7 +101,6 @@ extern bool Shangon; extern bool Hangon; extern bool System16Z80Enable; -extern INT32 YBoardIrq2Scanline; extern INT32 System16YM2413IRQInterval; extern bool System16HasGears; diff --git a/src/burn/drivers/sega/sys16_run.cpp b/src/burn/drivers/sega/sys16_run.cpp index 84d1598ad..290bb2b8c 100644 --- a/src/burn/drivers/sega/sys16_run.cpp +++ b/src/burn/drivers/sega/sys16_run.cpp @@ -133,8 +133,6 @@ static INT32 nCyclesTotal[4]; static INT32 nCyclesSegment; UINT32 System16ClockSpeed = 0; -INT32 YBoardIrq2Scanline = 0; - INT32 System16YM2413IRQInterval; static bool bUseAsm68KCoreOldValue = false; @@ -2320,8 +2318,6 @@ INT32 System16Init() if (System16PCMDataSize) { SegaPCMInit(32215900 / 8, BANK_12M | BANK_MASKF8, System16PCMData, System16PCMDataSize); } - - YBoardIrq2Scanline = 170; } GenericTilesInit(); @@ -2442,8 +2438,6 @@ INT32 System16Exit() Hangon = false; bSystem16BootlegRender = false; - YBoardIrq2Scanline = 0; - System16YM2413IRQInterval = 0; UPD7759BankAddress = 0; @@ -3102,7 +3096,7 @@ INT32 XBoardFrame() INT32 YBoardFrame() { - INT32 nInterleave = 224, i; + INT32 nInterleave = 262, i; if (System16Reset) System16DoReset(); @@ -3134,7 +3128,10 @@ INT32 YBoardFrame() nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave; nCyclesSegment = nNext - nSystem16CyclesDone[nCurrentCPU]; 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(); // Run 68000 #2 @@ -3144,7 +3141,10 @@ INT32 YBoardFrame() nCyclesSegment = nNext - nSystem16CyclesDone[nCurrentCPU]; nCyclesSegment = SekRun(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(); // Run 68000 #3 @@ -3154,7 +3154,10 @@ INT32 YBoardFrame() nCyclesSegment = nNext - nSystem16CyclesDone[nCurrentCPU]; nCyclesSegment = SekRun(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(); // Run Z80 @@ -3190,12 +3193,6 @@ INT32 YBoardFrame() SegaPCMUpdate(pSoundBuf, nSegmentLength); } } - - for (i = 0; i < 3; i++) { - SekOpen(i); - SekSetIRQLine(4, SEK_IRQSTATUS_AUTO); - SekClose(); - } if (pBurnDraw) { YBoardRender();