Adding CBM510 support

git-svn-id: svn://svn.cc65.org/cc65/trunk@913 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2001-09-13 21:37:59 +00:00
parent 7f88d979f6
commit 14f2349ea1
8 changed files with 498 additions and 6 deletions

38
libsrc/cbm510/cgetc.s Normal file
View File

@@ -0,0 +1,38 @@
;
; Ullrich von Bassewitz, 06.08.1998
;
; char cgetc (void);
;
.export _cgetc
.import plot, write_crtc
.import cursor
.include "zeropage.inc"
.include "page3.inc"
; ------------------------------------------------------------------------
.proc _cgetc
L1: lda KeyIndex
beq L1
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
inx
cpx KeyIndex
bne L3
dec KeyIndex
cli
ldx #$00 ; High byte
tya ; First char from buffer
rts
.endproc