****************************************************************** * * * Assembly Code For: MouseUtil Version 1.1 * * Programming By: Luciano Bertato * * CompuServe: 73246,1744 * * Canada Remote Systems: LUCIANO BERTATO * * Date: Friday July 15, 1988 * * * ****************************************************************** ** external reference XREF _AbsExecBase ** macros LIBCALL MACRO XREF _LVO\1 CLR.L d0 MOVEA.L _AbsExecBase,a6 JSR _LVO\1(a6) ENDM CALL MACRO XREF _LVO\1 JSR _LVO\1(a6) ENDM FILL MACRO MOVE.L #\1,d0 MOVE.L #\2,d1 MOVE.L #\3,d2 MOVE.L #\4,d3 MOVEA.L RPort,a1 CALL RectFill ENDM ** open everything *********************************************** ** start _main: movem.l d0-d7/a0-a6,-(sp) movea.l #IntuiName,a1 LIBCALL OpenLibrary move.l d0,IntuitionBase beq abort1 movea.l #DosName,a1 LIBCALL OpenLibrary move.l d0,DosBase beq abort2 movea.l #GfxName,a1 LIBCALL OpenLibrary move.l d0,GfxBase beq abort3 movea.l #PrefBuffer,a0 movea.l IntuitionBase,a6 move.l #PrefBufferSize,d0 CALL GetPrefs tst.w d0 beq abort4 move.l d0,a0 move.w PointerTicks(a0),d0 move.w d0,TickValue cmp.w #4,d0 beq Fourset cmp.w #2,d0 beq Twoset or.w #SELECTED,OneGadget+12 bra Windowmake Twoset: or.w #SELECTED,TwoGadget+12 bra Windowmake Fourset: or.w #SELECTED,FourGadget+12 Windowmake: movea.l #window,a0 movea.l IntuitionBase,a6 CALL OpenWindow move.l d0,Windowptr beq abort4 move.l d0,a0 move.l wd_RPort(a0),RPort ****************************************************************** **waiting for gadget selection AdjustLoop: movea.l Windowptr,a0 movea.l wd_UserPort(a0),a0 move.b MP_SIGBIT(a0),d1 moveq.l #1,d0 lsl.l d1,d0 movea.l _AbsExecBase,a6 CALL Wait ****************************************************************** movea.l Windowptr,a0 movea.l wd_UserPort(a0),a0 movea.l _AbsExecBase,a6 CALL GetMsg movea.l d0,a1 move.l a1,-(sp) movea.l im_IAddress(a1),a0 move.w gg_GadgetID(a0),d0 cmp.w #8,d0 beq Done cmp.w #16,d0 bne AdjustTicks move.w TickValue,d0 bsr ChangeTicks bra Done AdjustTicks: bsr ChangeTicks movea.l (sp)+,a1 bsr Reply move.w NewTickValue,d0 cmp.w #1,d0 bne Jump1 or.w #SELECTED,OneGadget+12 bra Jump2 Jump1: and.w #DESELECTED,OneGadget+12 Jump2: cmp.w #2,d0 bne Jump3 or.w #SELECTED,TwoGadget+12 bra Jump4 Jump3: and.w #DESELECTED,TwoGadget+12 Jump4: cmp.w #4,d0 bne Jump5 or.w #SELECTED,FourGadget+12 bra Jump6 Jump5: and.w #DESELECTED,FourGadget+12 Jump6: movea.l GfxBase,a6 movea.l RPort,a1 moveq.l #COLOR,d0 CALL SetAPen FILL $3b,$2e,$7c,$38 FILL $7f,$2e,$c0,$38 FILL $c3,$2e,$104,$38 movea.l #OneGadget,a0 movea.l Windowptr,a1 movea.l #0,a2 movea.l IntuitionBase,a6 CALL RefreshGadgets bra AdjustLoop ** exit program ************************************************** **Done Done: movea.l (sp)+,a1 bsr Reply **abort abort5: movea.l Windowptr,a0 movea.l IntuitionBase,a6 CALL CloseWindow abort4: movea.l GfxBase,a1 LIBCALL CloseLibrary abort3: movea.l DosBase,a1 LIBCALL CloseLibrary abort2: movea.l IntuitionBase,a1 LIBCALL CloseLibrary abort1: movem.l (sp)+,d0-d7/a0-a6 clr.l d0 rts ****************************************************************** **subroutines ChangeTicks: movea.l #PrefBuffer,a0 lea PointerTicks(a0),a1 move.w d0,(a1) move.w d0,NewTickValue movea.l IntuitionBase,a6 move.l #PrefBufferSize,d0 moveq.l #1,d1 CALL SetPrefs rts Reply: movea.l _AbsExecBase,a6 CALL ReplyMsg rts ****************************************************************** SECTION data,DATA window: dc.w 30,30,320,90 dc.b 0,1 dc.l IDCMPflags,flags,DoneGadget,0,title,0,0 dc.w 1,1,640,200,WBENCHSCREEN ****************************************************************** DoneGadget: dc.l CancelGadget dc.w 200,70,50,11 dc.w GADGHCOMP,RELVERIFY,BOOLGADGET dc.l Done_border,0,Done_text,0,0 dc.w 8 dc.l 0 Done_text: dc.b 1,0,1,0 dc.w 2,2 dc.l 0,DG_text,0 Done_border: dc.w -1,-1 dc.b 1,0,JAM1,5 dc.l DoneXY,0 DoneXY: dc.w 0,0 dc.w 51,0 dc.w 51,12 dc.w 0,12 dc.w 0,0 DG_text: dc.b ' Done ',0,0 ****************************************************************** CancelGadget: dc.l OneGadget dc.w 70,70,66,11 dc.w GADGHCOMP,RELVERIFY,BOOLGADGET dc.l Cancel_border,0,Cancel_text,0,0 dc.w 16 dc.l 0 Cancel_text: dc.b 1,0,1,0 dc.w 2,2 dc.l 0,CG_text,0 Cancel_border: dc.w -1,-1 dc.b 1,0,JAM1,5 dc.l CancelXY,0 CancelXY: dc.w 0,0 dc.w 67,0 dc.w 67,12 dc.w 0,12 dc.w 0,0 CG_text: dc.b ' Cancel ',0,0 ****************************************************************** OneGadget: dc.l TwoGadget dc.w 195,46,66,11 dc.w GADGHCOMP,RELVERIFY,BOOLGADGET dc.l One_border,0,One_text,0,0 dc.w 1 dc.l 0 One_text: dc.b 1,0,1,0 dc.w 31,2 dc.l 0,OG_text,0 One_border: dc.w -1,-1 dc.b 1,0,JAM1,5 dc.l OneXY,0 OneXY: dc.w 0,0 dc.w 67,0 dc.w 67,12 dc.w 0,12 dc.w 0,0 OG_text: dc.b '1',0 ****************************************************************** TwoGadget: dc.l FourGadget dc.w 127,46,66,11 dc.w GADGHCOMP,RELVERIFY,BOOLGADGET dc.l Two_border,0,Two_text,0,0 dc.w 2 dc.l 0 Two_text: dc.b 1,0,1,0 dc.w 31,2 dc.l 0,TG_text,0 Two_border: dc.w -1,-1 dc.b 1,0,JAM1,5 dc.l TwoXY,0 TwoXY: dc.w 0,0 dc.w 67,0 dc.w 67,12 dc.w 0,12 dc.w 0,0 TG_text: dc.b '2',0 ****************************************************************** FourGadget: dc.l 0 dc.w 59,46,66,11 dc.w GADGHCOMP,RELVERIFY,BOOLGADGET dc.l Four_border,0,Four_text,0,0 dc.w 4 dc.l 0 Four_text: dc.b 1,0,1,0 dc.w 31,2 dc.l 0,FG_text,Four_text2 Four_text2: dc.b 1,0,1,0 dc.w 10,-26 dc.l 0,FG_text2,Four_text3 Four_text3: dc.b 1,0,1,0 dc.w 0,-9 dc.l 0,FG_text3,Four_text4 Four_text4: dc.b 1,0,1,0 dc.w 168,-9 dc.l 0,FG_text4,0 Four_border: dc.w -1,-1 dc.b 1,0,JAM1,5 dc.l FourXY,0 FourXY: dc.w 0,0 dc.w 67,0 dc.w 67,12 dc.w 0,12 dc.w 0,0 FG_text: dc.b '4',0 FG_text2: dc.b 'Select The Mouse Speed:',0 FG_text3: dc.b 'Slow',0,0 FG_text4: dc.b 'Fast',0,0 ****************************************************************** title: dc.b ' MouseUtil V1.1 ',0,0 IntuiName: dc.b 'intuition.library',0 DosName: dc.b 'dos.library',0 GfxName: dc.b 'graphics.library',0,0 ****************************************************************** WBENCHSCREEN EQU $0001 ACTIVATE EQU $1000 WINDOWDRAG EQU $0002 WINDOWCLOSE EQU $0008 SMART_REFRESH EQU $0000 STRGADGET EQU $0004 BOOLGADGET EQU $0001 PROPGADGET EQU $0003 TOGGLESELECT EQU $0100 RELVERIFY EQU $0001 GADGIMMEDIATE EQU $0002 FOLLOWMOUSE EQU $0008 SELECTED EQU $0080 DESELECTED EQU $FF7F GADGHCOMP EQU $0000 GADGHBOX EQU $0001 GADGHIMAGE EQU $0002 GADGHNONE EQU $0003 CLOSEWINDOW EQU $00000200 GADGETUP EQU $00000040 FREEVERT EQU $0004 FREEHORIZ EQU $0002 AUTOKNOB EQU $0001 JAM1 EQU $0000 MP_SIGBIT EQU $0F wd_UserPort EQU $56 wd_RPort EQU $32 im_IAddress EQU $1c gg_GadgetID EQU 38 PointerTicks EQU $6c PrefBufferSize EQU 232 COLOR EQU 0 flags EQU ACTIVATE!WINDOWDRAG!SMART_REFRESH IDCMPflags EQU GADGETUP ****************************************************************** SECTION mem,BSS IntuitionBase: ds.l 1 ;intuition base address pointer DosBase: ds.l 1 ;dos base address pointer GfxBase: ds.l 1 ;graphics base address pointer Windowptr: ds.l 1 ;pointer to window RPort: ds.l 1 ;rp pointer for window TickValue: ds.w 1 ;original mouse speed NewTickValue: ds.w 1 ;changed mouse speed PrefBuffer: ds.b 232 ;preferences buffer ****************************************************************** END