mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
add writing IMD images functionality
This commit is contained in:
@@ -36,6 +36,7 @@ LIBFLUXENGINE_SRCS = \
|
||||
lib/imagewriter/diskcopyimagewriter.cc \
|
||||
lib/imagewriter/imagewriter.cc \
|
||||
lib/imagewriter/imgimagewriter.cc \
|
||||
lib/imagewriter/imdimagewriter.cc \
|
||||
lib/imagewriter/ldbsimagewriter.cc \
|
||||
lib/imagewriter/nsiimagewriter.cc \
|
||||
lib/imagewriter/rawimagewriter.cc \
|
||||
|
||||
@@ -198,10 +198,16 @@ public:
|
||||
}
|
||||
//read sector numbering map
|
||||
sector_skew.clear();
|
||||
bool blnBase0 = false; //check what first start number of the sector is. Fluxengine expects 1.
|
||||
for (b = 0; b < header.numSectors; b++)
|
||||
{
|
||||
uint8_t t;
|
||||
t = br.read_8();
|
||||
if (t == 0x00) blnBase0 = true;
|
||||
if (blnBase0)
|
||||
{
|
||||
t=t+1;
|
||||
}
|
||||
sector_skew.push_back(t);
|
||||
headerPtr++;
|
||||
}
|
||||
|
||||
@@ -35,6 +35,9 @@ std::unique_ptr<ImageWriter> ImageWriter::create(const ImageWriterProto& config)
|
||||
case ImageWriterProto::kD88:
|
||||
return ImageWriter::createD88ImageWriter(config);
|
||||
|
||||
case ImageWriterProto::kImd:
|
||||
return ImageWriter::createImdImageWriter(config);
|
||||
|
||||
default:
|
||||
Error() << "bad output image config";
|
||||
return std::unique_ptr<ImageWriter>();
|
||||
@@ -52,6 +55,7 @@ void ImageWriter::updateConfigForFilename(ImageWriterProto* proto, const std::st
|
||||
{".diskcopy", [](auto* proto) { proto->mutable_diskcopy(); }},
|
||||
{".dsk", [](auto* proto) { proto->mutable_img(); }},
|
||||
{".img", [](auto* proto) { proto->mutable_img(); }},
|
||||
{".imd", [](auto* proto) { proto->mutable_imd(); }},
|
||||
{".ldbs", [](auto* proto) { proto->mutable_ldbs(); }},
|
||||
{".nsi", [](auto* proto) { proto->mutable_nsi(); }},
|
||||
{".raw", [](auto* proto) { proto->mutable_raw(); }},
|
||||
|
||||
@@ -21,6 +21,7 @@ public:
|
||||
static std::unique_ptr<ImageWriter> createNsiImageWriter(const ImageWriterProto& config);
|
||||
static std::unique_ptr<ImageWriter> createRawImageWriter(const ImageWriterProto& config);
|
||||
static std::unique_ptr<ImageWriter> createD88ImageWriter(const ImageWriterProto& config);
|
||||
static std::unique_ptr<ImageWriter> createImdImageWriter(const ImageWriterProto& config);
|
||||
|
||||
public:
|
||||
void printMap(const Image& sectors);
|
||||
|
||||
@@ -31,6 +31,7 @@ message DiskCopyOutputProto {}
|
||||
message NsiOutputProto {}
|
||||
message RawOutputProto {}
|
||||
message D88OutputProto {}
|
||||
message ImdOutputProto {}
|
||||
|
||||
message ImageWriterProto {
|
||||
optional string filename = 1 [(help) = "filename of output sector image"];
|
||||
@@ -42,6 +43,7 @@ message ImageWriterProto {
|
||||
NsiOutputProto nsi = 6;
|
||||
RawOutputProto raw = 7;
|
||||
D88OutputProto d88 = 8;
|
||||
ImdOutputProto imd = 9;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user