Compare commits

...

3 Commits

Author SHA1 Message Date
Denis Molony 8f95988596 link to DiskBrowserApp 2024-04-06 16:33:53 +10:00
Denis Molony 8cb682f068 added C1/4100 2024-03-12 17:37:13 +10:00
Denis Molony dfc7a68580 renamed jarFolder 2023-09-30 23:55:41 +10:00
3 changed files with 21 additions and 16 deletions

View File

@ -1,5 +1,6 @@
# Apple II Disk Browser # Apple II Disk Browser
### Alternative
There is a beta release of [DiskBrowser2](https://github.com/dmolony/diskbrowser2) available.
### Features ### Features
- Cross-platform (Windows, MacOS, Linux) - Cross-platform (Windows, MacOS, Linux)
- Disk formats - Disk formats

View File

@ -4,8 +4,8 @@
<property name="srcDir" location="src" /> <property name="srcDir" location="src" />
<property name="binDir" location="bin" /> <property name="binDir" location="bin" />
<property name="jarFolder" location="${user.home}/Dropbox/Java" /> <property name="jarDir" location="${user.home}/Dropbox/Java" />
<property name="jarFile" location="${jarFolder}/DiskBrowser.jar" /> <property name="jarFile" location="${jarDir}/DiskBrowser.jar" />
<target name="version"> <target name="version">
<echo>DiskBrowser.jar</echo> <echo>DiskBrowser.jar</echo>
@ -30,7 +30,7 @@
<target name="jar" depends="compile"> <target name="jar" depends="compile">
<jar destfile="${jarFile}"> <jar destfile="${jarFile}">
<fileset dir="${binDir}" /> <fileset dir="${binDir}" />
<zipfileset src="${jarFolder}/InputPanel.jar" /> <zipfileset src="${jarDir}/InputPanel.jar" />
<manifest> <manifest>
<attribute name="Main-Class" value="com.bytezone.diskbrowser.gui.DiskBrowser" /> <attribute name="Main-Class" value="com.bytezone.diskbrowser.gui.DiskBrowser" />
</manifest> </manifest>

View File

@ -16,9 +16,10 @@ import com.bytezone.diskbrowser.utilities.Utility;
public abstract class HiResImage extends AbstractFile public abstract class HiResImage extends AbstractFile
// -----------------------------------------------------------------------------------// // -----------------------------------------------------------------------------------//
{ {
static final String[] auxTypes = { "Paintworks Packed SHR Image", "Packed Super Hi-Res Image", static final String[] auxTypes =
"Super Hi-Res Image (Apple Preferred Format)", "Packed QuickDraw II PICT File", { "Paintworks Packed SHR Image", "Packed Super Hi-Res Image",
"Packed Super Hi-Res 3200 color image", "DreamGraphix" }; "Super Hi-Res Image (Apple Preferred Format)", "Packed QuickDraw II PICT File",
"Packed Super Hi-Res 3200 color image", "DreamGraphix" };
static final int COLOR_TABLE_SIZE = 32; static final int COLOR_TABLE_SIZE = 32;
static final int COLOR_TABLE_OFFSET_AUX_0 = 32_256; static final int COLOR_TABLE_OFFSET_AUX_0 = 32_256;
@ -115,7 +116,8 @@ public abstract class HiResImage extends AbstractFile
static PaletteFactory paletteFactory = new PaletteFactory (); static PaletteFactory paletteFactory = new PaletteFactory ();
static final byte[] pngHeader = { (byte) 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A }; static final byte[] pngHeader =
{ (byte) 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A };
static boolean colourQuirks; static boolean colourQuirks;
static boolean monochrome; static boolean monochrome;
@ -275,8 +277,8 @@ public abstract class HiResImage extends AbstractFile
{ {
String auxText = ""; String auxText = "";
StringBuilder text = new StringBuilder (); StringBuilder text = new StringBuilder ();
text.append (String.format ("Image File : %s%nFile type : $%02X %s%n", name, fileType, text.append (String.format ("Image File : %s%nFile type : $%02X %s%n", name,
ProdosConstants.fileTypes[fileType])); fileType, ProdosConstants.fileTypes[fileType]));
switch (fileType) switch (fileType)
{ {
@ -393,7 +395,8 @@ public abstract class HiResImage extends AbstractFile
{ {
if (dataBuffer.getSize () < rgbList.length + element) if (dataBuffer.getSize () < rgbList.length + element)
{ {
System.out.printf ("Bollocks: %d %d %d%n", dataBuffer.getSize (), rgbList.length, element); System.out.printf ("Bollocks: %d %d %d%n", dataBuffer.getSize (), rgbList.length,
element);
return element; return element;
} }
@ -462,12 +465,13 @@ public abstract class HiResImage extends AbstractFile
int type = (buffer[ptr] & 0xC0) >>> 6; // 0-3 int type = (buffer[ptr] & 0xC0) >>> 6; // 0-3
int count = (buffer[ptr++] & 0x3F) + 1; // 1-64 int count = (buffer[ptr++] & 0x3F) + 1; // 1-64
text.append (String.format ("%04X/%04d: %02X (%d,%2d) ", ptr - 1, size, buffer[ptr - 1], text.append (String.format ("%04X/%04d: %02X (%d,%2d) ", ptr - 1, size,
type, count)); buffer[ptr - 1], type, count));
if (type == 0) if (type == 0)
{ {
text.append (String.format ("%s%n", HexFormatter.getHexString (buffer, ptr, count))); text.append (
String.format ("%s%n", HexFormatter.getHexString (buffer, ptr, count)));
ptr += count; ptr += count;
size += count; size += count;
} }
@ -651,8 +655,8 @@ public abstract class HiResImage extends AbstractFile
if (buffer.length < 4) if (buffer.length < 4)
return false; return false;
return buffer[0] == (byte) 0xC1 && buffer[1] == (byte) 0xD0 && buffer[2] == (byte) 0xD0 return buffer[0] == (byte) 0xC1 && buffer[1] == (byte) 0xD0
&& buffer[3] == 0; && buffer[2] == (byte) 0xD0 && buffer[3] == 0;
} }
// ---------------------------------------------------------------------------------// // ---------------------------------------------------------------------------------//