Compare commits
10
Commits
558af36cd5
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fb097a0c49 | ||
|
|
3ee3a7e300 | ||
|
|
b2810fa062 | ||
|
|
c9f9121477 | ||
|
|
91ef70fe4e | ||
|
|
69bf418f43 | ||
|
|
540f0dff58 | ||
|
|
17668e2c3c | ||
|
|
3353b8436c
|
||
|
|
e635d0a608
|
No files matched your search
@@ -0,0 +1,36 @@
|
|||||||
|
name: Build and Test
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
pull_request:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: catthehacker/ubuntu:act-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup JDK
|
||||||
|
uses: actions/setup-java@v6
|
||||||
|
with:
|
||||||
|
distribution: temurin
|
||||||
|
java-version: '21'
|
||||||
|
#cache: maven
|
||||||
|
|
||||||
|
- name: Install Maven
|
||||||
|
run: apt-get update && apt-get install -y maven
|
||||||
|
|
||||||
|
- name: Test and package
|
||||||
|
run: mvn -B verify
|
||||||
|
|
||||||
|
- name: Upload jar
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: package
|
||||||
|
path: target/*.jar
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: catthehacker/ubuntu:act-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup JDK
|
||||||
|
uses: actions/setup-java@v6
|
||||||
|
with:
|
||||||
|
distribution: temurin
|
||||||
|
java-version: '21'
|
||||||
|
|
||||||
|
- name: Install Maven
|
||||||
|
run: apt-get update && apt-get install -y maven
|
||||||
|
|
||||||
|
- name: Package
|
||||||
|
run: mvn -B verify
|
||||||
|
|
||||||
|
- name: Create release
|
||||||
|
uses: https://gitea.com/actions/gitea-release-action@v1
|
||||||
|
with:
|
||||||
|
files: |-
|
||||||
|
target/symon*.jar
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
kSYMON - A 6502 System Simulator
|
kSYMON - A 6502 System Simulator
|
||||||
===============================
|
===============================
|
||||||
|
|
||||||
**Version:** 1.5.1k
|
**Version:** 1.5.1.1k
|
||||||
|
|
||||||
**Last Updated:** 24 September, 2026
|
**Last Updated:** 24 September, 2026
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,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.5.1k</version>
|
<version>1.5.1.1k</version>
|
||||||
<name>symon</name>
|
<name>symon</name>
|
||||||
<url>https://git.loomcom.com/seth/symon</url>
|
<url>https://git.loomcom.com/seth/symon</url>
|
||||||
<properties>
|
<properties>
|
||||||
|
|||||||
@@ -86,6 +86,9 @@ public class Main {
|
|||||||
case "beneater":
|
case "beneater":
|
||||||
machineClass = BenEaterMachine.class;
|
machineClass = BenEaterMachine.class;
|
||||||
break;
|
break;
|
||||||
|
case "mike42":
|
||||||
|
machineClass = MichaelBillingtonMachine.class;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
logger.error("Could not start Symon. Unknown machine type {}", machine);
|
logger.error("Could not start Symon. Unknown machine type {}", machine);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ 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 com.loomcom.symon.util.Utils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Skeleton for future implementation of a MOS 6522 VIA.
|
* Skeleton for future implementation of a MOS 6522 VIA.
|
||||||
@@ -56,6 +57,8 @@ public class Via6522 extends Pia {
|
|||||||
|
|
||||||
public Via6522(int address) throws MemoryRangeException {
|
public Via6522(int address) throws MemoryRangeException {
|
||||||
super(address, address + VIA_SIZE - 1, "MOS 6522 VIA");
|
super(address, address + VIA_SIZE - 1, "MOS 6522 VIA");
|
||||||
|
outputRegisterA = outputRegisterB = 0;
|
||||||
|
dataDirectionA = dataDirectionB = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -73,11 +76,11 @@ public class Via6522 extends Pia {
|
|||||||
@Override
|
@Override
|
||||||
public int read(int address, boolean cpuAccess) throws MemoryAccessException {
|
public int read(int address, boolean cpuAccess) throws MemoryAccessException {
|
||||||
return switch (address) {
|
return switch (address) {
|
||||||
case IOB_REG -> pbRead(cpuAccess);
|
case IOB_REG -> pbRead();
|
||||||
case IOA_REG -> paRead(cpuAccess);
|
case IOA_REG -> paRead();
|
||||||
case DDRB_REG -> dataDirectionB;
|
case DDRB_REG -> dataDirectionB;
|
||||||
case DDRA_REG -> dataDirectionA;
|
case DDRA_REG -> dataDirectionA;
|
||||||
case IOANH_REG -> paRead(cpuAccess);
|
case IOANH_REG -> paRead();
|
||||||
default -> throw new MemoryAccessException("No Register or Not Implemented!");
|
default -> throw new MemoryAccessException("No Register or Not Implemented!");
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -90,20 +93,21 @@ public class Via6522 extends Pia {
|
|||||||
inputRegisterA = data & 0xFF;
|
inputRegisterA = data & 0xFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getOutputRegisterB() {
|
|
||||||
return outputRegisterB;
|
public String getPBStatus() {
|
||||||
|
return "%" + Utils.byteToBin(pbRead());
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getOutputRegisterA() {
|
public String getPAStatus() {
|
||||||
return outputRegisterA;
|
return "%" + Utils.byteToBin(paRead());
|
||||||
}
|
}
|
||||||
|
|
||||||
private int pbRead(boolean cpuAccess) {
|
private int pbRead() {
|
||||||
// Return bits of output register where DDRB is 1 and input register where DDRB is 0
|
// Return bits of output register where DDRB is 1 and input register where DDRB is 0
|
||||||
return (outputRegisterB & dataDirectionB) | (inputRegisterB & ~dataDirectionB);
|
return (outputRegisterB & dataDirectionB) | (inputRegisterB & ~dataDirectionB);
|
||||||
}
|
}
|
||||||
|
|
||||||
private int paRead(boolean cpuAccess) {
|
private int paRead() {
|
||||||
// Return bits of output register where DDRB is 1 and input register where DDRB is 0
|
// Return bits of output register where DDRB is 1 and input register where DDRB is 0
|
||||||
return (outputRegisterA & dataDirectionA) | (inputRegisterA & ~dataDirectionA);
|
return (outputRegisterA & dataDirectionA) | (inputRegisterA & ~dataDirectionA);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
package com.loomcom.symon.ui;
|
package com.loomcom.symon.ui;
|
||||||
|
|
||||||
|
import com.formdev.flatlaf.util.UIScale;
|
||||||
import com.loomcom.symon.Breakpoints;
|
import com.loomcom.symon.Breakpoints;
|
||||||
import com.loomcom.symon.util.Utils;
|
import com.loomcom.symon.util.Utils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
@@ -40,7 +41,7 @@ public class BreakpointsWindow extends JFrame {
|
|||||||
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(BreakpointsWindow.class);
|
private static final Logger logger = LoggerFactory.getLogger(BreakpointsWindow.class);
|
||||||
|
|
||||||
private static final Dimension FRAME_SIZE = new Dimension(240, 280);
|
private static final Dimension FRAME_SIZE = UIScale.scale(new Dimension(240, 280));
|
||||||
private static final String EMPTY_STRING = "";
|
private static final String EMPTY_STRING = "";
|
||||||
|
|
||||||
private final JFrame mainWindow;
|
private final JFrame mainWindow;
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
package com.loomcom.symon.ui;
|
package com.loomcom.symon.ui;
|
||||||
|
|
||||||
|
import com.formdev.flatlaf.util.UIScale;
|
||||||
import com.loomcom.symon.Bus;
|
import com.loomcom.symon.Bus;
|
||||||
import com.loomcom.symon.exceptions.MemoryAccessException;
|
import com.loomcom.symon.exceptions.MemoryAccessException;
|
||||||
import com.loomcom.symon.util.Utils;
|
import com.loomcom.symon.util.Utils;
|
||||||
@@ -55,15 +56,15 @@ public class MemoryWindow extends JFrame implements ActionListener {
|
|||||||
private JButton previousPageButton;
|
private JButton previousPageButton;
|
||||||
private JButton nextPageButton;
|
private JButton nextPageButton;
|
||||||
|
|
||||||
private static final Dimension MINIMUM_SIZE = new Dimension(320, 600);
|
private static final Dimension MINIMUM_SIZE = UIScale.scale(new Dimension(400, 600));
|
||||||
|
|
||||||
// The width of column 0 (address), in pixels
|
// The width of column 0 (address), in pixels
|
||||||
private static final int ADDR_COL_WIDTH = 48;
|
private static final int ADDR_COL_WIDTH = UIScale.scale(64);
|
||||||
|
|
||||||
private static final int HEX_COL_WIDTH = 32;
|
private static final int HEX_COL_WIDTH = UIScale.scale(32);
|
||||||
|
|
||||||
// The width of the ASCII cells, in pixels
|
// The width of the ASCII cells, in pixels
|
||||||
private static final int ASCII_COL_WIDTH = 8;
|
private static final int ASCII_COL_WIDTH = UIScale.scale(15);
|
||||||
|
|
||||||
// The start/end columns of the ASCII view
|
// The start/end columns of the ASCII view
|
||||||
private static final int ASCII_COL_START = 9;
|
private static final int ASCII_COL_START = 9;
|
||||||
|
|||||||
@@ -26,12 +26,13 @@ package com.loomcom.symon.ui;
|
|||||||
import com.formdev.flatlaf.util.UIScale;
|
import com.formdev.flatlaf.util.UIScale;
|
||||||
import com.loomcom.symon.Cpu;
|
import com.loomcom.symon.Cpu;
|
||||||
import com.loomcom.symon.CpuState;
|
import com.loomcom.symon.CpuState;
|
||||||
|
import com.loomcom.symon.devices.Pia;
|
||||||
|
import com.loomcom.symon.devices.Via6522;
|
||||||
import com.loomcom.symon.machines.Machine;
|
import com.loomcom.symon.machines.Machine;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.border.Border;
|
import javax.swing.border.Border;
|
||||||
import javax.swing.border.EtchedBorder;
|
import javax.swing.border.EtchedBorder;
|
||||||
import javax.swing.plaf.metal.MetalTextFieldUI;
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
@@ -71,6 +72,8 @@ public class StatusPanel extends JPanel {
|
|||||||
private JTextField aField;
|
private JTextField aField;
|
||||||
private JTextField xField;
|
private JTextField xField;
|
||||||
private JTextField yField;
|
private JTextField yField;
|
||||||
|
private JTextField piaBField;
|
||||||
|
private JTextField piaAField;
|
||||||
|
|
||||||
private final Machine machine;
|
private final Machine machine;
|
||||||
|
|
||||||
@@ -153,6 +156,10 @@ public class StatusPanel extends JPanel {
|
|||||||
JLabel xLabel = makeLabel("X");
|
JLabel xLabel = makeLabel("X");
|
||||||
JLabel yLabel = makeLabel("Y");
|
JLabel yLabel = makeLabel("Y");
|
||||||
|
|
||||||
|
// PIA/VIA labels
|
||||||
|
JLabel piaBLabel = makeLabel("PB");
|
||||||
|
JLabel piaALabel = makeLabel("PA");
|
||||||
|
|
||||||
statusFlagsLabel.setToolTipText("6502 Processor Status Flags");
|
statusFlagsLabel.setToolTipText("6502 Processor Status Flags");
|
||||||
opcodeLabel.setToolTipText("Instruction Register");
|
opcodeLabel.setToolTipText("Instruction Register");
|
||||||
pcLabel.setToolTipText("Program Counter");
|
pcLabel.setToolTipText("Program Counter");
|
||||||
@@ -165,6 +172,9 @@ public class StatusPanel extends JPanel {
|
|||||||
xField = makeTextField(SMALL_TEXT_FIELD_SIZE, true);
|
xField = makeTextField(SMALL_TEXT_FIELD_SIZE, true);
|
||||||
yField = makeTextField(SMALL_TEXT_FIELD_SIZE, true);
|
yField = makeTextField(SMALL_TEXT_FIELD_SIZE, true);
|
||||||
|
|
||||||
|
piaBField = makeTextField(LARGE_TEXT_FIELD_SIZE, false);
|
||||||
|
piaAField = makeTextField(LARGE_TEXT_FIELD_SIZE, false);
|
||||||
|
|
||||||
// Make fields editable
|
// Make fields editable
|
||||||
pcField.addActionListener(new ActionListener() {
|
pcField.addActionListener(new ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
@@ -287,6 +297,25 @@ public class StatusPanel extends JPanel {
|
|||||||
add(xField, constraints);
|
add(xField, constraints);
|
||||||
constraints.gridx = 1;
|
constraints.gridx = 1;
|
||||||
add(yField, constraints);
|
add(yField, constraints);
|
||||||
|
|
||||||
|
constraints.insets = new Insets(5, 0, 0, 0);
|
||||||
|
constraints.gridx = 0;
|
||||||
|
constraints.gridwidth = 2;
|
||||||
|
constraints.gridy = 10;
|
||||||
|
add(piaBLabel, constraints);
|
||||||
|
|
||||||
|
constraints.insets = new Insets(2, 2, 2, 2);
|
||||||
|
constraints.gridy = 11;
|
||||||
|
add(piaBField, constraints);
|
||||||
|
|
||||||
|
constraints.insets = new Insets(5, 0, 0, 0);
|
||||||
|
constraints.gridy = 12;
|
||||||
|
add(piaALabel, constraints);
|
||||||
|
|
||||||
|
constraints.insets = new Insets(2, 2, 2, 2);
|
||||||
|
constraints.gridy = 13;
|
||||||
|
add(piaAField, constraints);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -296,6 +325,8 @@ public class StatusPanel extends JPanel {
|
|||||||
Cpu cpu = machine.getCpu();
|
Cpu cpu = machine.getCpu();
|
||||||
CpuState cpuState = cpu.getCpuState();
|
CpuState cpuState = cpu.getCpuState();
|
||||||
|
|
||||||
|
Pia pia = machine.getPia();
|
||||||
|
|
||||||
// Update the Processor Status Flag display
|
// Update the Processor Status Flag display
|
||||||
int status = cpuState.getStatusFlag();
|
int status = cpuState.getStatusFlag();
|
||||||
|
|
||||||
@@ -317,6 +348,12 @@ public class StatusPanel extends JPanel {
|
|||||||
xField.setText(cpu.getXRegisterStatus());
|
xField.setText(cpu.getXRegisterStatus());
|
||||||
yField.setText(cpu.getYRegisterStatus());
|
yField.setText(cpu.getYRegisterStatus());
|
||||||
|
|
||||||
|
// Update the Pia Variables
|
||||||
|
if (pia instanceof Via6522) {
|
||||||
|
piaBField.setText(((Via6522) pia).getPBStatus());
|
||||||
|
piaAField.setText(((Via6522) pia).getPAStatus());
|
||||||
|
}
|
||||||
|
|
||||||
repaint();
|
repaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
package com.loomcom.symon.ui;
|
package com.loomcom.symon.ui;
|
||||||
|
|
||||||
|
import com.formdev.flatlaf.util.UIScale;
|
||||||
import com.loomcom.symon.CpuState;
|
import com.loomcom.symon.CpuState;
|
||||||
import com.loomcom.symon.util.FifoRingBuffer;
|
import com.loomcom.symon.util.FifoRingBuffer;
|
||||||
|
|
||||||
@@ -39,8 +40,8 @@ public class TraceLog extends JFrame {
|
|||||||
private final FifoRingBuffer<CpuState> traceLog;
|
private final FifoRingBuffer<CpuState> traceLog;
|
||||||
private final JTextArea traceLogTextArea;
|
private final JTextArea traceLogTextArea;
|
||||||
|
|
||||||
private static final Dimension MIN_SIZE = new Dimension(320, 200);
|
private static final Dimension MIN_SIZE = UIScale.scale(new Dimension(320, 200));
|
||||||
private static final Dimension PREFERRED_SIZE = new Dimension(640, 480);
|
private static final Dimension PREFERRED_SIZE = UIScale.scale(new Dimension(640, 480));
|
||||||
private static final int MAX_LOG_LENGTH = 50000;
|
private static final int MAX_LOG_LENGTH = 50000;
|
||||||
|
|
||||||
public TraceLog() {
|
public TraceLog() {
|
||||||
@@ -53,7 +54,7 @@ public class TraceLog extends JFrame {
|
|||||||
setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
|
setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
|
||||||
|
|
||||||
traceLogTextArea = new JTextArea();
|
traceLogTextArea = new JTextArea();
|
||||||
traceLogTextArea.setFont(new Font(Font.MONOSPACED, Font.BOLD, 12));
|
traceLogTextArea.setFont(new Font(Font.MONOSPACED, Font.BOLD, UIScale.scale(12)));
|
||||||
traceLogTextArea.setEditable(false);
|
traceLogTextArea.setEditable(false);
|
||||||
|
|
||||||
JScrollPane scrollableView = new JScrollPane(traceLogTextArea);
|
JScrollPane scrollableView = new JScrollPane(traceLogTextArea);
|
||||||
|
|||||||
@@ -132,7 +132,9 @@ public final class Ui {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void applyDetectedUiScale() {
|
private static void applyDetectedUiScale() {
|
||||||
Double rawScale = X11ResourceReader.readXftDpiScale(); // ex: 1.5, 2.0, 2.5...
|
Double rawScale = null;
|
||||||
|
|
||||||
|
if (SystemInfo.isLinux) rawScale = X11ResourceReader.readXftDpiScale(); // ex: 1.5, 2.0, 2.5...
|
||||||
|
|
||||||
if (rawScale != null && rawScale > 1.0) {
|
if (rawScale != null && rawScale > 1.0) {
|
||||||
// flatlaf.uiScale aceita frações — mantém a precisão original
|
// flatlaf.uiScale aceita frações — mantém a precisão original
|
||||||
|
|||||||
@@ -76,6 +76,16 @@ public class Utils {
|
|||||||
"F0", "F1", "F2", "F3", "F4", "F5", "F6", "F7",
|
"F0", "F1", "F2", "F3", "F4", "F5", "F6", "F7",
|
||||||
"F8", "F9", "FA", "FB", "FC", "FD", "FE", "FF"};
|
"F8", "F9", "FA", "FB", "FC", "FD", "FE", "FF"};
|
||||||
|
|
||||||
|
private static final String[] BIN_CONSTANTS = new String[256];
|
||||||
|
|
||||||
|
static {
|
||||||
|
for (int i = 0; i < 256; i++) {
|
||||||
|
String bin = Integer.toBinaryString(i);
|
||||||
|
// Left-pad to 8 digits with zeros
|
||||||
|
BIN_CONSTANTS[i] = "00000000".substring(bin.length()) + bin;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Very fast 8-bit int to ASCII conversion.
|
* Very fast 8-bit int to ASCII conversion.
|
||||||
*
|
*
|
||||||
@@ -116,4 +126,14 @@ public class Utils {
|
|||||||
public static int address(int lowByte, int hiByte) {
|
public static int address(int lowByte, int hiByte) {
|
||||||
return ((hiByte << 8) | lowByte) & 0xffff;
|
return ((hiByte << 8) | lowByte) & 0xffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Very fast 8-bit int to binary conversion, with zero-padded output.
|
||||||
|
*
|
||||||
|
* @param val The unsigned 8-bit value to convert to a zero padded binary string.
|
||||||
|
* @return Eight digit, zero padded binary string.
|
||||||
|
*/
|
||||||
|
public static String byteToBin(int val) {
|
||||||
|
return BIN_CONSTANTS[val & 0xff];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user