diff --git a/src/com/bytezone/diskbrowser/applefile/DoubleHiResImage.java b/src/com/bytezone/diskbrowser/applefile/DoubleHiResImage.java index f3bdddb..0819119 100644 --- a/src/com/bytezone/diskbrowser/applefile/DoubleHiResImage.java +++ b/src/com/bytezone/diskbrowser/applefile/DoubleHiResImage.java @@ -37,21 +37,16 @@ public class DoubleHiResImage extends HiResImage { packedBuffer = buffer; doubleScrunch = new DoubleScrunch (buffer); - // doubleScrunch.unscrunch (buffer); auxBuffer = doubleScrunch.memory[0]; this.buffer = doubleScrunch.memory[1]; } - else //if (name.endsWith (".A2FC") || auxType == 0x2000) + else { auxBuffer = new byte[0x2000]; this.buffer = new byte[0x2000]; System.arraycopy (buffer, 0, auxBuffer, 0, 0x2000); System.arraycopy (buffer, 0x2000, this.buffer, 0, 0x2000); } - // else - // { - // auxBuffer = null; - // } createImage (); } @@ -62,7 +57,10 @@ public class DoubleHiResImage extends HiResImage // ---------------------------------------------------------------------------------// { // image will be doubled vertically - image = new BufferedImage (560, 192 * 2, BufferedImage.TYPE_BYTE_GRAY); + int WIDTH = 280 * 2; + int HEIGHT = 192 * 2; + + image = new BufferedImage (WIDTH, HEIGHT, BufferedImage.TYPE_BYTE_GRAY); DataBuffer dataBuffer = image.getRaster ().getDataBuffer (); int ndx = 0; @@ -81,11 +79,11 @@ public class DoubleHiResImage extends HiResImage int val = (value >> px) & 0x01; int pixel = val == 0 ? 0 : 255; dataBuffer.setElem (ndx, pixel); - dataBuffer.setElem (ndx + 560, pixel); // repeat pixel one line on + dataBuffer.setElem (ndx + WIDTH, pixel); // repeat pixel one line on ++ndx; } } - ndx += 560; // skip past repeated line + ndx += WIDTH; // skip past repeated line } } @@ -116,7 +114,7 @@ public class DoubleHiResImage extends HiResImage | ((auxBuffer[ptr + 1] & 0x7F) << 14) | ((buffer[ptr + 1] & 0x7F) << 21); for (int px = 0; px < 28; px += 4) { - int val = (value >> px) & 0x0F; + int val = (value >>> px) & 0x0F; int val2 = swap[val]; dataBuffer.setElem (ndx++, colours[val2]); dataBuffer.setElem (ndx++, colours[val2]); // repeat pixel