mirror of
https://github.com/dmolony/DiskBrowser.git
synced 2025-01-02 06:31:03 +00:00
minor tweaks
This commit is contained in:
parent
64ee8e5143
commit
2208b8f277
@ -619,7 +619,12 @@ public class AppleDisk implements Disk
|
||||
{
|
||||
StringBuilder text = new StringBuilder ();
|
||||
|
||||
text.append (String.format ("Path............ %s%n", file.getAbsolutePath ()));
|
||||
String path = file.getAbsolutePath ();
|
||||
String home = System.getProperty ("user.home");
|
||||
if (path.startsWith (home))
|
||||
path = "~" + path.substring (home.length ());
|
||||
|
||||
text.append (String.format ("Path............ %s%n", path));
|
||||
text.append (String.format ("File name....... %s%n", file.getName ()));
|
||||
text.append (String.format ("File size....... %,d%n", file.length ()));
|
||||
text.append (String.format ("Tracks.......... %d%n", tracks));
|
||||
|
@ -296,7 +296,10 @@ public class DosDisk extends AbstractFormattedDisk
|
||||
// return 0;
|
||||
|
||||
if (buffer[53] != 16 && buffer[53] != 13) // tracks per sector
|
||||
{
|
||||
System.out.printf ("%02X tracks per sector%n", buffer[53]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// if (buffer[49] < -1 || buffer[49] > 1) // direction of next file save
|
||||
// {
|
||||
|
@ -168,7 +168,11 @@ public class TreeBuilder
|
||||
{
|
||||
StringBuilder text = new StringBuilder ();
|
||||
|
||||
text.append ("Directory : " + file.getAbsolutePath () + "\n\n");
|
||||
String home = System.getProperty ("user.home");
|
||||
String path = file.getAbsolutePath ();
|
||||
if (path.startsWith (home))
|
||||
path = "~" + path.substring (home.length ());
|
||||
text.append ("Directory : " + path + "\n\n");
|
||||
text.append ("D File names "
|
||||
+ " Date Size Type\n");
|
||||
text.append ("- ----------------------------------------"
|
||||
@ -178,9 +182,11 @@ public class TreeBuilder
|
||||
if (files != null)
|
||||
for (File f : files)
|
||||
{
|
||||
String name = f.getName ();
|
||||
if (name.startsWith ("."))
|
||||
if (f.isHidden ())
|
||||
continue;
|
||||
String name = f.getName ();
|
||||
// if (name.startsWith ("."))
|
||||
// continue;
|
||||
|
||||
Date d = new Date (f.lastModified ());
|
||||
int pos = name.lastIndexOf ('.');
|
||||
|
@ -7,6 +7,7 @@ import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.bytezone.diskbrowser.utilities.HexFormatter;
|
||||
import com.bytezone.diskbrowser.utilities.Utility;
|
||||
|
||||
public class WozFile
|
||||
@ -41,7 +42,10 @@ public class WozFile
|
||||
boolean valid = false;
|
||||
|
||||
if (!matches (WOZ1_FILE_HEADER, buffer))
|
||||
{
|
||||
System.out.println (HexFormatter.format (buffer, 0, 20));
|
||||
throw new DiskNibbleException ("Header error");
|
||||
}
|
||||
|
||||
int checksum1 = readInt (buffer, 8, 4);
|
||||
int checksum2 = Utility.crc32 (buffer, 12, buffer.length - 12);
|
||||
|
@ -91,7 +91,7 @@ public class NuFX
|
||||
{
|
||||
crc = ((crc >>> 8) | (crc << 8)) & 0xFFFF;
|
||||
crc ^= (buffer[j] & 0xFF);
|
||||
crc ^= ((crc & 0xFF) >> 4);
|
||||
crc ^= ((crc & 0xFF) >>> 4);
|
||||
crc ^= (crc << 12) & 0xFFFF;
|
||||
crc ^= ((crc & 0xFF) << 5) & 0xFFFF;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user