mirror of
https://github.com/cc65/cc65.git
synced 2025-01-27 09:33:42 +00:00
Change display logic of mouse cursor (hide and show functions).
This commit is contained in:
parent
2be7c7c88d
commit
09aa007191
@ -49,13 +49,12 @@ cursor = 11 ; '+' screen code'
|
|||||||
|
|
||||||
getcursor:
|
getcursor:
|
||||||
column: ldy #$00 ; Patched at runtime
|
column: ldy #$00 ; Patched at runtime
|
||||||
lda (scrptr),y ; Patched at runtime
|
lda (scrptr),y
|
||||||
cmp #cursor
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
setcursor:
|
setcursor:
|
||||||
lda #cursor
|
column2:ldy #$00 ; Patched at runtime
|
||||||
setscr: sta (scrptr),y ; Patched at runtime
|
sta (scrptr),y
|
||||||
rts
|
rts
|
||||||
|
|
||||||
; ------------------------------------------------------------------------
|
; ------------------------------------------------------------------------
|
||||||
@ -67,16 +66,19 @@ done:
|
|||||||
|
|
||||||
; Hide the mouse cursor.
|
; Hide the mouse cursor.
|
||||||
hide:
|
hide:
|
||||||
jsr getcursor ; Cursor visible at current position?
|
jsr getcursor ; Get character at cursor position
|
||||||
bne done ; No, we're done
|
cmp #cursor ; "mouse" character
|
||||||
lda backup ; Get character at cursor position
|
bne overwr ; no, probably program has overwritten it
|
||||||
jmp setscr ; Draw character
|
lda backup ;
|
||||||
|
jmp setcursor ; Draw character
|
||||||
|
overwr: sta backup
|
||||||
|
rts
|
||||||
|
|
||||||
; Show the mouse cursor.
|
; Show the mouse cursor.
|
||||||
show:
|
show:
|
||||||
jsr getcursor ; Cursor visible at current position?
|
jsr getcursor ; Cursor visible at current position?
|
||||||
beq done ; Yes, we're done
|
|
||||||
sta backup ; Save character at cursor position
|
sta backup ; Save character at cursor position
|
||||||
|
lda #cursor
|
||||||
jmp setcursor ; Draw cursor
|
jmp setcursor ; Draw cursor
|
||||||
|
|
||||||
|
|
||||||
@ -87,6 +89,7 @@ movex:
|
|||||||
lsr a ; convert to character position
|
lsr a ; convert to character position
|
||||||
lsr a
|
lsr a
|
||||||
sta column+1
|
sta column+1
|
||||||
|
sta column2+1
|
||||||
rts
|
rts
|
||||||
|
|
||||||
; Move the mouse cursor y position to the value in A/X.
|
; Move the mouse cursor y position to the value in A/X.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user