From 0d01346ad4381b767691027623024e165d6525f6 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Thu, 20 Sep 2018 22:04:28 -0400 Subject: [PATCH] Advertises SMS support and goes as far as realising it needs to spawn a Master System. --- Analyser/Machines.hpp | 1 + Analyser/Static/Coleco/StaticAnalyser.hpp | 1 - Analyser/Static/Sega/StaticAnalyser.cpp | 19 +++++++++++ Analyser/Static/Sega/StaticAnalyser.hpp | 26 ++++++++++++++ Analyser/Static/StaticAnalyser.cpp | 3 ++ Machines/MasterSystem/MasterSystem.cpp | 9 +++++ Machines/MasterSystem/MasterSystem.hpp | 14 ++++++++ .../Clock Signal.xcodeproj/project.pbxproj | 34 ++++++++++++++++++- OSBindings/Mac/Clock Signal/Info.plist | 22 ++++++++++++ Storage/TargetPlatforms.hpp | 9 ++--- 10 files changed, 132 insertions(+), 6 deletions(-) create mode 100644 Analyser/Static/Sega/StaticAnalyser.cpp create mode 100644 Analyser/Static/Sega/StaticAnalyser.hpp create mode 100644 Machines/MasterSystem/MasterSystem.cpp create mode 100644 Machines/MasterSystem/MasterSystem.hpp diff --git a/Analyser/Machines.hpp b/Analyser/Machines.hpp index 679e8cb5d..fde24ec46 100644 --- a/Analyser/Machines.hpp +++ b/Analyser/Machines.hpp @@ -17,6 +17,7 @@ enum class Machine { Atari2600, ColecoVision, Electron, + MasterSystem, MSX, Oric, Vic20, diff --git a/Analyser/Static/Coleco/StaticAnalyser.hpp b/Analyser/Static/Coleco/StaticAnalyser.hpp index 77de5abf0..0101c8c71 100644 --- a/Analyser/Static/Coleco/StaticAnalyser.hpp +++ b/Analyser/Static/Coleco/StaticAnalyser.hpp @@ -23,5 +23,4 @@ TargetList GetTargets(const Media &media, const std::string &file_name, TargetPl } } - #endif /* StaticAnalyser_hpp */ diff --git a/Analyser/Static/Sega/StaticAnalyser.cpp b/Analyser/Static/Sega/StaticAnalyser.cpp new file mode 100644 index 000000000..0f8adbf68 --- /dev/null +++ b/Analyser/Static/Sega/StaticAnalyser.cpp @@ -0,0 +1,19 @@ +// +// StaticAnalyser.cpp +// Clock Signal +// +// Created by Thomas Harte on 20/09/2018. +// Copyright © 2018 Thomas Harte. All rights reserved. +// + +#include "StaticAnalyser.hpp" + +Analyser::Static::TargetList Analyser::Static::Sega::GetTargets(const Media &media, const std::string &file_name, TargetPlatform::IntType potential_platforms) { + TargetList targets; + std::unique_ptr target(new Target); + target->machine = Machine::MasterSystem; + target->media.cartridges = media.cartridges; + if(!target->media.empty()) + targets.push_back(std::move(target)); + return targets; +} diff --git a/Analyser/Static/Sega/StaticAnalyser.hpp b/Analyser/Static/Sega/StaticAnalyser.hpp new file mode 100644 index 000000000..127e2cd8d --- /dev/null +++ b/Analyser/Static/Sega/StaticAnalyser.hpp @@ -0,0 +1,26 @@ +// +// StaticAnalyser.hpp +// Clock Signal +// +// Created by Thomas Harte on 20/09/2018. +// Copyright © 2018 Thomas Harte. All rights reserved. +// + +#ifndef StaticAnalyser_Sega_StaticAnalyser_hpp +#define StaticAnalyser_Sega_StaticAnalyser_hpp + +#include "../StaticAnalyser.hpp" +#include "../../../Storage/TargetPlatforms.hpp" +#include + +namespace Analyser { +namespace Static { +namespace Sega { + +TargetList GetTargets(const Media &media, const std::string &file_name, TargetPlatform::IntType potential_platforms); + +} +} +} + +#endif /* StaticAnalyser_hpp */ diff --git a/Analyser/Static/StaticAnalyser.cpp b/Analyser/Static/StaticAnalyser.cpp index 5351ccecb..3a87db958 100644 --- a/Analyser/Static/StaticAnalyser.cpp +++ b/Analyser/Static/StaticAnalyser.cpp @@ -23,6 +23,7 @@ #include "DiskII/StaticAnalyser.hpp" #include "MSX/StaticAnalyser.hpp" #include "Oric/StaticAnalyser.hpp" +#include "Sega/StaticAnalyser.hpp" #include "ZX8081/StaticAnalyser.hpp" // Cartridges @@ -129,6 +130,7 @@ static Media GetMediaAndPlatforms(const std::string &file_name, TargetPlatform:: result.cartridges, Cartridge::BinaryDump, TargetPlatform::AcornElectron | TargetPlatform::ColecoVision | TargetPlatform::MSX) // ROM + Format("sms", result.cartridges, Cartridge::BinaryDump, TargetPlatform::Sega) // SMS Format("ssd", result.disks, Disk::DiskImageHolder, TargetPlatform::Acorn) // SSD Format("tap", result.tapes, Tape::CommodoreTAP, TargetPlatform::Commodore) // TAP (Commodore) Format("tap", result.tapes, Tape::OricTAP, TargetPlatform::Oric) // TAP (Oric) @@ -170,6 +172,7 @@ TargetList Analyser::Static::GetTargets(const std::string &file_name) { if(potential_platforms & TargetPlatform::ColecoVision) Append(Coleco); if(potential_platforms & TargetPlatform::Commodore) Append(Commodore); if(potential_platforms & TargetPlatform::DiskII) Append(DiskII); + if(potential_platforms & TargetPlatform::Sega) Append(Sega); if(potential_platforms & TargetPlatform::MSX) Append(MSX); if(potential_platforms & TargetPlatform::Oric) Append(Oric); if(potential_platforms & TargetPlatform::ZX8081) Append(ZX8081); diff --git a/Machines/MasterSystem/MasterSystem.cpp b/Machines/MasterSystem/MasterSystem.cpp new file mode 100644 index 000000000..d9b93a5c3 --- /dev/null +++ b/Machines/MasterSystem/MasterSystem.cpp @@ -0,0 +1,9 @@ +// +// MasterSystem.cpp +// Clock Signal +// +// Created by Thomas Harte on 20/09/2018. +// Copyright © 2018 Thomas Harte. All rights reserved. +// + +#include "MasterSystem.hpp" diff --git a/Machines/MasterSystem/MasterSystem.hpp b/Machines/MasterSystem/MasterSystem.hpp new file mode 100644 index 000000000..80eecc3f6 --- /dev/null +++ b/Machines/MasterSystem/MasterSystem.hpp @@ -0,0 +1,14 @@ +// +// MasterSystem.hpp +// Clock Signal +// +// Created by Thomas Harte on 20/09/2018. +// Copyright © 2018 Thomas Harte. All rights reserved. +// + +#ifndef MasterSystem_hpp +#define MasterSystem_hpp + +#include + +#endif /* MasterSystem_hpp */ diff --git a/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj b/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj index b52f8a493..8562422cf 100644 --- a/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj +++ b/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj @@ -242,6 +242,10 @@ 4B7A90ED20410A85008514A2 /* StaticAnalyser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B7A90EC20410A85008514A2 /* StaticAnalyser.cpp */; }; 4B7BC7F51F58F27800D1B1B4 /* 6502AllRAM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B6A4C911F58F09E00E3F787 /* 6502AllRAM.cpp */; }; 4B7BC7F61F58F7D200D1B1B4 /* 6502Base.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B6A4C951F58F09E00E3F787 /* 6502Base.cpp */; }; + 4B7F188E2154825E00388727 /* MasterSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B7F188C2154825D00388727 /* MasterSystem.cpp */; }; + 4B7F188F2154825E00388727 /* MasterSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B7F188C2154825D00388727 /* MasterSystem.cpp */; }; + 4B7F1897215486A200388727 /* StaticAnalyser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B7F1896215486A100388727 /* StaticAnalyser.cpp */; }; + 4B7F1898215486A200388727 /* StaticAnalyser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B7F1896215486A100388727 /* StaticAnalyser.cpp */; }; 4B80AD001F85CACA00176895 /* BestEffortUpdater.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B80ACFE1F85CAC900176895 /* BestEffortUpdater.cpp */; }; 4B8334821F5D9FF70097E338 /* PartialMachineCycle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B8334811F5D9FF70097E338 /* PartialMachineCycle.cpp */; }; 4B8334841F5DA0360097E338 /* Z80Storage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B8334831F5DA0360097E338 /* Z80Storage.cpp */; }; @@ -941,6 +945,10 @@ 4B7A90E42041097C008514A2 /* ColecoVision.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ColecoVision.cpp; sourceTree = ""; }; 4B7A90EB20410A85008514A2 /* StaticAnalyser.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = StaticAnalyser.hpp; sourceTree = ""; }; 4B7A90EC20410A85008514A2 /* StaticAnalyser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StaticAnalyser.cpp; sourceTree = ""; }; + 4B7F188C2154825D00388727 /* MasterSystem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MasterSystem.cpp; sourceTree = ""; }; + 4B7F188D2154825D00388727 /* MasterSystem.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = MasterSystem.hpp; sourceTree = ""; }; + 4B7F1895215486A100388727 /* StaticAnalyser.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = StaticAnalyser.hpp; sourceTree = ""; }; + 4B7F1896215486A100388727 /* StaticAnalyser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StaticAnalyser.cpp; sourceTree = ""; }; 4B80ACFE1F85CAC900176895 /* BestEffortUpdater.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BestEffortUpdater.cpp; path = ../../Concurrency/BestEffortUpdater.cpp; sourceTree = ""; }; 4B80ACFF1F85CACA00176895 /* BestEffortUpdater.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = BestEffortUpdater.hpp; path = ../../Concurrency/BestEffortUpdater.hpp; sourceTree = ""; }; 4B8334811F5D9FF70097E338 /* PartialMachineCycle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PartialMachineCycle.cpp; sourceTree = ""; }; @@ -2191,6 +2199,24 @@ path = Coleco; sourceTree = ""; }; + 4B7F188B2154825D00388727 /* MasterSystem */ = { + isa = PBXGroup; + children = ( + 4B7F188C2154825D00388727 /* MasterSystem.cpp */, + 4B7F188D2154825D00388727 /* MasterSystem.hpp */, + ); + path = MasterSystem; + sourceTree = ""; + }; + 4B7F1894215486A100388727 /* Sega */ = { + isa = PBXGroup; + children = ( + 4B7F1895215486A100388727 /* StaticAnalyser.hpp */, + 4B7F1896215486A100388727 /* StaticAnalyser.cpp */, + ); + path = Sega; + sourceTree = ""; + }; 4B8334881F5DB8470097E338 /* Implementation */ = { isa = PBXGroup; children = ( @@ -2292,6 +2318,7 @@ 4BD67DC8209BE4D600AB2146 /* DiskII */, 4B89450F201967B4007DE474 /* MSX */, 4B8944F6201967B4007DE474 /* Oric */, + 4B7F1894215486A100388727 /* Sega */, 4B894504201967B4007DE474 /* ZX8081 */, ); path = Static; @@ -2832,11 +2859,11 @@ isa = PBXGroup; children = ( 4B54C0BB1F8D8E790050900F /* KeyboardMachine.cpp */, - 4BA9C3CF1D8164A9002DDB61 /* MediaTarget.hpp */, 4B046DC31CFE651500E9E45E /* CRTMachine.hpp */, 4BBB709C2020109C002FE009 /* DynamicMachine.hpp */, 4B7041271F92C26900735E45 /* JoystickMachine.hpp */, 4B8E4ECD1DCE483D003716C3 /* KeyboardMachine.hpp */, + 4BA9C3CF1D8164A9002DDB61 /* MediaTarget.hpp */, 4BDCC5F81FB27A5E001220C5 /* ROMMachine.hpp */, 4B38F3491F2EC12000D9235D /* AmstradCPC */, 4B15AA082082C799005E6C8D /* AppleII */, @@ -2844,6 +2871,7 @@ 4B7A90E22041097C008514A2 /* ColecoVision */, 4B4DC81D1D2C2425003C5BF8 /* Commodore */, 4B2E2D9E1C3A070900138695 /* Electron */, + 4B7F188B2154825D00388727 /* MasterSystem */, 4B79A4FC1FC8FF9800EEDAD5 /* MSX */, 4BCF1FA51DADC3E10039D2E7 /* Oric */, 4B2B3A461F9B8FA70062DABF /* Utility */, @@ -3628,6 +3656,7 @@ 4B055AD51FAE9B0B0060FFFF /* Video.cpp in Sources */, 4B055AE11FAE9B6F0060FFFF /* ArrayBuilder.cpp in Sources */, 4B894521201967B4007DE474 /* StaticAnalyser.cpp in Sources */, + 4B7F188F2154825E00388727 /* MasterSystem.cpp in Sources */, 4B055AA51FAE85EF0060FFFF /* Encoder.cpp in Sources */, 4B894529201967B4007DE474 /* Disk.cpp in Sources */, 4B055AEA1FAE9B990060FFFF /* 6502Storage.cpp in Sources */, @@ -3641,6 +3670,7 @@ 4B894531201967B4007DE474 /* StaticAnalyser.cpp in Sources */, 4BC891AE20F6EAB300EDE5B3 /* Rectangle.cpp in Sources */, 4B894539201967B4007DE474 /* Tape.cpp in Sources */, + 4B7F1898215486A200388727 /* StaticAnalyser.cpp in Sources */, 4B055AE51FAE9B6F0060FFFF /* IntermediateShader.cpp in Sources */, 4B15A9FD208249BB005E6C8D /* StaticAnalyser.cpp in Sources */, 4B055AD31FAE9B0B0060FFFF /* Microdisc.cpp in Sources */, @@ -3864,6 +3894,7 @@ 4B12C0ED1FCFA98D005BFD93 /* Keyboard.cpp in Sources */, 4BA0F68E1EEA0E8400E9489E /* ZX8081.cpp in Sources */, 4BD468F71D8DF41D0084958B /* 1770.cpp in Sources */, + 4B7F1897215486A200388727 /* StaticAnalyser.cpp in Sources */, 4BD3A30B1EE755C800B5B501 /* Video.cpp in Sources */, 4BBF99141C8FBA6F0075DAFB /* TextureBuilder.cpp in Sources */, 4B5FADBA1DE3151600AEC565 /* FileHolder.cpp in Sources */, @@ -3895,6 +3926,7 @@ 4B6A4C991F58F09E00E3F787 /* 6502Base.cpp in Sources */, 4B4518871F75E91A00926311 /* DigitalPhaseLockedLoop.cpp in Sources */, 4B98A05E1FFAD3F600ADF63B /* CSROMFetcher.mm in Sources */, + 4B7F188E2154825E00388727 /* MasterSystem.cpp in Sources */, 4B8805F41DCFD22A003085B1 /* Commodore.cpp in Sources */, 4B3FCC40201EC24200960631 /* MultiMachine.cpp in Sources */, 4B2E2D9A1C3A06EC00138695 /* Atari2600.cpp in Sources */, diff --git a/OSBindings/Mac/Clock Signal/Info.plist b/OSBindings/Mac/Clock Signal/Info.plist index 0e4491399..ad27ed856 100644 --- a/OSBindings/Mac/Clock Signal/Info.plist +++ b/OSBindings/Mac/Clock Signal/Info.plist @@ -431,6 +431,28 @@ LSHandlerRank Owner + + CFBundleTypeExtensions + + sms + + CFBundleTypeOSTypes + + ???? + + CFBundleTypeIconFile + cartridge.png + CFBundleTypeName + Master System Cartridge + CFBundleTypeRole + Viewer + LSTypeIsPackage + + NSDocumentClass + $(PRODUCT_MODULE_NAME).MachineDocument + LSHandlerRank + Owner + CFBundleTypeExtensions diff --git a/Storage/TargetPlatforms.hpp b/Storage/TargetPlatforms.hpp index e6718dbf4..37017e236 100644 --- a/Storage/TargetPlatforms.hpp +++ b/Storage/TargetPlatforms.hpp @@ -24,10 +24,11 @@ enum Type: IntType { ColecoVision = 1 << 9, Commodore = 1 << 10, DiskII = 1 << 11, - MSX = 1 << 12, - Oric = 1 << 13, - ZX80 = 1 << 14, - ZX81 = 1 << 15, + Sega = 1 << 12, + MSX = 1 << 13, + Oric = 1 << 14, + ZX80 = 1 << 15, + ZX81 = 1 << 16, Acorn = AcornAtom | AcornElectron | BBCMaster | BBCModelA | BBCModelB, ZX8081 = ZX80 | ZX81,