Beispiel #1
0
        private static void ExecCpuTests(string testName, int frameCount)
        {
            var cpu = new CpuUnit();

            cpu.regs.PC   = 0;
            cpu.RESET     = () => { };
            cpu.NMIACK_M1 = () => { };
            cpu.INTACK_M1 = () => { };
            cpu.RDMEM_M1  = addr => (byte)addr;
            cpu.RDMEM     = addr => (byte)addr;
            cpu.WRMEM     = (addr, value) => { };
            cpu.RDPORT    = addr => 0xFF;
            cpu.WRPORT    = (addr, value) => { };
            cpu.RDNOMREQ  = addr => { };
            cpu.WRNOMREQ  = addr => { };

            Stopwatch watch = new Stopwatch();

            watch.Start();
            for (var cycle = 0L; cycle < 71980 * frameCount; cycle++)
            {
                cpu.ExecCycle();
            }
            watch.Stop();
            Console.WriteLine("{0} [cpu]:\t{1} [ms]", testName, watch.ElapsedMilliseconds);
        }
Beispiel #2
0
        public void ExecCycle()
        {
            int frameTact = GetFrameTact();

            if (frameTact < m_lastFrameTact)
            {
                OnEndFrame();
                OnBeginFrame();
            }
            m_lastFrameTact = frameTact;

            m_cpu.INT = m_rzx.IsPlayback ?
                        m_rzx.CheckInt(frameTact) :
                        m_ula.CheckInt(frameTact);
            m_eventManager.PreCycle();
            m_cpu.ExecCycle();
        }