Added D-Flat/32 library
[reactos.git] / rosapps / 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 /* ---------- keyboard prototypes -------- */
23 int AltConvert(int);
24 void GetKey(PINPUT_RECORD);
25 int getshift(void);
26 BOOL keyhit(void);
27 void beep(void);
28
29 /* ---------- cursor prototypes -------- */
30 void curr_cursor(int *x, int *y);
31 void cursor(int x, int y);
32 void hidecursor(void);
33 void unhidecursor(void);
34 void savecursor(void);
35 void restorecursor(void);
36 void normalcursor(void);
37 void set_cursor_type(unsigned t);
38 void videomode(void);
39 void SwapCursorStack(void);
40
41 /* ------------ timer macros -------------- */
42 #define timed_out(timer) (timer==0)
43 #define set_timer(timer, secs) timer=(secs)*182/10+1
44 #define disable_timer(timer) timer = -1
45 #define timer_running(timer) (timer > 0)
46 #define countdown(timer) --timer
47 #define timer_disabled(timer) (timer == -1)
48
49
50 #ifndef TURBOC
51 #ifndef BCPP
52 /* ============= Color Macros ============ */
53 #define BLACK 0
54 #define BLUE 1
55 #define GREEN 2
56 #define CYAN 3
57 #define RED 4
58 #define MAGENTA 5
59 #define BROWN 6
60 #define LIGHTGRAY 7
61 #define DARKGRAY 8
62 #define LIGHTBLUE 9
63 #define LIGHTGREEN 10
64 #define LIGHTCYAN 11
65 #define LIGHTRED 12
66 #define LIGHTMAGENTA 13
67 #define YELLOW 14
68 #define WHITE 15
69 #define keyhit kbhit
70 #endif
71 #endif
72
73 typedef enum messages {
74 #ifdef WATCOM
75 WATCOMFIX1 = -1,
76 #endif
77 #undef DFlatMsg
78 #define DFlatMsg(m) m,
79 #include "dflatmsg.h"
80 MESSAGECOUNT
81 } DFMESSAGE;
82
83 typedef enum window_class {
84 #ifdef WATCOM
85 WATCOMFIX2 = -1,
86 #endif
87 #define ClassDef(c,b,p,a) c,
88 #include "classes.h"
89 CLASSCOUNT
90 } DFCLASS;
91
92 #endif