1
0
mirror of https://github.com/cc65/cc65.git synced 2025-01-06 06:33:34 +00:00

Added two functions to backup and restore the cursor position

This commit is contained in:
mc78 2024-08-27 14:02:58 +02:00
parent 013a0cb4e9
commit f84f3ff0dc

25
libsrc/cbm/textcursor.s Normal file
View File

@ -0,0 +1,25 @@
;
; Helper functions to save/restore the cursor position when switching the screen memory
;
; void __fastcall__ savecursorto(uint16_t *ptr);
; void __fastcall__ restorecursorfrom(uint16_t *ptr);
.export _savecursorto, _restorecursorfrom
.import CURS_X: zp, CURS_Y: zp
.proc _savecursorto
jsr pushax
lda CURS_X
ldx CURS_Y
ldy #0
jmp staxspidx
.endproc
.proc _restorecursorfrom
jsr ldaxi
sta CURS_X
stx CURS_Y
rts
.endproc