src/apu/apu.cc
/*
 * Increments the frame cycle and step counters according to the mode of the
 * frame counter.
 */
Increments the frame cycle and step counters according to the mode of the
frame counter.
Increments the frame cycle and step counters according to the mode of the frame counter .
void Apu::IncFrame(void) {
  frame_clock_++;
  if (frame_clock_ > FRAME_STEP_LENGTH) {
    frame_clock_ = 0;
    frame_step_++;
    if ((frame_step_ >= 5) || ((frame_step_ >= 4)
                           && !(frame_control_ & FLAG_MODE))) {
      frame_step_ = 0;
    }
  }
  return;
}
void Apu :: IncFrame ( void ) { frame_clock_ ++ ; if ( frame_clock_ > FRAME_STEP_LENGTH ) { frame_clock_ = 0 ; frame_step_ ++ ; if ( ( frame_step_ >= 5 ) || ( ( frame_step_ >= 4 ) && ! ( frame_control_ & FLAG_MODE ) ) ) { frame_step_ = 0 ; } } return ; }
Increments the frame cycle and step counters according to the mode of the
 frame counter.
Increments the frame cycle and step counters according to the mode of the frame counter .
// Reset the clock if a step has been completed. // Reset the step if a frame has been completed for the given mode.