2017-02-25 21:20:17 +00:00
|
|
|
;
|
2017-06-15 20:44:46 +00:00
|
|
|
; 2017-02-25, jede <jede@oric.org>
|
|
|
|
; 2017-06-15, Greg King
|
2017-02-25 21:20:17 +00:00
|
|
|
;
|
2017-06-15 20:44:46 +00:00
|
|
|
; 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
|
|
|
|
2017-06-15 20:44:46 +00:00
|
|
|
.include "telestrat.inc"
|
|
|
|
|
|
|
|
gotoxy: jsr popa ; Get Y
|
2017-02-25 20:32:06 +00:00
|
|
|
|
|
|
|
.proc _gotoxy
|
2017-06-15 20:44:46 +00:00
|
|
|
|
|
|
|
; 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
|
2019-07-02 23:13:59 +00:00
|
|
|
|
2022-02-21 20:44:31 +00:00
|
|
|
; Update address video ram position when SCRY is modified (update_adscr)
|
2019-07-18 18:48:10 +00:00
|
|
|
; Fall through
|
2019-07-17 19:48:53 +00:00
|
|
|
.endproc
|
2019-07-02 23:13:59 +00:00
|
|
|
|
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
|
2019-07-02 23:13:59 +00:00
|
|
|
loop:
|
2021-03-01 21:33:12 +00:00
|
|
|
lda ADSCR
|
2019-07-17 19:48:53 +00:00
|
|
|
clc
|
2019-07-18 18:48:10 +00:00
|
|
|
adc #SCREEN_XSIZE
|
2019-07-17 19:48:53 +00:00
|
|
|
bcc skip
|
2021-03-01 21:33:12 +00:00
|
|
|
inc ADSCR+1
|
2019-07-02 23:13:59 +00:00
|
|
|
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
|