From 8e35e913bb526d8edf627723ef15bd0e4df21113 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 14 May 2017 16:59:24 -0400 Subject: [PATCH] Formally withdrew the 'load automatically' option for the Vic, having removed that option elsewhere. --- Machines/Commodore/Vic-20/Vic20.cpp | 30 ++++----- Machines/Commodore/Vic-20/Vic20.hpp | 3 +- .../Clock Signal/Base.lproj/Vic20Options.xib | 67 ++++++++----------- .../Documents/Vic20OptionsPanel.swift | 41 +++--------- .../Clock Signal/Machine/Wrappers/CSVic20.h | 1 - .../Clock Signal/Machine/Wrappers/CSVic20.mm | 7 -- 6 files changed, 53 insertions(+), 96 deletions(-) diff --git a/Machines/Commodore/Vic-20/Vic20.cpp b/Machines/Commodore/Vic-20/Vic20.cpp index 3d48552f2..f67afb99f 100644 --- a/Machines/Commodore/Vic-20/Vic20.cpp +++ b/Machines/Commodore/Vic-20/Vic20.cpp @@ -289,23 +289,21 @@ void Machine::configure_as_target(const StaticAnalyser::Target &target) { write_to_map(processor_read_memory_map_, rom_, rom_address_, 0x2000); } -// if(should_automatically_load_media_) { - if(target.loadingCommand.length()) { - set_typer_for_string(target.loadingCommand.c_str()); - } + if(target.loadingCommand.length()) { + set_typer_for_string(target.loadingCommand.c_str()); + } - switch(target.vic20.memory_model) { - case StaticAnalyser::Vic20MemoryModel::Unexpanded: - set_memory_size(Default); - break; - case StaticAnalyser::Vic20MemoryModel::EightKB: - set_memory_size(ThreeKB); - break; - case StaticAnalyser::Vic20MemoryModel::ThirtyTwoKB: - set_memory_size(ThirtyTwoKB); - break; - } -// } + switch(target.vic20.memory_model) { + case StaticAnalyser::Vic20MemoryModel::Unexpanded: + set_memory_size(Default); + break; + case StaticAnalyser::Vic20MemoryModel::EightKB: + set_memory_size(ThreeKB); + break; + case StaticAnalyser::Vic20MemoryModel::ThirtyTwoKB: + set_memory_size(ThirtyTwoKB); + break; + } } void Machine::tape_did_change_input(Storage::Tape::BinaryTapePlayer *tape) { diff --git a/Machines/Commodore/Vic-20/Vic20.hpp b/Machines/Commodore/Vic-20/Vic20.hpp index c381b5441..749b55466 100644 --- a/Machines/Commodore/Vic-20/Vic20.hpp +++ b/Machines/Commodore/Vic-20/Vic20.hpp @@ -166,7 +166,6 @@ class Machine: void set_region(Region region); inline void set_use_fast_tape_hack(bool activate) { use_fast_tape_hack_ = activate; } -// inline void set_should_automatically_load_media(bool activate) { should_automatically_load_media_ = activate; } // to satisfy CPU6502::Processor unsigned int perform_bus_operation(CPU6502::BusOperation operation, uint16_t address, uint8_t *value); @@ -216,7 +215,7 @@ class Machine: // Tape std::shared_ptr tape_; - bool use_fast_tape_hack_;//, should_automatically_load_media_; + bool use_fast_tape_hack_; bool is_running_at_zero_cost_; // Disk diff --git a/OSBindings/Mac/Clock Signal/Base.lproj/Vic20Options.xib b/OSBindings/Mac/Clock Signal/Base.lproj/Vic20Options.xib index 2284abe76..c578c2188 100644 --- a/OSBindings/Mac/Clock Signal/Base.lproj/Vic20Options.xib +++ b/OSBindings/Mac/Clock Signal/Base.lproj/Vic20Options.xib @@ -1,7 +1,8 @@ - + - + + @@ -14,14 +15,14 @@ - + - + - - - - - - - - - - - - - - - - - - - + @@ -76,18 +50,32 @@ + + + + + + + + + + + + + + + + + + - - - - + - @@ -96,10 +84,9 @@ - - + diff --git a/OSBindings/Mac/Clock Signal/Documents/Vic20OptionsPanel.swift b/OSBindings/Mac/Clock Signal/Documents/Vic20OptionsPanel.swift index f491b6e1c..c7b02bd6d 100644 --- a/OSBindings/Mac/Clock Signal/Documents/Vic20OptionsPanel.swift +++ b/OSBindings/Mac/Clock Signal/Documents/Vic20OptionsPanel.swift @@ -13,18 +13,6 @@ class Vic20OptionsPanel: MachinePanel { } } - // MARK: automatic loading tick box - @IBOutlet var loadAutomaticallyButton: NSButton? - var autoloadingUserDefaultsKey: String { - get { return prefixedUserDefaultsKey("autoload") } - } - - @IBAction func setShouldLoadAutomatically(_ sender: NSButton!) { - let loadAutomatically = sender.state == NSOnState - vic20.shouldLoadAutomatically = loadAutomatically - UserDefaults.standard.set(loadAutomatically, forKey: self.autoloadingUserDefaultsKey) - } - // MARK: country selector @IBOutlet var countryButton: NSPopUpButton? var countryUserDefaultsKey: String { @@ -85,28 +73,21 @@ class Vic20OptionsPanel: MachinePanel { let standardUserDefaults = UserDefaults.standard standardUserDefaults.register(defaults: [ - self.autoloadingUserDefaultsKey: true, self.memorySizeUserDefaultsKey: 5, self.countryUserDefaultsKey: 1 ]) - let loadAutomatically = standardUserDefaults.bool(forKey: self.autoloadingUserDefaultsKey) - vic20.shouldLoadAutomatically = loadAutomatically - self.loadAutomaticallyButton?.state = loadAutomatically ? NSOnState : NSOffState - - if !loadAutomatically { - let memorySize = standardUserDefaults.integer(forKey: self.memorySizeUserDefaultsKey) - var indexToSelect: Int? - switch memorySize { - case 32: indexToSelect = 2 - case 8: indexToSelect = 1 - default: indexToSelect = 0 - } - if let indexToSelect = indexToSelect { - self.memorySizeButton?.selectItem(at: indexToSelect) - setMemorySize(indexToSelect) - } - } +// let memorySize = standardUserDefaults.integer(forKey: self.memorySizeUserDefaultsKey) +// var indexToSelect: Int? +// switch memorySize { +// case 32: indexToSelect = 2 +// case 8: indexToSelect = 1 +// default: indexToSelect = 0 +// } +// if let indexToSelect = indexToSelect { +// self.memorySizeButton?.selectItem(at: indexToSelect) +// setMemorySize(indexToSelect) +// } // TODO: this should be part of the configuration let country = standardUserDefaults.integer(forKey: self.countryUserDefaultsKey) diff --git a/OSBindings/Mac/Clock Signal/Machine/Wrappers/CSVic20.h b/OSBindings/Mac/Clock Signal/Machine/Wrappers/CSVic20.h index 5ec512dc9..5e97f7209 100644 --- a/OSBindings/Mac/Clock Signal/Machine/Wrappers/CSVic20.h +++ b/OSBindings/Mac/Clock Signal/Machine/Wrappers/CSVic20.h @@ -29,7 +29,6 @@ typedef NS_ENUM(NSInteger, CSVic20MemorySize) @interface CSVic20 : CSMachine @property (nonatomic, assign) BOOL useFastLoadingHack; -@property (nonatomic, assign) BOOL shouldLoadAutomatically; @property (nonatomic, assign) CSVic20Country country; @property (nonatomic, assign) CSVic20MemorySize memorySize; diff --git a/OSBindings/Mac/Clock Signal/Machine/Wrappers/CSVic20.mm b/OSBindings/Mac/Clock Signal/Machine/Wrappers/CSVic20.mm index 46fac4973..c2f700ec5 100644 --- a/OSBindings/Mac/Clock Signal/Machine/Wrappers/CSVic20.mm +++ b/OSBindings/Mac/Clock Signal/Machine/Wrappers/CSVic20.mm @@ -178,13 +178,6 @@ using namespace Commodore::Vic20; } } -- (void)setShouldLoadAutomatically:(BOOL)shouldLoadAutomatically { - _shouldLoadAutomatically = shouldLoadAutomatically; - @synchronized(self) { -// _vic20.set_should_automatically_load_media(shouldLoadAutomatically ? true : false); - } -} - - (void)setCountry:(CSVic20Country)country { _country = country; NSString *charactersROM, *kernelROM;