more DOS 4.1 testing

This commit is contained in:
Denis Molony 2019-01-25 17:06:31 +11:00
parent 1b5f3f95a9
commit 99bbd69878
5 changed files with 15 additions and 6 deletions

View File

@ -40,7 +40,11 @@ public class AppleDiskAddress implements DiskAddress
@Override
public boolean matches (DiskAddress that)
{
return that != null && this.block == that.getBlock ();
if (that == null)
return false;
// if (zeroFlag != ((AppleDiskAddress) that).zeroFlag)
// return false;
return this.block == that.getBlock ();
}
@Override

View File

@ -471,6 +471,7 @@ public class DiskFactory
}
catch (Exception e)
{
e.printStackTrace ();
}
if (debug)
System.out.println (" not a DOS disk");

View File

@ -64,7 +64,9 @@ abstract class AbstractCatalogEntry implements AppleFileSource
System.out.println ("Unknown file type : " + type);
name = getName ("", entryBuffer);
lastModified = Utility.getDateTime (entryBuffer, 0x1B);
if (dosDisk.getVersion () >= 0x41)
lastModified = Utility.getDateTime (entryBuffer, 0x1B);
// CATALOG command only formats the LO byte - see Beneath Apple DOS pp4-6
String base = String.format ("%s%s %03d ", (locked) ? "*" : " ", getFileType (),
(entryBuffer[33] & 0xFF));

View File

@ -86,7 +86,8 @@ class CatalogEntry extends AbstractCatalogEntry
break;
}
if (thisDA.matches (da))
if (thisDA.matches (da) && ((AppleDiskAddress) thisDA)
.zeroFlag () == ((AppleDiskAddress) da).zeroFlag ())
{
System.out.printf ("Next T/S list in sector %s points to itself%n", thisDA);
break;
@ -133,10 +134,10 @@ class CatalogEntry extends AbstractCatalogEntry
String lengthText = length == 0 ? "" : String.format ("$%4X %,6d", length, length);
String message = "";
String lockedFlag = (locked) ? "*" : " ";
if (dosDisk.dosVTOCSector.dosVersion >= 0x41)
{
message = lastModified.toString ().replace ('T', ' ');
}
if (reportedSize != actualSize)
message += "Bad size (" + reportedSize + ") ";
if (dataSectors.size () == 0)
@ -148,6 +149,7 @@ class CatalogEntry extends AbstractCatalogEntry
tsSectors.size (), (dataSectors.size () - textFileGaps), message.trim ());
if (actualSize == 0)
text = text.substring (0, 50);
return text;
}
}

View File

@ -72,7 +72,7 @@ public class Utility
LocalDateTime.of (val[3] + 2000, val[5], val[4], val[2], val[1], val[0]);
return date;
}
catch (DateTimeException e)
catch (DateTimeException | NumberFormatException e)
{
return null;
}