//reset the computer public void resetComputer(int i) { Loader.Log("Computer: Resetting Computer", false, false); RAM = new Memory(size, null); Registers = new Memory(0, null); TraceStep = 1; if (File.Exists("trace.log") && trace) { sw.Close(); File.Delete("trace.log"); sw = new StreamWriter("trace.log"); } if (cpu != null) { var x = cpu.getBreak(); cpu = new CPU(ref RAM, ref Registers); foreach (var y in x) { cpu.addBreak(y.Key); } } else { cpu = new CPU(ref RAM, ref Registers); } //interrupt = false; Registers.setRegister(13, 0x7000); }
//resets the computer model when the computer resets public int resetComputer() { dontrun = false; Loader.Log("Computer: Resetting Computer", false, false); RAM = new Memory(size, null); Registers = new Memory(0, null); TraceStep = 1; if (File.Exists("trace.log") && trace) { sw.Close(); File.Delete("trace.log"); sw = new StreamWriter("trace.log"); } //load file Loader.Read(fileName, RAM, false, false, Registers); if (cpu != null) { var x = cpu.getBreak(); cpu = new CPU(ref RAM, ref Registers); foreach (var y in x) { cpu.addBreak(y.Key); } } else { cpu = new CPU(ref RAM, ref Registers); } //interrupt = false; // Registers.setRegister(13, 0x7000); return(RAM.Checksum()); }