mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-13 07:30:21 +00:00
Declared support for the Acorn disk files, started hammering out an encoder.
This commit is contained in:
parent
0e44cfa8a1
commit
bcf91de7e9
@ -9,6 +9,19 @@
|
||||
#ifndef _770_hpp
|
||||
#define _770_hpp
|
||||
|
||||
#include <stdio.h>
|
||||
#include "../../Storage/Disk/DiskDrive.hpp"
|
||||
|
||||
namespace WD {
|
||||
|
||||
class WD1770 {
|
||||
public:
|
||||
|
||||
void set_drive(std::shared_ptr<Storage::Disk::Drive> drive);
|
||||
void set_is_double_density(bool is_double_density);
|
||||
void set_register(int address, uint8_t value);
|
||||
void get_register(int address);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif /* _770_hpp */
|
||||
|
@ -355,6 +355,7 @@
|
||||
4BEF6AAA1D35CE9E00E73575 /* DigitalPhaseLockedLoopBridge.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4BEF6AA91D35CE9E00E73575 /* DigitalPhaseLockedLoopBridge.mm */; };
|
||||
4BEF6AAC1D35D1C400E73575 /* DPLLTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BEF6AAB1D35D1C400E73575 /* DPLLTests.swift */; };
|
||||
4BF1354C1D6D2C300054B2EA /* StaticAnalyser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF1354A1D6D2C300054B2EA /* StaticAnalyser.cpp */; };
|
||||
4BF8295D1D8F048B001BAE39 /* MFM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BF8295B1D8F048B001BAE39 /* MFM.cpp */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
@ -805,6 +806,8 @@
|
||||
4BEF6AAB1D35D1C400E73575 /* DPLLTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DPLLTests.swift; sourceTree = "<group>"; };
|
||||
4BF1354A1D6D2C300054B2EA /* StaticAnalyser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StaticAnalyser.cpp; path = ../../StaticAnalyser/StaticAnalyser.cpp; sourceTree = "<group>"; };
|
||||
4BF1354B1D6D2C300054B2EA /* StaticAnalyser.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = StaticAnalyser.hpp; path = ../../StaticAnalyser/StaticAnalyser.hpp; sourceTree = "<group>"; };
|
||||
4BF8295B1D8F048B001BAE39 /* MFM.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MFM.cpp; path = Encodings/MFM.cpp; sourceTree = "<group>"; };
|
||||
4BF8295C1D8F048B001BAE39 /* MFM.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = MFM.hpp; path = Encodings/MFM.hpp; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@ -1400,6 +1403,8 @@
|
||||
children = (
|
||||
4BB697CC1D4BA44400248BDF /* CommodoreGCR.cpp */,
|
||||
4BB697CD1D4BA44400248BDF /* CommodoreGCR.hpp */,
|
||||
4BF8295B1D8F048B001BAE39 /* MFM.cpp */,
|
||||
4BF8295C1D8F048B001BAE39 /* MFM.hpp */,
|
||||
);
|
||||
name = Encodings;
|
||||
sourceTree = "<group>";
|
||||
@ -2091,6 +2096,7 @@
|
||||
4BC830D11D6E7C690000A26F /* Tape.cpp in Sources */,
|
||||
4B69FB441C4D941400B5F0AA /* TapeUEF.cpp in Sources */,
|
||||
4B4DC8211D2C2425003C5BF8 /* Vic20.cpp in Sources */,
|
||||
4BF8295D1D8F048B001BAE39 /* MFM.cpp in Sources */,
|
||||
4BE77A2E1D84ADFB00BC3827 /* File.cpp in Sources */,
|
||||
4BAB62B51D327F7E00DF5BA0 /* G64.cpp in Sources */,
|
||||
4BD468F71D8DF41D0084958B /* 1770.cpp in Sources */,
|
||||
|
@ -130,6 +130,20 @@
|
||||
<key>NSDocumentClass</key>
|
||||
<string>$(PRODUCT_MODULE_NAME).Vic20Document</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>ssd</string>
|
||||
<string>dsd</string>
|
||||
<string>adf</string>
|
||||
<string>adl</string>
|
||||
<string>adm</string>
|
||||
</array>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>Electron/BBC Disk Image</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
|
@ -6,8 +6,8 @@
|
||||
// Copyright © 2016 Thomas Harte. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef CommodoreGCR_hpp
|
||||
#define CommodoreGCR_hpp
|
||||
#ifndef Storage_Disk_Encodings_CommodoreGCR_hpp
|
||||
#define Storage_Disk_Encodings_CommodoreGCR_hpp
|
||||
|
||||
#include "../../Storage.hpp"
|
||||
#include <cstdint>
|
||||
|
50
Storage/Disk/Encodings/MFM.cpp
Normal file
50
Storage/Disk/Encodings/MFM.cpp
Normal file
@ -0,0 +1,50 @@
|
||||
//
|
||||
// MFM.cpp
|
||||
// Clock Signal
|
||||
//
|
||||
// Created by Thomas Harte on 18/09/2016.
|
||||
// Copyright © 2016 Thomas Harte. All rights reserved.
|
||||
//
|
||||
|
||||
#include "MFM.hpp"
|
||||
|
||||
using namespace Storage::Encodings;
|
||||
|
||||
void Shifter::add_sync()
|
||||
{
|
||||
// i.e. 0100 0100 1000 1001
|
||||
output = (uint16_t)((output << 15) | 0x4489);
|
||||
}
|
||||
|
||||
void MFMShifter::shift(uint8_t input)
|
||||
{
|
||||
uint16_t spread_value =
|
||||
(uint16_t)(
|
||||
((input & 0x01) << 0) |
|
||||
((input & 0x02) << 1) |
|
||||
((input & 0x04) << 2) |
|
||||
((input & 0x08) << 3) |
|
||||
((input & 0x10) << 4) |
|
||||
((input & 0x20) << 5) |
|
||||
((input & 0x40) << 6) |
|
||||
((input & 0x80) << 7)
|
||||
);
|
||||
uint16_t or_bits = (uint16_t)((spread_value << 1) | (spread_value >> 1) | (output << 15));
|
||||
output = spread_value | ((~or_bits) & 0xaaaa);
|
||||
}
|
||||
|
||||
void FMShifter::shift(uint8_t input)
|
||||
{
|
||||
output =
|
||||
(uint16_t)(
|
||||
((input & 0x01) << 0) |
|
||||
((input & 0x02) << 1) |
|
||||
((input & 0x04) << 2) |
|
||||
((input & 0x08) << 3) |
|
||||
((input & 0x10) << 4) |
|
||||
((input & 0x20) << 5) |
|
||||
((input & 0x40) << 6) |
|
||||
((input & 0x80) << 7) |
|
||||
0xaaaa
|
||||
);
|
||||
}
|
37
Storage/Disk/Encodings/MFM.hpp
Normal file
37
Storage/Disk/Encodings/MFM.hpp
Normal file
@ -0,0 +1,37 @@
|
||||
//
|
||||
// MFM.hpp
|
||||
// Clock Signal
|
||||
//
|
||||
// Created by Thomas Harte on 18/09/2016.
|
||||
// Copyright © 2016 Thomas Harte. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef Storage_Disk_Encodings_MFM_hpp
|
||||
#define Storage_Disk_Encodings_MFM_hpp
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace Storage {
|
||||
namespace Encodings {
|
||||
|
||||
class Shifter {
|
||||
public:
|
||||
virtual void shift(uint8_t input) = 0;
|
||||
void add_sync();
|
||||
uint16_t output;
|
||||
};
|
||||
|
||||
class MFMShifter: public Shifter {
|
||||
public:
|
||||
void shift(uint8_t input);
|
||||
};
|
||||
|
||||
class FMShifter: public Shifter {
|
||||
public:
|
||||
void shift(uint8_t input);
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* MFM_hpp */
|
Loading…
x
Reference in New Issue
Block a user