WORKS WITHOUT REDBUS STORING DATA

main
Astoria 7 months ago
parent bbf950f8b3
commit d6fc1bfe5c

2
.gitmodules vendored

@ -1,3 +1,3 @@
[submodule "J65el02"]
path = J65el02
url = git@github.com:simon816/J65el02.git
url = https://github.com/walksanatora/J65el02.git

@ -1 +1 @@
Subproject commit b687ef534c10ae6723564aa3f6ced9746f07f4a0
Subproject commit 341d5a5fe2d200583bccaefce8884927fe6605b1

@ -28,7 +28,7 @@ public class BasicMonitorDriver implements MonitorDriver, KeyListener {
int xoffset = 30;
int yoffset = 26;
public BasicMonitorDriver(Machine emu) {
public BasicMonitorDriver() {
this.emu = emu;
try{
display = ImageIO.read(Objects.requireNonNull(getClass().getResourceAsStream("/display.png")));

@ -4,6 +4,7 @@ import com.simon816.j65el02.Machine;
import com.simon816.j65el02.device.FileDiskDriver;
import com.simon816.j65el02.device.RPDrive;
import com.simon816.j65el02.device.RPMonitor;
import com.simon816.j65el02.device.RedBus;
import java.io.IOException;
import java.net.URISyntaxException;
@ -26,39 +27,39 @@ public class Main {
}
}
static Machine emu = new Machine(rpcboot, 8192);
static long interruptTimer = 50L;
//Adjust as needed to match original clock speed
static long frequency = 2L;
static BasicMonitorDriver monitorDriver;
static TimerTask interruptTask = new TimerTask(){
public void run(){
if(emu.cpu.isWaitingForInterrupt())
emu.interruptWait.release();
}
};
static TimerTask cpuTask = new TimerTask(){
public void run(){
for(int i = 0; i < 50; i++)
emu.step();
}
};
static Timer timer1 = new Timer();
static Timer timer2 = new Timer();
public static void main(String[] args) {
RedBus redBus = new RedBus();
Emulator core = new Emulator(redBus);
TimerTask interruptTask = new TimerTask(){
public void run(){
if(core.cpu.isWaitingForInterrupt())
core.setWaitingOnInterrupt();
}
};
TimerTask cpuTask = new TimerTask(){
public void run(){
for(int i = 0; i < 50; i++)
core.step();
}
};
try {
FileDiskDriver tetrisDrive = new FileDiskDriver(disk, "tetrisDrive", "TETRIS", false);
monitorDriver = new BasicMonitorDriver(emu);
RPDrive diskDrive = new RPDrive(emu, tetrisDrive);
RPMonitor monitor = new RPMonitor(emu, monitorDriver);
emu.setPeripheral(emu.getDefaultDriveId(), diskDrive);
emu.setPeripheral(emu.getDefaultMonitorId(), monitor);
monitorDriver = new BasicMonitorDriver();
RPDrive diskDrive = new RPDrive(tetrisDrive);
RPMonitor monitor = new RPMonitor(monitorDriver);
redBus.setPeripheral(2, diskDrive);
redBus.setPeripheral(1, monitor);
System.out.println("Started emu thread");
System.out.println("Started display thread");
timer1.schedule(interruptTask, new Date(), interruptTimer);

Loading…
Cancel
Save