mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
Change the global config variable to a globalConfig() function.
This commit is contained in:
@@ -56,27 +56,27 @@ public:
|
||||
inputFile.read((char*)trackTable.begin(), trackTable.size());
|
||||
ByteReader trackTableReader(trackTable);
|
||||
|
||||
if (config.encoder().format_case() !=
|
||||
if (globalConfig().encoder().format_case() !=
|
||||
EncoderProto::FormatCase::FORMAT_NOT_SET)
|
||||
log("D88: overriding configured format");
|
||||
|
||||
auto ibm = config.mutable_encoder()->mutable_ibm();
|
||||
auto ibm = globalConfig().mutable_encoder()->mutable_ibm();
|
||||
int clockRate = 500;
|
||||
if (mediaFlag == 0x20)
|
||||
{
|
||||
log("D88: forcing high density mode");
|
||||
config.mutable_drive()->set_high_density(true);
|
||||
config.mutable_layout()->set_tpi(96);
|
||||
globalConfig().mutable_drive()->set_high_density(true);
|
||||
globalConfig().mutable_layout()->set_tpi(96);
|
||||
}
|
||||
else
|
||||
{
|
||||
log("D88: forcing single/double density mode");
|
||||
clockRate = 300;
|
||||
config.mutable_drive()->set_high_density(false);
|
||||
config.mutable_layout()->set_tpi(48);
|
||||
globalConfig().mutable_drive()->set_high_density(false);
|
||||
globalConfig().mutable_layout()->set_tpi(48);
|
||||
}
|
||||
|
||||
auto layout = config.mutable_layout();
|
||||
auto layout = globalConfig().mutable_layout();
|
||||
std::unique_ptr<Image> image(new Image);
|
||||
for (int track = 0; track < trackTableSize / 4; track++)
|
||||
{
|
||||
|
||||
@@ -91,11 +91,11 @@ public:
|
||||
trackCount++;
|
||||
}
|
||||
|
||||
auto layout = config.mutable_layout();
|
||||
if (config.encoder().format_case() ==
|
||||
auto layout = globalConfig().mutable_layout();
|
||||
if (globalConfig().encoder().format_case() ==
|
||||
EncoderProto::FormatCase::FORMAT_NOT_SET)
|
||||
{
|
||||
auto ibm = config.mutable_encoder()->mutable_ibm();
|
||||
auto ibm = globalConfig().mutable_encoder()->mutable_ibm();
|
||||
auto trackdata = ibm->add_trackdata();
|
||||
trackdata->set_target_clock_period_us(2);
|
||||
|
||||
@@ -134,7 +134,7 @@ public:
|
||||
break;
|
||||
}
|
||||
|
||||
config.mutable_decoder()->mutable_ibm();
|
||||
globalConfig().mutable_decoder()->mutable_ibm();
|
||||
}
|
||||
|
||||
image->calculateSize();
|
||||
|
||||
@@ -70,11 +70,11 @@ public:
|
||||
trackCount++;
|
||||
}
|
||||
|
||||
auto layout = config.mutable_layout();
|
||||
if (config.encoder().format_case() ==
|
||||
auto layout = globalConfig().mutable_layout();
|
||||
if (globalConfig().encoder().format_case() ==
|
||||
EncoderProto::FormatCase::FORMAT_NOT_SET)
|
||||
{
|
||||
auto ibm = config.mutable_encoder()->mutable_ibm();
|
||||
auto ibm = globalConfig().mutable_encoder()->mutable_ibm();
|
||||
auto trackdata = ibm->add_trackdata();
|
||||
trackdata->set_target_clock_period_us(2);
|
||||
|
||||
|
||||
@@ -157,7 +157,7 @@ public:
|
||||
TrackHeader header = {0, 0, 0, 0, 0};
|
||||
TrackHeader previousheader = {0, 0, 0, 0, 0};
|
||||
|
||||
auto layout = config.mutable_layout();
|
||||
auto layout = globalConfig().mutable_layout();
|
||||
|
||||
unsigned n = 0;
|
||||
unsigned headerPtr = 0;
|
||||
@@ -259,7 +259,7 @@ public:
|
||||
headerPtr++;
|
||||
}
|
||||
|
||||
auto ibm = config.mutable_encoder()->mutable_ibm();
|
||||
auto ibm = globalConfig().mutable_encoder()->mutable_ibm();
|
||||
auto trackdata = ibm->add_trackdata();
|
||||
|
||||
auto layoutdata = layout->add_layoutdata();
|
||||
@@ -443,7 +443,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
if (config.encoder().format_case() !=
|
||||
if (globalConfig().encoder().format_case() !=
|
||||
EncoderProto::FormatCase::FORMAT_NOT_SET)
|
||||
log("IMD: overriding configured format");
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ public:
|
||||
if (!inputFile.is_open())
|
||||
error("cannot open input file");
|
||||
|
||||
auto layout = config.layout();
|
||||
auto layout = globalConfig().layout();
|
||||
if (!layout.tracks() || !layout.sides())
|
||||
error(
|
||||
"IMG: bad configuration; did you remember to set the "
|
||||
|
||||
@@ -49,16 +49,16 @@ public:
|
||||
error("NFD: unsupported number of heads");
|
||||
}
|
||||
|
||||
if (config.encoder().format_case() !=
|
||||
if (globalConfig().encoder().format_case() !=
|
||||
EncoderProto::FormatCase::FORMAT_NOT_SET)
|
||||
log("NFD: overriding configured format");
|
||||
|
||||
auto ibm = config.mutable_encoder()->mutable_ibm();
|
||||
auto layout = config.mutable_layout();
|
||||
auto ibm = globalConfig().mutable_encoder()->mutable_ibm();
|
||||
auto layout = globalConfig().mutable_layout();
|
||||
log("NFD: HD 1.2MB mode");
|
||||
log("NFD: forcing hign density mode");
|
||||
config.mutable_drive()->set_high_density(true);
|
||||
config.mutable_layout()->set_tpi(96);
|
||||
globalConfig().mutable_drive()->set_high_density(true);
|
||||
globalConfig().mutable_layout()->set_tpi(96);
|
||||
|
||||
std::unique_ptr<Image> image(new Image);
|
||||
for (int track = 0; track < 163; track++)
|
||||
|
||||
Reference in New Issue
Block a user