Core/burn/drv/capcom/cps_run.cpp
// Execute a beam-synchronised interrupt and schedule the next one
Execute a beam-synchronised interrupt and schedule the next one
Execute a beam - synchronised interrupt and schedule the next one
static void DoIRQ()
{
	if (nIrqLine >= nFirstLine) {
		nInterrupt++;
		nRasterline[nInterrupt] = nIrqLine - nFirstLine;
	}
	SekSetIRQLine(4, SEK_IRQSTATUS_AUTO);
	SekRun(nCpsCycles * 0x01 / nCpsNumScanlines);
	if (nRasterline[nInterrupt] < 224) {
		CopyCpsReg(nInterrupt);
		CopyCpsFrg(nInterrupt);
	} else {
		nRasterline[nInterrupt] = 0;
	}
	if (!bEnableAutoIrq50) {
		if (nIrqLine >= nIrqLine50) {
			nIrqLine50 = nCpsNumScanlines;
		}
	} else {
		if (bEnableAutoIrq50 && nIrqLine == nIrqLine50) {
			nIrqLine50 += 32;
		}
	}
	if (!bEnableAutoIrq52 && nIrqLine >= nIrqLine52) {
		nIrqLine52 = nCpsNumScanlines;
	} else {
		if (bEnableAutoIrq52 && nIrqLine == nIrqLine52) {
			nIrqLine52 += 32;
		}
	}
	ScheduleIRQ();
	if (nIrqCycles < SekTotalCycles()) {
		nIrqCycles = SekTotalCycles() + 1;
	}
	return;
}
static void DoIRQ ( ) { if ( nIrqLine >= nFirstLine ) { nInterrupt ++ ; nRasterline [ nInterrupt ] = nIrqLine - nFirstLine ; } SekSetIRQLine ( 4 , SEK_IRQSTATUS_AUTO ) ; SekRun ( nCpsCycles * 0x01 / nCpsNumScanlines ) ; if ( nRasterline [ nInterrupt ] < 224 ) { CopyCpsReg ( nInterrupt ) ; CopyCpsFrg ( nInterrupt ) ; } else { nRasterline [ nInterrupt ] = 0 ; } if ( ! bEnableAutoIrq50 ) { if ( nIrqLine >= nIrqLine50 ) { nIrqLine50 = nCpsNumScanlines ; } } else { if ( bEnableAutoIrq50 && nIrqLine == nIrqLine50 ) { nIrqLine50 += 32 ; } } if ( ! bEnableAutoIrq52 && nIrqLine >= nIrqLine52 ) { nIrqLine52 = nCpsNumScanlines ; } else { if ( bEnableAutoIrq52 && nIrqLine == nIrqLine52 ) { nIrqLine52 += 32 ; } } ScheduleIRQ ( ) ; if ( nIrqCycles < SekTotalCycles ( ) ) { nIrqCycles = SekTotalCycles ( ) + 1 ; } return ; }
Execute a beam-synchronised interrupt and schedule the next one
Execute a beam - synchronised interrupt and schedule the next one
// 0x4E - bit 9 = 1: Beam Synchronized interrupts disabled // 0x50 - Beam synchronized interrupt #1 occurs at raster line. // 0x52 - Beam synchronized interrupt #2 occurs at raster line. // Trigger IRQ and copy registers. // Schedule next interrupt