This commit is contained in:
Theron Spiegl 2020-01-01 21:20:47 -06:00
parent bcbf0d3acb
commit 0ea8ac6471
1 changed files with 3 additions and 8 deletions

View File

@ -82,7 +82,8 @@ impl Square {
self.sample = if self.duty_cycle[self.duty_counter] == 0 // the sequencer output is zero, or
|| self.timer_period > 0x7FF // overflow from the sweep unit's adder is silencing the channel,
|| self.length_counter == 0 // the length counter is zero, or
|| self.timer_period < 8 { // the timer has a value less than eight.
|| self.timer_period < 8 // the timer has a value less than eight.
{
0
} else if self.constant_volume_flag {
self.envelope
@ -172,13 +173,7 @@ impl Square {
self.duty_cycle = DUTY_CYCLE_SEQUENCES[(value >> 6) as usize];
self.length_counter_halt = value & (1<<5) != 0;
self.constant_volume_flag = value & (1<<4) != 0;
// println!("using envelope volume: {}", !self.constant_volume_flag);
self.envelope = value as u16 & 0b1111;
// if self.constant_volume_flag {
// value as u16 & 0b1111
// } else {
// self.decay_counter
// };
}
// $4001/$4005