mask off high bit
This commit is contained in:
parent
ad14d1bed6
commit
dee3c48dcb
|
@ -35,7 +35,7 @@ public class CPMTextFile extends AbstractFile
|
|||
|
||||
int max = buffer.length - 1;
|
||||
while (ptr < max && buffer[ptr] != 0x0D && buffer[ptr + 1] != 0x0A)
|
||||
line.append ((char) buffer[ptr++]);
|
||||
line.append ((char) (buffer[ptr++] & 0x7F));
|
||||
|
||||
return line.toString ();
|
||||
}
|
||||
|
|
|
@ -162,7 +162,15 @@ public class DirectoryEntry implements AppleFileSource
|
|||
byte[] exactBuffer = new byte[len];
|
||||
System.arraycopy (buffer, 0, exactBuffer, 0, len);
|
||||
|
||||
if ("ASM".equals (type))
|
||||
int max = Math.min (256, exactBuffer.length);
|
||||
int count = 0;
|
||||
for (int i = 1; i < max; i++)
|
||||
{
|
||||
if (exactBuffer[i - 1] == 0x0D && exactBuffer[i] == 0x0A)
|
||||
++count;
|
||||
}
|
||||
|
||||
if ("ASM".equals (type) || "DOC".equals (type) || "TXT".equals (type) || count > 0)
|
||||
appleFile = new CPMTextFile (name, exactBuffer);
|
||||
else
|
||||
appleFile = new DefaultAppleFile (name, exactBuffer, "CPM File : " + type);
|
||||
|
|
|
@ -146,11 +146,11 @@ public class AppleDisk implements Disk
|
|||
System.out.println ();
|
||||
}
|
||||
|
||||
if (sectorSize != 256 && sectorSize != 512)
|
||||
{
|
||||
System.out.println ("Invalid sector size : " + sectorSize);
|
||||
new Exception ().printStackTrace ();
|
||||
}
|
||||
// if (sectorSize != 256 && sectorSize != 512)
|
||||
// {
|
||||
// System.out.println ("Invalid sector size : " + sectorSize);
|
||||
// new Exception ().printStackTrace ();
|
||||
// }
|
||||
|
||||
if (sectorSize != 256 && sectorSize != 512)
|
||||
throw new FileFormatException ("Invalid sector size : " + sectorSize);
|
||||
|
|
Loading…
Reference in New Issue