mirror of
https://codeberg.org/sethm/symon.git
synced 2026-11-08 03:12:23 +00:00
Compare commits
3
Commits
v1.2.0
..
1.2.branch
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0e49b197b3 | ||
|
|
eff98118d5 | ||
|
|
66c52c8826 |
No files matched your search
@@ -1,9 +1,9 @@
|
|||||||
SYMON - A 6502 System Simulator
|
SYMON - A 6502 System Simulator
|
||||||
===============================
|
===============================
|
||||||
|
|
||||||
**Version:** 1.2.0
|
**Version:** 1.2.1
|
||||||
|
|
||||||
**Last Updated:** 3 January, 2016
|
**Last Updated:** 8 January, 2016
|
||||||
|
|
||||||
See the file COPYING for license.
|
See the file COPYING for license.
|
||||||
|
|
||||||
@@ -235,6 +235,9 @@ running.
|
|||||||
|
|
||||||
## 5.0 Revision History
|
## 5.0 Revision History
|
||||||
|
|
||||||
|
- **1.2.1:** 8 January, 2016 - Remove dependency on Java 8. Now
|
||||||
|
supports compiling and running under Java 1.7.
|
||||||
|
|
||||||
- **1.2.0:** 3 January, 2016 - Add symbolic disassembly to breakpoints
|
- **1.2.0:** 3 January, 2016 - Add symbolic disassembly to breakpoints
|
||||||
window.
|
window.
|
||||||
|
|
||||||
|
|||||||
@@ -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>1.2.0</version>
|
<version>1.2.1</version>
|
||||||
<name>symon</name>
|
<name>symon</name>
|
||||||
<url>http://www.loomcom.com/symon</url>
|
<url>http://www.loomcom.com/symon</url>
|
||||||
<properties>
|
<properties>
|
||||||
@@ -91,8 +91,8 @@
|
|||||||
<version>3.1</version>
|
<version>3.1</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<compilerArgument>-Xlint:unchecked</compilerArgument>
|
<compilerArgument>-Xlint:unchecked</compilerArgument>
|
||||||
<source>1.8</source>
|
<source>1.7</source>
|
||||||
<target>1.8</target>
|
<target>1.7</target>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ import java.util.Map;
|
|||||||
|
|
||||||
import java.util.SortedSet;
|
import java.util.SortedSet;
|
||||||
import java.util.TreeSet;
|
import java.util.TreeSet;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Bus ties the whole thing together, man.
|
* The Bus ties the whole thing together, man.
|
||||||
@@ -222,9 +221,11 @@ public class Bus {
|
|||||||
List<Integer> priorities = new ArrayList<>(deviceMap.keySet());
|
List<Integer> priorities = new ArrayList<>(deviceMap.keySet());
|
||||||
Collections.sort(priorities);
|
Collections.sort(priorities);
|
||||||
|
|
||||||
for(int priority : priorities) {
|
for (int priority : priorities) {
|
||||||
SortedSet<Device> deviceSet = deviceMap.get(priority);
|
SortedSet<Device> deviceSet = deviceMap.get(priority);
|
||||||
devices.addAll(deviceSet.stream().collect(Collectors.toList()));
|
for (Device device : deviceSet) {
|
||||||
|
devices.add(device);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return devices;
|
return devices;
|
||||||
|
|||||||
@@ -86,7 +86,9 @@ public class Main {
|
|||||||
|
|
||||||
final Simulator simulator = new Simulator(machineClass);
|
final Simulator simulator = new Simulator(machineClass);
|
||||||
|
|
||||||
SwingUtilities.invokeLater(() -> {
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
try {
|
try {
|
||||||
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
||||||
// Create the main UI window
|
// Create the main UI window
|
||||||
@@ -94,6 +96,7 @@ public class Main {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -185,7 +185,9 @@ public class Simulator {
|
|||||||
JButton hardResetButton = new JButton("Hard Reset");
|
JButton hardResetButton = new JButton("Hard Reset");
|
||||||
|
|
||||||
stepCountBox = new JComboBox<>(STEPS);
|
stepCountBox = new JComboBox<>(STEPS);
|
||||||
stepCountBox.addActionListener(actionEvent -> {
|
stepCountBox.addActionListener(new ActionListener() {
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent actionEvent) {
|
||||||
try {
|
try {
|
||||||
JComboBox cb = (JComboBox) actionEvent.getSource();
|
JComboBox cb = (JComboBox) actionEvent.getSource();
|
||||||
stepsPerClick = Integer.parseInt((String) cb.getSelectedItem());
|
stepsPerClick = Integer.parseInt((String) cb.getSelectedItem());
|
||||||
@@ -193,6 +195,7 @@ public class Simulator {
|
|||||||
stepsPerClick = 1;
|
stepsPerClick = 1;
|
||||||
stepCountBox.setSelectedIndex(0);
|
stepCountBox.setSelectedIndex(0);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
buttonContainer.add(runStopButton);
|
buttonContainer.add(runStopButton);
|
||||||
@@ -211,24 +214,38 @@ public class Simulator {
|
|||||||
// Bottom - buttons.
|
// Bottom - buttons.
|
||||||
mainWindow.getContentPane().add(buttonContainer, BorderLayout.PAGE_END);
|
mainWindow.getContentPane().add(buttonContainer, BorderLayout.PAGE_END);
|
||||||
|
|
||||||
runStopButton.addActionListener(actionEvent -> {
|
runStopButton.addActionListener(new ActionListener() {
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent actionEvent) {
|
||||||
if (runLoop != null && runLoop.isRunning()) {
|
if (runLoop != null && runLoop.isRunning()) {
|
||||||
handleStop();
|
Simulator.this.handleStop();
|
||||||
} else {
|
} else {
|
||||||
handleStart();
|
Simulator.this.handleStart();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
stepButton.addActionListener(actionEvent -> handleStep(stepsPerClick));
|
stepButton.addActionListener(new ActionListener() {
|
||||||
|
@Override
|
||||||
softResetButton.addActionListener(actionEvent -> {
|
public void actionPerformed(ActionEvent actionEvent) {
|
||||||
// If this was a CTRL-click, do a hard reset.
|
Simulator.this.handleStep(stepsPerClick);
|
||||||
handleReset(false);
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
hardResetButton.addActionListener(actionEvent -> {
|
softResetButton.addActionListener(new ActionListener() {
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent actionEvent) {
|
||||||
// If this was a CTRL-click, do a hard reset.
|
// If this was a CTRL-click, do a hard reset.
|
||||||
handleReset(true);
|
Simulator.this.handleReset(false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
hardResetButton.addActionListener(new ActionListener() {
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent actionEvent) {
|
||||||
|
// If this was a CTRL-click, do a hard reset.
|
||||||
|
Simulator.this.handleReset(true);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
mainWindow.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
|
mainWindow.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
|
||||||
@@ -400,13 +417,16 @@ public class Simulator {
|
|||||||
logger.debug("Starting main run loop.");
|
logger.debug("Starting main run loop.");
|
||||||
isRunning = true;
|
isRunning = true;
|
||||||
|
|
||||||
SwingUtilities.invokeLater(() -> {
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
// Don't allow step while the simulator is running
|
// Don't allow step while the simulator is running
|
||||||
stepButton.setEnabled(false);
|
stepButton.setEnabled(false);
|
||||||
stepCountBox.setEnabled(false);
|
stepCountBox.setEnabled(false);
|
||||||
menuBar.simulatorDidStart();
|
menuBar.simulatorDidStart();
|
||||||
// Toggle the state of the run button
|
// Toggle the state of the run button
|
||||||
runStopButton.setText("Stop");
|
runStopButton.setText("Stop");
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -417,7 +437,9 @@ public class Simulator {
|
|||||||
logger.error("Exception in main simulator run thread. Exiting run.", ex);
|
logger.error("Exception in main simulator run thread. Exiting run.", ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
SwingUtilities.invokeLater(() -> {
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
statusPane.updateState();
|
statusPane.updateState();
|
||||||
memoryWindow.updateState();
|
memoryWindow.updateState();
|
||||||
runStopButton.setText("Run");
|
runStopButton.setText("Run");
|
||||||
@@ -428,6 +450,7 @@ public class Simulator {
|
|||||||
}
|
}
|
||||||
menuBar.simulatorDidStop();
|
menuBar.simulatorDidStop();
|
||||||
traceLog.simulatorDidStop();
|
traceLog.simulatorDidStop();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
isRunning = false;
|
isRunning = false;
|
||||||
@@ -480,9 +503,12 @@ public class Simulator {
|
|||||||
// Now load the program at the starting address.
|
// Now load the program at the starting address.
|
||||||
loadProgram(program, preferences.getProgramStartAddress());
|
loadProgram(program, preferences.getProgramStartAddress());
|
||||||
|
|
||||||
SwingUtilities.invokeLater(() -> {
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
console.reset();
|
console.reset();
|
||||||
breakpoints.refresh();
|
breakpoints.refresh();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO: "Don't Show Again" checkbox
|
// TODO: "Don't Show Again" checkbox
|
||||||
@@ -623,9 +649,12 @@ public class Simulator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void actionPerformed(ActionEvent actionEvent) {
|
public void actionPerformed(ActionEvent actionEvent) {
|
||||||
SwingUtilities.invokeLater(() -> {
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
console.setFont(new Font("Monospaced", Font.PLAIN, size));
|
console.setFont(new Font("Monospaced", Font.PLAIN, size));
|
||||||
mainWindow.pack();
|
mainWindow.pack();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -889,13 +918,16 @@ public class Simulator {
|
|||||||
|
|
||||||
private void updateVisibleState() {
|
private void updateVisibleState() {
|
||||||
// Immediately update the UI.
|
// Immediately update the UI.
|
||||||
SwingUtilities.invokeLater(() -> {
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
// Now update the state
|
// Now update the state
|
||||||
statusPane.updateState();
|
statusPane.updateState();
|
||||||
memoryWindow.updateState();
|
memoryWindow.updateState();
|
||||||
if (traceLog.shouldUpdate()) {
|
if (traceLog.shouldUpdate()) {
|
||||||
traceLog.refresh();
|
traceLog.refresh();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -115,7 +115,9 @@ public abstract class Device implements Comparable<Device> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void notifyListeners() {
|
public void notifyListeners() {
|
||||||
deviceChangeListeners.forEach(DeviceChangeListener::deviceStateChanged);
|
for (DeviceChangeListener listener : deviceChangeListeners) {
|
||||||
|
listener.deviceStateChanged();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ package com.loomcom.symon.devices;
|
|||||||
|
|
||||||
import com.loomcom.symon.exceptions.MemoryAccessException;
|
import com.loomcom.symon.exceptions.MemoryAccessException;
|
||||||
import com.loomcom.symon.exceptions.MemoryRangeException;
|
import com.loomcom.symon.exceptions.MemoryRangeException;
|
||||||
import jdk.nashorn.internal.ir.annotations.Ignore;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
|
|||||||
@@ -30,7 +30,10 @@ import org.slf4j.LoggerFactory;
|
|||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.border.EmptyBorder;
|
import javax.swing.border.EmptyBorder;
|
||||||
|
import javax.swing.event.ListSelectionEvent;
|
||||||
|
import javax.swing.event.ListSelectionListener;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -62,22 +65,25 @@ public class BreakpointsWindow extends JFrame {
|
|||||||
breakpointsPanel.setLayout(new BorderLayout());
|
breakpointsPanel.setLayout(new BorderLayout());
|
||||||
breakpointsPanel.setBorder(new EmptyBorder(10, 10, 10, 10));
|
breakpointsPanel.setBorder(new EmptyBorder(10, 10, 10, 10));
|
||||||
|
|
||||||
JButton addButton = new JButton("Add");
|
final JButton addButton = new JButton("Add");
|
||||||
JButton removeButton = new JButton("Del");
|
final JButton removeButton = new JButton("Del");
|
||||||
removeButton.setEnabled(false);
|
removeButton.setEnabled(false);
|
||||||
|
|
||||||
JTextField addTextField = new JTextField(4);
|
final JTextField addTextField = new JTextField(4);
|
||||||
|
|
||||||
JTable breakpointsTable = new JTable(breakpoints);
|
final JTable breakpointsTable = new JTable(breakpoints);
|
||||||
breakpointsTable.setShowGrid(true);
|
breakpointsTable.setShowGrid(true);
|
||||||
breakpointsTable.setGridColor(Color.LIGHT_GRAY);
|
breakpointsTable.setGridColor(Color.LIGHT_GRAY);
|
||||||
breakpointsTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
breakpointsTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
||||||
breakpointsTable.getSelectionModel().addListSelectionListener(e -> {
|
breakpointsTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
|
||||||
|
@Override
|
||||||
|
public void valueChanged(ListSelectionEvent e) {
|
||||||
if (e.getFirstIndex() > -1) {
|
if (e.getFirstIndex() > -1) {
|
||||||
removeButton.setEnabled(true);
|
removeButton.setEnabled(true);
|
||||||
} else {
|
} else {
|
||||||
removeButton.setEnabled(false);
|
removeButton.setEnabled(false);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
JScrollPane scrollPane = new JScrollPane(breakpointsTable);
|
JScrollPane scrollPane = new JScrollPane(breakpointsTable);
|
||||||
@@ -86,8 +92,10 @@ public class BreakpointsWindow extends JFrame {
|
|||||||
|
|
||||||
breakpointsPanel.add(scrollPane, BorderLayout.CENTER);
|
breakpointsPanel.add(scrollPane, BorderLayout.CENTER);
|
||||||
|
|
||||||
ActionListener addBreakpointListener = e -> {
|
ActionListener addBreakpointListener = new ActionListener() {
|
||||||
int value = -1;
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
int value;
|
||||||
|
|
||||||
String newBreakpoint = addTextField.getText();
|
String newBreakpoint = addTextField.getText();
|
||||||
|
|
||||||
@@ -111,12 +119,18 @@ public class BreakpointsWindow extends JFrame {
|
|||||||
logger.debug("Added breakpoint ${}", Utils.wordToHex(value));
|
logger.debug("Added breakpoint ${}", Utils.wordToHex(value));
|
||||||
|
|
||||||
addTextField.setText(EMPTY_STRING);
|
addTextField.setText(EMPTY_STRING);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
addButton.addActionListener(addBreakpointListener);
|
addButton.addActionListener(addBreakpointListener);
|
||||||
addTextField.addActionListener(addBreakpointListener);
|
addTextField.addActionListener(addBreakpointListener);
|
||||||
|
|
||||||
removeButton.addActionListener(e -> breakpoints.removeBreakpointAtIndex(breakpointsTable.getSelectedRow()));
|
removeButton.addActionListener(new ActionListener() {
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
breakpoints.removeBreakpointAtIndex(breakpointsTable.getSelectedRow());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
controlPanel.add(addTextField);
|
controlPanel.add(addTextField);
|
||||||
controlPanel.add(addButton);
|
controlPanel.add(addButton);
|
||||||
|
|||||||
@@ -97,19 +97,25 @@ public class PreferencesDialog extends Observable implements Preferences {
|
|||||||
JButton applyButton = new JButton("Apply");
|
JButton applyButton = new JButton("Apply");
|
||||||
JButton cancelButton = new JButton("Cancel");
|
JButton cancelButton = new JButton("Cancel");
|
||||||
|
|
||||||
cancelButton.addActionListener(actionEvent -> {
|
cancelButton.addActionListener(new ActionListener() {
|
||||||
updateUi();
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent actionEvent) {
|
||||||
|
PreferencesDialog.this.updateUi();
|
||||||
dialog.setVisible(false);
|
dialog.setVisible(false);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
applyButton.addActionListener(actionEvent -> {
|
applyButton.addActionListener(new ActionListener() {
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent actionEvent) {
|
||||||
haltOnBreak = haltOnBreakCheckBox.isSelected();
|
haltOnBreak = haltOnBreakCheckBox.isSelected();
|
||||||
programLoadAddress = hexToInt(programLoadAddressField.getText());
|
programLoadAddress = PreferencesDialog.this.hexToInt(programLoadAddressField.getText());
|
||||||
updateUi();
|
PreferencesDialog.this.updateUi();
|
||||||
// TODO: Actually check to see if values have changed, don't assume.
|
// TODO: Actually check to see if values have changed, don't assume.
|
||||||
setChanged();
|
PreferencesDialog.this.setChanged();
|
||||||
PreferencesDialog.this.notifyObservers();
|
PreferencesDialog.this.notifyObservers();
|
||||||
dialog.setVisible(false);
|
dialog.setVisible(false);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
buttonsContainer.add(applyButton);
|
buttonsContainer.add(applyButton);
|
||||||
|
|||||||
@@ -31,6 +31,8 @@ import javax.swing.*;
|
|||||||
import javax.swing.border.Border;
|
import javax.swing.border.Border;
|
||||||
import javax.swing.border.EtchedBorder;
|
import javax.swing.border.EtchedBorder;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* UI component that displays the current state of the simulated CPU.
|
* UI component that displays the current state of the simulated CPU.
|
||||||
@@ -162,59 +164,74 @@ public class StatusPanel extends JPanel {
|
|||||||
yField = makeTextField(SMALL_TEXT_FIELD_SIZE, true);
|
yField = makeTextField(SMALL_TEXT_FIELD_SIZE, true);
|
||||||
|
|
||||||
// Make fields editable
|
// Make fields editable
|
||||||
pcField.addActionListener(e -> {
|
pcField.addActionListener(new ActionListener() {
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
try {
|
try {
|
||||||
int newVal = getHexVal(pcField) & 0xffff;
|
int newVal = StatusPanel.this.getHexVal(pcField) & 0xffff;
|
||||||
machine.getCpu().setProgramCounter(newVal);
|
machine.getCpu().setProgramCounter(newVal);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
// Swallow exception
|
// Swallow exception
|
||||||
}
|
}
|
||||||
|
|
||||||
updateState();
|
StatusPanel.this.updateState();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
spField.addActionListener(e -> {
|
spField.addActionListener(new ActionListener() {
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
try {
|
try {
|
||||||
int newVal = getHexVal(spField) & 0xff;
|
int newVal = StatusPanel.this.getHexVal(spField) & 0xff;
|
||||||
machine.getCpu().setStackPointer(newVal);
|
machine.getCpu().setStackPointer(newVal);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
// Swallow exception
|
// Swallow exception
|
||||||
}
|
}
|
||||||
|
|
||||||
updateState();
|
StatusPanel.this.updateState();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
aField.addActionListener(e -> {
|
aField.addActionListener(new ActionListener() {
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
try {
|
try {
|
||||||
int newVal = getHexVal(aField) & 0xff;
|
int newVal = StatusPanel.this.getHexVal(aField) & 0xff;
|
||||||
machine.getCpu().setAccumulator(newVal);
|
machine.getCpu().setAccumulator(newVal);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
// Swallow exception
|
// Swallow exception
|
||||||
}
|
}
|
||||||
|
|
||||||
updateState();
|
StatusPanel.this.updateState();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
xField.addActionListener(e -> {
|
xField.addActionListener(new ActionListener() {
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
try {
|
try {
|
||||||
int newVal = getHexVal(xField) & 0xff;
|
int newVal = StatusPanel.this.getHexVal(xField) & 0xff;
|
||||||
machine.getCpu().setXRegister(newVal);
|
machine.getCpu().setXRegister(newVal);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
// Swallow exception
|
// Swallow exception
|
||||||
}
|
}
|
||||||
|
|
||||||
updateState();
|
StatusPanel.this.updateState();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
yField.addActionListener(e -> {
|
yField.addActionListener(new ActionListener() {
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
try {
|
try {
|
||||||
int newVal = getHexVal(yField) & 0xff;
|
int newVal = StatusPanel.this.getHexVal(yField) & 0xff;
|
||||||
machine.getCpu().setYRegister(newVal);
|
machine.getCpu().setYRegister(newVal);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
// Swallow exception
|
// Swallow exception
|
||||||
}
|
}
|
||||||
|
|
||||||
updateState();
|
StatusPanel.this.updateState();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
constraints.anchor = GridBagConstraints.LINE_START;
|
constraints.anchor = GridBagConstraints.LINE_START;
|
||||||
|
|||||||
@@ -122,10 +122,13 @@ public class VideoWindow extends JFrame implements DeviceChangeListener {
|
|||||||
*/
|
*/
|
||||||
private class CursorBlinker implements Runnable {
|
private class CursorBlinker implements Runnable {
|
||||||
public void run() {
|
public void run() {
|
||||||
SwingUtilities.invokeLater(() -> {
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
if (cursorBlinkRate > 0) {
|
if (cursorBlinkRate > 0) {
|
||||||
hideCursor = !hideCursor;
|
hideCursor = !hideCursor;
|
||||||
repaint();
|
VideoWindow.this.repaint();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user