File: cgetc.s

package info (click to toggle)
cc65 2.19-2
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 20,268 kB
  • sloc: ansic: 117,151; asm: 66,339; pascal: 4,248; makefile: 1,009; perl: 607
file content (28 lines) | stat: -rw-r--r-- 942 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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
        ldx     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:
        ; 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)
        BRK_TELEMON(XCOSCR)  ; switch off cursor

loop:
        BRK_TELEMON XRD0     ; waits until key is pressed
        bcs     loop
        rts
.endproc