mirror of
https://github.com/dmolony/DiskBrowser.git
synced 2024-12-24 23:31:31 +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)
|
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;
|
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);
|
DirectoryEntry entry = new DirectoryEntry (this, buffer, i);
|
||||||
if (parent == null)
|
SectorType sectorType = getSectorType (entry.getType ());
|
||||||
{
|
for (DiskAddress block : entry.getSectors ())
|
||||||
fileEntries.add (entry);
|
if (!disk.isSectorEmpty (block))
|
||||||
DefaultMutableTreeNode node = new DefaultMutableTreeNode (entry);
|
sectorTypes[block.getBlock ()] = sectorType;
|
||||||
root.add (node);
|
|
||||||
node.setAllowsChildren (false);
|
DirectoryEntry parent = findParent (entry);
|
||||||
}
|
if (parent == null)
|
||||||
else
|
{
|
||||||
parent.add (entry);
|
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;
|
return true;
|
||||||
if (val > 31)
|
if (val > 31)
|
||||||
return false;
|
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)
|
if (b == 0)
|
||||||
break;
|
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++)
|
for (int i = 0; i < 4; i++)
|
||||||
{
|
blocks.add (new AppleDiskAddress (blockNumber + i, disk));
|
||||||
AppleDiskAddress da = new AppleDiskAddress (blockNumber + i, disk);
|
|
||||||
blocks.add (da);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user