From b34eed7de00a40c797af40bce5456e3c8c49b892 Mon Sep 17 00:00:00 2001 From: David Schmenk Date: Wed, 2 May 2018 13:27:08 -0700 Subject: [PATCH] Stop continuous events when mouse button pressed --- src/libsrc/apple/mouse.pla | 138 ++++++++++++++++++------------------- 1 file changed, 69 insertions(+), 69 deletions(-) diff --git a/src/libsrc/apple/mouse.pla b/src/libsrc/apple/mouse.pla index 5e05de6..27a8d87 100644 --- a/src/libsrc/apple/mouse.pla +++ b/src/libsrc/apple/mouse.pla @@ -31,7 +31,7 @@ end asm vblEvent INC VBLINT ; INC VBL EVENT + TYA ; MOUSE MOVE OR BUTTON ACTIVE - AND #$86 + AND #$82 end asm bttnEvent EOR LASTBTTN @@ -94,7 +94,7 @@ end def chkVblTimer byte count word msec - + msec = 0 count = chkEvt(@vblInt) while count @@ -243,37 +243,37 @@ CHKMOUSE: LDX #$20 ; LOOK FOR MOUSE ; EXIT: A = SLOT # :: C = 0 ; X = SLOT PAGE ; -SCAN_SLOTS: ORA #$C0 - STA TMPTR+1 - LDA #$00 - STA TMPTR -CHKSIG: LDY #$05 - LDA (TMPTR),Y - CMP #$38 ; LOOK FOR PASCAL COMPAT SIG - BNE :+ - LDY #$07 - LDA (TMPTR),Y - CMP #$18 - BNE :+ - LDY #$0B - LDA (TMPTR),Y - CMP #$01 - BNE :+ - LDY #$0C - TXA ; LOOK FOR MATCHING ID - CMP (TMPTR),Y - BNE :+ - LDA TMPTR+1 - TAX - AND #$07 - CLC - RTS -: INC TMPTR+1 - LDA TMPTR+1 - CMP #$C8 - BCC CHKSIG - SEC - RTS +SCAN_SLOTS: ORA #$C0 + STA TMPTR+1 + LDA #$00 + STA TMPTR +CHKSIG: LDY #$05 + LDA (TMPTR),Y + CMP #$38 ; LOOK FOR PASCAL COMPAT SIG + BNE :+ + LDY #$07 + LDA (TMPTR),Y + CMP #$18 + BNE :+ + LDY #$0B + LDA (TMPTR),Y + CMP #$01 + BNE :+ + LDY #$0C + TXA ; LOOK FOR MATCHING ID + CMP (TMPTR),Y + BNE :+ + LDA TMPTR+1 + TAX + AND #$07 + CLC + RTS +: INC TMPTR+1 + LDA TMPTR+1 + CMP #$C8 + BCC CHKSIG + SEC + RTS ;* ;* TURN VBL INTS ON AFTER INIT @@ -300,48 +300,48 @@ CALLVBLPROC: JSR $0000 .ASCIIZ "VBlank timer active" NOVBL: RTS - JSR PRODOS - .BYTE $40 ; ALLOC INTERRUPT - .ADDR ALLOCINTPARMS -.IFDEF DEBUG - BCC :+ - JSR PUTSLN - .ASCIIZ "FAILED TO ALLOCATE INTERRUPT" + JSR PRODOS + .BYTE $40 ; ALLOC INTERRUPT + .ADDR ALLOCINTPARMS +.IFDEF DEBUG + BCC :+ + JSR PUTSLN + .ASCIIZ "FAILED TO ALLOCATE INTERRUPT" : .ENDIF - RTS -ALLOCINTPARMS: .BYTE $02 - .BYTE $00 ; INT NUM - .ADDR IO_INTERRUPT ; INT CODE + RTS +ALLOCINTPARMS: .BYTE $02 + .BYTE $00 ; INT NUM + .ADDR IO_INTERRUPT ; INT CODE ;* ;* I/O INTERRUPT ROUTINE ;* -IO_INTERRUPT: CLD - LDY #$02 ; SLOT #1 * 2 -FNDIRQPROC: LDA LINK_DEVIRQ+1,Y - BEQ NXTIRQPROC - STA CALLIRQPROC+2 - LDA LINK_DEVIRQ,Y - STA CALLIRQPROC+1 - TYA - LSR - PHA -CALLIRQPROC: JSR $0000 - BCS :+ - PLA - TAY - PHA - JSR THREAD_NOTIFYIO -: PLA - ASL - TAY -NXTIRQPROC: INY - INY - CPY #$10 - BCC FNDIRQPROC - CLC - RTS +IO_INTERRUPT: CLD + LDY #$02 ; SLOT #1 * 2 +FNDIRQPROC: LDA LINK_DEVIRQ+1,Y + BEQ NXTIRQPROC + STA CALLIRQPROC+2 + LDA LINK_DEVIRQ,Y + STA CALLIRQPROC+1 + TYA + LSR + PHA +CALLIRQPROC: JSR $0000 + BCS :+ + PLA + TAY + PHA + JSR THREAD_NOTIFYIO +: PLA + ASL + TAY +NXTIRQPROC: INY + INY + CPY #$10 + BCC FNDIRQPROC + CLC + RTS ;* ;* MOUSE DEVICE DRIVER