mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
Add boilerplate for Roland D20 decoder.
This commit is contained in:
@@ -24,6 +24,7 @@ LIBARCH_SRCS = \
|
||||
arch/mx/decoder.cc \
|
||||
arch/northstar/decoder.cc \
|
||||
arch/northstar/encoder.cc \
|
||||
arch/rolandd20/decoder.cc \
|
||||
arch/smaky6/decoder.cc \
|
||||
arch/tids990/decoder.cc \
|
||||
arch/tids990/encoder.cc \
|
||||
|
||||
49
arch/rolandd20/decoder.cc
Normal file
49
arch/rolandd20/decoder.cc
Normal file
@@ -0,0 +1,49 @@
|
||||
#include "lib/globals.h"
|
||||
#include "lib/decoders/decoders.h"
|
||||
#include "lib/crc.h"
|
||||
#include "lib/fluxmap.h"
|
||||
#include "lib/decoders/fluxmapreader.h"
|
||||
#include "lib/sector.h"
|
||||
#include "lib/bytes.h"
|
||||
#include "rolandd20.h"
|
||||
#include <string.h>
|
||||
|
||||
/* Sector header record:
|
||||
*
|
||||
* BF FF FF FF FF FF FE AB
|
||||
*
|
||||
* f f f f f e a b
|
||||
* 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 0 1 0 1 1
|
||||
* 1111111111111111111111111111111111111111111111011101110111011111
|
||||
* f f f f f f f f f f f d d d d f
|
||||
*/
|
||||
|
||||
static const FluxPattern SECTOR_PATTERN(64, 0xfffffffffffddddfLL);
|
||||
|
||||
class RolandD20Decoder : public Decoder
|
||||
{
|
||||
public:
|
||||
RolandD20Decoder(const DecoderProto& config):
|
||||
Decoder(config)
|
||||
{}
|
||||
|
||||
nanoseconds_t advanceToNextRecord() override
|
||||
{
|
||||
return seekToPattern(SECTOR_PATTERN);
|
||||
}
|
||||
|
||||
void decodeSectorRecord() override
|
||||
{
|
||||
auto rawbits = readRawBits(128);
|
||||
const auto& bytes = decodeFmMfm(rawbits);
|
||||
hexdump(std::cout, bytes);
|
||||
}
|
||||
};
|
||||
|
||||
std::unique_ptr<Decoder> createRolandD20Decoder(const DecoderProto& config)
|
||||
{
|
||||
return std::unique_ptr<Decoder>(new RolandD20Decoder(config));
|
||||
}
|
||||
|
||||
|
||||
|
||||
4
arch/rolandd20/rolandd20.h
Normal file
4
arch/rolandd20/rolandd20.h
Normal file
@@ -0,0 +1,4 @@
|
||||
#pragma once
|
||||
|
||||
extern std::unique_ptr<Decoder> createRolandD20Decoder(const DecoderProto& config);
|
||||
|
||||
5
arch/rolandd20/rolandd20.proto
Normal file
5
arch/rolandd20/rolandd20.proto
Normal file
@@ -0,0 +1,5 @@
|
||||
syntax = "proto2";
|
||||
|
||||
message RolandD20DecoderProto {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user