home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c011 / 1.ddi / SOURCE / FXVL.ASM < prev    next >
Encoding:
Assembly Source File  |  1989-06-01  |  9.9 KB  |  330 lines

  1.   PAGE    60,132
  2.   TITLE   fxVL.ASM -- PCX Effects
  3.   SUBTTL  Copyright (c) Genus Microprogramming, Inc. 1988-89
  4.  
  5. ; fxVC.ASM                                                                   ;
  6. ; Copyright (c) Genus Microprogramming, Inc. 1988-89  All Rights Reserved.   ;
  7.  
  8. ;****************************************************************************;
  9. ;                                                                            ;
  10. ; This file contains procedures for taking a pcx virtual buffer and          ;
  11. ; 'sliding' it on the display.                                               ;
  12. ;                                                                            ;
  13. ; Procedures: fxVirtualSlide                                                 ;
  14. ;                                                                            ;
  15. ;                                                                            ;
  16. ;                                                                            ;
  17. ; Microsoft ASM 5.x version.              Programmer: Chris Howard  3/15/89  ;
  18. ;                                                                            ;
  19. ;****************************************************************************;
  20.  
  21. ; Include files
  22.   INCLUDE ..\inc\pcxDefs.inc
  23.   INCLUDE ..\inc\pcxMacs.inc
  24.   INCLUDE ..\inc\pcxErrs.inc
  25.  
  26.   INCLUDE ..\inc\fxDefs.inc
  27.   INCLUDE ..\inc\fxMacs.inc
  28.   INCLUDE ..\inc\fxErrs.inc
  29.  
  30.   @SetModel
  31.  
  32.   @BegData
  33.   @EndData
  34.  
  35.   @BegCode
  36.  
  37.           EXTRN     pcxVirtualDisplay       : FAR
  38.           EXTRN     fxEffectDelay           : FAR
  39.  
  40.           PUBLIC    fxVirtualSlide
  41.  
  42. ;**********
  43.  
  44. ;
  45. ; This is the Virtual Slide effect procedure, for the fxVirtualEffect
  46. ; interface.  It is an INTERNAL routine only.
  47. ;
  48. ; On Entry:  SS:BP    points to pcxVirtualEffect frame
  49. ;            ES:DI    points to display structure
  50. ;            DS:SI    points to buffer
  51. ;
  52. ; On Exit:   retcode  contains error code, if any
  53. ;
  54.  
  55. fxVirtualSlide      PROC FAR
  56.  
  57.           mov       ax,vedir                ;What direction?
  58.           cmp       ax,fxRIGHT              ;Right
  59.           jne       fxVL_lefttest
  60.  
  61.           jmp       fxVL_right
  62.  
  63. fxVL_lefttest:
  64.  
  65.           cmp       ax,fxLEFT               ;Left
  66.           jne       fxVL_uptest
  67.  
  68.           jmp       fxVL_left
  69.  
  70. fxVL_uptest:
  71.  
  72.           cmp       ax,fxUP                 ;Up
  73.           jne       fxVL_down
  74.  
  75.           jmp       SHORT fxVL_up
  76.  
  77. fxVL_down:
  78.  
  79.           mov       si,vegrain              ;Initialize loop counter
  80.  
  81. fxVL_downloop:
  82.  
  83.           mov       ax,vevseg               ;vptr
  84.           push      ax
  85.           mov       ax,vevofs
  86.           push      ax
  87.           xor       ax,ax                   ;vx   = 0
  88.           push      ax
  89.  
  90.           cmp       si,vedepth              ;Is loop past a grain increment?
  91.           jle       fxVL_downvy             ;If not, continue
  92.  
  93.           mov       si,vedepth              ;Otherwise, reset
  94.  
  95. fxVL_downvy:
  96.  
  97.           mov       bx,vedepth
  98.           sub       bx,si
  99.           push      bx                      ;vy   = loop
  100.           mov       ax,vex                  ;x    = x
  101.           push      ax
  102.           mov       ax,vey                  ;y    = y
  103.           push      ax
  104.           mov       ax,vex2                 ;x2   = x2
  105.           push      ax                           
  106.           mov       ax,si                   ;y2   = y+loop-1
  107.           add       ax,vey
  108.           dec       ax
  109.           push      ax
  110.           mov       ax,vepage               ;page = current
  111.           push      ax                      
  112.  
  113.           call      pcxVirtualDisplay       ;Display this part
  114.  
  115.           mov       ax,vedelay              ;Get the delay count
  116.           push      ax
  117.  
  118.           call      fxEffectDelay           ; and delay
  119.  
  120.           jnc       fxVL_downbump           ;If no error, continue
  121.           jmp       fxVL_error              
  122.  
  123. fxVL_downbump:
  124.  
  125.           cmp       si,vedepth              ;Have we done the entire image?
  126.           jge       fxVL_downdone
  127.  
  128.           add       si,vegrain              ;Bump our loop counter
  129.           jmp       fxVL_downloop           ; and loop
  130.  
  131. fxVL_downdone:
  132.  
  133.           @SetRet   veret,fxSUCCESS         ;Set the return code
  134.  
  135.           jmp       fxVL_exit
  136.  
  137. fxVL_up:
  138.  
  139.           mov       si,vegrain              ;Initialize loop counter
  140.  
  141. fxVL_uploop:
  142.  
  143.           mov       ax,vevseg               ;vptr
  144.           push      ax
  145.           mov       ax,vevofs
  146.           push      ax
  147.           xor       ax,ax                   ;vx   = 0
  148.           push      ax
  149.           push      ax                      ;vy   = 0
  150.           mov       ax,vex                  ;x    = x
  151.           push      ax
  152.  
  153.           mov       dx,si
  154.           cmp       dx,vedepth              ;Is loop past a grain increment?
  155.           jl        fxVL_upy                ;If not, continue
  156.  
  157.           mov       dx,vedepth              ;Otherwise, reset
  158.           dec       dx
  159.  
  160. fxVL_upy:
  161.  
  162.           mov       ax,vey2
  163.           sub       ax,dx
  164.           push      ax                      ;y    = y2-loop
  165.           mov       ax,vex2                 ;x2   = x2
  166.           push      ax                           
  167.           mov       ax,vey2                 ;y2   = y2
  168.           push      ax                      
  169.           mov       ax,vepage               ;page = current
  170.           push      ax                      
  171.  
  172.           call      pcxVirtualDisplay       ;Display this part
  173.  
  174.           mov       ax,vedelay              ;Get the delay count
  175.           push      ax
  176.  
  177.           call      fxEffectDelay           ; and delay
  178.  
  179.           jnc       fxVL_upbump             ;If no error, continue
  180.           jmp       fxVL_error              
  181.  
  182. fxVL_upbump:  
  183.  
  184.           cmp       si,vedepth              ;Have we done the entire image?
  185.           jge       fxVL_updone
  186.  
  187.           add       si,vegrain              ;Bump our loop counter
  188.           jmp       fxVL_uploop             ; and loop
  189.  
  190. fxVL_updone:
  191.  
  192.           @SetRet   veret,fxSUCCESS         ;Set the return code
  193.  
  194.           jmp       fxVL_exit
  195.  
  196. fxVL_right:
  197.  
  198.           mov       si,vevgrain             ;Initialize loop counter
  199.  
  200. fxVL_rightloop:
  201.  
  202.           mov       ax,vevseg               ;vptr
  203.           push      ax
  204.           mov       ax,vevofs
  205.           push      ax
  206.  
  207.           cmp       si,vewidth              ;Is loop past a grain increment?
  208.           jle       fxVL_rightvx            ;If not, continue
  209.  
  210.           mov       si,vewidth              ;Otherwise, reset
  211.  
  212. fxVL_rightvx:
  213.  
  214.           mov       bx,vewidth              ;vx   = width-loop
  215.           sub       bx,si
  216.           push      bx                      
  217.  
  218.           xor       ax,ax                   ;vy   = 0
  219.           push      ax
  220.           mov       ax,vex                  ;x    = x
  221.           push      ax
  222.           mov       ax,vey                  ;y    = y
  223.           push      ax
  224.           mov       ax,si                   ;x2   = x+loop-1
  225.           add       ax,vex
  226.           dec       ax
  227.           push      ax
  228.           mov       ax,vey2                 ;y2   = y2
  229.           push      ax
  230.           mov       ax,vepage               ;page = current
  231.           push      ax                      
  232.  
  233.           call      pcxVirtualDisplay       ;Display this part
  234.  
  235.           mov       ax,vedelay              ;Get the delay count
  236.           push      ax
  237.  
  238.           call      fxEffectDelay           ; and delay
  239.  
  240.           jnc       fxVL_rightbump          ;If no error, continue
  241.           jmp       SHORT fxVL_error              
  242.  
  243. fxVL_rightbump:
  244.  
  245.           cmp       si,vewidth              ;Have we done the entire image?
  246.           jge       fxVL_rightdone
  247.  
  248.           add       si,vevgrain             ;Bump our loop counter
  249.           jmp       fxVL_rightloop          ; and loop
  250.  
  251. fxVL_rightdone:
  252.  
  253.           @SetRet   veret,fxSUCCESS         ;Set the return code
  254.  
  255.           jmp       SHORT fxVL_exit
  256.  
  257. fxVL_left:
  258.  
  259.           mov       si,vevgrain             ;Initialize loop counter
  260.           inc       WORD PTR vex2
  261.  
  262. fxVL_leftloop:
  263.  
  264.           mov       ax,vevseg               ;vptr
  265.           push      ax
  266.           mov       ax,vevofs
  267.           push      ax
  268.           xor       ax,ax                   ;vx   = 0
  269.           push      ax
  270.           push      ax                      ;vy   = 0
  271.  
  272.           mov       dx,si
  273.           cmp       dx,vewidth              ;Is loop past a grain increment?
  274.           jl        fxVL_leftx              ;If not, continue
  275.  
  276.           mov       dx,vewidth              ;Otherwise, reset
  277.           dec       dx
  278.  
  279. fxVL_leftx:
  280.  
  281.           mov       ax,vex2                 ;x    = x2-loop
  282.           sub       ax,dx
  283.           push      ax                      
  284.  
  285.           mov       ax,vey                  ;y    = y
  286.           push      ax
  287.           mov       ax,vex2                 ;x2   = x2
  288.           push      ax
  289.           mov       ax,vey2                 ;y2   = y2
  290.           push      ax
  291.           mov       ax,vepage               ;page = current
  292.           push      ax
  293.  
  294.           call      pcxVirtualDisplay       ;Display this part
  295.  
  296.           mov       ax,vedelay              ;Get the delay count
  297.           push      ax
  298.  
  299.           call      fxEffectDelay           ; and delay
  300.  
  301.           jnc       fxVL_leftbump           ;If no error, continue
  302.           jmp       SHORT fxVL_error              
  303.  
  304. fxVL_leftbump:
  305.  
  306.           cmp       si,vewidth              ;Have we done the entire image?
  307.           jge       fxVL_leftdone
  308.  
  309.           add       si,vevgrain             ;Bump our loop counter
  310.           jmp       fxVL_leftloop           ; and loop
  311.  
  312. fxVL_leftdone:
  313.  
  314.           @SetRet   veret,fxSUCCESS         ;Set the return code
  315.           jmp       SHORT fxVL_exit
  316.  
  317. fxVL_error:
  318.  
  319.           @SetRet   veret,ax                ;Set the error code
  320.  
  321. fxVL_exit:
  322.  
  323.           @Exit     veret,veparm            ;Return
  324.  
  325. fxVirtualSlide      ENDP
  326.  
  327.   @EndCode
  328.  
  329.           END
  330.