mirror of
https://github.com/cc65/cc65.git
synced 2024-11-18 00:07:21 +00:00
a084ea8e42
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).
32 lines
559 B
ArmAsm
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
|