]> git.sur5r.net Git - cc65/blobdiff - libsrc/cbm610/cgetc.s
no TGI_ERR_NO_MEM or TGI_ERR_NO_IOCB anymore: replaced by TGI_ERR_NO_RES
[cc65] / libsrc / cbm610 / cgetc.s
index c801c3ab811337625a3e739f0262f50884f8196b..8a017b4f5ad7c4070fff66fc8c8ef521a1211234 100644 (file)
@@ -8,42 +8,43 @@
        .import         plot, write_crtc
        .import         cursor
 
-       .include        "zeropage.inc"
-       .include        "page3.inc"
+        .import         keyidx: zp, keybuf: zp, config: zp
 
 
-_cgetc:        lda     KeyIndex        ; Get number of characters
-       bne     L2              ; Jump if there are already chars waiting
+
+_cgetc:        lda     keyidx          ; Get number of characters
+       bne     L2              ; Jump if there are already chars waiting
 
 ; Switch on the cursor if needed
 
                lda     cursor
-               beq     L1              ; Jump if no cursor
+               beq     L1              ; Jump if no cursor
 
-               jsr     plot            ; Set the current cursor position
+               jsr     plot            ; Set the current cursor position
                ldy     #10
-               lda     Config          ; Cursor format
+               lda     config          ; Cursor format
                jsr     write_crtc      ; Set the cursor formar
 
-L1:            lda     KeyIndex
+L1:            lda     keyidx
                beq     L1
 
                ldy     #10
-               lda     #$20            ; Cursor off
+               lda     #$20            ; Cursor off
                jsr     write_crtc
 
-L2:            ldx     #$00            ; Get index
-               ldy     KeyBuf          ; Get first character in the buffer
+L2:            ldx     #$00            ; Get index
+               ldy     keybuf          ; Get first character in the buffer
                sei
-L3:            lda     KeyBuf+1,x      ; Move up the remaining chars
-               sta     KeyBuf,x
+L3:            lda     keybuf+1,x      ; Move up the remaining chars
+               sta     keybuf,x
                inx
-               cpx     KeyIndex
+               cpx     keyidx
                bne     L3
-               dec     KeyIndex
+               dec     keyidx
                cli
 
-               ldx     #$00            ; High byte
-               tya                     ; First char from buffer
+               ldx     #$00            ; High byte
+               tya                     ; First char from buffer
                rts
 
+