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

  1.   PAGE    60,132
  2.   TITLE   fxVA.ASM -- PCX Effects
  3.   SUBTTL  Copyright (c) Genus Microprogramming, Inc. 1988-89
  4.  
  5. ; fxVA.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. ; 'sanding' it on the display.                                               ;
  12. ;                                                                            ;
  13. ; Procedures: fxVirtualSand                                                  ;
  14. ;                                                                            ;
  15. ;                                                                            ;
  16. ;                                                                            ;
  17. ; Microsoft ASM 5.x version.              Programmer: Chris Howard  3/15/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    fxVirtualSand 
  41.  
  42. ;**********
  43.  
  44. ;
  45. ; This is the Virtual Sand 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. fxVirtualSand       PROC FAR
  56.  
  57.           mov       ax,vedir                ;What direction?
  58.           cmp       ax,fxUP                 ;Right and up  
  59.           jne       fxVA_down       
  60.  
  61.           jmp       SHORT fxVA_up   
  62.  
  63. fxVA_down:
  64.                                         
  65.           mov       si,vedepth              ;Initialize loop counter
  66.           dec       si
  67.  
  68. fxVA_mainloop:
  69.  
  70.           mov       di,0                    ;Init inner loop
  71.  
  72. fxVA_loop:
  73.  
  74.           mov       ax,vevseg               ;vptr
  75.           push      ax
  76.           mov       ax,vevofs
  77.           push      ax
  78.           xor       ax,ax                   ;vx   = 0
  79.           push      ax
  80.           push      si                      ;vy   = loop
  81.           mov       ax,vex                  ;x    = x
  82.           push      ax
  83.           mov       bx,vey                  ;y    = y+loop
  84.           add       bx,di
  85.           push      bx
  86.           mov       ax,vex2                 ;x2   = x2
  87.           push      ax                           
  88.           push      bx                      ;y2   = y+loop
  89.           mov       ax,vepage               ;page = current
  90.           push      ax                      
  91.  
  92.           call      pcxVirtualDisplay       ;Display this part
  93.  
  94.           inc       di                      ;Bump inner loop
  95.           cmp       di,si                   ;Have we 'sanded' to the bottom?
  96.           jle       fxVA_loop               ;If not, loop
  97.  
  98.           mov       ax,vedelay              ;Get the delay count
  99.           push      ax
  100.  
  101.           call      fxEffectDelay           ; and delay
  102.  
  103.           jnc       fxVA_bump               ;If no error, continue
  104.           jmp       SHORT fxVA_error              
  105.  
  106. fxVA_bump:
  107.  
  108.           dec       si                      ;Bump main loop
  109.           cmp       si,0                    ;Have we done all lines?
  110.           jge       fxVA_mainloop           ;If not, loop
  111.  
  112.           @SetRet   veret,fxSUCCESS         ;Set the return code
  113.           jmp       SHORT fxVA_exit
  114.  
  115. fxVA_up:
  116.                                         
  117.           mov       si,0                    ;Initialize loop counter
  118.  
  119. fxVA_upmainloop:
  120.  
  121.           mov       di,vedepth              ;Init inner loop
  122.  
  123. fxVA_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,si                   ;Have we 'sanded' to the top?
  147.           jge       fxVA_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       fxVA_upbump             ;If no error, continue
  155.           jmp       SHORT fxVA_error              
  156.  
  157. fxVA_upbump:
  158.  
  159.           inc       si                      ;Bump main loop
  160.           cmp       si,vedepth              ;Have we done all lines?
  161.           jl        fxVA_upmainloop         ;If not, loop
  162.  
  163.           @SetRet   veret,fxSUCCESS         ;Set the return code
  164.           jmp       SHORT fxVA_exit
  165.  
  166. fxVA_error:
  167.  
  168.           @SetRet   veret,ax                ;Set the error
  169.  
  170. fxVA_exit:
  171.  
  172.           @Exit     veret,veparm            ;Return
  173.  
  174. fxVirtualSand       ENDP
  175.  
  176.   @EndCode
  177.  
  178.           END
  179.