Add some helper methods to make decoders easier. Port IBM to the new new

architecture.
This commit is contained in:
David Given
2019-04-30 20:45:16 +02:00
parent 4cc680057e
commit 184e7766f0
5 changed files with 137 additions and 138 deletions

View File

@@ -4,6 +4,7 @@
#include "bytes.h"
#include "sector.h"
#include "record.h"
#include "fluxmapreader.h"
class Sector;
class Fluxmap;
@@ -48,6 +49,15 @@ public:
void decodeToSectors(Track& track) override;
void pushRecord(const Fluxmap::Position& start, const Fluxmap::Position& end);
std::vector<bool> readRawBits(unsigned count)
{ return _fmr->readRawBits(count, _sector->clock); }
Fluxmap::Position tell()
{ return _fmr->tell(); }
void seek(const Fluxmap::Position& pos)
{ return _fmr->seek(pos); }
protected:
virtual RecordType advanceToNextRecord() = 0;
virtual void decodeSectorRecord() = 0;