diff --git a/src/com/bytezone/diskbrowser/applefile/HiResImage.java b/src/com/bytezone/diskbrowser/applefile/HiResImage.java index df8f962..56bc443 100644 --- a/src/com/bytezone/diskbrowser/applefile/HiResImage.java +++ b/src/com/bytezone/diskbrowser/applefile/HiResImage.java @@ -20,6 +20,7 @@ public abstract class HiResImage extends AbstractFile "Super Hi-Res Image (Apple Preferred Format)", "Packed QuickDraw II PICT File", "Packed Super Hi-Res 3200 color image" }; static final int COLOR_TABLE_SIZE = 32; + static final int COLOR_TABLE_OFFSET = 32000; public static final int FADDEN_AUX = 0x8066; // ---- ---- ------ -------------------------------------- ------------------------ @@ -463,10 +464,6 @@ public abstract class HiResImage extends AbstractFile int type = (buffer[ptr] & 0xC0) >>> 6; // 0-3 int count = (buffer[ptr++] & 0x3F) + 1; // 1-64 - // if (ptr >= buffer.length) // needed for NAGELxx - // break; - - // System.out.printf ("%3d %d %d %d%n", ptr, type, count, newPtr); switch (type) { case 0: diff --git a/src/com/bytezone/diskbrowser/applefile/SHRPictureFile2.java b/src/com/bytezone/diskbrowser/applefile/SHRPictureFile2.java index 9f95c5b..360584d 100644 --- a/src/com/bytezone/diskbrowser/applefile/SHRPictureFile2.java +++ b/src/com/bytezone/diskbrowser/applefile/SHRPictureFile2.java @@ -171,11 +171,12 @@ public class SHRPictureFile2 extends HiResImage failureReason = "Buffer should be 38,400 bytes"; return; } - int maxTables = (buffer.length - 32000) / COLOR_TABLE_SIZE; + int maxTables = (buffer.length - COLOR_TABLE_OFFSET) / COLOR_TABLE_SIZE; colorTables = new ColorTable[maxTables]; for (int i = 0; i < colorTables.length; i++) { - colorTables[i] = new ColorTable (i, buffer, 32000 + i * COLOR_TABLE_SIZE); + colorTables[i] = + new ColorTable (i, buffer, COLOR_TABLE_OFFSET + i * COLOR_TABLE_SIZE); colorTables[i].reverse (); } break;