1
0
mirror of https://github.com/cc65/cc65.git synced 2025-01-11 11:30:13 +00:00

29 lines
942 B
ArmAsm
Raw Normal View History

2017-10-01 23:23:03 +02:00
;
; jede jede@oric.org 2017-10-01
;
.export _cgetc
2019-02-05 23:27:52 +01:00
2017-10-08 18:11:09 +02:00
.import cursor
2019-02-05 23:27:52 +01:00
2017-10-01 23:23:03 +02:00
.include "telestrat.inc"
.proc _cgetc
2019-02-05 23:27:52 +01:00
; this routine could be quicker if we wrote in page 2 variables,
2017-10-08 18:14:26 +02:00
; but it's better to use telemon routine in that case, because telemon can manage 4 I/O
2017-10-16 18:15:53 +02:00
ldx cursor ; if cursor equal to 0, then switch off cursor
2017-10-08 18:11:09 +02:00
beq switchoff_cursor
2019-02-05 23:27:52 +01:00
2017-10-08 18:11:09 +02:00
ldx #$00 ; x is the first screen
BRK_TELEMON(XCSSCR) ; display cursor
2017-10-08 18:14:26 +02:00
jmp loop ; could be replaced by a bne/beq but 'jmp' is cleaner than a bne/beq which could expect some matters
2019-02-05 23:27:52 +01:00
switchoff_cursor:
2017-10-16 18:15:53 +02:00
; at this step X is equal to $00, X must be set, because it's the id of the screen (telestrat can handle 4 virtuals screen)
2019-02-05 23:27:52 +01:00
BRK_TELEMON(XCOSCR) ; switch off cursor
loop:
2017-10-08 18:14:26 +02:00
BRK_TELEMON XRD0 ; waits until key is pressed
2017-10-02 12:20:52 +02:00
bcs loop
2017-10-01 23:23:03 +02:00
rts
2019-02-05 23:27:52 +01:00
.endproc