1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-27 00:29:31 +00:00
cc65/libsrc/telestrat/gotoxy.s

54 lines
943 B
ArmAsm
Raw Normal View History

;
; 2017-02-25, jede <jede@oric.org>
; 2017-06-15, Greg King
;
; void gotoxy (unsigned char x, unsigned char y);
;
2019-07-07 20:02:48 +00:00
.export gotoxy, _gotoxy, update_adscr
2019-07-06 08:16:57 +00:00
2019-07-17 19:48:53 +00:00
.import popa, OLD_CHARCOLOR, OLD_BGCOLOR
2017-02-25 20:32:06 +00:00
.include "telestrat.inc"
gotoxy: jsr popa ; Get Y
2017-02-25 20:32:06 +00:00
.proc _gotoxy
; This function moves only the display cursor; it does not move the prompt position.
; In telemon, there is a position for the prompt, and another for the cursor.
2019-07-10 19:44:07 +00:00
2019-07-17 19:48:53 +00:00
sta SCRY
2022-04-17 14:06:22 +00:00
2019-07-10 19:44:07 +00:00
2019-07-17 19:48:53 +00:00
jsr popa
sta SCRX
; Update address video ram position when SCRY is modified (update_adscr)
; Fall through
2019-07-17 19:48:53 +00:00
.endproc
2019-07-17 19:48:53 +00:00
.proc update_adscr
lda #<SCREEN
2021-03-01 21:33:12 +00:00
sta ADSCR
2019-07-17 19:48:53 +00:00
lda #>SCREEN
2021-03-01 21:33:12 +00:00
sta ADSCR+1
2019-07-17 19:48:53 +00:00
ldy SCRY
beq out
loop:
2021-03-01 21:33:12 +00:00
lda ADSCR
2019-07-17 19:48:53 +00:00
clc
adc #SCREEN_XSIZE
2019-07-17 19:48:53 +00:00
bcc skip
2021-03-01 21:33:12 +00:00
inc ADSCR+1
skip:
2021-03-01 21:33:12 +00:00
sta ADSCR
2019-07-17 19:48:53 +00:00
dey
bne loop
2022-04-17 14:06:22 +00:00
out:
2019-07-17 19:48:53 +00:00
rts
2019-07-07 20:02:48 +00:00
.endproc