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 ; ------------------------------------------------------------------------
25 ; ------------------------------------------------------------------------
27 .segment "EXTZP" : zeropage
30 ; ------------------------------------------------------------------------
42 ; ------------------------------------------------------------------------
46 cursor = 11 ; '+' screen code'
51 column: ldy #$00 ; Patched at runtime
56 column2:ldy #$00 ; Patched at runtime
60 ; ------------------------------------------------------------------------
67 ; Hide the mouse cursor.
69 jsr getcursor ; Get character at cursor position
70 cmp #cursor ; "mouse" character
71 bne overwr ; no, probably program has overwritten it
73 jmp setcursor ; Draw character
77 ; Show the mouse cursor.
79 jsr getcursor ; Cursor visible at current position?
80 sta backup ; Save character at cursor position
82 jmp setcursor ; Draw cursor
85 ; Move the mouse cursor x position to the value in A/X.
89 lsr a ; convert to character position
95 ; Move the mouse cursor y position to the value in A/X.
98 ldy tmp4 ; mul40 uses tmp4
99 lda loc_tmp ; and this local variable
101 txa ; get parameter back
102 lsr a ; convert y position to character line