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
52 lda (scrptr),y ; Patched at runtime
58 setscr: sta (scrptr),y ; Patched at runtime
61 ; ------------------------------------------------------------------------
68 ; Hide the mouse cursor.
70 jsr getcursor ; Cursor visible at current position?
71 bne done ; No, we're done
72 lda backup ; Get character at cursor position
73 jmp setscr ; Draw character
75 ; Show the mouse cursor.
77 jsr getcursor ; Cursor visible at current position?
78 beq done ; Yes, we're done
79 sta backup ; Save character at cursor position
80 jmp setcursor ; Draw cursor
83 ; Move the mouse cursor x position to the value in A/X.
87 lsr a ; convert to character position
92 ; Move the mouse cursor y position to the value in A/X.
95 ldy tmp4 ; mul40 uses tmp4
96 lda loc_tmp ; and this local variable
98 txa ; get parameter back
99 lsr a ; convert y position to character line