home *** CD-ROM | disk | FTP | other *** search
- PAGE 60,132
- TITLE fxVS.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 ;
- ; 'splitting' it on the display. ;
- ; ;
- ; Procedures: fxVirtualSplit ;
- ; ;
- ; ;
- ; ;
- ; 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 fxVirtualSplit
-
- ;**********
-
- ;
- ; This is the Virtual Split 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
- ;
-
- fxVirtualSplit PROC FAR
-
- mov ax,vedir ;What direction?
- cmp ax,fxVERT ;Vertical
- jne fxVS_horiz
-
- jmp fxVS_vert
-
- fxVS_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,vehhalf ;Initialize loop counters
- mov di,vehhalf
- inc di
-
- fxVS_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 fxVS_downvy ;If not, continue
-
- mov dx,veloopmax ;Otherwise, reset
-
- fxVS_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 fxVS_upvy ;If not, continue
-
- mov di,vedepth ;Otherwise, reset
-
- fxVS_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 fxVS_upbump ;If no error, continue
- jmp fxVS_error
-
- fxVS_upbump:
-
- cmp di,vedepth ;Have we done the entire image?
- ; (NOTE: use DI, since SI will
- ; NEVER overrun edge ...)
- jge fxVS_horizdone
-
- add di,vegrain ;Bump our loop counters
- add si,vegrain
- jmp fxVS_horizloop ; and loop
-
- fxVS_horizdone:
-
- @SetRet veret,fxSUCCESS ;Set the return code
-
- jmp fxVS_exit ; and exit
-
- fxVS_vert:
-
- inc WORD PTR vex2 ;Bump X2, to comp for later add
-
- mov ax,vewidth ;Get the middle
- sub ax,vevgrain ;Sub the grain
- mov veloopmax,ax ;Store as the loop maximum
-
- mov si,vevhalf ;Initialize left
- mov di,vevhalf ; and right loop counters
- add di,vevgrain
-
- fxVS_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 fxVS_rightvx ;If not, continue
-
- mov dx,veloopmax ;Otherwise, reset
-
- fxVS_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 fxVS_leftvx ;If not, continue
-
- mov di,vewidth ;Otherwise, reset
-
- fxVS_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 fxVS_leftbump ;If no error, continue
- jmp SHORT fxVS_error
-
- fxVS_leftbump:
-
- cmp si,veloopmax ;Have we done the entire image?
- jge fxVS_vertdone
-
- add si,vevgrain ;Bump our loop counters
- add di,vevgrain
- jmp fxVS_vertloop ; and loop
-
- fxVS_vertdone:
-
- @SetRet veret,fxSUCCESS ;Set the return code
- jmp SHORT fxVS_exit
-
- fxVS_error:
-
- @SetRet veret,ax ;Set the error code
-
- fxVS_exit:
-
- @Exit veret,veparm ;Return
-
- fxVirtualSplit ENDP
-
- @EndCode
-
- END
-