home *** CD-ROM | disk | FTP | other *** search
- { Code by TyRaNT / MurmidoneS }
- Program DotChaos;
-
- Var SinTab : Array[0..360] Of Shortint;
- CosTab : Array[0..360] Of Shortint;
- CsilTab : Array[0..20000] Of Word;
- CsilMov : Array[0..10000] Of Byte;
- CsilTer : Array[0..2000] Of Integer;
- CsilTar : Array[0..100] Of Integer;
- Sor100 : Array[0..180] Of Word;
- Szinek : Array[0..300] Of Byte;
-
- CsP,Sza : Word;
- I : LongInt;
- te,aj : Word;
- te2,aj2 : Word;
- J,K : Word;
- X,Y : LongInt;
- A,B : Real;
- MaxCs : Word;
- IrqSave : Byte;
-
- Procedure GenSinCos;
- Begin
- A:=0;
- I:=0;
- Repeat
- SinTab[I]:=Trunc(Sin(A)*256);
- CosTab[I]:=Trunc(Cos(A)*256);
- Inc(I);
- A:=A+Pi/180
- Until A>2*Pi;
- End;
-
- Procedure GenCsilTab;
- Begin
- RandomIze;
- I:=0;
- J:=0;
- Repeat
- K:=110;
- Repeat
- X:=(SinTab[I]*K*768) Div 65536+160;
- Y:=(CosTab[I]*K*614) Div 65536+100;
- If (X<1) Or (X>319) Then Begin X:=0; Y:=0; End;
- If (Y<1) Or (Y>199) Then Begin X:=0; Y:=0; End;
- CsilTab[J]:=Y*320+X;
- Inc(J);
- K:=K-1;
- Until K=10;
- I:=I+2;
- Until I=360;
- {asm
- jmp @ter
-
- @Iv: dw 0
- @Jv: dw 0
- @Kv: dw 0
-
- @ter:
- mov cs:word ptr @Iv,0
- mov cs:word ptr @Jv,0
- @Pc1:
- mov cs:word ptr @kv,110
-
- lea si,sintab
-
-
- end;}
- End;
-
- Procedure GenCsilMov;
- Begin
- I:=0;
- Repeat
- CsilMov[I]:=Random(180);
- CsilMov[I+1]:=Random(100);
- Inc(I,2);
- Until I>=(MaxCs*2);
- End;
-
- Procedure GenCsilTer;
- Begin
- asm
- push es
- mov ax,ds
- mov es,ax
- lea di,Csiltar
- xor ax,ax
- mov cx,100
- rep stosw
- lea di,Csilter
- xor ax,ax
- mov cx,2000
- rep stosw
- pop es
- end;
-
-
- A:=2*Pi/360;
- B:=0;
- For I:=0 To 1440 Do Begin
- CsilTer[I+200]:=Round(Sin(B*3)*20)*320;
- CsilTer[I+200]:=CsilTer[I+200]+Round(Sin(B*4)*20);
- B:=B+A;
- End;
- End;
-
-
- Procedure GenSor100; assembler;
- asm
- push es
- mov ax,ds
- mov es,ax
- lea di,sor100
- xor ax,ax
- xor bx,bx
- mov cx,180
- xor dx,dx
- @gssz: push cx
- push ax
- mov bx,100
- mul bx
- stosw
- pop ax
- pop cx
- inc ax
- loop @gssz
- pop es
- end;
-
- Procedure Genszin; assembler;
- asm
-
- mov ax,ds
- mov es,ax
-
- lea di,szinek
- add di,298
- xor dx,dx
- mov cx,100
-
- @yoo: mov al,dl
- shr al,1
- stosb
- sub di,2
- mov al,dl
- shr al,1
- stosb
- sub di,2
- mov al,dl
- stosb
- sub di,2
- cmp dx,62
- je @yot
- add dx,2
- @yot: loop @yoo
-
- MOV BX,1;
- MOV CX,99;
- push ds
- pop es
- MOV DX,Offset szinek
- mov ax,01012h
- INT 10H
- End;
-
- Begin
- asm
- Jmp @Start
-
- @Ret: mov dx,03dah
- @y1: in al,dx
- test al,8
- jz @y1
- @y2: in al,dx
- test al,8
- jnz @y2
- ret
-
-
- @Fel: mov CX,MaxCs
- dec cx
- mov si,offset CsilMov
- @Lo2: push cx
-
- lodsw
-
- cmp ax,0
- je @t1
-
- nop
-
- @ko: inc ah
- cmp ah,100
- jne @Lt1
- xor ah,ah
- @Lt1: mov [si-2],ax
- push ax
-
- mov cl,ah
- xor ch,ch
- xor ah,ah
-
- mov bx,offset sor100
- add bx,ax
- add bx,ax
- mov ax,[bx]
- add ax,cx
-
-
- mov Bx,offset CsilTab
- add bx,ax
- add bx,ax
- mov di,[bx]
-
- pop ax
-
- mov al,ah
- xor ah,ah
- mov bx,offset CsilTar
- add bx,ax
- add bx,ax
- add di,[bx]
-
- cmp di,te
- jb @t1
- cmp di,aj
- ja @t1
-
- stosb
-
- @T1: pop cx
- loop @Lo2
- ret
-
- @csilmv: push es
- push ds
- pop es
-
- mov si,offset CsilTer
- add si,csp
- mov di,offset CsilTar
- mov cx,100
- rep movsw
-
- add csp,2
- cmp csp,920*2
- jne @cmk
- mov csp,200*2
-
- @cmk: pop es
- ret
-
- @Start: mov ax,013h
- int 10h
-
- Call Genszin
-
- mov ax,09000h
- mov es,ax
- xor di,di
- xor ax,ax
- mov cx,32000
- rep stosw
- mov csp,20
- mov sza,500
- call @csilmv
- mov te,20*320
- mov te2,20*320
- mov aj,180*320
- mov aj2,180*320
- mov maxcs,5000
- call GenSinCos;
- call GenSor100;
- call GenCsilMov
- call GenCsilTab;
- call GenCsilTer;
-
- mov cx,100
- @tmcs: push cx
- call @csilmv
- pop cx
- loop @tmcs
-
- @E1: call @fel
- push ds
- push es
- push es
- pop ds
- push 0a000h
- pop es
- mov si,20*320+20
- mov di,20*320+20
- mov cx,160
- @cl1: push cx
- mov cx,280/4
- db $66
- rep movsw
- add si,40
- add di,40
- pop cx
- loop @cl1
- pop es
- pop ds
-
- call @ret
- xor di,di
- mov cx,16000
- db $66
- xor ax,ax
- db $66
- rep stosw
-
- call @csilmv
- call @csilmv
-
- in al,060h
- cmp al,1
- jne @e1
-
- end;
-
- End.