home *** CD-ROM | disk | FTP | other *** search
- PAGE 60,132
- TITLE fxVW.ASM -- PCX Effects
- SUBTTL Copyright (c) Genus Microprogramming, Inc. 1988-89
-
- ; fxVW.ASM ;
- ; Copyright (c) Genus Microprogramming, Inc. 1988-89 All Rights Reserved. ;
-
- ;****************************************************************************;
- ; ;
- ; This file contains procedures for taking a pcx virtual buffer and ;
- ; 'wiping' it on the display. ;
- ; ;
- ; Procedures: fxVirtualWipe ;
- ; ;
- ; ;
- ; ;
- ; Microsoft ASM 5.x version. Programmer: Chris Howard 3/15/89 ;
- ; ;
- ;****************************************************************************;
-
- ; Include files
- INCLUDE ..\inc\pcxDefs.inc
- INCLUDE ..\inc\pcxMacs.inc
- INCLUDE ..\inc\pcxErrs.inc
-
- INCLUDE ..\inc\fxDefs.inc
- INCLUDE ..\inc\fxMacs.inc
- INCLUDE ..\inc\fxErrs.inc
-
- @SetModel
-
- @BegData
- @EndData
-
- @BegCode
-
- EXTRN pcxVirtualDisplay : FAR
- EXTRN fxEffectDelay : FAR
-
- PUBLIC fxVirtualWipe
-
- ;**********
-
- ;
- ; This is the Virtual Wipe effect procedure, for the fxVirtualEffect
- ; interface. It is an INTERNAL routine only.
- ;
- ; On Entry: SS:BP points to pcxVirtualEffect frame
- ; ES:DI points to display structure
- ; DS:SI points to buffer
- ;
- ; On Exit: retcode contains error code, if any
- ;
-
- fxVirtualWipe PROC FAR
-
- mov ax,vedir ;What direction?
- cmp ax,fxRIGHT ;Right
- jne fxVW_lefttest
-
- jmp fxVW_right
-
- fxVW_lefttest:
-
- cmp ax,fxLEFT ;Left
- jne fxVW_uptest
-
- jmp fxVW_left
-
- fxVW_uptest:
-
- cmp ax,fxUP ;Up
- jne fxVW_down
-
- jmp SHORT fxVW_up
-
- fxVW_down:
-
- mov ax,vedepth ;Get the depth
- sub ax,vegrain ; and sub the grain
- dec ax
- mov veloopmax,ax ;Store as the loop maximum
-
- mov si,0 ;Initialize loop counter
-
- fxVW_downloop:
-
- mov ax,vevseg ;vptr
- push ax
- mov ax,vevofs
- push ax
- xor ax,ax ;vx = 0
- push ax
-
- mov dx,si
- cmp dx,veloopmax ;Is loop past a grain increment?
- jle fxVW_downvy ;If not, continue
-
- mov dx,veloopmax ;Otherwise, reset
-
- fxVW_downvy:
-
- push dx ;vy = loop
- mov ax,vex ;x = x
- push ax
- mov bx,vey ;y = y+loop
- add bx,dx
- push bx
- mov ax,vex2 ;x2 = x2
- push ax
- add bx,vegrain ;y2 = y+loop+grain
- push bx
- mov ax,vepage ;page = current
- push ax
-
- call pcxVirtualDisplay ;Display this part
-
- mov ax,vedelay ;Get the delay count
- push ax
-
- call fxEffectDelay ; and delay
-
- jnc fxVW_downbump ;If no error, continue
- jmp fxVW_error
-
- fxVW_downbump:
-
- add si,vegrain ;Bump our loop counter
- cmp si,vedepth ;Have we done the entire image?
- jl fxVW_downloop ;If not, loop
-
- @SetRet veret,fxSUCCESS ;Set the return code
-
- jmp fxVW_exit ; and exit
-
- fxVW_up:
-
- inc WORD PTR vey2 ;Bump Y2, to comp for later add
-
- mov si,vegrain ;Initialize loop counter
- inc si
-
- fxVW_uploop:
-
- mov ax,vevseg ;vptr
- push ax
- mov ax,vevofs
- push ax
- xor ax,ax ;vx = 0
- push ax
-
- cmp si,vedepth ;Is loop past a grain increment?
- jle fxVW_upvy ;If not, continue
-
- mov si,vedepth ;Otherwise, reset
-
- fxVW_upvy:
-
- mov ax,vedepth ;vy = depth-loop
- sub ax,si
- push ax
- mov ax,vex ;x = x
- push ax
- mov bx,vey2 ;y = y2-loop
- sub bx,si
- push bx
- mov ax,vex2 ;x2 = x2
- push ax
- add bx,vegrain ;y2 = y2-loop+grain
- push bx
- mov ax,vepage ;page = current
- push ax
-
- call pcxVirtualDisplay ;Display this part
-
- mov ax,vedelay ;Get the delay count
- push ax
-
- call fxEffectDelay ; and delay
-
- jnc fxVW_upbump ;If no error, continue
- jmp fxVW_error
-
- fxVW_upbump:
-
- cmp si,vedepth ;Have we done the entire image?
- jge fxVW_updone
-
- add si,vegrain ;Bump our loop counter
- jmp fxVW_uploop ; and loop
-
- fxVW_updone:
-
- @SetRet veret,fxSUCCESS ;Set the return code
-
- jmp fxVW_exit
-
- fxVW_right:
-
- mov ax,vewidth ;Get the depth
- sub ax,vevgrain ; and sub the grain
- mov veloopmax,ax ;Store as the loop maximum
-
- mov si,0 ;Initialize loop counter
-
- fxVW_rightloop:
-
- mov ax,vevseg ;vptr
- push ax
- mov ax,vevofs
- push ax
-
- mov dx,si
- cmp dx,veloopmax ;Is loop past a grain increment?
- jle fxVW_rightvx ;If not, continue
-
- mov dx,veloopmax ;Otherwise, reset
-
- fxVW_rightvx:
-
- push dx ;vx = loop
- xor ax,ax ;vy = 0
- push ax
- mov bx,vex ;x = x+loop
- add bx,dx
- push bx
- mov ax,vey ;y = y
- push ax
- add bx,vevgrain ;x2 = x+loop+grain
- push bx
- mov ax,vey2 ;y2 = y2
- push ax
- mov ax,vepage ;page = current
- push ax
-
- call pcxVirtualDisplay ;Display this part
-
- mov ax,vedelay ;Get the delay count
- push ax
-
- call fxEffectDelay ; and delay
-
- jnc fxVW_rightbump ;If no error, continue
- jmp SHORT fxVW_error
-
- fxVW_rightbump:
-
- cmp si,vewidth ;Have we done the entire image?
- jge fxVW_rightdone
-
- add si,vevgrain ;Bump our loop counter
- jmp fxVW_rightloop ; and loop
-
- fxVW_rightdone:
-
- @SetRet veret,fxSUCCESS ;Set the return code
-
- jmp SHORT fxVW_exit
-
- fxVW_left:
-
- mov si,vevgrain ;Initialize loop counter
- inc WORD PTR vex2
-
- fxVW_leftloop:
-
- mov ax,vevseg ;vptr
- push ax
- mov ax,vevofs
- push ax
-
- cmp si,vewidth ;Is loop past a grain increment?
- jle fxVW_leftvx ;If not, continue
-
- mov si,vewidth ;Otherwise, reset
-
- fxVW_leftvx:
-
- mov ax,vewidth ;vx = width-loop
- sub ax,si
- push ax
- xor ax,ax ;vy = 0
- push ax
- mov bx,vex2 ;x = x2-loop
- sub bx,si
- push bx
- mov ax,vey ;y = y
- push ax
- add bx,vevgrain ;x2 = x2-loop+grain
- push bx
- mov ax,vey2 ;y2 = y2
- push ax
- mov ax,vepage ;page = current
- push ax
-
- call pcxVirtualDisplay ;Display this part
-
- mov ax,vedelay ;Get the delay count
- push ax
-
- call fxEffectDelay ; and delay
-
- jnc fxVW_leftbump ;If no error, continue
- jmp SHORT fxVW_error
-
- fxVW_leftbump:
-
- cmp si,vewidth ;Have we done the entire image?
- jge fxVW_leftdone
-
- add si,vevgrain ;Bump our loop counter
- jmp fxVW_leftloop ; and loop
-
- fxVW_leftdone:
-
- @SetRet veret,fxSUCCESS ;Set the return code
- jmp SHORT fxVW_exit
-
- fxVW_error:
-
- @SetRet veret,ax ;Set the return code
-
- fxVW_exit:
-
- @Exit veret,veparm ;Return
-
- fxVirtualWipe ENDP
-
- @EndCode
-
- END
-