From 28412150e6f6ba2ab1ef81f85170bd75885dcaa1 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sat, 8 Jul 2017 17:59:33 -0400 Subject: [PATCH 1/5] Added controls for controlling the tape motor of the ZX80/81, assuming I can find an automatic option. --- .../Clock Signal.xcodeproj/project.pbxproj | 4 ++ .../Clock Signal/Base.lproj/ZX8081Options.xib | 43 +++++++++++++++---- .../Documents/ZX8081OptionsPanel.swift | 20 +++++++++ 3 files changed, 59 insertions(+), 8 deletions(-) create mode 100644 OSBindings/Mac/Clock Signal/Documents/ZX8081OptionsPanel.swift diff --git a/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj b/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj index 30bd9550c..35d3c1475 100644 --- a/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj +++ b/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj @@ -96,6 +96,7 @@ 4B924E991E74D22700B76AF1 /* AtariStaticAnalyserTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4B924E981E74D22700B76AF1 /* AtariStaticAnalyserTests.mm */; }; 4B9252CE1E74D28200B76AF1 /* Atari ROMs in Resources */ = {isa = PBXBuildFile; fileRef = 4B9252CD1E74D28200B76AF1 /* Atari ROMs */; }; 4B92EACA1B7C112B00246143 /* 6502TimingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B92EAC91B7C112B00246143 /* 6502TimingTests.swift */; }; + 4B95FA9D1F11893B0008E395 /* ZX8081OptionsPanel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B95FA9C1F11893B0008E395 /* ZX8081OptionsPanel.swift */; }; 4B96F7221D75119A0058BB2D /* Tape.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B96F7201D75119A0058BB2D /* Tape.cpp */; }; 4B9CCDA11DA279CA0098B625 /* Vic20OptionsPanel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B9CCDA01DA279CA0098B625 /* Vic20OptionsPanel.swift */; }; 4BA0F68E1EEA0E8400E9489E /* ZX8081.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BA0F68C1EEA0E8400E9489E /* ZX8081.cpp */; }; @@ -609,6 +610,7 @@ 4B924E981E74D22700B76AF1 /* AtariStaticAnalyserTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AtariStaticAnalyserTests.mm; sourceTree = ""; }; 4B9252CD1E74D28200B76AF1 /* Atari ROMs */ = {isa = PBXFileReference; lastKnownFileType = folder; path = "Atari ROMs"; sourceTree = ""; }; 4B92EAC91B7C112B00246143 /* 6502TimingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = 6502TimingTests.swift; sourceTree = ""; }; + 4B95FA9C1F11893B0008E395 /* ZX8081OptionsPanel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ZX8081OptionsPanel.swift; sourceTree = ""; }; 4B96F7201D75119A0058BB2D /* Tape.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Tape.cpp; path = ../../StaticAnalyser/Acorn/Tape.cpp; sourceTree = ""; }; 4B96F7211D75119A0058BB2D /* Tape.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = Tape.hpp; path = ../../StaticAnalyser/Acorn/Tape.hpp; sourceTree = ""; }; 4B9CCDA01DA279CA0098B625 /* Vic20OptionsPanel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Vic20OptionsPanel.swift; sourceTree = ""; }; @@ -1312,6 +1314,7 @@ 4B8FE2211DA19FB20090D3CE /* MachinePanel.swift */, 4B2A332E1DB86869002876E3 /* OricOptionsPanel.swift */, 4B9CCDA01DA279CA0098B625 /* Vic20OptionsPanel.swift */, + 4B95FA9C1F11893B0008E395 /* ZX8081OptionsPanel.swift */, 4B8FE2131DA19D5F0090D3CE /* Atari2600Options.xib */, 4B8FE2171DA19D5F0090D3CE /* ElectronOptions.xib */, 4B8FE2151DA19D5F0090D3CE /* MachineDocument.xib */, @@ -2566,6 +2569,7 @@ 4BD4A8CD1E077E8A0020D856 /* PCMSegment.cpp in Sources */, 4BD14B111D74627C0088EAD6 /* StaticAnalyser.cpp in Sources */, 4BBF99151C8FBA6F0075DAFB /* CRTOpenGL.cpp in Sources */, + 4B95FA9D1F11893B0008E395 /* ZX8081OptionsPanel.swift in Sources */, 4B0CCC451C62D0B3001CAC5F /* CRT.cpp in Sources */, 4BCF1FA41DADC3DD0039D2E7 /* Oric.cpp in Sources */, 4BEA525E1DF33323007E74F2 /* Tape.cpp in Sources */, diff --git a/OSBindings/Mac/Clock Signal/Base.lproj/ZX8081Options.xib b/OSBindings/Mac/Clock Signal/Base.lproj/ZX8081Options.xib index b1dcdf861..c6129a19e 100644 --- a/OSBindings/Mac/Clock Signal/Base.lproj/ZX8081Options.xib +++ b/OSBindings/Mac/Clock Signal/Base.lproj/ZX8081Options.xib @@ -1,7 +1,7 @@ - + - + @@ -12,17 +12,17 @@ - + - + - + + + + - + + + + + + + - + diff --git a/OSBindings/Mac/Clock Signal/Documents/ZX8081OptionsPanel.swift b/OSBindings/Mac/Clock Signal/Documents/ZX8081OptionsPanel.swift new file mode 100644 index 000000000..9f5147006 --- /dev/null +++ b/OSBindings/Mac/Clock Signal/Documents/ZX8081OptionsPanel.swift @@ -0,0 +1,20 @@ +// +// ZX8081OptionsPanel.swift +// Clock Signal +// +// Created by Thomas Harte on 08/07/2017. +// Copyright © 2017 Thomas Harte. All rights reserved. +// + +import Cocoa + +class ZX8081OptionsPanel: MachinePanel { + + @IBOutlet var tapeControlButton: NSButton! + @IBAction func setAutomaticTapeConrol(_ sender: NSButton!) { + Swift.print("tape control \(tapeControlButton)") + } + @IBAction func playOrPauseTape(_ sender: NSButton!) { + Swift.print("play/pause") + } +} From 23e989e170af67a0e282f9787fd057f75476584e Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sat, 8 Jul 2017 19:12:06 -0400 Subject: [PATCH 2/5] This will likely do for the Swift/XIB side of things: the play/pause button is enabled or disabled as per the user's choice of automatic tape control, and toggles function when pressed. It communicates activity down to the Objective-C[++] layer, giving it a route through to the actual machine. --- .../Clock Signal/Base.lproj/ZX8081Options.xib | 7 ++-- .../ClockSignal-Bridging-Header.h | 1 + .../Documents/ZX8081OptionsPanel.swift | 42 +++++++++++++++---- .../Clock Signal/Machine/Wrappers/CSZX8081.h | 3 ++ 4 files changed, 43 insertions(+), 10 deletions(-) diff --git a/OSBindings/Mac/Clock Signal/Base.lproj/ZX8081Options.xib b/OSBindings/Mac/Clock Signal/Base.lproj/ZX8081Options.xib index c6129a19e..5b4b66fd0 100644 --- a/OSBindings/Mac/Clock Signal/Base.lproj/ZX8081Options.xib +++ b/OSBindings/Mac/Clock Signal/Base.lproj/ZX8081Options.xib @@ -38,12 +38,12 @@ - +