OpenLibrary MACRO MOVE.L $4,A6 MOVE.L #\1,A1 MOVE.L #\2,D0 CALLLIB _LVOOpenLibrary ENDM INCLUDE "graphics/gfxbase.i" INCLUDE "graphics_lvo.i" ; requires fd2pragma to create INCLUDE "exec/exec_lib.i" ; preserve registers code is below PreserveViewAndCopperList: OpenLibrary GraphicsLibrary,0 MOVE.L D0,GraphicsBase MOVE.L D0,A6 MOVE.L gb_ActiView(A6),OldView MOVE.L gb_copinit(A6),OldCopper TakeOwnership: MOVE.L #0,A1 CALLLIB _LVOLoadView ; nuke the view CALLLIB _LVOWaitTOF ; wait two vertical blanks CALLLIB _LVOWaitTOF CALLLIB _LVOOwnBlitter CALLLIB _LVOWaitBlit ; wait... MOVE.L $4,A6 CALLLIB _LVOForbid ; the system is ours CNOP 0,4 OldView dc.l 0 OldCopper dc.l 0 GraphicsBase dc.l 0 CNOP 0,4 GraphicsLibrary GRAPHICSNAME