5244db73b5bc1badd41cc0b70581b90f5eef96a4
[reactos.git] / include / dflat32 / system.h
1 /* --------------- system.h -------------- */
2 #ifndef SYSTEM_H
3 #define SYSTEM_H
4
5 /* #if MSC | WATCOM */
6 #include <direct.h>
7 /* #else */
8 /* #include <dir.h> */
9 /* #endif */
10
11 #define swap(a,b){int x=a;a=b;b=x;}
12 /* ------- platform-dependent values ------ */
13 #define KEYBOARDPORT 0x60
14 #define FREQUENCY 100
15 #define COUNT (1193280L / FREQUENCY)
16 #define ZEROFLAG 0x40
17 #define MAXSAVES 50
18
19 /* #define SCREENWIDTH  (80) */
20 /* #define SCREENHEIGHT (25) */
21
22 HANDLE hInput;
23 HANDLE hOutput;
24
25 SHORT sScreenHeight;
26 SHORT sScreenWidth;
27
28
29 /* ---------- keyboard prototypes -------- */
30 int AltConvert(int);
31 void GetKey(PINPUT_RECORD);
32 int getshift(void);
33 BOOL keyhit(void);
34 void beep(void);
35
36 /* ---------- cursor prototypes -------- */
37 void curr_cursor(int *x, int *y);
38 void cursor(int x, int y);
39 void hidecursor(void);
40 void unhidecursor(void);
41 void savecursor(void);
42 void restorecursor(void);
43 void normalcursor(void);
44 void set_cursor_size(unsigned t);
45 void videomode(void);
46 void SwapCursorStack(void);
47
48 /* ------------ timer macros -------------- */
49 #define timed_out(timer)         (timer==0)
50 #define set_timer(timer, secs)     timer=(secs)*182/10+1
51 #define disable_timer(timer)     timer = -1
52 #define timer_running(timer)     (timer > 0)
53 #define countdown(timer)         --timer
54 #define timer_disabled(timer)     (timer == -1)
55
56
57 #ifndef TURBOC
58 #ifndef BCPP
59 /* ============= Color Macros ============ */
60 #define BLACK         0
61 #define BLUE          1
62 #define GREEN         2
63 #define CYAN          3
64 #define RED           4
65 #define MAGENTA       5
66 #define BROWN         6
67 #define LIGHTGRAY     7
68 #define DARKGRAY      8
69 #define LIGHTBLUE     9
70 #define LIGHTGREEN   10
71 #define LIGHTCYAN    11
72 #define LIGHTRED     12
73 #define LIGHTMAGENTA 13
74 #define YELLOW       14
75 #define WHITE        15
76 #define keyhit       kbhit
77 #endif
78 #endif
79
80 typedef enum messages {
81 #ifdef WATCOM
82         WATCOMFIX1 = -1,
83 #endif
84         #undef DFlatMsg
85         #define DFlatMsg(m) m,
86         #include "dflatmsg.h"
87         MESSAGECOUNT
88 } DFMESSAGE;
89
90 typedef enum window_class    {
91 #ifdef WATCOM
92         WATCOMFIX2 = -1,
93 #endif
94         #define ClassDef(c,b,p,a) c,
95         #include "classes.h"
96         CLASSCOUNT
97 } DFCLASS;
98
99 #endif