-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPETSCII.pas
44 lines (38 loc) · 2.97 KB
/
PETSCII.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
namespace D64;
//
// Based on Info from https://dflund.se/~triad/krad/recode/petscii_c64en_uc.txt
//
type
PETSCII = public static class
private
protected
public
method GetString(aBytes: array of Byte): not nullable String;
begin
result := "";
for each b in aBytes do begin
var lChar := PETSCII2Unicode[b];
if lChar ≠ #0 then
result := result+lChar
else
result := result+"?";
end;
end;
const PETSCII2Unicode = [#$0000, #$0000, #$0000, #$0000, #$0000, #$F100, #$0000, #$0000, #$F118, #$F119, #$0000, #$0000, #$0000, #$000D, #$000E, #$0000,
#$0000, #$F11C, #$F11A, #$F120, #$007F, #$0000, #$0000, #$0000, #$0000, #$0000, #$0000, #$0000, #$F101, #$F11D, #$F102, #$F103,
#$0020, #$0021, #$0022, #$0023, #$0024, #$0025, #$0026, #$0027, #$0028, #$0029, #$002A, #$002B, #$002C, #$002D, #$002E, #$002F,
#$0030, #$0031, #$0032, #$0033, #$0034, #$0035, #$0036, #$0037, #$0038, #$0039, #$003A, #$003B, #$003C, #$003D, #$003E, #$003F,
#$0040, #$0041, #$0042, #$0043, #$0044, #$0045, #$0046, #$0047, #$0048, #$0049, #$004A, #$004B, #$004C, #$004D, #$004E, #$004F,
#$0050, #$0051, #$0052, #$0053, #$0054, #$0055, #$0056, #$0057, #$0058, #$0059, #$005A, #$005B, #$00A3, #$005D, #$2191, #$2190,
#$2501, #$2660, #$2502, #$2501, #$F122, #$F123, #$F124, #$F126, #$F128, #$256E, #$2570, #$256F, #$F12A, #$2572, #$2571, #$F12B,
#$F12C, #$25CF, #$F125, #$2665, #$F127, #$256D, #$2573, #$25CB, #$2663, #$F129, #$2666, #$253C, #$F12E, #$2502, #$03C0, #$25E5,
#$0000, #$F104, #$0000, #$0000, #$0000, #$F110, #$F112, #$F114, #$F116, #$F111, #$F113, #$F115, #$F117, #$000A, #$000F, #$0000,
#$F105, #$F11E, #$F11B, #$000C, #$F121, #$F106, #$F107, #$F108, #$F109, #$F10A, #$F10B, #$F10C, #$F10D, #$F11D, #$F10E, #$F10F,
#$00A0, #$258C, #$2584, #$2594, #$2581, #$258F, #$2592, #$2595, #$F12F, #$25E4, #$F130, #$251C, #$F134, #$2514, #$2510, #$2582,
#$250C, #$2534, #$252C, #$2524, #$258E, #$258D, #$F131, #$F132, #$F133, #$2583, #$F12D, #$F135, #$F136, #$2518, #$F137, #$F138,
#$2501, #$2660, #$2502, #$2501, #$F122, #$F123, #$F124, #$F126, #$F128, #$256E, #$2570, #$256F, #$F12A, #$2572, #$2571, #$F12B,
#$F12C, #$25CF, #$F125, #$2665, #$F127, #$256D, #$2573, #$25CB, #$2663, #$F129, #$2666, #$253C, #$F12E, #$2502, #$03C0, #$25E5,
#$00A0, #$258C, #$2584, #$2594, #$2581, #$258F, #$2592, #$2595, #$F12F, #$25E4, #$F130, #$251C, #$F134, #$2514, #$2510, #$2582,
#$250C, #$2534, #$252C, #$2524, #$258E, #$258D, #$F131, #$F132, #$F133, #$2583, #$F12D, #$F135, #$F136, #$2518, #$F137, #$03C0];
end;
end.