mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
Automatically set the number of heads and cylinders where appropriate.
This commit is contained in:
@@ -165,6 +165,21 @@ public:
|
||||
const Geometry& geometry = image->getGeometry();
|
||||
std::cout << fmt::format("D88: read {} tracks, {} sides\n",
|
||||
geometry.numTracks, geometry.numSides);
|
||||
|
||||
if (!config.has_heads())
|
||||
{
|
||||
auto* heads = config.mutable_heads();
|
||||
heads->set_start(0);
|
||||
heads->set_end(geometry.numSides - 1);
|
||||
}
|
||||
|
||||
if (!config.has_cylinders())
|
||||
{
|
||||
auto* cylinders = config.mutable_cylinders();
|
||||
cylinders->set_start(0);
|
||||
cylinders->set_end(geometry.numTracks - 1);
|
||||
}
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
|
||||
@@ -136,6 +136,21 @@ public:
|
||||
std::cout << fmt::format("DIM: read {} tracks, {} sides, {} kB total\n",
|
||||
geometry.numTracks, geometry.numSides,
|
||||
((int)inputFile.tellg() - 256) / 1024);
|
||||
|
||||
if (!config.has_heads())
|
||||
{
|
||||
auto* heads = config.mutable_heads();
|
||||
heads->set_start(0);
|
||||
heads->set_end(geometry.numSides - 1);
|
||||
}
|
||||
|
||||
if (!config.has_cylinders())
|
||||
{
|
||||
auto* cylinders = config.mutable_cylinders();
|
||||
cylinders->set_start(0);
|
||||
cylinders->set_end(geometry.numTracks - 1);
|
||||
}
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
|
||||
@@ -109,6 +109,21 @@ public:
|
||||
std::cout << fmt::format("FDI: read {} tracks, {} sides, {} kB total\n",
|
||||
geometry.numTracks, geometry.numSides,
|
||||
((int)inputFile.tellg() - headerSize) / 1024);
|
||||
|
||||
if (!config.has_heads())
|
||||
{
|
||||
auto* heads = config.mutable_heads();
|
||||
heads->set_start(0);
|
||||
heads->set_end(geometry.numSides - 1);
|
||||
}
|
||||
|
||||
if (!config.has_cylinders())
|
||||
{
|
||||
auto* cylinders = config.mutable_cylinders();
|
||||
cylinders->set_start(0);
|
||||
cylinders->set_end(geometry.numTracks - 1);
|
||||
}
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user