mirror of
https://github.com/dmolony/DiskBrowser.git
synced 2025-02-27 19:29:01 +00:00
tweaks
This commit is contained in:
parent
4c42a5c26d
commit
2655db4da8
@ -567,7 +567,8 @@ public class DiskFactory
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
System.out.println (e);
|
e.printStackTrace ();
|
||||||
|
// System.out.println (e);
|
||||||
}
|
}
|
||||||
if (debug)
|
if (debug)
|
||||||
System.out.println ("Not a Prodos 2mg disk");
|
System.out.println ("Not a Prodos 2mg disk");
|
||||||
|
@ -44,7 +44,7 @@ public class DisksWindow extends JFrame
|
|||||||
|
|
||||||
public DisksWindow (RootFolderData rootFolderData)
|
public DisksWindow (RootFolderData rootFolderData)
|
||||||
{
|
{
|
||||||
super ("Disk List - " + rootFolderData.getRootFolder ().getAbsolutePath ());
|
super (rootFolderData.getRootFolderPathText ());
|
||||||
this.rootFolderData = rootFolderData;
|
this.rootFolderData = rootFolderData;
|
||||||
|
|
||||||
table = new JTable ();
|
table = new JTable ();
|
||||||
|
@ -132,6 +132,15 @@ public class RootFolderData
|
|||||||
disksWindow = null; // force a recount
|
disksWindow = null; // force a recount
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String getRootFolderPathText ()
|
||||||
|
{
|
||||||
|
String text = rootFolder.getAbsolutePath ();
|
||||||
|
String homeDir = System.getProperty ("user.home");
|
||||||
|
if (text.startsWith (homeDir))
|
||||||
|
text = text.replace (homeDir, "~");
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
|
||||||
private void clear ()
|
private void clear ()
|
||||||
{
|
{
|
||||||
typeTotals = new int[4][Utility.suffixes.size ()];
|
typeTotals = new int[4][Utility.suffixes.size ()];
|
||||||
|
@ -32,15 +32,11 @@ class FileEntry extends CatalogEntry implements ProdosConstants
|
|||||||
private boolean invalid;
|
private boolean invalid;
|
||||||
private FileEntry link;
|
private FileEntry link;
|
||||||
|
|
||||||
// private final Disk appleDisk;
|
|
||||||
|
|
||||||
public FileEntry (ProdosDisk fDisk, byte[] entryBuffer, DirectoryHeader parent,
|
public FileEntry (ProdosDisk fDisk, byte[] entryBuffer, DirectoryHeader parent,
|
||||||
int parentBlock)
|
int parentBlock)
|
||||||
{
|
{
|
||||||
super (fDisk, entryBuffer);
|
super (fDisk, entryBuffer);
|
||||||
|
|
||||||
// appleDisk = fDisk.getDisk ();
|
|
||||||
|
|
||||||
assert parent != null;
|
assert parent != null;
|
||||||
this.parentDirectory = parent;
|
this.parentDirectory = parent;
|
||||||
this.catalogBlock = this.disk.getDiskAddress (parentBlock);
|
this.catalogBlock = this.disk.getDiskAddress (parentBlock);
|
||||||
@ -61,17 +57,11 @@ class FileEntry extends CatalogEntry implements ProdosConstants
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case SAPLING:
|
case SAPLING:
|
||||||
// if (isGSOSFile ()) // not sure why this exists
|
|
||||||
// traverseGEOSIndex (keyPtr);
|
|
||||||
// else
|
|
||||||
addDataBlocks (storageType, keyPtr);
|
addDataBlocks (storageType, keyPtr);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TREE:
|
case TREE:
|
||||||
masterIndexBlock = disk.getDiskAddress (keyPtr);
|
masterIndexBlock = disk.getDiskAddress (keyPtr);
|
||||||
// if (isGSOSFile ()) // not sure why this exists
|
|
||||||
// traverseGEOSMasterIndex (keyPtr);
|
|
||||||
// else
|
|
||||||
addDataBlocks (storageType, keyPtr);
|
addDataBlocks (storageType, keyPtr);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -203,49 +193,6 @@ class FileEntry extends CatalogEntry implements ProdosConstants
|
|||||||
return blocks;
|
return blocks;
|
||||||
}
|
}
|
||||||
|
|
||||||
// should be removed
|
|
||||||
// private boolean isGSOSFile ()
|
|
||||||
// {
|
|
||||||
// // return ((fileType & 0xF0) == 0x80);
|
|
||||||
// if ((fileType & 0xF0) == 0x80)
|
|
||||||
// System.out.println ("GS/OS file: " + name);
|
|
||||||
// return false;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// should be removed
|
|
||||||
// private void traverseGEOSMasterIndex (int keyPtr)
|
|
||||||
// {
|
|
||||||
// byte[] buffer = disk.readSector (keyPtr); // master index
|
|
||||||
// for (int i = 0; i < 0x80; i++)
|
|
||||||
// {
|
|
||||||
// int block = HexFormatter.intValue (buffer[i], buffer[i + 256]);
|
|
||||||
// if (block == 0)
|
|
||||||
// break;
|
|
||||||
// if (block == 0xFFFF)
|
|
||||||
// continue;
|
|
||||||
// traverseGEOSIndex (block);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// should be removed
|
|
||||||
// private void traverseGEOSIndex (int keyPtr)
|
|
||||||
// {
|
|
||||||
// parentDisk.setSectorType (keyPtr, parentDisk.indexSector);
|
|
||||||
// indexBlocks.add (disk.getDiskAddress (keyPtr));
|
|
||||||
// byte[] buffer = disk.readSector (keyPtr);
|
|
||||||
//
|
|
||||||
// for (int i = 0; i < 0x80; i++)
|
|
||||||
// {
|
|
||||||
// int block = HexFormatter.intValue (buffer[i], buffer[i + 256]);
|
|
||||||
// if (block == 0)
|
|
||||||
// break;
|
|
||||||
// if (block == 0xFFFF)
|
|
||||||
// continue;
|
|
||||||
// parentDisk.setSectorType (block, parentDisk.dataSector);
|
|
||||||
// dataBlocks.add (disk.getDiskAddress (block));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DataSource getDataSource ()
|
public DataSource getDataSource ()
|
||||||
{
|
{
|
||||||
|
@ -40,7 +40,8 @@ class VolumeDirectoryHeader extends DirectoryHeader
|
|||||||
} while (block > 0);
|
} while (block > 0);
|
||||||
|
|
||||||
// convert the Free Sector Table
|
// convert the Free Sector Table
|
||||||
int bitMapBytes = totalBlocks / 8; // one bit per block
|
// int bitMapBytes = totalBlocks / 8; // one bit per block
|
||||||
|
int bitMapBytes = (totalBlocks - 1) / 8 + 1; // one bit per block
|
||||||
byte[] buffer = new byte[bitMapBytes];
|
byte[] buffer = new byte[bitMapBytes];
|
||||||
int bitMapBlocks = (bitMapBytes - 1) / disk.getSectorsPerTrack () + 1;
|
int bitMapBlocks = (bitMapBytes - 1) / disk.getSectorsPerTrack () + 1;
|
||||||
int lastBitMapBlock = bitMapBlock + bitMapBlocks - 1;
|
int lastBitMapBlock = bitMapBlock + bitMapBlocks - 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user