From 6d0e41b7608e9d9a7e66eae6db5ef0d2238746aa Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Thu, 19 Sep 2019 19:41:43 -0400 Subject: [PATCH] Adds "quick boot" as a standard option. I assume I'm going to reuse this. --- Configurable/StandardOptions.cpp | 9 +++++++++ Configurable/StandardOptions.hpp | 17 ++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/Configurable/StandardOptions.cpp b/Configurable/StandardOptions.cpp index 2aae5b393..4b57ce6ae 100644 --- a/Configurable/StandardOptions.cpp +++ b/Configurable/StandardOptions.cpp @@ -42,6 +42,7 @@ std::vector> Configurable::standard_option options.emplace_back(new Configurable::ListOption("Display", "display", display_options)); } if(mask & AutomaticTapeMotorControl) options.emplace_back(new Configurable::BooleanOption("Automatic Tape Motor Control", "autotapemotor")); + if(mask & QuickBoot) options.emplace_back(new Configurable::BooleanOption("Boot Quickly", "quickboot")); return options; } @@ -66,6 +67,10 @@ void Configurable::append_display_selection(Configurable::SelectionSet &selectio selection_set["display"] = std::unique_ptr(new Configurable::ListSelection(string_selection)); } +void Configurable::append_quick_boot_selection(Configurable::SelectionSet &selection_set, bool selection) { + append_bool(selection_set, "quickboot", selection); +} + // MARK: - Selection parsers bool Configurable::get_quick_load_tape(const Configurable::SelectionSet &selections_by_option, bool &result) { return get_bool(selections_by_option, "quickload", result); @@ -97,3 +102,7 @@ bool Configurable::get_display(const Configurable::SelectionSet &selections_by_o } return false; } + +bool Configurable::get_quick_boot(const Configurable::SelectionSet &selections_by_option, bool &result) { + return get_bool(selections_by_option, "quickboot", result); +} diff --git a/Configurable/StandardOptions.hpp b/Configurable/StandardOptions.hpp index a6a4a915d..fa042ee65 100644 --- a/Configurable/StandardOptions.hpp +++ b/Configurable/StandardOptions.hpp @@ -19,7 +19,8 @@ enum StandardOptions { DisplayCompositeColour = (1 << 2), DisplayCompositeMonochrome = (1 << 3), QuickLoadTape = (1 << 4), - AutomaticTapeMotorControl = (1 << 5) + AutomaticTapeMotorControl = (1 << 5), + QuickBoot = (1 << 6), }; enum class Display { @@ -49,6 +50,11 @@ void append_automatic_tape_motor_control_selection(SelectionSet &selection_set, */ void append_display_selection(SelectionSet &selection_set, Display selection); +/*! + Appends to @c selection_set a selection of @c selection for QuickBoot. +*/ +void append_quick_boot_selection(SelectionSet &selection_set, bool selection); + /*! Attempts to discern a QuickLoadTape selection from @c selections_by_option. @@ -76,6 +82,15 @@ bool get_automatic_tape_motor_control_selection(const SelectionSet &selections_b */ bool get_display(const SelectionSet &selections_by_option, Display &result); +/*! + Attempts to QuickBoot a QuickLoadTape selection from @c selections_by_option. + + @param selections_by_option The user selections. + @param result The location to which the selection will be stored if found. + @returns @c true if a selection is found; @c false otherwise. +*/ +bool get_quick_boot(const SelectionSet &selections_by_option, bool &result); + } #endif /* StandardOptions_hpp */