Clear memory on Control+Reset

This commit is contained in:
Seth Morabito committed 2014-07-27 13:41:44 -07:00
1 parent b1e1e75555
commit 4bfc196b49
3 files changed
+15 -6

No files matched your search

@@ -209,7 +209,8 @@ public class Simulator {
resetButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent actionEvent) {
handleReset(false);
// If this was a CTRL-click, do a hard reset.
handleReset((actionEvent.getModifiers() & ActionEvent.CTRL_MASK) != 0);
}
});
@@ -277,14 +278,19 @@ public class Simulator {
try {
logger.log(Level.INFO, "Reset requested. Resetting CPU.");
// Reset and clear memory
// Reset CPU
machine.getCpu().reset();
// Clear the console.
console.reset();
// Reset the trace log.
traceLog.reset();
// If we're doing a cold reset, clear the memory.
// TODO: Clear memory
if (isColdReset) {
Memory mem = machine.getRam();
if (mem != null) {
mem.fill(0);
}
}
// Update status.
SwingUtilities.invokeLater(new Runnable() {
public void run() {