diff --git a/A2Mac.xcodeproj/project.pbxproj b/A2Mac.xcodeproj/project.pbxproj index 96ee4ed..a9a15fd 100644 --- a/A2Mac.xcodeproj/project.pbxproj +++ b/A2Mac.xcodeproj/project.pbxproj @@ -18,6 +18,10 @@ 323E2DD1245531E600156805 /* Apple2e.rom in Resources */ = {isa = PBXBuildFile; fileRef = 323E2DCD245531E500156805 /* Apple2e.rom */; }; 32440B85247E27D7000F9DA1 /* 6502.c in Sources */ = {isa = PBXBuildFile; fileRef = 32439F7422ECD8AD0077AAE0 /* 6502.c */; }; 32440BA32480D5C0000F9DA1 /* LoRes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32440BA22480D5C0000F9DA1 /* LoRes.swift */; }; + 325DC40E24AC5ABC00EB8858 /* doc.on.doc.png in Copy Image Files */ = {isa = PBXBuildFile; fileRef = 325DC40D24AC5ABC00EB8858 /* doc.on.doc.png */; }; + 325DC41024AC691B00EB8858 /* rgb_color.png in Copy Image Files */ = {isa = PBXBuildFile; fileRef = 325DC40F24AC691B00EB8858 /* rgb_color.png */; }; + 325DC41324AC692D00EB8858 /* rgb_mono.png in Copy Image Files */ = {isa = PBXBuildFile; fileRef = 325DC41124AC692D00EB8858 /* rgb_mono.png */; }; + 325DC41424AC692D00EB8858 /* mono.png in Copy Image Files */ = {isa = PBXBuildFile; fileRef = 325DC41224AC692D00EB8858 /* mono.png */; }; 325EB62F23F8856F00C6B4A4 /* woz.c in Sources */ = {isa = PBXBuildFile; fileRef = 325EB62E23F8856F00C6B4A4 /* woz.c */; }; 325EB63623F8F78300C6B4A4 /* disk.c in Sources */ = {isa = PBXBuildFile; fileRef = 325EB63523F8F78300C6B4A4 /* disk.c */; }; 325EB63923F9E48100C6B4A4 /* common.c in Sources */ = {isa = PBXBuildFile; fileRef = 325EB63823F9E48100C6B4A4 /* common.c */; }; @@ -85,6 +89,8 @@ 32E3126724A7194900E61891 /* disk_ii_arm.sfx in Copy SFX Files */ = {isa = PBXBuildFile; fileRef = 32E3126424A7193700E61891 /* disk_ii_arm.sfx */; }; 32E3126924A98B9300E61891 /* dsk2woz.c in Sources */ = {isa = PBXBuildFile; fileRef = 32E3126824A98B9300E61891 /* dsk2woz.c */; }; 32E3126A24A98B9300E61891 /* dsk2woz.c in Sources */ = {isa = PBXBuildFile; fileRef = 32E3126824A98B9300E61891 /* dsk2woz.c */; }; + 32E3126D24AC033A00E61891 /* ToolBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32E3126C24AC033A00E61891 /* ToolBarController.swift */; }; + 32E3127424AC0B2E00E61891 /* doc.on.clipboard.png in Copy Image Files */ = {isa = PBXBuildFile; fileRef = 32E3127224AC0AC400E61891 /* doc.on.clipboard.png */; }; 32F8A87C24A3A84300EE6735 /* PrintChar21.ttf in Copy Font Files */ = {isa = PBXBuildFile; fileRef = 325EB67B23FBD43800C6B4A4 /* PrintChar21.ttf */; }; 32F8A87D24A3A84700EE6735 /* PRNumber3.ttf in Copy Font Files */ = {isa = PBXBuildFile; fileRef = 32089E4724556DBD0036E667 /* PRNumber3.ttf */; }; 32F8A87F24A3A8A000EE6735 /* apple.rom in Copy ROM Images */ = {isa = PBXBuildFile; fileRef = 32439F8422ECD8AD0077AAE0 /* apple.rom */; }; @@ -256,6 +262,11 @@ dstPath = ""; dstSubfolderSpec = 7; files = ( + 325DC41024AC691B00EB8858 /* rgb_color.png in Copy Image Files */, + 325DC41324AC692D00EB8858 /* rgb_mono.png in Copy Image Files */, + 325DC41424AC692D00EB8858 /* mono.png in Copy Image Files */, + 325DC40E24AC5ABC00EB8858 /* doc.on.doc.png in Copy Image Files */, + 32E3127424AC0B2E00E61891 /* doc.on.clipboard.png in Copy Image Files */, 323D04442490B3930086A901 /* dotmatrix_effect.png in Copy Image Files */, 32F8A8AF24A3AB5900EE6735 /* apple-rainbow.png in Copy Image Files */, 32F8A8B024A3AB5D00EE6735 /* scanlines.png in Copy Image Files */, @@ -324,6 +335,10 @@ 32440B9C247F9DC7000F9DA1 /* blank.woz */ = {isa = PBXFileReference; lastKnownFileType = file; path = blank.woz; sourceTree = ""; }; 32440BA0247F9F99000F9DA1 /* LOCKSMITH_V7_REV_B.woz */ = {isa = PBXFileReference; lastKnownFileType = file; path = LOCKSMITH_V7_REV_B.woz; sourceTree = ""; }; 32440BA22480D5C0000F9DA1 /* LoRes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoRes.swift; sourceTree = ""; }; + 325DC40D24AC5ABC00EB8858 /* doc.on.doc.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = doc.on.doc.png; sourceTree = ""; }; + 325DC40F24AC691B00EB8858 /* rgb_color.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = rgb_color.png; sourceTree = ""; }; + 325DC41124AC692D00EB8858 /* rgb_mono.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = rgb_mono.png; sourceTree = ""; }; + 325DC41224AC692D00EB8858 /* mono.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = mono.png; sourceTree = ""; }; 325EB62D23F8856F00C6B4A4 /* woz.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = woz.h; sourceTree = ""; }; 325EB62E23F8856F00C6B4A4 /* woz.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = woz.c; sourceTree = ""; }; 325EB63423F8F78300C6B4A4 /* disk.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = disk.h; sourceTree = ""; }; @@ -396,6 +411,8 @@ 32E3126424A7193700E61891 /* disk_ii_arm.sfx */ = {isa = PBXFileReference; lastKnownFileType = file; path = disk_ii_arm.sfx; sourceTree = ""; }; 32E3126824A98B9300E61891 /* dsk2woz.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = dsk2woz.c; sourceTree = ""; }; 32E3126B24A9928F00E61891 /* dsk2woz.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = dsk2woz.h; sourceTree = ""; }; + 32E3126C24AC033A00E61891 /* ToolBarController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToolBarController.swift; sourceTree = ""; }; + 32E3127224AC0AC400E61891 /* doc.on.clipboard.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = doc.on.clipboard.png; sourceTree = ""; }; 32EDB7A123272CA80073AF2D /* fail1.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = fail1.txt; sourceTree = ""; }; 32F2C144249218A400FDC61B /* locksmith_v6.0.woz */ = {isa = PBXFileReference; lastKnownFileType = file; path = locksmith_v6.0.woz; sourceTree = ""; }; /* End PBXFileReference section */ @@ -749,6 +766,7 @@ 32BFFB6322EACC660003B53F /* Info.plist */, 32BFFB6422EACC660003B53F /* A2Mac.entitlements */, 32439F7222ECD8AC0077AAE0 /* A2Mac-Bridging-Header.h */, + 32E3126C24AC033A00E61891 /* ToolBarController.swift */, ); path = A2Mac; sourceTree = ""; @@ -778,6 +796,11 @@ 32E21BE62491BF8B006C0C72 /* apple-rainbow.png */, 323D04432490B3930086A901 /* dotmatrix_effect.png */, 323D04452490BA1E0086A901 /* scanlines.png */, + 325DC40D24AC5ABC00EB8858 /* doc.on.doc.png */, + 32E3127224AC0AC400E61891 /* doc.on.clipboard.png */, + 325DC41224AC692D00EB8858 /* mono.png */, + 325DC41124AC692D00EB8858 /* rgb_mono.png */, + 325DC40F24AC691B00EB8858 /* rgb_color.png */, ); path = img; sourceTree = ""; @@ -1128,6 +1151,7 @@ buildActionMask = 2147483647; files = ( 325EB63623F8F78300C6B4A4 /* disk.c in Sources */, + 32E3126D24AC033A00E61891 /* ToolBarController.swift in Sources */, 325EB63923F9E48100C6B4A4 /* common.c in Sources */, 323D0437248B6BEA0086A901 /* 6502.c in Sources */, 32A9F74A2467B60B004902A1 /* speaker.c in Sources */, diff --git a/A2Mac.xcodeproj/project.xcworkspace/xcuserdata/trudnai.xcuserdatad/xcdebugger/Expressions.xcexplist b/A2Mac.xcodeproj/project.xcworkspace/xcuserdata/trudnai.xcuserdatad/xcdebugger/Expressions.xcexplist index 682fb63..db7b1e3 100644 --- a/A2Mac.xcodeproj/project.xcworkspace/xcuserdata/trudnai.xcuserdatad/xcdebugger/Expressions.xcexplist +++ b/A2Mac.xcodeproj/project.xcworkspace/xcuserdata/trudnai.xcuserdatad/xcdebugger/Expressions.xcexplist @@ -14,13 +14,10 @@ + contextName = "specialized closure #1 in ViewController.Update():ViewController.swift"> - - + value = "self.HiRes.frame"> @@ -67,7 +64,7 @@ contextName = "closure #1 in ViewController.Update():ViewController.swift"> + value = "txtArr"> @@ -76,10 +73,10 @@ value = "txt"> + value = "MEMcfg.txt_page_2"> + value = "MEMcfg.is_80STORE"> @@ -221,13 +218,13 @@ contextName = "spkr_update:speaker.c"> + value = "(uint8_t)spkr_samples[455]"> + value = "(uint8_t)spkr_samples[452]"> @@ -283,7 +280,7 @@ value = "pdl_value[pdl]"> + value = "normalized_time >= pdl_value[pdl] ? 255 : 0"> @@ -295,7 +292,7 @@ value = "1 * 512 * (1 - ( 3300 / 3300.0 ))"> + value = "normalized_time"> @@ -312,13 +309,13 @@ value = "textLines"> + value = "hires.layer"> + value = "hires.frame"> @@ -334,7 +331,7 @@ contextName = "LoRes.Update():LoRes.swift"> + value = "blockChanged[ screenIdx ]"> @@ -343,7 +340,7 @@ value = "UInt8(block & 4)"> + value = "UInt8( (block >> 4) & 0x0F )"> @@ -378,10 +375,18 @@ contextName = "set_flags_NZC:common.h"> + value = "(unsigned)test "> + value = "(unsigned)0xFF"> + + + + + + @@ -499,6 +504,20 @@ + + + + + + + + + + @@ -519,14 +538,22 @@ + + + + + + + value = "linAddr"> + value = "(blockH7 | ( block & bitMask ))"> @@ -549,42 +576,20 @@ + + - - - - - - - - + value = "ctx?.data"> - - - - - - - - - - @@ -621,16 +626,16 @@ value = "m6502"> + value = "Apple2_64K_RAM + 0x3600"> + value = "(void*)Apple2_64K_RAM"> + value = "Apple2_64K_AUX + 0x3600"> @@ -686,7 +691,7 @@ value = "new"> + value = "WOZwrite.shift16"> @@ -698,7 +703,7 @@ value = "(1 << i) - 1"> + value = "WOZtmp.shift16"> @@ -720,10 +725,10 @@ value = "Apple2_64K_AUX + 0xC600"> + value = "(void*)rom"> + value = "Apple2_64K_RAM + 0xC600"> @@ -748,10 +753,13 @@ + contextName = "BRA:6502_instr_branch.h"> + value = ""> + + diff --git a/A2Mac/Base.lproj/Main.storyboard b/A2Mac/Base.lproj/Main.storyboard index 1dabdb8..c9f31a0 100644 --- a/A2Mac/Base.lproj/Main.storyboard +++ b/A2Mac/Base.lproj/Main.storyboard @@ -1206,16 +1206,283 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1249,7 +1516,7 @@ - + 1234567890123456789012345678901234567890 @@@@@@@@@1@@@@@@@@@2@@@@@@@@@3@@@@@@@@@4 @@ -1371,40 +1638,36 @@ - - + + - - + - - - - @@ -1415,13 +1678,13 @@ - + - + - + - + - + - + @@ -1569,124 +1832,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1724,19 +1869,6 @@ - - - - - - - - - - - - - @@ -1757,19 +1889,6 @@ - - - - - - - - - - - - - @@ -1835,8 +1954,21 @@ + + + + + + + + + + + + + diff --git a/A2Mac/ToolBarController.swift b/A2Mac/ToolBarController.swift new file mode 100644 index 0000000..8cb5a2e --- /dev/null +++ b/A2Mac/ToolBarController.swift @@ -0,0 +1,84 @@ +// +// ToolBarController.swift +// Steve ][ +// +// Created by Tamas Rudnai on 6/30/20. +// Copyright © 2020 GameAlloy. All rights reserved. +// + +import Cocoa +import AVFoundation + + +class ToolBarController: NSWindowController { + + @IBAction func PowerOn(_ sender: Any) { + ViewController.current?.PowerOn(sender) + } + + @IBAction func PowerOff(_ sender: Any) { + ViewController.current?.PowerOff(sender) + } + + @IBAction func Pause(_ sender: Any) { + ViewController.current?.Pause(sender) + } + + @IBAction func Copy(_ sender: Any) { + } + + @IBAction func Paste(_ sender: Any) { + } + + @IBAction func Mono(_ sender: Any) { + ViewController.current?.ColorMonitorSelector(color: false) + } + + @IBAction func Color(_ sender: Any) { + ViewController.current?.ColorMonitorSelector(color: true) + } + + @IBAction func FGcolor(_ sender: Any) { + } + + @IBAction func BGcolor(_ sender: Any) { + } + + @IBAction func buttonPressed(_ sender: NSButton) { + } + + @IBOutlet weak var SpeedSelector: NSToolbarItem! + + @IBAction func SpeedSelect(_ slider: NSSlider) { + switch slider.intValue { + case 2: + ViewController.current?.setCPUClockSpeed(freq: 2) + SpeedSelector.label = "2 MHz" + + case 3: + ViewController.current?.setCPUClockSpeed(freq: 4) + SpeedSelector.label = "4 MHz" + + case 4: + ViewController.current?.setCPUClockSpeed(freq: 10) + SpeedSelector.label = "10 MHz" + + case 5: + ViewController.current?.setCPUClockSpeed(freq: 100) + SpeedSelector.label = "100 MHz" + + case 6: + ViewController.current?.setCPUClockSpeed(freq: 1600) + SpeedSelector.label = "MAX Speed" + + default: + ViewController.current?.setCPUClockSpeed(freq: 1.023) + SpeedSelector.label = "1.023 MHz" + } + } + + @IBAction func CPUMode(_ sender: NSPopUpButton) { + ViewController.current?.setSimulationMode( mode: sender.selectedItem?.title ?? "Normal" ) + } + +} diff --git a/A2Mac/ViewController.swift b/A2Mac/ViewController.swift index 8bdbc25..e6e2dd9 100644 --- a/A2Mac/ViewController.swift +++ b/A2Mac/ViewController.swift @@ -92,7 +92,7 @@ class ViewController: NSViewController { "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_ !\"#$%&'()*+,-./0123456789:;<=>?" + - "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u{007F}" + "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u{E27F}" static let charConvStrFlashOn : String = "\u{E140}\u{E141}\u{E142}\u{E143}\u{E144}\u{E145}\u{E146}\u{E147}\u{E148}\u{E149}\u{E14A}\u{E14B}\u{E14C}\u{E14D}\u{E14E}\u{E14F}\u{E150}\u{E151}\u{E152}\u{E153}\u{E154}\u{E155}\u{E156}\u{E157}\u{E158}\u{E159}\u{E15A}\u{E15B}\u{E15C}\u{E15D}\u{E15E}\u{E15F}\u{E120}\u{E121}\u{E122}\u{E123}\u{E124}\u{E125}\u{E126}\u{E127}\u{E128}\u{E129}\u{E12A}\u{E12B}\u{E12C}\u{E12D}\u{E12E}\u{E12F}\u{E130}\u{E131}\u{E132}\u{E133}\u{E134}\u{E135}\u{E136}\u{E137}\u{E138}\u{E139}\u{E13A}\u{E13B}\u{E13C}\u{E13D}\u{E13E}\u{E13F}" + @@ -100,7 +100,7 @@ class ViewController: NSViewController { "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_ !\"#$%&'()*+,-./0123456789:;<=>?" + - "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u{007F}" + "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u{E27F}" static let charConvTblFlashOn = Array( charConvStrFlashOn ) static let charConvTblFlashOff = Array( charConvStrFlashOff ) @@ -378,12 +378,10 @@ class ViewController: NSViewController { } } } - } - + default: super.keyDown(with: event) - break } } } @@ -440,6 +438,7 @@ class ViewController: NSViewController { #endif } + displayField.currentEditor()?.selectedRange = NSMakeRange(0, 0) } @@ -1106,9 +1105,8 @@ class ViewController: NSViewController { hires.RenderFullScreen() } - @IBAction func ColorMonitorOnOff(_ sender: NSButton) { - ColorMonitor = sender.state == .on - hires.RenderFullScreen() + func ColorMonitorSelector( color : Bool ) { + ColorMonitor = color if ( ColorMonitor ) { display.textColor = colorWhite // .white @@ -1116,6 +1114,12 @@ class ViewController: NSViewController { else { display.textColor = colorGreen // .green } + + hires.RenderFullScreen() + } + + @IBAction func ColorMonitorOnOff(_ sender: NSButton) { + ColorMonitorSelector( color: sender.state == .on ) } @IBAction func MonitorChange(_ sender: NSButton) { diff --git a/Resources/img/doc.on.clipboard.png b/Resources/img/doc.on.clipboard.png new file mode 100644 index 0000000..11753a4 Binary files /dev/null and b/Resources/img/doc.on.clipboard.png differ diff --git a/Resources/img/doc.on.clipboard.svg b/Resources/img/doc.on.clipboard.svg new file mode 100644 index 0000000..351f9ff --- /dev/null +++ b/Resources/img/doc.on.clipboard.svg @@ -0,0 +1,160 @@ + + + + + + + + + Weight/Scale Variations + Ultralight + Thin + Light + Regular + Medium + Semibold + Bold + Heavy + Black + + + + + + + + + + + Design Variations + Symbols are supported in up to nine weights and three scales. + For optimal layout with text and other symbols, vertically align + symbols with the adjacent text. + + + + + + Margins + Leading and trailing margins on the left and right side of each symbol + can be adjusted by modifying the width of the blue rectangles. + Modifications are automatically applied proportionally to all + scales and weights. + + + + Exporting + Symbols should be outlined when exporting to ensure the + design is preserved when submitting to Xcode. + Template v.1.0 + Generated from doc.on.clipboard + Typeset at 100 points + Small + Medium + Large + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Resources/img/doc.on.doc.png b/Resources/img/doc.on.doc.png new file mode 100644 index 0000000..67584e2 Binary files /dev/null and b/Resources/img/doc.on.doc.png differ diff --git a/Resources/img/doc.on.doc.svg b/Resources/img/doc.on.doc.svg new file mode 100644 index 0000000..35142d8 --- /dev/null +++ b/Resources/img/doc.on.doc.svg @@ -0,0 +1,160 @@ + + + + + + + + + Weight/Scale Variations + Ultralight + Thin + Light + Regular + Medium + Semibold + Bold + Heavy + Black + + + + + + + + + + + Design Variations + Symbols are supported in up to nine weights and three scales. + For optimal layout with text and other symbols, vertically align + symbols with the adjacent text. + + + + + + Margins + Leading and trailing margins on the left and right side of each symbol + can be adjusted by modifying the width of the blue rectangles. + Modifications are automatically applied proportionally to all + scales and weights. + + + + Exporting + Symbols should be outlined when exporting to ensure the + design is preserved when submitting to Xcode. + Template v.1.0 + Generated from doc.on.doc + Typeset at 100 points + Small + Medium + Large + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Resources/img/mono.png b/Resources/img/mono.png new file mode 100644 index 0000000..82c7cfe Binary files /dev/null and b/Resources/img/mono.png differ diff --git a/Resources/img/rgb_color.png b/Resources/img/rgb_color.png new file mode 100644 index 0000000..3c8ba7f Binary files /dev/null and b/Resources/img/rgb_color.png differ diff --git a/Resources/img/rgb_mono.png b/Resources/img/rgb_mono.png new file mode 100644 index 0000000..4714350 Binary files /dev/null and b/Resources/img/rgb_mono.png differ