feat(snd): synchronize audio with rest of system
In it's current form I think this is actually rather inefficient. It's also not very accurate since I throw away a lot of samples for no real good reason. More improvements to thiss will be coming henceforth
This commit is contained in:
@@ -125,9 +125,14 @@ impl Cpu {
|
||||
}
|
||||
};
|
||||
|
||||
let pending: u32 = cycles.into();
|
||||
let mut pending: u32 = cycles.into();
|
||||
for _ in 0..pending {
|
||||
self.bus.clock();
|
||||
if !self.bus.is_audio_full() {
|
||||
self.bus.clock();
|
||||
} else {
|
||||
self.bus.flush_audio();
|
||||
pending += 1;
|
||||
}
|
||||
}
|
||||
|
||||
self.handle_interrupts();
|
||||
|
Reference in New Issue
Block a user