We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b5d890a commit fb798c8Copy full SHA for fb798c8
core/src/gameboy/sound_controller.rs
@@ -406,8 +406,7 @@ impl SoundController {
406
u64::MAX
407
} else {
408
let fs = self.sample_frequency;
409
- let next_sample = clock + (((CLOCK_SPEED - self.sample_mod) + fs - 1) / fs);
410
- // round up
+ let next_sample = clock + (CLOCK_SPEED - self.sample_mod).div_ceil(fs);
411
next_sample + (next_sample % 2 != 0) as u64
412
};
413
debug_assert!(clock < next_step);
0 commit comments