mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
Rename cylinder to track throughout (mostly).
This commit is contained in:
@@ -14,10 +14,10 @@ struct CwfHeader
|
||||
uint8_t version; // version of this file
|
||||
uint8_t clock_rate; // clock rate used: 0, 1, 2 (2 = 28MHz)
|
||||
uint8_t drive_type; // type of drive
|
||||
uint8_t cylinders; // number of cylinders
|
||||
uint8_t tracks; // number of tracks
|
||||
uint8_t sides; // number of sides
|
||||
uint8_t index_mark; // nonzero if index marks are included
|
||||
uint8_t step; // cylinder stepping interval
|
||||
uint8_t step; // track stepping interval
|
||||
uint8_t filler[15]; // reserved for expansion
|
||||
uint8_t comment[100]; // brief comment
|
||||
};
|
||||
@@ -58,11 +58,11 @@ public:
|
||||
Error() << "unsupported clock rate";
|
||||
}
|
||||
|
||||
std::cout << fmt::format("CWF {}x{} = {} cylinders, {} sides\n",
|
||||
_header.cylinders, _header.step, _header.cylinders*_header.step, _header.sides);
|
||||
std::cout << fmt::format("CWF {}x{} = {} tracks, {} sides\n",
|
||||
_header.tracks, _header.step, _header.tracks*_header.step, _header.sides);
|
||||
std::cout << fmt::format("CWF sample clock rate: {} MHz\n", _clockRate / 1e6);
|
||||
|
||||
int tracks = _header.cylinders*_header.sides;
|
||||
int tracks = _header.tracks*_header.sides;
|
||||
for (int i=0; i<tracks; i++)
|
||||
{
|
||||
CwfTrack trackheader;
|
||||
|
||||
@@ -62,12 +62,12 @@ public:
|
||||
}
|
||||
|
||||
public:
|
||||
std::unique_ptr<FluxSourceIterator> readFlux(int cylinder, int head) override
|
||||
std::unique_ptr<FluxSourceIterator> readFlux(int track, int head) override
|
||||
{
|
||||
for (const auto& track : _proto.track())
|
||||
for (const auto& trackFlux : _proto.track())
|
||||
{
|
||||
if ((track.cylinder() == cylinder) && (track.head() == head))
|
||||
return std::make_unique<Fl2FluxSourceIterator>(track);
|
||||
if ((trackFlux.track() == track) && (trackFlux.head() == head))
|
||||
return std::make_unique<Fl2FluxSourceIterator>(trackFlux);
|
||||
}
|
||||
|
||||
return std::make_unique<EmptyFluxSourceIterator>();
|
||||
|
||||
@@ -76,9 +76,9 @@ void FluxSource::updateConfigForFilename(FluxSourceProto* proto, const std::stri
|
||||
class TrivialFluxSourceIterator : public FluxSourceIterator
|
||||
{
|
||||
public:
|
||||
TrivialFluxSourceIterator(TrivialFluxSource* fluxSource, int cylinder, int head):
|
||||
TrivialFluxSourceIterator(TrivialFluxSource* fluxSource, int track, int head):
|
||||
_fluxSource(fluxSource),
|
||||
_cylinder(cylinder),
|
||||
_track(track),
|
||||
_head(head)
|
||||
{}
|
||||
|
||||
@@ -89,20 +89,20 @@ public:
|
||||
|
||||
std::unique_ptr<const Fluxmap> next() override
|
||||
{
|
||||
auto fluxmap = _fluxSource->readSingleFlux(_cylinder, _head);
|
||||
auto fluxmap = _fluxSource->readSingleFlux(_track, _head);
|
||||
_fluxSource = nullptr;
|
||||
return fluxmap;
|
||||
}
|
||||
|
||||
private:
|
||||
TrivialFluxSource* _fluxSource;
|
||||
int _cylinder;
|
||||
int _track;
|
||||
int _head;
|
||||
};
|
||||
|
||||
std::unique_ptr<FluxSourceIterator> TrivialFluxSource::readFlux(int cylinder, int head)
|
||||
std::unique_ptr<FluxSourceIterator> TrivialFluxSource::readFlux(int track, int head)
|
||||
{
|
||||
return std::make_unique<TrivialFluxSourceIterator>(this, cylinder, head);
|
||||
return std::make_unique<TrivialFluxSourceIterator>(this, track, head);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -15,9 +15,9 @@ private:
|
||||
{
|
||||
public:
|
||||
HardwareFluxSourceIterator(
|
||||
const HardwareFluxSource& fluxsource, int cylinder, int head):
|
||||
const HardwareFluxSource& fluxsource, int track, int head):
|
||||
_fluxsource(fluxsource),
|
||||
_cylinder(cylinder),
|
||||
_track(track),
|
||||
_head(head)
|
||||
{
|
||||
}
|
||||
@@ -30,7 +30,7 @@ private:
|
||||
std::unique_ptr<const Fluxmap> next()
|
||||
{
|
||||
usbSetDrive(config.drive().drive(), config.drive().high_density(), config.drive().index_mode());
|
||||
usbSeek(_cylinder);
|
||||
usbSeek(_track);
|
||||
|
||||
Bytes data = usbRead(_head,
|
||||
config.drive().sync_with_index(),
|
||||
@@ -43,7 +43,7 @@ private:
|
||||
|
||||
private:
|
||||
const HardwareFluxSource& _fluxsource;
|
||||
int _cylinder;
|
||||
int _track;
|
||||
int _head;
|
||||
};
|
||||
|
||||
@@ -76,10 +76,10 @@ public:
|
||||
~HardwareFluxSource() {}
|
||||
|
||||
public:
|
||||
std::unique_ptr<FluxSourceIterator> readFlux(int cylinder, int head) override
|
||||
std::unique_ptr<FluxSourceIterator> readFlux(int track, int head) override
|
||||
{
|
||||
return std::make_unique<HardwareFluxSourceIterator>(
|
||||
*this, cylinder, head);
|
||||
*this, track, head);
|
||||
}
|
||||
|
||||
void recalibrate() override
|
||||
|
||||
Reference in New Issue
Block a user