; *************************************** ; Turbo-Mouse Accessory ; 16.4.1989 27.4.1989 ; Peter Holzwarth Frank Ostrowski ; *************************************** ;This accessory installs itself as a mouse speeder. It uses ;the XBRA identifications as the GFA assembler only supports ;mouse speeders with XBRA. start: lea.l stack,sp bsr a_i move.w #34,-(sp) ;Fetch vectors list from keyboard trap #14 ;processor interrupts movea.l d0,a3 pea init ;install turbo mouse move.w #38,-(sp) trap #14 l: bsr e_t ; move.w #2,-(sp) ;invert screen ; trap #14 ;test:then also e_t: ; addq.l #2,sp ;move.l #$00010000,intin ; movea.l d0,a0 ;(i.e. return very quickly) ; move.w #32000/4-1,d0 ;.1: not.l (a0)+ ; dbra d0,.1 bra.s l init: movea.l a3,a0 ;install turbo mouse movea.l 16(a0),a1 ;old mouse vector move.l a1,old ;save old contents move.l #turbo,16(a0) ;set own mouse vector rts ;finished .DC.l 'XBRA','PHFO' old: .DC.l 0 turbo: movem.l d0-d2/a0,-(sp) ;save registers required cmpi.b #$f8,(a0) ;is it a mouse interrupt? bcs .e ; no cmpi.b #$fc,(a0)+ bcc .e ; no move.b (a0)+,d0 ; x-movement move.b (a0)+,d1 ; y-movement cmpi.b #2,d0 bls.s .01 move.b d0,d2 bpl.s .00 neg.b d2 .00: mulu.w d2,d0 .01: cmpi.b #2,d1 bls.s .03 move.b d1,d2 bpl.s .02 neg.b d2 .02: mulu.w d2,d1 .03: .2: move.b d1,-(a0) ;and write back values move.b d0,-(a0) .e: movem.l (sp)+,d0-d2/a0 ;restore registers move.l old,-(sp) rts a_i: moveq.l #10,d0 moveq.l #0,d1 moveq.l #1,d2 moveq.l #0,d3 bra aesd e_t: move.l #-1,intin ;EVNT_TIMER(-1) = never moveq.l #24,d0 moveq.l #2,d1 moveq.l #0,d2 moveq.l #0,d3 aesd: moveq.l #0,d4 movem.w d0-d4,contrl move.l #aesbp,d1 move.w #200,d0 trap #2 rts aesbp: .DC.l contrl,globl,intin,intout,addrin,addrout .BSS contrl: .DS.w 12 globl: .DS.w 15 intin: .DS.w 2 intout: .DS.w 1 addrin: .DS.l 1 addrout: .DS.l 1 .DS.l 256 stack: