From 1a3b2b0620c307dc6e84dda44b26a5e99890e48e Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Wed, 15 Nov 2023 14:27:04 -0500 Subject: [PATCH] Add necessary wiring for File -> New... --- Machines/Utility/MachineForTarget.cpp | 5 + .../Machine/StaticAnalyser/CSStaticAnalyser.h | 5 + .../StaticAnalyser/CSStaticAnalyser.mm | 10 + .../Base.lproj/MachinePicker.xib | 186 +++++++++++------- .../MachinePicker/MachinePicker.swift | 3 + 5 files changed, 135 insertions(+), 74 deletions(-) diff --git a/Machines/Utility/MachineForTarget.cpp b/Machines/Utility/MachineForTarget.cpp index 8b0f3026a..8bde43eba 100644 --- a/Machines/Utility/MachineForTarget.cpp +++ b/Machines/Utility/MachineForTarget.cpp @@ -25,6 +25,7 @@ #include "../MasterSystem/MasterSystem.hpp" #include "../MSX/MSX.hpp" #include "../Oric/Oric.hpp" +#include "../PCCompatible/PCCompatible.hpp" #include "../Sinclair/ZX8081/ZX8081.hpp" #include "../Sinclair/ZXSpectrum/ZXSpectrum.hpp" @@ -69,6 +70,7 @@ Machine::DynamicMachine *Machine::MachineForTarget(const Analyser::Static::Targe Bind(Enterprise) Bind(MSX) Bind(Oric) + Bind(PCCompatible) BindD(Sega::MasterSystem, MasterSystem) BindD(Sinclair::ZX8081, ZX8081) BindD(Sinclair::ZXSpectrum, ZXSpectrum) @@ -139,6 +141,7 @@ std::string Machine::ShortNameForTargetMachine(const Analyser::Machine machine) case Analyser::Machine::MasterSystem: return "MasterSystem"; case Analyser::Machine::MSX: return "MSX"; case Analyser::Machine::Oric: return "Oric"; + case Analyser::Machine::PCCompatible: return "PCCompatible"; case Analyser::Machine::Vic20: return "Vic20"; case Analyser::Machine::ZX8081: return "ZX8081"; case Analyser::Machine::ZXSpectrum: return "ZXSpectrum"; @@ -162,6 +165,7 @@ std::string Machine::LongNameForTargetMachine(Analyser::Machine machine) { case Analyser::Machine::MasterSystem: return "Sega Master System"; case Analyser::Machine::MSX: return "MSX"; case Analyser::Machine::Oric: return "Oric"; + case Analyser::Machine::PCCompatible: return "PC Compatible"; case Analyser::Machine::Vic20: return "Vic 20"; case Analyser::Machine::ZX8081: return "ZX80/81"; case Analyser::Machine::ZXSpectrum: return "ZX Spectrum"; @@ -244,6 +248,7 @@ std::map> Machine::Target Add(Macintosh); Add(MSX); Add(Oric); + options.emplace(std::make_pair(LongNameForTargetMachine(Analyser::Machine::PCCompatible), new Analyser::Static::Target(Analyser::Machine::PCCompatible))); AddMapped(Vic20, Commodore); Add(ZX8081); Add(ZXSpectrum); diff --git a/OSBindings/Mac/Clock Signal/Machine/StaticAnalyser/CSStaticAnalyser.h b/OSBindings/Mac/Clock Signal/Machine/StaticAnalyser/CSStaticAnalyser.h index bcb958cb1..2028fb66f 100644 --- a/OSBindings/Mac/Clock Signal/Machine/StaticAnalyser/CSStaticAnalyser.h +++ b/OSBindings/Mac/Clock Signal/Machine/StaticAnalyser/CSStaticAnalyser.h @@ -123,6 +123,10 @@ typedef NS_ENUM(NSInteger, CSMachineMSXRegion) { CSMachineMSXRegionJapanese, }; +typedef NS_ENUM(NSInteger, CSPCCompatibleModel) { + CSPCCompatibleModelTurboXT, +}; + typedef int Kilobytes; @interface CSStaticAnalyser : NSObject @@ -143,6 +147,7 @@ typedef int Kilobytes; - (instancetype)initWithVic20Region:(CSMachineVic20Region)region memorySize:(Kilobytes)memorySize hasC1540:(BOOL)hasC1540; - (instancetype)initWithZX80MemorySize:(Kilobytes)memorySize useZX81ROM:(BOOL)useZX81ROM; - (instancetype)initWithZX81MemorySize:(Kilobytes)memorySize; +- (instancetype)initWithPCCompatibleModel:(CSPCCompatibleModel)model; @property(nonatomic, readonly, nullable) NSString *optionsNibName; @property(nonatomic, readonly) NSString *displayName; diff --git a/OSBindings/Mac/Clock Signal/Machine/StaticAnalyser/CSStaticAnalyser.mm b/OSBindings/Mac/Clock Signal/Machine/StaticAnalyser/CSStaticAnalyser.mm index dbca34373..bb7c8db8b 100644 --- a/OSBindings/Mac/Clock Signal/Machine/StaticAnalyser/CSStaticAnalyser.mm +++ b/OSBindings/Mac/Clock Signal/Machine/StaticAnalyser/CSStaticAnalyser.mm @@ -272,6 +272,16 @@ return self; } +- (instancetype)initWithPCCompatibleModel:(CSPCCompatibleModel)model { + self = [super init]; + if(self) { + using Target = Analyser::Static::Target; + auto target = std::make_unique(Analyser::Machine::PCCompatible); + _targets.push_back(std::move(target)); + } + return self; +} + - (instancetype)initWithSpectrumModel:(CSMachineSpectrumModel)model { self = [super init]; if(self) { diff --git a/OSBindings/Mac/Clock Signal/MachinePicker/Base.lproj/MachinePicker.xib b/OSBindings/Mac/Clock Signal/MachinePicker/Base.lproj/MachinePicker.xib index c3733c142..540acaa95 100644 --- a/OSBindings/Mac/Clock Signal/MachinePicker/Base.lproj/MachinePicker.xib +++ b/OSBindings/Mac/Clock Signal/MachinePicker/Base.lproj/MachinePicker.xib @@ -1,8 +1,8 @@ - + - + @@ -17,10 +17,10 @@ - - + + - + - + @@ -59,7 +59,7 @@ Gw - + @@ -81,7 +81,7 @@ Gw - + @@ -89,7 +89,7 @@ Gw - + @@ -148,7 +148,7 @@ Gw - + @@ -172,7 +172,7 @@ Gw - + @@ -180,7 +180,7 @@ Gw - + @@ -235,19 +235,19 @@ Gw - + - - + + - - + + @@ -255,7 +255,7 @@ Gw - + @@ -269,7 +269,7 @@ Gw - + @@ -303,7 +303,7 @@ Gw - + @@ -338,32 +338,32 @@ Gw - +