;
;
;
		INCLUDE "graphics/view.i"

		CSECT	text,0,1,0,4

		XREF	_OldFunc

		XDEF	@MVP_Patch

@MVP_Patch	move.l	a2,-(a7)		; we need a2 for jumping
		btst.b	#2,(vp_Modes+1)(a1)	; test if it's a LACE ViewPort
		beq.s	oldfunc
		tst.l	(vp_UCopIns)(a1)	; test if there's a user CopperList
		beq.s	oldfunc
		btst.b	#0,(vp_DyOffset+1)(a1)	; test if the vertical offset is odd
		beq.s	oldfunc
		subq.w	#1,vp_DyOffset(a1)	; if everything is true, decrement the offset

oldfunc:	move.l	_OldFunc,a2		; jsr to the old function
		jsr	(a2)
		move.l	(a7)+,a2
		rts
