mirror of
https://github.com/dmolony/DiskBrowser.git
synced 2024-12-24 23:31:31 +00:00
tidying
This commit is contained in:
parent
7603a89c3a
commit
087ad914b4
@ -4,16 +4,16 @@ import com.bytezone.diskbrowser.utilities.HexFormatter;
|
|||||||
|
|
||||||
abstract class DirectoryHeader extends CatalogEntry
|
abstract class DirectoryHeader extends CatalogEntry
|
||||||
{
|
{
|
||||||
int entryLength;
|
final int entryLength;
|
||||||
int entriesPerBlock;
|
final int entriesPerBlock;
|
||||||
int fileCount;
|
final int fileCount;
|
||||||
|
|
||||||
public DirectoryHeader (ProdosDisk parentDisk, byte[] entryBuffer)
|
public DirectoryHeader (ProdosDisk parentDisk, byte[] entryBuffer)
|
||||||
{
|
{
|
||||||
super (parentDisk, entryBuffer);
|
super (parentDisk, entryBuffer);
|
||||||
|
|
||||||
entryLength = HexFormatter.intValue (entryBuffer[31]);
|
entryLength = HexFormatter.intValue (entryBuffer[31]);
|
||||||
entriesPerBlock = HexFormatter.intValue (entryBuffer[32]);
|
entriesPerBlock = HexFormatter.intValue (entryBuffer[32]);
|
||||||
fileCount = HexFormatter.intValue (entryBuffer[33], entryBuffer[34]);
|
fileCount = HexFormatter.intValue (entryBuffer[33], entryBuffer[34]);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -77,8 +77,8 @@ class FileEntry extends CatalogEntry implements ProdosConstants
|
|||||||
case TYPE_GSOS_EXTENDED_FILE:
|
case TYPE_GSOS_EXTENDED_FILE:
|
||||||
parentDisk.setSectorType (keyPtr, fDisk.extendedKeySector);
|
parentDisk.setSectorType (keyPtr, fDisk.extendedKeySector);
|
||||||
indexBlocks.add (disk.getDiskAddress (keyPtr));
|
indexBlocks.add (disk.getDiskAddress (keyPtr));
|
||||||
byte[] buffer2 = disk.readSector (keyPtr);
|
byte[] buffer2 = disk.readSector (keyPtr); // data fork and resource fork
|
||||||
// data fork and resource fork
|
|
||||||
for (int i = 0; i < 512; i += 256)
|
for (int i = 0; i < 512; i += 256)
|
||||||
{
|
{
|
||||||
int storageType = buffer2[i] & 0x0F;
|
int storageType = buffer2[i] & 0x0F;
|
||||||
@ -536,6 +536,7 @@ class FileEntry extends CatalogEntry implements ProdosConstants
|
|||||||
return sectors;
|
return sectors;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean contains (DiskAddress da)
|
public boolean contains (DiskAddress da)
|
||||||
{
|
{
|
||||||
if (da.equals (masterIndexBlock))
|
if (da.equals (masterIndexBlock))
|
||||||
|
@ -8,8 +8,8 @@ import com.bytezone.diskbrowser.disk.DiskAddress;
|
|||||||
|
|
||||||
class ProdosBitMapSector extends AbstractSector
|
class ProdosBitMapSector extends AbstractSector
|
||||||
{
|
{
|
||||||
DiskAddress da;
|
private final DiskAddress da;
|
||||||
ProdosDisk parent;
|
private final ProdosDisk parent;
|
||||||
|
|
||||||
ProdosBitMapSector (ProdosDisk parent, Disk disk, byte[] buffer, DiskAddress da)
|
ProdosBitMapSector (ProdosDisk parent, Disk disk, byte[] buffer, DiskAddress da)
|
||||||
{
|
{
|
||||||
@ -26,8 +26,6 @@ class ProdosBitMapSector extends AbstractSector
|
|||||||
// check range of bits for current block - so far I don't have a disk that needs
|
// check range of bits for current block - so far I don't have a disk that needs
|
||||||
// more than a single block
|
// more than a single block
|
||||||
int relativeBlock = da.getBlock () - parent.vdh.bitMapBlock;
|
int relativeBlock = da.getBlock () - parent.vdh.bitMapBlock;
|
||||||
// System.out.println ("rel " + relativeBlock);
|
|
||||||
// System.out.println ("width : " + grid.width);
|
|
||||||
int startBit = relativeBlock * 4096;
|
int startBit = relativeBlock * 4096;
|
||||||
int endBit = startBit + 4096;
|
int endBit = startBit + 4096;
|
||||||
if (startBit >= grid.width * grid.height)
|
if (startBit >= grid.width * grid.height)
|
||||||
@ -55,7 +53,7 @@ class ProdosBitMapSector extends AbstractSector
|
|||||||
int endRow = startRow + (512 / width);
|
int endRow = startRow + (512 / width);
|
||||||
int block = startBit;
|
int block = startBit;
|
||||||
int byteNo = 0;
|
int byteNo = 0;
|
||||||
// System.out.printf ("Start %d, end %d%n", startRow, endRow);
|
// System.out.printf ("Start %d, end %d%n", startRow, endRow);
|
||||||
for (int row = startRow; row < endRow; row++)
|
for (int row = startRow; row < endRow; row++)
|
||||||
{
|
{
|
||||||
StringBuilder details = new StringBuilder ();
|
StringBuilder details = new StringBuilder ();
|
||||||
|
@ -33,32 +33,31 @@ interface ProdosConstants
|
|||||||
int TYPE_SEEDLING = 1;
|
int TYPE_SEEDLING = 1;
|
||||||
int TYPE_FREE = 0;
|
int TYPE_FREE = 0;
|
||||||
|
|
||||||
String[] fileTypes = { "NON", "BAD", "PCD", "PTX", "TXT", "PDA", "BIN", "FNT", "FOT", "BA3",
|
String[] fileTypes =
|
||||||
"DA3", "WPF", "SOS", "$0D", "$0E", "DIR", "RPD", "RPI", "AFD", "AFM",
|
{ "NON", "BAD", "PCD", "PTX", "TXT", "PDA", "BIN", "FNT", "FOT", "BA3", "DA3",
|
||||||
"AFR", "SCL", "PFS", "$17", "$18", "ADB", "AWP", "ASP", "$1C", "$1D",
|
"WPF", "SOS", "$0D", "$0E", "DIR", "RPD", "RPI", "AFD", "AFM", "AFR", "SCL",
|
||||||
"$1E", "$1F", "TDM", "$21", "$22", "$23", "$24", "$25", "$26", "$27",
|
"PFS", "$17", "$18", "ADB", "AWP", "ASP", "$1C", "$1D", "$1E", "$1F", "TDM",
|
||||||
"$28", "$29", "8SC", "8OB", "8IC", "8LD", "P8C", "$2F", "$30", "$31",
|
"$21", "$22", "$23", "$24", "$25", "$26", "$27", "$28", "$29", "8SC", "8OB",
|
||||||
"$32", "$33", "$34", "$35", "$36", "$37", "$38", "$39", "$3A", "$3B",
|
"8IC", "8LD", "P8C", "$2F", "$30", "$31", "$32", "$33", "$34", "$35", "$36",
|
||||||
"$3C", "$3D", "$3E", "$3F", "DIC", "OCR", "FTD", "$43", "$44", "$45",
|
"$37", "$38", "$39", "$3A", "$3B", "$3C", "$3D", "$3E", "$3F", "DIC", "OCR",
|
||||||
"$46", "$47", "$48", "$49", "$4A", "$4B", "$4C", "$4D", "$4E", "$4F",
|
"FTD", "$43", "$44", "$45", "$46", "$47", "$48", "$49", "$4A", "$4B", "$4C",
|
||||||
"GWP", "GSS", "GDB", "DRW", "GDP", "HMD", "EDU", "STN", "HLP", "COM",
|
"$4D", "$4E", "$4F", "GWP", "GSS", "GDB", "DRW", "GDP", "HMD", "EDU", "STN",
|
||||||
"CFG", "ANM", "MUM", "ENT", "DVU", "FIN", "$60", "$61", "$62", "$63",
|
"HLP", "COM", "CFG", "ANM", "MUM", "ENT", "DVU", "FIN", "$60", "$61", "$62",
|
||||||
"$64", "$65", "$66", "$67", "$68", "$69", "$6A", "BIO", "$6C", "TDR",
|
"$63", "$64", "$65", "$66", "$67", "$68", "$69", "$6A", "BIO", "$6C", "TDR",
|
||||||
"PRE", "HDV", "$70", "$71", "$72", "$73", "$74", "$75", "$76", "$77",
|
"PRE", "HDV", "$70", "$71", "$72", "$73", "$74", "$75", "$76", "$77", "$78",
|
||||||
"$78", "$79", "$7A", "$7B", "$7C", "$7D", "$7E", "$7F", "GES", "GEA",
|
"$79", "$7A", "$7B", "$7C", "$7D", "$7E", "$7F", "GES", "GEA", "GEO", "GED",
|
||||||
"GEO", "GED", "GEF", "GEP", "GEI", "GEX", "$88", "GEV", "$8A", "GEC",
|
"GEF", "GEP", "GEI", "GEX", "$88", "GEV", "$8A", "GEC", "GEK", "GEW", "$8E",
|
||||||
"GEK", "GEW", "$8E", "$8F", "$90", "$91", "$92", "$93", "$94", "$95",
|
"$8F", "$90", "$91", "$92", "$93", "$94", "$95", "$96", "$97", "$98", "$99",
|
||||||
"$96", "$97", "$98", "$99", "$9A", "$9B", "$9C", "$9D", "$9E", "$9F",
|
"$9A", "$9B", "$9C", "$9D", "$9E", "$9F", "WP ", "$A1", "$A2", "$A3", "$A4",
|
||||||
"WP ", "$A1", "$A2", "$A3", "$A4", "$A5", "$A6", "$A7", "$A8", "$A9",
|
"$A5", "$A6", "$A7", "$A8", "$A9", "$AA", "GSB", "TDF", "BDF", "$AE", "$AF",
|
||||||
"$AA", "GSB", "TDF", "BDF", "$AE", "$AF", "SRC", "OBJ", "LIB", "S16",
|
"SRC", "OBJ", "LIB", "S16", "RTL", "EXE", "PIF", "TIF", "NDA", "CDA", "TOL",
|
||||||
"RTL", "EXE", "PIF", "TIF", "NDA", "CDA", "TOL", "DVR", "LDF", "FST",
|
"DVR", "LDF", "FST", "$BE", "DOC", "PNT", "PIC", "ANI", "PAL", "$C4", "OOG",
|
||||||
"$BE", "DOC", "PNT", "PIC", "ANI", "PAL", "$C4", "OOG", "SCR", "CDV",
|
"SCR", "CDV", "FON", "FND", "ICN", "$CB", "$CC", "$CD", "$CE", "$CF", "$D0",
|
||||||
"FON", "FND", "ICN", "$CB", "$CC", "$CD", "$CE", "$CF", "$D0", "$D1",
|
"$D1", "$D2", "$D3", "$D4", "MUS", "INS", "MDI", "SND", "$D9", "$DA", "DBM",
|
||||||
"$D2", "$D3", "$D4", "MUS", "INS", "MDI", "SND", "$D9", "$DA", "DBM",
|
"$DC", "DDD", "$DE", "$DF", "LBR", "$E1", "ATK", "$E3", "$E4", "$E5", "$E6",
|
||||||
"$DC", "DDD", "$DE", "$DF", "LBR", "$E1", "ATK", "$E3", "$E4", "$E5",
|
"$E7", "$E8", "$E9", "$EA", "$EB", "$EC", "$ED", "R16", "PAS", "CMD", "$F1",
|
||||||
"$E6", "$E7", "$E8", "$E9", "$EA", "$EB", "$EC", "$ED", "R16", "PAS",
|
"$F2", "$F3", "$F4", "$F5", "$F6", "$F7", "$F8", "OS ", "INT", "IVR", "BAS",
|
||||||
"CMD", "$F1", "$F2", "$F3", "$F4", "$F5", "$F6", "$F7", "$F8", "OS ",
|
"VAR", "REL", "SYS" };
|
||||||
"INT", "IVR", "BAS", "VAR", "REL", "SYS" };
|
|
||||||
|
|
||||||
int ENTRY_SIZE = 39;
|
int ENTRY_SIZE = 39;
|
||||||
int ENTRIES_PER_BLOCK = 13;
|
int ENTRIES_PER_BLOCK = 13;
|
||||||
|
@ -12,16 +12,16 @@ class ProdosDirectory extends AbstractFile
|
|||||||
private static final String newLine = String.format ("%n");
|
private static final String newLine = String.format ("%n");
|
||||||
private static final String newLine2 = newLine + newLine;
|
private static final String newLine2 = newLine + newLine;
|
||||||
|
|
||||||
// private final Disk parent;
|
|
||||||
private final FormattedDisk parentFD;
|
private final FormattedDisk parentFD;
|
||||||
private final int totalBlocks;
|
private final int totalBlocks;
|
||||||
private final int freeBlocks;
|
private final int freeBlocks;
|
||||||
private final int usedBlocks;
|
private final int usedBlocks;
|
||||||
|
|
||||||
public ProdosDirectory (FormattedDisk parent, String name, byte[] buffer, int totalBlocks,
|
public ProdosDirectory (FormattedDisk parent, String name, byte[] buffer,
|
||||||
int freeBlocks, int usedBlocks)
|
int totalBlocks, int freeBlocks, int usedBlocks)
|
||||||
{
|
{
|
||||||
super (name, buffer);
|
super (name, buffer);
|
||||||
|
|
||||||
this.parentFD = parent;
|
this.parentFD = parent;
|
||||||
this.totalBlocks = totalBlocks;
|
this.totalBlocks = totalBlocks;
|
||||||
this.freeBlocks = freeBlocks;
|
this.freeBlocks = freeBlocks;
|
||||||
@ -37,7 +37,8 @@ class ProdosDirectory extends AbstractFile
|
|||||||
{
|
{
|
||||||
int storageType = (buffer[i] & 0xF0) >> 4;
|
int storageType = (buffer[i] & 0xF0) >> 4;
|
||||||
if (storageType == 0)
|
if (storageType == 0)
|
||||||
continue; // break??
|
continue; // break??
|
||||||
|
|
||||||
int nameLength = buffer[i] & 0x0F;
|
int nameLength = buffer[i] & 0x0F;
|
||||||
String filename = HexFormatter.getString (buffer, i + 1, nameLength);
|
String filename = HexFormatter.getString (buffer, i + 1, nameLength);
|
||||||
String subType = "";
|
String subType = "";
|
||||||
@ -49,8 +50,9 @@ class ProdosDirectory extends AbstractFile
|
|||||||
case ProdosConstants.TYPE_SUBDIRECTORY_HEADER:
|
case ProdosConstants.TYPE_SUBDIRECTORY_HEADER:
|
||||||
text.append ("/" + filename + newLine2);
|
text.append ("/" + filename + newLine2);
|
||||||
text.append (" NAME TYPE BLOCKS "
|
text.append (" NAME TYPE BLOCKS "
|
||||||
+ "MODIFIED CREATED ENDFILE SUBTYPE" + newLine2);
|
+ "MODIFIED CREATED ENDFILE SUBTYPE" + newLine2);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ProdosConstants.TYPE_FREE:
|
case ProdosConstants.TYPE_FREE:
|
||||||
case ProdosConstants.TYPE_SEEDLING:
|
case ProdosConstants.TYPE_SEEDLING:
|
||||||
case ProdosConstants.TYPE_SAPLING:
|
case ProdosConstants.TYPE_SAPLING:
|
||||||
@ -62,16 +64,17 @@ class ProdosDirectory extends AbstractFile
|
|||||||
int blocks = HexFormatter.intValue (buffer[i + 19], buffer[i + 20]);
|
int blocks = HexFormatter.intValue (buffer[i + 19], buffer[i + 20]);
|
||||||
|
|
||||||
GregorianCalendar created = HexFormatter.getAppleDate (buffer, i + 24);
|
GregorianCalendar created = HexFormatter.getAppleDate (buffer, i + 24);
|
||||||
String dateC =
|
String dateC = created == null ? NO_DATE
|
||||||
created == null ? NO_DATE : ProdosDisk.sdf.format (created.getTime ())
|
: ProdosDisk.sdf.format (created.getTime ()).toUpperCase ();
|
||||||
.toUpperCase ();
|
String timeC =
|
||||||
String timeC = created == null ? "" : ProdosDisk.stf.format (created.getTime ());
|
created == null ? "" : ProdosDisk.stf.format (created.getTime ());
|
||||||
GregorianCalendar modified = HexFormatter.getAppleDate (buffer, i + 33);
|
GregorianCalendar modified = HexFormatter.getAppleDate (buffer, i + 33);
|
||||||
String dateM =
|
String dateM = modified == null ? NO_DATE
|
||||||
modified == null ? NO_DATE : ProdosDisk.sdf.format (modified.getTime ())
|
: ProdosDisk.sdf.format (modified.getTime ()).toUpperCase ();
|
||||||
.toUpperCase ();
|
String timeM =
|
||||||
String timeM = modified == null ? "" : ProdosDisk.stf.format (modified.getTime ());
|
modified == null ? "" : ProdosDisk.stf.format (modified.getTime ());
|
||||||
int eof = HexFormatter.intValue (buffer[i + 21], buffer[i + 22], buffer[i + 23]);
|
int eof =
|
||||||
|
HexFormatter.intValue (buffer[i + 21], buffer[i + 22], buffer[i + 23]);
|
||||||
int fileType = HexFormatter.intValue (buffer[i + 16]);
|
int fileType = HexFormatter.intValue (buffer[i + 16]);
|
||||||
locked = (buffer[i + 30] & 0xE0) == 0xE0 ? " " : "*";
|
locked = (buffer[i + 30] & 0xE0) == 0xE0 ? " " : "*";
|
||||||
|
|
||||||
@ -94,17 +97,18 @@ class ProdosDirectory extends AbstractFile
|
|||||||
subType = "";
|
subType = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
text.append (String.format ("%s%-15s %3s %5d %9s %5s %9s %5s %8d %7s%n", locked,
|
text.append (String.format ("%s%-15s %3s %5d %9s %5s %9s %5s %8d %7s%n",
|
||||||
filename, ProdosConstants.fileTypes[type], blocks,
|
locked, filename, ProdosConstants.fileTypes[type],
|
||||||
dateM, timeM, dateC, timeC, eof, subType));
|
blocks, dateM, timeM, dateC, timeC, eof, subType));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
text.append (" <Unknown strage type : " + storageType + newLine);
|
text.append (" <Unknown strage type : " + storageType + newLine);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
text.append (String
|
text.append (String.format (
|
||||||
.format ("%nBLOCKS FREE:%5d BLOCKS USED:%5d TOTAL BLOCKS:%5d%n", freeBlocks,
|
"%nBLOCKS FREE:%5d BLOCKS USED:%5d TOTAL BLOCKS:%5d%n",
|
||||||
usedBlocks, totalBlocks));
|
freeBlocks, usedBlocks, totalBlocks));
|
||||||
return text.toString ();
|
return text.toString ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,8 +16,12 @@ import com.bytezone.diskbrowser.utilities.HexFormatter;
|
|||||||
|
|
||||||
public class ProdosDisk extends AbstractFormattedDisk
|
public class ProdosDisk extends AbstractFormattedDisk
|
||||||
{
|
{
|
||||||
|
protected static final DateFormat df = DateFormat.getInstance ();
|
||||||
|
protected static final SimpleDateFormat sdf = new SimpleDateFormat ("d-MMM-yy");
|
||||||
|
protected static final SimpleDateFormat stf = new SimpleDateFormat ("H:mm");
|
||||||
|
|
||||||
final SectorType dosSector = new SectorType ("Bootstrap Loader", Color.lightGray);
|
final SectorType dosSector = new SectorType ("Bootstrap Loader", Color.lightGray);
|
||||||
final SectorType catalogSector = new SectorType ("Catalog", new Color (0, 200, 0)); // green
|
final SectorType catalogSector = new SectorType ("Catalog", new Color (0, 200, 0));
|
||||||
final SectorType volumeMapSector = new SectorType ("Volume Map", Color.blue);
|
final SectorType volumeMapSector = new SectorType ("Volume Map", Color.blue);
|
||||||
final SectorType subcatalogSector = new SectorType ("Subcatalog", Color.magenta);
|
final SectorType subcatalogSector = new SectorType ("Subcatalog", Color.magenta);
|
||||||
final SectorType masterIndexSector = new SectorType ("Master Index", Color.orange);
|
final SectorType masterIndexSector = new SectorType ("Master Index", Color.orange);
|
||||||
@ -26,12 +30,9 @@ public class ProdosDisk extends AbstractFormattedDisk
|
|||||||
final SectorType extendedKeySector = new SectorType ("Extended key", Color.gray);
|
final SectorType extendedKeySector = new SectorType ("Extended key", Color.gray);
|
||||||
|
|
||||||
private final List<DirectoryHeader> headerEntries = new ArrayList<DirectoryHeader> ();
|
private final List<DirectoryHeader> headerEntries = new ArrayList<DirectoryHeader> ();
|
||||||
VolumeDirectoryHeader vdh = null;
|
protected VolumeDirectoryHeader vdh;
|
||||||
private static final boolean debug = false;
|
|
||||||
|
|
||||||
static final DateFormat df = DateFormat.getInstance ();
|
private static final boolean debug = false;
|
||||||
static final SimpleDateFormat sdf = new SimpleDateFormat ("d-MMM-yy");
|
|
||||||
static final SimpleDateFormat stf = new SimpleDateFormat ("H:mm");
|
|
||||||
|
|
||||||
public ProdosDisk (Disk disk)
|
public ProdosDisk (Disk disk)
|
||||||
{
|
{
|
||||||
@ -106,7 +107,7 @@ public class ProdosDisk extends AbstractFormattedDisk
|
|||||||
sectorTypes[block] = currentSectorType;
|
sectorTypes[block] = currentSectorType;
|
||||||
for (int i = 0; i < vdh.totalBitMapBlocks; i++)
|
for (int i = 0; i < vdh.totalBitMapBlocks; i++)
|
||||||
sectorTypes[vdh.bitMapBlock + i] = volumeMapSector;
|
sectorTypes[vdh.bitMapBlock + i] = volumeMapSector;
|
||||||
parentNode.setUserObject (vdh); // populate the empty volume node
|
parentNode.setUserObject (vdh); // populate the empty volume node
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ProdosConstants.TYPE_SUBDIRECTORY_HEADER:
|
case ProdosConstants.TYPE_SUBDIRECTORY_HEADER:
|
||||||
@ -122,7 +123,7 @@ public class ProdosDisk extends AbstractFormattedDisk
|
|||||||
DefaultMutableTreeNode directoryNode = new DefaultMutableTreeNode (ce);
|
DefaultMutableTreeNode directoryNode = new DefaultMutableTreeNode (ce);
|
||||||
directoryNode.setAllowsChildren (true);
|
directoryNode.setAllowsChildren (true);
|
||||||
parentNode.add (directoryNode);
|
parentNode.add (directoryNode);
|
||||||
processDirectoryBlock (ce.keyPtr, ce, directoryNode); // Recursion !!
|
processDirectoryBlock (ce.keyPtr, ce, directoryNode); // Recursion !!
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ProdosConstants.TYPE_SEEDLING:
|
case ProdosConstants.TYPE_SEEDLING:
|
||||||
@ -239,15 +240,6 @@ public class ProdosDisk extends AbstractFormattedDisk
|
|||||||
return super.getFormattedSector (da);
|
return super.getFormattedSector (da);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override
|
|
||||||
// public String getSectorFilename (DiskAddress da)
|
|
||||||
// {
|
|
||||||
// for (AppleFileSource fe : fileEntries)
|
|
||||||
// if (((FileEntry) fe).contains (da))
|
|
||||||
// return ((FileEntry) fe).getUniqueName ();
|
|
||||||
// return null;
|
|
||||||
// }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DiskAddress> getFileSectors (int fileNo)
|
public List<DiskAddress> getFileSectors (int fileNo)
|
||||||
{
|
{
|
||||||
|
@ -5,7 +5,6 @@ import com.bytezone.diskbrowser.disk.Disk;
|
|||||||
|
|
||||||
class ProdosExtendedKeySector extends AbstractSector
|
class ProdosExtendedKeySector extends AbstractSector
|
||||||
{
|
{
|
||||||
|
|
||||||
public ProdosExtendedKeySector (Disk disk, byte[] buffer)
|
public ProdosExtendedKeySector (Disk disk, byte[] buffer)
|
||||||
{
|
{
|
||||||
super (disk, buffer);
|
super (disk, buffer);
|
||||||
|
@ -6,7 +6,7 @@ import com.bytezone.diskbrowser.utilities.HexFormatter;
|
|||||||
|
|
||||||
class ProdosIndexSector extends AbstractSector
|
class ProdosIndexSector extends AbstractSector
|
||||||
{
|
{
|
||||||
String name;
|
private final String name;
|
||||||
|
|
||||||
ProdosIndexSector (String name, Disk disk, byte[] buffer)
|
ProdosIndexSector (String name, Disk disk, byte[] buffer)
|
||||||
{
|
{
|
||||||
@ -21,10 +21,12 @@ class ProdosIndexSector extends AbstractSector
|
|||||||
|
|
||||||
for (int i = 0; i < 256; i++)
|
for (int i = 0; i < 256; i++)
|
||||||
{
|
{
|
||||||
text.append (String.format ("%02X %02X %02X", i, buffer[i], buffer[i + 256]));
|
text.append (String.format ("%02X %02X %02X", i, buffer[i],
|
||||||
|
buffer[i + 256]));
|
||||||
if (buffer[i] != 0 || buffer[i + 256] != 0)
|
if (buffer[i] != 0 || buffer[i + 256] != 0)
|
||||||
text.append (String.format (" %s%n",
|
text.append (String
|
||||||
"block " + HexFormatter.intValue (buffer[i], buffer[i + 256])));
|
.format (" %s%n",
|
||||||
|
"block " + HexFormatter.intValue (buffer[i], buffer[i + 256])));
|
||||||
else
|
else
|
||||||
text.append ("\n");
|
text.append ("\n");
|
||||||
}
|
}
|
||||||
|
@ -8,36 +8,38 @@ import com.bytezone.diskbrowser.utilities.HexFormatter;
|
|||||||
|
|
||||||
class SubDirectoryHeader extends DirectoryHeader
|
class SubDirectoryHeader extends DirectoryHeader
|
||||||
{
|
{
|
||||||
int parentPointer;
|
private final int parentPointer;
|
||||||
int parentSequence;
|
private final int parentSequence;
|
||||||
int parentSize;
|
private final int parentSize;
|
||||||
|
|
||||||
public SubDirectoryHeader (ProdosDisk parentDisk, byte[] entryBuffer, FileEntry parent)
|
public SubDirectoryHeader (ProdosDisk parentDisk, byte[] entryBuffer, FileEntry parent)
|
||||||
{
|
{
|
||||||
super (parentDisk, entryBuffer);
|
super (parentDisk, entryBuffer);
|
||||||
this.parentDirectory = parent.parentDirectory;
|
this.parentDirectory = parent.parentDirectory;
|
||||||
|
|
||||||
parentPointer = HexFormatter.intValue (entryBuffer[35], entryBuffer[36]);
|
parentPointer = HexFormatter.intValue (entryBuffer[35], entryBuffer[36]);
|
||||||
parentSequence = HexFormatter.intValue (entryBuffer[37]);
|
parentSequence = HexFormatter.intValue (entryBuffer[37]);
|
||||||
parentSize = HexFormatter.intValue (entryBuffer[38]);
|
parentSize = HexFormatter.intValue (entryBuffer[38]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString ()
|
public String toString ()
|
||||||
{
|
{
|
||||||
String locked = (access == 0x01) ? "*" : " ";
|
String locked = (access == 0x01) ? "*" : " ";
|
||||||
return String.format (" %s%-40s %15s", locked, "/" + name, ProdosDisk.df.format (created
|
return String.format (" %s%-40s %15s", locked, "/" + name,
|
||||||
.getTime ()));
|
ProdosDisk.df.format (created.getTime ()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public DataSource getDataSource ()
|
@Override
|
||||||
{
|
public DataSource getDataSource ()
|
||||||
// should this return a directory listing?
|
{
|
||||||
return null;
|
// should this return a directory listing?
|
||||||
}
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public List<DiskAddress> getSectors ()
|
@Override
|
||||||
{
|
public List<DiskAddress> getSectors ()
|
||||||
return null;
|
{
|
||||||
}
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
@ -13,11 +13,11 @@ import com.bytezone.diskbrowser.utilities.HexFormatter;
|
|||||||
*/
|
*/
|
||||||
class VolumeDirectoryHeader extends DirectoryHeader
|
class VolumeDirectoryHeader extends DirectoryHeader
|
||||||
{
|
{
|
||||||
int bitMapBlock;
|
protected final int bitMapBlock;
|
||||||
int totalBlocks;
|
protected int totalBlocks;
|
||||||
int freeBlocks;
|
protected int freeBlocks;
|
||||||
int usedBlocks;
|
protected int usedBlocks;
|
||||||
int totalBitMapBlocks;
|
protected int totalBitMapBlocks;
|
||||||
|
|
||||||
public VolumeDirectoryHeader (ProdosDisk parentDisk, byte[] entryBuffer)
|
public VolumeDirectoryHeader (ProdosDisk parentDisk, byte[] entryBuffer)
|
||||||
{
|
{
|
||||||
@ -57,10 +57,9 @@ class VolumeDirectoryHeader extends DirectoryHeader
|
|||||||
|
|
||||||
block = 0;
|
block = 0;
|
||||||
|
|
||||||
// nb dual-dos disk needs to use totalBlocks obtained from disk
|
// nb1 dual-dos disk needs to use totalBlocks obtained from disk
|
||||||
// int max1 = (totalBlocks - 1) / 8 + 1; // bytes required for sector map
|
// int max1 = (totalBlocks - 1) / 8 + 1; // bytes required for sector map
|
||||||
|
// nb2 hard disk may be truncated, so use actual number of blocks
|
||||||
// nb disk may be truncated, so use actual number of blocks
|
|
||||||
// int max2 = (disk.getTotalBlocks () - 1) / 8 + 1; // bytes required for sector map
|
// int max2 = (disk.getTotalBlocks () - 1) / 8 + 1; // bytes required for sector map
|
||||||
|
|
||||||
int max = (Math.min (totalBlocks, disk.getTotalBlocks ()) - 1) / 8 + 1;
|
int max = (Math.min (totalBlocks, disk.getTotalBlocks ()) - 1) / 8 + 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user