mirror of
https://github.com/dmolony/DiskBrowser.git
synced 2024-11-25 16:34:00 +00:00
align text records
This commit is contained in:
parent
030121f12c
commit
d97ba0393b
@ -248,7 +248,7 @@ public class IntegerBasicProgram extends AbstractFile
|
||||
}
|
||||
/*
|
||||
* To find integer basic in memory:
|
||||
* $CA $CB contain the starting address
|
||||
* $CA $CB contain the starting address ($9464)
|
||||
* http://www.easy68k.com/paulrsm/6502/INTLST.TXT
|
||||
*/
|
||||
|
||||
|
@ -26,6 +26,11 @@ public class TextBuffer
|
||||
// step
|
||||
buffer = new byte[totalRecords * reclen];
|
||||
int copyBytes = Math.min (availableBytes, buffer.length);
|
||||
|
||||
if (copyBytes < 0)
|
||||
System.out.printf ("offset %d len %d copy %d%n", offset, buffer.length,
|
||||
copyBytes);
|
||||
else
|
||||
System.arraycopy (tempBuffer, offset, buffer, 0, copyBytes);
|
||||
}
|
||||
|
||||
|
@ -88,7 +88,7 @@ public class TextFile extends AbstractFile
|
||||
for (TextBuffer tb : buffers)
|
||||
{
|
||||
buffer = tb.buffer;
|
||||
knownLength (text, tb.firstRecNo);
|
||||
text = knownLength (text, tb.firstRecNo);
|
||||
}
|
||||
return text.toString ();
|
||||
}
|
||||
@ -102,6 +102,7 @@ public class TextFile extends AbstractFile
|
||||
recNo++;
|
||||
continue;
|
||||
}
|
||||
|
||||
int len = buffer.length - ptr;
|
||||
int bytes = len < recordLength ? len : recordLength;
|
||||
|
||||
@ -111,9 +112,12 @@ public class TextFile extends AbstractFile
|
||||
if ((buffer[ptr + bytes - 1] & 0x7F) == 0x0D) // ignore CR
|
||||
bytes--;
|
||||
|
||||
text.append (String.format ("%,10d %,8d %s%n", recNo * recordLength, recNo++,
|
||||
HexFormatter.getString (buffer, ptr, bytes)));
|
||||
String line = HexFormatter.getString (buffer, ptr, bytes);
|
||||
line = line.replaceAll ("\\n", "\n ");
|
||||
text.append (
|
||||
String.format ("%,10d %,8d %s%n", recNo * recordLength, recNo++, line));
|
||||
}
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user