public void ResumeEmulation() { AudioHandler.Resume(); if (!string.IsNullOrEmpty(FileName)) { if (ROM?.Header == null) { byte[] data = File.ReadAllBytes(FileName); LoadRom(data); } ROM.LoadSRAM(); _isExecuting = true; while (_isExecuting) { RunFrame(false); Renderer.RenderBuffer(PPU.GetPixels()); APU.SetSamples(AudioHandler.SampleBufferL, AudioHandler.SampleBufferR); AudioHandler.NextBuffer(); FrameRendered?.Invoke(this, null); } } }