Fixed CxROM handling & Fixed Language Card RAM Write enable feature

This commit is contained in:
tudnai 2020-08-02 15:00:42 -07:00
parent 8e6617bcee
commit 6889eafb0b
14 changed files with 530 additions and 106 deletions

View File

@ -11,7 +11,7 @@
320B3FC424AD88B0005EA133 /* power.png in Copy Image Files */ = {isa = PBXBuildFile; fileRef = 320B3FC324AD88B0005EA133 /* power.png */; };
320B4FC124B182DE00070038 /* Apple Disk II.png in Copy Image Files */ = {isa = PBXBuildFile; fileRef = 320B4FC024B182DD00070038 /* Apple Disk II.png */; };
320F2A8824CFD74100671B35 /* Steve2Icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 320F2A8724CFD74000671B35 /* Steve2Icon.icns */; };
320F2A8D24D0FB9200671B35 /* 6502.c in Sources */ = {isa = PBXBuildFile; fileRef = 32439F7422ECD8AD0077AAE0 /* 6502.c */; };
320F2AAD24D53B4100671B35 /* 6502.c in Sources */ = {isa = PBXBuildFile; fileRef = 32439F7422ECD8AD0077AAE0 /* 6502.c */; };
3213936624079C30007F5C4A /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 32BFFB6022EACC660003B53F /* Main.storyboard */; };
323D042E248980600086A901 /* Preferences.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 323D042D248980600086A901 /* Preferences.storyboard */; };
323D043024898AB70086A901 /* PreferencesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 323D042F24898AB70086A901 /* PreferencesViewController.swift */; };
@ -313,6 +313,7 @@
320F2A8924CFFBE300671B35 /* 6502_std.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 6502_std.h; sourceTree = "<group>"; };
320F2A8A24D0001600671B35 /* 6502_und.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 6502_und.h; sourceTree = "<group>"; };
320F2A8B24D0828600671B35 /* 6502_C.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 6502_C.h; sourceTree = "<group>"; };
320F2A9924D4DE8400671B35 /* 6502_C_Rockwell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 6502_C_Rockwell.h; sourceTree = "<group>"; };
323D042D248980600086A901 /* Preferences.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Preferences.storyboard; sourceTree = "<group>"; };
323D042F24898AB70086A901 /* PreferencesViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PreferencesViewController.swift; sourceTree = "<group>"; };
323D04312489BFD80086A901 /* PreferencesWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PreferencesWindowController.swift; sourceTree = "<group>"; };
@ -681,6 +682,7 @@
320F2A8924CFFBE300671B35 /* 6502_std.h */,
320F2A8A24D0001600671B35 /* 6502_und.h */,
320F2A8B24D0828600671B35 /* 6502_C.h */,
320F2A9924D4DE8400671B35 /* 6502_C_Rockwell.h */,
32440B69247CA1CE000F9DA1 /* 65C02.c */,
32440B67247CA1AF000F9DA1 /* 6502_vanilla.c */,
);
@ -1206,11 +1208,11 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
320F2AAD24D53B4100671B35 /* 6502.c in Sources */,
32BFFB5B22EACC630003B53F /* AppDelegate.swift in Sources */,
32E3126D24AC033A00E61891 /* ToolBarController.swift in Sources */,
323D043024898AB70086A901 /* PreferencesViewController.swift in Sources */,
323D04332489BFD80086A901 /* PreferencesWindowController.swift in Sources */,
320F2A8D24D0FB9200671B35 /* 6502.c in Sources */,
32E3126924A98B9300E61891 /* dsk2woz.c in Sources */,
325EB63623F8F78300C6B4A4 /* disk.c in Sources */,
325EB62F23F8856F00C6B4A4 /* woz.c in Sources */,

View File

@ -14,13 +14,10 @@
</PersistentStrings>
</ContextState>
<ContextState
contextName = "BRA:6502_instr_branch.h">
contextName = "specialized closure #1 in ViewController.Update():ViewController.swift">
<PersistentStrings>
<PersistentString
value = "">
</PersistentString>
<PersistentString
value = "RAM[0x346f]">
value = "self.HiRes.frame">
</PersistentString>
</PersistentStrings>
</ContextState>
@ -67,7 +64,7 @@
contextName = "closure #1 in ViewController.Update():ViewController.swift">
<PersistentStrings>
<PersistentString
value = "MEMcfg.is_80STORE">
value = "txtArr">
</PersistentString>
<PersistentString
value = "self.shadowTxt">
@ -76,10 +73,10 @@
value = "txt">
</PersistentString>
<PersistentString
value = "MEMcfg.txt_page_2">
value = "MEMcfg.is_80STORE">
</PersistentString>
<PersistentString
value = "txtArr">
value = "MEMcfg.txt_page_2">
</PersistentString>
</PersistentStrings>
</ContextState>
@ -220,27 +217,27 @@
<ContextState
contextName = "spkr_update:speaker.c">
<PersistentStrings>
<PersistentString
value = "(uint8_t)spkr_samples[452]">
</PersistentString>
<PersistentString
value = "clk_6502_per_frm_max">
</PersistentString>
<PersistentString
value = "clkfrm">
</PersistentString>
<PersistentString
value = "(uint8_t)spkr_samples[451]">
value = "(uint8_t)spkr_samples[452]">
</PersistentString>
<PersistentString
value = "spkr_sample_idx">
</PersistentString>
<PersistentString
value = "(uint8_t)spkr_samples[455]">
value = "(uint8_t)spkr_samples[451]">
</PersistentString>
<PersistentString
value = "clk_6502_per_frm">
</PersistentString>
<PersistentString
value = "(uint8_t)spkr_samples[455]">
</PersistentString>
<PersistentString
value = "clkfrm">
</PersistentString>
</PersistentStrings>
</ContextState>
<ContextState
@ -295,7 +292,7 @@
value = "pdl_value[pdl]">
</PersistentString>
<PersistentString
value = "normalized_time">
value = "normalized_time &gt;= pdl_value[pdl] ? 255 : 0">
</PersistentString>
<PersistentString
value = "(3300 * 255/3300)">
@ -307,7 +304,7 @@
value = "1 * 512 * (1 - ( 3300 / 3300.0 ))">
</PersistentString>
<PersistentString
value = "normalized_time &gt;= pdl_value[pdl] ? 255 : 0">
value = "normalized_time">
</PersistentString>
</PersistentStrings>
</ContextState>
@ -324,13 +321,13 @@
value = "textLines">
</PersistentString>
<PersistentString
value = "hires.frame">
value = "hires.layer">
</PersistentString>
<PersistentString
value = "view">
</PersistentString>
<PersistentString
value = "hires.layer">
value = "hires.frame">
</PersistentString>
</PersistentStrings>
</ContextState>
@ -346,7 +343,7 @@
contextName = "LoRes.Update():LoRes.swift">
<PersistentStrings>
<PersistentString
value = "UInt8( (block &gt;&gt; 4) &amp; 0x0F )">
value = "blockChanged[ screenIdx ]">
</PersistentString>
<PersistentString
value = "UInt8(block)">
@ -355,7 +352,7 @@
value = "UInt8(block &amp; 4)">
</PersistentString>
<PersistentString
value = "blockChanged[ screenIdx ]">
value = "UInt8( (block &gt;&gt; 4) &amp; 0x0F )">
</PersistentString>
</PersistentStrings>
</ContextState>
@ -390,10 +387,10 @@
contextName = "set_flags_NZC:common.h">
<PersistentStrings>
<PersistentString
value = "(unsigned)0xFF">
value = "(unsigned)test ">
</PersistentString>
<PersistentString
value = "(unsigned)test ">
value = "(unsigned)0xFF">
</PersistentString>
</PersistentStrings>
</ContextState>
@ -543,10 +540,10 @@
contextName = "HiRes.draw(_:):HiRes.swift">
<PersistentStrings>
<PersistentString
value = "ctx?.bitsPerComponent">
value = "linAddr">
</PersistentString>
<PersistentString
value = "ctx?.data">
value = "ctx?.height">
</PersistentString>
<PersistentString
value = "ctx?.width">
@ -569,14 +566,14 @@
<PersistentString
value = "HiRes.blockCols">
</PersistentString>
<PersistentString
value = "ctx?.bitsPerComponent">
</PersistentString>
<PersistentString
value = "shadowScreen">
</PersistentString>
<PersistentString
value = "linAddr">
</PersistentString>
<PersistentString
value = "ctx?.height">
value = "ctx?.data">
</PersistentString>
</PersistentStrings>
</ContextState>
@ -592,13 +589,13 @@
contextName = "HiRes.compute():HiRes.swift">
<PersistentStrings>
<PersistentString
value = "UnsafeRawBufferPointer(result)">
value = "computePipelineState.maxTotalThreadsPerThreadgroup">
</PersistentString>
<PersistentString
value = "result[2]">
</PersistentString>
<PersistentString
value = "computePipelineState.maxTotalThreadsPerThreadgroup">
value = "UnsafeRawBufferPointer(result)">
</PersistentString>
</PersistentStrings>
</ContextState>
@ -640,6 +637,9 @@
<PersistentString
value = "m6502">
</PersistentString>
<PersistentString
value = "(void*)Apple2_64K_RAM">
</PersistentString>
<PersistentString
value = "Apple2_64K_AUX + 0x3600">
</PersistentString>
@ -649,9 +649,6 @@
<PersistentString
value = "Apple2_64K_RAM + 0x3600">
</PersistentString>
<PersistentString
value = "(void*)Apple2_64K_RAM">
</PersistentString>
</PersistentStrings>
</ContextState>
<ContextState
@ -706,7 +703,7 @@
value = "new">
</PersistentString>
<PersistentString
value = "WOZtmp.shift16">
value = "WOZwrite.shift16">
</PersistentString>
<PersistentString
value = "WOZwrite.shift">
@ -718,7 +715,21 @@
value = "(1 &lt;&lt; i) - 1">
</PersistentString>
<PersistentString
value = "WOZwrite.shift16">
value = "WOZtmp.shift16">
</PersistentString>
</PersistentStrings>
</ContextState>
<ContextState
contextName = "io_RAM_EXP:mmio.h">
<PersistentStrings>
<PersistentString
value = "m6502.clktime + clkfrm">
</PersistentString>
<PersistentString
value = "m6502.clktime + clkfrm - wram1_clk">
</PersistentString>
<PersistentString
value = "wram1_clk">
</PersistentString>
</PersistentStrings>
</ContextState>
@ -740,10 +751,10 @@
value = "Apple2_64K_AUX + 0xC600">
</PersistentString>
<PersistentString
value = "Apple2_64K_RAM + 0xC600">
value = "(void*)rom">
</PersistentString>
<PersistentString
value = "(void*)rom">
value = "Apple2_64K_RAM + 0xC600">
</PersistentString>
<PersistentString
value = "strlen(fullPath)">
@ -768,10 +779,13 @@
</PersistentStrings>
</ContextState>
<ContextState
contextName = "specialized closure #1 in ViewController.Update():ViewController.swift">
contextName = "BRA:6502_instr_branch.h">
<PersistentStrings>
<PersistentString
value = "self.HiRes.frame">
value = "">
</PersistentString>
<PersistentString
value = "RAM[0x346f]">
</PersistentString>
</PersistentStrings>
</ContextState>

View File

@ -1317,7 +1317,7 @@
<popUpButton key="view" id="Ktw-L6-kEz">
<rect key="frame" x="0.0" y="14" width="43" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<popUpButtonCell key="cell" type="bevel" bezelStyle="regularSquare" image="Joystick" imagePosition="only" alignment="right" lineBreakMode="truncatingTail" refusesFirstResponder="YES" imageScaling="proportionallyUpOrDown" inset="2" pullsDown="YES" arrowPosition="noArrow" id="A4p-LJ-svz">
<popUpButtonCell key="cell" type="bevel" bezelStyle="regularSquare" image="popUpButtonCell:A4p-LJ-svz:image" imagePosition="only" alignment="right" lineBreakMode="truncatingTail" refusesFirstResponder="YES" imageScaling="proportionallyUpOrDown" inset="2" pullsDown="YES" arrowPosition="noArrow" id="A4p-LJ-svz">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu"/>
<menu key="menu" id="q8R-kX-3jc">
@ -1343,7 +1343,7 @@
<popUpButton key="view" id="rfS-6q-EKe">
<rect key="frame" x="0.0" y="14" width="43" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<popUpButtonCell key="cell" type="bevel" bezelStyle="regularSquare" image="Quick Disk" imagePosition="only" alignment="right" lineBreakMode="truncatingTail" refusesFirstResponder="YES" imageScaling="proportionallyUpOrDown" inset="2" pullsDown="YES" arrowPosition="noArrow" id="8bV-Aa-zHf">
<popUpButtonCell key="cell" type="bevel" bezelStyle="regularSquare" image="popUpButtonCell:A4p-LJ-svz:image" imagePosition="only" alignment="right" lineBreakMode="truncatingTail" refusesFirstResponder="YES" imageScaling="proportionallyUpOrDown" inset="2" pullsDown="YES" arrowPosition="noArrow" id="8bV-Aa-zHf">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu"/>
<menu key="menu" id="7Vp-Rc-UbT">
@ -1366,7 +1366,7 @@
<popUpButton key="view" id="MAv-S5-diZ">
<rect key="frame" x="0.0" y="14" width="43" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<popUpButtonCell key="cell" type="bevel" bezelStyle="regularSquare" image="Chip" imagePosition="only" alignment="right" lineBreakMode="truncatingTail" refusesFirstResponder="YES" imageScaling="proportionallyUpOrDown" inset="2" pullsDown="YES" arrowPosition="noArrow" id="WVW-Wo-mc9">
<popUpButtonCell key="cell" type="bevel" bezelStyle="regularSquare" image="popUpButtonCell:A4p-LJ-svz:image" imagePosition="only" alignment="right" lineBreakMode="truncatingTail" refusesFirstResponder="YES" imageScaling="proportionallyUpOrDown" inset="2" pullsDown="YES" arrowPosition="noArrow" id="WVW-Wo-mc9">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu"/>
<menu key="menu" id="Gc4-Or-LMB">
@ -1611,7 +1611,66 @@
</allowedInputSourceLocales>
</textFieldCell>
</textField>
<textField identifier="DisplayField" canDrawConcurrently="YES" focusRingType="none" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" alphaValue="0.0" mirrorLayoutDirectionWhenInternationalizing="never" textCompletion="NO" translatesAutoresizingMaskIntoConstraints="NO" id="SEL-hl-0c0">
<scrollView hidden="YES" canDrawConcurrently="YES" borderType="none" horizontalLineScroll="4" horizontalPageScroll="24" verticalLineScroll="1" verticalPageScroll="24" hasHorizontalScroller="NO" hasVerticalScroller="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ss1-M1-nGn" userLabel="Scroll View - Display View">
<rect key="frame" x="11" y="16" width="1130" height="768"/>
<clipView key="contentView" drawsBackground="NO" copiesOnScroll="NO" id="1wa-ZE-lex">
<rect key="frame" x="0.0" y="0.0" width="1130" height="768"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textView canDrawConcurrently="YES" editable="NO" drawsBackground="NO" importsGraphics="NO" richText="NO" horizontallyResizable="YES" verticallyResizable="YES" baseWritingDirection="leftToRight" findStyle="bar" allowsCharacterPickerTouchBarItem="NO" textCompletion="NO" id="ccC-Wu-3za" userLabel="Display">
<rect key="frame" x="0.0" y="0.0" width="1130" height="768"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
<size key="minSize" width="1130" height="768"/>
<size key="maxSize" width="1152" height="10000000"/>
<attributedString key="textStorage">
<fragment>
<mutableString key="content">1234567890123456789012345678901234567890@@@@@@@@@1@@@@@@@@@2@@@@@@@@@3@@@@@@@@@4
@@@@@@@@@@@@@@@@@@@3@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@4@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@5@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@6@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@7@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@8@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@9@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@10@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@11@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@12@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@13@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@14@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@15@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@16@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@17@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@18@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@19@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@20@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@21@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@22@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@23@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@24@@@@@@@@@@@@@@@@@@@@</mutableString>
<attributes>
<color key="NSColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<font key="NSFont" size="32" name="PrintChar21"/>
<paragraphStyle key="NSParagraphStyle" alignment="natural" lineBreakMode="wordWrapping" baseWritingDirection="leftToRight" tighteningFactorForTruncation="0.0"/>
</attributes>
</fragment>
</attributedString>
<color key="insertionPointColor" name="textColor" catalog="System" colorSpace="catalog"/>
</textView>
</subviews>
<edgeInsets key="contentInsets" left="0.0" right="0.0" top="0.0" bottom="0.0"/>
</clipView>
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="nV1-lT-ewY">
<rect key="frame" x="-100" y="-100" width="225" height="15"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="NO" id="cfR-PX-LW3">
<rect key="frame" x="-100" y="-100" width="15" height="135"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
</scrollView>
<textField identifier="DisplayField" hidden="YES" canDrawConcurrently="YES" focusRingType="none" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" alphaValue="0.0" mirrorLayoutDirectionWhenInternationalizing="never" textCompletion="NO" translatesAutoresizingMaskIntoConstraints="NO" id="SEL-hl-0c0">
<rect key="frame" x="14" y="16" width="1124" height="768"/>
<constraints>
<constraint firstAttribute="width" secondItem="SEL-hl-0c0" secondAttribute="height" multiplier="35:24" id="4LP-hK-Xit"/>
@ -1745,7 +1804,7 @@
<subviews>
<popUpButton translatesAutoresizingMaskIntoConstraints="NO" id="49f-8R-QCc">
<rect key="frame" x="0.0" y="83" width="120" height="103"/>
<popUpButtonCell key="cell" type="bevel" bezelStyle="regularSquare" image="popUpButtonCell:CNs-lh-urM:image" imagePosition="only" alignment="left" lineBreakMode="truncatingTail" refusesFirstResponder="YES" imageScaling="proportionallyUpOrDown" inset="2" pullsDown="YES" arrowPosition="noArrow" altersStateOfSelectedItem="NO" id="CNs-lh-urM">
<popUpButtonCell key="cell" type="bevel" bezelStyle="regularSquare" image="popUpButtonCell:A4p-LJ-svz:image" imagePosition="only" alignment="left" lineBreakMode="truncatingTail" refusesFirstResponder="YES" imageScaling="proportionallyUpOrDown" inset="2" pullsDown="YES" arrowPosition="noArrow" altersStateOfSelectedItem="NO" id="CNs-lh-urM">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu"/>
<menu key="menu" id="N33-K0-nba">
@ -1779,7 +1838,7 @@
</popUpButton>
<popUpButton translatesAutoresizingMaskIntoConstraints="NO" id="QDr-Cp-9QQ">
<rect key="frame" x="0.0" y="0.0" width="120" height="103"/>
<popUpButtonCell key="cell" type="bevel" bezelStyle="regularSquare" image="popUpButtonCell:CNs-lh-urM:image" imagePosition="only" alignment="left" lineBreakMode="truncatingTail" refusesFirstResponder="YES" imageScaling="proportionallyUpOrDown" inset="2" pullsDown="YES" arrowPosition="noArrow" altersStateOfSelectedItem="NO" selectedItem="vmR-CG-qdv" id="8FA-1D-k8p">
<popUpButtonCell key="cell" type="bevel" bezelStyle="regularSquare" image="popUpButtonCell:A4p-LJ-svz:image" imagePosition="only" alignment="left" lineBreakMode="truncatingTail" refusesFirstResponder="YES" imageScaling="proportionallyUpOrDown" inset="2" pullsDown="YES" arrowPosition="noArrow" altersStateOfSelectedItem="NO" selectedItem="vmR-CG-qdv" id="8FA-1D-k8p">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu"/>
<menu key="menu" id="8He-mk-LVI">
@ -1903,9 +1962,11 @@
<constraint firstItem="D0w-YC-YlJ" firstAttribute="trailing" secondItem="SEL-hl-0c0" secondAttribute="trailing" id="5wF-ul-W4h"/>
<constraint firstItem="D0w-YC-YlJ" firstAttribute="top" secondItem="SEL-hl-0c0" secondAttribute="top" id="8bz-WZ-Szj"/>
<constraint firstItem="dGn-a4-c1t" firstAttribute="top" secondItem="SEL-hl-0c0" secondAttribute="top" id="8g8-nm-CxE"/>
<constraint firstItem="ss1-M1-nGn" firstAttribute="trailing" secondItem="iIF-Q5-Onc" secondAttribute="trailing" constant="-11" id="AYX-tI-fE9"/>
<constraint firstItem="Ghs-c1-ZkA" firstAttribute="bottom" secondItem="SEL-hl-0c0" secondAttribute="bottom" id="DgS-2W-eVa"/>
<constraint firstItem="dGn-a4-c1t" firstAttribute="bottom" secondItem="SEL-hl-0c0" secondAttribute="bottom" id="EBM-Pm-MJ8"/>
<constraint firstItem="Gqh-qw-fjy" firstAttribute="top" secondItem="SEL-hl-0c0" secondAttribute="top" id="FF5-Ke-cOk"/>
<constraint firstItem="ss1-M1-nGn" firstAttribute="bottom" secondItem="iIF-Q5-Onc" secondAttribute="bottom" constant="-16" id="Gk9-mO-8Dz"/>
<constraint firstAttribute="bottom" secondItem="Fdf-pv-iEw" secondAttribute="bottom" constant="8" id="H1Q-Vj-rPM"/>
<constraint firstItem="Ghs-c1-ZkA" firstAttribute="trailing" secondItem="SEL-hl-0c0" secondAttribute="trailing" id="HPu-Oe-CBl"/>
<constraint firstItem="iIF-Q5-Onc" firstAttribute="leading" secondItem="m2S-Jp-Qdl" secondAttribute="leading" id="LGA-tZ-gFh"/>
@ -1916,6 +1977,7 @@
<constraint firstItem="D0w-YC-YlJ" firstAttribute="leading" secondItem="SEL-hl-0c0" secondAttribute="leading" id="SVU-d6-DH1"/>
<constraint firstItem="Fdf-pv-iEw" firstAttribute="top" secondItem="m2S-Jp-Qdl" secondAttribute="top" constant="8" id="Umg-3A-zmv"/>
<constraint firstItem="Gqh-qw-fjy" firstAttribute="leading" secondItem="SEL-hl-0c0" secondAttribute="leading" id="VcW-Wh-wiF"/>
<constraint firstItem="ss1-M1-nGn" firstAttribute="top" secondItem="iIF-Q5-Onc" secondAttribute="top" constant="16" id="VdT-jM-SRU"/>
<constraint firstItem="dGn-a4-c1t" firstAttribute="trailing" secondItem="SEL-hl-0c0" secondAttribute="trailing" id="XM9-i5-GOP"/>
<constraint firstItem="Fdf-pv-iEw" firstAttribute="leading" secondItem="iIF-Q5-Onc" secondAttribute="trailing" constant="8" id="Xbh-Ub-1Ng"/>
<constraint firstItem="SEL-hl-0c0" firstAttribute="top" secondItem="iIF-Q5-Onc" secondAttribute="top" constant="16" id="aWz-Ad-PIM"/>
@ -1925,6 +1987,7 @@
<constraint firstItem="LlM-EV-ruZ" firstAttribute="bottom" secondItem="SEL-hl-0c0" secondAttribute="bottom" id="ltj-Ea-Vtb"/>
<constraint firstItem="iIF-Q5-Onc" firstAttribute="top" secondItem="m2S-Jp-Qdl" secondAttribute="top" id="m3e-ww-N7S"/>
<constraint firstItem="LlM-EV-ruZ" firstAttribute="trailing" secondItem="SEL-hl-0c0" secondAttribute="trailing" id="nAy-xD-Y3s"/>
<constraint firstItem="ss1-M1-nGn" firstAttribute="leading" secondItem="iIF-Q5-Onc" secondAttribute="leading" constant="11" id="nue-HB-5Zo"/>
<constraint firstItem="D0w-YC-YlJ" firstAttribute="bottom" secondItem="SEL-hl-0c0" secondAttribute="bottom" id="qTc-wn-Sqn"/>
<constraint firstItem="dGn-a4-c1t" firstAttribute="leading" secondItem="SEL-hl-0c0" secondAttribute="leading" id="xqX-cb-8Hz"/>
<constraint firstAttribute="trailing" secondItem="Fdf-pv-iEw" secondAttribute="trailing" constant="8" id="yy6-NU-JJX"/>
@ -1944,6 +2007,8 @@
<outlet property="scanLines" destination="dGn-a4-c1t" id="3Xy-Ku-95P"/>
<outlet property="speedometer" destination="FBZ-dh-6Fs" id="L0v-RY-xwB"/>
<outlet property="splashScreen" destination="D0w-YC-YlJ" id="WJB-BH-5EP"/>
<outlet property="textDisplay" destination="ccC-Wu-3za" id="2AD-aQ-x6x"/>
<outlet property="textDisplayScroller" destination="ss1-M1-nGn" id="Bbp-M9-REy"/>
</connections>
</viewController>
<customObject id="rPt-NT-nkU" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
@ -1974,7 +2039,7 @@
<image name="White" width="64" height="64"/>
<image name="apple_original_logo_design" width="384" height="307.20001220703125"/>
<image name="dotmatrix_effect" width="268.79998779296875" height="184.32000732421875"/>
<image name="popUpButtonCell:CNs-lh-urM:image" width="1" height="1">
<image name="popUpButtonCell:A4p-LJ-svz:image" width="1" height="1">
<mutableData key="keyedArchiveRepresentation">
YnBsaXN0MDDUAQIDBAUGVVZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3ASAAGGoK8QEgcI
ExQZHh8jJCsuMTtDR0tPUlUkbnVsbNUJCgsMDQ4PEBESVk5TU2l6ZVYkY2xhc3NcTlNJbWFnZUZsYWdz

View File

@ -171,19 +171,19 @@ class HiRes: NSView {
// let color_orange : UInt32 = 0xFFEE2211;
// HiRes Colors for the SRGB color space
let color_black : UInt32 = 0x00000000;
let color_white : UInt32 = 0xFFEEEEEE;
let color_purple : UInt32 = 0xFFDD55FF;
let color_green : UInt32 = 0xFF2BD84A;
let color_blue : UInt32 = 0xFF5599FF;
let color_orange : UInt32 = 0xFFFF6302;
let color_black : UInt32 = 0x00000000
let color_white : UInt32 = 0xFFEEEEEE
let color_purple : UInt32 = 0xFFDD55FF
let color_green : UInt32 = 0xFF2BD84A
let color_blue : UInt32 = 0xFF5599FF
let color_orange : UInt32 = 0xFFFF6302
// for debugging only:
let color_turquis : UInt32 = 0xFF11BBBB;
let color_yellow : UInt32 = 0xFFBBBB11;
let color_turquis : UInt32 = 0xFF11BBBB
let color_yellow : UInt32 = 0xFFBBBB11
// default is green
var monoColor : UInt32 = 0xFF2BD84A;
var monoColor : UInt32 = 0xFF2BD84A
func refreshChanged( blockSize : Int ) {

View File

@ -67,6 +67,8 @@ func spk_dn_play() {
class ViewController: NSViewController {
@IBOutlet weak var textDisplayScroller: NSScrollView!
@IBOutlet var textDisplay: NSTextView!
@IBOutlet weak var displayField: NSTextField!
@IBOutlet weak var display: NSTextFieldCell!
@IBOutlet weak var speedometer: NSTextFieldCell!
@ -176,8 +178,10 @@ class ViewController: NSViewController {
// Animated Splash Screen fade out and (Text) Monitor fade in
hires.isHidden = true
displayField.alphaValue = 0
displayField.isHidden = false
// displayField.alphaValue = 0
// displayField.isHidden = false
textDisplayScroller.alphaValue = 0
textDisplayScroller.isHidden = false
splashScreen.alphaValue = 1
splashScreen.isHidden = false
@ -185,11 +189,11 @@ class ViewController: NSViewController {
NSAnimationContext.runAnimationGroup({ (context) in
context.duration = 0.5
// Use the value you want to animate to (NOT the starting value)
self.displayField.animator().alphaValue = 1
self.textDisplayScroller.animator().alphaValue = 1
self.splashScreen.animator().alphaValue = 0
},
completionHandler:{ () -> Void in
self.displayField.alphaValue = 1
self.textDisplayScroller.alphaValue = 1
self.splashScreen.isHidden = true
})
@ -232,8 +236,8 @@ class ViewController: NSViewController {
// Animated Splash Screen fade out and (Text) Monitor fade in
hires.isHidden = true
displayField.alphaValue = 0
displayField.isHidden = false
textDisplayScroller.alphaValue = 0
// textDisplayScroller.isHidden = false
splashScreen.alphaValue = 1
splashScreen.isHidden = false
@ -314,7 +318,7 @@ class ViewController: NSViewController {
static let textArraySize = textLines * (textCols + lineEndChars) + textCols * 2
var txtClear = [Character](repeating: " ", count: textArraySize * 2)
var txtArr = [Character](repeating: " ", count: textArraySize * 2)
var unicodeTextArray = [Character](repeating: " ", count: textArraySize * 2)
var s = String()
@ -354,7 +358,7 @@ class ViewController: NSViewController {
func SelectAll() {
// displayField.currentEditor()?.selectAll(nil)
// textDisplayScroller.currentEditor()?.selectAll(nil)
displayField.selectText(nil)
}
@ -393,21 +397,21 @@ class ViewController: NSViewController {
if ( Mouse2Joystick ) {
pdl_prevarr[0] = pdl_valarr[0]
pdl_valarr[0] = Double(mouseLocation.x / (displayField.frame.width) )
pdl_valarr[0] = Double(mouseLocation.x / (textDisplayScroller.frame.width) )
pdl_diffarr[0] = pdl_valarr[0] - pdl_prevarr[0]
pdl_prevarr[1] = pdl_valarr[1]
pdl_valarr[1] = 1 - Double(mouseLocation.y / (displayField.frame.height) )
pdl_valarr[1] = 1 - Double(mouseLocation.y / (textDisplayScroller.frame.height) )
pdl_diffarr[1] = pdl_valarr[1] - pdl_prevarr[1]
}
if ( MouseInterface ) {
pdl_prevarr[2] = pdl_valarr[2]
pdl_valarr[2] = Double(mouseLocation.x / (displayField.frame.width) )
pdl_valarr[2] = Double(mouseLocation.x / (textDisplayScroller.frame.width) )
pdl_diffarr[2] = pdl_valarr[2] - pdl_prevarr[2]
pdl_prevarr[3] = pdl_valarr[3]
pdl_valarr[3] = 1 - Double(mouseLocation.y / (displayField.frame.height) )
pdl_valarr[3] = 1 - Double(mouseLocation.y / (textDisplayScroller.frame.height) )
pdl_diffarr[3] = pdl_valarr[3] - pdl_prevarr[3]
}
}
@ -658,7 +662,6 @@ class ViewController: NSViewController {
var shadowTxt : String = ""
func Render() {
frameCnt += 1
@ -675,7 +678,7 @@ class ViewController: NSViewController {
// 1. We can update UI elements
// 2. it is independent of the simulation, de that is running in the background thread while we are busy with rendering...
DispatchQueue.main.sync {
var txt : String = ""
var unicodeTextString : String = ""
var fromLines = 0
var toLines = self.textLines
@ -689,12 +692,12 @@ class ViewController: NSViewController {
}
}
self.txtArr = self.txtClear
self.unicodeTextArray = self.txtClear
// render an empty space to eiminate displaying text portion of the screen covered by graphics
let charDisposition = videoMode.col80 == 0 ? 1 : 2
for y in 0 ..< fromLines {
self.txtArr[ y * (self.textCols * charDisposition + self.lineEndChars) + self.textCols * charDisposition] = "\n"
self.unicodeTextArray[ y * (self.textCols * charDisposition + self.lineEndChars) + self.textCols * charDisposition] = "\n"
}
// 40 col
@ -712,10 +715,10 @@ class ViewController: NSViewController {
let idx = Int(byte);
let chr = ViewController.charConvTbl[idx]
self.txtArr[ y * (self.textCols + self.lineEndChars) + x ] = chr
self.unicodeTextArray[ y * (self.textCols + self.lineEndChars) + x ] = chr
}
self.txtArr[ y * (self.textCols + self.lineEndChars) + self.textCols ] = "\n"
self.unicodeTextArray[ y * (self.textCols + self.lineEndChars) + self.textCols ] = "\n"
}
}
// 80 col
@ -732,21 +735,21 @@ class ViewController: NSViewController {
let idx = Int(byte);
let chr = ViewController.charConvTbl[idx]
self.txtArr[ y * (self.textCols * 2 + self.lineEndChars) + x * 2 + 1] = chr
self.unicodeTextArray[ y * (self.textCols * 2 + self.lineEndChars) + x * 2 + 1] = chr
let byte2 = textAuxBuffer[ ViewController.textLineOfs[y] + x ]
let idx2 = Int(byte2);
let chr2 = ViewController.charConvTbl[idx2]
self.txtArr[ y * (self.textCols * 2 + self.lineEndChars) + x * 2] = chr2
self.unicodeTextArray[ y * (self.textCols * 2 + self.lineEndChars) + x * 2] = chr2
}
self.txtArr[ y * (self.textCols * 2 + self.lineEndChars) + self.textCols * 2] = "\n"
self.unicodeTextArray[ y * (self.textCols * 2 + self.lineEndChars) + self.textCols * 2] = "\n"
}
}
txt = String(self.txtArr)
unicodeTextString = String(self.unicodeTextArray)
// TODO: Render text Screen in native C
// txt = String(bytesNoCopy: ViewController.textScreen!, length: 10, encoding: .ascii, freeWhenDone: false) ?? "HMM"
@ -764,9 +767,23 @@ class ViewController: NSViewController {
}
}
if ( self.shadowTxt != txt ) {
self.shadowTxt = txt
self.display.stringValue = txt
if ( self.shadowTxt != unicodeTextString ) {
self.shadowTxt = unicodeTextString
// self.display.stringValue = unicodeTextString
self.textDisplay.string = unicodeTextString
// let bold14 = NSFont.boldSystemFont(ofSize: 14.0)
// let textColor = NSColor.red
// let attribs = [NSAttributedString.Key.font:bold14,NSAttributedString.Key.foregroundColor:textColor,NSAttributedString.Key.paragraphStyle:textParagraph]
// let textParagraph = NSMutableParagraphStyle()
// textParagraph.lineSpacing = 0
// textParagraph.minimumLineHeight = 32.0
// textParagraph.maximumLineHeight = 32.0
//
// let attribs = [NSAttributedString.Key.paragraphStyle: textParagraph]
// let attrString:NSAttributedString = NSAttributedString.init(string: unicodeTextString, attributes: attribs)
// self.display.attributedStringValue = attrString
}
// self.display.stringValue = "testing\nit\nout"
@ -948,12 +965,13 @@ class ViewController: NSViewController {
self.display.font = NSFont(name: "PrintChar21", size: 32)
}
override func viewDidLoad() {
super.viewDidLoad()
ViewController.current = self
openLog()
hires.clearScreen();
spkr_load_sfx( Bundle.main.resourcePath! + "/sfx" )
@ -966,7 +984,7 @@ class ViewController: NSViewController {
// createHiRes()
self.displayField.scaleUnitSquare(to: NSSize(width: 1, height: 1))
self.textDisplayScroller.scaleUnitSquare(to: NSSize(width: 1, height: 1))
// NSEvent.removeMonitor(NSEvent.EventType.flagsChanged)
// NSEvent.addLocalMonitorForEvents(matching: .flagsChanged) {
@ -1116,6 +1134,16 @@ class ViewController: NSViewController {
@IBAction func CRTMonitorOnOff(_ sender: NSButton) {
CRTMonitor = sender.state == .on
scanLines.isHidden = !CRTMonitor
if ( CRTMonitor ) {
display.textColor = .white
// TODO: Adjust gamma so pixels are brighter
}
else {
display.textColor = colorWhite
// TODO: Adjust gamma so pixels are dimmer
}
hires.RenderFullScreen()
}

View File

@ -696,8 +696,8 @@ void rom_loadFile( const char * bundlePath, const char * filename ) {
void openLog() {
#ifdef DISASSEMBLY
outdev = fopen("/Users/trudnai/Library/Containers/com.gamealloy.A2Mac/Data/disassembly_new.log", "w+");
#ifdef DISASSEMBLER
outdev = fopen("/Users/trudnai/Library/Containers/com.trudnai.steveii/Data/disassembly_new.log", "w+");
#endif
// for DEBUG ONLY!!! -- use stdout if could not create log file
// if (outdev == NULL) {

View File

@ -3,7 +3,29 @@
// A2Mac
//
// Created by Tamas Rudnai on 7/27/20.
// Copyright © 2020 GameAlloy. All rights reserved.
// Copyright © 2019, 2020 Tamas Rudnai. All rights reserved.
//
// This file is part of Steve ][ -- The Apple ][ Emulator.
//
// Steve ][ is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Steve ][ is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Steve ][. If not, see <https://www.gnu.org/licenses/>.
//
// Documentations:
//
// http://nesdev.com/6502_cpu.txt
// http://www.oxyron.de/html/opcodes02.html
// https://macgui.com/kb/article/46
// https://www.masswerk.at/6502/6502_instruction_set.html
//
#ifndef _6502_C_h
@ -36,7 +58,7 @@
// Additional instructions
// BRA - BRanch Always
case 0x80: JMP( rel_addr() ); return 3; // BRA reladdr
case 0x80: BRA( rel_addr() ); return 3; // BRA reladdr
// PHX PHY PLX PLY - PusH or PulL X or Y register
case 0x5A: PHY(); return 3; // PHY

78
src/cpu/6502_C_Rockwell.h Normal file
View File

@ -0,0 +1,78 @@
//
// 6502_und.h
// A2Mac
//
// Created by Tamas Rudnai on 7/27/20.
// Copyright © 2019, 2020 Tamas Rudnai. All rights reserved.
//
// This file is part of Steve ][ -- The Apple ][ Emulator.
//
// Steve ][ is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Steve ][ is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Steve ][. If not, see <https://www.gnu.org/licenses/>.
//
// Documentations:
//
// http://nesdev.com/6502_cpu.txt
// http://www.oxyron.de/html/opcodes02.html
// https://macgui.com/kb/article/46
// https://www.masswerk.at/6502/6502_instruction_set.html
//
#ifndef _6502_C_Rockwell_h
#define _6502_C_Rockwell_h
// Additional Rockwell 65C02 and WDC 65C02 instructions
// Four additional instructions and one additional addressing mode are available on 65C02s manufactured by Rockwell and WDC
// BBR BBS - Branch on Bit Reset or Set
case 0x0F: BBR0( src_zp(), rel_addr() ); return 5; // BBR0 zpg, rel
case 0x1F: BBR1( src_zp(), rel_addr() ); return 5; // BBR1 zpg, rel
case 0x2F: BBR2( src_zp(), rel_addr() ); return 5; // BBR2 zpg, rel
case 0x3F: BBR3( src_zp(), rel_addr() ); return 5; // BBR3 zpg, rel
case 0x4F: BBR4( src_zp(), rel_addr() ); return 5; // BBR4 zpg, rel
case 0x5F: BBR5( src_zp(), rel_addr() ); return 5; // BBR5 zpg, rel
case 0x6F: BBR6( src_zp(), rel_addr() ); return 5; // BBR6 zpg, rel
case 0x7F: BBR7( src_zp(), rel_addr() ); return 5; // BBR7 zpg, rel
case 0x8F: BBS0( src_zp(), rel_addr() ); return 5; // BBS0 zpg, rel
case 0x9F: BBS1( src_zp(), rel_addr() ); return 5; // BBS1 zpg, rel
case 0xAF: BBS2( src_zp(), rel_addr() ); return 5; // BBS2 zpg, rel
case 0xBF: BBS3( src_zp(), rel_addr() ); return 5; // BBS3 zpg, rel
case 0xCF: BBS4( src_zp(), rel_addr() ); return 5; // BBS4 zpg, rel
case 0xDF: BBS5( src_zp(), rel_addr() ); return 5; // BBS5 zpg, rel
case 0xEF: BBS6( src_zp(), rel_addr() ); return 5; // BBS6 zpg, rel
case 0xFF: BBS7( src_zp(), rel_addr() ); return 5; // BBS7 zpg, rel
// RMB SMB - Reset or Set Memory Bit
case 0x07: RMB0( src_zp() ); return 5; // RMB0 zpg, rel
case 0x17: RMB1( src_zp() ); return 5; // RMB1 zpg, rel
case 0x27: RMB2( src_zp() ); return 5; // RMB2 zpg, rel
case 0x37: RMB3( src_zp() ); return 5; // RMB3 zpg, rel
case 0x47: RMB4( src_zp() ); return 5; // RMB4 zpg, rel
case 0x57: RMB5( src_zp() ); return 5; // RMB5 zpg, rel
case 0x67: RMB6( src_zp() ); return 5; // RMB6 zpg, rel
case 0x77: RMB7( src_zp() ); return 5; // RMB7 zpg, rel
case 0x87: SMB0( src_zp() ); return 5; // SMB0 zpg, rel
case 0x97: SMB1( src_zp() ); return 5; // SMB1 zpg, rel
case 0xA7: SMB2( src_zp() ); return 5; // SMB2 zpg, rel
case 0xB7: SMB3( src_zp() ); return 5; // SMB3 zpg, rel
case 0xC7: SMB4( src_zp() ); return 5; // SMB4 zpg, rel
case 0xD7: SMB5( src_zp() ); return 5; // SMB5 zpg, rel
case 0xE7: SMB6( src_zp() ); return 5; // SMB6 zpg, rel
case 0xF7: SMB7( src_zp() ); return 5; // SMB7 zpg, rel
#endif /* _6502_C_Rockwell_h */

View File

@ -3,7 +3,29 @@
// A2Mac
//
// Created by Tamas Rudnai on 7/27/20.
// Copyright © 2020 GameAlloy. All rights reserved.
// Copyright © 2019, 2020 Tamas Rudnai. All rights reserved.
//
// This file is part of Steve ][ -- The Apple ][ Emulator.
//
// Steve ][ is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Steve ][ is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Steve ][. If not, see <https://www.gnu.org/licenses/>.
//
// Documentations:
//
// http://nesdev.com/6502_cpu.txt
// http://www.oxyron.de/html/opcodes02.html
// https://macgui.com/kb/article/46
// https://www.masswerk.at/6502/6502_instruction_set.html
//
#ifndef _6502_std_h

View File

@ -3,7 +3,29 @@
// A2Mac
//
// Created by Tamas Rudnai on 7/27/20.
// Copyright © 2020 GameAlloy. All rights reserved.
// Copyright © 2019, 2020 Tamas Rudnai. All rights reserved.
//
// This file is part of Steve ][ -- The Apple ][ Emulator.
//
// Steve ][ is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Steve ][ is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Steve ][. If not, see <https://www.gnu.org/licenses/>.
//
// Documentations:
//
// http://nesdev.com/6502_cpu.txt
// http://www.oxyron.de/html/opcodes02.html
// https://macgui.com/kb/article/46
// https://www.masswerk.at/6502/6502_instruction_set.html
//
#ifndef _6502_und_h

View File

@ -253,7 +253,6 @@ INLINE int m6502_Step() {
dbgPrintf("%04X: Unimplemented Instruction 0x%02X\n", m6502.PC -1, memread( m6502.PC -1 ));
return 2;
}
// } // fetch16
return 2;
}
@ -443,7 +442,7 @@ void rom_loadFile( const char * bundlePath, const char * filename ) {
void openLog() {
#ifdef DISASSEMBLY
#ifdef DISASSEMBLER
outdev = fopen("/Users/trudnai/Library/Containers/com.gamealloy.A2Mac/Data/disassembly_new.log", "w+");
#endif
// for DEBUG ONLY!!! -- use stdout if could not create log file

View File

@ -208,4 +208,79 @@ INLINE void BVS( int8_t reladdr ) {
}
}
/**
BBR BBS - Branch on Bit Reset or Set
BBR and BBS test the specified zero page location and branch if the specified bit is clear (BBR) or set (BBS).
Note that as with TRB, the term reset in BBR is used to mean clear.
On the 6502 and 65C02, bit 7 is typically the most convenient bit to use for I/O and software flags because
it can be tested by several instructions, such as BIT and LDA. BBR and BBS can test any of the 8 bits without
affecting any flags or using any registers. Unlike other branch instructions, BBR and BBS always take the same
number of cycles (five) whether the branch is taken or not. It is often useful to test bit 0, for example, to test
whether a byte is even or odd. However, the usefulness of BBR and BBS is somewhat limited for a couple of reasons.
First, there is only a single addressing mode for these instructions -- no indexing by X or Y, for instance.
Second, they are restricted to zero page locations. For software flags this may be just fine, but it may not be very
convenient (or cost effective) to add any additional address decoding hardware that may be necessary to
map I/O locations to the zero page.
The addressing mode is a combination of zero page addressing and relative addressing -- really just a juxtaposition of the two.
The bit to test is typically specified as part of the instruction name rather than the operand, i.e.
Flags affected: none
OP LEN CYC MODE FLAGS SYNTAX
-- --- --- ---- ----- ------
0F 3 5 zp,rel ........ BBR0 $12,LABEL
1F 3 5 zp,rel ........ BBR1 $12,LABEL
2F 3 5 zp,rel ........ BBR2 $12,LABEL
3F 3 5 zp,rel ........ BBR3 $12,LABEL
4F 3 5 zp,rel ........ BBR4 $12,LABEL
5F 3 5 zp,rel ........ BBR5 $12,LABEL
6F 3 5 zp,rel ........ BBR6 $12,LABEL
7F 3 5 zp,rel ........ BBR7 $12,LABEL
8F 3 5 zp,rel ........ BBS0 $12,LABEL
9F 3 5 zp,rel ........ BBS1 $12,LABEL
AF 3 5 zp,rel ........ BBS2 $12,LABEL
BF 3 5 zp,rel ........ BBS3 $12,LABEL
CF 3 5 zp,rel ........ BBS4 $12,LABEL
DF 3 5 zp,rel ........ BBS5 $12,LABEL
EF 3 5 zp,rel ........ BBS6 $12,LABEL
FF 3 5 zp,rel ........ BBS7 $12,LABEL
**/
#define BBR(n) INLINE void BBR##n( uint8_t src, int8_t reladdr ) { \
dbgPrintf("BBR"#n" "); \
disPrintf(disassembly.inst, "BBR"#n); \
if ( ! (src & (1 << n) ) ) { \
BRA( reladdr ); \
} \
}
BBR(0)
BBR(1)
BBR(2)
BBR(3)
BBR(4)
BBR(5)
BBR(6)
BBR(7)
#define BBS(n) INLINE void BBS##n( uint8_t src, int8_t reladdr ) { \
dbgPrintf("BBS"#n" "); \
disPrintf(disassembly.inst, "BBS"#n); \
if ( (src & (1 << n) ) ) { \
BRA( reladdr ); \
} \
}
BBS(0)
BBS(1)
BBS(2)
BBS(3)
BBS(4)
BBS(5)
BBS(6)
BBS(7)
#endif // __6502_INSTR_BRANCH_H__

View File

@ -136,5 +136,75 @@ INLINE void SEI() {
m6502.I = 1;
}
/**
RMB SMB - Reset or Set Memory Bit
RMB and SMB clear (RMB) or set (SMB) the specified bit in the specified zero page location,
and can be used in conjuction with the BBR and BBS instructions. Again, note that as with BBR and TRB,
the term reset in RMB is used to mean clear.
The function of RMB and SMB is very similar to the function of TRB and TSB, except that RMB and SMB
can clear or set only one zero page bit, whereas TRB and TSB can clear or set any number of bits. Also,
only zero page addressing is available with RMB and SMB, whereas zero page and absolute addressing
are available for both TRB and TSB. As a result, RMB and SMB do not offer much that isn't already available
with TRB and TSB (which are available on 65C02s from all manufacturers). The main advantages are that
RMB and SMB, unlike TRB and TSB, do not use the accumulator, leaving it available, and do not affect any flags.
However, it is worth noting that it is rarely useful to preserve the value of the Z (zero) flag (the only flag affected by
TRB and TSB), unlike other flags (such as the carry).
Like BBR and BBS, the bit to test is typically specified as part of the instruction name rather than the operand, i.e.
Flags affected: none
OP LEN CYC MODE FLAGS SYNTAX
-- --- --- ---- ----- ------
07 2 5 zp ........ RMB0 $12
17 2 5 zp ........ RMB1 $12
27 2 5 zp ........ RMB2 $12
37 2 5 zp ........ RMB3 $12
47 2 5 zp ........ RMB4 $12
57 2 5 zp ........ RMB5 $12
67 2 5 zp ........ RMB6 $12
77 2 5 zp ........ RMB7 $12
87 2 5 zp ........ SMB0 $12
97 2 5 zp ........ SMB1 $12
A7 2 5 zp ........ SMB2 $12
B7 2 5 zp ........ SMB3 $12
C7 2 5 zp ........ SMB4 $12
D7 2 5 zp ........ SMB5 $12
E7 2 5 zp ........ SMB6 $12
F7 2 5 zp ........ SMB7 $12
**/
#define RMB(n) INLINE void RMB##n( uint8_t zpg ) { \
dbgPrintf("RMB"#n" "); \
disPrintf(disassembly.inst, "RMB"#n); \
WRLOMEM[zpg] &= ~(1 << n); \
}
RMB(0)
RMB(1)
RMB(2)
RMB(3)
RMB(4)
RMB(5)
RMB(6)
RMB(7)
#define SMB(n) INLINE void SMB##n( uint8_t zpg ) { \
dbgPrintf("SMB"#n" "); \
disPrintf(disassembly.inst, "SMB"#n); \
WRLOMEM[zpg] |= (1 << n); \
}
SMB(0)
SMB(1)
SMB(2)
SMB(3)
SMB(4)
SMB(5)
SMB(6)
SMB(7)
#endif // __6502_INSTR_SET_CLR_H__

View File

@ -442,6 +442,23 @@ void auxMemorySelect( MEMcfg_t newMEMcfg ) {
MEMcfg = newMEMcfg;
}
void CxMemorySelect( MEMcfg_t newMEMcfg ) {
if ( newMEMcfg.int_Cx_ROM ) {
// load internal ROM to memory
memcpy(Apple2_64K_MEM + 0xC100, Apple2_16K_ROM + 0x100, 16 * KB - 0x100);
}
else {
// load peripheral ROM to memory
// memcpy(Apple2_64K_MEM + 0xC100, Apple2_64K_RAM + 0xC100, 16 * KB - 0x100);
memcpy(Apple2_64K_MEM + 0xC600, Apple2_64K_RAM + 0xC600, 0x100);
}
MEMcfg = newMEMcfg;
}
uint8_t * current_RAM_bank = Apple2_64K_AUX + 0xC000;
@ -519,6 +536,10 @@ INLINE void io_RAM_EXP( uint16_t addr ) {
break;
}
// when was the last time changing LC memory?
static uint64_t wram1_clk = 0;
// is RAM Writeable?
switch ((uint8_t)addr) {
case (uint8_t)io_MEM_RDROM_WRAM_2:
@ -526,8 +547,7 @@ INLINE void io_RAM_EXP( uint16_t addr ) {
case (uint8_t)io_MEM_RDROM_WRAM_2_:
case (uint8_t)io_MEM_RDROM_WRAM_1_:
// printf("RD_ROM + WR_AUX\n");
// printf("RD_ROM + WR_AUX\n");
// will write directly to Auxiliary RAM, and mark it as NO need to commit from Shadow RAM
MEMcfg.WR_RAM = 0;
@ -545,13 +565,20 @@ INLINE void io_RAM_EXP( uint16_t addr ) {
case (uint8_t)io_MEM_RDRAM_WRAM_2_:
case (uint8_t)io_MEM_RDRAM_WRAM_1_:
// printf("RD_RAM + WR_RAM\n");
// will write to Shadow RAM, and mark it as need to commit from Shadow RAM
MEMcfg.WR_RAM = 1;
WRD0MEM = Apple2_64K_MEM; // for Write $D000 - $DFFF (shadow memory) - BANK X
WRHIMEM = Apple2_64K_MEM; // for Write $E000 - $FFFF (shadow memory)
// printf("RD_RAM + WR_RAM\n");
// was this a consequential read?
if ( m6502.clktime + clkfrm - wram1_clk < 10 ) {
// will write to Shadow RAM, and mark it as need to commit from Shadow RAM
MEMcfg.WR_RAM = 1;
WRD0MEM = Apple2_64K_MEM; // for Write $D000 - $DFFF (shadow memory) - BANK X
WRHIMEM = Apple2_64K_MEM; // for Write $E000 - $FFFF (shadow memory)
}
// it was too long ago, no write
else {
WRD0MEM = Apple2_Dummy_RAM;
WRHIMEM = Apple2_Dummy_RAM;
}
wram1_clk = m6502.clktime + clkfrm;
break;
default:
@ -911,13 +938,13 @@ INLINE void ioWrite( uint16_t addr, uint8_t val ) {
case (uint8_t)io_SETSLOTCXROM:
// printf("io_SETSLOTCXROM\n");
MEMcfg.int_Cx_ROM = 0;
// TODO: set Cx00 ROM area table to SLOT
CxMemorySelect(MEMcfg);
break;
case (uint8_t)io_SETINTCXROM:
// printf("io_SETINTCXROM\n");
MEMcfg.int_Cx_ROM = 1;
// TODO: set Cx00 ROM area table to INT
CxMemorySelect(MEMcfg);
break;
case (uint8_t)io_SETSLOTC3ROM: