mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
Boilerplate rearrangement to move all the brother stuff into a directory of its
own. Prepare for writing.
This commit is contained in:
21
lib/brother/brother.h
Normal file
21
lib/brother/brother.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#ifndef BROTHER_H
|
||||
#define BROTHER_H
|
||||
|
||||
/* Brother word processor format (or at least, one of them) */
|
||||
|
||||
#define BROTHER_SECTOR_RECORD 0xFFFFFD57
|
||||
#define BROTHER_DATA_RECORD 0xFFFFFDDB
|
||||
#define BROTHER_DATA_RECORD_PAYLOAD 256
|
||||
|
||||
class Sector;
|
||||
class Fluxmap;
|
||||
|
||||
extern std::vector<std::vector<uint8_t>> decodeBitsToRecordsBrother(const std::vector<bool>& bitmap);
|
||||
|
||||
extern std::vector<std::unique_ptr<Sector>> parseRecordsToSectorsBrother(const std::vector<std::vector<uint8_t>>& records);
|
||||
|
||||
extern std::vector<bool> encodeRecordsToBits(const std::vector<std::vector<uint8_t>>& records);
|
||||
|
||||
extern std::vector<std::vector<std::unique_ptr<uint8_t>>> unparseSectorsToRecordsBrother(const std::vector<std::unique_ptr<Sector>>& sectors);
|
||||
|
||||
#endif
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "sql.h"
|
||||
#include "fluxmap.h"
|
||||
#include "decoders.h"
|
||||
#include "brother.h"
|
||||
#include <ctype.h>
|
||||
|
||||
static std::vector<uint8_t> outputbuffer;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "globals.h"
|
||||
#include "decoders.h"
|
||||
#include "image.h"
|
||||
#include "brother.h"
|
||||
#include "crc.h"
|
||||
#include <string.h>
|
||||
|
||||
|
||||
@@ -23,21 +23,13 @@ struct IbmIdam
|
||||
uint8_t crc[2];
|
||||
};
|
||||
|
||||
/* Brother word processor format (or at least, one of them) */
|
||||
|
||||
#define BROTHER_SECTOR_RECORD 0xFFFFFD57
|
||||
#define BROTHER_DATA_RECORD 0xFFFFFDDB
|
||||
#define BROTHER_DATA_RECORD_PAYLOAD 256
|
||||
|
||||
class Sector;
|
||||
class Fluxmap;
|
||||
|
||||
extern std::vector<bool> decodeFluxmapToBits(const Fluxmap& fluxmap, nanoseconds_t clock_period);
|
||||
|
||||
extern std::vector<std::vector<uint8_t>> decodeBitsToRecordsMfm(const std::vector<bool>& bitmap);
|
||||
extern std::vector<std::vector<uint8_t>> decodeBitsToRecordsBrother(const std::vector<bool>& bitmap);
|
||||
|
||||
extern std::vector<std::unique_ptr<Sector>> parseRecordsToSectorsIbm(const std::vector<std::vector<uint8_t>>& records);
|
||||
extern std::vector<std::unique_ptr<Sector>> parseRecordsToSectorsBrother(const std::vector<std::vector<uint8_t>>& records);
|
||||
|
||||
#endif
|
||||
|
||||
15
meson.build
15
meson.build
@@ -55,18 +55,27 @@ decoderlib = shared_library('decoderlib',
|
||||
'lib/decoders/decoders.cc',
|
||||
'lib/decoders/mfmdecoder.cc',
|
||||
'lib/decoders/ibmparser.cc',
|
||||
'lib/brother/decoder.cc',
|
||||
'lib/brother/parser.cc',
|
||||
],
|
||||
include_directories: [feinc, fmtinc],
|
||||
link_with: [felib, fmtlib]
|
||||
)
|
||||
decoderinc = include_directories('lib/decoders')
|
||||
|
||||
brotherlib = shared_library('brotherlib',
|
||||
[
|
||||
'lib/brother/decoder.cc',
|
||||
'lib/brother/parser.cc',
|
||||
],
|
||||
include_directories: [feinc, fmtinc, decoderinc],
|
||||
link_with: [felib, fmtlib, decoderlib]
|
||||
)
|
||||
brotherinc = include_directories('lib/brother')
|
||||
|
||||
executable('fe-rpm', ['src/fe-rpm.cc'], include_directories: [feinc], link_with: [felib])
|
||||
executable('fe-seek', ['src/fe-seek.cc'], include_directories: [feinc], link_with: [felib])
|
||||
executable('fe-testbulktransport', ['src/fe-testbulktransport.cc'], include_directories: [feinc], link_with: [felib])
|
||||
executable('fe-readibm', ['src/fe-readibm.cc'], include_directories: [feinc, fmtinc, decoderinc], link_with: [felib, readerlib, decoderlib, fmtlib])
|
||||
executable('fe-readbrother', ['src/fe-readbrother.cc'], include_directories: [feinc, fmtinc, decoderinc], link_with: [felib, readerlib, decoderlib, fmtlib])
|
||||
executable('fe-readbrother', ['src/fe-readbrother.cc'], include_directories: [feinc, fmtinc, decoderinc, brotherinc], link_with: [felib, readerlib, decoderlib, brotherlib, fmtlib])
|
||||
executable('fe-writebrother', ['src/fe-writebrother.cc'], include_directories: [feinc, fmtinc, decoderinc, brotherinc], link_with: [felib, readerlib, decoderlib, brotherlib, fmtlib])
|
||||
executable('fe-inspect', ['src/fe-inspect.cc'], include_directories: [feinc, fmtinc, decoderinc], link_with: [felib, readerlib, decoderlib, fmtlib])
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "reader.h"
|
||||
#include "fluxmap.h"
|
||||
#include "decoders.h"
|
||||
#include "brother.h"
|
||||
#include "image.h"
|
||||
#include <fmt/format.h>
|
||||
#include <fstream>
|
||||
|
||||
Reference in New Issue
Block a user