Allow volumes to be a lot higher and check that clipping is handled

This commit is contained in:
Gwilym Kuiper 2022-05-04 20:42:32 +01:00
parent abfbf6a454
commit 4a06acba6b
2 changed files with 2 additions and 1 deletions

View file

@ -42,6 +42,8 @@ fn main(mut gba: Gba) -> ! {
if input.is_pressed(Button::L) {
channel.volume(half);
} else if input.is_pressed(Button::R) {
channel.volume(20.into()); // intentionally introduce clipping
} else {
channel.volume(1.into());
}

View file

@ -96,7 +96,6 @@ impl SoundChannel {
#[inline(always)]
pub fn volume(&mut self, volume: Num<i16, 4>) -> &mut Self {
assert!(volume <= Num::new(1), "volume must be <= 1");
assert!(volume >= Num::new(0), "volume must be >= 0");
self.volume = volume;