home *** CD-ROM | disk | FTP | other *** search
- PAGE 60,132
- TITLE fxVC.ASM -- PCX Effects
- SUBTTL Copyright (c) Genus Microprogramming, Inc. 1988-89
-
- ; fxVC.ASM ;
- ; Copyright (c) Genus Microprogramming, Inc. 1988-89 All Rights Reserved. ;
-
- ;****************************************************************************;
- ; ;
- ; This file contains procedures for taking a pcx virtual buffer and ;
- ; 'crushing' it on the display. ;
- ; ;
- ; Procedures: fxVirtualCrush ;
- ; ;
- ; ;
- ; ;
- ; 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 fxVirtualCrush
-
- ;**********
-
- ;
- ; This is the Virtual Crush 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
- ;
-
- fxVirtualCrush PROC FAR
-
- mov ax,vedir ;What direction?
- cmp ax,fxVERT ;Vertical
- jne fxVC_horiz
-
- jmp fxVC_vert
-
- fxVC_horiz:
-
- inc WORD PTR vey2 ;Bump Y2, to comp for later add
-
- 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 counters
- mov di,vegrain
- inc di
-
- fxVC_horizloop:
-
- 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 fxVC_downvy ;If not, continue
-
- mov dx,veloopmax ;Otherwise, reset
-
- fxVC_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,vevseg ;vptr
- push ax
- mov ax,vevofs
- push ax
- xor ax,ax ;vx = 0
- push ax
-
- cmp di,vedepth ;Is loop past a grain increment?
- jle fxVC_upvy ;If not, continue
-
- mov di,vedepth ;Otherwise, reset
-
- fxVC_upvy:
-
- mov ax,vedepth ;vy = depth-loop
- sub ax,di
- push ax
- mov ax,vex ;x = x
- push ax
- mov bx,vey2 ;y = y2-loop
- sub bx,di
- 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 fxVC_horizbump ;If no error, continue
- jmp fxVC_error
-
- fxVC_horizbump:
-
- add di,vegrain ;Bump our loop counters
- add si,vegrain
- cmp si,vehhalf ;Have we done the entire image?
- jl fxVC_horizloop ;If not, loop
-
- @SetRet veret,fxSUCCESS ;Set the return code
-
- jmp fxVC_exit ; and exit
-
- fxVC_vert:
-
- inc WORD PTR vex2 ;Bump X2, to comp for later add
-
- mov ax,vevhalf ;Get the middle
- sub ax,vevgrain ;Sub the grain
- mov veloopmax,ax ;Store as the loop maximum
-
- mov si,0 ;Initialize left
- mov di,vevgrain ; and right loop counters
-
- fxVC_vertloop:
-
- mov ax,vevseg ;vptr
- push ax
- mov ax,vevofs
- push ax
-
- mov dx,si
- cmp dx,veloopmax ;Is loop past a grain increment?
- jle fxVC_rightvx ;If not, continue
-
- mov dx,veloopmax ;Otherwise, reset
-
- fxVC_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,vevseg ;vptr
- push ax
- mov ax,vevofs
- push ax
-
- cmp di,vewidth ;Is loop past a grain increment?
- jle fxVC_leftvx ;If not, continue
-
- mov di,vewidth ;Otherwise, reset
-
- fxVC_leftvx:
-
- mov ax,vewidth ;vx = width-loop
- sub ax,di
- push ax
- xor ax,ax ;vy = 0
- push ax
- mov bx,vex2 ;x = x2-loop
- sub bx,di
- 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 fxVC_vertbump ;If no error, continue
- jmp SHORT fxVC_error
-
- fxVC_vertbump:
-
- cmp si,veloopmax ;Have we done the entire image?
- jge fxVC_vertdone
-
- add si,vevgrain ;Bump our loop counters
- add di,vevgrain
- jmp fxVC_vertloop ; and loop
-
- fxVC_vertdone:
-
- @SetRet veret,fxSUCCESS ;Set the return code
- jmp SHORT fxVC_exit
-
- fxVC_error:
-
- @SetRet veret,ax ;Set the error code
-
- fxVC_exit:
-
- @Exit veret,veparm ;Return
-
- fxVirtualCrush ENDP
-
- @EndCode
-
- END
-