]> git.sur5r.net Git - cc65/blobdiff - libsrc/atmos/cgetc.s
fix comments
[cc65] / libsrc / atmos / cgetc.s
index b927af6c69f77f031cab3d98b2896bbe3a87afc7..e6473471906357cccbc7fb57bc49c7e491ebce17 100644 (file)
@@ -5,8 +5,7 @@
 ;
 
        .export         _cgetc
-        .constructor    cursoroff
-        .destructor     cursoron
+        .constructor    initcgetc
        .import         cursor
 
        .include        "atmos.inc"
 
         lda     cursor          ; Cursor currently off?
         beq     @L1             ; Skip if so
-        jsr     cursoron
+        lda     STATUS
+        ora     #%00000001      ; Cursor ON
+        sta     STATUS
 @L1:    lda     KEYBUF
         bpl     @L1
 
 ; If the cursor was enabled, disable it now
 
         ldx     cursor
-        beq     @L3
+        beq     @L2
+        ldx     #$00            ; Zero high byte
         dec     STATUS          ; Clear bit zero
 
 ; We have the character, clear avail flag
 
 @L2:    and     #$7F            ; Mask out avail flag
         sta     KEYBUF
+        ldy     $209
+        cpy     #$A5
+        bne     @L3
+        ora     #$80            ; FUNCT pressed
 
 ; Done
 
-@L3:    ldx     #$00
-        rts
+@L3:    rts
 
 .endproc
 
 ; ------------------------------------------------------------------------
-; Switch the cursor on
-
-cursoron:
-        lda     STATUS
-        ora     #%00000001
-        sta     STATUS
-        rts
+; Switch the cursor off, disable capslock. Code goes into the INIT segment
+; which may be reused after it is run.
 
-; ------------------------------------------------------------------------
-; Switch the cursor off
+.segment        "INIT"
 
-cursoroff:
+initcgetc:
         lda     STATUS
         and     #%11111110
         sta     STATUS
+        lda     #$7F
+        sta     CAPSLOCK
         rts