Fixing acx create disk with DOS format to mark tracks 0-2 as used. #129

This commit is contained in:
Rob Greene 2023-10-26 23:01:25 -05:00
parent d62eee955c
commit 72f51be107
2 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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);
}