diff --git a/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj b/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj index 38df9ccb5..4687fe9c1 100644 --- a/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj +++ b/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj @@ -723,8 +723,6 @@ 4B2A53971D117D36003C6002 /* KeyCodes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KeyCodes.h; sourceTree = ""; }; 4B2A53991D117D36003C6002 /* CSAtari2600.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSAtari2600.h; sourceTree = ""; }; 4B2A539A1D117D36003C6002 /* CSAtari2600.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CSAtari2600.mm; sourceTree = ""; }; - 4B2A539D1D117D36003C6002 /* CSVic20.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSVic20.h; sourceTree = ""; }; - 4B2A539E1D117D36003C6002 /* CSVic20.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CSVic20.mm; sourceTree = ""; }; 4B2AF8681E513FC20027EE29 /* TIATests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TIATests.mm; sourceTree = ""; }; 4B2B3A471F9B8FA70062DABF /* Typer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Typer.cpp; sourceTree = ""; }; 4B2B3A481F9B8FA70062DABF /* MemoryFuzzer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MemoryFuzzer.cpp; sourceTree = ""; }; @@ -977,7 +975,6 @@ 4B98A1CD1FFADEC400ADF63B /* MSX ROMs */ = {isa = PBXFileReference; lastKnownFileType = folder; path = "MSX ROMs"; sourceTree = ""; }; 4B9BE3FE203A0C0600FFAE60 /* MultiSpeaker.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = MultiSpeaker.cpp; sourceTree = ""; }; 4B9BE3FF203A0C0600FFAE60 /* MultiSpeaker.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = MultiSpeaker.hpp; sourceTree = ""; }; - 4B9CCDA01DA279CA0098B625 /* Vic20OptionsPanel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Vic20OptionsPanel.swift; sourceTree = ""; }; 4BA0F68C1EEA0E8400E9489E /* ZX8081.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ZX8081.cpp; path = Data/ZX8081.cpp; sourceTree = ""; }; 4BA0F68D1EEA0E8400E9489E /* ZX8081.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ZX8081.hpp; path = Data/ZX8081.hpp; sourceTree = ""; }; 4BA61EAE1D91515900B3C876 /* NSData+StdVector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSData+StdVector.h"; sourceTree = ""; }; @@ -1375,7 +1372,6 @@ 4BEF6AA91D35CE9E00E73575 /* DigitalPhaseLockedLoopBridge.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DigitalPhaseLockedLoopBridge.mm; sourceTree = ""; }; 4BEF6AAB1D35D1C400E73575 /* DPLLTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DPLLTests.swift; sourceTree = ""; }; 4BF4A2D91F534DB300B171F4 /* TargetPlatforms.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = TargetPlatforms.hpp; sourceTree = ""; }; - 4BF4A2DA1F5365C600B171F4 /* CSZX8081+Instantiation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CSZX8081+Instantiation.h"; sourceTree = ""; }; 4BF6606A1F281573002CB053 /* ClockReceiver.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ClockReceiver.hpp; sourceTree = ""; }; 4BF8295F1D8F3C87001BAE39 /* CRC.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = CRC.hpp; path = ../../NumberTheory/CRC.hpp; sourceTree = ""; }; 4BFCA1211ECBDCAF00AC40C1 /* AllRAMProcessor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AllRAMProcessor.cpp; sourceTree = ""; }; @@ -1581,11 +1577,8 @@ isa = PBXGroup; children = ( 4B2A53991D117D36003C6002 /* CSAtari2600.h */, - 4B2A539D1D117D36003C6002 /* CSVic20.h */, 4B14978D1EE4B4D200CE2596 /* CSZX8081.h */, - 4BF4A2DA1F5365C600B171F4 /* CSZX8081+Instantiation.h */, 4B2A539A1D117D36003C6002 /* CSAtari2600.mm */, - 4B2A539E1D117D36003C6002 /* CSVic20.mm */, 4B14978E1EE4B4D200CE2596 /* CSZX8081.mm */, ); path = Wrappers; @@ -1881,7 +1874,6 @@ 4B8FE21F1DA19D7C0090D3CE /* Atari2600OptionsPanel.swift */, 4B55CE5E1C3B7D960093A61B /* MachineDocument.swift */, 4B8FE2211DA19FB20090D3CE /* MachinePanel.swift */, - 4B9CCDA01DA279CA0098B625 /* Vic20OptionsPanel.swift */, 4B95FA9C1F11893B0008E395 /* ZX8081OptionsPanel.swift */, 4B38F34D1F2EC6BA00D9235D /* AmstradCPCOptions.xib */, 4B8FE2131DA19D5F0090D3CE /* Atari2600Options.xib */, diff --git a/OSBindings/Mac/Clock Signal/ClockSignal-Bridging-Header.h b/OSBindings/Mac/Clock Signal/ClockSignal-Bridging-Header.h index 18f0f2e7d..e993b600d 100644 --- a/OSBindings/Mac/Clock Signal/ClockSignal-Bridging-Header.h +++ b/OSBindings/Mac/Clock Signal/ClockSignal-Bridging-Header.h @@ -6,7 +6,6 @@ #import "CSFastLoading.h" #import "CSAtari2600.h" -#import "CSVic20.h" #import "CSZX8081.h" #import "CSStaticAnalyser.h" diff --git a/OSBindings/Mac/Clock Signal/Documents/Vic20OptionsPanel.swift b/OSBindings/Mac/Clock Signal/Documents/Vic20OptionsPanel.swift deleted file mode 100644 index c7b02bd6d..000000000 --- a/OSBindings/Mac/Clock Signal/Documents/Vic20OptionsPanel.swift +++ /dev/null @@ -1,97 +0,0 @@ -// -// Vic20OptionsPanel.swift -// Clock Signal -// -// Created by Thomas Harte on 03/10/2016. -// Copyright © 2016 Thomas Harte. All rights reserved. -// - -class Vic20OptionsPanel: MachinePanel { - var vic20: CSVic20! { - get { - return self.machine as! CSVic20 - } - } - - // MARK: country selector - @IBOutlet var countryButton: NSPopUpButton? - var countryUserDefaultsKey: String { - get { return prefixedUserDefaultsKey("country") } - } - - @IBAction func setCountry(_ sender: NSPopUpButton!) { - UserDefaults.standard.set(sender.indexOfSelectedItem, forKey: self.countryUserDefaultsKey) - setCountry(sender.indexOfSelectedItem) - } - - fileprivate func setCountry(_ countryID: Int) { - switch countryID { - case 0: // Danish - vic20.country = .danish - case 1: // European - vic20.country = .european - case 2: // Japanese - vic20.country = .japanese - case 3: // Swedish - vic20.country = .swedish - case 4: // US - vic20.country = .american - default: break - } - } - - // MARK: memory model selector - @IBOutlet var memorySizeButton: NSPopUpButton? - var memorySizeUserDefaultsKey: String { - get { return prefixedUserDefaultsKey("memorySize") } - } - - @IBAction func setMemorySize(_ sender: NSPopUpButton!) { - var selectedSize: Int? - switch sender.indexOfSelectedItem { - case 0: selectedSize = 5 - case 1: selectedSize = 8 - case 2: selectedSize = 32 - default: break - } - if let selectedSize = selectedSize { - UserDefaults.standard.set(selectedSize, forKey: self.memorySizeUserDefaultsKey) - setMemorySize(sender.indexOfSelectedItem) - } - } - fileprivate func setMemorySize(_ sizeIndex: Int) { - switch sizeIndex { - case 2: vic20.memorySize = .size32Kb - case 1: vic20.memorySize = .size8Kb - default: vic20.memorySize = .size5Kb - } - } - - // MARK: option restoration - override func establishStoredOptions() { - super.establishStoredOptions() - - let standardUserDefaults = UserDefaults.standard - standardUserDefaults.register(defaults: [ - self.memorySizeUserDefaultsKey: 5, - self.countryUserDefaultsKey: 1 - ]) - -// 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) - setCountry(country) - self.countryButton?.selectItem(at: country) - } -} diff --git a/OSBindings/Mac/Clock Signal/Machine/Wrappers/CSVic20.h b/OSBindings/Mac/Clock Signal/Machine/Wrappers/CSVic20.h deleted file mode 100644 index 13dcc4733..000000000 --- a/OSBindings/Mac/Clock Signal/Machine/Wrappers/CSVic20.h +++ /dev/null @@ -1,35 +0,0 @@ -// -// CSVic20.h -// Clock Signal -// -// Created by Thomas Harte on 04/06/2016. -// Copyright © 2016 Thomas Harte. All rights reserved. -// - -#import "CSMachine.h" -#import "CSFastLoading.h" - -typedef NS_ENUM(NSInteger, CSVic20Country) -{ - CSVic20CountryAmerican, - CSVic20CountryDanish, - CSVic20CountryEuropean, - CSVic20CountryJapanese, - CSVic20CountrySwedish -}; - -typedef NS_ENUM(NSInteger, CSVic20MemorySize) -{ - CSVic20MemorySize5Kb, - CSVic20MemorySize8Kb, - CSVic20MemorySize32Kb, -}; - -@interface CSVic20 : CSMachine - -- (instancetype)init; - -@property (nonatomic, assign) CSVic20Country country; -@property (nonatomic, assign) CSVic20MemorySize memorySize; - -@end diff --git a/OSBindings/Mac/Clock Signal/Machine/Wrappers/CSVic20.mm b/OSBindings/Mac/Clock Signal/Machine/Wrappers/CSVic20.mm deleted file mode 100644 index 58755b490..000000000 --- a/OSBindings/Mac/Clock Signal/Machine/Wrappers/CSVic20.mm +++ /dev/null @@ -1,66 +0,0 @@ -// -// CSVic20.m -// Clock Signal -// -// Created by Thomas Harte on 04/06/2016. -// Copyright © 2016 Thomas Harte. All rights reserved. -// - -#import "CSVic20.h" - -#include "Vic20.hpp" -#include "TypedDynamicMachine.hpp" - -@implementation CSVic20 { - Machine::TypedDynamicMachine _vic20; -} - -- (instancetype)init { - _vic20 = Machine::TypedDynamicMachine(Commodore::Vic20::Machine::Vic20()); - return nil;//[super initWithMachine:&_vic20]; -} - -- (NSString *)userDefaultsPrefix { return @"vic20"; } - -#pragma mark - Keyboard map - -/*- (void)setKey:(uint16_t)key isPressed:(BOOL)isPressed { - switch(key) { - case VK_UpArrow: _vic20->set_joystick_state(JoystickInput::Up, isPressed); break; - case VK_DownArrow: _vic20->set_joystick_state(JoystickInput::Down, isPressed); break; - case VK_LeftArrow: _vic20->set_joystick_state(JoystickInput::Left, isPressed); break; - case VK_RightArrow: _vic20->set_joystick_state(JoystickInput::Right, isPressed); break; - case VK_ANSI_A: _vic20->set_joystick_state(JoystickInput::Fire, isPressed); break; - } -}*/ - -#pragma mark - Public configuration options - -- (void)setCountry:(CSVic20Country)country { - _country = country; - Commodore::Vic20::Region region; - switch(country) { - case CSVic20CountryDanish: region = Commodore::Vic20::Danish; break; - case CSVic20CountryEuropean: region = Commodore::Vic20::European; break; - case CSVic20CountryJapanese: region = Commodore::Vic20::Japanese; break; - case CSVic20CountrySwedish: region = Commodore::Vic20::Swedish; break; - case CSVic20CountryAmerican: region = Commodore::Vic20::American; break; - } - - @synchronized(self) { - _vic20.get()->set_region(region); - } -} - -- (void)setMemorySize:(CSVic20MemorySize)memorySize { - _memorySize = memorySize; - @synchronized(self) { - switch(memorySize) { - case CSVic20MemorySize5Kb: _vic20.get()->set_memory_size(Commodore::Vic20::Default); break; - case CSVic20MemorySize8Kb: _vic20.get()->set_memory_size(Commodore::Vic20::ThreeKB); break; - case CSVic20MemorySize32Kb: _vic20.get()->set_memory_size(Commodore::Vic20::ThirtyTwoKB); break; - } - } -} - -@end diff --git a/OSBindings/Mac/Clock Signal/Machine/Wrappers/CSZX8081+Instantiation.h b/OSBindings/Mac/Clock Signal/Machine/Wrappers/CSZX8081+Instantiation.h deleted file mode 100644 index 600046fb2..000000000 --- a/OSBindings/Mac/Clock Signal/Machine/Wrappers/CSZX8081+Instantiation.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// CSZX8081+Instantiation.h -// Clock Signal -// -// Created by Thomas Harte on 27/08/2017. -// Copyright © 2017 Thomas Harte. All rights reserved. -// - -#include "StaticAnalyser.hpp" -#import "CSZX8081.h" - -@interface CSZX8081 (Instantiation) - -- (instancetype)initWithIntendedTarget:(const Analyser::Static::Target &)target; - -@end