mirror of
https://github.com/dmolony/DiskBrowser.git
synced 2025-02-18 05:30:29 +00:00
fixed double hi res
This commit is contained in:
parent
24daee5319
commit
96badbeff3
@ -19,7 +19,7 @@ public class ExoBuffer
|
||||
private static int PFLAG_BITS_ALIGN_START = (1 << PBIT_BITS_ALIGN_START);
|
||||
private static int PFLAG_4_OFFSET_TABLES = (1 << PBIT_4_OFFSET_TABLES);
|
||||
|
||||
byte[] outBuffer = new byte[8192];
|
||||
byte[] outBuffer = new byte[16384];
|
||||
|
||||
// ---------------------------------------------------------------------------------//
|
||||
public ExoBuffer (byte[] inBuffer)
|
||||
@ -31,21 +31,26 @@ public class ExoBuffer
|
||||
// tableDump (decCtx.table);
|
||||
decCtxDecrunch (decCtx);
|
||||
|
||||
if (decCtx.outPos != outBuffer.length)
|
||||
{
|
||||
byte[] outBuffer2 = new byte[decCtx.outPos];
|
||||
System.arraycopy (outBuffer, 0, outBuffer2, 0, outBuffer2.length);
|
||||
outBuffer = outBuffer2;
|
||||
}
|
||||
reverse (outBuffer);
|
||||
// System.out.println (HexFormatter.format (outBuffer));
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------//
|
||||
private void reverse (byte[] inBuffer)
|
||||
// ---------------------------------------------------------------------------------//
|
||||
{
|
||||
int lo = 0;
|
||||
int hi = inBuffer.length - 1;
|
||||
while (lo < hi)
|
||||
{
|
||||
byte temp = inBuffer[lo];
|
||||
inBuffer[lo] = inBuffer[hi];
|
||||
inBuffer[hi] = temp;
|
||||
++lo;
|
||||
--hi;
|
||||
inBuffer[lo++] = inBuffer[hi];
|
||||
inBuffer[hi--] = temp;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -666,11 +666,9 @@ public abstract class HiResImage extends AbstractFile
|
||||
public static boolean isExo (byte[] buffer)
|
||||
// ---------------------------------------------------------------------------------//
|
||||
{
|
||||
if (buffer[0] == 1 && buffer[1] == 0)
|
||||
{
|
||||
// ExoBuffer exoBuffer = new ExoBuffer (buffer);
|
||||
if (buffer[0] == 1 && buffer[1] == 0) // this sucks
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -322,12 +322,18 @@ class FileEntry extends CatalogEntry implements ProdosConstants
|
||||
else if (auxType == 0x3FF8 && HiResImage.isExo (exactBuffer))
|
||||
{
|
||||
ExoBuffer exoBuffer = new ExoBuffer (exactBuffer);
|
||||
file = new OriginalHiResImage (name, exoBuffer.getExpandedBuffer (), 0x4000);
|
||||
byte[] outBuffer = exoBuffer.getExpandedBuffer ();
|
||||
if (outBuffer.length == 0x2000)
|
||||
file = new OriginalHiResImage (name, outBuffer, 0x3FF8);
|
||||
else if (outBuffer.length == 0x4000)
|
||||
file = new DoubleHiResImage (name, outBuffer);
|
||||
else
|
||||
file = new AssemblerProgram (name, exactBuffer, auxType);
|
||||
}
|
||||
else if (oneOf (endOfFile, 0x1FF8, 0x1FFF, 0x2000, 0x4000)
|
||||
&& oneOf (auxType, 0x1FFF, 0x2000, 0x4000, 0x6000))
|
||||
file = new OriginalHiResImage (name, exactBuffer, auxType);
|
||||
else if (endOfFile == 38400 && name.startsWith ("LVL."))
|
||||
else if (endOfFile == 0x9600 && name.startsWith ("LVL."))
|
||||
file = new LodeRunner (name, exactBuffer);
|
||||
else if (auxType == 0x1000 && CharacterRom.isRom (exactBuffer))
|
||||
file = new CharacterRom (name, exactBuffer);
|
||||
|
Loading…
x
Reference in New Issue
Block a user