src/apu/apu.cc
/*
 * Updates the output of the noise channel.
 */
Updates the output of the noise channel.
Updates the output of the noise channel .
void Apu::UpdateNoise(void) {
  if ((noise_->length > 0) && !(noise_->shift & 0x01U)) {
    noise_->output = (noise_->control & FLAG_CONST_VOL)
                   ? noise_->control & VOLUME_MASK
                   : noise_->env_volume;
  } else {
    noise_->output = 0;
  }
  if (noise_->clock > 0) {
    noise_->clock--;
  } else {
    noise_->clock = noise_->timer;
    UpdateNoiseShift();
  }
  return;
}
void Apu :: UpdateNoise ( void ) { if ( ( noise_ -> length > 0 ) && ! ( noise_ -> shift & 0x01U ) ) { noise_ -> output = ( noise_ -> control & FLAG_CONST_VOL ) ? noise_ -> control & VOLUME_MASK : noise_ -> env_volume ; } else { noise_ -> output = 0 ; } if ( noise_ -> clock > 0 ) { noise_ -> clock -- ; } else { noise_ -> clock = noise_ -> timer ; UpdateNoiseShift ( ) ; } return ; }
Updates the output of the noise channel.
Updates the output of the noise channel .
// Determine what sound should be output this cycle. // Check if it is time to update the noise channel.