-
Notifications
You must be signed in to change notification settings - Fork 0
/
printTime.inc
99 lines (67 loc) · 1.28 KB
/
printTime.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
procedure printTime;
var p: PByte absolute $e0;
i, a, b, l: byte;
t: TString;
procedure printDigits;
begin
if l > 0 then begin
a:=(ord(t[l])- 47) shl 3 + 96;
dec(l);
end else
a:=96;
if l>0 then begin
b:=(ord(t[l]) - 47) shl 3;
dec(l);
end else
b:=0;
for i:=7 downto 0 do begin
p[0]:=digitH[a+i] or digitH[b+i];
dec(p);
end;
end;
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(second);
p:=pointer(PMB_PAGE+$700+162+7);
printDigits_hi(0, $0f);
p:=pointer(PMB_PAGE+$600+162+7);
printDigits_hi(96, $f0);
toString(minute);
p:=pointer(PMB_PAGE+$500+162+7);
printDigits;
end;