Skip to content

Commit

Permalink
Revert unintentional changes
Browse files Browse the repository at this point in the history
  • Loading branch information
uweseimet committed Oct 26, 2024
1 parent d239b81 commit c15d7f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
18 changes: 3 additions & 15 deletions cpp/devices/tape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,23 +342,11 @@ void Tape::AddDeviceConfigurationPage(map<int, vector<byte>> &pages, bool change

void Tape::AddMediumPartitionPage(map<int, vector<byte> > &pages, bool changeable) const
{
vector<byte> buf(10);
vector<byte> buf(8);

if (!changeable) {
// Maximum additional partitions
buf[2] = (byte)1;

// PSUM (descriptor unit in MB)
buf[4] = (byte)0b00010000;

// Logical unit is capable of format and partition recognition
buf[5] = (byte)0x03;

// Approximate partition size in MB
if (IsReady()) {
const auto capacity = static_cast<uint32_t>(GetFileSize()) / 1048576;
SetInt16(buf, 8, capacity > 0 ? capacity : 1);
}
// Fixed data partitions, PSUM (descriptor unit in MB)
buf[4] = (byte)0b10010000;
}

pages[17] = buf;
Expand Down
2 changes: 1 addition & 1 deletion cpp/test/tape_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ static void ValidateModePages(map<int, vector<byte>> &pages)
EXPECT_EQ(8U, pages[10].size());
EXPECT_EQ(14U, pages[15].size());
EXPECT_EQ(16U, pages[16].size());
EXPECT_EQ(10U, pages[17].size());
EXPECT_EQ(8U, pages[17].size());
}

static void CheckPosition(AbstractController &controller, PrimaryDevice &tape, uint32_t position)
Expand Down

0 comments on commit c15d7f5

Please sign in to comment.