1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-01-10 00:29:40 +00:00

Merge pull request #1438 from TomHarte/Plus4UI

Add Plus 4 to Mac UI.
This commit is contained in:
Thomas Harte 2025-01-03 23:10:45 -05:00 committed by GitHub
commit c1ecfd289e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 70 additions and 16 deletions

View File

@ -133,7 +133,7 @@ class ConcreteMachine:
public Machine,
public Utility::TypeRecipient<CharacterMapper> {
public:
ConcreteMachine(const Analyser::Static::Commodore::Target &target, const ROMMachine::ROMFetcher &rom_fetcher) :
ConcreteMachine(const Analyser::Static::Target &target, const ROMMachine::ROMFetcher &rom_fetcher) :
m6502_(*this),
interrupts_(*this),
timers_(interrupts_),
@ -557,7 +557,7 @@ std::unique_ptr<Machine> Machine::Plus4(
const Analyser::Static::Target *target,
const ROMMachine::ROMFetcher &rom_fetcher
) {
using Target = Analyser::Static::Commodore::Target;
using Target = Analyser::Static::Target;
const Target *const commodore_target = dynamic_cast<const Target *>(target);
return std::make_unique<ConcreteMachine>(*commodore_target, rom_fetcher);
}

View File

@ -62,7 +62,7 @@
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
enableASanStackUseAfterReturn = "YES"

View File

@ -39,6 +39,11 @@ typedef NS_ENUM(NSInteger, CSMachineArchimedesModel) {
CSMachineArchimedesModelFirstGeneration,
};
typedef NS_ENUM(NSInteger, CSMachineCommodoreTEDModel) {
CSMachineCommodoreTEDModelC16,
CSMachineCommodoreTEDModelPlus4,
};
typedef NS_ENUM(NSInteger, CSMachineCPCModel) {
CSMachineCPCModel464,
CSMachineCPCModel664,
@ -145,6 +150,7 @@ typedef int Kilobytes;
- (instancetype)initWithAppleIIgsModel:(CSMachineAppleIIgsModel)model memorySize:(Kilobytes)memorySize;
- (instancetype)initWithArchimedesModel:(CSMachineArchimedesModel)model;
- (instancetype)initWithAtariSTMemorySize:(Kilobytes)memorySize;
- (instancetype)initWithCommodoreTEDModel:(CSMachineCommodoreTEDModel)model;
- (instancetype)initWithElectronDFS:(BOOL)dfs adfs:(BOOL)adfs ap6:(BOOL)ap6 sidewaysRAM:(BOOL)sidewaysRAM;
- (instancetype)initWithEnterpriseModel:(CSMachineEnterpriseModel)model speed:(CSMachineEnterpriseSpeed)speed exosVersion:(CSMachineEnterpriseEXOS)exosVersion basicVersion:(CSMachineEnterpriseBASIC)basicVersion dos:(CSMachineEnterpriseDOS)dos;
- (instancetype)initWithMacintoshModel:(CSMachineMacintoshModel)model;

View File

@ -151,15 +151,25 @@
using Target = Analyser::Static::AtariST::Target;
auto target = std::make_unique<Target>();
switch(memorySize) {
default: target->memory_size = Target::MemorySize::FiveHundredAndTwelveKilobytes; break;
case 1024: target->memory_size = Target::MemorySize::OneMegabyte; break;
case 4096: target->memory_size = Target::MemorySize::FourMegabytes; break;
default: target->memory_size = Target::MemorySize::FiveHundredAndTwelveKilobytes; break;
case 1024: target->memory_size = Target::MemorySize::OneMegabyte; break;
case 4096: target->memory_size = Target::MemorySize::FourMegabytes; break;
}
_targets.push_back(std::move(target));
}
return self;
}
- (instancetype)initWithCommodoreTEDModel:(CSMachineCommodoreTEDModel)model {
self = [super init];
if(self) {
using Target = Analyser::Static::Target;
auto target = std::make_unique<Target>(Analyser::Machine::Plus4);
_targets.push_back(std::move(target));
}
return self;
}
- (instancetype)initWithElectronDFS:(BOOL)dfs adfs:(BOOL)adfs ap6:(BOOL)ap6 sidewaysRAM:(BOOL)sidewaysRAM {
self = [super init];
if(self) {

View File

@ -17,10 +17,10 @@
<window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" titleVisibility="hidden" id="QvC-M9-y7g">
<windowStyleMask key="styleMask" titled="YES" documentModal="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="196" y="240" width="590" height="369"/>
<rect key="contentRect" x="196" y="240" width="590" height="389"/>
<rect key="screenRect" x="0.0" y="0.0" width="1470" height="924"/>
<view key="contentView" wantsLayer="YES" id="EiT-Mj-1SZ">
<rect key="frame" x="0.0" y="0.0" width="590" height="369"/>
<rect key="frame" x="0.0" y="0.0" width="590" height="389"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="hKn-1l-OSN">
@ -59,13 +59,13 @@ Gw
</textFieldCell>
</textField>
<scrollView borderType="line" autohidesScrollers="YES" horizontalLineScroll="24" horizontalPageScroll="10" verticalLineScroll="24" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="z5Q-Bs-hJj">
<rect key="frame" x="20" y="50" width="130" height="270"/>
<rect key="frame" x="20" y="50" width="130" height="290"/>
<clipView key="contentView" id="O8s-Vw-9yQ">
<rect key="frame" x="1" y="1" width="128" height="268"/>
<rect key="frame" x="1" y="1" width="128" height="288"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="none" columnReordering="NO" columnResizing="NO" multipleSelection="NO" emptySelection="NO" autosaveColumns="NO" typeSelect="NO" rowHeight="24" id="3go-Eb-GOy">
<rect key="frame" x="0.0" y="0.0" width="128" height="268"/>
<rect key="frame" x="0.0" y="0.0" width="128" height="288"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<size key="intercellSpacing" width="17" height="0.0"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
@ -105,7 +105,7 @@ Gw
</scroller>
</scrollView>
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="VAc-6N-O7q">
<rect key="frame" x="18" y="328" width="554" height="21"/>
<rect key="frame" x="18" y="348" width="554" height="21"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="Choose a machine" id="32m-Vs-dPO">
<font key="font" textStyle="title2" name=".SFNS-Regular"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@ -113,7 +113,7 @@ Gw
</textFieldCell>
</textField>
<tabView type="noTabsBezelBorder" translatesAutoresizingMaskIntoConstraints="NO" id="VUb-QG-x7c">
<rect key="frame" x="154" y="47" width="420" height="274"/>
<rect key="frame" x="154" y="47" width="420" height="294"/>
<font key="font" metaFont="system"/>
<tabViewItems>
<tabViewItem label="Amiga" identifier="amiga" id="JmB-OF-xcM">
@ -421,6 +421,27 @@ Gw
</constraints>
</view>
</tabViewItem>
<tabViewItem label="Commodore TED" identifier="c16plus4" id="8zk-1k-5AC" userLabel="Commodore TED">
<view key="view" id="JoI-6t-qsH">
<rect key="frame" x="10" y="7" width="400" height="274"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Sbs-hE-B7B">
<rect key="frame" x="18" y="238" width="364" height="16"/>
<textFieldCell key="cell" lineBreakMode="clipping" alignment="center" title="At present only a 64kb Commodore 16 is available." id="Sh8-Y5-Giz">
<font key="font" usesAppearanceFont="YES"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
<constraints>
<constraint firstItem="Sbs-hE-B7B" firstAttribute="leading" secondItem="JoI-6t-qsH" secondAttribute="leading" constant="20" symbolic="YES" id="72I-3B-f1k"/>
<constraint firstItem="Sbs-hE-B7B" firstAttribute="top" secondItem="JoI-6t-qsH" secondAttribute="top" constant="20" symbolic="YES" id="vvk-Dc-0KN"/>
<constraint firstAttribute="trailing" secondItem="Sbs-hE-B7B" secondAttribute="trailing" constant="20" symbolic="YES" id="xMF-do-3ah"/>
</constraints>
</view>
</tabViewItem>
<tabViewItem label="Electron" identifier="electron" id="muc-z9-Vqc">
<view key="view" id="SRc-2D-95G">
<rect key="frame" x="10" y="7" width="400" height="254"/>

View File

@ -275,7 +275,11 @@ class MachinePicker: NSObject, NSTableViewDataSource, NSTableViewDelegate {
switch machineSelector.selectedTabViewItem!.identifier as! String {
case "amiga":
return CSStaticAnalyser(amigaModel: .A500, chipMemorySize: Kilobytes(amigaChipRAMButton.selectedTag()), fastMemorySize: Kilobytes(amigaFastRAMButton.selectedTag()))
return CSStaticAnalyser(
amigaModel: .A500,
chipMemorySize: Kilobytes(amigaChipRAMButton.selectedTag()),
fastMemorySize: Kilobytes(amigaFastRAMButton.selectedTag())
)
case "appleii":
var model: CSMachineAppleIIModel = .appleII
@ -295,7 +299,11 @@ class MachinePicker: NSObject, NSTableViewDataSource, NSTableViewDelegate {
default: diskController = .none
}
return CSStaticAnalyser(appleIIModel: model, diskController: diskController, hasMockingboard: appleIIMockingboardButton.state == .on)
return CSStaticAnalyser(
appleIIModel: model,
diskController: diskController,
hasMockingboard: appleIIMockingboardButton.state == .on
)
case "appleiigs":
var model: CSMachineAppleIIgsModel = .ROM00
@ -316,6 +324,9 @@ class MachinePicker: NSObject, NSTableViewDataSource, NSTableViewDelegate {
let memorySize = Kilobytes(atariSTMemorySizeButton.selectedTag())
return CSStaticAnalyser(atariSTMemorySize: memorySize)
case "c16plus4":
return CSStaticAnalyser(commodoreTEDModel: .C16)
case "cpc":
switch cpcModelTypeButton.selectedTag() {
case 464: return CSStaticAnalyser(amstradCPCModel: .model464)
@ -371,7 +382,13 @@ class MachinePicker: NSObject, NSTableViewDataSource, NSTableViewDelegate {
default: dos = .dosNone
}
return CSStaticAnalyser(enterpriseModel: model, speed: speed, exosVersion: exos, basicVersion: basic, dos: dos)
return CSStaticAnalyser(
enterpriseModel: model,
speed: speed,
exosVersion: exos,
basicVersion: basic,
dos: dos
)
case "mac":
switch macintoshModelTypeButton.selectedTag() {