From 7aa22317027df79a5a492b2e676421e0df09ba16 Mon Sep 17 00:00:00 2001
From: Christian Groessler <chris@groessler.org>
Date: Fri, 31 May 2013 01:38:16 +0200
Subject: [PATCH] adapt to atarixl target

---
 libsrc/atari/cgetc.s | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/libsrc/atari/cgetc.s b/libsrc/atari/cgetc.s
index f8948a5bc..43969c2aa 100644
--- a/libsrc/atari/cgetc.s
+++ b/libsrc/atari/cgetc.s
@@ -7,22 +7,28 @@
 
         .include "atari.inc"
         .export _cgetc,setcursor
+         .import KEYBDV_wrapper
         .import cursor,mul40
 
 _cgetc:
         jsr     setcursor
+        lda     #12
+        sta     ICAX1Z          ; fix problems with direct call to KEYBDV
+.if .not .defined(__ATARIXL__)
         jsr     @1
+.else
+	jsr	KEYBDV_wrapper
+.endif
         ldx     #0
         rts
 
-@1:     lda     KEYBDV+5
+.if .not .defined(__ATARIXL__)
+@1:	lda     KEYBDV+5
         pha
         lda     KEYBDV+4
         pha
-        lda     #12
-        sta     ICAX1Z          ; fix problems with direct call to KEYBDV
-        rts
-
+	rts
+.endif
 
 .proc   setcursor