Beispiel #1
0
        void RunZ80(int cycles)
        {
            // I emulate the YM2612 synced to Z80 clock, for better or worse.
            // So we still need to keep the Z80 cycle count accurate even if the Z80 isn't running.

            if (Z80Runnable)
            {
                SoundCPU.ExecuteCycles(cycles);
            }
            else
            {
                SoundCPU.TotalExecutedCycles += cycles;
            }
        }
Beispiel #2
0
        public void ExecFrame(bool render)
        {
            int scanlinesPerFrame = DisplayType == DisplayType.NTSC ? 262 : 313;

            SpriteLimit = Sms.Settings.SpriteLimit;
            for (ScanLine = 0; ScanLine < scanlinesPerFrame; ScanLine++)
            {
                RenderCurrentScanline(render);

                ProcessFrameInterrupt();
                ProcessLineInterrupt();

                Cpu.ExecuteCycles(IPeriod);

                if (ScanLine == scanlinesPerFrame - 1)
                {
                    ProcessGGScreen();
                }
            }
        }
Beispiel #3
0
        public void FrameAdvance(bool render, bool rendersound)
        {
            lagged = true;
            //I eyeballed this speed
            for (int i = 0; i < 5; i++)
            {
                onPressed = Controller.IsPressed("ON");
                //and this was derived from other emus
                cpu.ExecuteCycles(10000);
                cpu.Interrupt = true;
            }

            Frame++;
            if (lagged)
            {
                lagCount++;
                isLag = true;
            }
            else
            {
                isLag = false;
            }
        }