Got all the startup issues with motherboard resolved, which were apparently the reason that the joysticks were not initalizing on startup correctly.

This commit is contained in:
Brendan Robert 2015-08-13 01:12:09 -05:00
parent 8a1844fb90
commit 2114059914
5 changed files with 15 additions and 9 deletions

View File

@ -124,7 +124,8 @@ public class Apple2e extends Computer {
if (motherboard != null && motherboard.isRunning()) {
motherboard.suspend();
}
motherboard = new Motherboard(this);
motherboard = new Motherboard(this, motherboard);
reconfigure();
motherboard.reconfigure();
}
@ -132,7 +133,6 @@ public class Apple2e extends Computer {
public void coldStart() {
pause();
reinitMotherboard();
//getMemory().dump();
for (SoftSwitches s : SoftSwitches.values()) {
s.getSwitch().reset();
}
@ -143,10 +143,6 @@ public class Apple2e extends Computer {
}
reboot();
resume();
/*
getCpu().resume();
getVideo().resume();
*/
}
public void reboot() {
@ -477,4 +473,8 @@ public class Apple2e extends Computer {
public String getShortName() {
return "computer";
}
private void attachMiscDevices() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
}

View File

@ -110,6 +110,7 @@ public abstract class Device implements Reconfigurable {
public void resume() {
setRun(true);
waitCycles = 0;
}
public abstract void attach();

View File

@ -58,9 +58,14 @@ public class Motherboard extends TimedDevice {
/**
* Creates a new instance of Motherboard
* @param computer
* @param oldMotherboard
*/
public Motherboard(Computer computer) {
public Motherboard(Computer computer, Motherboard oldMotherboard) {
super(computer);
if (oldMotherboard != null) {
miscDevices.addAll(oldMotherboard.miscDevices);
speaker = oldMotherboard.speaker;
}
}
@Override

View File

@ -197,13 +197,13 @@ public class Joystick extends Device {
@Override
protected void doEvent(RAMEvent e) {
setRun(true);
readJoystick();
xSwitch.setState(true);
x = 10 + joyX * 11;
ySwitch.setState(true);
y = 10 + joyY * 11;
e.setNewValue(computer.getVideo().getFloatingBus());
resume();
}
};

View File

@ -69,7 +69,7 @@ public class PlaybackEngine extends Computer {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
};
Motherboard motherboard = new Motherboard(dummyComputer);
Motherboard motherboard = new Motherboard(dummyComputer, null);
CardMockingboard mockingboard = new CardMockingboard(dummyComputer);
public PlaybackEngine() {