Merge pull request #503 from jedeoric/master
[telestrat] cgetc is now available
This commit is contained in:
commit
820b4dbc77
1 changed files with 28 additions and 0 deletions
28
libsrc/telestrat/cgetc.s
Normal file
28
libsrc/telestrat/cgetc.s
Normal file
|
@ -0,0 +1,28 @@
|
|||
;
|
||||
; jede jede@oric.org 2017-10-01
|
||||
;
|
||||
.export _cgetc
|
||||
|
||||
.import cursor
|
||||
|
||||
.include "telestrat.inc"
|
||||
|
||||
.proc _cgetc
|
||||
; this routine could be quicker if we wrote in page 2 variables,
|
||||
; but it's better to use telemon routine in that case, because telemon can manage 4 I/O
|
||||
lda cursor ; if cursor equal to 0, then switch off cursor
|
||||
beq switchoff_cursor
|
||||
|
||||
ldx #$00 ; x is the first screen
|
||||
BRK_TELEMON(XCSSCR) ; display cursor
|
||||
jmp loop ; could be replaced by a bne/beq but 'jmp' is cleaner than a bne/beq which could expect some matters
|
||||
|
||||
switchoff_cursor:
|
||||
ldx #$00 ; x is the first screen
|
||||
BRK_TELEMON(XCOSCR) ; switch off cursor
|
||||
|
||||
loop:
|
||||
BRK_TELEMON XRD0 ; waits until key is pressed
|
||||
bcs loop
|
||||
rts
|
||||
.endproc
|
Loading…
Add table
Reference in a new issue