diff --git a/src/com/bytezone/diskbrowser/cpm/CPMDisk.java b/src/com/bytezone/diskbrowser/cpm/CPMDisk.java index 1cf553c..b3a3b2a 100644 --- a/src/com/bytezone/diskbrowser/cpm/CPMDisk.java +++ b/src/com/bytezone/diskbrowser/cpm/CPMDisk.java @@ -166,7 +166,7 @@ public class CPMDisk extends AbstractFormattedDisk "---- --------- --- - - -- -- -- -- ----------------------------" + "-------------------" + newLine; StringBuilder text = new StringBuilder (); - text.append (String.format ("Disk : %s%n%n", getAbsolutePath ())); + text.append (String.format ("Disk : %s%n%n", getDisplayPath ())); text.append ("User Name Typ R S Ex S2 S1 RC Blocks" + newLine); text.append (line); diff --git a/src/com/bytezone/diskbrowser/disk/AbstractFormattedDisk.java b/src/com/bytezone/diskbrowser/disk/AbstractFormattedDisk.java index eaf5a64..b5c9a0a 100755 --- a/src/com/bytezone/diskbrowser/disk/AbstractFormattedDisk.java +++ b/src/com/bytezone/diskbrowser/disk/AbstractFormattedDisk.java @@ -193,6 +193,18 @@ public abstract class AbstractFormattedDisk implements FormattedDisk return disk.getFile ().getAbsolutePath (); } + @Override + public String getDisplayPath () + { + if (originalPath != null) + return originalPath.toString (); + String home = System.getProperty ("user.home"); + String path = disk.getFile ().getAbsolutePath (); + if (path.startsWith (home)) + return "~" + path.substring (home.length ()); + return disk.getFile ().getAbsolutePath (); + } + @Override public String getName () { diff --git a/src/com/bytezone/diskbrowser/disk/AbstractSector.java b/src/com/bytezone/diskbrowser/disk/AbstractSector.java index 4ce11e0..8fae4dc 100755 --- a/src/com/bytezone/diskbrowser/disk/AbstractSector.java +++ b/src/com/bytezone/diskbrowser/disk/AbstractSector.java @@ -119,7 +119,8 @@ public abstract class AbstractSector implements DataSource if (size == 1) desc += " (" + (b[offset] & 0xFF) + ")"; else if (size == 2) - desc += " (" + ((b[offset + 1] & 0xFF) * 256 + (b[offset] & 0xFF)) + ")"; + desc += + String.format (" (%,d)", ((b[offset + 1] & 0xFF) * 256 + (b[offset] & 0xFF))); else if (size == 3) desc += String.format (" (%,d)", ((b[offset + 2] & 0xFF) * 65536) + ((b[offset + 1] & 0xFF) * 256) + (b[offset] & 0xFF)); diff --git a/src/com/bytezone/diskbrowser/disk/DualDosDisk.java b/src/com/bytezone/diskbrowser/disk/DualDosDisk.java index 8052577..5014439 100755 --- a/src/com/bytezone/diskbrowser/disk/DualDosDisk.java +++ b/src/com/bytezone/diskbrowser/disk/DualDosDisk.java @@ -229,6 +229,12 @@ public class DualDosDisk implements FormattedDisk return disks[currentDisk].getAbsolutePath (); } + @Override + public String getDisplayPath () + { + return disks[currentDisk].getDisplayPath (); + } + @Override public FormattedDisk getParent () { diff --git a/src/com/bytezone/diskbrowser/disk/FormattedDisk.java b/src/com/bytezone/diskbrowser/disk/FormattedDisk.java index c599d22..cbca363 100755 --- a/src/com/bytezone/diskbrowser/disk/FormattedDisk.java +++ b/src/com/bytezone/diskbrowser/disk/FormattedDisk.java @@ -64,6 +64,8 @@ public interface FormattedDisk public String getAbsolutePath (); + public String getDisplayPath (); + public void setOriginalPath (Path path); // VTOC flags sector as free, but it is in use by a file diff --git a/src/com/bytezone/diskbrowser/dos/CatalogEntry.java b/src/com/bytezone/diskbrowser/dos/CatalogEntry.java index 09cc8dc..eeb2a9f 100644 --- a/src/com/bytezone/diskbrowser/dos/CatalogEntry.java +++ b/src/com/bytezone/diskbrowser/dos/CatalogEntry.java @@ -143,10 +143,9 @@ class CatalogEntry extends AbstractCatalogEntry if (dataSectors.size () == 0) message += "No data "; - String text = - String.format ("%1s %1s %03d %-30.30s %-5s " + "%-13s %2d %3d %s", - lockedFlag, getFileType (), actualSize, name, addressText, lengthText, - tsSectors.size (), (dataSectors.size () - textFileGaps), message.trim ()); + String text = String.format ("%1s %1s %03d %-30.30s %-5s %-13s %3d %3d %s", + lockedFlag, getFileType (), actualSize, name, addressText, lengthText, + tsSectors.size (), (dataSectors.size () - textFileGaps), message.trim ()); if (actualSize == 0) text = text.substring (0, 50); diff --git a/src/com/bytezone/diskbrowser/dos/DosDisk.java b/src/com/bytezone/diskbrowser/dos/DosDisk.java index efcb0b5..0d58d24 100755 --- a/src/com/bytezone/diskbrowser/dos/DosDisk.java +++ b/src/com/bytezone/diskbrowser/dos/DosDisk.java @@ -404,7 +404,7 @@ public class DosDisk extends AbstractFormattedDisk String line = "- --- --- ------------------------------ ----- -------------" + " -- ---- -------------------" + newLine; StringBuilder text = new StringBuilder (); - text.append (String.format ("Disk : %s%n%n", getAbsolutePath ())); + text.append (String.format ("Disk : %s%n%n", getDisplayPath ())); text.append ("L Typ Len Name Addr" + " Length TS Data Comment" + newLine); text.append (line); @@ -441,10 +441,10 @@ public class DosDisk extends AbstractFormattedDisk * There were actually three versions of DOS 3.3 that Apple released without bumping the version number: - + The first version that was released had FPBASIC and INTBASIC files that were 50 sectors in size. - + The second version of DOS 3.3, often referred to as “DOS 3.3e”, appeared at the time the Apple IIe was released. In this version, the FPBASIC and INTBASIC files were 42 sectors in size. The changes introduced at that time included code to turn @@ -452,12 +452,12 @@ public class DosDisk extends AbstractFormattedDisk command. This fix reportedly introduced an even worse bug, but as the command was not heavily used it did not make much of an impact on most programmers. The APPEND fix was applied by utilizing some formerly unused space in the DOS 3.3 code. - + The third version of DOS 3.3 appeared just before the first release of ProDOS. The only mention of this in the press was in the DOSTalk column of Softalk magazine. This final version of DOS 3.3 included a different fix for the APPEND bug, using another bit of unused space in DOS 3.3. - + With regard to the FPBASIC and INTBASIC files: There were three differences between the 50 sector and the 42 sector versions of the INTBASIC file. Firstly, the $F800-$FFFF section was removed. This area was the code for the Monitor, and with diff --git a/src/com/bytezone/diskbrowser/nib/WozFile.java b/src/com/bytezone/diskbrowser/nib/WozFile.java index b78f5ba..09af137 100644 --- a/src/com/bytezone/diskbrowser/nib/WozFile.java +++ b/src/com/bytezone/diskbrowser/nib/WozFile.java @@ -11,8 +11,11 @@ import com.bytezone.diskbrowser.utilities.Utility; public class WozFile { - private static final byte[] WOZ_FILE_HEADER = - { 0x57, 0x4F, 0x5A, 0x31, (byte) 0xFF, 0x0a, 0x0D, 0x0A }; + private static final byte[] WOZ1_FILE_HEADER = + { 0x57, 0x4F, 0x5A, 0x31, (byte) 0xFF, 0x0A, 0x0D, 0x0A }; + private static final byte[] WOZ2_FILE_HEADER = + { 0x57, 0x4F, 0x5A, 0x32, (byte) 0xFF, 0x0A, 0x0D, 0x0A }; + private static final int TRK_SIZE = 0x1A00; private static final int INFO_SIZE = 0x3C; private static final int TMAP_SIZE = 0xA0; @@ -37,7 +40,7 @@ public class WozFile byte[] buffer = readFile (); boolean valid = false; - if (!matches (WOZ_FILE_HEADER, buffer)) + if (!matches (WOZ1_FILE_HEADER, buffer)) throw new DiskNibbleException ("Header error"); int checksum1 = readInt (buffer, 8, 4); diff --git a/src/com/bytezone/diskbrowser/pascal/PascalDisk.java b/src/com/bytezone/diskbrowser/pascal/PascalDisk.java index a12dc2f..c1763b8 100755 --- a/src/com/bytezone/diskbrowser/pascal/PascalDisk.java +++ b/src/com/bytezone/diskbrowser/pascal/PascalDisk.java @@ -257,7 +257,7 @@ public class PascalDisk extends AbstractFormattedDisk String date = volumeEntry.date == null ? "--" : df.format (volumeEntry.date.getTime ()); StringBuilder text = new StringBuilder (); - text.append ("Disk : " + disk.getFile ().getAbsolutePath () + newLine2); + text.append ("Disk : " + getDisplayPath () + newLine2); text.append ("Volume : " + volumeEntry.name + newLine); text.append ("Date : " + date + newLine2); text.append ( diff --git a/src/com/bytezone/diskbrowser/prodos/ProdosDirectory.java b/src/com/bytezone/diskbrowser/prodos/ProdosDirectory.java index ccc55d8..21ebab0 100755 --- a/src/com/bytezone/diskbrowser/prodos/ProdosDirectory.java +++ b/src/com/bytezone/diskbrowser/prodos/ProdosDirectory.java @@ -32,7 +32,7 @@ class ProdosDirectory extends AbstractFile implements ProdosConstants public String getText () { StringBuffer text = new StringBuffer (); - text.append ("Disk : " + parentFD.getAbsolutePath () + newLine2); + text.append ("Disk : " + parentFD.getDisplayPath () + newLine2); for (int i = 0; i < buffer.length; i += 39) { int storageType = (buffer[i] & 0xF0) >> 4;