Eliminate the broken tpi system for a simple drive/format type field.

This commit is contained in:
David Given
2023-10-29 21:10:14 +01:00
parent ff1fb761f2
commit 533b217c8f
86 changed files with 1831 additions and 798 deletions

View File

@@ -214,7 +214,7 @@ private:
_directoryBlock = rbr.read_be32();
rbr.skip(4);
_directorySize = rbr.read_be32();
rbr.skip(4);
rbr.skip(4);
unsigned tracks = rbr.read_be32();
unsigned heads = rbr.read_be32();
unsigned sectors = rbr.read_be32();

View File

@@ -69,10 +69,10 @@ private:
void putBlock(RolandFsFilesystem* fs, uint8_t offset, uint8_t block)
{
if (blocks.size() <= offset)
blocks.resize(offset+1);
blocks.resize(offset + 1);
blocks[offset] = block;
length = (offset+1) * fs->_blockSectors * fs->_sectorSize;
length = (offset + 1) * fs->_blockSectors * fs->_sectorSize;
attributes[Filesystem::LENGTH] = std::to_string(length);
}
@@ -84,7 +84,7 @@ private:
if (!blocknumber)
break;
putBlock(fs, offset+i, blocknumber);
putBlock(fs, offset + i, blocknumber);
}
}
@@ -336,7 +336,7 @@ private:
else
de = it->second;
de->putBlocks(this, extent*16, direntBytes);
de->putBlocks(this, extent * 16, direntBytes);
}
}

View File

@@ -12,7 +12,7 @@ class Encoder;
class SectorInterface
{
public:
virtual ~SectorInterface() {}
virtual ~SectorInterface() {}
public:
virtual std::shared_ptr<const Sector> get(

View File

@@ -281,9 +281,10 @@ Bytes Filesystem::getSector(unsigned track, unsigned side, unsigned sector)
Bytes Filesystem::getLogicalSector(uint32_t number, uint32_t count)
{
if ((number + count) > _locations.size())
throw BadFilesystemException(
fmt::format("invalid filesystem: sector {} is out of bounds ({} maximum)",
number + count - 1, _locations.size()));
throw BadFilesystemException(fmt::format(
"invalid filesystem: sector {} is out of bounds ({} maximum)",
number + count - 1,
_locations.size()));
Bytes data;
ByteWriter bw(data);