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 >
Text File  |  1990-05-06  |  2KB  |  91 lines

  1.            INCLUDE      "exec/types.i"
  2.            INCLUDE      "graphics/clip.i"
  3.            INCLUDE      "graphics/rastport.i"
  4.            INCLUDE      "hardware/blit.i"
  5.            INCLUDE      "PopUpMenu.i"
  6.  
  7. _LVOBltBitMap  EQU      -$1e
  8. ALLPLANES      EQU      -1
  9. B_XOR_C        EQU      ABNC+ANBC
  10.  
  11.            xdef      @SwapBits
  12.  
  13.            section      text,code
  14. *****************************************************************************
  15. * SwapBits(Window) - Works like SwapBitsRastPortClipRect() without bugs :-) *
  16. *                                        *
  17. *****************************************************************************
  18.  
  19. * ------------ Check to see that window is open
  20. @SwapBits:     TST.W      (A0)
  21.            BEQ.S      NoWindow
  22.  
  23.            MOVEM.L      D2-D7/A2/A6,-(SP)
  24.  
  25. * ------------ SrcX
  26.            MOVEQ.L      #0,D0
  27.            MOVE.W      wd_LeftEdge(A0),D0
  28.  
  29. * ------------ SrcY
  30.            MOVEQ.L      #0,D1
  31.            MOVE.W      wd_TopEdge(A0),D1
  32.  
  33. * ------------ SizeX
  34.            MOVEQ.L      #0,D4
  35.            MOVE.W      wd_Width(A0),D4
  36.  
  37. * ------------ SizeY
  38.            MOVEQ.L      #0,D5
  39.            MOVE.W      wd_Height(A0),D5
  40.  
  41. * ------------ MinTerm
  42.            MOVEQ.L      #B_XOR_C,D6
  43.  
  44. * ------------ Mask
  45.            MOVEQ.L      #ALLPLANES,D7
  46.  
  47. * ------------ TempA
  48.            SUB.L      A2,A2
  49.  
  50.            MOVE.L      _GfxBase(A4),A6
  51.  
  52. * ------------ Off-screen bitmap
  53.            LEA      wd_Bm(A0),A1
  54.  
  55. * ------------ On-screen bitmap
  56.            MOVE.L      _Rp+rp_BitMap(A4),A0
  57.  
  58. * ------------ DestX
  59.            MOVEQ.L      #0,D2
  60. * ------------ DestY
  61.            MOVEQ.L      #0,D3
  62.  
  63. * ------------ OffScreen = OffScreen XOR OnScreen
  64.            BSR.S      Swap
  65. * ------------ OnScreen = OnScreen XOR OffScreen  (= OffScreen)
  66.            BSR.S      Swap
  67. * ------------ OffScreen = OffScreen XOR OnScreen  (= OnScreen)
  68.            BSR.S      Swap
  69.  
  70.            MOVEM.L      (SP)+,D2-D7/A2/A6
  71. NoWindow:      RTS
  72.  
  73.  
  74. Swap:           MOVEM.L      D0/D1/A0/A1,-(SP)
  75.            JSR      _LVOBltBitMap(A6)
  76.            MOVEM.L      (SP)+,D0/D1/A0/A1
  77.  
  78.            EXG.L      A0,A1
  79.            EXG.L      D0,D2
  80.            EXG.L      D1,D3
  81.  
  82.            RTS
  83.  
  84.            section      __MERGED,bss
  85.  
  86.            xref      _GfxBase
  87.            xref      _Rp
  88.  
  89.            END
  90.  
  91.