-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathCGATTY.PAS
125 lines (105 loc) · 2.12 KB
/
CGATTY.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
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
unit CGATTY;
interface
uses
Crt, Objects, Win, TeleType,HistTTY;
type
PCGATTY = ^TCGATTY;
TCGATTY =
object( THistTTY )
procedure ClrToEol; virtual;
procedure NewPaper; virtual;
{ procedure PaperBottom; virtual;
procedure SendNewLine; virtual;
} end;
implementation
{ TCgaTTY }
procedure TCgaTTY.ClrToEol;
begin
writechar( WhereX, whereY, Bounds.B.x - Bounds.A.x - WhereX + 1, ' ', cGround );
end;
procedure TCgaTTY.NewPaper;
var
i: byte;
begin
color( cInv);
ClrScr;
color( cGround);
gotoXY(1, Bounds.B.y - Bounds.A.y + 1);
PaperTop;
{
SendMargins;
ClrToEol;
TeleT.NewPaper;
if checksnow
then
begin
for i := 1 to Bounds.B.y - Bounds.A.y - 5 do
begin
SendNewLine;
writechar( 1, whereY, Bounds.B.x - Bounds.A.x - 2, ' ', cGround )
end;
gotoxy( 1, 5 )
end
end;
procedure TCgaTTY.PaperBottom;
begin
if checksnow
then
begin
gotoxy( 1, Bounds.B.y - Bounds.A.y);
SendNewLine
end;
TeleT.PaperBottom
end;
}
end;
end.
if height = 0
then height := 24;
if ColorAdapter
then seg := $b800
else seg := $b000;
procedure TCgaTTY.SendNewLine;
function VPtr( x, y: byte): pointer;
begin
VPtr := Ptr( seg, ofs + (y * width + x) * 2)
end;
var
width : word absolute $0000:$044a;
height : byte absolute $0000:$0484;
scrsize: word absolute $0000:$044c;
ofs : word absolute $0000:$044e;
Seg : word;
procedure MyMove( var src, dst; size: word);
begin
if CheckSnow
then
asm
cli
push ds
lds si, src
les di, dst
mov cx, size
mov dx, $3da
@WrtLoop:in al, dx
test al, 8
jne @Write
@Again1:in al, dx
rcr al, 1
jc @Again1
@Again2:in al, dx
rcr al, 1
jnc @Again2
@Write: movsw
loop @WrtLoop
pop ds
sti
end
else Move( src, dst, size * 2)
end;
begin
MyMove( VPtr(0,2)^, VPtr(0, 1)^, width * 22);
gotoXY(2,WhereY);
ClrToEol;
SendMargins;
}