From 405f58d6a3ee868ecdb2d4c9bcb572cd66723b84 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sat, 21 Oct 2017 10:21:40 -0400 Subject: [PATCH 1/3] Corrects write guard names. --- Machines/Commodore/Vic-20/Keyboard.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Machines/Commodore/Vic-20/Keyboard.hpp b/Machines/Commodore/Vic-20/Keyboard.hpp index 0b5f62224..b9c3c0c29 100644 --- a/Machines/Commodore/Vic-20/Keyboard.hpp +++ b/Machines/Commodore/Vic-20/Keyboard.hpp @@ -1,13 +1,13 @@ // -// KeyboardMapper.hpp +// Keyboard.hpp // Clock Signal // // Created by Thomas Harte on 10/10/2017. // Copyright © 2017 Thomas Harte. All rights reserved. // -#ifndef Machines_Commodore_Vic20_KeyboardMapper_hpp -#define Machines_Commodore_Vic20_KeyboardMapper_hpp +#ifndef Machines_Commodore_Vic20_Keyboard_hpp +#define Machines_Commodore_Vic20_Keyboard_hpp #include "../../KeyboardMachine.hpp" #include "../../Typer.hpp" @@ -49,4 +49,4 @@ struct CharacterMapper: public ::Utility::CharacterMapper { } } -#endif /* KeyboardMapper_hpp */ +#endif /* Keyboard_hpp */ From 9ad4025138d5fa130dd0a3b34aa4e0f594f2a4f9 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sat, 21 Oct 2017 10:30:02 -0400 Subject: [PATCH 2/3] Relocates things that were in Machines/ for machine usage. Leaving only those things intended to be visible interface. --- Machines/AmstradCPC/AmstradCPC.cpp | 4 +-- Machines/AmstradCPC/CharacterMapper.hpp | 2 +- Machines/Commodore/Vic-20/Keyboard.hpp | 2 +- Machines/Electron/CharacterMapper.hpp | 2 +- Machines/Electron/Electron.cpp | 2 +- Machines/Oric/CharacterMapper.hpp | 2 +- Machines/Oric/Oric.cpp | 4 +-- Machines/{ => Utility}/MemoryFuzzer.cpp | 0 Machines/{ => Utility}/MemoryFuzzer.hpp | 0 Machines/{ => Utility}/Typer.cpp | 0 Machines/{ => Utility}/Typer.hpp | 4 +-- Machines/ZX8081/CharacterMapper.hpp | 2 +- Machines/ZX8081/ZX8081.cpp | 4 +-- .../Clock Signal.xcodeproj/project.pbxproj | 32 ++++++++++++------- 14 files changed, 34 insertions(+), 26 deletions(-) rename Machines/{ => Utility}/MemoryFuzzer.cpp (100%) rename Machines/{ => Utility}/MemoryFuzzer.hpp (100%) rename Machines/{ => Utility}/Typer.cpp (100%) rename Machines/{ => Utility}/Typer.hpp (97%) diff --git a/Machines/AmstradCPC/AmstradCPC.cpp b/Machines/AmstradCPC/AmstradCPC.cpp index 5d4052f8d..596c9c439 100644 --- a/Machines/AmstradCPC/AmstradCPC.cpp +++ b/Machines/AmstradCPC/AmstradCPC.cpp @@ -18,8 +18,8 @@ #include "../../Components/8272/i8272.hpp" #include "../../Components/AY38910/AY38910.hpp" -#include "../MemoryFuzzer.hpp" -#include "../Typer.hpp" +#include "../Utility/MemoryFuzzer.hpp" +#include "../Utility/Typer.hpp" #include "../../Storage/Tape/Tape.hpp" diff --git a/Machines/AmstradCPC/CharacterMapper.hpp b/Machines/AmstradCPC/CharacterMapper.hpp index 89f985ae2..3a7e418e3 100644 --- a/Machines/AmstradCPC/CharacterMapper.hpp +++ b/Machines/AmstradCPC/CharacterMapper.hpp @@ -9,7 +9,7 @@ #ifndef Machines_AmstradCPC_CharacterMapper_hpp #define Machines_AmstradCPC_CharacterMapper_hpp -#include "../Typer.hpp" +#include "../Utility/Typer.hpp" namespace AmstradCPC { diff --git a/Machines/Commodore/Vic-20/Keyboard.hpp b/Machines/Commodore/Vic-20/Keyboard.hpp index b9c3c0c29..0db843f30 100644 --- a/Machines/Commodore/Vic-20/Keyboard.hpp +++ b/Machines/Commodore/Vic-20/Keyboard.hpp @@ -10,7 +10,7 @@ #define Machines_Commodore_Vic20_Keyboard_hpp #include "../../KeyboardMachine.hpp" -#include "../../Typer.hpp" +#include "../../Utility/Typer.hpp" namespace Commodore { namespace Vic20 { diff --git a/Machines/Electron/CharacterMapper.hpp b/Machines/Electron/CharacterMapper.hpp index 2bb157736..d74a43ce6 100644 --- a/Machines/Electron/CharacterMapper.hpp +++ b/Machines/Electron/CharacterMapper.hpp @@ -9,7 +9,7 @@ #ifndef Machines_Electron_CharacterMapper_hpp #define Machines_Electron_CharacterMapper_hpp -#include "../Typer.hpp" +#include "../Utility/Typer.hpp" namespace Electron { diff --git a/Machines/Electron/Electron.cpp b/Machines/Electron/Electron.cpp index 2ca236611..5b8055edb 100644 --- a/Machines/Electron/Electron.cpp +++ b/Machines/Electron/Electron.cpp @@ -13,7 +13,7 @@ #include "../../ClockReceiver/ClockReceiver.hpp" #include "../../ClockReceiver/ForceInline.hpp" -#include "../Typer.hpp" +#include "../Utility/Typer.hpp" #include "CharacterMapper.hpp" #include "Interrupts.hpp" diff --git a/Machines/Oric/CharacterMapper.hpp b/Machines/Oric/CharacterMapper.hpp index 95d9f34aa..ca6a0641e 100644 --- a/Machines/Oric/CharacterMapper.hpp +++ b/Machines/Oric/CharacterMapper.hpp @@ -9,7 +9,7 @@ #ifndef Machines_Oric_CharacterMapper_hpp #define Machines_Oric_CharacterMapper_hpp -#include "../Typer.hpp" +#include "../Utility/Typer.hpp" namespace Oric { diff --git a/Machines/Oric/Oric.cpp b/Machines/Oric/Oric.cpp index 9f6f717f9..1c5ae8697 100644 --- a/Machines/Oric/Oric.cpp +++ b/Machines/Oric/Oric.cpp @@ -13,8 +13,8 @@ #include "Microdisc.hpp" #include "Video.hpp" -#include "../MemoryFuzzer.hpp" -#include "../Typer.hpp" +#include "../Utility/MemoryFuzzer.hpp" +#include "../Utility/Typer.hpp" #include "../../Processors/6502/6502.hpp" #include "../../Components/6522/6522.hpp" diff --git a/Machines/MemoryFuzzer.cpp b/Machines/Utility/MemoryFuzzer.cpp similarity index 100% rename from Machines/MemoryFuzzer.cpp rename to Machines/Utility/MemoryFuzzer.cpp diff --git a/Machines/MemoryFuzzer.hpp b/Machines/Utility/MemoryFuzzer.hpp similarity index 100% rename from Machines/MemoryFuzzer.hpp rename to Machines/Utility/MemoryFuzzer.hpp diff --git a/Machines/Typer.cpp b/Machines/Utility/Typer.cpp similarity index 100% rename from Machines/Typer.cpp rename to Machines/Utility/Typer.cpp diff --git a/Machines/Typer.hpp b/Machines/Utility/Typer.hpp similarity index 97% rename from Machines/Typer.hpp rename to Machines/Utility/Typer.hpp index 2c165a489..39570d0e4 100644 --- a/Machines/Typer.hpp +++ b/Machines/Utility/Typer.hpp @@ -10,8 +10,8 @@ #define Typer_hpp #include -#include "KeyboardMachine.hpp" -#include "../ClockReceiver/ClockReceiver.hpp" +#include "../KeyboardMachine.hpp" +#include "../../ClockReceiver/ClockReceiver.hpp" namespace Utility { diff --git a/Machines/ZX8081/CharacterMapper.hpp b/Machines/ZX8081/CharacterMapper.hpp index b78b66dfd..010b7a08d 100644 --- a/Machines/ZX8081/CharacterMapper.hpp +++ b/Machines/ZX8081/CharacterMapper.hpp @@ -9,7 +9,7 @@ #ifndef Machines_ZX8081_CharacterMapper_hpp #define Machines_ZX8081_CharacterMapper_hpp -#include "../Typer.hpp" +#include "../Utility/Typer.hpp" namespace ZX8081 { diff --git a/Machines/ZX8081/ZX8081.cpp b/Machines/ZX8081/ZX8081.cpp index 94a435b53..43f7d0ce1 100644 --- a/Machines/ZX8081/ZX8081.cpp +++ b/Machines/ZX8081/ZX8081.cpp @@ -14,8 +14,8 @@ #include "../../ClockReceiver/ForceInline.hpp" -#include "../MemoryFuzzer.hpp" -#include "../Typer.hpp" +#include "../Utility/MemoryFuzzer.hpp" +#include "../Utility/Typer.hpp" #include "CharacterMapper.hpp" #include "KeyboardMapper.hpp" diff --git a/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj b/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj index ff22b64e9..480495edf 100644 --- a/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj +++ b/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj @@ -23,10 +23,8 @@ 4B1497981EE4B97F00CE2596 /* ZX8081Options.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4B1497961EE4B97F00CE2596 /* ZX8081Options.xib */; }; 4B1558C01F844ECD006E9A97 /* BitReverse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B1558BE1F844ECD006E9A97 /* BitReverse.cpp */; }; 4B1D08061E0F7A1100763741 /* TimeTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4B1D08051E0F7A1100763741 /* TimeTests.mm */; }; - 4B1E85751D170228001EF87D /* Typer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B1E85731D170228001EF87D /* Typer.cpp */; }; 4B1E85811D176468001EF87D /* 6532Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B1E85801D176468001EF87D /* 6532Tests.swift */; }; 4B1EDB451E39A0AC009D6819 /* chip.png in Resources */ = {isa = PBXBuildFile; fileRef = 4B1EDB431E39A0AC009D6819 /* chip.png */; }; - 4B2A332A1DB8544D002876E3 /* MemoryFuzzer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B2A33281DB8544D002876E3 /* MemoryFuzzer.cpp */; }; 4B2A332D1DB86821002876E3 /* OricOptions.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4B2A332B1DB86821002876E3 /* OricOptions.xib */; }; 4B2A332F1DB86869002876E3 /* OricOptionsPanel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B2A332E1DB86869002876E3 /* OricOptionsPanel.swift */; }; 4B2A539F1D117D36003C6002 /* CSAudioQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B2A53911D117D36003C6002 /* CSAudioQueue.m */; }; @@ -35,6 +33,8 @@ 4B2A53A21D117D36003C6002 /* CSElectron.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4B2A539C1D117D36003C6002 /* CSElectron.mm */; }; 4B2A53A31D117D36003C6002 /* CSVic20.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4B2A539E1D117D36003C6002 /* CSVic20.mm */; }; 4B2AF8691E513FC20027EE29 /* TIATests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4B2AF8681E513FC20027EE29 /* TIATests.mm */; }; + 4B2B3A4B1F9B8FA70062DABF /* Typer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B2B3A471F9B8FA70062DABF /* Typer.cpp */; }; + 4B2B3A4C1F9B8FA70062DABF /* MemoryFuzzer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B2B3A481F9B8FA70062DABF /* MemoryFuzzer.cpp */; }; 4B2BFC5F1D613E0200BA3AA9 /* TapePRG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B2BFC5D1D613E0200BA3AA9 /* TapePRG.cpp */; }; 4B2BFDB21DAEF5FF001A68B8 /* Video.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B2BFDB01DAEF5FF001A68B8 /* Video.cpp */; }; 4B2C45421E3C3896002A2389 /* cartridge.png in Resources */ = {isa = PBXBuildFile; fileRef = 4B2C45411E3C3896002A2389 /* cartridge.png */; }; @@ -513,15 +513,11 @@ 4B1558BE1F844ECD006E9A97 /* BitReverse.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = BitReverse.cpp; path = Data/BitReverse.cpp; sourceTree = ""; }; 4B1558BF1F844ECD006E9A97 /* BitReverse.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; name = BitReverse.hpp; path = Data/BitReverse.hpp; sourceTree = ""; }; 4B1D08051E0F7A1100763741 /* TimeTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TimeTests.mm; sourceTree = ""; }; - 4B1E85731D170228001EF87D /* Typer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Typer.cpp; sourceTree = ""; }; - 4B1E85741D170228001EF87D /* Typer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Typer.hpp; sourceTree = ""; }; 4B1E857B1D174DEC001EF87D /* 6532.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = 6532.hpp; sourceTree = ""; }; 4B1E85801D176468001EF87D /* 6532Tests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = 6532Tests.swift; sourceTree = ""; }; 4B1EDB431E39A0AC009D6819 /* chip.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = chip.png; sourceTree = ""; }; 4B2409541C45AB05004DA684 /* Speaker.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = Speaker.hpp; path = ../../Outputs/Speaker.hpp; sourceTree = ""; }; 4B24095A1C45DF85004DA684 /* Stepper.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Stepper.hpp; sourceTree = ""; }; - 4B2A33281DB8544D002876E3 /* MemoryFuzzer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MemoryFuzzer.cpp; sourceTree = ""; }; - 4B2A33291DB8544D002876E3 /* MemoryFuzzer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = MemoryFuzzer.hpp; sourceTree = ""; }; 4B2A332C1DB86821002876E3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = "Clock Signal/Base.lproj/OricOptions.xib"; sourceTree = SOURCE_ROOT; }; 4B2A332E1DB86869002876E3 /* OricOptionsPanel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OricOptionsPanel.swift; sourceTree = ""; }; 4B2A53901D117D36003C6002 /* CSAudioQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSAudioQueue.h; sourceTree = ""; }; @@ -537,6 +533,10 @@ 4B2A539D1D117D36003C6002 /* CSVic20.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSVic20.h; sourceTree = ""; }; 4B2A539E1D117D36003C6002 /* CSVic20.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CSVic20.mm; sourceTree = ""; }; 4B2AF8681E513FC20027EE29 /* TIATests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TIATests.mm; sourceTree = ""; }; + 4B2B3A471F9B8FA70062DABF /* Typer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Typer.cpp; sourceTree = ""; }; + 4B2B3A481F9B8FA70062DABF /* MemoryFuzzer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MemoryFuzzer.cpp; sourceTree = ""; }; + 4B2B3A491F9B8FA70062DABF /* MemoryFuzzer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = MemoryFuzzer.hpp; sourceTree = ""; }; + 4B2B3A4A1F9B8FA70062DABF /* Typer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Typer.hpp; sourceTree = ""; }; 4B2BFC5D1D613E0200BA3AA9 /* TapePRG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TapePRG.cpp; sourceTree = ""; }; 4B2BFC5E1D613E0200BA3AA9 /* TapePRG.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = TapePRG.hpp; sourceTree = ""; }; 4B2BFDB01DAEF5FF001A68B8 /* Video.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Video.cpp; path = Oric/Video.cpp; sourceTree = ""; }; @@ -1311,6 +1311,17 @@ path = Wrappers; sourceTree = ""; }; + 4B2B3A461F9B8FA70062DABF /* Utility */ = { + isa = PBXGroup; + children = ( + 4B2B3A471F9B8FA70062DABF /* Typer.cpp */, + 4B2B3A481F9B8FA70062DABF /* MemoryFuzzer.cpp */, + 4B2B3A491F9B8FA70062DABF /* MemoryFuzzer.hpp */, + 4B2B3A4A1F9B8FA70062DABF /* Typer.hpp */, + ); + path = Utility; + sourceTree = ""; + }; 4B2E2D961C3A06EC00138695 /* Atari2600 */ = { isa = PBXGroup; children = ( @@ -2193,19 +2204,16 @@ isa = PBXGroup; children = ( 4B54C0BB1F8D8E790050900F /* KeyboardMachine.cpp */, - 4B2A33281DB8544D002876E3 /* MemoryFuzzer.cpp */, - 4B1E85731D170228001EF87D /* Typer.cpp */, 4BA9C3CF1D8164A9002DDB61 /* ConfigurationTarget.hpp */, 4B046DC31CFE651500E9E45E /* CRTMachine.hpp */, 4B7041271F92C26900735E45 /* JoystickMachine.hpp */, 4B8E4ECD1DCE483D003716C3 /* KeyboardMachine.hpp */, - 4B2A33291DB8544D002876E3 /* MemoryFuzzer.hpp */, - 4B1E85741D170228001EF87D /* Typer.hpp */, 4B38F3491F2EC12000D9235D /* AmstradCPC */, 4B2E2D961C3A06EC00138695 /* Atari2600 */, 4B4DC81D1D2C2425003C5BF8 /* Commodore */, 4B2E2D9E1C3A070900138695 /* Electron */, 4BCF1FA51DADC3E10039D2E7 /* Oric */, + 4B2B3A461F9B8FA70062DABF /* Utility */, 4B1497931EE4B5AC00CE2596 /* ZX8081 */, ); name = Machines; @@ -2973,10 +2981,10 @@ 4BBF99181C8FBA6F0075DAFB /* TextureTarget.cpp in Sources */, 4BC76E691C98E31700E6EF73 /* FIRFilter.cpp in Sources */, 4B3BF5B01F146265005B6C36 /* CSW.cpp in Sources */, - 4B2A332A1DB8544D002876E3 /* MemoryFuzzer.cpp in Sources */, 4B4518A51F75FD1C00926311 /* SSD.cpp in Sources */, 4B55CE5F1C3B7D960093A61B /* MachineDocument.swift in Sources */, 4B2A332F1DB86869002876E3 /* OricOptionsPanel.swift in Sources */, + 4B2B3A4C1F9B8FA70062DABF /* MemoryFuzzer.cpp in Sources */, 4B7913CC1DFCD80E00175A82 /* Video.cpp in Sources */, 4B4518831F75E91A00926311 /* PCMTrack.cpp in Sources */, 4B45189F1F75FD1C00926311 /* AcornADF.cpp in Sources */, @@ -3007,9 +3015,9 @@ 4B643F3A1D77AD1900D431D6 /* CSStaticAnalyser.mm in Sources */, 4B1497881EE4A1DA00CE2596 /* ZX80O81P.cpp in Sources */, 4B5A12571DD55862007A2231 /* Disassembler6502.cpp in Sources */, + 4B2B3A4B1F9B8FA70062DABF /* Typer.cpp in Sources */, 4B4518821F75E91A00926311 /* PCMSegment.cpp in Sources */, 4BE7C9181E3D397100A5496D /* TIA.cpp in Sources */, - 4B1E85751D170228001EF87D /* Typer.cpp in Sources */, 4B80AD001F85CACA00176895 /* BestEffortUpdater.cpp in Sources */, 4B2E2D9D1C3A070400138695 /* Electron.cpp in Sources */, 4B3940E71DA83C8300427841 /* AsyncTaskQueue.cpp in Sources */, From 9e0907ee7687346d314f22f5e2c27ebf99ff32c7 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sat, 21 Oct 2017 10:52:35 -0400 Subject: [PATCH 3/3] Completes clean-up of post-formalisation per-machine keyboard code. At least for now. Standardising on how column + row is encoded might be helpful. --- Machines/AmstradCPC/AmstradCPC.cpp | 3 +- Machines/AmstradCPC/AmstradCPC.hpp | 19 ----- Machines/AmstradCPC/CharacterMapper.hpp | 23 ------ .../{CharacterMapper.cpp => Keyboard.cpp} | 71 ++++++++++++++++- Machines/AmstradCPC/Keyboard.hpp | 46 +++++++++++ Machines/AmstradCPC/KeyboardMapper.cpp | 76 ------------------- Machines/AmstradCPC/KeyboardMapper.hpp | 22 ------ Machines/Commodore/Vic-20/Keyboard.cpp | 3 +- Machines/Electron/CharacterMapper.hpp | 23 ------ Machines/Electron/Electron.cpp | 3 +- Machines/Electron/Electron.hpp | 19 ----- .../{CharacterMapper.cpp => Keyboard.cpp} | 52 ++++++++++++- Machines/Electron/Keyboard.hpp | 46 +++++++++++ Machines/Electron/KeyboardMapper.cpp | 57 -------------- Machines/Electron/KeyboardMapper.hpp | 22 ------ Machines/Oric/CharacterMapper.hpp | 23 ------ .../{CharacterMapper.cpp => Keyboard.cpp} | 48 +++++++++++- Machines/Oric/Keyboard.hpp | 48 ++++++++++++ Machines/Oric/KeyboardMapper.cpp | 53 ------------- Machines/Oric/KeyboardMapper.hpp | 22 ------ Machines/Oric/Oric.cpp | 3 +- Machines/Oric/Oric.hpp | 21 ----- Machines/ZX8081/CharacterMapper.hpp | 27 ------- .../{CharacterMapper.cpp => Keyboard.cpp} | 30 +++++++- Machines/ZX8081/Keyboard.hpp | 43 +++++++++++ Machines/ZX8081/KeyboardMapper.cpp | 35 --------- Machines/ZX8081/KeyboardMapper.hpp | 22 ------ Machines/ZX8081/ZX8081.cpp | 3 +- Machines/ZX8081/ZX8081.hpp | 11 --- .../Clock Signal.xcodeproj/project.pbxproj | 72 ++++++------------ 30 files changed, 397 insertions(+), 549 deletions(-) delete mode 100644 Machines/AmstradCPC/CharacterMapper.hpp rename Machines/AmstradCPC/{CharacterMapper.cpp => Keyboard.cpp} (58%) create mode 100644 Machines/AmstradCPC/Keyboard.hpp delete mode 100644 Machines/AmstradCPC/KeyboardMapper.cpp delete mode 100644 Machines/AmstradCPC/KeyboardMapper.hpp delete mode 100644 Machines/Electron/CharacterMapper.hpp rename Machines/Electron/{CharacterMapper.cpp => Keyboard.cpp} (65%) create mode 100644 Machines/Electron/Keyboard.hpp delete mode 100644 Machines/Electron/KeyboardMapper.cpp delete mode 100644 Machines/Electron/KeyboardMapper.hpp delete mode 100644 Machines/Oric/CharacterMapper.hpp rename Machines/Oric/{CharacterMapper.cpp => Keyboard.cpp} (66%) create mode 100644 Machines/Oric/Keyboard.hpp delete mode 100644 Machines/Oric/KeyboardMapper.cpp delete mode 100644 Machines/Oric/KeyboardMapper.hpp delete mode 100644 Machines/ZX8081/CharacterMapper.hpp rename Machines/ZX8081/{CharacterMapper.cpp => Keyboard.cpp} (85%) create mode 100644 Machines/ZX8081/Keyboard.hpp delete mode 100644 Machines/ZX8081/KeyboardMapper.cpp delete mode 100644 Machines/ZX8081/KeyboardMapper.hpp diff --git a/Machines/AmstradCPC/AmstradCPC.cpp b/Machines/AmstradCPC/AmstradCPC.cpp index 596c9c439..7f2ebd9ea 100644 --- a/Machines/AmstradCPC/AmstradCPC.cpp +++ b/Machines/AmstradCPC/AmstradCPC.cpp @@ -8,8 +8,7 @@ #include "AmstradCPC.hpp" -#include "CharacterMapper.hpp" -#include "KeyboardMapper.hpp" +#include "Keyboard.hpp" #include "../../Processors/Z80/Z80.hpp" diff --git a/Machines/AmstradCPC/AmstradCPC.hpp b/Machines/AmstradCPC/AmstradCPC.hpp index 788111219..c070b3bb9 100644 --- a/Machines/AmstradCPC/AmstradCPC.hpp +++ b/Machines/AmstradCPC/AmstradCPC.hpp @@ -25,25 +25,6 @@ enum ROMType: int { AMSDOS }; -enum Key: uint16_t { -#define Line(l, k1, k2, k3, k4, k5, k6, k7, k8) \ - k1 = (l << 4) | 0x07, k2 = (l << 4) | 0x06, k3 = (l << 4) | 0x05, k4 = (l << 4) | 0x04,\ - k5 = (l << 4) | 0x03, k6 = (l << 4) | 0x02, k7 = (l << 4) | 0x01, k8 = (l << 4) | 0x00, - - Line(0, KeyFDot, KeyEnter, KeyF3, KeyF6, KeyF9, KeyDown, KeyRight, KeyUp) - Line(1, KeyF0, KeyF2, KeyF1, KeyF5, KeyF8, KeyF7, KeyCopy, KeyLeft) - Line(2, KeyControl, KeyBackSlash, KeyShift, KeyF4, KeyRightSquareBracket, KeyReturn, KeyLeftSquareBracket, KeyClear) - Line(3, KeyFullStop, KeyForwardSlash, KeyColon, KeySemicolon, KeyP, KeyAt, KeyMinus, KeyCaret) - Line(4, KeyComma, KeyM, KeyK, KeyL, KeyI, KeyO, Key9, Key0) - Line(5, KeySpace, KeyN, KeyJ, KeyH, KeyY, KeyU, Key7, Key8) - Line(6, KeyV, KeyB, KeyF, KeyG, KeyT, KeyR, Key5, Key6) - Line(7, KeyX, KeyC, KeyD, KeyS, KeyW, KeyE, Key3, Key4) - Line(8, KeyZ, KeyCapsLock, KeyA, KeyTab, KeyQ, KeyEscape, Key2, Key1) - Line(9, KeyDelete, KeyJoy1Fire3, KeyJoy2Fire2, KeyJoy1Fire1, KeyJoy1Right, KeyJoy1Left, KeyJoy1Down, KeyJoy1Up) - -#undef Line -}; - /*! Models an Amstrad CPC. */ diff --git a/Machines/AmstradCPC/CharacterMapper.hpp b/Machines/AmstradCPC/CharacterMapper.hpp deleted file mode 100644 index 3a7e418e3..000000000 --- a/Machines/AmstradCPC/CharacterMapper.hpp +++ /dev/null @@ -1,23 +0,0 @@ -// -// CharacterMapper.hpp -// Clock Signal -// -// Created by Thomas Harte on 11/08/2017. -// Copyright © 2017 Thomas Harte. All rights reserved. -// - -#ifndef Machines_AmstradCPC_CharacterMapper_hpp -#define Machines_AmstradCPC_CharacterMapper_hpp - -#include "../Utility/Typer.hpp" - -namespace AmstradCPC { - -class CharacterMapper: public ::Utility::CharacterMapper { - public: - uint16_t *sequence_for_character(char character); -}; - -} - -#endif /* CharacterMapper_hpp */ diff --git a/Machines/AmstradCPC/CharacterMapper.cpp b/Machines/AmstradCPC/Keyboard.cpp similarity index 58% rename from Machines/AmstradCPC/CharacterMapper.cpp rename to Machines/AmstradCPC/Keyboard.cpp index 1effb650f..a1e1e1e2f 100644 --- a/Machines/AmstradCPC/CharacterMapper.cpp +++ b/Machines/AmstradCPC/Keyboard.cpp @@ -1,16 +1,79 @@ // -// CharacterMapper.cpp +// Keyboard.cpp // Clock Signal // -// Created by Thomas Harte on 11/08/2017. +// Created by Thomas Harte on 10/10/2017. // Copyright © 2017 Thomas Harte. All rights reserved. // -#include "CharacterMapper.hpp" -#include "AmstradCPC.hpp" +#include "Keyboard.hpp" using namespace AmstradCPC; +uint16_t KeyboardMapper::mapped_key_for_key(Inputs::Keyboard::Key key) { +#define BIND(source, dest) case Inputs::Keyboard::Key::source: return dest + switch(key) { + default: return KeyCopy; + + BIND(k0, Key0); BIND(k1, Key1); BIND(k2, Key2); BIND(k3, Key3); BIND(k4, Key4); + BIND(k5, Key5); BIND(k6, Key6); BIND(k7, Key7); BIND(k8, Key8); BIND(k9, Key9); + BIND(Q, KeyQ); BIND(W, KeyW); BIND(E, KeyE); BIND(R, KeyR); BIND(T, KeyT); + BIND(Y, KeyY); BIND(U, KeyU); BIND(I, KeyI); BIND(O, KeyO); BIND(P, KeyP); + BIND(A, KeyA); BIND(S, KeyS); BIND(D, KeyD); BIND(F, KeyF); BIND(G, KeyG); + BIND(H, KeyH); BIND(J, KeyJ); BIND(K, KeyK); BIND(L, KeyL); + BIND(Z, KeyZ); BIND(X, KeyX); BIND(C, KeyC); BIND(V, KeyV); + BIND(B, KeyB); BIND(N, KeyN); BIND(M, KeyM); + + BIND(Escape, KeyEscape); + BIND(F1, KeyF1); BIND(F2, KeyF2); BIND(F3, KeyF3); BIND(F4, KeyF4); BIND(F5, KeyF5); + BIND(F6, KeyF6); BIND(F7, KeyF7); BIND(F8, KeyF8); BIND(F9, KeyF9); BIND(F10, KeyF0); + + BIND(F11, KeyRightSquareBracket); + BIND(F12, KeyClear); + + BIND(Hyphen, KeyMinus); BIND(Equals, KeyCaret); BIND(BackSpace, KeyDelete); + BIND(Tab, KeyTab); + + BIND(OpenSquareBracket, KeyAt); + BIND(CloseSquareBracket, KeyLeftSquareBracket); + BIND(BackSlash, KeyBackSlash); + + BIND(CapsLock, KeyCapsLock); + BIND(Semicolon, KeyColon); + BIND(Quote, KeySemicolon); + BIND(Hash, KeyRightSquareBracket); + BIND(Enter, KeyReturn); + + BIND(LeftShift, KeyShift); + BIND(Comma, KeyComma); + BIND(FullStop, KeyFullStop); + BIND(ForwardSlash, KeyForwardSlash); + BIND(RightShift, KeyShift); + + BIND(LeftControl, KeyControl); BIND(LeftOption, KeyControl); BIND(LeftMeta, KeyControl); + BIND(Space, KeySpace); + BIND(RightMeta, KeyControl); BIND(RightOption, KeyControl); BIND(RightControl, KeyControl); + + BIND(Left, KeyLeft); BIND(Right, KeyRight); + BIND(Up, KeyUp); BIND(Down, KeyDown); + + BIND(KeyPad0, KeyF0); + BIND(KeyPad1, KeyF1); BIND(KeyPad2, KeyF2); BIND(KeyPad3, KeyF3); + BIND(KeyPad4, KeyF4); BIND(KeyPad5, KeyF5); BIND(KeyPad6, KeyF6); + BIND(KeyPad7, KeyF7); BIND(KeyPad8, KeyF8); BIND(KeyPad9, KeyF9); + BIND(KeyPadPlus, KeySemicolon); + BIND(KeyPadMinus, KeyMinus); + + BIND(KeyPadEnter, KeyEnter); + BIND(KeyPadDecimalPoint, KeyFullStop); + BIND(KeyPadEquals, KeyMinus); + BIND(KeyPadSlash, KeyForwardSlash); + BIND(KeyPadAsterisk, KeyColon); + BIND(KeyPadDelete, KeyDelete); + } +#undef BIND +} + uint16_t *CharacterMapper::sequence_for_character(char character) { #define KEYS(...) {__VA_ARGS__, KeyboardMachine::Machine::KeyEndSequence} #define SHIFT(...) {KeyShift, __VA_ARGS__, KeyboardMachine::Machine::KeyEndSequence} diff --git a/Machines/AmstradCPC/Keyboard.hpp b/Machines/AmstradCPC/Keyboard.hpp new file mode 100644 index 000000000..a75ec7799 --- /dev/null +++ b/Machines/AmstradCPC/Keyboard.hpp @@ -0,0 +1,46 @@ +// +// Keyboard.hpp +// Clock Signal +// +// Created by Thomas Harte on 10/10/2017. +// Copyright © 2017 Thomas Harte. All rights reserved. +// + +#ifndef Machines_AmstradCPC_Keyboard_hpp +#define Machines_AmstradCPC_Keyboard_hpp + +#include "../KeyboardMachine.hpp" +#include "../Utility/Typer.hpp" + +namespace AmstradCPC { + +enum Key: uint16_t { +#define Line(l, k1, k2, k3, k4, k5, k6, k7, k8) \ + k1 = (l << 4) | 0x07, k2 = (l << 4) | 0x06, k3 = (l << 4) | 0x05, k4 = (l << 4) | 0x04,\ + k5 = (l << 4) | 0x03, k6 = (l << 4) | 0x02, k7 = (l << 4) | 0x01, k8 = (l << 4) | 0x00, + + Line(0, KeyFDot, KeyEnter, KeyF3, KeyF6, KeyF9, KeyDown, KeyRight, KeyUp) + Line(1, KeyF0, KeyF2, KeyF1, KeyF5, KeyF8, KeyF7, KeyCopy, KeyLeft) + Line(2, KeyControl, KeyBackSlash, KeyShift, KeyF4, KeyRightSquareBracket, KeyReturn, KeyLeftSquareBracket, KeyClear) + Line(3, KeyFullStop, KeyForwardSlash, KeyColon, KeySemicolon, KeyP, KeyAt, KeyMinus, KeyCaret) + Line(4, KeyComma, KeyM, KeyK, KeyL, KeyI, KeyO, Key9, Key0) + Line(5, KeySpace, KeyN, KeyJ, KeyH, KeyY, KeyU, Key7, Key8) + Line(6, KeyV, KeyB, KeyF, KeyG, KeyT, KeyR, Key5, Key6) + Line(7, KeyX, KeyC, KeyD, KeyS, KeyW, KeyE, Key3, Key4) + Line(8, KeyZ, KeyCapsLock, KeyA, KeyTab, KeyQ, KeyEscape, Key2, Key1) + Line(9, KeyDelete, KeyJoy1Fire3, KeyJoy2Fire2, KeyJoy1Fire1, KeyJoy1Right, KeyJoy1Left, KeyJoy1Down, KeyJoy1Up) + +#undef Line +}; + +struct KeyboardMapper: public KeyboardMachine::Machine::KeyboardMapper { + uint16_t mapped_key_for_key(Inputs::Keyboard::Key key); +}; + +struct CharacterMapper: public ::Utility::CharacterMapper { + uint16_t *sequence_for_character(char character); +}; + +}; + +#endif /* KeyboardMapper_hpp */ diff --git a/Machines/AmstradCPC/KeyboardMapper.cpp b/Machines/AmstradCPC/KeyboardMapper.cpp deleted file mode 100644 index 186a4e824..000000000 --- a/Machines/AmstradCPC/KeyboardMapper.cpp +++ /dev/null @@ -1,76 +0,0 @@ -// -// KeyboardMapper.cpp -// Clock Signal -// -// Created by Thomas Harte on 10/10/2017. -// Copyright © 2017 Thomas Harte. All rights reserved. -// - -#include "KeyboardMapper.hpp" -#include "AmstradCPC.hpp" - -using namespace AmstradCPC; - -uint16_t KeyboardMapper::mapped_key_for_key(Inputs::Keyboard::Key key) { -#define BIND(source, dest) case Inputs::Keyboard::Key::source: return dest - switch(key) { - default: return KeyCopy; - - BIND(k0, Key0); BIND(k1, Key1); BIND(k2, Key2); BIND(k3, Key3); BIND(k4, Key4); - BIND(k5, Key5); BIND(k6, Key6); BIND(k7, Key7); BIND(k8, Key8); BIND(k9, Key9); - BIND(Q, KeyQ); BIND(W, KeyW); BIND(E, KeyE); BIND(R, KeyR); BIND(T, KeyT); - BIND(Y, KeyY); BIND(U, KeyU); BIND(I, KeyI); BIND(O, KeyO); BIND(P, KeyP); - BIND(A, KeyA); BIND(S, KeyS); BIND(D, KeyD); BIND(F, KeyF); BIND(G, KeyG); - BIND(H, KeyH); BIND(J, KeyJ); BIND(K, KeyK); BIND(L, KeyL); - BIND(Z, KeyZ); BIND(X, KeyX); BIND(C, KeyC); BIND(V, KeyV); - BIND(B, KeyB); BIND(N, KeyN); BIND(M, KeyM); - - BIND(Escape, KeyEscape); - BIND(F1, KeyF1); BIND(F2, KeyF2); BIND(F3, KeyF3); BIND(F4, KeyF4); BIND(F5, KeyF5); - BIND(F6, KeyF6); BIND(F7, KeyF7); BIND(F8, KeyF8); BIND(F9, KeyF9); BIND(F10, KeyF0); - - BIND(F11, KeyRightSquareBracket); - BIND(F12, KeyClear); - - BIND(Hyphen, KeyMinus); BIND(Equals, KeyCaret); BIND(BackSpace, KeyDelete); - BIND(Tab, KeyTab); - - BIND(OpenSquareBracket, KeyAt); - BIND(CloseSquareBracket, KeyLeftSquareBracket); - BIND(BackSlash, KeyBackSlash); - - BIND(CapsLock, KeyCapsLock); - BIND(Semicolon, KeyColon); - BIND(Quote, KeySemicolon); - BIND(Hash, KeyRightSquareBracket); - BIND(Enter, KeyReturn); - - BIND(LeftShift, KeyShift); - BIND(Comma, KeyComma); - BIND(FullStop, KeyFullStop); - BIND(ForwardSlash, KeyForwardSlash); - BIND(RightShift, KeyShift); - - BIND(LeftControl, KeyControl); BIND(LeftOption, KeyControl); BIND(LeftMeta, KeyControl); - BIND(Space, KeySpace); - BIND(RightMeta, KeyControl); BIND(RightOption, KeyControl); BIND(RightControl, KeyControl); - - BIND(Left, KeyLeft); BIND(Right, KeyRight); - BIND(Up, KeyUp); BIND(Down, KeyDown); - - BIND(KeyPad0, KeyF0); - BIND(KeyPad1, KeyF1); BIND(KeyPad2, KeyF2); BIND(KeyPad3, KeyF3); - BIND(KeyPad4, KeyF4); BIND(KeyPad5, KeyF5); BIND(KeyPad6, KeyF6); - BIND(KeyPad7, KeyF7); BIND(KeyPad8, KeyF8); BIND(KeyPad9, KeyF9); - BIND(KeyPadPlus, KeySemicolon); - BIND(KeyPadMinus, KeyMinus); - - BIND(KeyPadEnter, KeyEnter); - BIND(KeyPadDecimalPoint, KeyFullStop); - BIND(KeyPadEquals, KeyMinus); - BIND(KeyPadSlash, KeyForwardSlash); - BIND(KeyPadAsterisk, KeyColon); - BIND(KeyPadDelete, KeyDelete); - } -#undef BIND -} diff --git a/Machines/AmstradCPC/KeyboardMapper.hpp b/Machines/AmstradCPC/KeyboardMapper.hpp deleted file mode 100644 index da848b113..000000000 --- a/Machines/AmstradCPC/KeyboardMapper.hpp +++ /dev/null @@ -1,22 +0,0 @@ -// -// KeyboardMapper.hpp -// Clock Signal -// -// Created by Thomas Harte on 10/10/2017. -// Copyright © 2017 Thomas Harte. All rights reserved. -// - -#ifndef Machines_AmstradCPC_KeyboardMapper_hpp -#define Machines_AmstradCPC_KeyboardMapper_hpp - -#include "../KeyboardMachine.hpp" - -namespace AmstradCPC { - -struct KeyboardMapper: public KeyboardMachine::Machine::KeyboardMapper { - uint16_t mapped_key_for_key(Inputs::Keyboard::Key key); -}; - -}; - -#endif /* KeyboardMapper_hpp */ diff --git a/Machines/Commodore/Vic-20/Keyboard.cpp b/Machines/Commodore/Vic-20/Keyboard.cpp index 7bede4a65..8f3d5773d 100644 --- a/Machines/Commodore/Vic-20/Keyboard.cpp +++ b/Machines/Commodore/Vic-20/Keyboard.cpp @@ -1,5 +1,5 @@ // -// KeyboardMapper.cpp +// Keyboard.cpp // Clock Signal // // Created by Thomas Harte on 10/10/2017. @@ -7,7 +7,6 @@ // #include "Keyboard.hpp" -#include "Vic20.hpp" using namespace Commodore::Vic20; diff --git a/Machines/Electron/CharacterMapper.hpp b/Machines/Electron/CharacterMapper.hpp deleted file mode 100644 index d74a43ce6..000000000 --- a/Machines/Electron/CharacterMapper.hpp +++ /dev/null @@ -1,23 +0,0 @@ -// -// CharacterMapper.hpp -// Clock Signal -// -// Created by Thomas Harte on 03/08/2017. -// Copyright © 2017 Thomas Harte. All rights reserved. -// - -#ifndef Machines_Electron_CharacterMapper_hpp -#define Machines_Electron_CharacterMapper_hpp - -#include "../Utility/Typer.hpp" - -namespace Electron { - -class CharacterMapper: public ::Utility::CharacterMapper { - public: - uint16_t *sequence_for_character(char character); -}; - -} - -#endif /* Machines_Electron_CharacterMapper_hpp */ diff --git a/Machines/Electron/Electron.cpp b/Machines/Electron/Electron.cpp index 5b8055edb..cb39fc39f 100644 --- a/Machines/Electron/Electron.cpp +++ b/Machines/Electron/Electron.cpp @@ -15,9 +15,8 @@ #include "../Utility/Typer.hpp" -#include "CharacterMapper.hpp" #include "Interrupts.hpp" -#include "KeyboardMapper.hpp" +#include "Keyboard.hpp" #include "Plus3.hpp" #include "Speaker.hpp" #include "Tape.hpp" diff --git a/Machines/Electron/Electron.hpp b/Machines/Electron/Electron.hpp index e30f39c22..724956157 100644 --- a/Machines/Electron/Electron.hpp +++ b/Machines/Electron/Electron.hpp @@ -31,25 +31,6 @@ enum ROMSlot: uint8_t { ROMSlotOS, ROMSlotDFS, ROMSlotADFS }; -enum Key: uint16_t { - KeySpace = 0x0000 | 0x08, KeyCopy = 0x0000 | 0x02, KeyRight = 0x0000 | 0x01, - KeyDelete = 0x0010 | 0x08, KeyReturn = 0x0010 | 0x04, KeyDown = 0x0010 | 0x02, KeyLeft = 0x0010 | 0x01, - KeyColon = 0x0020 | 0x04, KeyUp = 0x0020 | 0x02, KeyMinus = 0x0020 | 0x01, - KeySlash = 0x0030 | 0x08, KeySemiColon = 0x0030 | 0x04, KeyP = 0x0030 | 0x02, Key0 = 0x0030 | 0x01, - KeyFullStop = 0x0040 | 0x08, KeyL = 0x0040 | 0x04, KeyO = 0x0040 | 0x02, Key9 = 0x0040 | 0x01, - KeyComma = 0x0050 | 0x08, KeyK = 0x0050 | 0x04, KeyI = 0x0050 | 0x02, Key8 = 0x0050 | 0x01, - KeyM = 0x0060 | 0x08, KeyJ = 0x0060 | 0x04, KeyU = 0x0060 | 0x02, Key7 = 0x0060 | 0x01, - KeyN = 0x0070 | 0x08, KeyH = 0x0070 | 0x04, KeyY = 0x0070 | 0x02, Key6 = 0x0070 | 0x01, - KeyB = 0x0080 | 0x08, KeyG = 0x0080 | 0x04, KeyT = 0x0080 | 0x02, Key5 = 0x0080 | 0x01, - KeyV = 0x0090 | 0x08, KeyF = 0x0090 | 0x04, KeyR = 0x0090 | 0x02, Key4 = 0x0090 | 0x01, - KeyC = 0x00a0 | 0x08, KeyD = 0x00a0 | 0x04, KeyE = 0x00a0 | 0x02, Key3 = 0x00a0 | 0x01, - KeyX = 0x00b0 | 0x08, KeyS = 0x00b0 | 0x04, KeyW = 0x00b0 | 0x02, Key2 = 0x00b0 | 0x01, - KeyZ = 0x00c0 | 0x08, KeyA = 0x00c0 | 0x04, KeyQ = 0x00c0 | 0x02, Key1 = 0x00c0 | 0x01, - KeyShift = 0x00d0 | 0x08, KeyControl = 0x00d0 | 0x04, KeyFunc = 0x00d0 | 0x02, KeyEscape = 0x00d0 | 0x01, - - KeyBreak = 0xfffd, -}; - /*! @abstract Represents an Acorn Electron. diff --git a/Machines/Electron/CharacterMapper.cpp b/Machines/Electron/Keyboard.cpp similarity index 65% rename from Machines/Electron/CharacterMapper.cpp rename to Machines/Electron/Keyboard.cpp index d17588ced..381e07b40 100644 --- a/Machines/Electron/CharacterMapper.cpp +++ b/Machines/Electron/Keyboard.cpp @@ -1,16 +1,60 @@ // -// CharacterMapper.cpp +// Keyboard.cpp // Clock Signal // -// Created by Thomas Harte on 03/08/2017. +// Created by Thomas Harte on 10/10/2017. // Copyright © 2017 Thomas Harte. All rights reserved. // -#include "CharacterMapper.hpp" -#include "Electron.hpp" +#include "Keyboard.hpp" using namespace Electron; +uint16_t KeyboardMapper::mapped_key_for_key(Inputs::Keyboard::Key key) { +#define BIND(source, dest) case Inputs::Keyboard::Key::source: return Electron::Key::dest + switch(key) { + default: return KeyCopy; + + BIND(k0, Key0); BIND(k1, Key1); BIND(k2, Key2); BIND(k3, Key3); BIND(k4, Key4); + BIND(k5, Key5); BIND(k6, Key6); BIND(k7, Key7); BIND(k8, Key8); BIND(k9, Key9); + BIND(Q, KeyQ); BIND(W, KeyW); BIND(E, KeyE); BIND(R, KeyR); BIND(T, KeyT); + BIND(Y, KeyY); BIND(U, KeyU); BIND(I, KeyI); BIND(O, KeyO); BIND(P, KeyP); + BIND(A, KeyA); BIND(S, KeyS); BIND(D, KeyD); BIND(F, KeyF); BIND(G, KeyG); + BIND(H, KeyH); BIND(J, KeyJ); BIND(K, KeyK); BIND(L, KeyL); + BIND(Z, KeyZ); BIND(X, KeyX); BIND(C, KeyC); BIND(V, KeyV); + BIND(B, KeyB); BIND(N, KeyN); BIND(M, KeyM); + + BIND(Comma, KeyComma); + BIND(FullStop, KeyFullStop); + BIND(ForwardSlash, KeySlash); + BIND(Semicolon, KeySemiColon); + BIND(Quote, KeyColon); + + BIND(Escape, KeyEscape); + BIND(Equals, KeyBreak); + BIND(F12, KeyBreak); + + BIND(Left, KeyLeft); BIND(Right, KeyRight); BIND(Up, KeyUp); BIND(Down, KeyDown); + + BIND(Tab, KeyFunc); BIND(LeftOption, KeyFunc); BIND(RightOption, KeyFunc); + BIND(LeftMeta, KeyFunc); BIND(RightMeta, KeyFunc); + BIND(CapsLock, KeyControl); BIND(LeftControl, KeyControl); BIND(RightControl, KeyControl); + BIND(LeftShift, KeyShift); BIND(RightShift, KeyShift); + + BIND(Hyphen, KeyMinus); + BIND(Delete, KeyDelete); + BIND(Enter, KeyReturn); BIND(KeyPadEnter, KeyReturn); + + BIND(KeyPad0, Key0); BIND(KeyPad1, Key1); BIND(KeyPad2, Key2); BIND(KeyPad3, Key3); BIND(KeyPad4, Key4); + BIND(KeyPad5, Key5); BIND(KeyPad6, Key6); BIND(KeyPad7, Key7); BIND(KeyPad8, Key8); BIND(KeyPad9, Key9); + + BIND(KeyPadMinus, KeyMinus); BIND(KeyPadPlus, KeyColon); + + BIND(Space, KeySpace); + } +#undef BIND +} + uint16_t *CharacterMapper::sequence_for_character(char character) { #define KEYS(...) {__VA_ARGS__, KeyboardMachine::Machine::KeyEndSequence} #define SHIFT(...) {KeyShift, __VA_ARGS__, KeyboardMachine::Machine::KeyEndSequence} diff --git a/Machines/Electron/Keyboard.hpp b/Machines/Electron/Keyboard.hpp new file mode 100644 index 000000000..b752d2337 --- /dev/null +++ b/Machines/Electron/Keyboard.hpp @@ -0,0 +1,46 @@ +// +// Keyboard.hpp +// Clock Signal +// +// Created by Thomas Harte on 10/10/2017. +// Copyright © 2017 Thomas Harte. All rights reserved. +// + +#ifndef Machines_Electron_Keyboard_hpp +#define Machines_Electron_Keyboard_hpp + +#include "../KeyboardMachine.hpp" +#include "../Utility/Typer.hpp" + +namespace Electron { + +enum Key: uint16_t { + KeySpace = 0x0000 | 0x08, KeyCopy = 0x0000 | 0x02, KeyRight = 0x0000 | 0x01, + KeyDelete = 0x0010 | 0x08, KeyReturn = 0x0010 | 0x04, KeyDown = 0x0010 | 0x02, KeyLeft = 0x0010 | 0x01, + KeyColon = 0x0020 | 0x04, KeyUp = 0x0020 | 0x02, KeyMinus = 0x0020 | 0x01, + KeySlash = 0x0030 | 0x08, KeySemiColon = 0x0030 | 0x04, KeyP = 0x0030 | 0x02, Key0 = 0x0030 | 0x01, + KeyFullStop = 0x0040 | 0x08, KeyL = 0x0040 | 0x04, KeyO = 0x0040 | 0x02, Key9 = 0x0040 | 0x01, + KeyComma = 0x0050 | 0x08, KeyK = 0x0050 | 0x04, KeyI = 0x0050 | 0x02, Key8 = 0x0050 | 0x01, + KeyM = 0x0060 | 0x08, KeyJ = 0x0060 | 0x04, KeyU = 0x0060 | 0x02, Key7 = 0x0060 | 0x01, + KeyN = 0x0070 | 0x08, KeyH = 0x0070 | 0x04, KeyY = 0x0070 | 0x02, Key6 = 0x0070 | 0x01, + KeyB = 0x0080 | 0x08, KeyG = 0x0080 | 0x04, KeyT = 0x0080 | 0x02, Key5 = 0x0080 | 0x01, + KeyV = 0x0090 | 0x08, KeyF = 0x0090 | 0x04, KeyR = 0x0090 | 0x02, Key4 = 0x0090 | 0x01, + KeyC = 0x00a0 | 0x08, KeyD = 0x00a0 | 0x04, KeyE = 0x00a0 | 0x02, Key3 = 0x00a0 | 0x01, + KeyX = 0x00b0 | 0x08, KeyS = 0x00b0 | 0x04, KeyW = 0x00b0 | 0x02, Key2 = 0x00b0 | 0x01, + KeyZ = 0x00c0 | 0x08, KeyA = 0x00c0 | 0x04, KeyQ = 0x00c0 | 0x02, Key1 = 0x00c0 | 0x01, + KeyShift = 0x00d0 | 0x08, KeyControl = 0x00d0 | 0x04, KeyFunc = 0x00d0 | 0x02, KeyEscape = 0x00d0 | 0x01, + + KeyBreak = 0xfffd, +}; + +struct KeyboardMapper: public KeyboardMachine::Machine::KeyboardMapper { + uint16_t mapped_key_for_key(Inputs::Keyboard::Key key); +}; + +struct CharacterMapper: public ::Utility::CharacterMapper { + uint16_t *sequence_for_character(char character); +}; + +}; + +#endif /* KeyboardMapper_hpp */ diff --git a/Machines/Electron/KeyboardMapper.cpp b/Machines/Electron/KeyboardMapper.cpp deleted file mode 100644 index 50ee57b80..000000000 --- a/Machines/Electron/KeyboardMapper.cpp +++ /dev/null @@ -1,57 +0,0 @@ -// -// KeyboardMapper.cpp -// Clock Signal -// -// Created by Thomas Harte on 10/10/2017. -// Copyright © 2017 Thomas Harte. All rights reserved. -// - -#include "KeyboardMapper.hpp" -#include "Electron.hpp" - -using namespace Electron; - -uint16_t KeyboardMapper::mapped_key_for_key(Inputs::Keyboard::Key key) { -#define BIND(source, dest) case Inputs::Keyboard::Key::source: return Electron::Key::dest - switch(key) { - default: return KeyCopy; - - BIND(k0, Key0); BIND(k1, Key1); BIND(k2, Key2); BIND(k3, Key3); BIND(k4, Key4); - BIND(k5, Key5); BIND(k6, Key6); BIND(k7, Key7); BIND(k8, Key8); BIND(k9, Key9); - BIND(Q, KeyQ); BIND(W, KeyW); BIND(E, KeyE); BIND(R, KeyR); BIND(T, KeyT); - BIND(Y, KeyY); BIND(U, KeyU); BIND(I, KeyI); BIND(O, KeyO); BIND(P, KeyP); - BIND(A, KeyA); BIND(S, KeyS); BIND(D, KeyD); BIND(F, KeyF); BIND(G, KeyG); - BIND(H, KeyH); BIND(J, KeyJ); BIND(K, KeyK); BIND(L, KeyL); - BIND(Z, KeyZ); BIND(X, KeyX); BIND(C, KeyC); BIND(V, KeyV); - BIND(B, KeyB); BIND(N, KeyN); BIND(M, KeyM); - - BIND(Comma, KeyComma); - BIND(FullStop, KeyFullStop); - BIND(ForwardSlash, KeySlash); - BIND(Semicolon, KeySemiColon); - BIND(Quote, KeyColon); - - BIND(Escape, KeyEscape); - BIND(Equals, KeyBreak); - BIND(F12, KeyBreak); - - BIND(Left, KeyLeft); BIND(Right, KeyRight); BIND(Up, KeyUp); BIND(Down, KeyDown); - - BIND(Tab, KeyFunc); BIND(LeftOption, KeyFunc); BIND(RightOption, KeyFunc); - BIND(LeftMeta, KeyFunc); BIND(RightMeta, KeyFunc); - BIND(CapsLock, KeyControl); BIND(LeftControl, KeyControl); BIND(RightControl, KeyControl); - BIND(LeftShift, KeyShift); BIND(RightShift, KeyShift); - - BIND(Hyphen, KeyMinus); - BIND(Delete, KeyDelete); - BIND(Enter, KeyReturn); BIND(KeyPadEnter, KeyReturn); - - BIND(KeyPad0, Key0); BIND(KeyPad1, Key1); BIND(KeyPad2, Key2); BIND(KeyPad3, Key3); BIND(KeyPad4, Key4); - BIND(KeyPad5, Key5); BIND(KeyPad6, Key6); BIND(KeyPad7, Key7); BIND(KeyPad8, Key8); BIND(KeyPad9, Key9); - - BIND(KeyPadMinus, KeyMinus); BIND(KeyPadPlus, KeyColon); - - BIND(Space, KeySpace); - } -#undef BIND -} diff --git a/Machines/Electron/KeyboardMapper.hpp b/Machines/Electron/KeyboardMapper.hpp deleted file mode 100644 index 6b2528a33..000000000 --- a/Machines/Electron/KeyboardMapper.hpp +++ /dev/null @@ -1,22 +0,0 @@ -// -// KeyboardMapper.hpp -// Clock Signal -// -// Created by Thomas Harte on 10/10/2017. -// Copyright © 2017 Thomas Harte. All rights reserved. -// - -#ifndef Machines_Electron_KeyboardMapper_hpp -#define Machines_Electron_KeyboardMapper_hpp - -#include "../KeyboardMachine.hpp" - -namespace Electron { - -struct KeyboardMapper: public KeyboardMachine::Machine::KeyboardMapper { - uint16_t mapped_key_for_key(Inputs::Keyboard::Key key); -}; - -}; - -#endif /* KeyboardMapper_hpp */ diff --git a/Machines/Oric/CharacterMapper.hpp b/Machines/Oric/CharacterMapper.hpp deleted file mode 100644 index ca6a0641e..000000000 --- a/Machines/Oric/CharacterMapper.hpp +++ /dev/null @@ -1,23 +0,0 @@ -// -// CharacterMapper.hpp -// Clock Signal -// -// Created by Thomas Harte on 03/08/2017. -// Copyright © 2017 Thomas Harte. All rights reserved. -// - -#ifndef Machines_Oric_CharacterMapper_hpp -#define Machines_Oric_CharacterMapper_hpp - -#include "../Utility/Typer.hpp" - -namespace Oric { - -class CharacterMapper: public ::Utility::CharacterMapper { - public: - uint16_t *sequence_for_character(char character); -}; - -} - -#endif /* Machines_Oric_CharacterMapper_hpp */ diff --git a/Machines/Oric/CharacterMapper.cpp b/Machines/Oric/Keyboard.cpp similarity index 66% rename from Machines/Oric/CharacterMapper.cpp rename to Machines/Oric/Keyboard.cpp index 53df8fa35..d00abdc0b 100644 --- a/Machines/Oric/CharacterMapper.cpp +++ b/Machines/Oric/Keyboard.cpp @@ -1,16 +1,56 @@ // -// CharacterMapper.cpp +// Keyboard.cpp // Clock Signal // -// Created by Thomas Harte on 03/08/2017. +// Created by Thomas Harte on 10/10/2017. // Copyright © 2017 Thomas Harte. All rights reserved. // -#include "CharacterMapper.hpp" -#include "Oric.hpp" +#include "Keyboard.hpp" using namespace Oric; +uint16_t KeyboardMapper::mapped_key_for_key(Inputs::Keyboard::Key key) { +#define BIND(source, dest) case Inputs::Keyboard::Key::source: return Oric::dest + switch(key) { + default: break; + + BIND(k0, Key0); BIND(k1, Key1); BIND(k2, Key2); BIND(k3, Key3); BIND(k4, Key4); + BIND(k5, Key5); BIND(k6, Key6); BIND(k7, Key7); BIND(k8, Key8); BIND(k9, Key9); + BIND(Q, KeyQ); BIND(W, KeyW); BIND(E, KeyE); BIND(R, KeyR); BIND(T, KeyT); + BIND(Y, KeyY); BIND(U, KeyU); BIND(I, KeyI); BIND(O, KeyO); BIND(P, KeyP); + BIND(A, KeyA); BIND(S, KeyS); BIND(D, KeyD); BIND(F, KeyF); BIND(G, KeyG); + BIND(H, KeyH); BIND(J, KeyJ); BIND(K, KeyK); BIND(L, KeyL); + BIND(Z, KeyZ); BIND(X, KeyX); BIND(C, KeyC); BIND(V, KeyV); + BIND(B, KeyB); BIND(N, KeyN); BIND(M, KeyM); + + BIND(Left, KeyLeft); BIND(Right, KeyRight); BIND(Up, KeyUp); BIND(Down, KeyDown); + + BIND(Hyphen, KeyMinus); BIND(Equals, KeyEquals); BIND(BackSlash, KeyBackSlash); + BIND(OpenSquareBracket, KeyOpenSquare); BIND(CloseSquareBracket, KeyCloseSquare); + + BIND(BackSpace, KeyDelete); BIND(Delete, KeyDelete); + + BIND(Semicolon, KeySemiColon); BIND(Quote, KeyQuote); + BIND(Comma, KeyComma); BIND(FullStop, KeyFullStop); BIND(ForwardSlash, KeyForwardSlash); + + BIND(Escape, KeyEscape); BIND(Tab, KeyEscape); + BIND(CapsLock, KeyControl); BIND(LeftControl, KeyControl); BIND(RightControl, KeyControl); + BIND(LeftOption, KeyFunction); + BIND(RightOption, KeyFunction); + BIND(LeftMeta, KeyFunction); + BIND(RightMeta, KeyFunction); + BIND(LeftShift, KeyLeftShift); + BIND(RightShift, KeyRightShift); + + BIND(Space, KeySpace); + BIND(Enter, KeyReturn); + } +#undef BIND + + return KeyboardMachine::Machine::KeyNotMapped; +} + uint16_t *CharacterMapper::sequence_for_character(char character) { #define KEYS(...) {__VA_ARGS__, KeyboardMachine::Machine::KeyEndSequence} #define SHIFT(...) {KeyLeftShift, __VA_ARGS__, KeyboardMachine::Machine::KeyEndSequence} diff --git a/Machines/Oric/Keyboard.hpp b/Machines/Oric/Keyboard.hpp new file mode 100644 index 000000000..2adca8442 --- /dev/null +++ b/Machines/Oric/Keyboard.hpp @@ -0,0 +1,48 @@ +// +// Keyboard.hpp +// Clock Signal +// +// Created by Thomas Harte on 10/10/2017. +// Copyright © 2017 Thomas Harte. All rights reserved. +// + +#ifndef Machines_Oric_Keyboard_hpp +#define Machines_Oric_Keyboard_hpp + +#include "../KeyboardMachine.hpp" +#include "../Utility/Typer.hpp" + +namespace Oric { + +enum Key: uint16_t { + Key3 = 0x0000 | 0x80, KeyX = 0x0000 | 0x40, Key1 = 0x0000 | 0x20, + KeyV = 0x0000 | 0x08, Key5 = 0x0000 | 0x04, KeyN = 0x0000 | 0x02, Key7 = 0x0000 | 0x01, + KeyD = 0x0100 | 0x80, KeyQ = 0x0100 | 0x40, KeyEscape = 0x0100 | 0x20, + KeyF = 0x0100 | 0x08, KeyR = 0x0100 | 0x04, KeyT = 0x0100 | 0x02, KeyJ = 0x0100 | 0x01, + KeyC = 0x0200 | 0x80, Key2 = 0x0200 | 0x40, KeyZ = 0x0200 | 0x20, KeyControl = 0x0200 | 0x10, + Key4 = 0x0200 | 0x08, KeyB = 0x0200 | 0x04, Key6 = 0x0200 | 0x02, KeyM = 0x0200 | 0x01, + KeyQuote = 0x0300 | 0x80, KeyBackSlash = 0x0300 | 0x40, + KeyMinus = 0x0300 | 0x08, KeySemiColon = 0x0300 | 0x04, Key9 = 0x0300 | 0x02, KeyK = 0x0300 | 0x01, + KeyRight = 0x0400 | 0x80, KeyDown = 0x0400 | 0x40, KeyLeft = 0x0400 | 0x20, KeyLeftShift = 0x0400 | 0x10, + KeyUp = 0x0400 | 0x08, KeyFullStop = 0x0400 | 0x04, KeyComma = 0x0400 | 0x02, KeySpace = 0x0400 | 0x01, + KeyOpenSquare = 0x0500 | 0x80, KeyCloseSquare = 0x0500 | 0x40, KeyDelete = 0x0500 | 0x20, KeyFunction = 0x0500 | 0x10, + KeyP = 0x0500 | 0x08, KeyO = 0x0500 | 0x04, KeyI = 0x0500 | 0x02, KeyU = 0x0500 | 0x01, + KeyW = 0x0600 | 0x80, KeyS = 0x0600 | 0x40, KeyA = 0x0600 | 0x20, + KeyE = 0x0600 | 0x08, KeyG = 0x0600 | 0x04, KeyH = 0x0600 | 0x02, KeyY = 0x0600 | 0x01, + KeyEquals = 0x0700 | 0x80, KeyReturn = 0x0700 | 0x20, KeyRightShift = 0x0700 | 0x10, + KeyForwardSlash = 0x0700 | 0x08, Key0 = 0x0700 | 0x04, KeyL = 0x0700 | 0x02, Key8 = 0x0700 | 0x01, + + KeyNMI = 0xfffd, +}; + +struct KeyboardMapper: public KeyboardMachine::Machine::KeyboardMapper { + uint16_t mapped_key_for_key(Inputs::Keyboard::Key key); +}; + +struct CharacterMapper: public ::Utility::CharacterMapper { + uint16_t *sequence_for_character(char character); +}; + +}; + +#endif /* KeyboardMapper_hpp */ diff --git a/Machines/Oric/KeyboardMapper.cpp b/Machines/Oric/KeyboardMapper.cpp deleted file mode 100644 index 4a8a5a8e7..000000000 --- a/Machines/Oric/KeyboardMapper.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// -// KeyboardMapper.cpp -// Clock Signal -// -// Created by Thomas Harte on 10/10/2017. -// Copyright © 2017 Thomas Harte. All rights reserved. -// - -#include "KeyboardMapper.hpp" -#include "Oric.hpp" - -using namespace Oric; - -uint16_t KeyboardMapper::mapped_key_for_key(Inputs::Keyboard::Key key) { -#define BIND(source, dest) case Inputs::Keyboard::Key::source: return Oric::dest - switch(key) { - default: break; - - BIND(k0, Key0); BIND(k1, Key1); BIND(k2, Key2); BIND(k3, Key3); BIND(k4, Key4); - BIND(k5, Key5); BIND(k6, Key6); BIND(k7, Key7); BIND(k8, Key8); BIND(k9, Key9); - BIND(Q, KeyQ); BIND(W, KeyW); BIND(E, KeyE); BIND(R, KeyR); BIND(T, KeyT); - BIND(Y, KeyY); BIND(U, KeyU); BIND(I, KeyI); BIND(O, KeyO); BIND(P, KeyP); - BIND(A, KeyA); BIND(S, KeyS); BIND(D, KeyD); BIND(F, KeyF); BIND(G, KeyG); - BIND(H, KeyH); BIND(J, KeyJ); BIND(K, KeyK); BIND(L, KeyL); - BIND(Z, KeyZ); BIND(X, KeyX); BIND(C, KeyC); BIND(V, KeyV); - BIND(B, KeyB); BIND(N, KeyN); BIND(M, KeyM); - - BIND(Left, KeyLeft); BIND(Right, KeyRight); BIND(Up, KeyUp); BIND(Down, KeyDown); - - BIND(Hyphen, KeyMinus); BIND(Equals, KeyEquals); BIND(BackSlash, KeyBackSlash); - BIND(OpenSquareBracket, KeyOpenSquare); BIND(CloseSquareBracket, KeyCloseSquare); - - BIND(BackSpace, KeyDelete); BIND(Delete, KeyDelete); - - BIND(Semicolon, KeySemiColon); BIND(Quote, KeyQuote); - BIND(Comma, KeyComma); BIND(FullStop, KeyFullStop); BIND(ForwardSlash, KeyForwardSlash); - - BIND(Escape, KeyEscape); BIND(Tab, KeyEscape); - BIND(CapsLock, KeyControl); BIND(LeftControl, KeyControl); BIND(RightControl, KeyControl); - BIND(LeftOption, KeyFunction); - BIND(RightOption, KeyFunction); - BIND(LeftMeta, KeyFunction); - BIND(RightMeta, KeyFunction); - BIND(LeftShift, KeyLeftShift); - BIND(RightShift, KeyRightShift); - - BIND(Space, KeySpace); - BIND(Enter, KeyReturn); - } -#undef BIND - - return KeyboardMachine::Machine::KeyNotMapped; -} diff --git a/Machines/Oric/KeyboardMapper.hpp b/Machines/Oric/KeyboardMapper.hpp deleted file mode 100644 index 2a61bdf61..000000000 --- a/Machines/Oric/KeyboardMapper.hpp +++ /dev/null @@ -1,22 +0,0 @@ -// -// KeyboardMapper.hpp -// Clock Signal -// -// Created by Thomas Harte on 10/10/2017. -// Copyright © 2017 Thomas Harte. All rights reserved. -// - -#ifndef Machines_Oric_KeyboardMapper_hpp -#define Machines_Oric_KeyboardMapper_hpp - -#include "../KeyboardMachine.hpp" - -namespace Oric { - -struct KeyboardMapper: public KeyboardMachine::Machine::KeyboardMapper { - uint16_t mapped_key_for_key(Inputs::Keyboard::Key key); -}; - -}; - -#endif /* KeyboardMapper_hpp */ diff --git a/Machines/Oric/Oric.cpp b/Machines/Oric/Oric.cpp index 1c5ae8697..b59b37a0d 100644 --- a/Machines/Oric/Oric.cpp +++ b/Machines/Oric/Oric.cpp @@ -8,8 +8,7 @@ #include "Oric.hpp" -#include "CharacterMapper.hpp" -#include "KeyboardMapper.hpp" +#include "Keyboard.hpp" #include "Microdisc.hpp" #include "Video.hpp" diff --git a/Machines/Oric/Oric.hpp b/Machines/Oric/Oric.hpp index cecb873ef..9a69965a7 100644 --- a/Machines/Oric/Oric.hpp +++ b/Machines/Oric/Oric.hpp @@ -22,27 +22,6 @@ enum ROM { BASIC10, BASIC11, Microdisc, Colour }; -enum Key: uint16_t { - Key3 = 0x0000 | 0x80, KeyX = 0x0000 | 0x40, Key1 = 0x0000 | 0x20, - KeyV = 0x0000 | 0x08, Key5 = 0x0000 | 0x04, KeyN = 0x0000 | 0x02, Key7 = 0x0000 | 0x01, - KeyD = 0x0100 | 0x80, KeyQ = 0x0100 | 0x40, KeyEscape = 0x0100 | 0x20, - KeyF = 0x0100 | 0x08, KeyR = 0x0100 | 0x04, KeyT = 0x0100 | 0x02, KeyJ = 0x0100 | 0x01, - KeyC = 0x0200 | 0x80, Key2 = 0x0200 | 0x40, KeyZ = 0x0200 | 0x20, KeyControl = 0x0200 | 0x10, - Key4 = 0x0200 | 0x08, KeyB = 0x0200 | 0x04, Key6 = 0x0200 | 0x02, KeyM = 0x0200 | 0x01, - KeyQuote = 0x0300 | 0x80, KeyBackSlash = 0x0300 | 0x40, - KeyMinus = 0x0300 | 0x08, KeySemiColon = 0x0300 | 0x04, Key9 = 0x0300 | 0x02, KeyK = 0x0300 | 0x01, - KeyRight = 0x0400 | 0x80, KeyDown = 0x0400 | 0x40, KeyLeft = 0x0400 | 0x20, KeyLeftShift = 0x0400 | 0x10, - KeyUp = 0x0400 | 0x08, KeyFullStop = 0x0400 | 0x04, KeyComma = 0x0400 | 0x02, KeySpace = 0x0400 | 0x01, - KeyOpenSquare = 0x0500 | 0x80, KeyCloseSquare = 0x0500 | 0x40, KeyDelete = 0x0500 | 0x20, KeyFunction = 0x0500 | 0x10, - KeyP = 0x0500 | 0x08, KeyO = 0x0500 | 0x04, KeyI = 0x0500 | 0x02, KeyU = 0x0500 | 0x01, - KeyW = 0x0600 | 0x80, KeyS = 0x0600 | 0x40, KeyA = 0x0600 | 0x20, - KeyE = 0x0600 | 0x08, KeyG = 0x0600 | 0x04, KeyH = 0x0600 | 0x02, KeyY = 0x0600 | 0x01, - KeyEquals = 0x0700 | 0x80, KeyReturn = 0x0700 | 0x20, KeyRightShift = 0x0700 | 0x10, - KeyForwardSlash = 0x0700 | 0x08, Key0 = 0x0700 | 0x04, KeyL = 0x0700 | 0x02, Key8 = 0x0700 | 0x01, - - KeyNMI = 0xfffd, -}; - /*! Models an Oric 1/Atmos with or without a Microdisc. */ diff --git a/Machines/ZX8081/CharacterMapper.hpp b/Machines/ZX8081/CharacterMapper.hpp deleted file mode 100644 index 010b7a08d..000000000 --- a/Machines/ZX8081/CharacterMapper.hpp +++ /dev/null @@ -1,27 +0,0 @@ -// -// CharacterMapper.hpp -// Clock Signal -// -// Created by Thomas Harte on 03/08/2017. -// Copyright © 2017 Thomas Harte. All rights reserved. -// - -#ifndef Machines_ZX8081_CharacterMapper_hpp -#define Machines_ZX8081_CharacterMapper_hpp - -#include "../Utility/Typer.hpp" - -namespace ZX8081 { - -class CharacterMapper: public ::Utility::CharacterMapper { - public: - CharacterMapper(bool is_zx81); - uint16_t *sequence_for_character(char character); - - private: - bool is_zx81_; -}; - -} - -#endif /* CharacterMapper_hpp */ diff --git a/Machines/ZX8081/CharacterMapper.cpp b/Machines/ZX8081/Keyboard.cpp similarity index 85% rename from Machines/ZX8081/CharacterMapper.cpp rename to Machines/ZX8081/Keyboard.cpp index af4f41f60..8824e4507 100644 --- a/Machines/ZX8081/CharacterMapper.cpp +++ b/Machines/ZX8081/Keyboard.cpp @@ -1,16 +1,38 @@ // -// CharacterMapper.cpp +// Keyboard.cpp // Clock Signal // -// Created by Thomas Harte on 03/08/2017. +// Created by Thomas Harte on 10/10/2017. // Copyright © 2017 Thomas Harte. All rights reserved. // -#include "CharacterMapper.hpp" -#include "ZX8081.hpp" +#include "Keyboard.hpp" using namespace ZX8081; +uint16_t KeyboardMapper::mapped_key_for_key(Inputs::Keyboard::Key key) { +#define BIND(source, dest) case Inputs::Keyboard::Key::source: return ZX8081::dest + switch(key) { + default: break; + + BIND(k0, Key0); BIND(k1, Key1); BIND(k2, Key2); BIND(k3, Key3); BIND(k4, Key4); + BIND(k5, Key5); BIND(k6, Key6); BIND(k7, Key7); BIND(k8, Key8); BIND(k9, Key9); + BIND(Q, KeyQ); BIND(W, KeyW); BIND(E, KeyE); BIND(R, KeyR); BIND(T, KeyT); + BIND(Y, KeyY); BIND(U, KeyU); BIND(I, KeyI); BIND(O, KeyO); BIND(P, KeyP); + BIND(A, KeyA); BIND(S, KeyS); BIND(D, KeyD); BIND(F, KeyF); BIND(G, KeyG); + BIND(H, KeyH); BIND(J, KeyJ); BIND(K, KeyK); BIND(L, KeyL); + BIND(Z, KeyZ); BIND(X, KeyX); BIND(C, KeyC); BIND(V, KeyV); + BIND(B, KeyB); BIND(N, KeyN); BIND(M, KeyM); + + BIND(LeftShift, KeyShift); BIND(RightShift, KeyShift); + BIND(FullStop, KeyDot); + BIND(Enter, KeyEnter); + BIND(Space, KeySpace); + } +#undef BIND + return KeyboardMachine::Machine::KeyNotMapped; +} + CharacterMapper::CharacterMapper(bool is_zx81) : is_zx81_(is_zx81) {} uint16_t *CharacterMapper::sequence_for_character(char character) { diff --git a/Machines/ZX8081/Keyboard.hpp b/Machines/ZX8081/Keyboard.hpp new file mode 100644 index 000000000..146b676b7 --- /dev/null +++ b/Machines/ZX8081/Keyboard.hpp @@ -0,0 +1,43 @@ +// +// Keyboard.hpp +// Clock Signal +// +// Created by Thomas Harte on 10/10/2017. +// Copyright © 2017 Thomas Harte. All rights reserved. +// + +#ifndef Machines_ZX8081_Keyboard_hpp +#define Machines_ZX8081_Keyboard_hpp + +#include "../KeyboardMachine.hpp" +#include "../Utility/Typer.hpp" + +namespace ZX8081 { + +enum Key: uint16_t { + KeyShift = 0x0000 | 0x01, KeyZ = 0x0000 | 0x02, KeyX = 0x0000 | 0x04, KeyC = 0x0000 | 0x08, KeyV = 0x0000 | 0x10, + KeyA = 0x0100 | 0x01, KeyS = 0x0100 | 0x02, KeyD = 0x0100 | 0x04, KeyF = 0x0100 | 0x08, KeyG = 0x0100 | 0x10, + KeyQ = 0x0200 | 0x01, KeyW = 0x0200 | 0x02, KeyE = 0x0200 | 0x04, KeyR = 0x0200 | 0x08, KeyT = 0x0200 | 0x10, + Key1 = 0x0300 | 0x01, Key2 = 0x0300 | 0x02, Key3 = 0x0300 | 0x04, Key4 = 0x0300 | 0x08, Key5 = 0x0300 | 0x10, + Key0 = 0x0400 | 0x01, Key9 = 0x0400 | 0x02, Key8 = 0x0400 | 0x04, Key7 = 0x0400 | 0x08, Key6 = 0x0400 | 0x10, + KeyP = 0x0500 | 0x01, KeyO = 0x0500 | 0x02, KeyI = 0x0500 | 0x04, KeyU = 0x0500 | 0x08, KeyY = 0x0500 | 0x10, + KeyEnter = 0x0600 | 0x01, KeyL = 0x0600 | 0x02, KeyK = 0x0600 | 0x04, KeyJ = 0x0600 | 0x08, KeyH = 0x0600 | 0x10, + KeySpace = 0x0700 | 0x01, KeyDot = 0x0700 | 0x02, KeyM = 0x0700 | 0x04, KeyN = 0x0700 | 0x08, KeyB = 0x0700 | 0x10, +}; + +struct KeyboardMapper: public KeyboardMachine::Machine::KeyboardMapper { + uint16_t mapped_key_for_key(Inputs::Keyboard::Key key); +}; + +class CharacterMapper: public ::Utility::CharacterMapper { + public: + CharacterMapper(bool is_zx81); + uint16_t *sequence_for_character(char character); + + private: + bool is_zx81_; +}; + +}; + +#endif /* KeyboardMapper_hpp */ diff --git a/Machines/ZX8081/KeyboardMapper.cpp b/Machines/ZX8081/KeyboardMapper.cpp deleted file mode 100644 index 1280f2e92..000000000 --- a/Machines/ZX8081/KeyboardMapper.cpp +++ /dev/null @@ -1,35 +0,0 @@ -// -// KeyboardMapper.cpp -// Clock Signal -// -// Created by Thomas Harte on 10/10/2017. -// Copyright © 2017 Thomas Harte. All rights reserved. -// - -#include "KeyboardMapper.hpp" -#include "ZX8081.hpp" - -using namespace ZX8081; - -uint16_t KeyboardMapper::mapped_key_for_key(Inputs::Keyboard::Key key) { -#define BIND(source, dest) case Inputs::Keyboard::Key::source: return ZX8081::dest - switch(key) { - default: break; - - BIND(k0, Key0); BIND(k1, Key1); BIND(k2, Key2); BIND(k3, Key3); BIND(k4, Key4); - BIND(k5, Key5); BIND(k6, Key6); BIND(k7, Key7); BIND(k8, Key8); BIND(k9, Key9); - BIND(Q, KeyQ); BIND(W, KeyW); BIND(E, KeyE); BIND(R, KeyR); BIND(T, KeyT); - BIND(Y, KeyY); BIND(U, KeyU); BIND(I, KeyI); BIND(O, KeyO); BIND(P, KeyP); - BIND(A, KeyA); BIND(S, KeyS); BIND(D, KeyD); BIND(F, KeyF); BIND(G, KeyG); - BIND(H, KeyH); BIND(J, KeyJ); BIND(K, KeyK); BIND(L, KeyL); - BIND(Z, KeyZ); BIND(X, KeyX); BIND(C, KeyC); BIND(V, KeyV); - BIND(B, KeyB); BIND(N, KeyN); BIND(M, KeyM); - - BIND(LeftShift, KeyShift); BIND(RightShift, KeyShift); - BIND(FullStop, KeyDot); - BIND(Enter, KeyEnter); - BIND(Space, KeySpace); - } -#undef BIND - return KeyboardMachine::Machine::KeyNotMapped; -} diff --git a/Machines/ZX8081/KeyboardMapper.hpp b/Machines/ZX8081/KeyboardMapper.hpp deleted file mode 100644 index 5129fa305..000000000 --- a/Machines/ZX8081/KeyboardMapper.hpp +++ /dev/null @@ -1,22 +0,0 @@ -// -// KeyboardMapper.hpp -// Clock Signal -// -// Created by Thomas Harte on 10/10/2017. -// Copyright © 2017 Thomas Harte. All rights reserved. -// - -#ifndef Machines_ZX8081_KeyboardMapper_hpp -#define Machines_ZX8081_KeyboardMapper_hpp - -#include "../KeyboardMachine.hpp" - -namespace ZX8081 { - -struct KeyboardMapper: public KeyboardMachine::Machine::KeyboardMapper { - uint16_t mapped_key_for_key(Inputs::Keyboard::Key key); -}; - -}; - -#endif /* KeyboardMapper_hpp */ diff --git a/Machines/ZX8081/ZX8081.cpp b/Machines/ZX8081/ZX8081.cpp index 43f7d0ce1..4679db934 100644 --- a/Machines/ZX8081/ZX8081.cpp +++ b/Machines/ZX8081/ZX8081.cpp @@ -17,8 +17,7 @@ #include "../Utility/MemoryFuzzer.hpp" #include "../Utility/Typer.hpp" -#include "CharacterMapper.hpp" -#include "KeyboardMapper.hpp" +#include "Keyboard.hpp" #include "Video.hpp" #include diff --git a/Machines/ZX8081/ZX8081.hpp b/Machines/ZX8081/ZX8081.hpp index 22025fcd2..9750183e6 100644 --- a/Machines/ZX8081/ZX8081.hpp +++ b/Machines/ZX8081/ZX8081.hpp @@ -22,17 +22,6 @@ enum ROMType: uint8_t { ZX80, ZX81 }; -enum Key: uint16_t { - KeyShift = 0x0000 | 0x01, KeyZ = 0x0000 | 0x02, KeyX = 0x0000 | 0x04, KeyC = 0x0000 | 0x08, KeyV = 0x0000 | 0x10, - KeyA = 0x0100 | 0x01, KeyS = 0x0100 | 0x02, KeyD = 0x0100 | 0x04, KeyF = 0x0100 | 0x08, KeyG = 0x0100 | 0x10, - KeyQ = 0x0200 | 0x01, KeyW = 0x0200 | 0x02, KeyE = 0x0200 | 0x04, KeyR = 0x0200 | 0x08, KeyT = 0x0200 | 0x10, - Key1 = 0x0300 | 0x01, Key2 = 0x0300 | 0x02, Key3 = 0x0300 | 0x04, Key4 = 0x0300 | 0x08, Key5 = 0x0300 | 0x10, - Key0 = 0x0400 | 0x01, Key9 = 0x0400 | 0x02, Key8 = 0x0400 | 0x04, Key7 = 0x0400 | 0x08, Key6 = 0x0400 | 0x10, - KeyP = 0x0500 | 0x01, KeyO = 0x0500 | 0x02, KeyI = 0x0500 | 0x04, KeyU = 0x0500 | 0x08, KeyY = 0x0500 | 0x10, - KeyEnter = 0x0600 | 0x01, KeyL = 0x0600 | 0x02, KeyK = 0x0600 | 0x04, KeyJ = 0x0600 | 0x08, KeyH = 0x0600 | 0x10, - KeySpace = 0x0700 | 0x01, KeyDot = 0x0700 | 0x02, KeyM = 0x0700 | 0x04, KeyN = 0x0700 | 0x08, KeyB = 0x0700 | 0x10, -}; - class Machine: public CRTMachine::Machine, public ConfigurationTarget::Machine, diff --git a/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj b/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj index 480495edf..84ab437c3 100644 --- a/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj +++ b/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj @@ -82,11 +82,11 @@ 4B5073071DDD3B9400C48FBD /* ArrayBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B5073051DDD3B9400C48FBD /* ArrayBuilder.cpp */; }; 4B50730A1DDFCFDF00C48FBD /* ArrayBuilderTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4B5073091DDFCFDF00C48FBD /* ArrayBuilderTests.mm */; }; 4B54C0BC1F8D8E790050900F /* KeyboardMachine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B54C0BB1F8D8E790050900F /* KeyboardMachine.cpp */; }; - 4B54C0BF1F8D8F450050900F /* KeyboardMapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B54C0BD1F8D8F450050900F /* KeyboardMapper.cpp */; }; - 4B54C0C21F8D91CD0050900F /* KeyboardMapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B54C0C11F8D91CD0050900F /* KeyboardMapper.cpp */; }; + 4B54C0BF1F8D8F450050900F /* Keyboard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B54C0BD1F8D8F450050900F /* Keyboard.cpp */; }; + 4B54C0C21F8D91CD0050900F /* Keyboard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B54C0C11F8D91CD0050900F /* Keyboard.cpp */; }; 4B54C0C51F8D91D90050900F /* Keyboard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B54C0C41F8D91D90050900F /* Keyboard.cpp */; }; - 4B54C0C81F8D91E50050900F /* KeyboardMapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B54C0C61F8D91E50050900F /* KeyboardMapper.cpp */; }; - 4B54C0CB1F8D92590050900F /* KeyboardMapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B54C0CA1F8D92580050900F /* KeyboardMapper.cpp */; }; + 4B54C0C81F8D91E50050900F /* Keyboard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B54C0C61F8D91E50050900F /* Keyboard.cpp */; }; + 4B54C0CB1F8D92590050900F /* Keyboard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B54C0CA1F8D92580050900F /* Keyboard.cpp */; }; 4B55CE5D1C3B7D6F0093A61B /* CSOpenGLView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B55CE5C1C3B7D6F0093A61B /* CSOpenGLView.m */; }; 4B55CE5F1C3B7D960093A61B /* MachineDocument.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B55CE5E1C3B7D960093A61B /* MachineDocument.swift */; }; 4B58601E1F806AB200AEE2E3 /* MFMSectorDump.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B58601C1F806AB200AEE2E3 /* MFMSectorDump.cpp */; }; @@ -117,9 +117,6 @@ 4B83348A1F5DB94B0097E338 /* IRQDelegatePortHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B8334891F5DB94B0097E338 /* IRQDelegatePortHandler.cpp */; }; 4B83348C1F5DB99C0097E338 /* 6522Base.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B83348B1F5DB99C0097E338 /* 6522Base.cpp */; }; 4B8334951F5E25B60097E338 /* C1540.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B8334941F5E25B60097E338 /* C1540.cpp */; }; - 4B8378DC1F336631005CA9E4 /* CharacterMapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B8378DA1F336631005CA9E4 /* CharacterMapper.cpp */; }; - 4B8378DF1F33675F005CA9E4 /* CharacterMapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B8378DD1F33675F005CA9E4 /* CharacterMapper.cpp */; }; - 4B8378E21F336920005CA9E4 /* CharacterMapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B8378E01F336920005CA9E4 /* CharacterMapper.cpp */; }; 4B86E25B1F8C628F006FAA45 /* Keyboard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B86E2591F8C628F006FAA45 /* Keyboard.cpp */; }; 4B8805F01DCFC99C003085B1 /* Acorn.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B8805EE1DCFC99C003085B1 /* Acorn.cpp */; }; 4B8805F41DCFD22A003085B1 /* Commodore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B8805F21DCFD22A003085B1 /* Commodore.cpp */; }; @@ -144,7 +141,6 @@ 4BA22B071D8817CE0008C640 /* Disk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BA22B051D8817CE0008C640 /* Disk.cpp */; }; 4BA61EB01D91515900B3C876 /* NSData+StdVector.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4BA61EAF1D91515900B3C876 /* NSData+StdVector.mm */; }; 4BA799951D8B656E0045123D /* StaticAnalyser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BA799931D8B656E0045123D /* StaticAnalyser.cpp */; }; - 4BACC5B11F3DFF7C0037C015 /* CharacterMapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BACC5AF1F3DFF7C0037C015 /* CharacterMapper.cpp */; }; 4BB17D4E1ED7909F00ABD1E1 /* tests.expected.json in Resources */ = {isa = PBXBuildFile; fileRef = 4BB17D4C1ED7909F00ABD1E1 /* tests.expected.json */; }; 4BB17D4F1ED7909F00ABD1E1 /* tests.in.json in Resources */ = {isa = PBXBuildFile; fileRef = 4BB17D4D1ED7909F00ABD1E1 /* tests.in.json */; }; 4BB298F11B587D8400A49093 /* start in Resources */ = {isa = PBXBuildFile; fileRef = 4BB297E51B587D8300A49093 /* start */; }; @@ -634,16 +630,16 @@ 4B5073061DDD3B9400C48FBD /* ArrayBuilder.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ArrayBuilder.hpp; sourceTree = ""; }; 4B5073091DDFCFDF00C48FBD /* ArrayBuilderTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ArrayBuilderTests.mm; sourceTree = ""; }; 4B54C0BB1F8D8E790050900F /* KeyboardMachine.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = KeyboardMachine.cpp; sourceTree = ""; }; - 4B54C0BD1F8D8F450050900F /* KeyboardMapper.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = KeyboardMapper.cpp; path = Oric/KeyboardMapper.cpp; sourceTree = ""; }; - 4B54C0BE1F8D8F450050900F /* KeyboardMapper.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; name = KeyboardMapper.hpp; path = Oric/KeyboardMapper.hpp; sourceTree = ""; }; - 4B54C0C01F8D91CD0050900F /* KeyboardMapper.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = KeyboardMapper.hpp; path = AmstradCPC/KeyboardMapper.hpp; sourceTree = ""; }; - 4B54C0C11F8D91CD0050900F /* KeyboardMapper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = KeyboardMapper.cpp; path = AmstradCPC/KeyboardMapper.cpp; sourceTree = ""; }; + 4B54C0BD1F8D8F450050900F /* Keyboard.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = Keyboard.cpp; path = Oric/Keyboard.cpp; sourceTree = ""; }; + 4B54C0BE1F8D8F450050900F /* Keyboard.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; name = Keyboard.hpp; path = Oric/Keyboard.hpp; sourceTree = ""; }; + 4B54C0C01F8D91CD0050900F /* Keyboard.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = Keyboard.hpp; path = AmstradCPC/Keyboard.hpp; sourceTree = ""; }; + 4B54C0C11F8D91CD0050900F /* Keyboard.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Keyboard.cpp; path = AmstradCPC/Keyboard.cpp; sourceTree = ""; }; 4B54C0C31F8D91D90050900F /* Keyboard.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Keyboard.hpp; sourceTree = ""; }; 4B54C0C41F8D91D90050900F /* Keyboard.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Keyboard.cpp; sourceTree = ""; }; - 4B54C0C61F8D91E50050900F /* KeyboardMapper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = KeyboardMapper.cpp; path = Electron/KeyboardMapper.cpp; sourceTree = ""; }; - 4B54C0C71F8D91E50050900F /* KeyboardMapper.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = KeyboardMapper.hpp; path = Electron/KeyboardMapper.hpp; sourceTree = ""; }; - 4B54C0C91F8D92580050900F /* KeyboardMapper.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = KeyboardMapper.hpp; path = ZX8081/KeyboardMapper.hpp; sourceTree = ""; }; - 4B54C0CA1F8D92580050900F /* KeyboardMapper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = KeyboardMapper.cpp; path = ZX8081/KeyboardMapper.cpp; sourceTree = ""; }; + 4B54C0C61F8D91E50050900F /* Keyboard.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Keyboard.cpp; path = Electron/Keyboard.cpp; sourceTree = ""; }; + 4B54C0C71F8D91E50050900F /* Keyboard.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = Keyboard.hpp; path = Electron/Keyboard.hpp; sourceTree = ""; }; + 4B54C0C91F8D92580050900F /* Keyboard.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = Keyboard.hpp; path = ZX8081/Keyboard.hpp; sourceTree = ""; }; + 4B54C0CA1F8D92580050900F /* Keyboard.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Keyboard.cpp; path = ZX8081/Keyboard.cpp; sourceTree = ""; }; 4B55CE5B1C3B7D6F0093A61B /* CSOpenGLView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSOpenGLView.h; sourceTree = ""; }; 4B55CE5C1C3B7D6F0093A61B /* CSOpenGLView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CSOpenGLView.m; sourceTree = ""; }; 4B55CE5E1C3B7D960093A61B /* MachineDocument.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MachineDocument.swift; sourceTree = ""; }; @@ -699,12 +695,6 @@ 4B83348E1F5DBA6E0097E338 /* 6522Storage.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = 6522Storage.hpp; path = Implementation/6522Storage.hpp; sourceTree = ""; }; 4B8334911F5E24FF0097E338 /* C1540Base.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = C1540Base.hpp; path = Implementation/C1540Base.hpp; sourceTree = ""; }; 4B8334941F5E25B60097E338 /* C1540.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = C1540.cpp; path = Implementation/C1540.cpp; sourceTree = ""; }; - 4B8378DA1F336631005CA9E4 /* CharacterMapper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CharacterMapper.cpp; path = Electron/CharacterMapper.cpp; sourceTree = ""; }; - 4B8378DB1F336631005CA9E4 /* CharacterMapper.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = CharacterMapper.hpp; path = Electron/CharacterMapper.hpp; sourceTree = ""; }; - 4B8378DD1F33675F005CA9E4 /* CharacterMapper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CharacterMapper.cpp; path = ZX8081/CharacterMapper.cpp; sourceTree = ""; }; - 4B8378DE1F33675F005CA9E4 /* CharacterMapper.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = CharacterMapper.hpp; path = ZX8081/CharacterMapper.hpp; sourceTree = ""; }; - 4B8378E01F336920005CA9E4 /* CharacterMapper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CharacterMapper.cpp; path = Oric/CharacterMapper.cpp; sourceTree = ""; }; - 4B8378E11F336920005CA9E4 /* CharacterMapper.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = CharacterMapper.hpp; path = Oric/CharacterMapper.hpp; sourceTree = ""; }; 4B86E2591F8C628F006FAA45 /* Keyboard.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Keyboard.cpp; sourceTree = ""; }; 4B86E25A1F8C628F006FAA45 /* Keyboard.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Keyboard.hpp; sourceTree = ""; }; 4B8805EE1DCFC99C003085B1 /* Acorn.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Acorn.cpp; path = Parsers/Acorn.cpp; sourceTree = ""; }; @@ -746,8 +736,6 @@ 4BA9C3CF1D8164A9002DDB61 /* ConfigurationTarget.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = ConfigurationTarget.hpp; sourceTree = ""; }; 4BAB62AC1D3272D200DF5BA0 /* Disk.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Disk.hpp; sourceTree = ""; }; 4BAB62AE1D32730D00DF5BA0 /* Storage.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Storage.hpp; sourceTree = ""; }; - 4BACC5AF1F3DFF7C0037C015 /* CharacterMapper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CharacterMapper.cpp; path = AmstradCPC/CharacterMapper.cpp; sourceTree = ""; }; - 4BACC5B01F3DFF7C0037C015 /* CharacterMapper.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = CharacterMapper.hpp; path = AmstradCPC/CharacterMapper.hpp; sourceTree = ""; }; 4BB06B211F316A3F00600C7A /* ForceInline.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = ForceInline.hpp; sourceTree = ""; }; 4BB146C61F49D7D700253439 /* Sleeper.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Sleeper.hpp; sourceTree = ""; }; 4BB17D4C1ED7909F00ABD1E1 /* tests.expected.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = tests.expected.json; path = FUSE/tests.expected.json; sourceTree = ""; }; @@ -1220,12 +1208,10 @@ 4B1497931EE4B5AC00CE2596 /* ZX8081 */ = { isa = PBXGroup; children = ( - 4B8378DD1F33675F005CA9E4 /* CharacterMapper.cpp */, - 4B54C0CA1F8D92580050900F /* KeyboardMapper.cpp */, + 4B54C0CA1F8D92580050900F /* Keyboard.cpp */, 4BD3A3091EE755C800B5B501 /* Video.cpp */, 4B1497901EE4B5A800CE2596 /* ZX8081.cpp */, - 4B8378DE1F33675F005CA9E4 /* CharacterMapper.hpp */, - 4B54C0C91F8D92580050900F /* KeyboardMapper.hpp */, + 4B54C0C91F8D92580050900F /* Keyboard.hpp */, 4BD3A30A1EE755C800B5B501 /* Video.hpp */, 4B1497911EE4B5A800CE2596 /* ZX8081.hpp */, ); @@ -1342,17 +1328,15 @@ 4B2E2D9E1C3A070900138695 /* Electron */ = { isa = PBXGroup; children = ( - 4B8378DA1F336631005CA9E4 /* CharacterMapper.cpp */, 4B2E2D9B1C3A070400138695 /* Electron.cpp */, - 4B54C0C61F8D91E50050900F /* KeyboardMapper.cpp */, + 4B54C0C61F8D91E50050900F /* Keyboard.cpp */, 4B30512E1D98ACC600B4FED8 /* Plus3.cpp */, 4BEA52611DF339D7007E74F2 /* Speaker.cpp */, 4BEA525D1DF33323007E74F2 /* Tape.cpp */, 4B7913CA1DFCD80E00175A82 /* Video.cpp */, - 4B8378DB1F336631005CA9E4 /* CharacterMapper.hpp */, 4B2E2D9C1C3A070400138695 /* Electron.hpp */, 4BEA52601DF3343A007E74F2 /* Interrupts.hpp */, - 4B54C0C71F8D91E50050900F /* KeyboardMapper.hpp */, + 4B54C0C71F8D91E50050900F /* Keyboard.hpp */, 4B30512F1D98ACC600B4FED8 /* Plus3.hpp */, 4BEA52621DF339D7007E74F2 /* Speaker.hpp */, 4BEA525F1DF333D8007E74F2 /* Tape.hpp */, @@ -1406,11 +1390,9 @@ isa = PBXGroup; children = ( 4B38F3461F2EC11D00D9235D /* AmstradCPC.cpp */, - 4BACC5AF1F3DFF7C0037C015 /* CharacterMapper.cpp */, - 4B54C0C11F8D91CD0050900F /* KeyboardMapper.cpp */, + 4B54C0C11F8D91CD0050900F /* Keyboard.cpp */, 4B38F3471F2EC11D00D9235D /* AmstradCPC.hpp */, - 4BACC5B01F3DFF7C0037C015 /* CharacterMapper.hpp */, - 4B54C0C01F8D91CD0050900F /* KeyboardMapper.hpp */, + 4B54C0C01F8D91CD0050900F /* Keyboard.hpp */, ); name = AmstradCPC; sourceTree = ""; @@ -2344,13 +2326,11 @@ 4BCF1FA51DADC3E10039D2E7 /* Oric */ = { isa = PBXGroup; children = ( - 4B8378E01F336920005CA9E4 /* CharacterMapper.cpp */, - 4B54C0BD1F8D8F450050900F /* KeyboardMapper.cpp */, + 4B54C0BD1F8D8F450050900F /* Keyboard.cpp */, 4B5FADBE1DE3BF2B00AEC565 /* Microdisc.cpp */, 4BCF1FA21DADC3DD0039D2E7 /* Oric.cpp */, 4B2BFDB01DAEF5FF001A68B8 /* Video.cpp */, - 4B8378E11F336920005CA9E4 /* CharacterMapper.hpp */, - 4B54C0BE1F8D8F450050900F /* KeyboardMapper.hpp */, + 4B54C0BE1F8D8F450050900F /* Keyboard.hpp */, 4B5FADBF1DE3BF2B00AEC565 /* Microdisc.hpp */, 4BCF1FA31DADC3DD0039D2E7 /* Oric.hpp */, 4B2BFDB11DAEF5FF001A68B8 /* Video.hpp */, @@ -2949,21 +2929,19 @@ 4B4518A01F75FD1C00926311 /* CPCDSK.cpp in Sources */, 4B95FA9D1F11893B0008E395 /* ZX8081OptionsPanel.swift in Sources */, 4B0CCC451C62D0B3001CAC5F /* CRT.cpp in Sources */, - 4B8378DC1F336631005CA9E4 /* CharacterMapper.cpp in Sources */, 4B322E041F5A2E3C004EB04C /* Z80Base.cpp in Sources */, 4B4518A31F75FD1C00926311 /* HFE.cpp in Sources */, - 4B8378E21F336920005CA9E4 /* CharacterMapper.cpp in Sources */, 4B4518A11F75FD1C00926311 /* D64.cpp in Sources */, 4B1558C01F844ECD006E9A97 /* BitReverse.cpp in Sources */, 4BCF1FA41DADC3DD0039D2E7 /* Oric.cpp in Sources */, - 4B54C0CB1F8D92590050900F /* KeyboardMapper.cpp in Sources */, + 4B54C0CB1F8D92590050900F /* Keyboard.cpp in Sources */, 4BEA525E1DF33323007E74F2 /* Tape.cpp in Sources */, 4B8334951F5E25B60097E338 /* C1540.cpp in Sources */, 4B1497921EE4B5A800CE2596 /* ZX8081.cpp in Sources */, 4B643F3F1D77B88000D431D6 /* DocumentController.swift in Sources */, 4B4518861F75E91A00926311 /* MFMDiskController.cpp in Sources */, 4BA799951D8B656E0045123D /* StaticAnalyser.cpp in Sources */, - 4B54C0BF1F8D8F450050900F /* KeyboardMapper.cpp in Sources */, + 4B54C0BF1F8D8F450050900F /* Keyboard.cpp in Sources */, 4B3FE75E1F3CF68B00448EE4 /* CPM.cpp in Sources */, 4B2BFDB21DAEF5FF001A68B8 /* Video.cpp in Sources */, 4B4DC82B1D2C27A4003C5BF8 /* SerialBus.cpp in Sources */, @@ -2977,7 +2955,6 @@ 4B96F7221D75119A0058BB2D /* Tape.cpp in Sources */, 4B4518811F75E91A00926311 /* PCMPatchedTrack.cpp in Sources */, 4B8805F71DCFF6C9003085B1 /* Commodore.cpp in Sources */, - 4BACC5B11F3DFF7C0037C015 /* CharacterMapper.cpp in Sources */, 4BBF99181C8FBA6F0075DAFB /* TextureTarget.cpp in Sources */, 4BC76E691C98E31700E6EF73 /* FIRFilter.cpp in Sources */, 4B3BF5B01F146265005B6C36 /* CSW.cpp in Sources */, @@ -3022,12 +2999,11 @@ 4B2E2D9D1C3A070400138695 /* Electron.cpp in Sources */, 4B3940E71DA83C8300427841 /* AsyncTaskQueue.cpp in Sources */, 4B69FB3D1C4D908A00B5F0AA /* Tape.cpp in Sources */, - 4B8378DF1F33675F005CA9E4 /* CharacterMapper.cpp in Sources */, 4B4518841F75E91A00926311 /* UnformattedTrack.cpp in Sources */, 4B8FE2291DA1EDDF0090D3CE /* ElectronOptionsPanel.swift in Sources */, 4B55CE5D1C3B7D6F0093A61B /* CSOpenGLView.m in Sources */, 4BB697CB1D4B6D3E00248BDF /* TimedEventLoop.cpp in Sources */, - 4B54C0C21F8D91CD0050900F /* KeyboardMapper.cpp in Sources */, + 4B54C0C21F8D91CD0050900F /* Keyboard.cpp in Sources */, 4BBC951E1F368D83008F4C34 /* i8272.cpp in Sources */, 4BF1354C1D6D2C300054B2EA /* StaticAnalyser.cpp in Sources */, 4B4A76301DB1A3FA007AAE2E /* AY38910.cpp in Sources */, @@ -3058,7 +3034,7 @@ 4BEE0A6F1D72496600532C7B /* Cartridge.cpp in Sources */, 4B8805FB1DCFF807003085B1 /* Oric.cpp in Sources */, 4B5FADC01DE3BF2B00AEC565 /* Microdisc.cpp in Sources */, - 4B54C0C81F8D91E50050900F /* KeyboardMapper.cpp in Sources */, + 4B54C0C81F8D91E50050900F /* Keyboard.cpp in Sources */, 4BEE0A701D72496600532C7B /* PRG.cpp in Sources */, 4B8334861F5DA3780097E338 /* 6502Storage.cpp in Sources */, 4B8FE2271DA1DE2D0090D3CE /* NSBundle+DataResource.m in Sources */,