From af9786fb4237f337817be93fa5ca60010afc399b Mon Sep 17 00:00:00 2001 From: Denis Molony Date: Mon, 25 Mar 2019 14:35:37 +1100 Subject: [PATCH] bad 2mg --- src/com/bytezone/diskbrowser/disk/AppleDisk.java | 13 ++++++++++++- src/com/bytezone/diskbrowser/dos/DosVTOCSector.java | 8 ++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/com/bytezone/diskbrowser/disk/AppleDisk.java b/src/com/bytezone/diskbrowser/disk/AppleDisk.java index 20ed639..ba35b4f 100755 --- a/src/com/bytezone/diskbrowser/disk/AppleDisk.java +++ b/src/com/bytezone/diskbrowser/disk/AppleDisk.java @@ -147,6 +147,8 @@ public class AppleDisk implements Disk { System.out.println ("Not a 2mg file"); this.blocks = (int) file.length () / 4096 * 8; // reduce blocks to a multiple of 8 + tracks = blocks / 8; // change parameter! + sectors = 8; // change parameter! this.sectorSize = 512; this.trackSize = sectors * sectorSize; } @@ -180,7 +182,16 @@ public class AppleDisk implements Disk this.tracks = tracks; this.sectors = sectors; - diskBuffer = new byte[tracks * sectors * sectorSize]; + if (debug) + { + System.out.printf ("Track size : %d%n", trackSize); + System.out.printf ("Sector size : %d%n", sectorSize); + System.out.printf ("Tracks : %d%n", tracks); + System.out.printf ("Sectors : %d%n", sectors); + System.out.printf ("Blocks : %d%n", blocks); + } + + diskBuffer = new byte[blocks * sectorSize]; hasData = new boolean[blocks]; if (debug) diff --git a/src/com/bytezone/diskbrowser/dos/DosVTOCSector.java b/src/com/bytezone/diskbrowser/dos/DosVTOCSector.java index f25d7b4..9f23e82 100755 --- a/src/com/bytezone/diskbrowser/dos/DosVTOCSector.java +++ b/src/com/bytezone/diskbrowser/dos/DosVTOCSector.java @@ -129,10 +129,10 @@ class DosVTOCSector extends AbstractSector String extra = ""; if (i == 56 && bootSectorEmpty) extra = "(unusable)"; - else if (i <= 64 && !bootSectorEmpty) - extra = "(reserved for DOS)"; - else if (i == 124) - extra = "(VTOC and Catalog)"; + // else if (i <= 64 && !bootSectorEmpty) + // extra = "(reserved for DOS)"; + // else if (i == 124) + // extra = "(VTOC and Catalog)"; addText (text, buffer, i, 4, String.format ("Track %02X %s %s", (i - 56) / 4, getBitmap (buffer[i], buffer[i + 1]), extra)); }