From 2c2bb3765f3aa57931d6c9da57020651b30a5b8c Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Wed, 23 Jun 2021 19:32:34 -0400 Subject: [PATCH] Withdraws the EPDOS option. At least for now; it's something to worry about later. --- Analyser/Static/Enterprise/Target.hpp | 2 +- Machines/Enterprise/Enterprise.cpp | 46 +++++++++---------- .../Machine/StaticAnalyser/CSStaticAnalyser.h | 1 - .../StaticAnalyser/CSStaticAnalyser.mm | 1 - .../Base.lproj/MachinePicker.xib | 3 +- .../MachinePicker/MachinePicker.swift | 1 - 6 files changed, 25 insertions(+), 29 deletions(-) diff --git a/Analyser/Static/Enterprise/Target.hpp b/Analyser/Static/Enterprise/Target.hpp index 1785405c4..9200a3ce5 100644 --- a/Analyser/Static/Enterprise/Target.hpp +++ b/Analyser/Static/Enterprise/Target.hpp @@ -21,7 +21,7 @@ struct Target: public Analyser::Static::Target, public Reflection::StructImpl class ConcreteMachine: // Possibly add in a DOS. switch(target.dos) { - case Target::DOS::EPDOS: request = request && ROM::Request(ROM::Name::EnterpriseEPDOS); break; - case Target::DOS::EXDOS: request = request && ROM::Request(ROM::Name::EnterpriseEXDOS); break; + case Target::DOS::EXDOS: request = request && ROM::Request(ROM::Name::EnterpriseEXDOS); break; default: break; } @@ -181,14 +180,16 @@ template class ConcreteMachine: } } - // Extract the appropriate DOS ROM. - dos_.fill(0xff); - for(const auto rom_name: { ROM::Name::EnterpriseEPDOS, ROM::Name::EnterpriseEXDOS }) { - const auto dos = roms.find(rom_name); - if(dos != roms.end()) { - memcpy(dos_.data(), dos->second.data(), std::min(dos_.size(), dos->second.size())); - break; - } + // Extract the appropriate DOS ROMs. + epdos_rom_.fill(0xff); + const auto epdos = roms.find(ROM::Name::EnterpriseEPDOS); + if(epdos != roms.end()) { + memcpy(epdos_rom_.data(), epdos->second.data(), std::min(epdos_rom_.size(), epdos->second.size())); + } + exdos_rom_.fill(0xff); + const auto exdos = roms.find(ROM::Name::EnterpriseEXDOS); + if(exdos != roms.end()) { + memcpy(exdos_rom_.data(), exdos->second.data(), std::min(exdos_rom_.size(), exdos->second.size())); } // Seed key state. @@ -355,7 +356,8 @@ template class ConcreteMachine: std::array ram_; std::array exos_; std::array basic_; - std::array dos_; + std::array exdos_rom_; + std::array epdos_rom_; const uint8_t min_ram_slot_; const uint8_t *read_pointers_[4] = {nullptr, nullptr, nullptr, nullptr}; @@ -365,20 +367,18 @@ template class ConcreteMachine: template void page(uint8_t offset) { pages_[slot] = offset; - if(offset < exos_.size() / 0x4000) { - page(&exos_[offset * 0x4000], nullptr); - return; - } +#define Map(location, source) \ + if(offset >= location && offset < location + source.size() / 0x4000) { \ + page(&source[(offset - location) * 0x4000], nullptr); \ + return; \ + } - if(offset >= 16 && offset < 16 + basic_.size() / 0x4000) { - page(&basic_[(offset - 16) * 0x4000], nullptr); - return; - } + Map(0, exos_); + Map(16, basic_); + Map(32, exdos_rom_); + Map(48, epdos_rom_); - if(offset >= 32 && offset < 32 + dos_.size() / 0x4000) { - page(&dos_[(offset - 32) * 0x4000], nullptr); - return; - } +#undef Map // Of whatever size of RAM I've declared above, use only the final portion. // This correlated with Nick always having been handed the final 64kb and, diff --git a/OSBindings/Mac/Clock Signal/Machine/StaticAnalyser/CSStaticAnalyser.h b/OSBindings/Mac/Clock Signal/Machine/StaticAnalyser/CSStaticAnalyser.h index 11d6e9841..988fd9075 100644 --- a/OSBindings/Mac/Clock Signal/Machine/StaticAnalyser/CSStaticAnalyser.h +++ b/OSBindings/Mac/Clock Signal/Machine/StaticAnalyser/CSStaticAnalyser.h @@ -62,7 +62,6 @@ typedef NS_ENUM(NSInteger, CSMachineEnterpriseBASIC) { typedef NS_ENUM(NSInteger, CSMachineEnterpriseDOS) { CSMachineEnterpriseDOSEXDOS, - CSMachineEnterpriseDOSEPDOS, CSMachineEnterpriseDOSNone, }; diff --git a/OSBindings/Mac/Clock Signal/Machine/StaticAnalyser/CSStaticAnalyser.mm b/OSBindings/Mac/Clock Signal/Machine/StaticAnalyser/CSStaticAnalyser.mm index 787f33d6c..805fff5d1 100644 --- a/OSBindings/Mac/Clock Signal/Machine/StaticAnalyser/CSStaticAnalyser.mm +++ b/OSBindings/Mac/Clock Signal/Machine/StaticAnalyser/CSStaticAnalyser.mm @@ -161,7 +161,6 @@ switch(dos) { case CSMachineEnterpriseDOSEXDOS: target->dos = Target::DOS::EXDOS; break; - case CSMachineEnterpriseDOSEPDOS: target->dos = Target::DOS::EPDOS; break; default: case CSMachineEnterpriseDOSNone: target->dos = Target::DOS::None; break; } diff --git a/OSBindings/Mac/Clock Signal/MachinePicker/Base.lproj/MachinePicker.xib b/OSBindings/Mac/Clock Signal/MachinePicker/Base.lproj/MachinePicker.xib index 4b162af57..494e5dcdc 100644 --- a/OSBindings/Mac/Clock Signal/MachinePicker/Base.lproj/MachinePicker.xib +++ b/OSBindings/Mac/Clock Signal/MachinePicker/Base.lproj/MachinePicker.xib @@ -353,13 +353,12 @@ Gw - + - diff --git a/OSBindings/Mac/Clock Signal/MachinePicker/MachinePicker.swift b/OSBindings/Mac/Clock Signal/MachinePicker/MachinePicker.swift index dbf8c0b2e..970200e2a 100644 --- a/OSBindings/Mac/Clock Signal/MachinePicker/MachinePicker.swift +++ b/OSBindings/Mac/Clock Signal/MachinePicker/MachinePicker.swift @@ -303,7 +303,6 @@ class MachinePicker: NSObject, NSTableViewDataSource, NSTableViewDelegate { var dos: CSMachineEnterpriseDOS = .dosNone switch enterpriseDOSButton.selectedTag() { case 1: dos = .DOSEXDOS - case 2: dos = .DOSEPDOS case 0: fallthrough default: dos = .dosNone }