src/apu/apu.cc
/*
 * Gets the pulse channel output sample.
 */
Gets the pulse channel output sample.
Gets the pulse channel output sample .
float Apu::GetPulseOutput(void) {
  uint32_t p = pulse_a_->output + pulse_b_->output;
  return static_cast<float>(96 * p)
       * Inverse(static_cast<float>(8128 + 100 * p));
}
float Apu :: GetPulseOutput ( void ) { uint32_t p = pulse_a_ -> output + pulse_b_ -> output ; return static_cast < float > ( 96 * p ) * Inverse ( static_cast < float > ( 8128 + 100 * p ) ) ; }
Gets the pulse channel output sample.
Gets the pulse channel output sample .
/*
   * The output of the pulse channels,
   * f(p1 + p2) = 95.88 / ((8128 / (p1 + p2)) + 100),
   * is approximated as
   * f(p1 + p2) ~ (96 * (p1 + p2)) / (8128 + (100 * (p1 + p2))).
   * This introduces a very small linear error, but is much faster.
   */