Convert the Apple2 decoder.

This commit is contained in:
David Given
2021-05-15 14:04:44 +02:00
parent e1398d98b0
commit 1149ad86a2
7 changed files with 41 additions and 26 deletions

View File

@@ -9,10 +9,12 @@
class Sector;
class Fluxmap;
class Apple2InputProto;
class Apple2Decoder : public AbstractDecoder
{
public:
Apple2Decoder(const Apple2InputProto&) {}
virtual ~Apple2Decoder() {}
RecordType advanceToNextRecord();

4
arch/apple2/apple2.proto Normal file
View File

@@ -0,0 +1,4 @@
syntax = "proto2";
message Apple2InputProto {}

View File

@@ -5,6 +5,7 @@
#include "encoders/encoders.h"
#include "arch/aeslanier/aeslanier.h"
#include "arch/amiga/amiga.h"
#include "arch/apple2/apple2.h"
#include "arch/brother/brother.h"
#include "arch/c64/c64.h"
#include "arch/f85/f85.h"
@@ -30,6 +31,9 @@ std::unique_ptr<AbstractDecoder> AbstractDecoder::create(const DecoderProto& con
case DecoderProto::kAmiga:
return std::unique_ptr<AbstractDecoder>(new AmigaDecoder(config.amiga()));
case DecoderProto::kApple2:
return std::unique_ptr<AbstractDecoder>(new Apple2Decoder(config.apple2()));
case DecoderProto::kBrother:
return std::unique_ptr<AbstractDecoder>(new BrotherDecoder(config.brother()));

View File

@@ -2,6 +2,7 @@ syntax = "proto2";
import "arch/aeslanier/aeslanier.proto";
import "arch/amiga/amiga.proto";
import "arch/apple2/apple2.proto";
import "arch/brother/brother.proto";
import "arch/c64/c64.proto";
import "arch/f85/f85.proto";
@@ -29,6 +30,7 @@ message DecoderProto {
F85InputProto f85 = 10;
Fb100InputProto fb100 = 11;
MacintoshInputProto macintosh = 12;
Apple2InputProto apple2 = 13;
}
}

View File

@@ -259,6 +259,7 @@ buildlibrary libfmt.a \
buildproto libproto.a \
arch/aeslanier/aeslanier.proto \
arch/amiga/amiga.proto \
arch/apple2/apple2.proto \
arch/brother/brother.proto \
arch/c64/c64.proto \
arch/f85/f85.proto \
@@ -348,6 +349,7 @@ READABLES="\
aeslanier \
ampro \
amiga \
apple2 \
atarist \
brother \
c64 \

View File

@@ -1,26 +0,0 @@
#include "globals.h"
#include "flags.h"
#include "reader.h"
#include "fluxmap.h"
#include "decoders/decoders.h"
#include "apple2/apple2.h"
#include "sector.h"
#include "sectorset.h"
#include "record.h"
#include "fmt/format.h"
#include <fstream>
static FlagGroup flags { &readerFlags };
int mainReadApple2(int argc, const char* argv[])
{
setReaderDefaultSource(":t=0-79:s=0");
setReaderDefaultOutput("apple2.adf");
setReaderRevolutions(2);
flags.parseFlags(argc, argv);
Apple2Decoder decoder;
readDiskCommand(decoder);
return 0;
}

View File

@@ -0,0 +1,27 @@
input {
disk {
drive {}
}
}
output {
file {
filename: "apple2.img"
img {}
}
}
decoder {
apple2 {}
}
cylinders {
start: 0
end: 79
}
heads {
start: 0
end: 0
}