home *** CD-ROM | disk | FTP | other *** search
- PAGE 60,132
- TITLE fxVP.ASM -- PCX Effects
- SUBTTL Copyright (c) Genus Microprogramming, Inc. 1988-89
-
- ; fxVP.ASM ;
- ; Copyright (c) Genus Microprogramming, Inc. 1988-89 All Rights Reserved. ;
-
- ;****************************************************************************;
- ; ;
- ; This file contains procedures for taking a pcx virtual buffer and ;
- ; 'spiraling' it on the display. ;
- ; ;
- ; Procedures: fxVirtualSpiral ;
- ; ;
- ; ;
- ; ;
- ; Microsoft ASM 5.x version. Programmer: Chris Howard 5/03/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
- EXTRN fxVirtualGrid : FAR
- EXTRN fxVirtualBox : FAR
-
- PUBLIC fxVirtualSpiral
-
- ;**********
-
- ;
- ; This is the Virtual Spiral 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
- ;
-
- fxVirtualSpiral PROC FAR
-
- call fxVirtualGrid ;Break up image into a grid
-
- mov ax,veimax ;Get the grid center points
- shr ax,1
- mov vevhalf,ax
-
- mov bx,vejmax
- shr bx,1
- mov vehhalf,bx
-
- cmp ax,bx ;Determine loop maximum
- jle fxVS_max
-
- mov ax,bx
-
- fxVS_max:
-
- inc ax
- mov veloopmax,ax ;Set the loop maximum
-
- fxVS_dir:
-
- mov ax,vedir ;What direction?
- cmp ax,fxIN ;Right and up
- jne fxVS_out
-
- jmp fxVS_in
-
- fxVS_out:
-
- mov si,veloopmax ;Get the loop maximum
- dec si ; and sub one to get starting pt
-
- mov vei,si ;Store starting locations
- mov di,si
- mov vej,di
-
- mov ax,veimax ;Get the column max
- sub ax,veloopmax ; sub the starting position
- inc ax ; and bump by one
- mov veimax,ax ;Now store as ending location
-
- mov ax,vejmax ;Get the row max
- sub ax,veloopmax ; sub the starting position
- inc ax ; and bump by one
- mov vejmax,ax ;Now store the ending location
-
- mov cx,veloopmax ;Get the maximum count
-
- fxVS_outtop:
-
- cmp si,veimax ;Are we at the right
- je fxVS_outright ;If so, go down it
-
- inc si ;Otherwise, bump to next grid
- call fxVirtualBox
-
- mov ax,vedelay ;Get the delay count
- push ax
-
- call fxEffectDelay ; and delay
-
- jnc fxVS_outtop ;If no error, continue
- jmp fxVS_error
-
- fxVS_outright:
-
- cmp di,vejmax ;Are we at the bottom edge?
- je fxVS_outbottom ;If so, go along it
-
- inc di ;Otherwise, bump to next grid
- call fxVirtualBox
-
- mov ax,vedelay ;Get the delay count
- push ax
-
- call fxEffectDelay ; and delay
-
- jnc fxVS_outright ;If no error, continue
- jmp fxVS_error
-
- fxVS_outbottom:
-
- cmp si,vei ;Are we at the left edge?
- je fxVS_outleft ;If so, go along it
-
- dec si ;Otherwise, bump to next grid
- call fxVirtualBox
-
- mov ax,vedelay ;Get the delay count
- push ax
-
- call fxEffectDelay ; and delay
-
- jnc fxVS_outbottom ;If no error, continue
- jmp fxVS_error
-
- fxVS_outleft:
-
- call fxVirtualBox
-
- cmp di,vej ;Are we at the top edge?
- je fxVS_outchkloop ;If so, check our loop
-
- dec di ;Otherwise, bump up to next
-
- mov ax,vedelay ;Get the delay count
- push ax
-
- call fxEffectDelay ; and delay
-
- jnc fxVS_outleft ;If no error, continue
- jmp fxVS_error
-
- fxVS_outchkloop:
-
- dec si ;Move the upper left corner
- mov vei,si
- dec di
- mov vej,di
-
- inc WORD PTR veimax ; and lower right corner
- inc WORD PTR vejmax
-
- loop fxVS_outtop ;Loop until all squares are done
-
- fxVS_outdone:
-
- @SetRet veret,fxSUCCESS ;Set the return code
- jmp fxVS_exit ; and exit
-
- fxVS_in:
-
- mov si,0 ;Initialize start to upper left
- mov vei,si ; corner
- mov di,0
- mov vej,di
-
- mov cx,veloopmax ;Initialize max 'boxes'
-
- fxVS_intop:
-
- call fxVirtualBox
-
- cmp si,veimax ;Are we at the right edge?
- je fxVS_inright ;If so, go down it
-
- inc si ;Otherwise, bump to next
-
- mov ax,vedelay ;Get the delay count
- push ax
-
- call fxEffectDelay ; and delay
-
- jnc fxVS_intop ;If no error, continue
- jmp SHORT fxVS_error
-
- fxVS_inright:
-
- cmp di,vejmax ;Are we at the bottom edge?
- je fxVS_inbottom ;If so, go along it
-
- inc di ;Otherwise, bump to next
- call fxVirtualBox
-
- mov ax,vedelay ;Get the delay count
- push ax
-
- call fxEffectDelay ; and delay
-
- jnc fxVS_inright ;If no error, continue
- jmp SHORT fxVS_error
-
- fxVS_inbottom:
-
- cmp si,vei ;Are we at the left edge?
- je fxVS_inleft ;If so, go along it
-
- dec si ;Otherwise, bump up to next grid
- call fxVirtualBox
-
- mov ax,vedelay ;Get the delay count
- push ax
-
- call fxEffectDelay ; and delay
-
- jnc fxVS_inbottom ;If no error, continue
- jmp SHORT fxVS_error
-
- fxVS_inleft:
-
- cmp di,vej ;Are we at the top?
- je fxVS_inchkloop ;If so, check our loop
-
- dec di ;Otherwise, bump up
- call fxVirtualBox
-
- mov ax,vedelay ;Get the delay count
- push ax
-
- call fxEffectDelay ; and delay
-
- jnc fxVS_inleft ;If no error, continue
- jmp SHORT fxVS_error
-
- fxVS_inchkloop:
-
- inc si ;Move the upper left corner in
- mov vei,si ; and down
- inc di
- mov vej,di
-
- dec WORD PTR veimax ;Move the lower right corner in
- dec WORD PTR vejmax ; and up
-
- loop fxVS_intop ;Loop until all 'boxes' are done
-
- fxVS_indone:
-
- @SetRet veret,fxSUCCESS ;Set the return code
- jmp SHORT fxVS_exit ; and exit
-
- fxVS_error:
-
- @SetRet veret,ax ;Set the return code
-
- fxVS_exit:
-
- @Exit veret,veparm ;Return
-
- fxVirtualSpiral ENDP
-
- @EndCode
-
- END
-