src/cpu/cpu.cc
/*
 * Executes CPU cycles until either the given cycle limit has been reached
 * or the CPU must sync with the APU/PPU. Returns the number of cycles that
 * were executed. Fills the sync pointer with the number of cycles the CPU
 * should be synced to the APU/PPU.
 *
 * Assumes the CPU has been connected to a valid memory objected and at
 * least one cycle is in the state queue.
 */
Executes CPU cycles until either the given cycle limit has been reached
or the CPU must sync with the APU/PPU. Returns the number of cycles that
were executed. Fills the sync pointer with the number of cycles the CPU
should be synced to the APU/PPU.

Assumes the CPU has been connected to a valid memory objected and at
least one cycle is in the state queue.
Executes CPU cycles until either the given cycle limit has been reached or the CPU must sync with the APU / PPU . Returns the number of cycles that were executed . Fills the sync pointer with the number of cycles the CPU should be synced to the APU / PPU . Assumes the CPU has been connected to a valid memory objected and at least one cycle is in the state queue .
size_t Cpu::RunSchedule(size_t cycles, size_t &syncs) {
  size_t execs = 0;
  while (CheckNextCycle() && (execs < cycles)
                          && (dma_cycles_remaining_ == 0)) {
    RunCycle();
    execs++;
  }
  syncs = MAX(dma_cycles_remaining_, 1UL);
  return execs;
}
size_t Cpu :: RunSchedule ( size_t cycles , size_t & syncs ) { size_t execs = 0 ; while ( CheckNextCycle ( ) && ( execs < cycles ) && ( dma_cycles_remaining_ == 0 ) ) { RunCycle ( ) ; execs ++ ; } syncs = MAX ( dma_cycles_remaining_ , 1UL ) ; return execs ; }
Executes CPU cycles until either the given cycle limit has been reached
 or the CPU must sync with the APU/PPU.
Executes CPU cycles until either the given cycle limit has been reached or the CPU must sync with the APU / PPU .
// Execute the CPU until it must be synced. // The CPU must be synced for the duration of any DMA.