ExecBase = 4 OpenLib = -552 CloseLib = -414 SysCopper = 38 run: move.l ExecBase,a6 ; get the addres of the graphics libary move.l #gfxname,a1 clr.l d0 jsr OpenLib(a6) tst.l d0 beq end move.l d0,gfxbase ; and save clr.l d0 ; get the address of the system copper move.l gfxbase,a6 move.l SysCopper(a6),d0 tst.l d0 beq end move.l d0,oldcopper ; and save move.l #copper,$DFF080 ; move new copper to copper register move.w #0,$DFF088 ; activate new copper main: btst #6,$BFE001 ; is lmb prssed bne main ; 0 = pressed clean: move.l Execbase,a6 ; close grapfics library move.l gfxbase,a1 jsr CloseLib(a6) end: move.l oldcopper,$DFF080 ; restore system copper rts waitVBI: move.l $DFF004,d0 ; get vpos lsr.l #8,d0 ; shift 8 to left and.l #$1FF,d0 ; mask out the 9bits of vpos cmp.l #$138,d0 ; are we at VBI bne waitVBI ; no -> wait rts waitraster: ; expects line to wait for in d1.w move.l $DFF004,d0 ; get vpos lsr.l #8,d0 ; shift 8 to left and.l #$1FF,d0 ; mask out the 9bits of vpos cmp.l d1,d0 ; are we at the wanted line bne waitraster ; no -> wait rts ********* DATA in FAST MEM ************************ gfxname: dc.b 'graphics.library',0 even gfxbase: ds.l 1 oldcopper: ds.l 1 ********* DATA in CHIP MEM ************************ section copperlist,data_C copper: dc.w $100,$0200 dc.w $6407,$FFFE dc.w $180,$F00 dc.w $6507,$FFFE dc.w $180,$000 dc.w $FFFF,$FFFE