DOS 4.3 changes

This commit is contained in:
Denis Molony 2019-08-12 07:49:23 +10:00
parent 3482347c8d
commit 18493d3290
5 changed files with 19 additions and 13 deletions

View File

@ -211,7 +211,9 @@ public class ApplesoftBasicProgram extends BasicProgram
alignPos = 0;
}
fullText.deleteCharAt (fullText.length () - 1); // remove last newline
if (fullText.length () > 0)
fullText.deleteCharAt (fullText.length () - 1); // remove last newline
return fullText.toString ();
}

View File

@ -102,7 +102,7 @@ abstract class AbstractCatalogEntry implements AppleFileSource
protected String getFileType ()
{
switch (this.fileType)
switch (fileType)
{
case Text:
return "T";

View File

@ -183,13 +183,13 @@ public class DosDisk extends AbstractFormattedDisk
}
// add up all the free and used sectors, and label DOS sectors while we're here
int lastDosSector = dosVTOCSector.maxSectors * 3; // first three tracks
int lastDosSector = dosVTOCSector.maxSectors * 3; // first three tracks
for (DiskAddress da2 : disk)
{
int blockNo = da2.getBlock ();
if (blockNo < lastDosSector) // in the DOS region
{
if (freeBlocks.get (blockNo)) // according to the VTOC
if (freeBlocks.get (blockNo)) // according to the VTOC
++freeSectors;
else
{
@ -200,7 +200,7 @@ public class DosDisk extends AbstractFormattedDisk
}
else
{
if (stillAvailable (da2)) // free or used, ie not specifically labelled
if (stillAvailable (da2)) // free or used, ie not specifically labelled
++freeSectors;
else
++usedSectors;

View File

@ -10,7 +10,7 @@ class DosVTOCSector extends AbstractSector
{
DosDisk parentDisk;
int volume;
int dosVersion; // 1, 2, 3 or 0x41...
int dosVersion; // 1, 2, 3 or 0x41, 0x42, 0x43...
int maxTSPairs;
int lastAllocTrack;
int direction;
@ -65,7 +65,7 @@ class DosVTOCSector extends AbstractSector
addText (text, buffer, 0x20, 3,
"Date/time initialised: " + Utility.getDateTime (buffer, 0x20));
addText (text, buffer, 0x23, 3, "");
addText (text, buffer, 0x26, 1, "Not used");
addText (text, buffer, 0x26, 1, "VTOC Phase");
addTextAndDecimal (text, buffer, 0x27, 1, "Maximum TS pairs");
addText (text, buffer, 0x28, 2, "Volume library");
@ -172,7 +172,9 @@ class DosVTOCSector extends AbstractSector
{
int block = 0;
int base = maxSectors == 13 ? 3 : 0;
for (int i = 56; i <= 0xc3; i += 4)
int first = 0x38;
int max = maxTracks * 4 + first;
for (int i = first; i < max; i += 4)
{
block = check (buffer[i + 1], block, base);
block = check (buffer[i], block, 0);

View File

@ -8,7 +8,6 @@ import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import com.bytezone.diskbrowser.utilities.HexFormatter;
import com.bytezone.diskbrowser.utilities.Utility;
// -----------------------------------------------------------------------------------//
@ -43,7 +42,7 @@ public class WozFile
private List<Track> tracks;
private final boolean debug1 = false;
private final boolean debug2 = false;
private final boolean showTracks = false;
// ---------------------------------------------------------------------------------//
public WozFile (File file) throws DiskNibbleException
@ -181,7 +180,7 @@ public class WozFile
if (trk.bitCount == 0)
break;
tracks.add (trk);
if (debug2)
if (showTracks)
System.out.printf ("%n$%02X %s%n", i, trk);
}
catch (DiskNibbleException e)
@ -301,6 +300,9 @@ public class WozFile
requiredRam = val16 (buffer, ptr + 50);
largestTrack = val16 (buffer, ptr + 52);
}
if (debug1)
System.out.println (this);
}
// ---------------------------------------------------------------------------------//
@ -366,8 +368,8 @@ public class WozFile
this.rawBuffer = rawBuffer;
this.trackNo = trackNo;
if (debug1)
System.out.println (HexFormatter.format (rawBuffer, ptr, 1024, ptr));
// if (debug1)
// System.out.println (HexFormatter.format (rawBuffer, ptr, 1024, ptr));
if (info.wozVersion == 1)
{