From d576ff117225e2cc341545473d266ca640691690 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 10 Jun 2018 18:28:29 -0400 Subject: [PATCH] Exposes DOS 3.3 acceleration as an option. Albeit with an unhelpful label in the macOS GUI for now. --- Machines/AppleII/AppleII.cpp | 40 ++++++++++++++++--- Machines/AppleII/AppleII.hpp | 8 ++++ Machines/Electron/Electron.hpp | 1 + Machines/Utility/MachineForTarget.cpp | 1 + .../StaticAnalyser/CSStaticAnalyser.mm | 2 +- 5 files changed, 46 insertions(+), 6 deletions(-) diff --git a/Machines/AppleII/AppleII.cpp b/Machines/AppleII/AppleII.cpp index d9df49aea..427aef2ff 100644 --- a/Machines/AppleII/AppleII.cpp +++ b/Machines/AppleII/AppleII.cpp @@ -24,10 +24,9 @@ #include "DiskIICard.hpp" #include "Video.hpp" -#include "../../ClockReceiver/ForceInline.hpp" - #include "../../Analyser/Static/AppleII/Target.hpp" - +#include "../../ClockReceiver/ForceInline.hpp" +#include "../../Configurable/Configurable.hpp" #include "../../Storage/Disk/Track/TrackSerialiser.hpp" #include "../../Storage/Disk/Encodings/AppleGCR/SegmentParser.hpp" @@ -35,12 +34,19 @@ #include #include +std::vector> AppleII::get_options() { + std::vector> options; + options.emplace_back(new Configurable::BooleanOption("Accelerate DOS 3.3", "quickload")); + return options; +} + namespace { class ConcreteMachine: public CRTMachine::Machine, public ConfigurationTarget::Machine, public KeyboardMachine::Machine, + public Configurable::Device, public CPU::MOS6502::BusHandler, public Inputs::Keyboard, public AppleII::Machine, @@ -165,7 +171,7 @@ class ConcreteMachine: std::unique_ptr string_serialiser_; // MARK - quick loading - bool should_load_quickly_ = true; + bool should_load_quickly_ = false; public: ConcreteMachine(): @@ -277,6 +283,7 @@ class ConcreteMachine: ram_[io_control_block_address+0x02] > 0 && ram_[io_control_block_address+0x02] < 3 && ram_[io_control_block_address+0x0c] < 2 ) { + printf("."); const uint8_t iob_track = ram_[io_control_block_address+4]; const uint8_t iob_sector = ram_[io_control_block_address+5]; const uint8_t iob_drive = ram_[io_control_block_address+2] - 1; @@ -576,7 +583,6 @@ class ConcreteMachine: } bool insert_media(const Analyser::Static::Media &media) override { - if(!media.disks.empty()) { auto diskii = diskii_card(); if(diskii) diskii->set_disk(media.disks[0], 0); @@ -590,6 +596,30 @@ class ConcreteMachine: if(card) card->set_activity_observer(observer); } } + + // MARK: Options + std::vector> get_options() override { + return AppleII::get_options(); + } + + void set_selections(const Configurable::SelectionSet &selections_by_option) override { + bool quickload; + if(Configurable::get_quick_load_tape(selections_by_option, quickload)) { + should_load_quickly_ = quickload; + } + } + + Configurable::SelectionSet get_accurate_selections() override { + Configurable::SelectionSet selection_set; + Configurable::append_quick_load_tape_selection(selection_set, false); + return selection_set; + } + + Configurable::SelectionSet get_user_friendly_selections() override { + Configurable::SelectionSet selection_set; + Configurable::append_quick_load_tape_selection(selection_set, true); + return selection_set; + } }; } diff --git a/Machines/AppleII/AppleII.hpp b/Machines/AppleII/AppleII.hpp index fb7501721..76f42efc0 100644 --- a/Machines/AppleII/AppleII.hpp +++ b/Machines/AppleII/AppleII.hpp @@ -9,8 +9,16 @@ #ifndef AppleII_hpp #define AppleII_hpp +#include "../../Configurable/Configurable.hpp" + +#include +#include + namespace AppleII { +/// @returns The options available for an Apple II. +std::vector> get_options(); + class Machine { public: virtual ~Machine(); diff --git a/Machines/Electron/Electron.hpp b/Machines/Electron/Electron.hpp index e14fa6db9..ea88fa17c 100644 --- a/Machines/Electron/Electron.hpp +++ b/Machines/Electron/Electron.hpp @@ -12,6 +12,7 @@ #include "../../Configurable/Configurable.hpp" #include +#include #include namespace Electron { diff --git a/Machines/Utility/MachineForTarget.cpp b/Machines/Utility/MachineForTarget.cpp index a7fbaba64..37f43e379 100644 --- a/Machines/Utility/MachineForTarget.cpp +++ b/Machines/Utility/MachineForTarget.cpp @@ -129,6 +129,7 @@ std::string Machine::LongNameForTargetMachine(Analyser::Machine machine) { std::map>> Machine::AllOptionsByMachineName() { std::map>> options; + options.emplace(std::make_pair(LongNameForTargetMachine(Analyser::Machine::Electron), AppleII::get_options())); options.emplace(std::make_pair(LongNameForTargetMachine(Analyser::Machine::Electron), Electron::get_options())); options.emplace(std::make_pair(LongNameForTargetMachine(Analyser::Machine::MSX), MSX::get_options())); options.emplace(std::make_pair(LongNameForTargetMachine(Analyser::Machine::Oric), Oric::get_options())); diff --git a/OSBindings/Mac/Clock Signal/Machine/StaticAnalyser/CSStaticAnalyser.mm b/OSBindings/Mac/Clock Signal/Machine/StaticAnalyser/CSStaticAnalyser.mm index 34ee2dcc7..453cbb361 100644 --- a/OSBindings/Mac/Clock Signal/Machine/StaticAnalyser/CSStaticAnalyser.mm +++ b/OSBindings/Mac/Clock Signal/Machine/StaticAnalyser/CSStaticAnalyser.mm @@ -183,7 +183,7 @@ static Analyser::Static::ZX8081::Target::MemoryModel ZX8081MemoryModelFromSize(K - (NSString *)optionsPanelNibName { switch(_targets.front()->machine) { - case Analyser::Machine::AmstradCPC: return nil; + case Analyser::Machine::AppleII: return @"QuickLoadOptions"; case Analyser::Machine::Atari2600: return @"Atari2600Options"; case Analyser::Machine::Electron: return @"QuickLoadCompositeOptions"; case Analyser::Machine::MSX: return @"QuickLoadCompositeOptions";