1 {$E-,F+,G+,I-,N+,O+,Q-,R-,S-,V-}
8 Procedure CalcPlas( plas
: Pointer);
9 Procedure CalcTunnel( Int
: Word);
10 Procedure Trash_it_256
;
11 Procedure DoTunnel( plas
: Pointer; move
: Word);
12 Procedure CalcWorm( seg3
: Pointer);
13 Procedure CalcRain( plas
: Pointer; Intensity
: Byte);
14 Procedure DoWorm( plas
, seg3
: Pointer; move
: Word);
18 Procedure CalcPlas( plas
: Pointer);
19 Var a
, x
, x2
, x3
, y
, y2
: Word;
23 If Random(800)=0 Then Mem
[seg(segmen
^):x
]:=Random(30)*Random(20);
31 x2
:=x2
+Mem
[seg(segmen
^):x
+(y
-3)*256+y2
-3];
32 x3
:=Mem
[seg(segmen
^):x
];
33 If a
>10 Then x2
:=x2
div 25
34 Else x2
:=x2
div 25+Random(4)*Random(10*x3
)-Random(4)*Random(5*x3
);
35 If a
=11 Then x2
:=x2
+Random(20)*Random(20);
36 Mem
[seg(segmen2
^):x
]:=x2
;
54 Procedure CalcTunnel( Int
: Word);
55 Var x
, y
, col
, Winkel
: Word;
60 Winkel
:=Lo(Round(Arctan386(1.5*(99.5-y
)/(159.5-x
))
61 *(256 Shl (Int
-1))/pi
));
62 col
:=Round( 12000/Sqrt((159.5-x
)*(159.5-x
)+1.5*(99.5-y
)*(99.5-y
)) );
63 Memw
[seg(segmen2
^):2*(320*y
+x
)]:=(col
And 255) shl 8 +winkel
;
64 {} Memw
[seg(segmen2
^):2*(320*y
+(319-x
))]:=(col
and 255) shl 8 -winkel
;
68 Procedure DoTunnel( plas
: Pointer; move
: Word);assembler;
71 mov ax, word ptr [segmen2
+2]
78 mov cx, 32000 {z„hler}
82 mov si, [bx] {Addresse holen}
83 add si, ax {Bewegung drauf}
87 mov bx, 63999 {"von hinten" auch!}
89 inc bx {wegen "inc di" bei "movsb"}
90 mov di, bx {neuer Offset}
91 dec si {auch wegen "inc si" bei "movsb"}
99 Procedure CalcWorm( seg3
: Pointer);
101 x
, x2
, y
, y2
, mo
, col
, peri
: Word;
104 {For x:=0 To 3120 Do Sinus^[x]:=Round( 1024*Sin386((x*pi/180)/3120*360) );}
107 r
:=r
+0.1*Sqrt(Sqrt(Sqrt(r
)));
108 peri
:=Round(869*(r
/240));
111 y2
:=Round(0.6*(110.5+4000/r
112 +r
{Sinus^[Trunc(780+3120/(peri*2)*x)]/1024}
113 *Cos386(x
*pi
/peri
) ));
114 If (y2
>=0) And (y2
<200) Then
116 x2
:=Round(159.5+r
{*Sinus^[Trunc(3120/(peri*2)*x)]/1024}
117 *Sin386(x
*pi
/peri
) );
118 If (x2
>159) And (x2
<320) Then
120 col
:=Round(x
/peri
*512) And 255;
121 {} Memw
[seg(segmen2
^):2*(160*y2
+(319-x2
))]:=(256*(Round(2*r
) and 255))+257-col
;
122 {} Memw
[seg(seg3
^):2*(160*y2
+x2
-160)]:=(256*(Round(2*r
) and 255))+col
;
126 If (Round(r
*1000) mod 114=0)
127 And (r
<240) Then Write('²');
131 Procedure Trash_It_256
;
138 les di,segmen
{Schreib-Speicher" laden}
148 mov al,[si+1] {Pixelfarbe rechts neben dem Zielpixel nach al}
149 mov dl,[si-1] {Pixelfarbe links neben dem Zielpixel nach bl}
150 add ax,dx {Pixelfarben addieren}
151 mov dl,[si-257] {...und so weiter...[der Offset der Pixel berechnet
152 sich aus 320*Y+X ...min=0...max=63999]}
165 shr ax,3 {Summe der Farben per shiften um 3 nach rechts durch
167 stosb {in den "original-Punkt"}
168 inc si {n„chstes Pixel}
171 jnz @lop {solange, bis cx=0...dann sind alle, bis auf die
172 Pixel in Zeile 1 berechnet worden}
177 Procedure Klecks
( x
, y
, farbe
: Byte);assembler;
193 Procedure CalcRain( plas
: Pointer; Intensity
: Byte);
194 Var x
, y
, i
, a
: Word;
197 For i
:=0 To 160 Do {schon mal vorbereiten, damit dann nicht}
198 Begin {erst langsam der Screen voller wird}
199 If i
mod 16=0 Then Write('²');
201 Klecks( Random(246), Random(246), Intensity
);
216 Procedure DoWorm( plas
, seg3
: Pointer; move
: Word);assembler;
219 mov ax, word ptr [segmen2
+2]
222 mov ax, word ptr [seg3
+2]
230 mov ch, 200 {Z„hler der Zeilen}
232 mov cl, 160 {Spalten}
235 mov si, [bx] {Adresse laden}
236 add si, ax {Bewegung drauf}
237 movsb {Pixel kopieren}
238 add bx, 2 {n„chste Adresse}
239 dec cl {Z„hler senken}
241 push bx {linken Offset sichern}
243 mov cl, 160 {Spalten}
244 mov bx, dx {rechten laden}
253 mov dx, bx {rechten sichern}
254 pop bx {linken laden}