From 14ab294a473a2f8d28872886a03cd8691b9a77c9 Mon Sep 17 00:00:00 2001 From: drmortalwombat <90205530+drmortalwombat@users.noreply.github.com> Date: Sun, 2 Apr 2023 13:51:53 +0200 Subject: [PATCH] Add getchx() call to conio --- include/conio.c | 11 +++++++++++ include/conio.h | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/include/conio.c b/include/conio.c index ea6a5b7..74226d0 100644 --- a/include/conio.c +++ b/include/conio.c @@ -220,6 +220,17 @@ int getch(void) } } +int getchx(void) +{ + __asm + { + jsr getpch + sta accu + lda #0 + sta accu + 1 + } +} + void putch(int c) { __asm { diff --git a/include/conio.h b/include/conio.h index 370e5d8..28a72b4 100644 --- a/include/conio.h +++ b/include/conio.h @@ -25,6 +25,10 @@ int getche(void); int getch(void); +// like getch but does not wait, returns zero if no +// key is pressed +int getchx(void); + void putch(int c); void clrscr(void);