From 4fc71a43a7cc12a4114cf978dc83c2d52b06538c Mon Sep 17 00:00:00 2001 From: Brendan Robert Date: Sun, 29 Mar 2015 16:07:00 -0500 Subject: [PATCH] Changed friendly text to make more sense, also added hack to do a proper reboot when the HDV is inserted during the boot sequence... for science. --- src/main/java/jace/EmulatorUILogic.java | 18 +++++++++++++++ src/main/java/jace/apple2e/Apple2e.java | 19 +++++++-------- .../hardware/massStorage/CardMassStorage.java | 23 ++++++++----------- 3 files changed, 35 insertions(+), 25 deletions(-) diff --git a/src/main/java/jace/EmulatorUILogic.java b/src/main/java/jace/EmulatorUILogic.java index c7885eb..d2d5a65 100644 --- a/src/main/java/jace/EmulatorUILogic.java +++ b/src/main/java/jace/EmulatorUILogic.java @@ -25,6 +25,7 @@ import jace.config.ConfigurationUIController; import jace.config.InvokableAction; import jace.config.Reconfigurable; import jace.core.CPU; +import jace.core.Computer; import jace.core.Debugger; import jace.core.RAM; import jace.core.RAMEvent; @@ -46,6 +47,9 @@ import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; +import javafx.application.Platform; import javafx.embed.swing.SwingFXUtils; import javafx.event.EventHandler; import javafx.fxml.FXMLLoader; @@ -440,6 +444,20 @@ public class EmulatorUILogic implements Reconfigurable { JaceApplication.singleton.controller.removeMouseListener(handler); } } + + public static void simulateCtrlAppleReset() { + Computer computer = JaceApplication.singleton.controller.computer; + computer.keyboard.openApple(true); + computer.warmStart(); + Platform.runLater(() -> { + try { + Thread.sleep(500); + } catch (InterruptedException ex) { + Logger.getLogger(EmulatorUILogic.class.getName()).log(Level.SEVERE, null, ex); + } + computer.keyboard.openApple(false); + }); + } @Override public String getName() { diff --git a/src/main/java/jace/apple2e/Apple2e.java b/src/main/java/jace/apple2e/Apple2e.java index 33fc9b2..3f94019 100644 --- a/src/main/java/jace/apple2e/Apple2e.java +++ b/src/main/java/jace/apple2e/Apple2e.java @@ -383,18 +383,15 @@ public class Apple2e extends Computer { " Presented by BLuRry", " http://goo.gl/SnzqG", "", - "Press F1 to insert disk in Slot 6, D1", - "Press F2 to insert disk in Slot 6, D2", - "Press F3 to insert HDV or 2MG in slot 7", - "Press F4 to open configuration", - "Press F5 to run raw binary program", - "Press F8 to correct the aspect ratio", - "Press F9 to toggle fullscreen", - "Press F10 to open/close the debugger", + "To insert a disk, please drag it over", + "this window and drop on the desired", + "drive icon.", "", - " If metacheat is enabled:", - "Press HOME to activate memory heatmap", - "Press END to activate metacheat search" + "Press CTRL+SHIFT+C for configuration.", + "", + "O-A is Alt/Option", + "C-A is Shortcut/Command", + "Reset is Delete/Backspace" }) { int addr = 0x0401 + VideoDHGR.calculateTextOffset(row++); for (char c : s.toCharArray()) { diff --git a/src/main/java/jace/hardware/massStorage/CardMassStorage.java b/src/main/java/jace/hardware/massStorage/CardMassStorage.java index d0a82b0..1e13f7c 100644 --- a/src/main/java/jace/hardware/massStorage/CardMassStorage.java +++ b/src/main/java/jace/hardware/massStorage/CardMassStorage.java @@ -18,6 +18,7 @@ */ package jace.hardware.massStorage; +import jace.EmulatorUILogic; import jace.apple2e.MOS65C02; import jace.config.Name; import jace.core.Card; @@ -127,21 +128,15 @@ public class CardMassStorage extends Card implements MediaConsumerParent { @Override public void reconfigure() { - try { - unregisterListeners(); - int pc = computer.getCpu().getProgramCounter(); - if (drive1.getCurrentDisk() != null && getSlot() == 7 && (pc == 0x0c65e || pc == 0x0c661)) { + unregisterListeners(); + int pc = computer.getCpu().getProgramCounter(); + if (drive1.getCurrentDisk() != null && getSlot() == 7 && (pc >= 0x0c65e && pc <= 0x0c66F)) { // If the computer is in a loop trying to boot from cards 6, fast-boot from here instead - // This is a convenience to boot a hard-drive if the emulator has started waiting for a currentDisk - currentDrive = drive1; - getCurrentDisk().boot0(getSlot(), computer); - Optional[] cards = computer.getMemory().getAllCards(); - cards[6].ifPresent(card->computer.getMotherboard().cancelSpeedRequest(card)); - } - registerListeners(); - } catch (IOException ex) { - Logger.getLogger(CardMassStorage.class.getName()).log(Level.SEVERE, null, ex); + // This is a convenience to boot a hard-drive if the emulator has started waiting for a currentDisk + currentDrive = drive1; + EmulatorUILogic.simulateCtrlAppleReset(); } + registerListeners(); } @Override @@ -258,4 +253,4 @@ public class CardMassStorage extends Card implements MediaConsumerParent { public MediaConsumer[] getConsumers() { return new MediaConsumer[]{drive1, drive2}; } -} \ No newline at end of file +}