示例#1
0
        public void Cycle()
        {
            if (!timerRunning)
            {
                return;
            }
            tickCount--;
            if (tickCount > 0)
            {
                return;
            }
            tickCount = divider;
            if (!countExpired)
            {
                timer--;
                if (timer == 0xff)
                {
                    divider      = 1;
                    tickCount    = 1;
                    countExpired = true;
                    if (timerIrq)
                    {
                        switch (IrqMode)
                        {
                        case 'I': cpu.irq(); break;

                        case 'N': cpu.nmi(); break;

                        case 'R': cpu.Reset(); break;
                        }
                    }
                }
            }
            else
            {
                timer--;
                if (timer == 0x00)
                {
                    timerRunning = false;
                }
                else
                {
                    if (timerIrq)
                    {
                        switch (IrqMode)
                        {
                        case 'I': cpu.irq(); break;

                        case 'N': cpu.nmi(); break;

                        case 'R': cpu.Reset(); break;
                        }
                    }
                }
            }
        }
示例#2
0
 public void InstComplete()
 {
     if ((cpu.lastPc & 0x1c00) != 0x1c00 && SingleStep)
     {
         cpu.nmi();
     }
 }