This commit is contained in:
Denis Molony 2017-04-02 18:03:37 +10:00
parent 918af9a110
commit 5a7383183a
2 changed files with 10 additions and 7 deletions

View File

@ -294,7 +294,9 @@ public abstract class AbstractFormattedDisk implements FormattedDisk
{
if (block >= sectorTypes.length)
System.out.println ("Invalid block number: " + block);
else if (sectorTypes[block] != emptySector)
else if (sectorTypes[block] == emptySector)
System.out.printf ("Tried to assign %s to empty block %d%n", type.name, block);
else
sectorTypes[block] = type;
}

View File

@ -55,15 +55,16 @@ class DosVTOCSector extends AbstractSector
addTextAndDecimal (text, buffer, 53, 1, "Maximum sectors");
addTextAndDecimal (text, buffer, 54, 2, "Bytes per sector");
for (int i = 56; i <= 0xc3; i += 4)
boolean bootSectorEmpty = parentDisk.getDisk ().isSectorEmpty (0);
for (int i = 56; i <= 0xC3; i += 4)
{
String extra;
if (i <= 64)
extra = "(DOS)";
String extra = "";
if (i == 56 && bootSectorEmpty)
extra = "(unusable)";
else if (i <= 64 && !bootSectorEmpty)
extra = "(reserved for DOS)";
else if (i == 124)
extra = "(VTOC and Catalog)";
else
extra = "";
addText (text, buffer, i, 4, String.format ("Track %02X %s %s", (i - 56) / 4,
getBitmap (buffer[i], buffer[i + 1]), extra));
}