aboutsummaryrefslogtreecommitdiff
path: root/conio/cgetc.s
diff options
context:
space:
mode:
Diffstat (limited to 'conio/cgetc.s')
-rw-r--r--conio/cgetc.s31
1 files changed, 31 insertions, 0 deletions
diff --git a/conio/cgetc.s b/conio/cgetc.s
new file mode 100644
index 0000000..d1ae705
--- /dev/null
+++ b/conio/cgetc.s
@@ -0,0 +1,31 @@
+;
+; Christian Groessler, November-2002
+;
+; get a char from the keyboard
+; char cgetc(void)
+;
+
+ .include "atari.inc"
+ .export _cgetc
+ .import KEYBDV_handler
+ .import cursor,mul40
+
+_cgetc:
+ 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
+