From 3a7027ce7a16c8294bf93bc5380971d9ad713fc2 Mon Sep 17 00:00:00 2001 From: Date: Thu, 2 Aug 2012 14:18:25 +0000 Subject: [PATCH] Bump the version number since .12 was released Add a .po extension to the filename when we ingest a shrinkit or DC42 image since we don't really do read/write operations in their native format --- src/com/webcodepro/applecommander/storage/Disk.java | 11 ++++++++--- .../webcodepro/applecommander/ui/AppleCommander.java | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/com/webcodepro/applecommander/storage/Disk.java b/src/com/webcodepro/applecommander/storage/Disk.java index 081f0ef..42f31c0 100644 --- a/src/com/webcodepro/applecommander/storage/Disk.java +++ b/src/com/webcodepro/applecommander/storage/Disk.java @@ -183,8 +183,12 @@ public class Disk { if (isSDK() || isSHK()) { // If we have an SDK, unpack it and send along the byte array + // If we have a SHK, build a new disk and unpack the contents on to it diskImage = com.webcodepro.shrinkit.Utilities.unpackSHKFile(filename); diskSize = diskImage.length; + // Since we don't want to overwrite their shrinkit with a raw ProDOS image, + // add a .po extension to it + this.filename += ".po"; //$NON-NLS-1$ } else { File file = new File(filename); diskSize = (int) file.length(); @@ -196,7 +200,6 @@ public class Disk { StreamUtil.copy(input, diskImageByteArray); diskImage = diskImageByteArray.toByteArray(); } - int offset = 0; boolean is2img = false; /* Does it have the 2IMG header? */ if ((diskImage[0] == 0x32) && (diskImage[1] == 0x49) && (diskImage[2] == 0x4D) && (diskImage[3]) == 0x47) { @@ -205,12 +208,14 @@ public class Disk { /* Does it have the DiskCopy 4.2 header? */ else if (Disk.isDC42(diskImage)) { isDC42 = true; - offset = 84; long end = AppleUtil.getLongValue(diskImage,0x40); if (end < diskImage.length - 83) { diskImageDC42 = new byte[(int)end]; - System.arraycopy(diskImage, 84, diskImageDC42, 0, (int)end); + System.arraycopy(diskImage, 84, diskImageDC42, 0, (int)end); // 84 bytes into the DC42 stream is where the real data starts diskImageManager = new ByteArrayImageLayout(diskImageDC42); + // Since we don't want to overwrite their dmg or dc42 with a raw ProDOS image, + // add a .po extension to it + this.filename += ".po"; //$NON-NLS-1$ } else throw new IllegalArgumentException(textBundle.get("CommandLineDC42Bad")); //$NON-NLS-1$ diff --git a/src/com/webcodepro/applecommander/ui/AppleCommander.java b/src/com/webcodepro/applecommander/ui/AppleCommander.java index 3c2e8bb..6570f8c 100644 --- a/src/com/webcodepro/applecommander/ui/AppleCommander.java +++ b/src/com/webcodepro/applecommander/ui/AppleCommander.java @@ -40,7 +40,7 @@ import com.webcodepro.applecommander.util.TextBundle; * @author Rob Greene */ public class AppleCommander { - public static final String VERSION = "1.3.5.12"; //$NON-NLS-1$ + public static final String VERSION = "1.3.5.13"; //$NON-NLS-1$ private static TextBundle textBundle = UiBundle.getInstance(); /** * Launch AppleCommander.