2017-02-25 22:20:17 +01:00
|
|
|
;
|
2017-06-15 16:44:46 -04:00
|
|
|
; 2017-02-25, jede <jede@oric.org>
|
|
|
|
; 2017-06-15, Greg King
|
2017-02-25 22:20:17 +01:00
|
|
|
;
|
2017-06-15 16:44:46 -04:00
|
|
|
; void gotoxy (unsigned char x, unsigned char y);
|
|
|
|
;
|
|
|
|
|
2019-07-07 22:02:48 +02:00
|
|
|
.export gotoxy, _gotoxy, update_adscr
|
2019-07-06 10:16:57 +02:00
|
|
|
|
2019-07-17 21:48:53 +02:00
|
|
|
.import popa, OLD_CHARCOLOR, OLD_BGCOLOR
|
2017-02-25 21:32:06 +01:00
|
|
|
|
2017-06-15 16:44:46 -04:00
|
|
|
.include "telestrat.inc"
|
|
|
|
|
|
|
|
gotoxy: jsr popa ; Get Y
|
2017-02-25 21:32:06 +01:00
|
|
|
|
|
|
|
.proc _gotoxy
|
2017-06-15 16:44:46 -04: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 21:44:07 +02:00
|
|
|
|
2019-07-17 21:48:53 +02:00
|
|
|
sta SCRY
|
2022-04-17 16:06:22 +02:00
|
|
|
|
2019-07-10 21:44:07 +02:00
|
|
|
|
2019-07-17 21:48:53 +02:00
|
|
|
jsr popa
|
|
|
|
sta SCRX
|
2019-07-03 01:13:59 +02:00
|
|
|
|
2022-02-21 15:44:31 -05:00
|
|
|
; Update address video ram position when SCRY is modified (update_adscr)
|
2019-07-18 20:48:10 +02:00
|
|
|
; Fall through
|
2019-07-17 21:48:53 +02:00
|
|
|
.endproc
|
2019-07-03 01:13:59 +02:00
|
|
|
|
2019-07-17 21:48:53 +02:00
|
|
|
.proc update_adscr
|
|
|
|
|
|
|
|
lda #<SCREEN
|
2021-03-01 22:33:12 +01:00
|
|
|
sta ADSCR
|
2019-07-17 21:48:53 +02:00
|
|
|
|
|
|
|
lda #>SCREEN
|
2021-03-01 22:33:12 +01:00
|
|
|
sta ADSCR+1
|
2019-07-17 21:48:53 +02:00
|
|
|
|
|
|
|
ldy SCRY
|
|
|
|
beq out
|
2019-07-03 01:13:59 +02:00
|
|
|
loop:
|
2021-03-01 22:33:12 +01:00
|
|
|
lda ADSCR
|
2019-07-17 21:48:53 +02:00
|
|
|
clc
|
2019-07-18 20:48:10 +02:00
|
|
|
adc #SCREEN_XSIZE
|
2019-07-17 21:48:53 +02:00
|
|
|
bcc skip
|
2021-03-01 22:33:12 +01:00
|
|
|
inc ADSCR+1
|
2019-07-03 01:13:59 +02:00
|
|
|
skip:
|
2021-03-01 22:33:12 +01:00
|
|
|
sta ADSCR
|
2019-07-17 21:48:53 +02:00
|
|
|
dey
|
|
|
|
bne loop
|
2022-04-17 16:06:22 +02:00
|
|
|
out:
|
2019-07-17 21:48:53 +02:00
|
|
|
rts
|
2019-07-07 22:02:48 +02:00
|
|
|
.endproc
|