use of org.javatari.atari.console.savestate.ConsoleState in project javatari by ppeccin.
the class CartridgeSavestate method getConsoleState.
public ConsoleState getConsoleState() {
try {
ByteArrayInputStream byteStream = new ByteArrayInputStream(rom.content);
byteStream.skip(contentIdentifier.length);
ObjectInputStream objStream = new ObjectInputStream(byteStream);
return (ConsoleState) objStream.readObject();
} catch (Exception ex) {
// Cast or IO errors
ex.printStackTrace();
return null;
}
}
use of org.javatari.atari.console.savestate.ConsoleState in project javatari by ppeccin.
the class Console method pauseAndSaveState.
private ConsoleState pauseAndSaveState() {
pause();
ConsoleState state = saveState();
go();
return state;
}
use of org.javatari.atari.console.savestate.ConsoleState in project javatari by ppeccin.
the class ServerConsole method clockPulse.
@Override
public synchronized void clockPulse() {
Boolean powerChange = null;
ConsoleState state = null;
if (stateUpdateRequested) {
powerChange = powerOn;
state = saveState();
stateUpdateRequested = false;
}
List<ControlChange> controlChanges = ((ServerConsoleControlsSocketAdapter) controlsSocket).commitAndGetChangesToSend();
if (powerOn)
tia.clockPulse();
if (remoteTransmitter != null && remoteTransmitter.isClientConnected()) {
ServerUpdate update = new ServerUpdate();
update.powerChange = powerChange;
update.consoleState = state;
update.controlChanges = controlChanges;
remoteTransmitter.sendUpdate(update);
}
}
Aggregations