From 6f0ad0ab7188b82648ff3ada166d1809bb1a605b Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 4 Mar 2024 12:06:43 -0500 Subject: [PATCH] Add an empty Archimedes shell. --- Machines/Acorn/Archimedes/Archimedes.cpp | 55 +++++++++++++++++++ Machines/Acorn/Archimedes/Archimedes.hpp | 27 +++++++++ Machines/PCCompatible/PCCompatible.cpp | 1 - Machines/Utility/MachineForTarget.cpp | 5 +- .../Clock Signal.xcodeproj/project.pbxproj | 28 ++++++---- OSBindings/Qt/clksignal.pro | 1 + OSBindings/SDL/SConstruct | 1 + cmake/CLK_SOURCES.cmake | 1 + 8 files changed, 106 insertions(+), 13 deletions(-) create mode 100644 Machines/Acorn/Archimedes/Archimedes.cpp create mode 100644 Machines/Acorn/Archimedes/Archimedes.hpp diff --git a/Machines/Acorn/Archimedes/Archimedes.cpp b/Machines/Acorn/Archimedes/Archimedes.cpp new file mode 100644 index 000000000..30fad48e3 --- /dev/null +++ b/Machines/Acorn/Archimedes/Archimedes.cpp @@ -0,0 +1,55 @@ +// +// Archimedes.cpp +// Clock Signal +// +// Created by Thomas Harte on 04/03/2024. +// Copyright © 2024 Thomas Harte. All rights reserved. +// + +#include "Archimedes.hpp" + +#include "../../AudioProducer.hpp" +#include "../../KeyboardMachine.hpp" +#include "../../MediaTarget.hpp" +#include "../../ScanProducer.hpp" +#include "../../TimedMachine.hpp" + +namespace Archimedes { + +class ConcreteMachine: + public Machine, + public MachineTypes::TimedMachine, + public MachineTypes::ScanProducer +{ + public: + ConcreteMachine( + const Analyser::Static::Target &target, + const ROMMachine::ROMFetcher &rom_fetcher + ) { + (void)target; + (void)rom_fetcher; + } + + private: + + // MARK: - ScanProducer. + void set_scan_target(Outputs::Display::ScanTarget *scan_target) override { + (void)scan_target; + } + Outputs::Display::ScanStatus get_scaled_scan_status() const override { + return Outputs::Display::ScanStatus(); + } + + // MARK: - TimedMachine. + void run_for(Cycles cycles) override { + (void)cycles; + } +}; + +} + +using namespace Archimedes; + +std::unique_ptr Machine::Archimedes(const Analyser::Static::Target *target, const ROMMachine::ROMFetcher &rom_fetcher) { + return std::make_unique(*target, rom_fetcher); +} diff --git a/Machines/Acorn/Archimedes/Archimedes.hpp b/Machines/Acorn/Archimedes/Archimedes.hpp new file mode 100644 index 000000000..c967ad2eb --- /dev/null +++ b/Machines/Acorn/Archimedes/Archimedes.hpp @@ -0,0 +1,27 @@ +// +// Archimedes.hpp +// Clock Signal +// +// Created by Thomas Harte on 04/03/2024. +// Copyright © 2024 Thomas Harte. All rights reserved. +// + +#pragma once + +#include "../../../Analyser/Static/StaticAnalyser.hpp" +#include "../../ROMMachine.hpp" + +#include + +namespace Archimedes { + +class Machine { + public: + virtual ~Machine() = default; + static std::unique_ptr Archimedes( + const Analyser::Static::Target *target, + const ROMMachine::ROMFetcher &rom_fetcher + ); +}; + +} diff --git a/Machines/PCCompatible/PCCompatible.cpp b/Machines/PCCompatible/PCCompatible.cpp index 09f0475af..c0f17eb3f 100644 --- a/Machines/PCCompatible/PCCompatible.cpp +++ b/Machines/PCCompatible/PCCompatible.cpp @@ -1198,7 +1198,6 @@ class ConcreteMachine: using namespace PCCompatible; -// See header; constructs and returns an instance of the Amstrad CPC. std::unique_ptr Machine::PCCompatible(const Analyser::Static::Target *target, const ROMMachine::ROMFetcher &rom_fetcher) { const Target *const pc_target = dynamic_cast(target); diff --git a/Machines/Utility/MachineForTarget.cpp b/Machines/Utility/MachineForTarget.cpp index 55c3c347f..98851fd15 100644 --- a/Machines/Utility/MachineForTarget.cpp +++ b/Machines/Utility/MachineForTarget.cpp @@ -11,9 +11,10 @@ #include // Sources for runtime options and machines. +#include "../Acorn/Archimedes/Archimedes.hpp" +#include "../Acorn/Electron/Electron.hpp" #include "../Amiga/Amiga.hpp" #include "../AmstradCPC/AmstradCPC.hpp" -#include "../Acorn/Electron/Electron.hpp" #include "../Apple/AppleII/AppleII.hpp" #include "../Apple/AppleIIgs/AppleIIgs.hpp" #include "../Apple/Macintosh/Macintosh.hpp" @@ -55,12 +56,12 @@ std::unique_ptr Machine::MachineForTarget(const Analyse std::unique_ptr machine; try { - // TODO: add Archimedes below. #define BindD(name, m) case Analyser::Machine::m: machine = std::make_unique>(name::Machine::m(target, rom_fetcher)); break; #define Bind(m) BindD(m, m) switch(target->machine) { Bind(Amiga) Bind(AmstradCPC) + Bind(Archimedes) BindD(Apple::II, AppleII) BindD(Apple::IIgs, AppleIIgs) BindD(Apple::Macintosh, Macintosh) diff --git a/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj b/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj index dc09a4580..813c0e878 100644 --- a/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj +++ b/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj @@ -966,6 +966,8 @@ 4BB505812B962DDF0031C43C /* Plus3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BB505752B962DDF0031C43C /* Plus3.cpp */; }; 4BB505822B962DDF0031C43C /* Keyboard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BB505762B962DDF0031C43C /* Keyboard.cpp */; }; 4BB505832B962DDF0031C43C /* Keyboard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BB505762B962DDF0031C43C /* Keyboard.cpp */; }; + 4BB505862B9634F30031C43C /* Archimedes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BB505842B9634F30031C43C /* Archimedes.cpp */; }; + 4BB505872B9634F30031C43C /* Archimedes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BB505842B9634F30031C43C /* Archimedes.cpp */; }; 4BB697CB1D4B6D3E00248BDF /* TimedEventLoop.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BB697C91D4B6D3E00248BDF /* TimedEventLoop.cpp */; }; 4BB697CE1D4BA44400248BDF /* CommodoreGCR.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BB697CC1D4BA44400248BDF /* CommodoreGCR.cpp */; }; 4BB73EA21B587A5100552FC2 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BB73EA11B587A5100552FC2 /* AppDelegate.swift */; }; @@ -2102,6 +2104,8 @@ 4BB505752B962DDF0031C43C /* Plus3.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Plus3.cpp; sourceTree = ""; }; 4BB505762B962DDF0031C43C /* Keyboard.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Keyboard.cpp; sourceTree = ""; }; 4BB505772B962DDF0031C43C /* Electron.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Electron.hpp; sourceTree = ""; }; + 4BB505842B9634F30031C43C /* Archimedes.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Archimedes.cpp; sourceTree = ""; }; + 4BB505852B9634F30031C43C /* Archimedes.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Archimedes.hpp; sourceTree = ""; }; 4BB5B995281B1D3E00522DA9 /* RegisterSizes.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = RegisterSizes.hpp; sourceTree = ""; }; 4BB5B996281B1E3F00522DA9 /* Perform.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Perform.hpp; sourceTree = ""; }; 4BB5B997281B1F7B00522DA9 /* Status.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Status.hpp; sourceTree = ""; }; @@ -4370,6 +4374,8 @@ 4BB505692B962DDF0031C43C /* Archimedes */ = { isa = PBXGroup; children = ( + 4BB505842B9634F30031C43C /* Archimedes.cpp */, + 4BB505852B9634F30031C43C /* Archimedes.hpp */, ); path = Archimedes; sourceTree = ""; @@ -4377,19 +4383,19 @@ 4BB5056A2B962DDF0031C43C /* Electron */ = { isa = PBXGroup; children = ( - 4BB5056B2B962DDF0031C43C /* SoundGenerator.cpp */, - 4BB5056C2B962DDF0031C43C /* Plus3.hpp */, - 4BB5056D2B962DDF0031C43C /* Keyboard.hpp */, 4BB5056E2B962DDF0031C43C /* Electron.cpp */, - 4BB5056F2B962DDF0031C43C /* Video.cpp */, - 4BB505702B962DDF0031C43C /* Tape.hpp */, - 4BB505712B962DDF0031C43C /* Interrupts.hpp */, - 4BB505722B962DDF0031C43C /* Video.hpp */, - 4BB505732B962DDF0031C43C /* Tape.cpp */, - 4BB505742B962DDF0031C43C /* SoundGenerator.hpp */, - 4BB505752B962DDF0031C43C /* Plus3.cpp */, 4BB505762B962DDF0031C43C /* Keyboard.cpp */, + 4BB505752B962DDF0031C43C /* Plus3.cpp */, + 4BB5056B2B962DDF0031C43C /* SoundGenerator.cpp */, + 4BB505732B962DDF0031C43C /* Tape.cpp */, + 4BB5056F2B962DDF0031C43C /* Video.cpp */, 4BB505772B962DDF0031C43C /* Electron.hpp */, + 4BB505712B962DDF0031C43C /* Interrupts.hpp */, + 4BB5056D2B962DDF0031C43C /* Keyboard.hpp */, + 4BB5056C2B962DDF0031C43C /* Plus3.hpp */, + 4BB505742B962DDF0031C43C /* SoundGenerator.hpp */, + 4BB505702B962DDF0031C43C /* Tape.hpp */, + 4BB505722B962DDF0031C43C /* Video.hpp */, ); path = Electron; sourceTree = ""; @@ -5953,6 +5959,7 @@ 4BEDA40E25B2844B000C2DBD /* Decoder.cpp in Sources */, 4B1B88BD202E3D3D00B67DFF /* MultiMachine.cpp in Sources */, 4B055A971FAE85BB0060FFFF /* ZX8081.cpp in Sources */, + 4BB505872B9634F30031C43C /* Archimedes.cpp in Sources */, 4B055AAD1FAE85FD0060FFFF /* PCMTrack.cpp in Sources */, 4B2130E3273A7A0A008A77B4 /* Audio.cpp in Sources */, 4BD67DD1209BF27B00AB2146 /* Encoder.cpp in Sources */, @@ -6143,6 +6150,7 @@ 4B4518831F75E91A00926311 /* PCMTrack.cpp in Sources */, 4B8DF4F9254E36AE00F3433C /* Video.cpp in Sources */, 4B0ACC3223775819008902D0 /* Atari2600.cpp in Sources */, + 4BB505862B9634F30031C43C /* Archimedes.cpp in Sources */, 4B7C681E2751A104001671EC /* Bitplanes.cpp in Sources */, 4B45189F1F75FD1C00926311 /* AcornADF.cpp in Sources */, 4B7BA03023C2B19C00B98D9E /* Jasmin.cpp in Sources */, diff --git a/OSBindings/Qt/clksignal.pro b/OSBindings/Qt/clksignal.pro index e88990d12..f41076a23 100644 --- a/OSBindings/Qt/clksignal.pro +++ b/OSBindings/Qt/clksignal.pro @@ -85,6 +85,7 @@ SOURCES += \ $$SRC/InstructionSets/x86/*.cpp \ \ $$SRC/Machines/*.cpp \ + $$SRC/Machines/Acorn/Archimedes/*.cpp \ $$SRC/Machines/Acorn/Electron/*.cpp \ $$SRC/Machines/Amiga/*.cpp \ $$SRC/Machines/AmstradCPC/*.cpp \ diff --git a/OSBindings/SDL/SConstruct b/OSBindings/SDL/SConstruct index 73d5efc7e..fdc859455 100644 --- a/OSBindings/SDL/SConstruct +++ b/OSBindings/SDL/SConstruct @@ -72,6 +72,7 @@ SOURCES += glob.glob('../../InstructionSets/PowerPC/*.cpp') SOURCES += glob.glob('../../InstructionSets/x86/*.cpp') SOURCES += glob.glob('../../Machines/*.cpp') +SOURCES += glob.glob('../../Machines/Acorn/Archimedes/*.cpp') SOURCES += glob.glob('../../Machines/Acorn/Electron/*.cpp') SOURCES += glob.glob('../../Machines/Amiga/*.cpp') SOURCES += glob.glob('../../Machines/AmstradCPC/*.cpp') diff --git a/cmake/CLK_SOURCES.cmake b/cmake/CLK_SOURCES.cmake index b96c05dca..122b8396a 100644 --- a/cmake/CLK_SOURCES.cmake +++ b/cmake/CLK_SOURCES.cmake @@ -71,6 +71,7 @@ set(CLK_SOURCES InstructionSets/x86/Decoder.cpp InstructionSets/x86/Instruction.cpp + Machines/Acorn/Archimedes/Archimedes.cpp Machines/Acorn/Electron/Electron.cpp Machines/Acorn/Electron/Keyboard.cpp Machines/Acorn/Electron/Plus3.cpp