2 ; Text mode character 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_txt_callbacks
16 .importzp mouse_txt_char ; screen code of mouse cursor
20 ; ------------------------------------------------------------------------
27 ; ------------------------------------------------------------------------
29 .segment "EXTZP" : zeropage
32 ; ------------------------------------------------------------------------
46 ; ------------------------------------------------------------------------
53 column: ldy #$00 ; Patched at runtime
58 column2:ldy #$00 ; Patched at runtime
62 ; ------------------------------------------------------------------------
69 ; Hide the mouse cursor.
74 jsr getcursor ; Get character at cursor position
75 cmp #mouse_txt_char ; "mouse" character
76 bne overwr ; no, probably program has overwritten it
78 jmp setcursor ; Draw character
82 ; Show the mouse cursor.
89 jsr getcursor ; Cursor visible at current position?
90 sta backup ; Save character at cursor position
92 jmp setcursor ; Draw cursor
95 ; Move the mouse cursor x position to the value in A/X.
99 lsr a ; convert to character position
105 ; Move the mouse cursor y position to the value in A/X.
108 ldy tmp4 ; mul40 uses tmp4
109 lda loc_tmp ; and this local variable
111 txa ; get parameter back
112 lsr a ; convert y position to character line