home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c011 / 1.ddi / SOURCE / FXVR.ASM < prev    next >
Encoding:
Assembly Source File  |  1989-06-01  |  5.9 KB  |  179 lines

  1.   PAGE    60,132
  2.   TITLE   fxVR.ASM -- PCX Effects
  3.   SUBTTL  Copyright (c) Genus Microprogramming, Inc. 1988-89
  4.  
  5. ; fxVR.ASM                                                                   ;
  6. ; Copyright (c) Genus Microprogramming, Inc. 1988-89  All Rights Reserved.   ;
  7.  
  8. ;****************************************************************************;
  9. ;                                                                            ;
  10. ; This file contains procedures for taking a pcx virtual buffer and          ;
  11. ; 'dripping' it on the display.                                              ;
  12. ;                                                                            ;
  13. ; Procedures: fxVirtualSand                                                  ;
  14. ;                                                                            ;
  15. ;                                                                            ;
  16. ;                                                                            ;
  17. ; Microsoft ASM 5.x version.              Programmer: Chris Howard  5/04/89  ;
  18. ;                                                                            ;
  19. ;****************************************************************************;
  20.  
  21. ; Include files
  22.   INCLUDE ..\inc\pcxDefs.inc
  23.   INCLUDE ..\inc\pcxMacs.inc
  24.   INCLUDE ..\inc\pcxErrs.inc
  25.  
  26.   INCLUDE ..\inc\fxDefs.inc
  27.   INCLUDE ..\inc\fxMacs.inc
  28.   INCLUDE ..\inc\fxErrs.inc
  29.  
  30.   @SetModel
  31.  
  32.   @BegData
  33.   @EndData
  34.  
  35.   @BegCode
  36.  
  37.           EXTRN     pcxVirtualDisplay       : FAR
  38.           EXTRN     fxEffectDelay           : FAR
  39.  
  40.           PUBLIC    fxVirtualDrip 
  41.  
  42. ;**********
  43.  
  44. ;
  45. ; This is the Virtual Drip effect procedure, for the fxVirtualEffect
  46. ; interface.  It is an INTERNAL routine only.
  47. ;
  48. ; On Entry:  SS:BP    points to pcxVirtualEffect frame
  49. ;            ES:DI    points to display structure
  50. ;            DS:SI    points to buffer
  51. ;
  52. ; On Exit:   retcode  contains error code, if any
  53. ;
  54.  
  55. fxVirtualDrip       PROC FAR
  56.  
  57.           mov       ax,vedir                ;What direction?
  58.           cmp       ax,fxUP                 ;Right and up  
  59.           jne       fxVD_down       
  60.  
  61.           jmp       SHORT fxVD_up   
  62.  
  63. fxVD_down:
  64.                                         
  65.           mov       si,0                    ;Initialize loop counter
  66.  
  67. fxVD_mainloop:
  68.  
  69.           mov       di,si                   ;Init inner loop
  70.  
  71. fxVD_loop:
  72.  
  73.           mov       ax,vevseg               ;vptr
  74.           push      ax
  75.           mov       ax,vevofs
  76.           push      ax
  77.           xor       ax,ax                   ;vx   = 0
  78.           push      ax
  79.           push      si                      ;vy   = loop
  80.           mov       ax,vex                  ;x    = x
  81.           push      ax
  82.           mov       bx,vey                  ;y    = y+loop
  83.           add       bx,di
  84.           push      bx
  85.           mov       ax,vex2                 ;x2   = x2
  86.           push      ax                           
  87.           push      bx                      ;y2   = y+loop
  88.           mov       ax,vepage               ;page = current
  89.           push      ax                      
  90.  
  91.           call      pcxVirtualDisplay       ;Display this part
  92.  
  93.           inc       di                      ;Bump inner loop
  94.           cmp       di,vedepth              ;Have we 'dripped' to the bottom?
  95.           jl        fxVD_loop               ;If not, loop
  96.  
  97.           mov       ax,vedelay              ;Get the delay count
  98.           push      ax
  99.  
  100.           call      fxEffectDelay           ; and delay
  101.  
  102.           jnc       fxVD_bump               ;If no error, continue
  103.           jmp       SHORT fxVD_error              
  104.  
  105. fxVD_bump:
  106.  
  107.           inc       si                      ;Bump main loop
  108.           cmp       si,vedepth              ;Have we done all lines?
  109.           jl        fxVD_mainloop           ;If not, loop
  110.  
  111.           @SetRet   veret,fxSUCCESS         ;Set the return code
  112.           jmp       SHORT fxVD_exit
  113.  
  114. fxVD_up:
  115.                                         
  116.           mov       si,vedepth              ;Initialize loop counter
  117.           dec       si
  118.  
  119. fxVD_upmainloop:
  120.  
  121.           mov       di,si                   ;Init inner loop
  122.  
  123. fxVD_uploop:
  124.  
  125.           mov       ax,vevseg               ;vptr
  126.           push      ax
  127.           mov       ax,vevofs
  128.           push      ax
  129.           xor       ax,ax                   ;vx   = 0
  130.           push      ax
  131.           push      si                      ;vy   = loop
  132.           mov       ax,vex                  ;x    = x
  133.           push      ax
  134.           mov       bx,vey                  ;y    = y+loop
  135.           add       bx,di
  136.           push      bx
  137.           mov       ax,vex2                 ;x2   = x2
  138.           push      ax                           
  139.           push      bx                      ;y2   = y+loop
  140.           mov       ax,vepage               ;page = current
  141.           push      ax                      
  142.  
  143.           call      pcxVirtualDisplay       ;Display this part
  144.  
  145.           dec       di                      ;Bump inner loop
  146.           cmp       di,0                    ;Have we 'dripped' to the top?
  147.           jge       fxVD_uploop             ;If not, loop
  148.  
  149.           mov       ax,vedelay              ;Get the delay count
  150.           push      ax
  151.  
  152.           call      fxEffectDelay           ; and delay
  153.  
  154.           jnc       fxVD_upbump             ;If no error, continue
  155.           jmp       SHORT fxVD_error              
  156.  
  157. fxVD_upbump:
  158.  
  159.           dec       si                      ;Bump main loop
  160.           cmp       si,0                    ;Have we done all lines?
  161.           jge       fxVD_upmainloop         ;If not, loop
  162.  
  163.           @SetRet   veret,fxSUCCESS         ;Set the return code
  164.           jmp       SHORT fxVD_exit
  165.  
  166. fxVD_error:
  167.  
  168.           @SetRet   veret,ax                ;Set the error
  169.  
  170. fxVD_exit:
  171.  
  172.           @Exit     veret,veparm            ;Return
  173.  
  174. fxVirtualDrip       ENDP
  175.  
  176.   @EndCode
  177.  
  178.           END
  179.