home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 2: PC / frozenfish_august_1995.bin / bbs / d07xx / d0779.lha / VPortPatch / Patch.a < prev    next >
Text File  |  1992-12-06  |  549b  |  25 lines

  1. ;
  2. ;
  3. ;
  4.         INCLUDE "graphics/view.i"
  5.  
  6.         CSECT    text,0,1,0,4
  7.  
  8.         XREF    _OldFunc
  9.  
  10.         XDEF    @MVP_Patch
  11.  
  12. @MVP_Patch    move.l    a2,-(a7)        ; we need a2 for jumping
  13.         btst.b    #2,(vp_Modes+1)(a1)    ; test if it's a LACE ViewPort
  14.         beq.s    oldfunc
  15.         tst.l    (vp_UCopIns)(a1)    ; test if there's a user CopperList
  16.         beq.s    oldfunc
  17.         btst.b    #0,(vp_DyOffset+1)(a1)    ; test if the vertical offset is odd
  18.         beq.s    oldfunc
  19.         subq.w    #1,vp_DyOffset(a1)    ; if everything is true, decrement the offset
  20.  
  21. oldfunc:    move.l    _OldFunc,a2        ; jsr to the old function
  22.         jsr    (a2)
  23.         move.l    (a7)+,a2
  24.         rts
  25.