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

  1.   PAGE    60,132
  2.   TITLE   fxVW.ASM -- PCX Effects
  3.   SUBTTL  Copyright (c) Genus Microprogramming, Inc. 1988-89
  4.  
  5. ; fxVW.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. ; 'wiping' it on the display.                                                ;
  12. ;                                                                            ;
  13. ; Procedures: fxVirtualWipe                                                  ;
  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    fxVirtualWipe       
  41.  
  42. ;**********
  43.  
  44. ;
  45. ; This is the Virtual Wipe 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. fxVirtualWipe       PROC FAR
  56.  
  57.           mov       ax,vedir                ;What direction?
  58.           cmp       ax,fxRIGHT              ;Right
  59.           jne       fxVW_lefttest
  60.  
  61.           jmp       fxVW_right
  62.  
  63. fxVW_lefttest:
  64.  
  65.           cmp       ax,fxLEFT               ;Left
  66.           jne       fxVW_uptest
  67.  
  68.           jmp       fxVW_left
  69.  
  70. fxVW_uptest:
  71.  
  72.           cmp       ax,fxUP                 ;Up
  73.           jne       fxVW_down
  74.  
  75.           jmp       SHORT fxVW_up
  76.  
  77. fxVW_down:
  78.  
  79.           mov       ax,vedepth              ;Get the depth
  80.           sub       ax,vegrain              ; and sub the grain
  81.           dec       ax
  82.           mov       veloopmax,ax            ;Store as the loop maximum
  83.           
  84.           mov       si,0                    ;Initialize loop counter
  85.  
  86. fxVW_downloop:
  87.  
  88.           mov       ax,vevseg               ;vptr
  89.           push      ax
  90.           mov       ax,vevofs
  91.           push      ax
  92.           xor       ax,ax                   ;vx   = 0
  93.           push      ax
  94.  
  95.           mov       dx,si
  96.           cmp       dx,veloopmax            ;Is loop past a grain increment?
  97.           jle       fxVW_downvy             ;If not, continue
  98.  
  99.           mov       dx,veloopmax            ;Otherwise, reset
  100.  
  101. fxVW_downvy:
  102.  
  103.           push      dx                      ;vy   = loop
  104.           mov       ax,vex                  ;x    = x
  105.           push      ax
  106.           mov       bx,vey                  ;y    = y+loop
  107.           add       bx,dx
  108.           push      bx
  109.           mov       ax,vex2                 ;x2   = x2
  110.           push      ax                           
  111.           add       bx,vegrain              ;y2   = y+loop+grain
  112.           push      bx
  113.           mov       ax,vepage               ;page = current
  114.           push      ax                      
  115.  
  116.           call      pcxVirtualDisplay       ;Display this part
  117.  
  118.           mov       ax,vedelay              ;Get the delay count
  119.           push      ax
  120.  
  121.           call      fxEffectDelay           ; and delay
  122.  
  123.           jnc       fxVW_downbump           ;If no error, continue
  124.           jmp       fxVW_error              
  125.  
  126. fxVW_downbump:
  127.  
  128.           add       si,vegrain              ;Bump our loop counter
  129.           cmp       si,vedepth              ;Have we done the entire image?
  130.           jl        fxVW_downloop           ;If not, loop
  131.  
  132.           @SetRet   veret,fxSUCCESS         ;Set the return code
  133.  
  134.           jmp       fxVW_exit               ; and exit
  135.  
  136. fxVW_up:
  137.  
  138.           inc       WORD PTR vey2           ;Bump Y2, to comp for later add
  139.  
  140.           mov       si,vegrain              ;Initialize loop counter
  141.           inc       si
  142.  
  143. fxVW_uploop:
  144.  
  145.           mov       ax,vevseg               ;vptr
  146.           push      ax
  147.           mov       ax,vevofs
  148.           push      ax
  149.           xor       ax,ax                   ;vx   = 0
  150.           push      ax
  151.  
  152.           cmp       si,vedepth              ;Is loop past a grain increment?
  153.           jle       fxVW_upvy               ;If not, continue
  154.  
  155.           mov       si,vedepth              ;Otherwise, reset
  156.  
  157. fxVW_upvy:
  158.           
  159.           mov       ax,vedepth              ;vy   = depth-loop
  160.           sub       ax,si
  161.           push      ax                      
  162.           mov       ax,vex                  ;x    = x
  163.           push      ax
  164.           mov       bx,vey2                 ;y    = y2-loop
  165.           sub       bx,si
  166.           push      bx
  167.           mov       ax,vex2                 ;x2   = x2
  168.           push      ax                           
  169.           add       bx,vegrain              ;y2   = y2-loop+grain
  170.           push      bx
  171.           mov       ax,vepage               ;page = current
  172.           push      ax                      
  173.  
  174.           call      pcxVirtualDisplay       ;Display this part
  175.  
  176.           mov       ax,vedelay              ;Get the delay count
  177.           push      ax
  178.  
  179.           call      fxEffectDelay           ; and delay
  180.  
  181.           jnc       fxVW_upbump             ;If no error, continue
  182.           jmp       fxVW_error              
  183.  
  184. fxVW_upbump:
  185.  
  186.           cmp       si,vedepth              ;Have we done the entire image?
  187.           jge       fxVW_updone
  188.  
  189.           add       si,vegrain              ;Bump our loop counter
  190.           jmp       fxVW_uploop             ; and loop
  191.  
  192. fxVW_updone:
  193.  
  194.           @SetRet   veret,fxSUCCESS         ;Set the return code
  195.  
  196.           jmp       fxVW_exit
  197.  
  198. fxVW_right:
  199.           
  200.           mov       ax,vewidth              ;Get the depth
  201.           sub       ax,vevgrain             ; and sub the grain
  202.           mov       veloopmax,ax            ;Store as the loop maximum
  203.           
  204.           mov       si,0                    ;Initialize loop counter
  205.  
  206. fxVW_rightloop:
  207.  
  208.           mov       ax,vevseg               ;vptr
  209.           push      ax
  210.           mov       ax,vevofs
  211.           push      ax
  212.  
  213.           mov       dx,si
  214.           cmp       dx,veloopmax            ;Is loop past a grain increment?
  215.           jle       fxVW_rightvx            ;If not, continue
  216.  
  217.           mov       dx,veloopmax            ;Otherwise, reset
  218.  
  219. fxVW_rightvx:
  220.  
  221.           push      dx                      ;vx   = loop
  222.           xor       ax,ax                   ;vy   = 0
  223.           push      ax
  224.           mov       bx,vex                  ;x    = x+loop
  225.           add       bx,dx
  226.           push      bx
  227.           mov       ax,vey                  ;y    = y     
  228.           push      ax
  229.           add       bx,vevgrain             ;x2   = x+loop+grain
  230.           push      bx                           
  231.           mov       ax,vey2                 ;y2   = y2
  232.           push      ax
  233.           mov       ax,vepage               ;page = current
  234.           push      ax                      
  235.  
  236.           call      pcxVirtualDisplay       ;Display this part
  237.  
  238.           mov       ax,vedelay              ;Get the delay count
  239.           push      ax
  240.  
  241.           call      fxEffectDelay           ; and delay
  242.  
  243.           jnc       fxVW_rightbump          ;If no error, continue
  244.           jmp       SHORT fxVW_error              
  245.  
  246. fxVW_rightbump:
  247.  
  248.           cmp       si,vewidth              ;Have we done the entire image?
  249.           jge       fxVW_rightdone
  250.  
  251.           add       si,vevgrain             ;Bump our loop counter
  252.           jmp       fxVW_rightloop          ; and loop
  253.  
  254. fxVW_rightdone:
  255.  
  256.           @SetRet   veret,fxSUCCESS         ;Set the return code
  257.  
  258.           jmp       SHORT fxVW_exit
  259.  
  260. fxVW_left:
  261.           
  262.           mov       si,vevgrain             ;Initialize loop counter
  263.           inc       WORD PTR vex2
  264.  
  265. fxVW_leftloop:
  266.  
  267.           mov       ax,vevseg               ;vptr
  268.           push      ax
  269.           mov       ax,vevofs
  270.           push      ax
  271.  
  272.           cmp       si,vewidth              ;Is loop past a grain increment?
  273.           jle       fxVW_leftvx             ;If not, continue
  274.  
  275.           mov       si,vewidth              ;Otherwise, reset
  276.  
  277. fxVW_leftvx:
  278.  
  279.           mov       ax,vewidth              ;vx   = width-loop
  280.           sub       ax,si
  281.           push      ax
  282.           xor       ax,ax                   ;vy   = 0
  283.           push      ax
  284.           mov       bx,vex2                 ;x    = x2-loop
  285.           sub       bx,si
  286.           push      bx
  287.           mov       ax,vey                  ;y    = y     
  288.           push      ax
  289.           add       bx,vevgrain             ;x2   = x2-loop+grain
  290.           push      bx                           
  291.           mov       ax,vey2                 ;y2   = y2
  292.           push      ax
  293.           mov       ax,vepage               ;page = current
  294.           push      ax                      
  295.  
  296.           call      pcxVirtualDisplay       ;Display this part
  297.  
  298.           mov       ax,vedelay              ;Get the delay count
  299.           push      ax
  300.  
  301.           call      fxEffectDelay           ; and delay
  302.  
  303.           jnc       fxVW_leftbump           ;If no error, continue
  304.           jmp       SHORT fxVW_error              
  305.  
  306. fxVW_leftbump:
  307.  
  308.           cmp       si,vewidth              ;Have we done the entire image?
  309.           jge       fxVW_leftdone
  310.  
  311.           add       si,vevgrain             ;Bump our loop counter
  312.           jmp       fxVW_leftloop           ; and loop
  313.  
  314. fxVW_leftdone:
  315.  
  316.           @SetRet   veret,fxSUCCESS         ;Set the return code
  317.           jmp       SHORT fxVW_exit
  318.  
  319. fxVW_error:
  320.  
  321.           @SetRet   veret,ax                ;Set the return code
  322.  
  323. fxVW_exit:
  324.                     
  325.           @Exit     veret,veparm            ;Return
  326.  
  327. fxVirtualWipe       ENDP
  328.  
  329.   @EndCode
  330.  
  331.           END
  332.