From 0f83d543a137af00a6e20c1367e693fecb93e94d Mon Sep 17 00:00:00 2001 From: Robert Greene Date: Tue, 17 Dec 2002 05:27:34 +0000 Subject: [PATCH] Changed disk creation to use a create method, as this is better suited to disks that support mutiple logical disks. Also over-rode format to give suitable values. --- .../storage/UniDosFormatDisk.java | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/com/webcodepro/applecommander/storage/UniDosFormatDisk.java b/src/com/webcodepro/applecommander/storage/UniDosFormatDisk.java index 746681e..d544da6 100644 --- a/src/com/webcodepro/applecommander/storage/UniDosFormatDisk.java +++ b/src/com/webcodepro/applecommander/storage/UniDosFormatDisk.java @@ -53,12 +53,17 @@ public class UniDosFormatDisk extends DosFormatDisk { this.logicalOffset = logicalOffset; } /** - * Constructor for UniDosFormatDisk. - * @param filename + * Create a UniDosFormatDisk. */ - public UniDosFormatDisk(String filename, int logicalOffset) { - super(filename); - this.logicalOffset = logicalOffset; + public static DosFormatDisk[] create(String filename) { + byte[] diskImage = new byte[APPLE_800KB_2IMG_DISK]; + UniDosFormatDisk disk1 = new UniDosFormatDisk(filename, + diskImage, UNIDOS_DISK_1); + disk1.format(); + UniDosFormatDisk disk2 = new UniDosFormatDisk(filename, + diskImage, UNIDOS_DISK_2); + disk2.format(); + return new UniDosFormatDisk[] { disk1, disk2 }; } /** * Answer with the name of this disk. @@ -96,4 +101,11 @@ public class UniDosFormatDisk extends DosFormatDisk { return 0; } } + /** + * Format the disk as UniDOS. + * @see com.webcodepro.applecommander.storage.FormattedDisk#format() + */ + public void format() { + format(31, 50, 32); + } }