mirror of
https://github.com/dmolony/DiskBrowser.git
synced 2024-11-25 16:34:00 +00:00
crc bug with sdk disk images
This commit is contained in:
parent
a51a1251c6
commit
5681aa4270
@ -130,7 +130,10 @@ class LZW
|
||||
|
||||
int calculatedCrc = Utility.getCRC (buffer, length, crcBase);
|
||||
if (crc != calculatedCrc)
|
||||
{
|
||||
System.out.printf ("%n*** LZW CRC mismatch *** %04X %04X%n", crc, calculatedCrc);
|
||||
// throw new FileFormatException ("File CRC failed");
|
||||
}
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
@ -17,9 +17,10 @@ class LZW2 extends LZW
|
||||
bytes = Objects.requireNonNull (buffer);
|
||||
|
||||
this.crc = crc;
|
||||
this.v3eof = eof;
|
||||
|
||||
crcBase = 0xFFFF;
|
||||
codeWord = 0;
|
||||
v3eof = eof;
|
||||
|
||||
volume = buffer[0] & 0xFF;
|
||||
runLengthChar = (byte) (buffer[1] & 0xFF);
|
||||
|
@ -44,11 +44,11 @@ public class NuFX
|
||||
for (int rec = 0; rec < masterHeader.getTotalRecords (); rec++)
|
||||
{
|
||||
Record record = new Record (buffer, dataPtr);
|
||||
if (record.getFileSystemID () != 1)
|
||||
{
|
||||
System.out.println ("Not Prodos");
|
||||
break;
|
||||
}
|
||||
// if (record.getFileSystemID () != 1)
|
||||
// {
|
||||
// System.out.println ("Not Prodos: " + record.getFileSystemID ());
|
||||
// break;
|
||||
// }
|
||||
records.add (record);
|
||||
|
||||
if (debug)
|
||||
@ -175,7 +175,7 @@ public class NuFX
|
||||
if (nameOffset > 0) // remove volume name from path
|
||||
fileName = fileName.substring (nameOffset);
|
||||
|
||||
if (true)
|
||||
if (false)
|
||||
System.out.printf ("%3d %-35s %02X %,7d %,7d %,7d %s %s%n", ++count,
|
||||
fileName, fileType, auxType, eof, buffer.length, created, modified);
|
||||
|
||||
|
@ -37,7 +37,11 @@ class Thread
|
||||
lzw = switch (header.threadFormat)
|
||||
{
|
||||
case 2 -> new LZW1 (data);
|
||||
case 3 -> new LZW2 (data, header.threadCrc, header.uncompressedEOF);
|
||||
case 3 ->
|
||||
{
|
||||
int length = header.threadKind == 1 ? 0 : header.uncompressedEOF;
|
||||
yield new LZW2 (data, header.threadCrc, length);
|
||||
}
|
||||
default -> null; // 1 = Huffman Squeeze
|
||||
};
|
||||
|
||||
|
@ -49,9 +49,8 @@ class ThreadHeader
|
||||
text.append (String.format (" kind .............. %d %s%n", threadKind,
|
||||
threadKindText[threadClass][threadKind]));
|
||||
text.append (String.format (" crc ............... %,d (%<04X)%n", threadCrc));
|
||||
text.append (String.format (" uncompressedEOF ... %,d%n", uncompressedEOF));
|
||||
text.append (String.format (" compressedEOF ..... %,d (%08X)", compressedEOF,
|
||||
compressedEOF));
|
||||
text.append (String.format (" uncompressedEOF ... %,d (%<08X)%n", uncompressedEOF));
|
||||
text.append (String.format (" compressedEOF ..... %,d (%<08X)", compressedEOF));
|
||||
return text.toString ();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user