1
0
mirror of https://github.com/cc65/cc65.git synced 2024-11-07 21:10:15 +00:00
cc65/libsrc/atari/cgetc.s
Christian Groessler a084ea8e42 Atari: split "setcursor" function out of cgetc.s source file into setcursor.s.
This function is used by many other CONIO functions, and the user program not
necessarily uses 'cgetc'. Having "setcursor" in a different object file saves
space in this case and also allows the user program to override it (e.g. when
not using GRAPHICS 0 mode).
2017-10-03 21:58:52 +02:00

32 lines
559 B
ArmAsm

;
; Christian Groessler, November-2002
;
; get a char from the keyboard
; char cgetc(void)
;
.include "atari.inc"
.export _cgetc
.import setcursor
.import KEYBDV_handler
_cgetc:
jsr setcursor
lda #12
sta ICAX1Z ; fix problems with direct call to KEYBDV
.ifdef __ATARIXL__
jsr KEYBDV_handler
.else
jsr @1
.endif
ldx #0
rts
.ifndef __ATARIXL__
@1: lda KEYBDV+5
pha
lda KEYBDV+4
pha
rts
.endif