Rename c1p target to osic1p
This commit is contained in:
29
libsrc/osic1p/cgetc.s
Normal file
29
libsrc/osic1p/cgetc.s
Normal file
@@ -0,0 +1,29 @@
|
||||
;
|
||||
; char cgetc (void);
|
||||
;
|
||||
.export _cgetc
|
||||
.import cursor
|
||||
|
||||
.include "osic1p.inc"
|
||||
.include "extzp.inc"
|
||||
|
||||
; Input routine from 65V PROM MONITOR, show cursor if enabled
|
||||
_cgetc:
|
||||
lda cursor ; show cursor?
|
||||
beq nocursor
|
||||
ldy CURS_X
|
||||
lda (SCREEN_PTR),y ; fetch current character
|
||||
sta CURS_SAV ; save it
|
||||
lda #$A1 ; full white square
|
||||
sta (SCREEN_PTR),y ; store at cursor position
|
||||
nocursor:
|
||||
jsr INPUTC
|
||||
pha ; save retrieved character
|
||||
lda cursor ; was cursor on?
|
||||
beq nocursor2
|
||||
lda CURS_SAV ; fetch saved character
|
||||
ldy CURS_X
|
||||
sta (SCREEN_PTR),y ; store at cursor position
|
||||
nocursor2:
|
||||
pla ; restore retrieved character
|
||||
rts
|
||||
Reference in New Issue
Block a user