reset method

void reset()

Reset CPU

Re-initialize the processor as if a reset or power on had occurred.

Implementation

void reset() {
  // These registers are the ones that have predictable states
  //  immediately following a power-on or a reset.
  // The others are left alone, because their states are unpredictable.
  _sp = 0xdff0;
  _pc = 0x0000;
  _a = 0x00;
  _r = 0x00;
  _flagsReg = 0;
  // Start up with interrupts disabled.
  _interruptMode = 0;
  _iff1 = 0;
  _iff2 = 0;
  // Don't start halted or in a delayed DI or EI.
  _halted = false;
  _doDelayedDi = false;
  _doDelayedEi = false;
  // Obviously we've not used any cycles yet.
  _cycleCounter = 0;
}