1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-28 19:29:53 +00:00
cc65/libsrc/telestrat/gotoxy.s

55 lines
1.2 KiB
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-06 08:26:19 +00:00
.import popa, CHARCOLOR_CHANGE, BGCOLOR_CHANGE
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.
sta SCRY
jsr popa
sta SCRX
2019-07-07 20:02:48 +00:00
jsr update_adscr ; Update adress video ram position when SCRY et SCRX are modified
2019-07-06 08:16:57 +00:00
; Force to put again attribute when it moves on the screen
lda #$01
sta CHARCOLOR_CHANGE
sta BGCOLOR_CHANGE
rts
.endproc
2019-07-07 20:02:48 +00:00
.proc update_adscr
lda #<SCREEN
sta ADSCRL
lda #>SCREEN
2019-07-06 08:33:39 +00:00
sta ADSCRH
ldy SCRY
2019-07-06 08:16:57 +00:00
beq out
loop:
lda ADSCRL
clc
adc #$28
bcc skip
inc ADSCRH
skip:
sta ADSCRL
dey
bne loop
2019-07-06 08:16:57 +00:00
out:
rts
2019-07-07 20:02:48 +00:00
.endproc