Ejemplo n.º 1
0
        public void FrameAdvance(bool render, bool renderSound)
        {
            Cpu.Debug = Tracer.Enabled;
            Frame++;
            _isLag = true;
            PSG.BeginFrame(Cpu.TotalExecutedCycles);

            if (Cpu.Debug && Cpu.Logger == null)             // TODO, lets not do this on each frame. But lets refactor CoreComm/CoreComm first
            {
                Cpu.Logger = (s) => Tracer.Put(s);
            }

            byte tempRet1 = ControllerDeck.ReadPort1(Controller, true, true);
            byte tempRet2 = ControllerDeck.ReadPort2(Controller, true, true);

            bool intPending = (!tempRet1.Bit(4)) | (!tempRet2.Bit(4));

            VDP.ExecuteFrame(intPending);

            PSG.EndFrame(Cpu.TotalExecutedCycles);

            if (_isLag)
            {
                _lagCount++;
            }
        }