home *** CD-ROM | disk | FTP | other *** search
- PAGE 60,132
- TITLE fxVL.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 ;
- ; 'sliding' it on the display. ;
- ; ;
- ; Procedures: fxVirtualSlide ;
- ; ;
- ; ;
- ; ;
- ; 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 fxVirtualSlide
-
- ;**********
-
- ;
- ; This is the Virtual Slide 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
- ;
-
- fxVirtualSlide PROC FAR
-
- mov ax,vedir ;What direction?
- cmp ax,fxRIGHT ;Right
- jne fxVL_lefttest
-
- jmp fxVL_right
-
- fxVL_lefttest:
-
- cmp ax,fxLEFT ;Left
- jne fxVL_uptest
-
- jmp fxVL_left
-
- fxVL_uptest:
-
- cmp ax,fxUP ;Up
- jne fxVL_down
-
- jmp SHORT fxVL_up
-
- fxVL_down:
-
- mov si,vegrain ;Initialize loop counter
-
- fxVL_downloop:
-
- 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 fxVL_downvy ;If not, continue
-
- mov si,vedepth ;Otherwise, reset
-
- fxVL_downvy:
-
- mov bx,vedepth
- sub bx,si
- push bx ;vy = loop
- mov ax,vex ;x = x
- push ax
- mov ax,vey ;y = y
- push ax
- mov ax,vex2 ;x2 = x2
- push ax
- mov ax,si ;y2 = y+loop-1
- add ax,vey
- dec ax
- 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 fxVL_downbump ;If no error, continue
- jmp fxVL_error
-
- fxVL_downbump:
-
- cmp si,vedepth ;Have we done the entire image?
- jge fxVL_downdone
-
- add si,vegrain ;Bump our loop counter
- jmp fxVL_downloop ; and loop
-
- fxVL_downdone:
-
- @SetRet veret,fxSUCCESS ;Set the return code
-
- jmp fxVL_exit
-
- fxVL_up:
-
- mov si,vegrain ;Initialize loop counter
-
- fxVL_uploop:
-
- mov ax,vevseg ;vptr
- push ax
- mov ax,vevofs
- push ax
- xor ax,ax ;vx = 0
- push ax
- push ax ;vy = 0
- mov ax,vex ;x = x
- push ax
-
- mov dx,si
- cmp dx,vedepth ;Is loop past a grain increment?
- jl fxVL_upy ;If not, continue
-
- mov dx,vedepth ;Otherwise, reset
- dec dx
-
- fxVL_upy:
-
- mov ax,vey2
- sub ax,dx
- push ax ;y = y2-loop
- mov ax,vex2 ;x2 = x2
- push ax
- 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 fxVL_upbump ;If no error, continue
- jmp fxVL_error
-
- fxVL_upbump:
-
- cmp si,vedepth ;Have we done the entire image?
- jge fxVL_updone
-
- add si,vegrain ;Bump our loop counter
- jmp fxVL_uploop ; and loop
-
- fxVL_updone:
-
- @SetRet veret,fxSUCCESS ;Set the return code
-
- jmp fxVL_exit
-
- fxVL_right:
-
- mov si,vevgrain ;Initialize loop counter
-
- fxVL_rightloop:
-
- mov ax,vevseg ;vptr
- push ax
- mov ax,vevofs
- push ax
-
- cmp si,vewidth ;Is loop past a grain increment?
- jle fxVL_rightvx ;If not, continue
-
- mov si,vewidth ;Otherwise, reset
-
- fxVL_rightvx:
-
- mov bx,vewidth ;vx = width-loop
- sub bx,si
- push bx
-
- xor ax,ax ;vy = 0
- push ax
- mov ax,vex ;x = x
- push ax
- mov ax,vey ;y = y
- push ax
- mov ax,si ;x2 = x+loop-1
- add ax,vex
- dec ax
- push ax
- 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 fxVL_rightbump ;If no error, continue
- jmp SHORT fxVL_error
-
- fxVL_rightbump:
-
- cmp si,vewidth ;Have we done the entire image?
- jge fxVL_rightdone
-
- add si,vevgrain ;Bump our loop counter
- jmp fxVL_rightloop ; and loop
-
- fxVL_rightdone:
-
- @SetRet veret,fxSUCCESS ;Set the return code
-
- jmp SHORT fxVL_exit
-
- fxVL_left:
-
- mov si,vevgrain ;Initialize loop counter
- inc WORD PTR vex2
-
- fxVL_leftloop:
-
- mov ax,vevseg ;vptr
- push ax
- mov ax,vevofs
- push ax
- xor ax,ax ;vx = 0
- push ax
- push ax ;vy = 0
-
- mov dx,si
- cmp dx,vewidth ;Is loop past a grain increment?
- jl fxVL_leftx ;If not, continue
-
- mov dx,vewidth ;Otherwise, reset
- dec dx
-
- fxVL_leftx:
-
- mov ax,vex2 ;x = x2-loop
- sub ax,dx
- push ax
-
- mov ax,vey ;y = y
- push ax
- mov ax,vex2 ;x2 = x2
- push ax
- 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 fxVL_leftbump ;If no error, continue
- jmp SHORT fxVL_error
-
- fxVL_leftbump:
-
- cmp si,vewidth ;Have we done the entire image?
- jge fxVL_leftdone
-
- add si,vevgrain ;Bump our loop counter
- jmp fxVL_leftloop ; and loop
-
- fxVL_leftdone:
-
- @SetRet veret,fxSUCCESS ;Set the return code
- jmp SHORT fxVL_exit
-
- fxVL_error:
-
- @SetRet veret,ax ;Set the error code
-
- fxVL_exit:
-
- @Exit veret,veparm ;Return
-
- fxVirtualSlide ENDP
-
- @EndCode
-
- END
-