This commit is contained in:
Denis Molony 2017-01-27 18:11:00 +11:00
parent 0c8f92a862
commit adf22d8894
5 changed files with 34 additions and 18 deletions

View File

@ -143,6 +143,8 @@ public abstract class HiResImage extends AbstractFile
auxText = "Packed Hi-Res File";
else if (auxType == 0x4001)
auxText = "Packed Double Hi-Res File";
else
auxText = "Unknown aux: " + auxType;
break;
case ProdosConstants.FILE_TYPE_PNT: // 0xC0
@ -154,6 +156,8 @@ public abstract class HiResImage extends AbstractFile
auxText = "Super Hi-Res Image (Apple Preferred)";
else if (auxType == 3)
auxText = "Packed QuickDraw II PICT File";
else
auxText = "Unknown aux: " + auxType;
break;
case ProdosConstants.FILE_TYPE_PIC: // 0xC1
@ -163,6 +167,8 @@ public abstract class HiResImage extends AbstractFile
auxText = "QuickDraw PICT File";
else if (auxType == 2)
auxText = "Super Hi-Res 3200 color image";
else
auxText = "Unknown aux: " + auxType;
}
if (!auxText.isEmpty ())
@ -454,6 +460,7 @@ public abstract class HiResImage extends AbstractFile
int red = ((value >> 8) & 0x0f) * 17;
int green = ((value >> 4) & 0x0f) * 17;
int blue = (value & 0x0f) * 17;
color = new Color (red, green, blue);
}

View File

@ -26,10 +26,16 @@ public class SHRPictureFile2 extends HiResImage
System.out.println ("0xC0 aux 1 not written");
}
else
System.out.println ("unknown aux " + auxType);
System.out.println ("C0 unknown aux " + auxType);
}
else if (fileType == ProdosConstants.FILE_TYPE_PIC) // 0xC1
{
if (auxType > 2)
{
System.out.printf ("Changing aux from %04X to 0 in %s%n", auxType, name);
auxType = 0;
}
if (auxType == 0)
{
scb = new byte[200];
@ -53,12 +59,13 @@ public class SHRPictureFile2 extends HiResImage
}
}
else
System.out.println ("unknown aux " + auxType);
System.out.println ("C1 unknown aux " + auxType);
}
else
System.out.println ("unknown filetype " + fileType);
createImage ();
if (colorTables != null)
createImage ();
}
@Override
@ -110,11 +117,12 @@ public class SHRPictureFile2 extends HiResImage
text.append ("\n");
}
for (ColorTable colorTable : colorTables)
{
text.append (colorTable);
text.append ("\n\n");
}
if (colorTables != null)
for (ColorTable colorTable : colorTables)
{
text.append (colorTable);
text.append ("\n\n");
}
text.deleteCharAt (text.length () - 1);
text.deleteCharAt (text.length () - 1);

View File

@ -54,7 +54,7 @@ class DataPanel extends JTabbedPane
formattedText = new JTextArea (10, TEXT_WIDTH);
formattedPane = setPanel (formattedText, "Formatted");
formattedText.setLineWrap (menuHandler.lineWrapItem.isSelected ());
formattedText.setLineWrap (prefs.getBoolean (MenuHandler.PREFS_LINE_WRAP, true));
formattedText.setText ("Please use the 'File->Set HOME folder...' command to "
+ "\ntell DiskBrowser where your Apple disks are located."
+ "\n\nTo see the contents of a disk in more detail, double-click"

View File

@ -24,13 +24,13 @@ import com.bytezone.diskbrowser.disk.FormattedDisk;
public class MenuHandler
implements DiskSelectionListener, FileSelectionListener, QuitListener
{
private static final String PREFS_LINE_WRAP = "line wrap";
static final String PREFS_LINE_WRAP = "line wrap";
private static final String PREFS_SHOW_CATALOG = "show catalog";
private static final String PREFS_SHOW_LAYOUT = "show layout";
private static final String PREFS_SHOW_FREE_SECTORS = "show free sectors";
private static final String PREFS_COLOUR_QUIRKS = "colour quirks";
private static final String PREFS_MONOCHROME = "monochrome";
private static final String PREFS_DEBUGGING = "debugging";
// private static final String PREFS_DEBUGGING = "debugging";
private static final String PREFS_PALETTE = "palette";
FormattedDisk currentDisk;

View File

@ -137,7 +137,7 @@ class FileEntry extends CatalogEntry implements ProdosConstants
private void traverseMasterIndex (int keyPtr)
{
byte[] buffer = disk.readSector (keyPtr); // master index
byte[] buffer = disk.readSector (keyPtr); // master index
// find the last used index block
// get the file size from the catalog and only check those blocks
int highestBlock = 0;
@ -189,7 +189,7 @@ class FileEntry extends CatalogEntry implements ProdosConstants
break;
if (block == 0)
dataBlocks.add (null); // allow for sparse image files
dataBlocks.add (null); // allow for sparse image files
else
{
parentDisk.setSectorType (block, parentDisk.dataSector);
@ -200,8 +200,7 @@ class FileEntry extends CatalogEntry implements ProdosConstants
private void traverseGEOSMasterIndex (int keyPtr)
{
byte[] buffer = disk.readSector (keyPtr); // master index
// int length = HexFormatter.intValue (buffer[0xFF], buffer[0x1FF]);
byte[] buffer = disk.readSector (keyPtr); // master index
for (int i = 0; i < 0x80; i++)
{
int block = HexFormatter.intValue (buffer[i], buffer[i + 256]);
@ -218,7 +217,7 @@ class FileEntry extends CatalogEntry implements ProdosConstants
parentDisk.setSectorType (keyPtr, parentDisk.indexSector);
indexBlocks.add (disk.getDiskAddress (keyPtr));
byte[] buffer = disk.readSector (keyPtr);
// int length = HexFormatter.intValue (buffer[0xFF], buffer[0x1FF]);
for (int i = 0; i < 0x80; i++)
{
int block = HexFormatter.intValue (buffer[i], buffer[i + 256]);
@ -589,13 +588,15 @@ class FileEntry extends CatalogEntry implements ProdosConstants
@Override
public boolean contains (DiskAddress da)
{
if (da == null)
return false;
if (da.equals (masterIndexBlock))
return true;
for (DiskAddress block : indexBlocks)
if (block.matches (da))
if (da.matches (block))
return true;
for (DiskAddress block : dataBlocks)
if (block.matches (da))
if (da.matches (block))
return true;
return false;
}