home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
372.lha
/
PopUpMenu_3.2
/
Source
/
MySwapBits.a
< prev
next >
Wrap
Text File
|
1990-05-06
|
2KB
|
91 lines
INCLUDE "exec/types.i"
INCLUDE "graphics/clip.i"
INCLUDE "graphics/rastport.i"
INCLUDE "hardware/blit.i"
INCLUDE "PopUpMenu.i"
_LVOBltBitMap EQU -$1e
ALLPLANES EQU -1
B_XOR_C EQU ABNC+ANBC
xdef @SwapBits
section text,code
*****************************************************************************
* SwapBits(Window) - Works like SwapBitsRastPortClipRect() without bugs :-) *
* *
*****************************************************************************
* ------------ Check to see that window is open
@SwapBits: TST.W (A0)
BEQ.S NoWindow
MOVEM.L D2-D7/A2/A6,-(SP)
* ------------ SrcX
MOVEQ.L #0,D0
MOVE.W wd_LeftEdge(A0),D0
* ------------ SrcY
MOVEQ.L #0,D1
MOVE.W wd_TopEdge(A0),D1
* ------------ SizeX
MOVEQ.L #0,D4
MOVE.W wd_Width(A0),D4
* ------------ SizeY
MOVEQ.L #0,D5
MOVE.W wd_Height(A0),D5
* ------------ MinTerm
MOVEQ.L #B_XOR_C,D6
* ------------ Mask
MOVEQ.L #ALLPLANES,D7
* ------------ TempA
SUB.L A2,A2
MOVE.L _GfxBase(A4),A6
* ------------ Off-screen bitmap
LEA wd_Bm(A0),A1
* ------------ On-screen bitmap
MOVE.L _Rp+rp_BitMap(A4),A0
* ------------ DestX
MOVEQ.L #0,D2
* ------------ DestY
MOVEQ.L #0,D3
* ------------ OffScreen = OffScreen XOR OnScreen
BSR.S Swap
* ------------ OnScreen = OnScreen XOR OffScreen (= OffScreen)
BSR.S Swap
* ------------ OffScreen = OffScreen XOR OnScreen (= OnScreen)
BSR.S Swap
MOVEM.L (SP)+,D2-D7/A2/A6
NoWindow: RTS
Swap: MOVEM.L D0/D1/A0/A1,-(SP)
JSR _LVOBltBitMap(A6)
MOVEM.L (SP)+,D0/D1/A0/A1
EXG.L A0,A1
EXG.L D0,D2
EXG.L D1,D3
RTS
section __MERGED,bss
xref _GfxBase
xref _Rp
END