home *** CD-ROM | disk | FTP | other *** search
/ The Equalizer BBS / equalizer-bbs-collection_2004.zip / equalizer-bbs-collection / DEMOSCENE-STUFF / IBYTES02.ZIP / SRC_HI!.ZIP / HI!TRO.ASM < prev    next >
Assembly Source File  |  1994-06-26  |  15KB  |  869 lines

  1.         ideal
  2.         p386
  3.         model    large,pascal
  4.  
  5. TESTLAST    =    0
  6.  
  7. TESTPAL        =    0
  8. USUALVGA2    =    1
  9.  
  10. ; SETVGA.ASM
  11. extrn        set_vga_mode : far,\    ; Initialize very complex X mode
  12.         set_vga_page : far    ; AL-number of page to visualize
  13.  
  14. ; FASTFX.ASM
  15. extrn        set_fast_fx : far,\
  16.         draw_fast_fx : far,\
  17.         next_fast_fx : far
  18.  
  19. ; FLAME.ASM
  20. extrn        set_flame_palette : far,\
  21.         make_flame : far,\
  22.         wait_vr : far,\
  23.         start_flame_fade : far,\
  24.         fade_to_flame : far,\
  25.         fade_to_black : far,\
  26.         get_fade_pal_ptr : far
  27.  
  28. ; SHADEBOB.ASM
  29. extrn        init_shadebob : far,\
  30.         set_bob_traectory : far,\
  31.         put_shadebob : far
  32.  
  33. ; ROT.ASM
  34. extrn        set_rotate_texture : far,\
  35.         set_rotate_params : far,\
  36.         set_rotate_center : far,\
  37.         rot_draw_page : far,\
  38.         rot_draw_column : far
  39.  
  40. ; External images
  41. extrn        _rot_image0 : far,\    ; Binary image to rotate
  42.         _rot_image0pal : far    ; And its palette.
  43.  
  44. ; External text image
  45. extrn        HI_TEXT : far
  46.  
  47.         codeseg
  48.  
  49. ; -- entry -----------------------------------------------------
  50. ;
  51.         udataseg
  52. old_vga_mode    db    ?
  53.         codeseg
  54. proc        entry
  55.     cld
  56.     mov    ax,DGROUP
  57.     mov    ds,ax
  58.     mov    es,ax
  59.     mov    ah,0fh
  60.     int    10h
  61.     mov    [old_vga_mode],al
  62.     call    do_demo
  63.     mov    al,[old_vga_mode]
  64.     mov    ah,0
  65.     push    ax
  66.     int    10h
  67.     pop    ax
  68.     cmp    al,7
  69.     mov    ax,0b800h
  70.     jne    @@1
  71.     mov    ah,0b0h
  72. @@1:
  73.     call    put_end_text
  74.     mov    ax,4c00h
  75.     int    21h
  76. endp        entry
  77. ; -- put_end_text ----------------------------------------------
  78. ;
  79. proc        put_end_text    near
  80.     push    ds es
  81.     mov    es,ax
  82.     mov    ax,SEG HI_TEXT
  83.     mov    ds,ax
  84.     mov    si,offset HI_TEXT
  85.     xor    di,di
  86.     mov    cx,4000/4
  87.     rep    movsd
  88.     mov    dx,23*256
  89.     xor    bx,bx
  90.     mov    ah,2
  91.     int    10h
  92.     pop    es ds
  93.     ret
  94. endp        put_end_text
  95.  
  96. ; -- do_demo ---------------------------------------------------
  97. ;
  98. proc        do_demo    near
  99.     mov    ax,13h
  100.     int    10h
  101.     mov    dx,03dah
  102.     in    al,dx
  103.     mov    dl,0c8h
  104.     mov    al,0
  105.     out    dx,al
  106.     inc    dx
  107.     mov    cx,300h
  108. @@clrloop:
  109.     out    dx,al
  110.     loop    @@clrloop
  111. IF    TESTLAST eq 0
  112.     call    do_rotation
  113.     call    demo_shadebob
  114. ENDIF
  115.     call    demo_running_figures
  116.     ret
  117. endp        do_demo
  118.  
  119. ; **************************************************************
  120.  
  121. ; -- sb_traect -------------------------------------------------
  122. ;
  123. BOBXRAD        =    290/2
  124. BOBYRAD        =    170/2
  125.         udataseg
  126. bob_time    dw    ?
  127.         codeseg
  128. label        sine_table    word
  129. include    "sinetbl.inc"
  130. proc        sb_traect    far
  131.     mov    si,[bob_time]
  132.     shr    si,1
  133.     imul    di,si,4*2
  134.     and    di,(_TWOPI-1)*2
  135.     movsx    eax,[di+sine_table]
  136.     mov    edx,BOBXRAD
  137.     imul    edx
  138.     sar    eax,_FRACBITS
  139.     add    ax,160-8    ; Center coords without a half of bob
  140.     push    ax    ; Got X coordinate
  141.     imul    di,si,5*2
  142.     sub    di,_TWOPI/4*2
  143.     neg    di
  144.     and    di,(_TWOPI-1)*2
  145.     movsx    eax,[di+sine_table]
  146.     mov    edx,BOBYRAD
  147.     imul    edx
  148.     sar    eax,_FRACBITS
  149.     add    eax,100-8    ; Center w/o half of bob
  150.     mov    bx,ax
  151.     pop    ax
  152.     add    [bob_time],3;_TWOPI/320
  153.     or    ax,ax
  154.     ret
  155. endp        sb_traect
  156. ; -- sb_traect0 ------------------------------------------------
  157. ;
  158. proc        sb_traect0    far
  159.     mov    si,[bob_time]
  160.     shr    si,1
  161.     imul    di,si,12*2
  162.     and    di,(_TWOPI-1)*2
  163.     movsx    eax,[di+sine_table]
  164.     mov    edx,BOBXRAD
  165.     imul    edx
  166.     sar    eax,_FRACBITS
  167.     add    ax,160-8    ; Center coords without a half of bob
  168.     push    ax    ; Got X coordinate
  169.     imul    di,si,2
  170.     sub    di,_TWOPI/4*2
  171.     neg    di
  172.     and    di,(_TWOPI-1)*2
  173.     movsx    eax,[di+sine_table]
  174.     mov    edx,BOBYRAD
  175.     imul    edx
  176.     sar    eax,_FRACBITS
  177.     add    eax,100-8    ; Center w/o half of bob
  178.     mov    bx,ax
  179.     pop    ax
  180.     add    [bob_time],1;_TWOPI/320
  181.     or    ax,ax
  182.     ret
  183. endp        sb_traect0
  184. ; -- sb_tract_line ---------------------------------------------
  185. ;
  186.         udataseg
  187. sbstartx    dw    ?
  188. sbendx        dw    ?
  189. sbstarty    dw    ?
  190. sbendy        dw    ?
  191. sblinelen    dw    ?
  192. sblinetime    dw    ?
  193. sblinedone    db    ?
  194.         codeseg
  195. proc        sb_traect_line    far
  196.     cmp    [sblinedone],1
  197.     cmc
  198.     jb    @@exit
  199.     mov    bp,[sblinelen]
  200.     mov    si,[sblinetime]
  201.     mov    ax,[sbendy]
  202.     mov    bx,[sbstarty]
  203.     sub    ax,bx
  204.     imul    si
  205.     idiv    bp
  206.     add    bx,ax
  207.     mov    ax,[sbendx]
  208.     mov    cx,[sbstartx]
  209.     sub    ax,cx
  210.     imul    si
  211.     idiv    bp
  212.     add    ax,cx
  213.     add    si,2
  214.     mov    [sblinetime],si
  215.     cmp    si,bp
  216.     jb    @@end
  217.     mov    [sblinedone],1
  218. @@end:
  219.     or    ax,ax
  220. @@exit:
  221.     ret
  222. endp        sb_traect_line
  223.  
  224. ; -- demo_shadebob ---------------------------------------------
  225. ;
  226. PUTBOBCOUNTER    =    72
  227. label        lines_index    word
  228. dw    -2,-2,-2,-2    ; Wait a lot for flame
  229. MACRO    set_startcoords    x,y
  230. $STARTX        =    (&x)-8
  231. $STARTY        =    (&y)-8
  232. ENDM
  233. MACRO    sbline    x0,y0,x1,y1
  234. dw    $STARTX+x0,$STARTY+y0,$STARTX+x1,$STARTY+y1
  235. ENDM
  236. ; 'H'
  237. set_startcoords    20,10
  238. sbline    0,0,0,80
  239. sbline    60,0,60,80
  240. sbline    0,40,60,40
  241. ; 'I'
  242. set_startcoords    20+60+20,10
  243. sbline    5,0,45,0
  244. sbline    25,0,25,80
  245. sbline    5,80,45,80
  246. ; '!'
  247. set_startcoords    20+60+20+40+20*2,10
  248. sbline    50-10,0,50+10,0
  249. sbline    50+10,0,50,80-30
  250. sbline    50-10,0,50,80-30
  251. sbline    50,80-15,50,80
  252. dw    -2
  253. ; 'T'
  254. set_startcoords    20,100
  255. sbline    0,0,40,0
  256. sbline    20,0,20,80
  257. ; 'h'
  258. set_startcoords    20+40+20,100
  259. sbline    0,0,0,80
  260. sbline    0,35,40,45
  261. sbline    40,45,40,80
  262. ; 'e'
  263. set_startcoords    20+40+20+40+20,100
  264. MACRO    e_char
  265. sbline    0,40,20,0
  266. sbline    20,0,40,40
  267. sbline    40,40,0,40
  268. sbline    0,40,40,80
  269. ENDM
  270. e_char
  271. ; 'r'
  272. set_startcoords    20+40+20+40+20+40+20,100
  273. sbline    0,45,0,80
  274. sbline    0,35,10,40
  275. sbline    10,40,40,45
  276. ; 'e'
  277. set_startcoords    20+40+20+40+20+40+20+40+20,100
  278. e_char
  279. dw    -2,-2,-2,-2
  280. dw    -1    ; End of lines sequence
  281. proc        demo_shadebob    near
  282.     call    set_flame_palette
  283.     imul    ax,3
  284.     shr    ax,2
  285.     call    init_shadebob
  286.     mov    [bob_time],0
  287.     mov    ax,offset sb_traect
  288.     mov    dx,cs
  289.     call    set_bob_traectory
  290.     push    ds
  291.     pop    es
  292. IF    1
  293. @@loop0:
  294.     mov    cx,PUTBOBCOUNTER
  295. @@putbob:
  296.     call    put_shadebob
  297.     loop    @@putbob
  298.     call    make_flame
  299.     cmp    [bob_time],_TWOPI*2
  300.     jb    @@loop0
  301.     mov    ax,offset sb_traect_line
  302.     mov    dx,cs
  303.     call    set_bob_traectory
  304.     xor    si,si
  305. @@loop1:
  306.     mov    ax,[si+lines_index]
  307.     add    si,2
  308.     cmp    ax,-1
  309.     je    @@done_show
  310.     cmp    ax,-2
  311.     jne    @@draw_line
  312.     mov    cx,10
  313. @@makeflame:
  314.     call    make_flame    ; Let fire goes out
  315.     loop    @@makeflame
  316.     jmp    @@loop1
  317. @@draw_line:
  318.     mov    [sbstartx],ax
  319.     mov    bx,[si+lines_index]
  320.     mov    [sbstarty],bx
  321.     mov    cx,[si+lines_index+2]
  322.     mov    [sbendx],cx
  323.     mov    dx,[si+lines_index+4]
  324.     mov    [sbendy],dx
  325.     sub    ax,dx
  326.     sub    cx,bx
  327.     cwd
  328.     xor    ax,dx
  329.     sub    ax,dx
  330.     xchg    ax,cx
  331.     cwd
  332.     xor    ax,dx
  333.     sub    ax,dx
  334.     cmp    ax,cx
  335.     jae    @@maxfound
  336.     mov    ax,cx
  337. @@maxfound:
  338.     inc    ax
  339.     mov    [sblinelen],ax
  340.     mov    [sblinetime],0
  341.     mov    [sblinedone],0
  342. @@lineloop:
  343.     call    put_shadebob
  344.     cmp    [sblinedone],0
  345.     je    @@lineloop
  346.     add    si,6    ; Remaining three coords
  347.     jmp    @@loop1
  348. @@done_show:
  349. ENDIF
  350. ;    mov    ax,offset sb_traect0
  351. ;    mov    dx,cs
  352. ;    call    set_bob_traectory
  353. ;    mov    cx,PUTBOBCOUNTER*5
  354. ;@@beforefade:
  355. ;    call    put_shadebob
  356. ;    loop    @@beforefade
  357.     call    start_flame_fade
  358.     xor    ax,ax
  359. @@fade:
  360.     cmp    al,65
  361.     cmc
  362.     adc    ah,0
  363. ;    mov    cx,PUTBOBCOUNTER
  364. ;@@putbob0:
  365. ;    call    put_shadebob
  366. ;    loop    @@putbob0
  367. ;    call    make_flame
  368.     call    wait_vr
  369.     call    fade_to_flame
  370.     add    al,2;4
  371.     or    ah,ah
  372.     jz    @@fade
  373.     mov    cx,80
  374. @@lastpause:
  375.     call    wait_vr
  376.     loop    @@lastpause
  377. @@end:
  378.     call    undraw_screen
  379.     ret
  380. endp        demo_shadebob
  381. ; -- undraw_screen ---------------------------------------------
  382. ;
  383. proc        undraw_screen
  384.     push    es
  385.     call    get_fade_pal_ptr
  386.     push    di
  387.     xor    eax,eax
  388.     mov    cx,300/4
  389.     rep    stosw
  390.     pop    di
  391.     mov    ax,3f3fh
  392.     mov    [es:di+3],ax
  393.     mov    [es:di+3+2],al
  394.     mov    ax,0a000h
  395.     mov    es,ax
  396.     mov    eax,01010101h
  397.     mov    cx,64000/4
  398.     rep    stosd
  399.     mov    al,0
  400.     call    fade_to_flame
  401.     mov    bp,200/2-1
  402.     xor    bx,bx
  403. @@undrloop:
  404.     xor    eax,eax
  405.     mov    cx,320/4
  406.     mov    di,bx
  407.     rep    stosd
  408.     mov    di,199*320
  409.     sub    di,bx
  410.     mov    cx,320/4
  411.     rep    stosd
  412.     mov    cx,3
  413. @@wr0:
  414.     call    wait_vr
  415.     loop    @@wr0
  416.     add    bx,320
  417.     dec    bp
  418.     jnz    @@undrloop
  419.     mov    di,bx
  420.     mov    cx,320/4
  421.     xor    eax,eax
  422.     rep    stosd
  423.     mov    cx,200
  424. @@wr1:
  425.     call    wait_vr
  426.     loop    @@wr1
  427.     mov    bp,320/2
  428.     xor    bx,bx
  429.     mov    di,319
  430. @@undrloop0:
  431.     mov    cx,8
  432.     cmp    bp,4
  433.     jne    @@wr2
  434.     imul    cx,40
  435. @@wr2:
  436.     call    wait_vr
  437.     loop    @@wr2
  438.     mov    al,0
  439.     mov    [es:320*99+bx],al
  440.     mov    [es:320*99+di],al
  441.     mov    [es:320*100+bx],al
  442.     mov    [es:320*100+di],al
  443.     inc    bx
  444.     dec    di
  445.     dec    bp
  446.     jnz    @@undrloop0
  447.     mov    cx,400
  448. @@wr3:
  449.     call    wait_vr
  450.     loop    @@wr3
  451.     pop    es
  452.     ret
  453. endp        undraw_screen
  454.  
  455. ; **************************************************************
  456.  
  457. ; -- do_rotation -----------------------------------------------
  458. ;
  459. RLINEBITS    =    3
  460.         udataseg
  461. rcurr_linesz    dw    ?
  462. rcurr_radius    dw    ?
  463. rcurr_radpause    dw    ?
  464. rcurr_zoom    dd    ?
  465. rzoom_step    dd    ?
  466. rcurr_time    dw    ?
  467. rcurr_centerx    dw    ?
  468. rcurr_centery    dw    ?
  469. rcurr_centers    db    ?
  470. rcurr_centercnt    dw    ?
  471.         codeseg
  472. ROT_RAD        equ    [rcurr_radius];80
  473. proc        do_rotation    near
  474.     call    _init_rotrad
  475.     mov    [rcurr_zoom],_FRACMUL
  476.     mov    [rzoom_step],_FRACMUL/32
  477.     mov    [rcurr_centercnt],80
  478.     mov    [rcurr_centers],0
  479.     mov    [rcurr_linesz],-1
  480.     call    rotate_0
  481.     ret
  482. endp        do_rotation
  483. ; -- sqrt_fp ---------------------------------------------------
  484. ;
  485. proc        sqrt_fp
  486.     or    eax,eax
  487.     jnz    @@notz
  488.     ret
  489. @@notz:
  490.     mov    ecx,eax
  491.     mov    ebx,eax
  492.     shr    ebx,1
  493.     REPT    16
  494.     mov    eax,ecx
  495.     xor    edx,edx
  496.     shld    edx,eax,_FRACBITS
  497.     shl    eax,_FRACBITS
  498.     div    ebx
  499.     add    ebx,eax
  500.     shr    ebx,1
  501.     ENDM
  502.     ret
  503. endp        sqrt_fp
  504. ; -- get_line_y_size -------------------------------------------
  505. ;
  506. proc        get_line_y_size
  507.     mov    ax,[rcurr_linesz]
  508.     sar    ax,RLINEBITS
  509.     ret
  510. endp        get_line_y_size
  511. ; -- get_y_size ------------------------------------------------
  512. ;
  513. proc        get_y_size    near
  514.         udataseg
  515. @@currysz    dw    ?
  516.         codeseg
  517.     call    get_line_y_size
  518.     mov    [@@currysz],ax
  519.     movzx    eax,si
  520.     cwd
  521.     xor    ax,dx
  522.     sub    ax,dx
  523.     mov    bx,-1
  524.     cmp    ax,ROT_RAD
  525.     jg    @@end
  526.     shl    eax,_FRACBITS
  527.     jz    @@1
  528.     sub    eax,_FRACMUL/2
  529. @@1:
  530.     imul    eax
  531.     shrd    eax,edx,_FRACBITS
  532.     mov    ebx,eax
  533.     movzx    eax,ROT_RAD
  534.     imul    eax
  535.     shl    eax,_FRACBITS
  536.     sub    eax,ebx
  537.     call    sqrt_fp
  538.     shr    ebx,_FRACBITS
  539. @@end:
  540.     cmp    bx,[@@currysz]
  541.     jg    @@exit
  542.     mov    bx,[@@currysz]
  543. @@exit:
  544.     ret
  545. endp        get_y_size
  546. ; -- next_rzoom ------------------------------------------------
  547. ;
  548. proc        next_rzoom    near
  549.     mov    eax,[rzoom_step]
  550.     add    eax,[rcurr_zoom]
  551.     mov    [rcurr_zoom],eax
  552.     cmp    eax,_FRACMUL*4
  553.     jnb    @@invert
  554.     cmp    eax,_FRACMUL/32
  555.     ja    @@noti
  556. @@invert:
  557.     neg    [rzoom_step]
  558. @@noti:
  559.     ret
  560. endp        next_rzoom
  561. ; -- draw_rotated_pic ------------------------------------------
  562. ;
  563. proc        draw_rotated_pic    near
  564.     pushad
  565.     mov    si,-160
  566. @@loop:
  567.     call    get_y_size
  568.     or    bx,bx
  569.     jl    @@next
  570.     mov    cx,bx
  571.     add    cx,200/2
  572.     sub    bx,200/2
  573.     neg    bx
  574.     mov    ax,si
  575.     add    ax,320/2
  576.     call    rot_draw_column
  577. @@next:
  578.     inc    si
  579.     cmp    si,159
  580.     jle    @@loop
  581.     call    next_rzoom
  582.     popad
  583.     ret
  584. endp        draw_rotated_pic
  585. ; -- next_rot_radius -------------------------------------------
  586. ;
  587. proc        next_rot_radius    near
  588.     cmp    [rcurr_linesz],(80/2) shl RLINEBITS
  589.     jg    @@1
  590.     inc    [rcurr_linesz]
  591. @@1:
  592.     cmp    ROT_RAD,80
  593.     jb    @@inc
  594.     dec    [rcurr_radpause]
  595.     jg    @@exit
  596. _init_rotrad:
  597.     mov    ROT_RAD,5
  598.     mov    [rcurr_radpause],80*30
  599.     jmp    @@exit
  600. @@inc:
  601.     inc    ROT_RAD
  602. @@exit:
  603.     ret
  604. endp        next_rot_radius
  605. ; -- next_rot_center -------------------------------------------
  606. ;
  607. RADIUS0        =    79
  608. RADIUS1        =    30
  609. proc        next_rot_center    near
  610.     movzx    ebx,[rcurr_centers]
  611.     jmp    [ebx*2+@@steps]
  612. @@steps    dw    @@startwait,@@feed_xcenter,@@do_circle,@@alldone
  613. @@startwait:
  614.     mov    [rcurr_centerx],0
  615.     mov    [rcurr_centery],200/2+RADIUS0
  616.     dec    [rcurr_centercnt]
  617.     jnz    @@exit
  618.     mov    [rcurr_centercnt],160
  619.     jmp    @@next
  620. @@feed_xcenter:
  621.     inc    [rcurr_centerx]
  622.     dec    [rcurr_centercnt]
  623.     jnz    @@exit
  624.     mov    [rcurr_centercnt],256*2
  625.     jmp    @@next
  626. @@do_circle:
  627.     call    @@moveccircle
  628.     dec    [rcurr_centercnt]
  629.     jnz    @@exit
  630.     jmp    @@next
  631. @@alldone:
  632.     call    @@moveccircle
  633.     dec    [rcurr_centercnt]
  634.     jmp    @@exit
  635. @@next:
  636.     inc    [rcurr_centers]
  637. @@exit:
  638.     mov    ax,[rcurr_centerx]
  639.     mov    bx,[rcurr_centery]
  640.     call    set_rotate_center
  641.     ret
  642. label        @@moveccircle    near    ; Move center around circle
  643.     movzx    ebx,[rcurr_centercnt]
  644.     shl    bx,2
  645.     mov    dx,RADIUS0
  646.     and    bx,_TWOPI-1
  647.     mov    ax,[ebx*2+sine_table]
  648.     imul    dx
  649.     shrd    ax,dx,_FRACBITS
  650.     add    ax,320/2
  651.     mov    [rcurr_centerx],ax
  652.     sub    bx,_TWOPI/4
  653.     neg    bx
  654.     and    bx,_TWOPI-1
  655.     mov    ax,RADIUS0
  656.     imul    [ebx*2+sine_table]
  657.     shrd    ax,dx,_FRACBITS
  658.     add    ax,200/2
  659.     mov    [rcurr_centery],ax
  660.     retn
  661. endp        next_rot_center
  662. ; -- rotate_0 --------------------------------------------------
  663. ;
  664. proc        rotate_0    near
  665.     push    es
  666.     call    get_fade_pal_ptr
  667.     push    ds
  668.     mov    ax,SEG _rot_image0pal
  669.     mov    ds,ax
  670.     xor    si,si
  671.     mov    cx,300h/4
  672.     rep    movsd
  673.     pop    ds es
  674.     mov    al,0
  675.     call    fade_to_flame
  676.     mov    ax,SEG _rot_image0
  677.     call    set_rotate_texture
  678.     mov    ax,320/2
  679.     mov    bx,200/2
  680.     call    set_rotate_center
  681.     mov    ax,0a000h
  682.     call    rot_draw_page
  683.     xor    bp,bp
  684. @@mainloop:
  685.     call    wait_vr
  686.     movzx    ebx,[rcurr_time]
  687.     and    bx,_TWOPI-1
  688.     movsx    eax,[sine_table+ebx*2]
  689.     sub    bx,_TWOPI/4
  690.     neg    bx
  691.     and    bx,_TWOPI-1
  692.     movsx    ebx,[sine_table+ebx*2]
  693.     mov    ecx,[rcurr_zoom]
  694.     call    set_rotate_params
  695.     call    draw_rotated_pic
  696.     add    [rcurr_time],9
  697.     call    next_rot_radius
  698.     call    next_rot_center
  699.     cmp    [rcurr_centers],3
  700.     je    @@done
  701.     in    al,60h
  702.     cmp    al,1
  703.     jne    @@mainloop
  704.     mov    ah,0
  705.     int    16h
  706. @@done:
  707.     xor    ax,ax
  708. @@loop:
  709.     cmp    al,64
  710.     sbb    ah,ah
  711.     push    ax
  712.     call    wait_vr
  713.     call    fade_to_flame
  714.     movzx    ebx,[rcurr_time]
  715.     and    bx,_TWOPI-1
  716.     movsx    eax,[sine_table+ebx*2]
  717.     sub    bx,_TWOPI/4
  718.     neg    bx
  719.     and    bx,_TWOPI-1
  720.     movsx    ebx,[sine_table+ebx*2]
  721.     mov    ecx,[rcurr_zoom]
  722.     call    set_rotate_params
  723.     call    draw_rotated_pic
  724.     add    [rcurr_time],9
  725.     call    next_rot_radius
  726.     call    next_rot_center
  727.     pop    ax
  728.     add    al,2
  729.     or    ah,ah
  730.     jnz    @@loop
  731.     push    es
  732.     mov    ax,0a000h
  733.     mov    es,ax
  734.     xor    di,di
  735.     xor    eax,eax
  736.     mov    cx,64000/4
  737.     rep    stosd
  738.     pop    es
  739.     ret
  740. endp        rotate_0
  741.  
  742. ; **************************************************************
  743.  
  744. ; -- construct_fx_palette --------------------------------------
  745. ;
  746. proc        construct_fx_palette    near
  747.     push    es
  748.     call    get_fade_pal_ptr
  749.     push    di
  750.     xor    eax,eax
  751.     mov    cx,300h/4
  752.     rep    stosd
  753.     pop    di
  754.     xor    bx,bx
  755.     call    @@storepal
  756.     mov    al,3fh
  757.     call    @@storepal
  758.     xchg    al,ah
  759.     call    @@storepal
  760.     xchg    ah,bl
  761.     call    @@storepal
  762.     mov    al,3fh
  763.     call    @@storepal
  764.     xchg    al,ah
  765.     call    @@storepal
  766.     shr    ah,1
  767.     shr    bl,1
  768.     call    @@storepal
  769.     shr    ax,1
  770.     mov    al,3fh/2
  771.     shr    bl,1
  772.     call    @@storepal
  773.     mov    ax,03f3fh
  774.     mov    bl,al
  775.     call    @@storepal
  776.     pop    es
  777.     mov    al,0
  778.     call    fade_to_black
  779.     ret
  780. label        @@storepal    near
  781.     stosw
  782.     xchg    ax,bx
  783.     stosb
  784.     xchg    ax,bx
  785.     retn
  786. endp        construct_fx_palette
  787.  
  788. ; -- demo_running_figures --------------------------------------
  789. ;
  790. proc        demo_running_figures    near
  791. IF    USUALVGA2
  792.     call    set_vga_mode
  793. ENDIF
  794.     call    construct_fx_palette
  795.     call    set_fast_fx
  796. IF    TESTLAST eq 0
  797.     mov    ebp,2520
  798. ELSE
  799.     mov    ebp,10000
  800. ENDIF
  801.     mov    al,64
  802. @@loop0:
  803.     cmp    al,80h
  804.     sbb    ah,ah
  805.     and    al,ah
  806.     push    ax
  807.     call    wait_vr
  808.     call    fade_to_black
  809. IF    USUALVGA2
  810.     mov    ax,bp
  811.     and    ax,1
  812.     call    set_vga_page
  813. ELSE
  814.     mov    ax,0a000h
  815. ENDIF
  816.     call    draw_fast_fx
  817.     call    next_fast_fx
  818.     dec    ebp
  819.     pop    ax
  820.     sub    al,4
  821.     or    ah,ah
  822.     jnz    @@loop0
  823. @@loop:
  824.     mov    ax,bp
  825.     and    ax,1
  826.     call    wait_vr
  827. IF    USUALVGA2
  828.     call    set_vga_page    ; RET:AX-address of 
  829. ELSE
  830.     mov    ax,0a000h
  831. ENDIF
  832.     call    draw_fast_fx
  833.     call    next_fast_fx
  834.     dec    ebp
  835.     jz    @@end
  836.     in    al,60h
  837.     cmp    al,1
  838.     jnz    @@loop
  839.     mov    ah,0
  840.     int    16h
  841. @@end:
  842.     xor    ax,ax
  843. @@fadeloop0:
  844.     cmp    al,64
  845.     sbb    ah,ah
  846.     push    ax
  847.     call    wait_vr
  848.     call    fade_to_black
  849. IF    USUALVGA2
  850.     mov    ax,bp
  851.     and    ax,1
  852.     call    set_vga_page
  853. ELSE
  854.     mov    ax,0a000h
  855. ENDIF
  856.     call    draw_fast_fx
  857.     call    next_fast_fx
  858.     dec    ebp
  859.     pop    ax
  860.     add    al,2
  861.     or    ah,ah
  862.     jnz    @@fadeloop0
  863.     ret
  864. endp        demo_running_figures
  865.  
  866.         stack    1024
  867.  
  868.         end    entry
  869.