mirror of
https://github.com/italicsjenga/agb.git
synced 2025-02-02 12:36:35 +11:00
Allow volumes to be a lot higher and check that clipping is handled
This commit is contained in:
parent
abfbf6a454
commit
4a06acba6b
2 changed files with 2 additions and 1 deletions
|
@ -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());
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue