suppressed home component of disk path

This commit is contained in:
Denis Molony 2019-01-27 07:06:13 +11:00
parent 25948ad218
commit 1be511daeb
10 changed files with 39 additions and 16 deletions

View File

@ -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);

View File

@ -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 ()
{

View File

@ -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));

View File

@ -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 ()
{

View File

@ -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

View File

@ -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);

View File

@ -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

View File

@ -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);

View File

@ -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 (

View File

@ -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;