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 ; ------------------------------------------------------------------------
43 ; ------------------------------------------------------------------------
47 cursor = 11 ; '+' screen code'
52 column: ldy #$00 ; Patched at runtime
53 lda (scrptr),y ; Patched at runtime
59 setscr: sta (scrptr),y ; Patched at runtime
62 ; ------------------------------------------------------------------------
69 ; Hide the mouse cursor.
71 jsr getcursor ; Cursor visible at current position?
72 bne done ; No, we're done
73 lda backup ; Get character at cursor position
74 jmp setscr ; Draw character
76 ; Show the mouse cursor.
78 jsr getcursor ; Cursor visible at current position?
79 beq done ; Yes, we're done
80 sta backup ; Save character at cursor position
81 jmp setcursor ; Draw cursor
84 ; Move the mouse cursor x position to the value in A/X.
88 lsr a ; convert to character position
93 ; Move the mouse cursor y position to the value in A/X.
96 ldy tmp4 ; mul40 uses tmp4
97 lda loc_tmp ; and this local variable
99 txa ; get parameter back
100 lsr a ; convert y position to character line