1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-16 22:28:57 +00:00
CLK/Storage/Tape/Parsers/Spectrum.hpp
Thomas Harte d93d380c88 Adds bit-level Spectrum-style tape parsing.
More to do, obviously.
2021-03-07 15:51:25 -05:00

49 lines
920 B
C++

//
// Spectrum.hpp
// Clock Signal
//
// Created by Thomas Harte on 07/03/2021.
// Copyright © 2021 Thomas Harte. All rights reserved.
//
#ifndef Storage_Tape_Parsers_Spectrum_hpp
#define Storage_Tape_Parsers_Spectrum_hpp
#include "TapeParser.hpp"
namespace Storage {
namespace Tape {
namespace ZXSpectrum {
enum class WaveType {
// All references to 't-states' below are cycles relative to the
// ZX Spectrum's 3.5Mhz processor.
Pilot, // Nominally 2168 t-states.
Sync1, // 667 t-states.
Sync2, // 735 t-states.
Zero, // 855 t-states.
One, // 1710 t-states.
Gap,
};
enum class SymbolType {
Pilot,
Sync,
Zero,
One,
Gap,
};
class Parser: public Storage::Tape::PulseClassificationParser<WaveType, SymbolType> {
private:
void process_pulse(const Storage::Tape::Tape::Pulse &pulse) override;
void inspect_waves(const std::vector<WaveType> &waves) override;
};
}
}
}
#endif /* Spectrum_hpp */