1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-25 18:30:07 +00:00

Added the base skeletal stuff of HFE support.

This commit is contained in:
Thomas Harte 2017-08-17 21:48:48 -04:00
parent dc0ca83003
commit e6683e7f2d
5 changed files with 113 additions and 1 deletions

View File

@ -442,6 +442,7 @@
4BF8295D1D8F048B001BAE39 /* MFM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8295B1D8F048B001BAE39 /* MFM.cpp */; };
4BF829631D8F536B001BAE39 /* SSD.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF829611D8F536B001BAE39 /* SSD.cpp */; };
4BF829661D8F732B001BAE39 /* Disk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF829641D8F732B001BAE39 /* Disk.cpp */; };
4BFB9FAE1F467D3A00960122 /* HFE.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BFB9FAC1F467D3A00960122 /* HFE.cpp */; };
4BFCA1201ECBDC1500AC40C1 /* Z80AllRAM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BFCA11D1ECBD9BD00AC40C1 /* Z80AllRAM.cpp */; };
4BFCA1241ECBDCB400AC40C1 /* AllRAMProcessor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BFCA1211ECBDCAF00AC40C1 /* AllRAMProcessor.cpp */; };
4BFCA1271ECBE33200AC40C1 /* TestMachineZ80.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4BFCA1261ECBE33200AC40C1 /* TestMachineZ80.mm */; };
@ -1067,6 +1068,8 @@
4BF829641D8F732B001BAE39 /* Disk.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Disk.cpp; path = ../../StaticAnalyser/Acorn/Disk.cpp; sourceTree = "<group>"; };
4BF829651D8F732B001BAE39 /* Disk.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = Disk.hpp; path = ../../StaticAnalyser/Acorn/Disk.hpp; sourceTree = "<group>"; };
4BF829681D8F7361001BAE39 /* File.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = File.hpp; path = ../../StaticAnalyser/Acorn/File.hpp; sourceTree = "<group>"; };
4BFB9FAC1F467D3A00960122 /* HFE.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HFE.cpp; sourceTree = "<group>"; };
4BFB9FAD1F467D3A00960122 /* HFE.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = HFE.hpp; sourceTree = "<group>"; };
4BFCA11D1ECBD9BD00AC40C1 /* Z80AllRAM.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Z80AllRAM.cpp; path = Z80/Z80AllRAM.cpp; sourceTree = "<group>"; };
4BFCA11E1ECBD9BD00AC40C1 /* Z80AllRAM.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = Z80AllRAM.hpp; path = Z80/Z80AllRAM.hpp; sourceTree = "<group>"; };
4BFCA1211ECBDCAF00AC40C1 /* AllRAMProcessor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AllRAMProcessor.cpp; sourceTree = "<group>"; };
@ -1587,6 +1590,8 @@
4BF829621D8F536B001BAE39 /* SSD.hpp */,
4B838F1D1F35FDCD0016B5E6 /* CPCDSK.cpp */,
4B838F1E1F35FDCD0016B5E6 /* CPCDSK.hpp */,
4BFB9FAC1F467D3A00960122 /* HFE.cpp */,
4BFB9FAD1F467D3A00960122 /* HFE.hpp */,
);
path = Formats;
sourceTree = "<group>";
@ -2819,6 +2824,7 @@
4B2A539F1D117D36003C6002 /* CSAudioQueue.m in Sources */,
4B37EE821D7345A6006A09A4 /* BinaryDump.cpp in Sources */,
4BB73EA21B587A5100552FC2 /* AppDelegate.swift in Sources */,
4BFB9FAE1F467D3A00960122 /* HFE.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

View File

@ -245,6 +245,22 @@
<key>NSDocumentClass</key>
<string>$(PRODUCT_MODULE_NAME).MachineDocument</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>hfe</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>floppy35</string>
<key>CFBundleTypeName</key>
<string>HxC Disk Image</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSTypeIsPackage</key>
<integer>0</integer>
<key>NSDocumentClass</key>
<string>$(PRODUCT_MODULE_NAME).MachineDocument</string>
</dict>
</array>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>

View File

@ -27,6 +27,7 @@
#include "../Storage/Disk/Formats/CPCDSK.hpp"
#include "../Storage/Disk/Formats/D64.hpp"
#include "../Storage/Disk/Formats/G64.hpp"
#include "../Storage/Disk/Formats/HFE.hpp"
#include "../Storage/Disk/Formats/OricMFMDSK.hpp"
#include "../Storage/Disk/Formats/SSD.hpp"
@ -48,7 +49,8 @@ enum class TargetPlatform: TargetPlatformType {
Oric = 1 << 4,
ZX8081 = 1 << 5,
AllTape = Acorn | Commodore | Oric | ZX8081 | AmstradCPC,
AllTape = Acorn | AmstradCPC | Commodore | Oric | ZX8081,
AllDisk = Acorn | AmstradCPC | Commodore | Oric,
};
using namespace StaticAnalyser;
@ -95,6 +97,7 @@ static Media GetMediaAndPlatforms(const char *file_name, TargetPlatformType &pot
Format("dsk", result.disks, Disk::CPCDSK, TargetPlatform::AmstradCPC) // DSK (Amstrad CPC)
Format("dsk", result.disks, Disk::OricMFMDSK, TargetPlatform::Oric) // DSK (Oric)
Format("g64", result.disks, Disk::G64, TargetPlatform::Commodore) // G64
Format("hfe", result.disks, Disk::HFE, TargetPlatform::AmstradCPC) // HFE (TODO: plus other target platforms)
Format("o", result.tapes, Tape::ZX80O81P, TargetPlatform::ZX8081) // O
Format("p", result.tapes, Tape::ZX80O81P, TargetPlatform::ZX8081) // P
Format("p81", result.tapes, Tape::ZX80O81P, TargetPlatform::ZX8081) // P81

View File

@ -0,0 +1,35 @@
//
// HFE.cpp
// Clock Signal
//
// Created by Thomas Harte on 17/08/2017.
// Copyright © 2017 Thomas Harte. All rights reserved.
//
#include "HFE.hpp"
using namespace Storage::Disk;
HFE::HFE(const char *file_name) :
Storage::FileHolder(file_name) {
throw ErrorNotHFE;
}
HFE::~HFE() {
}
unsigned int HFE::get_head_position_count() {
return track_count_;
}
unsigned int HFE::get_head_count() {
return head_count_;
}
bool HFE::get_is_read_only() {
return true;
}
std::shared_ptr<Track> HFE::get_uncached_track_at_position(unsigned int head, unsigned int position) {
return nullptr;
}

View File

@ -0,0 +1,52 @@
//
// HFE.hpp
// Clock Signal
//
// Created by Thomas Harte on 17/08/2017.
// Copyright © 2017 Thomas Harte. All rights reserved.
//
#ifndef HFE_hpp
#define HFE_hpp
#include "../Disk.hpp"
#include "../../FileHolder.hpp"
namespace Storage {
namespace Disk {
/*!
Provies a @c Disk containing an HFE disk image a bit stream representation of a floppy.
*/
class HFE: public Disk, public Storage::FileHolder {
public:
/*!
Construct an @c SSD containing content from the file with name @c file_name.
@throws ErrorCantOpen if this file can't be opened.
@throws ErrorNotSSD if the file doesn't appear to contain a .SSD format image.
*/
HFE(const char *file_name);
~HFE();
enum {
ErrorNotHFE,
};
// implemented to satisfy @c Disk
unsigned int get_head_position_count();
unsigned int get_head_count();
bool get_is_read_only();
private:
std::shared_ptr<Track> get_uncached_track_at_position(unsigned int head, unsigned int position);
unsigned int head_count_;
unsigned int track_count_;
};
}
}
#endif /* HFE_hpp */