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);