/** Resets the CPU to it's power on state. Memory contents are not cleared. */ public void reset() { checkEnableGbc(); setDoubleSpeedCpu(false); graphicsChip.dispose(); cartridge.reset(); interruptsEnabled = false; ieDelay = -1; pc = 0x0100; sp = 0xFFFE; f = 0xB0; gbcRamBank = 1; instrCount = 0; if (gbcFeatures) { registers[a] = 0x11; } else { registers[a] = 0x01; } for (int r = 0; r < 0x8000; r++) { mainRam[r] = 0; } setBC(0x0013); setDE(0x00D8); setHL(0x014D); JavaBoy.debugLog("CPU reset"); ioHandler.reset(); }
/** Clear up memory */ public void dispose() { graphicsChip.dispose(); }