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