public void RunFrame() { while (ElapsedFrameCycles < CyclesPerFrame) { while (CpuCyclesForDot < CyclesPerDot) { CpuCyclesForDot += Cpu.Step(); } MemoryMap.FlushMmio(); Ppu.Tick(); MemoryMap.UpdateMmio(); CpuCyclesForDot -= CyclesPerDot; ElapsedFrameCycles += CyclesPerDot; } ElapsedFrameCycles -= CyclesPerFrame; }