-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTASKAS.PAS
156 lines (137 loc) · 2.97 KB
/
TASKAS.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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
program taskas;
{ $ DEFINE tarpas}
uses
crt;
const
ms = 150000; { delay }
Q = 15; { vienas taskas : metrai = 1 : Q }
alfa : real = 85; { kampas }
s0 : integer = 0; { pradine sx koordinate }
v0 : word = 63; { pradinis greitis }
g = 10; { laisvojo kritimo pagreitis }
var
x, y,
xx0, yy0,
xx1, yy1,
xx2, yy2,
xx3, yy3,
xx, yy : integer;
ckt : word;
procedure putpixel (x, y : word; sp : byte);
begin
mem [$A000 : 320 * y + x] := sp
end;
function sy (t : word) : integer;
var
pgt : real;
begin
pgt := t / Q;
sy := round (sin (alfa) * v0 * pgt - g * sqr (pgt) / 2)
end;
function sx (t : word) : integer;
var
pgt : real;
begin
pgt := t / Q;
sx := round (s0 + cos (alfa) * v0 * pgt)
end;
procedure DELAY (ms : Word); Assembler;
asm
mov ax, 1000;
mul ms;
mov cx, dx;
mov dx, ax;
mov ah, $86;
Int $15;
end;
begin
asm
mov ax, 13h
int 10h
end;
port [$3C8] := 1;
port [$3C9] := 63;
port [$3C9] := 63;
port [$3C9] := 0;
port [$3C8] := 2;
port [$3C9] := 53;
port [$3C9] := 53;
port [$3C9] := 0;
port [$3C8] := 3;
port [$3C9] := 43;
port [$3C9] := 43;
port [$3C9] := 0;
port [$3C8] := 4;
port [$3C9] := 33;
port [$3C9] := 33;
port [$3C9] := 0;
{$IFDEF tarpas}
for xx := 5 to 204 do
begin
port [$3C8] := xx;
port [$3C9] := xx div 2;
port [$3C9] := xx div 2;
port [$3C9] := 0;
end;
repeat until port [$60] = 57;
xx := 0;
yy := 0;
v0 := 0;
while (port [$60] <> 185) or (yy < 198) do
begin
inc (v0, 2);
inc (yy);
for xx := 310 to 319 do
putpixel (xx, yy, yy + 5);
delay (1000)
end;
{$ENDIF}
alfa := (alfa * pi) / 180;
ckT := 0;
xx0 := 0; xx1 := 0; xx2 := 0; xx3 := 0;
yy0 := 0; yy1 := 0; yy2 := 0; yy3 := 0;
sound (100);
delay (ms);
nosound;
while (v0 > 1) and (port [$60] <> 1) do
begin
putpixel (xx3, yy3, 0);
inc (ckT);
x := sx (ckt);
y := sy (ckt);
if x > 319 then
begin
if x div 320 mod 2 = 0 then xx := x mod 320
else xx := 319 - x mod 320
end
else xx := x;
if Y >= 200 then
begin
{ ckT := ckt + round (2 * (v0 * sin (alfa) / g + ckt));
s0 := s0 - round (2 * (v0 * sin (alfa) / g + ckt) * v0 * cos (alfa));}
yy := 0
end
else yy := 200 - y;
if y < 0 then
begin
v0 := round (v0 / 1.5);
s0 := x;
ckt := 0;
sound (100);
delay (ms);
nosound;
continue
end;
xx3 := xx2; xx2 := xx1; xx1 := xx0; xx0 := xx;
yy3 := yy2; yy2 := yy1; yy1 := yy0; yy0 := yy;
putpixel (xx3, yy3, 4);
putpixel (xx2, yy2, 3);
putpixel (xx1, yy1, 2);
putpixel (xx, yy, 1);
delay (ms);
end;
asm
mov ax, 3h
int 10h
end
end.