-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConsole.h
68 lines (61 loc) · 1.7 KB
/
Console.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/****** Console.h *************************************************************
*
* CADEC -- Copyright (C) 1997 Bill Farmer
*
* Emulation of PDP11 based telecontrol system
* on standard PC hardware.
*
*****************************************************************************/
#include <windows.h>
#include <unistd.h>
#define BLINK 0
#define BLACK 0
#define BROWN FOREGROUND_RED | FOREGROUND_GREEN
#define LIGHTGRAY FOREGROUND_INTENSITY
#define RED FOREGROUND_RED | FOREGROUND_INTENSITY
#define GREEN FOREGROUND_GREEN | FOREGROUND_INTENSITY
#define YELLOW FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY
#define BLUE FOREGROUND_BLUE | FOREGROUND_INTENSITY
#define MAGENTA FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_INTENSITY
#define CYAN FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY
#define WHITE FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | \
FOREGROUND_INTENSITY
// Text modes
enum
{C80,
C50};
// Sizes
enum
{C80_SCREEN_WIDTH = 82,
C80_SCREEN_HEIGHT = 24,
C80_BUFFER_WIDTH = 83,
C80_BUFFER_HEIGHT = 25,
C50_SCREEN_WIDTH = 82,
C50_SCREEN_HEIGHT = 50,
C50_BUFFER_WIDTH = 83,
C50_BUFFER_HEIGHT = 51};
enum
{TIMER = 1000};
// Cursor
enum
{_NOCURSOR,
_SOLIDCURSOR,
_NORMALCURSOR};
// Functions
void textmode(int);
void textcolor(int, int);
void gotoxy(int, int);
void clreol(void);
void clrscr(void);
int cputs(char *);
int cprintf(char *, ...);
int movetext(int, int, int, int, int, int);
int kbhit(void);
void _setcursortype(int);
int putch(int);
int getch(void);
int wherex(void);
int wherey(void);
int screenchar(void);
int getrandom(int);
void randomize(void);