Skip to content

Commit

Permalink
Add experimental support for libdsk 'altback' mode layouts.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgiven committed Nov 29, 2024
1 parent 0fcb207 commit cc169d4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/config/layout.proto
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ message LayoutProto
enum Order
{
UNDEFINED = 0;
CHS = 1;
HCS = 2;
CHS = 1; // sort by cylinder, then head, then sector -- libdsk 'alt'
HCS = 2; // sort by head, then cylinder, then sector -- libdsk 'outout'
HCS_RH1 = 3; // as HCS, except the cylinder count for head 1 is reversed -- libdsk 'outback'
}

message LayoutdataProto
Expand Down
14 changes: 14 additions & 0 deletions lib/data/layout.cc
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,20 @@ std::vector<std::pair<int, int>> Layout::getTrackOrdering(
break;
}

case LayoutProto::HCS_RH1:
{
for (int side = 0; side < sides; side++)
{
if (side == 0)
for (int track = 0; track < tracks; track++)
trackList.push_back(std::make_pair(track, side));
if (side == 1)
for (int track = tracks; track >= 0; track--)
trackList.push_back(std::make_pair(track - 1, side));
}
break;
}

default:
error("LAYOUT: invalid track trackList");
}
Expand Down

0 comments on commit cc169d4

Please sign in to comment.