1
0
mirror of https://github.com/cc65/cc65.git synced 2024-07-26 23:29:27 +00:00
cc65/libsrc/osic1p/cgetc.s

31 lines
997 B
ArmAsm
Raw Normal View History

2014-11-08 23:58:32 +00:00
;
; char cgetc (void);
;
.export _cgetc
2014-11-29 19:07:30 +00:00
.import cursor
2015-02-03 21:42:35 +00:00
.include "osic1p.inc"
2014-11-29 19:07:30 +00:00
.include "extzp.inc"
.include "zeropage.inc"
2014-11-08 23:58:32 +00:00
2014-11-29 19:07:30 +00:00
; 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 tmp1 ; save it
2014-11-29 19:07:30 +00:00
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 tmp1 ; fetch saved character
2014-11-29 19:07:30 +00:00
ldy CURS_X
sta (SCREEN_PTR),y ; store at cursor position
nocursor2:
pla ; restore retrieved character
rts