home *** CD-ROM | disk | FTP | other *** search
/ CD-X 1 / cdx_01.iso / demodisc / tyrant / s_scroll / sin.pas < prev   
Encoding:
Pascal/Delphi Source File  |  1995-03-17  |  4.2 KB  |  209 lines

  1. Program SinScroll;
  2.  
  3. Var     I,J       : Word;
  4.         A         : Real;
  5.  
  6. Procedure Ch4; External; {$L Ch4.Obj}
  7. Procedure Pcx_Tomorito; Assembler;
  8. ASM
  9.         PUSH DS;
  10.         push es
  11.              mov ax,cs
  12.              mov ds,ax
  13.              mov ax,08000h
  14.              mov es,ax
  15.              lea si,Ch4
  16.              ADD SI,128;
  17.              XOR DI,DI;
  18.              XOR BX,BX;
  19.              XOR CX,CX;
  20. @DataIn:     XOR BX,BX;
  21.              LODSB;
  22.              TEST AL,128;
  23.              JE @@AzAs1;
  24.              INC BX;
  25. @@AzAs1:     TEST AL,64;
  26.              JE @@AzAs2;
  27.              INC BX;
  28. @@AzAs2:     CMP BX,2;
  29.              JE @@Duplazas;
  30.              STOSB;
  31.              CMP DI,5*320;
  32.              JA @@AzAs3;
  33.              JMP @DataIn;
  34. @@AzAs3:     CMP DI,64000;
  35.              JA @@DispEnd;
  36.              JMP @DataIn;
  37. @@Duplazas:  AND AL,63;
  38.              XOR AH,AH;
  39.              MOV CX,AX;
  40.              CMP CX,0;
  41.              JNE @@Mehtt;
  42.              INC CX;
  43. @@Mehtt:     LODSB;
  44.              REPNZ STOSB;
  45.              CMP DI,64000;
  46.              JA @@DispEnd;
  47.              JMP @DataIn;
  48. @@DispEnd:   XOR AL,AL;
  49.              MOV DX,03C8h;
  50.              OUT DX,AL;
  51.              INC DX;
  52.              MOV CX,768;
  53. @L2:         LODSB;
  54.              SHR AL,1;
  55.              SHR AL,1;
  56.              OUT DX,AL;
  57.              LOOP @L2;
  58.              pop es
  59.              POP DS;
  60. End;
  61.  
  62.  
  63.  
  64. Begin
  65. asm
  66.         mov ax,09000h
  67.         mov es,ax
  68.         xor di,di
  69.         xor ax,ax
  70.         mov cx,32000
  71. rep     stosw
  72. end;
  73. RandomIze;
  74. A:=0;
  75. For I:=0 To 640 Do Begin
  76.                    MemW[$9000:60000+I*2]:=Round(Sin(A/8)*16)*320;
  77.                    A:=A+(2*pi)/20
  78.                    End;
  79. asm
  80.         push    ds
  81.         mov     ax,013h
  82.         int     10h
  83.  
  84.  
  85.         call    Pcx_tomorito
  86.  
  87.         mov ax,08000h
  88.         mov ds,ax
  89.         mov ax,09000h
  90.         mov es,ax
  91.  
  92.         xor     bx,bx
  93.         mov     cx,3
  94. @c7:    push    cx
  95.         mov     di,320
  96.         add     di,bx
  97.         xor     si,si
  98.         mov     cx,20
  99. @c6:    push    cx
  100.         mov     cx,28
  101. rep
  102. db  $66
  103.         movsw {!}
  104.         add   di,208
  105.         add   si,208
  106.         pop   cx
  107.         loop  @c6
  108.         add   bx,106
  109.         pop   cx
  110.         loop  @c7
  111.         mov     dx,320
  112.         xor     cx,cx
  113.         mov     bx,250
  114. @b4:    push    bx
  115.         push    cx
  116.         mov ax,09000h
  117.         mov ds,ax
  118.         mov ax,0a000h
  119.         mov es,ax
  120.         mov     di,61696
  121.         add     di,cx
  122.         mov     cx,10
  123. @b3:    push    cx
  124.         xor     bx,bx
  125.         mov     cx,20
  126. @b2:    push    cx
  127.         mov     si,60000
  128.         add     si,dx
  129.         mov     cx,80
  130. @b1:    push    di
  131.         lodsw
  132.         add     di,ax
  133.         mov     ax,0f0fh
  134.         push    si
  135.         mov     si,bx
  136.  
  137.         cmp     di,55998
  138.         ja      @t2
  139.         cmp     di,4800
  140.         jb      @t2
  141. db $66
  142.         movsw
  143. @t2:    pop     si
  144.         pop     di
  145.         add     di,4
  146.         add     bx,4
  147.         loop    @b1
  148.         pop     cx
  149.         loop    @b2
  150.         pop     cx
  151.         loop    @b3
  152.  
  153.         dec     dx
  154.         dec     dx
  155.         cmp     dx,65534
  156.         jne     @t1
  157.         mov     dx,320
  158. @t1:
  159.         mov ax,09000h
  160.         mov es,ax
  161.         mov     di,320
  162.         mov     si,320
  163.         mov     cx,18
  164. @c5:    push    cx
  165.         lodsw
  166.         push    ax
  167.         mov     cx,79
  168. rep
  169. db  $66
  170.         movsw
  171.         pop  ax
  172.         stosw
  173.         inc  di
  174.         inc  di
  175.         inc  si
  176.         inc  si
  177.         pop  cx
  178.         loop @c5
  179.  
  180. {          push    dx                           ;RETRACE
  181.           mov     dx,03dah
  182. @y1:      in      al,dx
  183.           test    al,8
  184.           jz      @y1
  185. @y2:      in      al,dx
  186.           test    al,8
  187.           jnz     @y2
  188.           pop     dx}
  189.  
  190.         pop       cx
  191.         pop       bx
  192.         cmp       bx,0
  193.         je        @t6
  194.         dec       bx
  195.         jmp       @t4
  196. @t6:    add       cx,320
  197.         cmp       cx,6400
  198.         jne       @t4
  199.         xor       cx,cx
  200. @t4:    in      al,060h
  201.         cmp     al,1
  202.         jne     @b4
  203.         pop     ds
  204.         mov     ax,03h
  205.         int     10h
  206. end;
  207. End.
  208.  
  209.                          CODE BY TYRANT / MURMIDONES