-
Notifications
You must be signed in to change notification settings - Fork 0
/
printSpeed.inc
70 lines (47 loc) · 936 Bytes
/
printSpeed.inc
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
procedure printSpeed;
var p: PByte absolute $e0;
i, a, l: byte;
t: TString;
procedure printDigits_hi(_add: byte; _and: byte);
begin
if l > 0 then begin
a:=(ord(t[l])- 47) shl 3 + _add;
dec(l);
end else
a:=_add;
for i:=7 downto 0 do begin
p[0]:=(p[0] and _and) or digitH[a+i];
dec(p);
end;
end;
{
procedure printDigits_lo;
begin
if l > 0 then begin
a:=(ord(t[l])- 47) shl 3;
dec(l);
end else
a:=0;
for i:=7 downto 0 do begin
p[0]:=(p[0] and $f0) or digitL[a+i];
dec(p);
end;
end;
}
procedure toString(a: byte);
begin
if a < 10 then begin
t[0]:=chr(2);
t[1]:='0';
t[2]:=chr(48 + a);
end else
t:=BytetoStr(a);
l:=2;
end;
begin
toString(max_speed - speed);
p:=pointer(PMB_PAGE+$600+194+7);
printDigits_hi(0, $0f);
p:=pointer(PMB_PAGE+$500+194+7);
printDigits_hi(96, $f0);
end;