mirror of
https://github.com/dmolony/DiskBrowser.git
synced 2024-12-24 08:29:20 +00:00
allow cpm.sys in directory
This commit is contained in:
parent
91b63158f1
commit
21e7f8f226
@ -56,27 +56,26 @@ public class CPMDisk extends AbstractFormattedDisk
|
||||
|
||||
for (int i = 0; i < buffer.length; i += 32)
|
||||
{
|
||||
if (buffer[i] != 0 && buffer[i] != (byte) 0xE5)
|
||||
int val = buffer[i] & 0xFF;
|
||||
if (val == 0xE5)
|
||||
break;
|
||||
if (buffer[i] == 0)
|
||||
{
|
||||
DirectoryEntry entry = new DirectoryEntry (this, buffer, i);
|
||||
SectorType sectorType = getSectorType (entry.getType ());
|
||||
for (DiskAddress block : entry.getSectors ())
|
||||
if (!disk.isSectorEmpty (block))
|
||||
sectorTypes[block.getBlock ()] = sectorType;
|
||||
|
||||
DirectoryEntry parent = findParent (entry);
|
||||
if (parent == null)
|
||||
{
|
||||
fileEntries.add (entry);
|
||||
DefaultMutableTreeNode node = new DefaultMutableTreeNode (entry);
|
||||
root.add (node);
|
||||
node.setAllowsChildren (false);
|
||||
}
|
||||
else
|
||||
parent.add (entry);
|
||||
DirectoryEntry entry = new DirectoryEntry (this, buffer, i);
|
||||
SectorType sectorType = getSectorType (entry.getType ());
|
||||
for (DiskAddress block : entry.getSectors ())
|
||||
if (!disk.isSectorEmpty (block))
|
||||
sectorTypes[block.getBlock ()] = sectorType;
|
||||
|
||||
DirectoryEntry parent = findParent (entry);
|
||||
if (parent == null)
|
||||
{
|
||||
fileEntries.add (entry);
|
||||
DefaultMutableTreeNode node = new DefaultMutableTreeNode (entry);
|
||||
root.add (node);
|
||||
node.setAllowsChildren (false);
|
||||
}
|
||||
else
|
||||
parent.add (entry);
|
||||
}
|
||||
}
|
||||
|
||||
@ -175,6 +174,13 @@ public class CPMDisk extends AbstractFormattedDisk
|
||||
return true;
|
||||
if (val > 31)
|
||||
return false;
|
||||
for (int j = 1; j <= 8; j++)
|
||||
{
|
||||
val = buffer[i + j] & 0xFF;
|
||||
// System.out.printf ("%3d %s%n", val, (char) val);
|
||||
if (val < 32 || val > 126)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -64,12 +64,15 @@ public class DirectoryEntry implements AppleFileSource
|
||||
if (b == 0)
|
||||
break;
|
||||
|
||||
int blockNumber = b * 4 + 48;
|
||||
int blockNumber;
|
||||
|
||||
if ((b & 0x80) == 0)
|
||||
blockNumber = (b * 4 + 48);
|
||||
else
|
||||
blockNumber = (b & 0x7F) * 4;
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
AppleDiskAddress da = new AppleDiskAddress (blockNumber + i, disk);
|
||||
blocks.add (da);
|
||||
}
|
||||
blocks.add (new AppleDiskAddress (blockNumber + i, disk));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user