src/cpu/cpu.cc
/*
 * Checks if the next memory operation is safe to perform while the CPU
 * is not synced with the PPU and APU.
 */
Checks if the next memory operation is safe to perform while the CPU
is not synced with the PPU and APU.
Checks if the next memory operation is safe to perform while the CPU is not synced with the PPU and APU .
bool Cpu::CheckNextCycle(void) {
  CpuOperation op = current_sequence_[inst_pointer_];
  CpuReg mem_addr = GET_MEM_ADDR(op);
  DoubleWord mem_offset = GET_MEM_OFST(op);
  MemoryOpcode mem_op = GET_MEM_OP(op);
  switch (mem_op) {
    case MEM_READ:
    case MEM_READZP:
      return memory_->CheckRead(READ_ADDR_REG(mem_addr, mem_offset));
    case MEM_WRITE:
      return memory_->CheckWrite(READ_ADDR_REG(mem_addr, 0));
    case MEM_FETCH:
    case MEM_BRANCH:
      return memory_->CheckRead(READ_ADDR_REG(REG_PCL, 0));
    default:
      return true;
  }
}
bool Cpu :: CheckNextCycle ( void ) { CpuOperation op = current_sequence_ [ inst_pointer_ ] ; CpuReg mem_addr = GET_MEM_ADDR ( op ) ; DoubleWord mem_offset = GET_MEM_OFST ( op ) ; MemoryOpcode mem_op = GET_MEM_OP ( op ) ; switch ( mem_op ) { case MEM_READ : case MEM_READZP : return memory_ -> CheckRead ( READ_ADDR_REG ( mem_addr , mem_offset ) ) ; case MEM_WRITE : return memory_ -> CheckWrite ( READ_ADDR_REG ( mem_addr , 0 ) ) ; case MEM_FETCH : case MEM_BRANCH : return memory_ -> CheckRead ( READ_ADDR_REG ( REG_PCL , 0 ) ) ; default : return true ; } }
Checks if the next memory operation is safe to perform while the CPU
 is not synced with the PPU and APU.
Checks if the next memory operation is safe to perform while the CPU is not synced with the PPU and APU .
// Decodes the information necessary to complete the memory operation. // Checks the operation encoded by memory.