diff --git a/Analyser/Static/StaticAnalyser.cpp b/Analyser/Static/StaticAnalyser.cpp index fdda45eaf..0990ebfaa 100644 --- a/Analyser/Static/StaticAnalyser.cpp +++ b/Analyser/Static/StaticAnalyser.cpp @@ -62,6 +62,7 @@ #include "Storage/Disk/DiskImage/Formats/NIB.hpp" #include "Storage/Disk/DiskImage/Formats/OricMFMDSK.hpp" #include "Storage/Disk/DiskImage/Formats/PCBooter.hpp" +#include "Storage/Disk/DiskImage/Formats/SAP.hpp" #include "Storage/Disk/DiskImage/Formats/SSD.hpp" #include "Storage/Disk/DiskImage/Formats/STX.hpp" #include "Storage/Disk/DiskImage/Formats/WOZ.hpp" @@ -311,6 +312,7 @@ static Media GetMediaAndPlatforms(const std::string &file_name, TargetPlatform:: TargetPlatform::AcornElectron | TargetPlatform::Coleco | TargetPlatform::MSX, "rom"); + accumulator.try_standard>(TargetPlatform::ThomsonMO, "sap"); accumulator.try_standard(TargetPlatform::Sega, "sg"); accumulator.try_standard(TargetPlatform::Sega, "sms"); accumulator.try_standard>(TargetPlatform::Acorn, "ssd"); diff --git a/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj b/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj index 46f3fc391..7e5ebcdd3 100644 --- a/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj +++ b/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj @@ -58,6 +58,9 @@ 4B03E8422F9528D4008AF203 /* LEP.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B03E8412F9528D4008AF203 /* LEP.cpp */; }; 4B03E8432F9528D4008AF203 /* LEP.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B03E8412F9528D4008AF203 /* LEP.cpp */; }; 4B03E8442F9528D4008AF203 /* LEP.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B03E8412F9528D4008AF203 /* LEP.cpp */; }; + 4B03E8472F965E17008AF203 /* SAP.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B03E8462F965E17008AF203 /* SAP.cpp */; }; + 4B03E8482F965E17008AF203 /* SAP.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B03E8462F965E17008AF203 /* SAP.cpp */; }; + 4B03E8492F965E17008AF203 /* SAP.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B03E8462F965E17008AF203 /* SAP.cpp */; }; 4B049CDD1DA3C82F00322067 /* BCDTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B049CDC1DA3C82F00322067 /* BCDTest.swift */; }; 4B04C899285E3DC800AA8FD6 /* 65816ComparativeTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4B04C898285E3DC800AA8FD6 /* 65816ComparativeTests.mm */; }; 4B051C912669C90B00CA44E8 /* ROMCatalogue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B051C5826670A9300CA44E8 /* ROMCatalogue.cpp */; }; @@ -1396,6 +1399,8 @@ 4B03E8352F8D914C008AF203 /* Video.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Video.cpp; sourceTree = ""; }; 4B03E8402F9528D4008AF203 /* LEP.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = LEP.hpp; sourceTree = ""; }; 4B03E8412F9528D4008AF203 /* LEP.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = LEP.cpp; sourceTree = ""; }; + 4B03E8452F965E17008AF203 /* SAP.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = SAP.hpp; sourceTree = ""; }; + 4B03E8462F965E17008AF203 /* SAP.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SAP.cpp; sourceTree = ""; }; 4B046DC31CFE651500E9E45E /* ScanProducer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ScanProducer.hpp; sourceTree = ""; }; 4B047075201ABC180047AB0D /* Cartridge.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Cartridge.hpp; sourceTree = ""; }; 4B049CDC1DA3C82F00322067 /* BCDTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BCDTest.swift; sourceTree = ""; }; @@ -3457,6 +3462,7 @@ 4B0F94FC208C1A1600FE41D9 /* NIB.cpp */, 4B4518971F75FD1B00926311 /* OricMFMDSK.cpp */, 423820422B1A90BE00964EFE /* PCBooter.cpp */, + 4B03E8462F965E17008AF203 /* SAP.cpp */, 4B4518991F75FD1B00926311 /* SSD.cpp */, 4B7BA03323C58B1E00B98D9E /* STX.cpp */, 4B6ED2EE208E2F8A0047B343 /* WOZ.cpp */, @@ -3481,6 +3487,7 @@ 4B0F94FD208C1A1600FE41D9 /* NIB.hpp */, 4B4518981F75FD1B00926311 /* OricMFMDSK.hpp */, 423820432B1A90BE00964EFE /* PCBooter.hpp */, + 4B03E8452F965E17008AF203 /* SAP.hpp */, 4B45189A1F75FD1B00926311 /* SSD.hpp */, 4B7BA03223C58B1E00B98D9E /* STX.hpp */, 4B6ED2EF208E2F8A0047B343 /* WOZ.hpp */, @@ -6675,6 +6682,7 @@ 4BD235CC2F32A4C80094AFAE /* KernelShaders.cpp in Sources */, 4B055AC21FAE9AE30060FFFF /* KeyboardMachine.cpp in Sources */, 4B89453B201967B4007DE474 /* StaticAnalyser.cpp in Sources */, + 4B03E8482F965E17008AF203 /* SAP.cpp in Sources */, 4B055AEB1FAE9BA20060FFFF /* PartialMachineCycle.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -6776,6 +6784,7 @@ 4B6AAEA4230E3E1D0078E864 /* MassStorageDevice.cpp in Sources */, 4B89452E201967B4007DE474 /* StaticAnalyser.cpp in Sources */, 4BC890D3230F86020025A55A /* DirectAccessDevice.cpp in Sources */, + 4B03E8492F965E17008AF203 /* SAP.cpp in Sources */, 4B7BA03723CEB86000B98D9E /* BD500.cpp in Sources */, 4B38F3481F2EC11D00D9235D /* AmstradCPC.cpp in Sources */, 4B8FE2221DA19FB20090D3CE /* MachineController.swift in Sources */, @@ -7050,6 +7059,7 @@ 423BDC4A2AB24699008E37B6 /* 8088Tests.mm in Sources */, 4B778F2723A5EEF60000D260 /* BinaryDump.cpp in Sources */, 4BFCA1241ECBDCB400AC40C1 /* AllRAMProcessor.cpp in Sources */, + 4B03E8472F965E17008AF203 /* SAP.cpp in Sources */, 4B06AB042C6460D60034D014 /* 6560.cpp in Sources */, 4B06AB002C6460B70034D014 /* Keyboard.cpp in Sources */, 4B778F5223A5F22F0000D260 /* StaticAnalyser.cpp in Sources */, diff --git a/OSBindings/Mac/Clock Signal/Info.plist b/OSBindings/Mac/Clock Signal/Info.plist index 606b53e0c..23b8a7e98 100644 --- a/OSBindings/Mac/Clock Signal/Info.plist +++ b/OSBindings/Mac/Clock Signal/Info.plist @@ -880,6 +880,7 @@ CFBundleTypeExtensions fd + sap CFBundleTypeIconFile floppy525 diff --git a/Storage/Disk/DiskImage/Formats/SAP.cpp b/Storage/Disk/DiskImage/Formats/SAP.cpp new file mode 100644 index 000000000..d14235fe5 --- /dev/null +++ b/Storage/Disk/DiskImage/Formats/SAP.cpp @@ -0,0 +1,40 @@ +// +// SAP.cpp +// Clock Signal +// +// Created by Thomas Harte on 20/04/2026. +// Copyright © 2026 Thomas Harte. All rights reserved. +// + +#include "SAP.hpp" + +using namespace Storage::Disk; + +SAP::SAP(const std::string &file_name) : file_(file_name) { +} + +HeadPosition SAP::maximum_head_position() const { + return HeadPosition(2); +} + +bool SAP::is_read_only() const { + return true; +} + +bool SAP::represents(const std::string &name) const { + return name == file_.name(); +} + +Track::Address SAP::canonical_address(const Track::Address address) const { + return Track::Address( + address.head, + HeadPosition(address.position.as_int()) + ); +} + +std::unique_ptr SAP::track_at_position(Track::Address) const { + return nullptr; +} + +void SAP::set_tracks(const std::map> &) { +} diff --git a/Storage/Disk/DiskImage/Formats/SAP.hpp b/Storage/Disk/DiskImage/Formats/SAP.hpp new file mode 100644 index 000000000..e02cbc415 --- /dev/null +++ b/Storage/Disk/DiskImage/Formats/SAP.hpp @@ -0,0 +1,33 @@ +// +// SAP.hpp +// Clock Signal +// +// Created by Thomas Harte on 20/04/2026. +// Copyright © 2026 Thomas Harte. All rights reserved. +// + +#pragma once + +#include "Storage/Disk/DiskImage/DiskImage.hpp" +#include "Storage/Disk/Track/PCMTrack.hpp" +#include "Storage/FileHolder.hpp" +#include + +namespace Storage::Disk { + +class SAP: public DiskImage { +public: + SAP(const std::string &file_name); + + HeadPosition maximum_head_position() const; + Track::Address canonical_address(Track::Address) const; + std::unique_ptr track_at_position(Track::Address) const; + void set_tracks(const std::map> &tracks); + bool is_read_only() const; + bool represents(const std::string &) const; + +private: + mutable FileHolder file_; +}; + +} diff --git a/cmake/CLK_SOURCES.cmake b/cmake/CLK_SOURCES.cmake index 25a8cbf23..0a32638ce 100644 --- a/cmake/CLK_SOURCES.cmake +++ b/cmake/CLK_SOURCES.cmake @@ -220,6 +220,7 @@ set(CLK_SOURCES Storage/Disk/DiskImage/Formats/NIB.cpp Storage/Disk/DiskImage/Formats/OricMFMDSK.cpp Storage/Disk/DiskImage/Formats/PCBooter.cpp + Storage/Disk/DiskImage/Formats/SAP.cpp Storage/Disk/DiskImage/Formats/SSD.cpp Storage/Disk/DiskImage/Formats/STX.cpp Storage/Disk/DiskImage/Formats/Utility/ImplicitSectors.cpp