src/apu/apu.cc
/*
 * Updates the length counter of each channel.
 */
Updates the length counter of each channel.
Updates the length counter of each channel .
void Apu::UpdateLength(void) {
  if ((pulse_a_->length > 0) && !(pulse_a_->control & FLAG_PULSE_HALT)) {
    pulse_a_->length--;
  }
  if ((pulse_b_->length > 0) && !(pulse_b_->control & FLAG_PULSE_HALT)) {
    pulse_b_->length--;
  }
  if ((triangle_->length > 0) && !(triangle_->control & FLAG_TRI_HALT)) {
    triangle_->length--;
  }
  if ((noise_->length > 0) && !(noise_->control & FLAG_NOISE_HALT)) {
    noise_->length--;
  }
  return;
}
void Apu :: UpdateLength ( void ) { if ( ( pulse_a_ -> length > 0 ) && ! ( pulse_a_ -> control & FLAG_PULSE_HALT ) ) { pulse_a_ -> length -- ; } if ( ( pulse_b_ -> length > 0 ) && ! ( pulse_b_ -> control & FLAG_PULSE_HALT ) ) { pulse_b_ -> length -- ; } if ( ( triangle_ -> length > 0 ) && ! ( triangle_ -> control & FLAG_TRI_HALT ) ) { triangle_ -> length -- ; } if ( ( noise_ -> length > 0 ) && ! ( noise_ -> control & FLAG_NOISE_HALT ) ) { noise_ -> length -- ; } return ; }
Updates the length counter of each channel.
Updates the length counter of each channel .
// Decrement pulse A length counter. // Decrement pulse B length counter. // Decrement triangle length counter. // Decrement noise length counter.