From 762494453fec0e60ed12e3b5a5c39143928f9002 Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Thu, 21 Apr 2022 10:52:26 -0300 Subject: [PATCH] chore: only sync to audio for now --- src/apu.zig | 2 +- src/main.zig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/apu.zig b/src/apu.zig index bb36b10..4db97bc 100644 --- a/src/apu.zig +++ b/src/apu.zig @@ -203,7 +203,7 @@ pub const Apu = struct { self.stream = SDL.SDL_NewAudioStream(SDL.AUDIO_F32, 2, @intCast(c_int, self.sampleRate()), SDL.AUDIO_F32, 2, host_sample_rate) orelse unreachable; } - // while (SDL.SDL_AudioStreamAvailable(self.stream) > (@sizeOf(f32) * 2 * 0x800)) {} + while (SDL.SDL_AudioStreamAvailable(self.stream) > (@sizeOf(f32) * 2 * 0x800)) {} _ = SDL.SDL_AudioStreamPut(self.stream, &[2]f32{ left, right }, 2 * @sizeOf(f32)); self.sched.push(.SampleAudio, self.sched.now() + self.sampleTicks() - late); diff --git a/src/main.zig b/src/main.zig index a6883d3..ee3a515 100644 --- a/src/main.zig +++ b/src/main.zig @@ -102,7 +102,7 @@ pub fn main() anyerror!void { var emu_rate = FpsAverage.init(); // Create Emulator Thread - const emu_thread = try Thread.spawn(.{}, emu.run, .{ .LimitedFPS, &quit, &emu_rate, &scheduler, &cpu }); + const emu_thread = try Thread.spawn(.{}, emu.run, .{ .UnlimitedFPS, &quit, &emu_rate, &scheduler, &cpu }); defer emu_thread.join(); var title_buf: [0x20]u8 = std.mem.zeroes([0x20]u8);