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

+5 -2
View File
@@ -3,9 +3,9 @@ SYMON - A 6502 System Simulator
**NOTE: THIS SOFTWARE IS UNDER ACTIVE DEVELOPMENT. Feedback is welcome!** **NOTE: THIS SOFTWARE IS UNDER ACTIVE DEVELOPMENT. Feedback is welcome!**
**Version:** 0.9.9.0 **Version:** 0.9.9.1
**Last Updated:** 26 July, 2014 **Last Updated:** 27 July, 2014
Copyright (c) 2014 Seth J. Morabito <web@loomcom.com> Copyright (c) 2014 Seth J. Morabito <web@loomcom.com>
@@ -217,6 +217,9 @@ running.
## 5.0 Revision History ## 5.0 Revision History
- **0.9.9.1:** 27 July, 2014 - Pressing 'Control' while clicking
'Reset' now performs a memory clear.
- **0.9.9:** 26 July, 2014 - MULTICOMP and multi-machine support - **0.9.9:** 26 July, 2014 - MULTICOMP and multi-machine support
contributed by Maik Marten <maikmarten@googlemail.com> contributed by Maik Marten <maikmarten@googlemail.com>
+1 -1
View File
@@ -4,7 +4,7 @@
<groupId>com.loomcom.symon</groupId> <groupId>com.loomcom.symon</groupId>
<artifactId>symon</artifactId> <artifactId>symon</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
<version>0.9.9.0</version> <version>0.9.9.1</version>
<name>symon</name> <name>symon</name>
<url>http://www.loomcom.com/symon</url> <url>http://www.loomcom.com/symon</url>
<properties> <properties>
@@ -209,7 +209,8 @@ public class Simulator {
resetButton.addActionListener(new ActionListener() { resetButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent actionEvent) { 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 { try {
logger.log(Level.INFO, "Reset requested. Resetting CPU."); logger.log(Level.INFO, "Reset requested. Resetting CPU.");
// Reset and clear memory // Reset CPU
machine.getCpu().reset(); machine.getCpu().reset();
// Clear the console. // Clear the console.
console.reset(); console.reset();
// Reset the trace log. // Reset the trace log.
traceLog.reset(); traceLog.reset();
// If we're doing a cold reset, clear the memory. // 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. // Update status.
SwingUtilities.invokeLater(new Runnable() { SwingUtilities.invokeLater(new Runnable() {
public void run() { public void run() {