chore: only sync to audio for now
This commit is contained in:
parent
e3553bcbd6
commit
762494453f
|
@ -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;
|
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));
|
_ = SDL.SDL_AudioStreamPut(self.stream, &[2]f32{ left, right }, 2 * @sizeOf(f32));
|
||||||
self.sched.push(.SampleAudio, self.sched.now() + self.sampleTicks() - late);
|
self.sched.push(.SampleAudio, self.sched.now() + self.sampleTicks() - late);
|
||||||
|
|
|
@ -102,7 +102,7 @@ pub fn main() anyerror!void {
|
||||||
var emu_rate = FpsAverage.init();
|
var emu_rate = FpsAverage.init();
|
||||||
|
|
||||||
// Create Emulator Thread
|
// 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();
|
defer emu_thread.join();
|
||||||
|
|
||||||
var title_buf: [0x20]u8 = std.mem.zeroes([0x20]u8);
|
var title_buf: [0x20]u8 = std.mem.zeroes([0x20]u8);
|
||||||
|
|
Loading…
Reference in New Issue