From a4d173bea90f40955663ad42727f8137431532a4 Mon Sep 17 00:00:00 2001 From: Denis Molony Date: Fri, 22 Nov 2019 15:42:07 +1000 Subject: [PATCH] doco --- README.md | 3 +- .../diskbrowser/applefile/HiResImage.java | 28 +++++++++++++++++-- .../applefile/SHRPictureFile2.java | 5 ++-- 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 62594a4..25e09f1 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ - CPM disks - Comprehensive disk listing - woz format disks +- UniDos disks ### Documentation * [Usage](resources/usage.md) @@ -25,7 +26,7 @@ * Install the **latest** version of the [Java Runtime Environment](http://www.oracle.com/technetwork/java/javase/downloads/index.html) (JRE or JDK). * Download DiskBrowser.jar from the [releases](https://github.com/dmolony/diskbrowser/releases) page. * Double-click the jar file, or enter 'java -jar DiskBrowser.jar' in the terminal. -* Set your root folder (where you keep your disk images). +* Set your root folder (the top-level folder where you keep your disk images). ### Example Screens #### Disk listing diff --git a/src/com/bytezone/diskbrowser/applefile/HiResImage.java b/src/com/bytezone/diskbrowser/applefile/HiResImage.java index d879fbd..cb28e1d 100644 --- a/src/com/bytezone/diskbrowser/applefile/HiResImage.java +++ b/src/com/bytezone/diskbrowser/applefile/HiResImage.java @@ -56,8 +56,9 @@ public abstract class HiResImage extends AbstractFile // * $C1 PIC $0000 IIGS Super Hi-Res Image SHRPictureFile2 // $C1 PIC $0001 IIGS QuickDraw II PICT File SHRPictureFile2 * // * $C1 PIC $0002 Super Hi-Res 3200 (Brooks) SHRPictureFile2 .3200 - // $C1 PIC $2000 ? - // $C1 PIC $4950 ? + // $C1 PIC $2000 = $C1/0000 + // $C1 PIC $4100 = $C1/0000 + // $C1 PIC $4950 = $C1/0000 // $C1 PIC $8001 Allison raw image // $C1 PIC $8002 Thunderscan // $C1 PIC $8003 DreamGraphix @@ -66,6 +67,29 @@ public abstract class HiResImage extends AbstractFile // $C3 PAL Paintworks palette // ---- ---- ------ -------------------------------------- ------------------------ + // packed unpacked + // $06.3200 1 + // $06.3201 . + // $C0 0000 1 + // $C0 0001 $C1 0000 . 1 + // $C0 0002 1 + // $C0 0003 $C1 0001 . . + // $C0 0004 $C1 0002 . 1 + // $C0 1000 . + // $C0 8000 . + // $C0 8001 . + // $C0 8005 . + // $C0 8006 . + // $C1 2000 . + // $C1 4100 1 + // $C1 4950 . + // $C1 8001 . + // $C1 8002 . + // $C1 8003 . + + // 1 Graphics & Animation.2mg + // + static PaletteFactory paletteFactory = new PaletteFactory (); static final byte[] pngHeader = diff --git a/src/com/bytezone/diskbrowser/applefile/SHRPictureFile2.java b/src/com/bytezone/diskbrowser/applefile/SHRPictureFile2.java index 95800f5..62096f4 100644 --- a/src/com/bytezone/diskbrowser/applefile/SHRPictureFile2.java +++ b/src/com/bytezone/diskbrowser/applefile/SHRPictureFile2.java @@ -159,12 +159,13 @@ public class SHRPictureFile2 extends HiResImage // 00000 - 31999 pixel data 32,000 bytes // 32000 - 38399 200 color tables of 32 bytes each (one color table per scan line) - if (buffer.length < 38400) + if (buffer.length < 38400 && false) { failureReason = "Buffer should be 38,400 bytes"; return; } - colorTables = new ColorTable[200]; + int maxTables = (buffer.length - 3200) / 32; + colorTables = new ColorTable[maxTables]; for (int i = 0; i < colorTables.length; i++) { colorTables[i] = new ColorTable (i, buffer, 32000 + i * 32);