mirror of
https://github.com/dmolony/DiskBrowser.git
synced 2025-02-12 13:30:32 +00:00
modified CPM validation
This commit is contained in:
parent
374050d9bc
commit
ee48dc2a32
@ -58,16 +58,25 @@ public class CPMDisk extends AbstractFormattedDisk
|
||||
for (int sector = 0; sector < 8; sector++)
|
||||
{
|
||||
DiskAddress da = disk.getDiskAddress (3, sector);
|
||||
if (disk.isSectorEmpty (da))
|
||||
break;
|
||||
|
||||
sectorTypes[da.getBlock ()] = catalogSector;
|
||||
byte[] buffer = disk.readSector (da);
|
||||
int b1 = buffer[0] & 0xFF;
|
||||
int b2 = buffer[1] & 0xFF;
|
||||
if (b1 == 0xE5)
|
||||
continue;
|
||||
if (b1 > 31)
|
||||
break;
|
||||
if (b2 < 32 || (b2 > 126 && b2 != 0xE5))
|
||||
break;
|
||||
|
||||
for (int i = 0; i < buffer.length; i += 32)
|
||||
{
|
||||
int val = buffer[i] & 0xFF;
|
||||
if (val == 0xE5)
|
||||
b1 = buffer[i] & 0xFF;
|
||||
b2 = buffer[i + 1] & 0xFF;
|
||||
if (b1 == 0xE5)
|
||||
break;
|
||||
if (b2 < 32 || (b2 > 126 && b2 != 0xE5))
|
||||
break;
|
||||
|
||||
DirectoryEntry entry = new DirectoryEntry (this, buffer, i);
|
||||
|
@ -79,19 +79,22 @@ class ProdosDirectory extends AbstractFile
|
||||
|
||||
switch (fileType)
|
||||
{
|
||||
case 4: // Text file
|
||||
case 4: // Text file
|
||||
int aux = HexFormatter.intValue (buffer[i + 31], buffer[i + 32]);
|
||||
subType = String.format ("R=%5d", aux);
|
||||
break;
|
||||
case 6: // BIN file
|
||||
|
||||
case 6: // BIN file
|
||||
aux = HexFormatter.intValue (buffer[i + 31], buffer[i + 32]);
|
||||
subType = String.format ("A=$%4X", aux);
|
||||
break;
|
||||
case 0x1A: // AWP file
|
||||
|
||||
case 0x1A: // AWP file
|
||||
aux = HexFormatter.intValue (buffer[i + 32], buffer[i + 31]); // backwards!
|
||||
if (aux != 0)
|
||||
filename = convert (filename, aux);
|
||||
break;
|
||||
|
||||
default:
|
||||
subType = "";
|
||||
}
|
||||
|
@ -12,10 +12,9 @@ import com.bytezone.common.Utility;
|
||||
public class NuFX
|
||||
{
|
||||
private static String[] fileSystems =
|
||||
{//
|
||||
"", "ProDOS/SOS", "DOS 3.3", "DOS 3.2", "Apple II Pascal", "Macintosh HFS",
|
||||
"Macintosh MFS", "Lisa File System", "Apple CP/M", "", "MS-DOS", "High Sierra",
|
||||
"ISO 9660", "AppleShare" };
|
||||
{ "", "ProDOS/SOS", "DOS 3.3", "DOS 3.2", "Apple II Pascal", "Macintosh HFS",
|
||||
"Macintosh MFS", "Lisa File System", "Apple CP/M", "", "MS-DOS", "High Sierra",
|
||||
"ISO 9660", "AppleShare" };
|
||||
private Header header;
|
||||
private final byte[] buffer;
|
||||
private final boolean debug = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user