mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
Convert the C64 decoder to the new configuration scheme. Also convert all the
imagewriters.
This commit is contained in:
@@ -7,10 +7,12 @@
|
|||||||
|
|
||||||
class Sector;
|
class Sector;
|
||||||
class Fluxmap;
|
class Fluxmap;
|
||||||
|
class Commodore64InputProto;
|
||||||
|
|
||||||
class Commodore64Decoder : public AbstractDecoder
|
class Commodore64Decoder : public AbstractDecoder
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
Commodore64Decoder(const Commodore64InputProto&) {}
|
||||||
virtual ~Commodore64Decoder() {}
|
virtual ~Commodore64Decoder() {}
|
||||||
|
|
||||||
RecordType advanceToNextRecord();
|
RecordType advanceToNextRecord();
|
||||||
|
|||||||
4
arch/c64/c64.proto
Normal file
4
arch/c64/c64.proto
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
syntax = "proto2";
|
||||||
|
|
||||||
|
message Commodore64InputProto {}
|
||||||
|
|
||||||
@@ -2,18 +2,12 @@ syntax = "proto2";
|
|||||||
|
|
||||||
import "lib/decoders/decoders.proto";
|
import "lib/decoders/decoders.proto";
|
||||||
import "lib/encoders/encoders.proto";
|
import "lib/encoders/encoders.proto";
|
||||||
import "lib/imagereader/img.proto";
|
import "lib/imagereader/imagereader.proto";
|
||||||
|
import "lib/imagewriter/imagewriter.proto";
|
||||||
import "lib/fluxsource/fluxsource.proto";
|
import "lib/fluxsource/fluxsource.proto";
|
||||||
import "lib/usb/usb.proto";
|
import "lib/usb/usb.proto";
|
||||||
import "lib/common.proto";
|
import "lib/common.proto";
|
||||||
|
|
||||||
message InputFileProto {
|
|
||||||
optional string filename = 1;
|
|
||||||
oneof format {
|
|
||||||
ImgInputOutputProto img = 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
message InputDiskProto {
|
message InputDiskProto {
|
||||||
oneof source {
|
oneof source {
|
||||||
string fluxfile = 1;
|
string fluxfile = 1;
|
||||||
@@ -22,13 +16,6 @@ message InputDiskProto {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
message OutputFileProto {
|
|
||||||
optional string filename = 1;
|
|
||||||
oneof format {
|
|
||||||
ImgInputOutputProto img = 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
message OutputDiskProto {
|
message OutputDiskProto {
|
||||||
oneof dest {
|
oneof dest {
|
||||||
string fluxfile = 1;
|
string fluxfile = 1;
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
#include "arch/aeslanier/aeslanier.h"
|
#include "arch/aeslanier/aeslanier.h"
|
||||||
#include "arch/amiga/amiga.h"
|
#include "arch/amiga/amiga.h"
|
||||||
#include "arch/brother/brother.h"
|
#include "arch/brother/brother.h"
|
||||||
|
#include "arch/c64/c64.h"
|
||||||
#include "arch/ibm/ibm.h"
|
#include "arch/ibm/ibm.h"
|
||||||
#include "decoders/fluxmapreader.h"
|
#include "decoders/fluxmapreader.h"
|
||||||
#include "record.h"
|
#include "record.h"
|
||||||
@@ -30,6 +31,9 @@ std::unique_ptr<AbstractDecoder> AbstractDecoder::create(const DecoderProto& con
|
|||||||
case DecoderProto::kBrother:
|
case DecoderProto::kBrother:
|
||||||
return std::unique_ptr<AbstractDecoder>(new BrotherDecoder(config.brother()));
|
return std::unique_ptr<AbstractDecoder>(new BrotherDecoder(config.brother()));
|
||||||
|
|
||||||
|
case DecoderProto::kC64:
|
||||||
|
return std::unique_ptr<AbstractDecoder>(new Commodore64Decoder(config.c64()));
|
||||||
|
|
||||||
case DecoderProto::kIbm:
|
case DecoderProto::kIbm:
|
||||||
return std::unique_ptr<AbstractDecoder>(new IbmDecoder(config.ibm()));
|
return std::unique_ptr<AbstractDecoder>(new IbmDecoder(config.ibm()));
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ syntax = "proto2";
|
|||||||
import "arch/aeslanier/aeslanier.proto";
|
import "arch/aeslanier/aeslanier.proto";
|
||||||
import "arch/amiga/amiga.proto";
|
import "arch/amiga/amiga.proto";
|
||||||
import "arch/brother/brother.proto";
|
import "arch/brother/brother.proto";
|
||||||
|
import "arch/c64/c64.proto";
|
||||||
import "arch/ibm/ibm.proto";
|
import "arch/ibm/ibm.proto";
|
||||||
|
|
||||||
message DecoderProto {
|
message DecoderProto {
|
||||||
@@ -16,6 +17,7 @@ message DecoderProto {
|
|||||||
BrotherInputProto brother = 6;
|
BrotherInputProto brother = 6;
|
||||||
AesLanierInputProto aeslanier = 7;
|
AesLanierInputProto aeslanier = 7;
|
||||||
AmigaInputProto amiga = 8;
|
AmigaInputProto amiga = 8;
|
||||||
|
Commodore64InputProto c64 = 9;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,3 +14,10 @@ message ImgInputOutputProto {
|
|||||||
optional int32 sides = 6 [default=2];
|
optional int32 sides = 6 [default=2];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message InputFileProto {
|
||||||
|
optional string filename = 1;
|
||||||
|
oneof format {
|
||||||
|
ImgInputOutputProto img = 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -25,10 +25,22 @@ std::map<std::string, ImageWriter::Constructor> ImageWriter::formats =
|
|||||||
|
|
||||||
std::unique_ptr<ImageWriter> ImageWriter::create(const OutputFileProto& config)
|
std::unique_ptr<ImageWriter> ImageWriter::create(const OutputFileProto& config)
|
||||||
{
|
{
|
||||||
if (config.has_img())
|
switch (config.format_case())
|
||||||
return ImageWriter::createImgImageWriter(config);
|
{
|
||||||
else
|
case OutputFileProto::kImg:
|
||||||
Error() << "bad output image config";
|
return ImageWriter::createImgImageWriter(config);
|
||||||
|
|
||||||
|
case OutputFileProto::kD64:
|
||||||
|
return ImageWriter::createD64ImageWriter(config);
|
||||||
|
|
||||||
|
case OutputFileProto::kLdbs:
|
||||||
|
return ImageWriter::createLDBSImageWriter(config);
|
||||||
|
|
||||||
|
case OutputFileProto::kDiskcopy:
|
||||||
|
return ImageWriter::createDiskCopyImageWriter(config);
|
||||||
|
}
|
||||||
|
Error() << "bad output image config";
|
||||||
|
return std::unique_ptr<ImageWriter>();
|
||||||
}
|
}
|
||||||
|
|
||||||
//void ImageWriter::verifyImageSpec(const ImageSpec& spec)
|
//void ImageWriter::verifyImageSpec(const ImageSpec& spec)
|
||||||
|
|||||||
18
lib/imagewriter/imagewriter.proto
Normal file
18
lib/imagewriter/imagewriter.proto
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
syntax = "proto2";
|
||||||
|
|
||||||
|
import "lib/imagereader/imagereader.proto";
|
||||||
|
|
||||||
|
message D64OutputProto {}
|
||||||
|
message LDBSOutputProto {}
|
||||||
|
message DiskCopyOutputProto {}
|
||||||
|
|
||||||
|
message OutputFileProto {
|
||||||
|
optional string filename = 1;
|
||||||
|
oneof format {
|
||||||
|
ImgInputOutputProto img = 2;
|
||||||
|
D64OutputProto d64 = 3;
|
||||||
|
LDBSOutputProto ldbs = 4;
|
||||||
|
DiskCopyOutputProto diskcopy = 5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -252,13 +252,15 @@ buildproto libproto.a \
|
|||||||
arch/amiga/amiga.proto \
|
arch/amiga/amiga.proto \
|
||||||
arch/aeslanier/aeslanier.proto \
|
arch/aeslanier/aeslanier.proto \
|
||||||
arch/brother/brother.proto \
|
arch/brother/brother.proto \
|
||||||
|
arch/c64/c64.proto \
|
||||||
arch/ibm/ibm.proto \
|
arch/ibm/ibm.proto \
|
||||||
lib/common.proto \
|
lib/common.proto \
|
||||||
lib/config.proto \
|
lib/config.proto \
|
||||||
lib/decoders/decoders.proto \
|
lib/decoders/decoders.proto \
|
||||||
lib/encoders/encoders.proto \
|
lib/encoders/encoders.proto \
|
||||||
lib/fluxsource/fluxsource.proto \
|
lib/fluxsource/fluxsource.proto \
|
||||||
lib/imagereader/img.proto \
|
lib/imagereader/imagereader.proto \
|
||||||
|
lib/imagewriter/imagewriter.proto \
|
||||||
lib/usb/usb.proto \
|
lib/usb/usb.proto \
|
||||||
|
|
||||||
buildlibrary libbackend.a \
|
buildlibrary libbackend.a \
|
||||||
@@ -334,6 +336,7 @@ READABLES="\
|
|||||||
acornadfs \
|
acornadfs \
|
||||||
acorndfs \
|
acorndfs \
|
||||||
brother \
|
brother \
|
||||||
|
c64 \
|
||||||
ibm \
|
ibm \
|
||||||
"
|
"
|
||||||
|
|
||||||
@@ -386,7 +389,6 @@ buildlibrary libfrontend.a \
|
|||||||
# src/fe-readampro.cc \
|
# src/fe-readampro.cc \
|
||||||
# src/fe-readapple2.cc \
|
# src/fe-readapple2.cc \
|
||||||
# src/fe-readatarist.cc \
|
# src/fe-readatarist.cc \
|
||||||
# src/fe-readc64.cc \
|
|
||||||
# src/fe-readf85.cc \
|
# src/fe-readf85.cc \
|
||||||
# src/fe-readfb100.cc \
|
# src/fe-readfb100.cc \
|
||||||
# src/fe-readibm.cc \
|
# src/fe-readibm.cc \
|
||||||
|
|||||||
@@ -1,27 +0,0 @@
|
|||||||
#include "globals.h"
|
|
||||||
#include "flags.h"
|
|
||||||
#include "reader.h"
|
|
||||||
#include "fluxmap.h"
|
|
||||||
#include "decoders/decoders.h"
|
|
||||||
#include "c64/c64.h"
|
|
||||||
#include "sector.h"
|
|
||||||
#include "sectorset.h"
|
|
||||||
#include "record.h"
|
|
||||||
#include "fmt/format.h"
|
|
||||||
#include <fstream>
|
|
||||||
|
|
||||||
static FlagGroup flags { &readerFlags };
|
|
||||||
|
|
||||||
int mainReadC64(int argc, const char* argv[])
|
|
||||||
{
|
|
||||||
setReaderDefaultSource(":t=0-79x2:s=0");
|
|
||||||
setReaderDefaultOutput("c64.d64");
|
|
||||||
setReaderRevolutions(2);
|
|
||||||
flags.parseFlags(argc, argv);
|
|
||||||
|
|
||||||
Commodore64Decoder decoder;
|
|
||||||
readDiskCommand(decoder);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
29
src/readables/c64.textpb
Normal file
29
src/readables/c64.textpb
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
input {
|
||||||
|
disk {
|
||||||
|
drive {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
output {
|
||||||
|
file {
|
||||||
|
filename: "c64.d64"
|
||||||
|
d64 {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
decoder {
|
||||||
|
c64 {}
|
||||||
|
}
|
||||||
|
|
||||||
|
cylinders {
|
||||||
|
start: 0
|
||||||
|
end: 79
|
||||||
|
step: 2
|
||||||
|
}
|
||||||
|
|
||||||
|
heads {
|
||||||
|
start: 0
|
||||||
|
end: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user