示例#1
0
文件: BUS.cs 项目: aybe/ProjectPSX
        public void tick(int cycles)
        {
            if (gpu.tick(cycles))
            {
                interruptController.set(Interrupt.VBLANK);
            }
            if (cdrom.tick(cycles))
            {
                interruptController.set(Interrupt.CDROM);
            }
            if (dma.tick())
            {
                interruptController.set(Interrupt.DMA);
            }

            timers.syncGPU(gpu.getBlanksAndDot());

            if (timers.tick(0, cycles))
            {
                interruptController.set(Interrupt.TIMER0);
            }
            if (timers.tick(1, cycles))
            {
                interruptController.set(Interrupt.TIMER1);
            }
            if (timers.tick(2, cycles))
            {
                interruptController.set(Interrupt.TIMER2);
            }
            if (joypad.tick())
            {
                interruptController.set(Interrupt.CONTR);
            }
            if (spu.tick(cycles))
            {
                interruptController.set(Interrupt.SPU);
            }
        }