]> git.sur5r.net Git - cc65/blob - include/conio.h
This commit was generated by cvs2svn to compensate for changes in r2,
[cc65] / include / conio.h
1 /*
2  * conio.h
3  *
4  * Ullrich von Bassewitz, 06.08.1998
5  *
6  *
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.
10  *
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,
15  *
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.
18  *
19  */
20
21
22
23 #ifndef _CONIO_H
24 #define _CONIO_H
25
26
27
28 #ifndef _STDARG_H
29 #  include <stdarg.h>
30 #endif
31
32 /* Read the CBM file if we're compiling for a CBM machine */
33 #ifdef __CBM__
34 #  ifndef _CBM_H
35 #    include <cbm.h>
36 #  endif
37 #endif
38
39 #ifdef __APPLE2__
40 #  ifndef _APPLE2_H
41 #    include <apple2.h>
42 #  endif
43 #endif
44
45 #ifdef __ATARI__
46 #  ifndef _ATARI_H
47 #    include <atari.h>
48 #  endif
49 #endif
50
51
52
53 /*****************************************************************************/
54 /*                                 Functions                                 */
55 /*****************************************************************************/
56
57
58
59 void clrscr (void);
60 /* Clear the whole screen and put the cursor into the top left corner */
61
62 unsigned char kbhit (void);
63 /* Return true if there's a key waiting, return false if not */
64
65 void __fastcall__ gotox (unsigned char x);
66 /* Set the cursor to the specified X position, leave the Y position untouched */
67
68 void __fastcall__ gotoy (unsigned char y);
69 /* Set the cursor to the specified Y position, leave the X position untouched */
70
71 void __fastcall__ gotoxy (unsigned char x, unsigned char y);
72 /* Set the cursor to the specified position */
73
74 unsigned char wherex (void);
75 /* Return the X position of the cursor */
76
77 unsigned char wherey (void);
78 /* Return the Y position of the cursor */
79
80 void __fastcall__ cputc (char c);
81 /* Output one character at the current cursor position */
82
83 void __fastcall__ cputcxy (unsigned char x, unsigned char y, char c);
84 /* Same as "gotoxy (x, y); cputc (c);" */
85
86 void __fastcall__ cputs (const char* s);
87 /* Output a NUL terminated string at the current cursor position */
88
89 void __fastcall__ cputsxy (unsigned char x, unsigned char y, const char* s);
90 /* Same as "gotoxy (x, y); puts (s);" */
91
92 int cprintf (const char* format, ...);
93 /* Like printf, but uses direct screen I/O */
94
95 int vcprintf (const char* format, va_list ap);
96 /* Like vprintf, but uses direct screen I/O */
97
98 char cgetc (void);
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.
102  */
103
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.
108  */
109
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.
113  */
114
115 unsigned char __fastcall__ textcolor (unsigned char color);
116 /* Set the color for text output. The old color setting is returned. */
117
118 unsigned char __fastcall__ bgcolor (unsigned char color);
119 /* Set the color for the background. The old color setting is returned. */
120
121 unsigned char __fastcall__ bordercolor (unsigned char color);
122 /* Set the color for the border. The old color setting is returned. */
123
124 void __fastcall__ chline (unsigned char length);
125 /* Output a horizontal line with the given length starting at the current
126  * cursor position.
127  */
128
129 void __fastcall__ chlinexy (unsigned char x, unsigned char y, unsigned char length);
130 /* Same as "gotoxy (x, y); chline (length);" */
131
132 void __fastcall__ cvline (unsigned char length);
133 /* Output a vertical line with the given length at the current cursor
134  * position.
135  */
136
137 void __fastcall__ cvlinexy (unsigned char x, unsigned char y, unsigned char length);
138 /* Same as "gotoxy (x, y); cvline (length);" */
139
140 void __fastcall__ cclear (unsigned char length);
141 /* Clear part of a line (write length spaces). */
142
143 void __fastcall__ cclearxy (unsigned char x, unsigned char y, unsigned char length);
144 /* Same as "gotoxy (x, y); cclear (length);" */
145
146 void __fastcall__ screensize (unsigned char* x, unsigned char* y);
147 /* Return the current screen size. */
148
149 void __fastcall__ cputhex8 (unsigned char val);
150 void __fastcall__ cputhex16 (unsigned val);
151 /* These shouldn't be here... */
152
153
154 /* End of conio.h */
155 #endif
156
157
158