mirror of
https://github.com/dmolony/DiskBrowser.git
synced 2024-12-24 23:31:31 +00:00
tidying
This commit is contained in:
parent
4724f11a2f
commit
691fb5c08a
@ -21,7 +21,7 @@ public class CPMDisk extends AbstractFormattedDisk
|
||||
public final SectorType basSector = new SectorType ("BAS", Color.gray);
|
||||
public final SectorType asmSector = new SectorType ("ASM", Color.orange);
|
||||
public final SectorType ovrSector = new SectorType ("OVR", Color.magenta);
|
||||
public final SectorType macSector = new SectorType ("Green", Color.green);
|
||||
public final SectorType macSector = new SectorType ("MAC", Color.green);
|
||||
|
||||
private int version; // http://www.seasip.info/Cpm/format22.html
|
||||
|
||||
|
@ -146,12 +146,6 @@ public class AppleDisk implements Disk
|
||||
System.out.println ();
|
||||
}
|
||||
|
||||
// if (sectorSize != 256 && sectorSize != 512)
|
||||
// {
|
||||
// System.out.println ("Invalid sector size : " + sectorSize);
|
||||
// new Exception ().printStackTrace ();
|
||||
// }
|
||||
|
||||
if (sectorSize != 256 && sectorSize != 512)
|
||||
throw new FileFormatException ("Invalid sector size : " + sectorSize);
|
||||
|
||||
|
@ -124,6 +124,9 @@ public class DiskFactory
|
||||
|
||||
if (((suffix.equals ("po") || suffix.equals ("dsk")) && file.length () > 143360))
|
||||
{
|
||||
if (debug)
|
||||
System.out.println ("Checking po or dsk hard drive: " + file.length ());
|
||||
|
||||
disk = checkHardDisk (file);
|
||||
if (disk != null)
|
||||
{
|
||||
@ -131,11 +134,22 @@ public class DiskFactory
|
||||
disk.setOriginalPath (p);
|
||||
return disk;
|
||||
}
|
||||
else
|
||||
|
||||
if (debug)
|
||||
System.out.println ("Creating a data disk from bad length");
|
||||
try
|
||||
{
|
||||
AppleDisk appleDisk = new AppleDisk (file, (int) file.length () / 4096, 8);
|
||||
if (debug)
|
||||
System.out.println ("created");
|
||||
return new DataDisk (appleDisk);
|
||||
}
|
||||
catch (FileFormatException e)
|
||||
{
|
||||
if (debug)
|
||||
System.out.println ("Creating AppleDisk failed");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
long length = file.length ();
|
||||
@ -296,20 +310,17 @@ public class DiskFactory
|
||||
if ((file.length () % 512) != 0)
|
||||
{
|
||||
if (debug)
|
||||
System.out.printf ("file length not divisible by 512 : %,d%n", file.length ());
|
||||
// return null;
|
||||
System.out.printf ("file length not divisible by 512 : %,d%n%n", file.length ());
|
||||
return null;
|
||||
}
|
||||
|
||||
// assumes a track is 4096 bytes
|
||||
// if ((file.length () % 4096) != 0)
|
||||
// {
|
||||
// if (debug)
|
||||
// {
|
||||
// System.out.printf ("file length not divisible by 4096 : %d%n%n", file.length ());
|
||||
// int usableLength = (int) (file.length () / 4096);
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
if ((file.length () % 4096) != 0)
|
||||
{
|
||||
if (debug)
|
||||
System.out.printf ("file length not divisible by 4096 : %d%n%n", file.length ());
|
||||
return null;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -25,8 +25,7 @@ public class DualDosDisk implements FormattedDisk, FileSelectionListener
|
||||
public DualDosDisk (FormattedDisk disk0, FormattedDisk disk1)
|
||||
{
|
||||
String diskName = disk0.getDisk ().getFile ().getName ();
|
||||
String text =
|
||||
"This disk contains both DOS and Prodos files. Isn't that clever?\n\n"
|
||||
String text = "This disk contains both DOS and Prodos files. Isn't that clever?\n\n"
|
||||
+ disk0.getDisk () + "\n" + disk1.getDisk ();
|
||||
DefaultMutableTreeNode root =
|
||||
new DefaultMutableTreeNode (new DefaultAppleFileSource (diskName, text, this));
|
||||
@ -112,14 +111,14 @@ public class DualDosDisk implements FormattedDisk, FileSelectionListener
|
||||
else if (disks[1] == fd && currentDisk != 1)
|
||||
currentDisk = 1;
|
||||
|
||||
System.out.println ("AFS : " + afs);
|
||||
System.out.println ("1. Setting current disk to : " + currentDisk);
|
||||
// System.out.println ("AFS : " + afs);
|
||||
// System.out.println ("1. Setting current disk to : " + currentDisk);
|
||||
}
|
||||
|
||||
public void setCurrentDiskNo (int n)
|
||||
{
|
||||
currentDisk = n;
|
||||
System.out.println ("2. Setting current disk to : " + currentDisk);
|
||||
// System.out.println ("2. Setting current disk to : " + currentDisk);
|
||||
}
|
||||
|
||||
public int getCurrentDiskNo ()
|
||||
@ -141,9 +140,10 @@ public class DualDosDisk implements FormattedDisk, FileSelectionListener
|
||||
@Override
|
||||
public AppleFileSource getCatalog ()
|
||||
{
|
||||
return new DefaultAppleFileSource ("text", disks[0].getCatalog ().getDataSource ()
|
||||
.getText ()
|
||||
+ "\n\n" + disks[1].getCatalog ().getDataSource ().getText (), this);
|
||||
return new DefaultAppleFileSource ("text",
|
||||
disks[0].getCatalog ().getDataSource ().getText () + "\n\n"
|
||||
+ disks[1].getCatalog ().getDataSource ().getText (),
|
||||
this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -151,7 +151,7 @@ public class DualDosDisk implements FormattedDisk, FileSelectionListener
|
||||
{
|
||||
if (true)
|
||||
return disks[currentDisk].getFile (uniqueName);
|
||||
System.out.println ("Searching for : " + uniqueName);
|
||||
// System.out.println ("Searching for : " + uniqueName);
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
AppleFileSource afs = disks[i].getFile (uniqueName);
|
||||
|
@ -138,7 +138,6 @@ public class InfocomDisk extends AbstractFormattedDisk
|
||||
{
|
||||
if (fileSize == 0)
|
||||
fileSize = getFileSize ();
|
||||
// System.out.println ("File size : " + fileSize);
|
||||
data = new byte[fileSize];
|
||||
|
||||
for (int track = 3, ptr = 0; track < 35; track++)
|
||||
|
Loading…
Reference in New Issue
Block a user