This commit is contained in:
Kelvin Sherlock 2020-08-19 23:19:12 -04:00
parent 75b3dd3749
commit 7b6d4de5b1
7 changed files with 266 additions and 151 deletions

17
FlippedView.h Normal file
View File

@ -0,0 +1,17 @@
//
// FlippedView.h
// MA2ME
//
// Created by Kelvin Sherlock on 8/19/2020.
// Copyright © 2020 Kelvin Sherlock. All rights reserved.
//
#import <Cocoa/Cocoa.h>
NS_ASSUME_NONNULL_BEGIN
@interface FlippedView : NSView
@end
NS_ASSUME_NONNULL_END

17
FlippedView.m Normal file
View File

@ -0,0 +1,17 @@
//
// FlippedView.m
// MA2ME
//
// Created by Kelvin Sherlock on 8/19/2020.
// Copyright © 2020 Kelvin Sherlock. All rights reserved.
//
#import "FlippedView.h"
@implementation FlippedView
-(BOOL)isFlipped {
return YES;
}
@end

View File

@ -8,6 +8,8 @@
/* Begin PBXBuildFile section */
B60A6E0C24ECE23F004B7EEF /* apple2gs.plist in Resources */ = {isa = PBXBuildFile; fileRef = B60A6E0B24ECE23F004B7EEF /* apple2gs.plist */; };
B60A6E0F24EDFB88004B7EEF /* SlotView2.xib in Resources */ = {isa = PBXBuildFile; fileRef = B60A6E0D24EDFB88004B7EEF /* SlotView2.xib */; };
B60A6E1424EE0AE2004B7EEF /* FlippedView.m in Sources */ = {isa = PBXBuildFile; fileRef = B60A6E1324EE0AE2004B7EEF /* FlippedView.m */; };
B64E15A624E9B34700E8AD3D /* Models.plist in Resources */ = {isa = PBXBuildFile; fileRef = B64E15A424E9B34700E8AD3D /* Models.plist */; };
B64E15A924EA1D5300E8AD3D /* ROMBrowserDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = B64E15A824EA1D5300E8AD3D /* ROMBrowserDelegate.m */; };
B64E15AC24EA1FD400E8AD3D /* SlotBrowserDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = B64E15AB24EA1FD400E8AD3D /* SlotBrowserDelegate.m */; };
@ -22,6 +24,9 @@
/* Begin PBXFileReference section */
B60A6E0B24ECE23F004B7EEF /* apple2gs.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = apple2gs.plist; sourceTree = "<group>"; };
B60A6E0E24EDFB88004B7EEF /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = MA2ME/MA2ME/Base.lproj/SlotView2.xib; sourceTree = "<group>"; };
B60A6E1224EE0AE2004B7EEF /* FlippedView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FlippedView.h; sourceTree = "<group>"; };
B60A6E1324EE0AE2004B7EEF /* FlippedView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FlippedView.m; sourceTree = "<group>"; };
B64E15A524E9B34700E8AD3D /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Base; path = Base.lproj/Models.plist; sourceTree = "<group>"; };
B64E15A724EA1D5300E8AD3D /* ROMBrowserDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ROMBrowserDelegate.h; sourceTree = "<group>"; };
B64E15A824EA1D5300E8AD3D /* ROMBrowserDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ROMBrowserDelegate.m; sourceTree = "<group>"; };
@ -65,6 +70,9 @@
B6BA257224E99BE9005FB8FF = {
isa = PBXGroup;
children = (
B60A6E1224EE0AE2004B7EEF /* FlippedView.h */,
B60A6E1324EE0AE2004B7EEF /* FlippedView.m */,
B60A6E0D24EDFB88004B7EEF /* SlotView2.xib */,
B65593AF24ECB61800722E0C /* SlotViewController.h */,
B65593B024ECB61800722E0C /* SlotViewController.m */,
B6BA257D24E99BE9005FB8FF /* MA2ME */,
@ -159,6 +167,7 @@
files = (
B6BA258224E99BEB005FB8FF /* Assets.xcassets in Resources */,
B6BA258524E99BEB005FB8FF /* MainMenu.xib in Resources */,
B60A6E0F24EDFB88004B7EEF /* SlotView2.xib in Resources */,
B64E15B824EC912200E8AD3D /* SlotView.xib in Resources */,
B64E15B524EA383F00E8AD3D /* apple2gs in Resources */,
B60A6E0C24ECE23F004B7EEF /* apple2gs.plist in Resources */,
@ -176,6 +185,7 @@
B6BA258824E99BEB005FB8FF /* main.m in Sources */,
B64E15AC24EA1FD400E8AD3D /* SlotBrowserDelegate.m in Sources */,
B64E15A924EA1D5300E8AD3D /* ROMBrowserDelegate.m in Sources */,
B60A6E1424EE0AE2004B7EEF /* FlippedView.m in Sources */,
B6BA258024E99BE9005FB8FF /* AppDelegate.m in Sources */,
B65593B124ECB61800722E0C /* SlotViewController.m in Sources */,
);
@ -184,6 +194,14 @@
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
B60A6E0D24EDFB88004B7EEF /* SlotView2.xib */ = {
isa = PBXVariantGroup;
children = (
B60A6E0E24EDFB88004B7EEF /* Base */,
);
name = SlotView2.xib;
sourceTree = "<group>";
};
B64E15A424E9B34700E8AD3D /* Models.plist */ = {
isa = PBXVariantGroup;
children = (

View File

@ -769,7 +769,7 @@
<font key="font" metaFont="system"/>
</pathCell>
</pathControl>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="cFJ-CO-Dzm">
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="cFJ-CO-Dzm" customClass="FlippedView">
<rect key="frame" x="20" y="169" width="306" height="570"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
</customView>

View File

@ -13,7 +13,6 @@
<outlet property="game_menu" destination="K8G-bZ-6mZ" id="IeQ-ZT-5F6"/>
<outlet property="modem_menu" destination="KHf-kC-BpZ" id="Qab-mA-anC"/>
<outlet property="printer_menu" destination="sTp-en-8Wd" id="zeu-LF-6mV"/>
<outlet property="ram_array" destination="RPu-My-wum" id="nZz-MO-ovx"/>
<outlet property="ram_menu" destination="Yks-M5-vi0" id="h5y-Un-jYJ"/>
<outlet property="rs232_menu" destination="6ln-U2-0Pi" id="7CT-OE-idV"/>
<outlet property="sl0_menu" destination="Jw1-t7-YyU" id="BB5-6y-zyf"/>
@ -24,14 +23,13 @@
<outlet property="sl5_menu" destination="8z4-8f-kLU" id="cLl-Ee-LUD"/>
<outlet property="sl6_menu" destination="GLb-F4-PWe" id="ubk-pt-e1Q"/>
<outlet property="sl7_menu" destination="IV2-3M-qfw" id="s5k-4G-w4r"/>
<outlet property="sl8_menu" destination="gOI-9u-PBt" id="02F-U5-Ipi"/>
<outlet property="view" destination="OM3-7F-wiN" id="yre-ts-aHj"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<gridView autoresizesSubviews="NO" xPlacement="leading" yPlacement="bottom" rowAlignment="none" translatesAutoresizingMaskIntoConstraints="NO" id="OM3-7F-wiN">
<rect key="frame" x="0.0" y="0.0" width="306" height="570"/>
<rect key="frame" x="0.0" y="0.0" width="306" height="534"/>
<rows>
<gridRow yPlacement="center" height="30" id="tHD-ui-hIL"/>
<gridRow yPlacement="center" height="30" id="Ccd-U2-Gx5">
@ -58,7 +56,6 @@
<gridRow yPlacement="center" height="30" id="Wdg-xb-xQx"/>
<gridRow yPlacement="center" height="30" id="ein-Fe-vBw"/>
<gridRow yPlacement="center" height="30" id="qjB-2w-AWE"/>
<gridRow yPlacement="center" height="30" id="n86-b0-b40"/>
<gridRow yPlacement="center" height="30" id="EEX-dh-jwn">
<connections>
<binding destination="-2" name="hidden" keyPath="machine.exp" id="EOZ-lS-QHF">
@ -89,8 +86,8 @@
<gridCells>
<gridCell row="tHD-ui-hIL" column="zpB-Rf-dWg" id="deJ-sv-Hb7">
<textField key="contentView" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="nHa-QG-HjJ">
<rect key="frame" x="-2" y="547" width="104" height="16"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="RAM" id="CvY-8m-Ni9">
<rect key="frame" x="-2" y="511" width="104" height="16"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="RAM:" id="CvY-8m-Ni9">
<font key="font" usesAppearanceFont="YES"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
@ -99,7 +96,7 @@
</gridCell>
<gridCell row="tHD-ui-hIL" column="6Vn-yh-FoQ" id="dak-Ha-01u">
<popUpButton key="contentView" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Yks-M5-vi0">
<rect key="frame" x="104" y="542" width="205" height="25"/>
<rect key="frame" x="104" y="506" width="205" height="25"/>
<popUpButtonCell key="cell" type="push" title="Item 1" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="92u-m2-3yN" id="XFo-KF-ueS">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu"/>
@ -110,19 +107,17 @@
<menuItem title="Item 3" id="q2n-oZ-46s"/>
</items>
</menu>
<connections>
<action selector="ram_menu_action:" target="-2" id="j5h-42-bcI"/>
</connections>
</popUpButtonCell>
<connections>
<action selector="memoryMenuChanged:" target="-2" id="m1Q-Xj-z22"/>
<binding destination="-2" name="content" keyPath="machine.RAM" id="1PS-Q2-Ky4"/>
</connections>
</popUpButton>
</gridCell>
<gridCell row="Ccd-U2-Gx5" column="zpB-Rf-dWg" xPlacement="fill" yPlacement="center" id="QI6-Cz-URX">
<textField key="contentView" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="v8c-Rp-Mnt">
<rect key="frame" x="-2" y="511" width="104" height="16"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="Slot 0" id="EF7-NX-RMW">
<rect key="frame" x="-2" y="475" width="104" height="16"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="Slot 0:" id="EF7-NX-RMW">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
@ -131,7 +126,7 @@
</gridCell>
<gridCell row="Ccd-U2-Gx5" column="6Vn-yh-FoQ" xPlacement="fill" yPlacement="center" id="0KQ-Qt-8KP">
<popUpButton key="contentView" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Jw1-t7-YyU">
<rect key="frame" x="104" y="506" width="205" height="25"/>
<rect key="frame" x="104" y="470" width="205" height="25"/>
<popUpButtonCell key="cell" type="push" title="Item 1" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="8Iv-mH-mEI" id="47g-IO-4Xt">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu"/>
@ -144,14 +139,15 @@
</menu>
</popUpButtonCell>
<connections>
<action selector="menuChanged:" target="-2" id="wPZ-cY-9Ir"/>
<binding destination="-2" name="content" keyPath="machine.sl0" id="2aW-3q-Mvt"/>
</connections>
</popUpButton>
</gridCell>
<gridCell row="JGU-aq-3uw" column="zpB-Rf-dWg" xPlacement="fill" yPlacement="center" id="Y1R-Ob-g2b">
<textField key="contentView" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="0gP-wH-DVr">
<rect key="frame" x="-2" y="475" width="104" height="16"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="Slot 1" id="bfg-tf-E34">
<rect key="frame" x="-2" y="439" width="104" height="16"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="Slot 1:" id="bfg-tf-E34">
<font key="font" usesAppearanceFont="YES"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
@ -159,8 +155,8 @@
</textField>
</gridCell>
<gridCell row="JGU-aq-3uw" column="6Vn-yh-FoQ" xPlacement="fill" yPlacement="center" id="v8q-Rj-E4q">
<popUpButton key="contentView" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="bta-RS-JT4">
<rect key="frame" x="104" y="470" width="205" height="25"/>
<popUpButton key="contentView" verticalHuggingPriority="750" tag="1" translatesAutoresizingMaskIntoConstraints="NO" id="bta-RS-JT4">
<rect key="frame" x="104" y="434" width="205" height="25"/>
<popUpButtonCell key="cell" type="push" title="Item 1" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="dXO-at-nGw" id="kNn-6b-ysf">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu"/>
@ -173,14 +169,15 @@
</menu>
</popUpButtonCell>
<connections>
<action selector="menuChanged:" target="-2" id="hl3-N2-89k"/>
<binding destination="-2" name="content" keyPath="machine.sl1" id="wQI-oy-SYz"/>
</connections>
</popUpButton>
</gridCell>
<gridCell row="gVW-Ya-phU" column="zpB-Rf-dWg" xPlacement="fill" yPlacement="center" id="tpv-Yc-qii">
<textField key="contentView" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="EHZ-ol-QVz">
<rect key="frame" x="-2" y="439" width="104" height="16"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="Slot 2" id="FlL-pN-rn7">
<rect key="frame" x="-2" y="403" width="104" height="16"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="Slot 2:" id="FlL-pN-rn7">
<font key="font" usesAppearanceFont="YES"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
@ -188,8 +185,8 @@
</textField>
</gridCell>
<gridCell row="gVW-Ya-phU" column="6Vn-yh-FoQ" xPlacement="fill" yPlacement="center" id="OzN-rM-Pgi">
<popUpButton key="contentView" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="cDU-b1-x5a">
<rect key="frame" x="104" y="434" width="205" height="25"/>
<popUpButton key="contentView" verticalHuggingPriority="750" tag="2" translatesAutoresizingMaskIntoConstraints="NO" id="cDU-b1-x5a">
<rect key="frame" x="104" y="398" width="205" height="25"/>
<popUpButtonCell key="cell" type="push" title="Item 1" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="vCY-qF-aB3" id="jvL-SH-nvG">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu"/>
@ -201,12 +198,16 @@
</items>
</menu>
</popUpButtonCell>
<connections>
<action selector="menuChanged:" target="-2" id="T5w-C4-Ohq"/>
<binding destination="-2" name="content" keyPath="machine.sl2" id="uXQ-0A-98q"/>
</connections>
</popUpButton>
</gridCell>
<gridCell row="3fP-qp-zmi" column="zpB-Rf-dWg" xPlacement="fill" yPlacement="center" id="LbW-TT-AQ7">
<textField key="contentView" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="zGs-8d-L0S">
<rect key="frame" x="-2" y="403" width="104" height="16"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="Slot 3" id="KZK-h8-8cw">
<rect key="frame" x="-2" y="367" width="104" height="16"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="Slot 3:" id="KZK-h8-8cw">
<font key="font" usesAppearanceFont="YES"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
@ -214,8 +215,8 @@
</textField>
</gridCell>
<gridCell row="3fP-qp-zmi" column="6Vn-yh-FoQ" xPlacement="fill" yPlacement="center" id="h8H-TB-p2z">
<popUpButton key="contentView" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="aSh-cs-0Nn">
<rect key="frame" x="104" y="398" width="205" height="25"/>
<popUpButton key="contentView" verticalHuggingPriority="750" tag="3" translatesAutoresizingMaskIntoConstraints="NO" id="aSh-cs-0Nn">
<rect key="frame" x="104" y="362" width="205" height="25"/>
<popUpButtonCell key="cell" type="push" title="Item 1" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="2yS-4z-8OR" id="HaE-TD-5Wx">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu"/>
@ -227,12 +228,16 @@
</items>
</menu>
</popUpButtonCell>
<connections>
<action selector="menuChanged:" target="-2" id="5uS-La-5cM"/>
<binding destination="-2" name="content" keyPath="machine.sl3" id="YgU-fX-fPC"/>
</connections>
</popUpButton>
</gridCell>
<gridCell row="86u-5p-UT6" column="zpB-Rf-dWg" xPlacement="fill" yPlacement="center" id="hJR-nJ-yYi">
<textField key="contentView" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="zsX-jd-6ba">
<rect key="frame" x="-2" y="367" width="104" height="16"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="Slot 4" id="WXv-RF-e7f">
<rect key="frame" x="-2" y="331" width="104" height="16"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="Slot 4:" id="WXv-RF-e7f">
<font key="font" usesAppearanceFont="YES"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
@ -240,8 +245,8 @@
</textField>
</gridCell>
<gridCell row="86u-5p-UT6" column="6Vn-yh-FoQ" xPlacement="fill" yPlacement="center" id="dHu-cL-FyO">
<popUpButton key="contentView" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="kU5-cR-hPZ">
<rect key="frame" x="104" y="362" width="205" height="25"/>
<popUpButton key="contentView" verticalHuggingPriority="750" tag="4" translatesAutoresizingMaskIntoConstraints="NO" id="kU5-cR-hPZ">
<rect key="frame" x="104" y="326" width="205" height="25"/>
<popUpButtonCell key="cell" type="push" title="Item 1" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="NaS-CV-XQm" id="rOP-eY-UKe">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu"/>
@ -253,12 +258,16 @@
</items>
</menu>
</popUpButtonCell>
<connections>
<action selector="menuChanged:" target="-2" id="I35-wl-YdH"/>
<binding destination="-2" name="content" keyPath="machine.sl4" id="yfx-hj-6Ly"/>
</connections>
</popUpButton>
</gridCell>
<gridCell row="Wdg-xb-xQx" column="zpB-Rf-dWg" xPlacement="fill" yPlacement="center" id="dsM-t5-8ng">
<textField key="contentView" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ANg-c1-hGf">
<rect key="frame" x="-2" y="331" width="104" height="16"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="Slot 5" id="EhN-EV-65V">
<rect key="frame" x="-2" y="295" width="104" height="16"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="Slot 5:" id="EhN-EV-65V">
<font key="font" usesAppearanceFont="YES"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
@ -266,8 +275,8 @@
</textField>
</gridCell>
<gridCell row="Wdg-xb-xQx" column="6Vn-yh-FoQ" xPlacement="fill" yPlacement="center" id="ffm-pA-jjo">
<popUpButton key="contentView" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="8z4-8f-kLU">
<rect key="frame" x="104" y="326" width="205" height="25"/>
<popUpButton key="contentView" verticalHuggingPriority="750" tag="5" translatesAutoresizingMaskIntoConstraints="NO" id="8z4-8f-kLU">
<rect key="frame" x="104" y="290" width="205" height="25"/>
<popUpButtonCell key="cell" type="push" title="Item 1" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="gH7-4J-xsg" id="cmc-Gf-Slp">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu"/>
@ -279,12 +288,16 @@
</items>
</menu>
</popUpButtonCell>
<connections>
<action selector="menuChanged:" target="-2" id="jSe-j9-QUW"/>
<binding destination="-2" name="content" keyPath="machine.sl5" id="Uo1-Rg-wko"/>
</connections>
</popUpButton>
</gridCell>
<gridCell row="ein-Fe-vBw" column="zpB-Rf-dWg" xPlacement="fill" yPlacement="center" id="PSw-Jx-eS2">
<textField key="contentView" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Cr1-RK-Z7V">
<rect key="frame" x="-2" y="295" width="104" height="16"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="Slot 6" id="uzy-th-5Yc">
<rect key="frame" x="-2" y="259" width="104" height="16"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="Slot 6:" id="uzy-th-5Yc">
<font key="font" usesAppearanceFont="YES"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
@ -292,8 +305,8 @@
</textField>
</gridCell>
<gridCell row="ein-Fe-vBw" column="6Vn-yh-FoQ" xPlacement="fill" yPlacement="center" id="FsV-vO-KAs">
<popUpButton key="contentView" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="GLb-F4-PWe">
<rect key="frame" x="104" y="290" width="205" height="25"/>
<popUpButton key="contentView" verticalHuggingPriority="750" tag="6" translatesAutoresizingMaskIntoConstraints="NO" id="GLb-F4-PWe">
<rect key="frame" x="104" y="254" width="205" height="25"/>
<popUpButtonCell key="cell" type="push" title="Item 1" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="VaX-M9-Op0" id="CjU-rC-HUT">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu"/>
@ -305,12 +318,16 @@
</items>
</menu>
</popUpButtonCell>
<connections>
<action selector="menuChanged:" target="-2" id="yZO-kH-P6Q"/>
<binding destination="-2" name="content" keyPath="machine.sl6" id="0ze-xJ-DNX"/>
</connections>
</popUpButton>
</gridCell>
<gridCell row="qjB-2w-AWE" column="zpB-Rf-dWg" xPlacement="fill" yPlacement="center" id="1WE-Mm-0O3">
<textField key="contentView" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="3Ia-XB-C6D">
<rect key="frame" x="-2" y="259" width="104" height="16"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="Slot 7" id="32J-6e-nRV">
<rect key="frame" x="-2" y="223" width="104" height="16"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="Slot 7:" id="32J-6e-nRV">
<font key="font" usesAppearanceFont="YES"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
@ -318,8 +335,8 @@
</textField>
</gridCell>
<gridCell row="qjB-2w-AWE" column="6Vn-yh-FoQ" xPlacement="fill" yPlacement="center" id="Yvr-uR-Hr5">
<popUpButton key="contentView" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="IV2-3M-qfw">
<rect key="frame" x="104" y="254" width="205" height="25"/>
<popUpButton key="contentView" verticalHuggingPriority="750" tag="7" translatesAutoresizingMaskIntoConstraints="NO" id="IV2-3M-qfw">
<rect key="frame" x="104" y="218" width="205" height="25"/>
<popUpButtonCell key="cell" type="push" title="Item 1" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="8nb-Bq-4R4" id="nKb-Ar-bCb">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu"/>
@ -331,38 +348,16 @@
</items>
</menu>
</popUpButtonCell>
</popUpButton>
</gridCell>
<gridCell row="n86-b0-b40" column="zpB-Rf-dWg" xPlacement="fill" yPlacement="center" id="BVb-xz-z6n">
<textField key="contentView" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Mv0-Yd-EQg">
<rect key="frame" x="-2" y="223" width="104" height="16"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="Slot 8" id="dCR-2L-b9S">
<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>
</gridCell>
<gridCell row="n86-b0-b40" column="6Vn-yh-FoQ" xPlacement="fill" yPlacement="center" id="HTD-dN-P6S">
<popUpButton key="contentView" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="gOI-9u-PBt">
<rect key="frame" x="104" y="218" width="205" height="25"/>
<popUpButtonCell key="cell" type="push" title="Item 1" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="sDW-p4-zeV" id="CiO-8J-xSZ">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu"/>
<menu key="menu" id="WDv-1D-6zB">
<items>
<menuItem title="Item 1" state="on" id="sDW-p4-zeV"/>
<menuItem title="Item 2" id="cam-cj-JZX"/>
<menuItem title="Item 3" id="ERp-dw-eVV"/>
</items>
</menu>
</popUpButtonCell>
<connections>
<action selector="menuChanged:" target="-2" id="llh-ab-ayK"/>
<binding destination="-2" name="content" keyPath="machine.sl7" id="hT6-pS-WmL"/>
</connections>
</popUpButton>
</gridCell>
<gridCell row="EEX-dh-jwn" column="zpB-Rf-dWg" xPlacement="fill" yPlacement="center" id="iRl-IX-FSD">
<textField key="contentView" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Avf-lX-f2Q">
<rect key="frame" x="-2" y="187" width="104" height="16"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="Expansion" id="PEU-OV-910">
<textFieldCell key="cell" lineBreakMode="clipping" title="Expansion:" id="PEU-OV-910">
<font key="font" usesAppearanceFont="YES"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
@ -370,7 +365,7 @@
</textField>
</gridCell>
<gridCell row="EEX-dh-jwn" column="6Vn-yh-FoQ" xPlacement="fill" yPlacement="center" id="Ehv-aA-Llc">
<popUpButton key="contentView" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="San-wP-1ez">
<popUpButton key="contentView" verticalHuggingPriority="750" tag="8" translatesAutoresizingMaskIntoConstraints="NO" id="San-wP-1ez">
<rect key="frame" x="104" y="182" width="205" height="25"/>
<popUpButtonCell key="cell" type="push" title="Item 1" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="jtv-Qx-oVD" id="42u-b4-3kx">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
@ -383,12 +378,16 @@
</items>
</menu>
</popUpButtonCell>
<connections>
<action selector="menuChanged:" target="-2" id="fi5-WL-lQa"/>
<binding destination="-2" name="content" keyPath="machine.exp" id="C88-Gb-QTE"/>
</connections>
</popUpButton>
</gridCell>
<gridCell row="OaZ-ZQ-gKK" column="zpB-Rf-dWg" xPlacement="fill" yPlacement="center" id="wRB-Wh-7kG">
<textField key="contentView" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="EMz-7i-H38">
<rect key="frame" x="-2" y="151" width="104" height="16"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="Auxiliary" id="SoV-Qy-h2g">
<textFieldCell key="cell" lineBreakMode="clipping" title="Auxiliary:" id="SoV-Qy-h2g">
<font key="font" usesAppearanceFont="YES"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
@ -396,7 +395,7 @@
</textField>
</gridCell>
<gridCell row="OaZ-ZQ-gKK" column="6Vn-yh-FoQ" xPlacement="fill" yPlacement="center" id="bx6-Rc-x2V">
<popUpButton key="contentView" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="3kq-qn-7YR">
<popUpButton key="contentView" verticalHuggingPriority="750" tag="9" translatesAutoresizingMaskIntoConstraints="NO" id="3kq-qn-7YR">
<rect key="frame" x="104" y="146" width="205" height="25"/>
<popUpButtonCell key="cell" type="push" title="Item 1" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="vWX-Cb-ldP" id="NqP-Uq-Knv">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
@ -409,12 +408,16 @@
</items>
</menu>
</popUpButtonCell>
<connections>
<action selector="menuChanged:" target="-2" id="uvt-uD-Adn"/>
<binding destination="-2" name="content" keyPath="machine.aux" id="KA7-7x-qeJ"/>
</connections>
</popUpButton>
</gridCell>
<gridCell row="wQi-Oz-7Ye" column="zpB-Rf-dWg" xPlacement="fill" yPlacement="center" id="KoQ-xV-fQu">
<textField key="contentView" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="JAG-sJ-u2B">
<rect key="frame" x="-2" y="115" width="104" height="16"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="RS 232" id="iG2-rY-VDv">
<textFieldCell key="cell" lineBreakMode="clipping" title="RS 232:" id="iG2-rY-VDv">
<font key="font" usesAppearanceFont="YES"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
@ -422,7 +425,7 @@
</textField>
</gridCell>
<gridCell row="wQi-Oz-7Ye" column="6Vn-yh-FoQ" xPlacement="fill" yPlacement="center" id="zWk-jd-i0V">
<popUpButton key="contentView" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="6ln-U2-0Pi">
<popUpButton key="contentView" verticalHuggingPriority="750" tag="10" translatesAutoresizingMaskIntoConstraints="NO" id="6ln-U2-0Pi">
<rect key="frame" x="104" y="110" width="205" height="25"/>
<popUpButtonCell key="cell" type="push" title="Item 1" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="uu3-rr-iD8" id="daT-eX-4Vu">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
@ -435,12 +438,16 @@
</items>
</menu>
</popUpButtonCell>
<connections>
<action selector="menuChanged:" target="-2" id="gmZ-pW-35n"/>
<binding destination="-2" name="content" keyPath="machine.rs232" id="LxA-8b-jb4"/>
</connections>
</popUpButton>
</gridCell>
<gridCell row="gr2-eY-995" column="zpB-Rf-dWg" id="xIE-bJ-mzr">
<textField key="contentView" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Svb-pu-WPf">
<rect key="frame" x="-2" y="79" width="104" height="16"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="Game I/O" id="2Gc-mV-zCZ">
<textFieldCell key="cell" lineBreakMode="clipping" title="Game I/O:" id="2Gc-mV-zCZ">
<font key="font" usesAppearanceFont="YES"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
@ -448,7 +455,7 @@
</textField>
</gridCell>
<gridCell row="gr2-eY-995" column="6Vn-yh-FoQ" id="nhy-Gp-GLL">
<popUpButton key="contentView" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="K8G-bZ-6mZ">
<popUpButton key="contentView" verticalHuggingPriority="750" tag="11" translatesAutoresizingMaskIntoConstraints="NO" id="K8G-bZ-6mZ">
<rect key="frame" x="104" y="74" width="205" height="25"/>
<popUpButtonCell key="cell" type="push" title="Item 1" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="GOm-Tf-6qc" id="Mig-Nu-gZB">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
@ -461,12 +468,16 @@
</items>
</menu>
</popUpButtonCell>
<connections>
<action selector="menuChanged:" target="-2" id="o53-71-xuf"/>
<binding destination="-2" name="content" keyPath="machine.gameio" id="tJw-AS-RUz"/>
</connections>
</popUpButton>
</gridCell>
<gridCell row="1xN-lm-s4l" column="zpB-Rf-dWg" id="vPV-KN-NNp">
<textField key="contentView" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="31K-iE-RCe">
<rect key="frame" x="-2" y="43" width="104" height="16"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="Printer" id="QZI-H7-i8m">
<textFieldCell key="cell" lineBreakMode="clipping" title="Printer:" id="QZI-H7-i8m">
<font key="font" usesAppearanceFont="YES"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
@ -474,7 +485,7 @@
</textField>
</gridCell>
<gridCell row="1xN-lm-s4l" column="6Vn-yh-FoQ" id="KRc-Z8-drK">
<popUpButton key="contentView" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="sTp-en-8Wd">
<popUpButton key="contentView" verticalHuggingPriority="750" tag="12" translatesAutoresizingMaskIntoConstraints="NO" id="sTp-en-8Wd">
<rect key="frame" x="104" y="38" width="205" height="25"/>
<popUpButtonCell key="cell" type="push" title="Item 1" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="TU9-ed-ofw" id="1OL-aw-xNL">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
@ -487,12 +498,16 @@
</items>
</menu>
</popUpButtonCell>
<connections>
<action selector="menuChanged:" target="-2" id="Fxc-YB-SF9"/>
<binding destination="-2" name="content" keyPath="machine.printer" id="3l1-Hn-v47"/>
</connections>
</popUpButton>
</gridCell>
<gridCell row="M2s-qn-SIT" column="zpB-Rf-dWg" id="8R2-aA-mLq">
<textField key="contentView" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="MH0-Nk-5Py">
<rect key="frame" x="-2" y="7" width="104" height="16"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="Modem" id="HQq-VN-Ju9">
<textFieldCell key="cell" lineBreakMode="clipping" title="Modem:" id="HQq-VN-Ju9">
<font key="font" usesAppearanceFont="YES"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
@ -500,7 +515,7 @@
</textField>
</gridCell>
<gridCell row="M2s-qn-SIT" column="6Vn-yh-FoQ" id="idI-pW-e7v">
<popUpButton key="contentView" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="KHf-kC-BpZ">
<popUpButton key="contentView" verticalHuggingPriority="750" tag="13" translatesAutoresizingMaskIntoConstraints="NO" id="KHf-kC-BpZ">
<rect key="frame" x="104" y="2" width="205" height="25"/>
<popUpButtonCell key="cell" type="push" title="Item 1" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="CxO-3g-va1" id="jDr-6p-C7y">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
@ -513,12 +528,15 @@
</items>
</menu>
</popUpButtonCell>
<connections>
<action selector="menuChanged:" target="-2" id="pHW-GG-2VQ"/>
<binding destination="-2" name="content" keyPath="machine.modem" id="hFa-pj-NnN"/>
</connections>
</popUpButton>
</gridCell>
</gridCells>
<point key="canvasLocation" x="268" y="71"/>
</gridView>
<arrayController id="RPu-My-wum" userLabel="RAM Array Controller"/>
<customObject id="aRt-yJ-VXG" customClass="NSArray"/>
<userDefaultsController representsSharedInstance="YES" id="ZGN-Cx-9po"/>
</objects>
</document>

View File

@ -13,9 +13,10 @@ NS_ASSUME_NONNULL_BEGIN
@interface SlotViewController : NSViewController
@property (nonatomic) NSString *model;
//@property (nonatomic) NSDictionary *machine;
@property (nonatomic) NSDictionary *machine;
@property unsigned memory;
@property NSString *memory;
@property NSUInteger memoryBytes;
@property NSString *sl0;
@property NSString *sl1;
@ -33,9 +34,15 @@ NS_ASSUME_NONNULL_BEGIN
@property NSString *printer;
@property NSString *modem;
@property NSSize resolution;
@property NSArray *args;
//-(void)setMachine: (NSDictionary *)machine;
- (IBAction)menuChanged:(id)sender;
- (IBAction)memoryMenuChanged:(id)sender;
@end
NS_ASSUME_NONNULL_END

View File

@ -9,7 +9,7 @@
#import "SlotViewController.h"
@interface SlotViewController () {
//NSDictionary *_machine;
}
@property (weak) IBOutlet NSPopUpButton *ram_menu;
@ -29,11 +29,6 @@
@property (weak) IBOutlet NSPopUpButton *printer_menu;
@property (weak) IBOutlet NSPopUpButton *modem_menu;
@property (strong) IBOutlet NSArrayController *ram_array;
@property NSArray *ram_menu_values;
@property NSDictionary *machine;
@end
@ -43,65 +38,14 @@
- (void)viewDidLoad {
[super viewDidLoad];
// Do view setup here.
[self setRam_menu_values: @[]];
NSBundle *bundle = [NSBundle mainBundle];
NSURL *url= [bundle URLForResource: @"apple2gs" withExtension: @"plist"];
NSDictionary *d = [NSDictionary dictionaryWithContentsOfURL: url];
[self setMachine: d];
//[self update_ram_menu];
[self setModel: @"apple2gs"];
}
-(void)reset {
}
- (IBAction)ram_menu_action:(id)sender {
NSLog(@"%@", sender);
}
static NSMenuItem *MemoryMenuItem(unsigned size) {
NSMenuItem *m;
NSString *s;
if (size >= 1024 * 1024)
s = [NSString stringWithFormat: @"%fM", (double)size / (1024 * 1024)];
else
s = [NSString stringWithFormat: @"%uK", size / 1024];
m = [[NSMenuItem alloc] initWithTitle: s action: nil keyEquivalent: @""];
[m setTag: size];
return m;
}
-(void)update_ram_menu {
#if 0
NSMenu *menu = [_ram_menu menu];
[menu removeAllItems];
[menu addItem: MemoryMenuItem(4096)];
[menu addItem: MemoryMenuItem(1310720)];
[menu addItem: MemoryMenuItem(5242880)];
[_ram_array setContent: @[
@{ @"description" : @"4K" },
@{ @"description" : @"8K" },
@{ @"description" : @"16K" }
]
];
#endif
[self setRam_menu_values: [_machine objectForKey: @"RAM"]];
//[_ram_array setContent: [_machine objectForKey: @"RAM"]];
}
-(void)setModel:(NSString *)model {
@ -109,21 +53,115 @@ static NSMenuItem *MemoryMenuItem(unsigned size) {
if ([model isEqualToString: _model]) return;
_model = model;
_machine = nil;
[self loadMachine: model];
}
-(void)resetMachine {
[self setMachine: @{}];
[self setSl0: @""];
[self setSl1: @""];
[self setSl2: @""];
[self setSl3: @""];
[self setSl4: @""];
[self setSl5: @""];
[self setSl6: @""];
[self setSl7: @""];
[self setRs232: @""];
[self setAux: @""];
[self setExp: @""];
[self setGameio: @""];
[self setPrinter: @""];
[self setModem: @""];
[self setMemory: @""];
[self setMemoryBytes: 0];
[self setResolution: NSMakeSize(0, 0)];
NSGridView *view = (NSGridView *)[self view];
if (!_model) {
[view setHidden: YES];
[self setMemory: 0];
[self setArgs: @[]];
}
-(void)loadMachine: (NSString *)model {
NSBundle *bundle = [NSBundle mainBundle];
NSURL *url= [bundle URLForResource: model withExtension: @"plist"];
NSDictionary *d = [NSDictionary dictionaryWithContentsOfURL: url];
if (!d) {
[self resetMachine];
return;
}
// n.b. - does content binding propogate immediately?
[self setMachine: d];
}
- (IBAction)menuChanged:(NSPopUpButton *)sender {
static NSString *Names[] = {
@"sl0", @"sl1", @"sl2", @"sl3",
@"sl4", @"sl5", @"sl6", @"sl7",
@"exp", @"aux",
@"gameio", @"printer", @"modem", @"rs232"
};
/* load ... */
NSInteger tag = [sender tag];
// NSInteger ix = [sender indexOfSelectedItem];
/* ram menu */
[_ram_menu removeAllItems];
[self update_ram_menu];
NSString *key = Names[tag];
NSDictionary *o = [[sender selectedItem] representedObject];
[self setValue: [o objectForKey: @"value"] forKey: key];
[self rebuildArgs];
}
- (IBAction)memoryMenuChanged:(NSPopUpButton *)sender {
//
NSDictionary *o = [[sender selectedItem] representedObject];
[self setMemory: [o objectForKey: @"description"]];
[self setMemoryBytes: [(NSNumber *)[o objectForKey: @"value"] unsignedIntValue]];
[self rebuildArgs];
}
-(void)rebuildArgs {
NSMutableArray *args = [NSMutableArray new];
#define _(a, b) if ([a length]) { [args addObject: b]; [args addObject: a]; }
_(_memory, @"-ramsize")
_(_sl0, @"-sl0")
_(_sl1, @"-sl1")
_(_sl2, @"-sl2")
_(_sl3, @"-sl3")
_(_sl4, @"-sl4")
_(_sl5, @"-sl5")
_(_sl6, @"-sl6")
_(_sl7, @"-sl7")
_(_rs232, @"-rs232")
_(_aux, @"-aux")
_(_exp, @"-exp")
_(_gameio, @"-gameio")
_(_printer, @"-printer")
_(_modem, @"-modem")
[self setArgs: args];
}
@end