4 * Ullrich von Bassewitz, 06.08.1998
7 * This is the direct console interface for cc65. I do not like the function
8 * names very much, but the first version started as a rewrite of Borlands
9 * conio, and, even if the interface has changed, the names did not.
11 * The interface does direct screen I/O, so it is fast enough for most
12 * programs. I did not implement text windows, since many applications do
13 * not need them and should not pay for the additional overhead. It should
14 * be easy to add text windows on a higher level if needed,
16 * Most routines do not check the parameters. This may be unfortunate but is
17 * also related to speed. The coordinates are always 0/0 based.
32 /* Read the CBM file if we're compiling for a CBM machine */
53 /*****************************************************************************/
55 /*****************************************************************************/
60 /* Clear the whole screen and put the cursor into the top left corner */
62 unsigned char kbhit (void);
63 /* Return true if there's a key waiting, return false if not */
65 void __fastcall__ gotox (unsigned char x);
66 /* Set the cursor to the specified X position, leave the Y position untouched */
68 void __fastcall__ gotoy (unsigned char y);
69 /* Set the cursor to the specified Y position, leave the X position untouched */
71 void __fastcall__ gotoxy (unsigned char x, unsigned char y);
72 /* Set the cursor to the specified position */
74 unsigned char wherex (void);
75 /* Return the X position of the cursor */
77 unsigned char wherey (void);
78 /* Return the Y position of the cursor */
80 void __fastcall__ cputc (char c);
81 /* Output one character at the current cursor position */
83 void __fastcall__ cputcxy (unsigned char x, unsigned char y, char c);
84 /* Same as "gotoxy (x, y); cputc (c);" */
86 void __fastcall__ cputs (const char* s);
87 /* Output a NUL terminated string at the current cursor position */
89 void __fastcall__ cputsxy (unsigned char x, unsigned char y, const char* s);
90 /* Same as "gotoxy (x, y); puts (s);" */
92 int cprintf (const char* format, ...);
93 /* Like printf, but uses direct screen I/O */
95 int vcprintf (const char* format, va_list ap);
96 /* Like vprintf, but uses direct screen I/O */
99 /* Return a character from the keyboard. If there is no character available,
100 * the functions waits until the user does press a key. If cursor is set to
101 * 1 (see below), a blinking cursor is displayed while waiting.
104 unsigned char __fastcall__ cursor (unsigned char onoff);
105 /* If onoff is 1, a cursor is display when waiting for keyboard input. If
106 * onoff is 0, the cursor is hidden when waiting for keyboard input. The
107 * function returns the old cursor setting.
110 unsigned char __fastcall__ revers (unsigned char onoff);
111 /* Enable/disable reverse character display. This may not be supported by
112 * the output device. Return the old setting.
115 unsigned char __fastcall__ textcolor (unsigned char color);
116 /* Set the color for text output. The old color setting is returned. */
118 unsigned char __fastcall__ bgcolor (unsigned char color);
119 /* Set the color for the background. The old color setting is returned. */
121 unsigned char __fastcall__ bordercolor (unsigned char color);
122 /* Set the color for the border. The old color setting is returned. */
124 void __fastcall__ chline (unsigned char length);
125 /* Output a horizontal line with the given length starting at the current
129 void __fastcall__ chlinexy (unsigned char x, unsigned char y, unsigned char length);
130 /* Same as "gotoxy (x, y); chline (length);" */
132 void __fastcall__ cvline (unsigned char length);
133 /* Output a vertical line with the given length at the current cursor
137 void __fastcall__ cvlinexy (unsigned char x, unsigned char y, unsigned char length);
138 /* Same as "gotoxy (x, y); cvline (length);" */
140 void __fastcall__ cclear (unsigned char length);
141 /* Clear part of a line (write length spaces). */
143 void __fastcall__ cclearxy (unsigned char x, unsigned char y, unsigned char length);
144 /* Same as "gotoxy (x, y); cclear (length);" */
146 void __fastcall__ screensize (unsigned char* x, unsigned char* y);
147 /* Return the current screen size. */
149 void __fastcall__ cputhex8 (unsigned char val);
150 void __fastcall__ cputhex16 (unsigned val);
151 /* These shouldn't be here... */