From 3d85e6bb97012f3222cd6c7c73010a235a46684a Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 31 Jan 2021 09:49:51 -0500 Subject: [PATCH 1/2] Adds Mac UI for new Electron configuration options. --- .../Machine/StaticAnalyser/CSStaticAnalyser.h | 2 +- .../StaticAnalyser/CSStaticAnalyser.mm | 8 ++-- .../Base.lproj/MachinePicker.xib | 44 ++++++++++++++----- .../MachinePicker/MachinePicker.swift | 12 ++++- 4 files changed, 49 insertions(+), 17 deletions(-) diff --git a/OSBindings/Mac/Clock Signal/Machine/StaticAnalyser/CSStaticAnalyser.h b/OSBindings/Mac/Clock Signal/Machine/StaticAnalyser/CSStaticAnalyser.h index 8fa8524a4..c4021e995 100644 --- a/OSBindings/Mac/Clock Signal/Machine/StaticAnalyser/CSStaticAnalyser.h +++ b/OSBindings/Mac/Clock Signal/Machine/StaticAnalyser/CSStaticAnalyser.h @@ -76,7 +76,7 @@ typedef int Kilobytes; - (nullable instancetype)initWithFileAtURL:(NSURL *)url; -- (instancetype)initWithElectronDFS:(BOOL)dfs adfs:(BOOL)adfs; +- (instancetype)initWithElectronDFS:(BOOL)dfs adfs:(BOOL)adfs ap6:(BOOL)ap6 sidewaysRAM:(BOOL)sidewaysRAM; - (instancetype)initWithAmstradCPCModel:(CSMachineCPCModel)model; - (instancetype)initWithMSXRegion:(CSMachineMSXRegion)region hasDiskDrive:(BOOL)hasDiskDrive; - (instancetype)initWithOricModel:(CSMachineOricModel)model diskInterface:(CSMachineOricDiskInterface)diskInterface; diff --git a/OSBindings/Mac/Clock Signal/Machine/StaticAnalyser/CSStaticAnalyser.mm b/OSBindings/Mac/Clock Signal/Machine/StaticAnalyser/CSStaticAnalyser.mm index 1ee71efa4..71eb87247 100644 --- a/OSBindings/Mac/Clock Signal/Machine/StaticAnalyser/CSStaticAnalyser.mm +++ b/OSBindings/Mac/Clock Signal/Machine/StaticAnalyser/CSStaticAnalyser.mm @@ -93,13 +93,15 @@ return self; } -- (instancetype)initWithElectronDFS:(BOOL)dfs adfs:(BOOL)adfs { +- (instancetype)initWithElectronDFS:(BOOL)dfs adfs:(BOOL)adfs ap6:(BOOL)ap6 sidewaysRAM:(BOOL)sidewaysRAM { self = [super init]; if(self) { using Target = Analyser::Static::Acorn::Target; auto target = std::make_unique(); - target->has_dfs = !!dfs; - target->has_adfs = !!adfs; + target->has_dfs = dfs; + target->has_adfs = adfs; + target->has_ap6_rom = ap6; + target->has_sideways_ram = sidewaysRAM; _targets.push_back(std::move(target)); } return self; diff --git a/OSBindings/Mac/Clock Signal/MachinePicker/Base.lproj/MachinePicker.xib b/OSBindings/Mac/Clock Signal/MachinePicker/Base.lproj/MachinePicker.xib index cb4c375c2..caab21366 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 @@ - + - + @@ -18,7 +18,7 @@ - + @@ -189,31 +189,49 @@ Gw - + + + - + + + + + @@ -257,18 +275,18 @@ Gw - + - + @@ -282,7 +300,7 @@ Gw - + @@ -551,7 +569,7 @@ Gw - + @@ -559,7 +577,9 @@ Gw + + diff --git a/OSBindings/Mac/Clock Signal/MachinePicker/MachinePicker.swift b/OSBindings/Mac/Clock Signal/MachinePicker/MachinePicker.swift index a67e11814..031de2cb8 100644 --- a/OSBindings/Mac/Clock Signal/MachinePicker/MachinePicker.swift +++ b/OSBindings/Mac/Clock Signal/MachinePicker/MachinePicker.swift @@ -18,6 +18,8 @@ class MachinePicker: NSObject { // MARK: - Electron properties @IBOutlet var electronDFSButton: NSButton? @IBOutlet var electronADFSButton: NSButton? + @IBOutlet var electronAP6Button: NSButton? + @IBOutlet var electronSidewaysRAMButton: NSButton? // MARK: - CPC properties @IBOutlet var cpcModelTypeButton: NSPopUpButton? @@ -65,6 +67,8 @@ class MachinePicker: NSObject { // Electron settings electronDFSButton?.state = standardUserDefaults.bool(forKey: "new.electronDFS") ? .on : .off electronADFSButton?.state = standardUserDefaults.bool(forKey: "new.electronADFS") ? .on : .off + electronAP6Button?.state = standardUserDefaults.bool(forKey: "new.electronAP6") ? .on : .off + electronSidewaysRAMButton?.state = standardUserDefaults.bool(forKey: "new.electronSidewaysRAM") ? .on : .off // CPC settings cpcModelTypeButton?.selectItem(withTag: standardUserDefaults.integer(forKey: "new.cpcModel")) @@ -106,6 +110,8 @@ class MachinePicker: NSObject { // Electron settings standardUserDefaults.set(electronDFSButton!.state == .on, forKey: "new.electronDFS") standardUserDefaults.set(electronADFSButton!.state == .on, forKey: "new.electronADFS") + standardUserDefaults.set(electronAP6Button!.state == .on, forKey: "new.electronAP6") + standardUserDefaults.set(electronSidewaysRAMButton!.state == .on, forKey: "new.electronSidewaysRAM") // CPC settings standardUserDefaults.set(cpcModelTypeButton!.selectedTag(), forKey: "new.cpcModel") @@ -140,7 +146,11 @@ class MachinePicker: NSObject { switch machineSelector!.selectedTabViewItem!.identifier as! String { case "electron": - return CSStaticAnalyser(electronDFS: electronDFSButton!.state == .on, adfs: electronADFSButton!.state == .on) + return CSStaticAnalyser( + electronDFS: electronDFSButton!.state == .on, + adfs: electronADFSButton!.state == .on, + ap6: electronAP6Button!.state == .on, + sidewaysRAM: electronSidewaysRAMButton!.state == .on) case "appleii": var model: CSMachineAppleIIModel = .appleII From 41a618c957736dbe1ebfbb0f53b9e53c225303bf Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 31 Jan 2021 10:13:32 -0500 Subject: [PATCH 2/2] Adds new Electron configuration options to the Qt UI. --- OSBindings/Qt/mainwindow.cpp | 4 ++++ OSBindings/Qt/mainwindow.ui | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/OSBindings/Qt/mainwindow.cpp b/OSBindings/Qt/mainwindow.cpp index 5e6b66410..8a0b781da 100644 --- a/OSBindings/Qt/mainwindow.cpp +++ b/OSBindings/Qt/mainwindow.cpp @@ -1164,6 +1164,8 @@ void MainWindow::start_electron() { target->has_dfs = ui->electronDFSCheckBox->isChecked(); target->has_adfs = ui->electronADFSCheckBox->isChecked(); + target->has_ap6_rom = ui->electronAP6CheckBox->isChecked(); + target->has_sideways_ram = ui->electronSidewaysRAMCheckBox->isChecked(); launchTarget(std::move(target)); } @@ -1298,6 +1300,8 @@ void MainWindow::launchTarget(std::unique_ptr &&target /* Electron. */ \ CheckBox(electronDFSCheckBox, "electron.hasDFS"); \ CheckBox(electronADFSCheckBox, "electron.hasADFS"); \ + CheckBox(electronAP6CheckBox, "electron.hasAP6"); \ + CheckBox(electronSidewaysRAMCheckBox, "electron.fillSidewaysRAM"); \ \ /* Macintosh. */ \ ComboBox(macintoshModelComboBox, "macintosh.model"); \ diff --git a/OSBindings/Qt/mainwindow.ui b/OSBindings/Qt/mainwindow.ui index a9439f40b..e7d29c142 100644 --- a/OSBindings/Qt/mainwindow.ui +++ b/OSBindings/Qt/mainwindow.ui @@ -201,6 +201,20 @@ + + + + With Advanced Plus 6 Utility ROM + + + + + + + Fill unused ROM banks with sideways RAM + + +