diff --git a/app/cli-acx/src/main/java/io/github/applecommander/acx/SystemType.java b/app/cli-acx/src/main/java/io/github/applecommander/acx/SystemType.java index 4f15ea4..1bae329 100644 --- a/app/cli-acx/src/main/java/io/github/applecommander/acx/SystemType.java +++ b/app/cli-acx/src/main/java/io/github/applecommander/acx/SystemType.java @@ -98,8 +98,7 @@ public enum SystemType { static void copyDosSystemTracks(FormattedDisk targetDisk, FormattedDisk source) { DosFormatDisk target = (DosFormatDisk)targetDisk; - // FIXME messing with the VTOC should be handled elsewhere - byte[] vtoc = source.readSector(DosFormatDisk.CATALOG_TRACK, DosFormatDisk.VTOC_SECTOR); + byte[] vtoc = target.readVtoc(); int sectorsPerTrack = vtoc[0x35]; // Note that this also patches T0 S0 for BOOT0 for (int t=0; t<3; t++) { @@ -108,6 +107,7 @@ public enum SystemType { target.setSectorUsed(t, s, vtoc); } } + target.writeVtoc(vtoc); } static void copyProdosSystemFiles(FormattedDisk target, FormattedDisk source) { // We need to explicitly fix the boot block diff --git a/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/dos33/DosFormatDisk.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/dos33/DosFormatDisk.java index 82f2dc0..aec2032 100644 --- a/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/dos33/DosFormatDisk.java +++ b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/dos33/DosFormatDisk.java @@ -275,14 +275,14 @@ public class DosFormatDisk extends FormattedDisk { /** * Return the VTOC (Volume Table Of Contents). */ - protected byte[] readVtoc() { + public byte[] readVtoc() { return readSector(CATALOG_TRACK, VTOC_SECTOR); } /** * Save the VTOC (Volume Table Of Contents) to disk. */ - protected void writeVtoc(byte[] vtoc) { + public void writeVtoc(byte[] vtoc) { writeSector(CATALOG_TRACK, VTOC_SECTOR, vtoc); }