2 ; Default mouse callbacks for the Ataris
4 ; Christian Groessler, 03.01.2014
6 ; derived from Apple2 version by
7 ; Oliver Schmidt, 22.09.2005
9 ; All functions in this module should be interrupt safe, because they may
10 ; be called from an interrupt handler
13 .export _mouse_def_callbacks
19 ; ------------------------------------------------------------------------
26 ; ------------------------------------------------------------------------
28 .segment "EXTZP" : zeropage
31 ; ------------------------------------------------------------------------
45 ; ------------------------------------------------------------------------
49 cursor = 11 ; '+' screen code'
54 column: ldy #$00 ; Patched at runtime
59 column2:ldy #$00 ; Patched at runtime
63 ; ------------------------------------------------------------------------
70 ; Hide the mouse cursor.
75 jsr getcursor ; Get character at cursor position
76 cmp #cursor ; "mouse" character
77 bne overwr ; no, probably program has overwritten it
79 jmp setcursor ; Draw character
83 ; Show the mouse cursor.
90 jsr getcursor ; Cursor visible at current position?
91 sta backup ; Save character at cursor position
93 jmp setcursor ; Draw cursor
96 ; Move the mouse cursor x position to the value in A/X.
100 lsr a ; convert to character position
106 ; Move the mouse cursor y position to the value in A/X.
109 ldy tmp4 ; mul40 uses tmp4
110 lda loc_tmp ; and this local variable
112 txa ; get parameter back
113 lsr a ; convert y position to character line