X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=include%2Fconio.h;h=300a3be6fd0be8402806b12661de86eaa84dba22;hb=209954a4a295c7d53e89981c421e6789f124a391;hp=89de4cda802357b7c88860a6585d1fc4682df0a5;hpb=f0b8ea1e14bf92005f894db02e04da987389bee4;p=cc65 diff --git a/include/conio.h b/include/conio.h index 89de4cda8..300a3be6f 100644 --- a/include/conio.h +++ b/include/conio.h @@ -1,12 +1,12 @@ /*****************************************************************************/ /* */ -/* conio.h */ +/* conio.h */ /* */ -/* Direct console I/O */ +/* Direct console I/O */ /* */ /* */ /* */ -/* (C) 1998-2004 Ullrich von Bassewitz */ +/* (C) 1998-2005 Ullrich von Bassewitz */ /* Römerstraße 52 */ /* D-70794 Filderstadt */ /* EMail: uz@cc65.org */ @@ -35,7 +35,7 @@ /* * This is the direct console interface for cc65. I do not like the function - * names very much, but the first version started as a rewrite of Borlands + * names very much, but the first version started as a rewrite of Borland's * conio, and, even if the interface has changed, the names did not. * * The interface does direct screen I/O, so it is fast enough for most @@ -58,7 +58,7 @@ # include #endif -/* Include the correct machine specific file */ +/* Include the correct machine-specific file */ #if defined(__APPLE2__) # include #elif defined(__APPLE2ENH__) @@ -69,6 +69,12 @@ # include #elif defined(__CBM__) # include +#elif defined(__GEOS__) +# include +#elif defined(__LUNIX__) +# include +#elif defined(__LYNX__) +# include #elif defined(__NES__) # include #else @@ -78,7 +84,7 @@ /*****************************************************************************/ -/* Functions */ +/* Functions */ /*****************************************************************************/ @@ -111,25 +117,31 @@ void __fastcall__ cputcxy (unsigned char x, unsigned char y, char c); /* Same as "gotoxy (x, y); cputc (c);" */ void __fastcall__ cputs (const char* s); -/* Output a NUL terminated string at the current cursor position */ +/* Output a NUL-terminated string at the current cursor position */ void __fastcall__ cputsxy (unsigned char x, unsigned char y, const char* s); /* Same as "gotoxy (x, y); puts (s);" */ int cprintf (const char* format, ...); -/* Like printf, but uses direct screen I/O */ +/* Like printf(), but uses direct screen output */ int __fastcall__ vcprintf (const char* format, va_list ap); -/* Like vprintf, but uses direct screen I/O */ +/* Like vprintf(), but uses direct screen output */ char cgetc (void); /* Return a character from the keyboard. If there is no character available, - * the functions waits until the user does press a key. If cursor is set to + * the function waits until the user does press a key. If cursor is set to * 1 (see below), a blinking cursor is displayed while waiting. */ +int cscanf (const char* format, ...); +/* Like scanf(), but uses direct keyboard input */ + +int __fastcall__ vcscanf (const char* format, va_list ap); +/* Like vscanf(), but uses direct keyboard input */ + unsigned char __fastcall__ cursor (unsigned char onoff); -/* If onoff is 1, a cursor is display when waiting for keyboard input. If +/* If onoff is 1, a cursor is displayed when waiting for keyboard input. If * onoff is 0, the cursor is hidden when waiting for keyboard input. The * function returns the old cursor setting. */ @@ -179,6 +191,34 @@ void __fastcall__ cputhex16 (unsigned val); +/*****************************************************************************/ +/* Macros */ +/*****************************************************************************/ + + + +/* On some platforms, functions are not available or are dummys. To suppress + * the call to these functions completely, the platform header files may + * define macros for these functions that start with an underline. If such a + * macro exists, a new macro is defined here, that expands to the one with the + * underline. The reason for this two stepped approach is that it is sometimes + * necessary to take the address of the function, which is not possible when + * using a macro. Since the function prototype is still present, #undefining + * the macro will give access to the actual function. + */ + +#if defined(_textcolor) +# define textcolor(x) _textcolor(x) +#endif +#if defined(_bgcolor) +# define bgcolor(x) _bgcolor(x) +#endif +#if defined(_bordercolor) +# define bordercolor(x) _bordercolor(x) +#endif + + + /* End of conio.h */ #endif