NHDT->ANH, nethack->anethack, nhdat->anhdat
[aNetHack.git] / include / pcconf.h
blobb97f7ed25449cedfc56c4860cdffd8d3a7b90dc6
1 /* aNetHack 0.0.1 pcconf.h $ANH-Date: 1457207019 2016/03/05 19:43:39 $ $ANH-Branch: master $:$ANH-Revision: 1.19 $ */
2 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3 /* aNetHack may be freely redistributed. See license for details. */
5 #ifndef PCCONF_H
6 #define PCCONF_H
8 #define MICRO /* always define this! */
10 #ifdef MSDOS /* some of this material is MS-DOS specific */
13 * Automatic Defines:
15 * __GO32__ is defined automatically by the djgpp port of gcc.
16 * __DJGPP__ is defined automatically by djgpp version 2 and above.
17 * _MSC_VER is defined automatically by Microsoft C.
18 * __BORLANDC__ is defined automatically by Borland C.
19 * __SC__ is defined automatically by Symantec C.
20 * Note: 3.6.x was not verified with Symantec C.
24 * The following options are somewhat configurable depending on
25 * your compiler.
29 * For pre-V7.0 Microsoft Compilers only, manually define OVERLAY here.
32 /*#define OVERLAY */ /* Manual overlay definition (MSC 6.0ax only) */
34 #ifndef __GO32__
35 #define MFLOPPY /* Support for floppy drives and ramdisks by dgk */
36 #endif
38 #define SHELL /* via exec of COMMAND.COM */
40 #ifdef __BORLANDC__
41 #define PCMUSIC /* Music option, enable very basic pc speaker music notes */
42 #endif
45 * Screen control options
47 * You may uncomment:
48 * ANSI_DEFAULT
49 * or TERMLIB
50 * or ANSI_DEFAULT and TERMLIB
51 * or NO_TERMS
54 /* # define TERMLIB */ /* enable use of termcap file /etc/termcap */
55 /* or ./termcap for MSDOS (SAC) */
56 /* compile and link in Fred Fish's termcap library, */
57 /* enclosed in TERMCAP.ARC, to use this */
59 /* # define ANSI_DEFAULT */ /* allows aNetHack to run without a ./termcap */
61 #define NO_TERMS /* Allows Nethack to run without ansi.sys by linking */
62 /* screen routines into the .exe */
64 #ifdef NO_TERMS /* if NO_TERMS select one screen package below */
65 #define SCREEN_BIOS /* Use bios calls for all screen control */
66 /* #define SCREEN_DJGPPFAST */ /* Use djgpp fast screen routines */
67 #endif
69 /* # define PC9800 */ /* Allows aNetHack to run on NEC PC-9800 machines */
70 /* Yamamoto Keizo */
73 * PC video hardware support options (for graphical tile support)
75 * You may uncomment any/all of the options below.
78 #ifndef SUPPRESS_GRAPHICS
79 #if (defined(SCREEN_BIOS) || defined(SCREEN_DJGPPFAST)) && !defined(PC9800)
80 #ifdef USE_TILES
81 #define SCREEN_VGA /* Include VGA graphics routines in the build */
82 #define SCREEN_VESA
83 #endif
84 #endif
85 #else
86 #undef NO_TERMS
87 #undef SCREEN_BIOS
88 #undef SCREEN_DJGPPFAST
89 #undef SCREEN_VGA
90 #undef SCREEN_VESA
91 #undef TERMLIB
92 #define ANSI_DEFAULT
93 #endif
95 #define RANDOM /* have Berkeley random(3) */
97 #define MAIL /* Allows for fake mail daemon to deliver mail */
98 /* in the MSDOS version. (For AMIGA MAIL see */
99 /* amiconf.h). In the future this will be the */
100 /* hook for mail reader implementation. */
102 /* The following is needed for prototypes of certain functions */
104 #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__SC__)
105 #include <process.h> /* Provides prototypes of exit(), spawn() */
106 #endif
108 #if defined(_MSC_VER) && (_MSC_VER >= 7)
109 #include <sys/types.h>
110 #include <stdlib.h>
111 #ifdef strcmpi
112 #undef strcmpi
113 #endif
114 #include <string.h> /* Provides prototypes of strncmpi(), etc. */
115 #include <conio.h>
116 #include <io.h>
117 #include <direct.h>
118 #define SIG_RET_TYPE void(__cdecl *)(int)
119 #define M(c) ((char) (0x80 | (c)))
120 #define vprintf printf
121 #define vfprintf fprintf
122 #define vsprintf sprintf
123 #endif
125 #if defined(__BORLANDC__) && defined(STRNCMPI)
126 #include <string.h> /* Provides prototypes of strncmpi(), etc. */
127 #endif
129 #if defined(__DJGPP__)
130 #define _NAIVE_DOS_REGS
131 #include <stdlib.h>
132 #include <string.h> /* Provides prototypes of strncmpi(), etc. */
133 #ifndef M
134 #define M(c) ((char) (0x80 | (c)))
135 #endif
136 #endif
139 * On the VMS and unix, this option controls whether a delay is done by
140 * the clock, or whether it is done by excess output. On the PC, however,
141 * there is always a clock to use for the delay. The TIMED_DELAY option
142 * on MSDOS (without the termcap routines) is used to determine whether to
143 * include the delay routines in the code (and thus, provides a compile time
144 * method to turn off napping for visual effect). However, it is also used
145 * in the music code to wait between different notes. So it is needed in that
146 * case as well.
148 * Whereas on the VMS and unix, flags.nap is a run-time option controlling
149 * whether there is a delay by clock or by excess output, on MSDOS it is
150 * simply a flag to turn on or off napping for visual effects at run-time.
153 #define TIMED_DELAY /* enable the `timed_delay' run-time option */
155 #ifdef PCMUSIC
156 #define TIMED_DELAY /* need it anyway */
157 #endif
158 #define NOCWD_ASSUMPTIONS /* Allow paths to be specified for HACKDIR, \
159 LEVELDIR, SAVEDIR, BONESDIR, DATADIR, \
160 SCOREDIR, LOCKDIR, CONFIGDIR, and TROUBLEDIR. \
163 #endif /* MSDOS configuration stuff */
165 #define PATHLEN 64 /* maximum pathlength */
166 #define FILENAME 80 /* maximum filename length (conservative) */
167 #ifndef MICRO_H
168 #include "micro.h" /* contains necessary externs for [os_name].c */
169 #endif
171 /* ===================================================
172 * The remaining code shouldn't need modification.
175 #ifndef SYSTEM_H
176 #if !defined(_MSC_VER)
177 #include "system.h"
178 #endif
179 #endif
181 #ifdef __DJGPP__
182 #include <unistd.h> /* close(), etc. */
183 /* lock() in io.h interferes with lock[] in decl.h */
184 #define lock djlock
185 #include <io.h>
186 #undef lock
187 #include <pc.h> /* kbhit() */
188 #define PC_LOCKING
189 #define HOLD_LOCKFILE_OPEN
190 #define SELF_RECOVER /* aNetHack itself can recover games */
191 #endif
193 #ifdef MSDOS
194 #ifndef EXEPATH
195 #define EXEPATH /* HACKDIR is .exe location if not explicitly defined */
196 #endif
197 #endif
199 #if defined(_MSC_VER) && defined(MSDOS)
200 #if (_MSC_VER >= 700) && !defined(FUNCTION_LEVEL_LINKING)
201 #ifndef MOVERLAY
202 #define MOVERLAY /* Microsoft's MOVE overlay system (MSC >= 7.0) */
203 #endif
204 #endif
205 #define PC_LOCKING
206 #endif
208 /* Borland Stuff */
209 #if defined(__BORLANDC__)
210 #if defined(__OVERLAY__) && !defined(VROOMM)
211 /* __OVERLAY__ is automatically defined by Borland C if overlay option is on
213 #define VROOMM /* Borland's VROOMM overlay system */
214 #endif
215 #if !defined(STKSIZ)
216 #define STKSIZ 5 * 1024 /* Use a default of 5K stack for Borland C */
217 /* This macro is used in any file that contains */
218 /* a main() function. */
219 #endif
220 #define PC_LOCKING
221 #endif
223 #ifdef PC_LOCKING
224 #define HLOCK "NHPERM"
225 #endif
227 #ifndef index
228 #define index strchr
229 #endif
230 #ifndef rindex
231 #define rindex strrchr
232 #endif
234 #ifndef AMIGA
235 #include <time.h>
236 #endif
238 #ifdef RANDOM
239 /* Use the high quality random number routines. */
240 #define Rand() random()
241 #else
242 #define Rand() rand()
243 #endif
245 #ifndef TOS
246 #define FCMASK 0660 /* file creation mask */
247 #endif
249 #include <fcntl.h>
251 #ifdef MSDOS
252 #define TEXTCOLOR /* */
253 #define PORT_HELP "msdoshlp.txt" /* msdos port specific help file */
254 #endif
256 /* Sanity check, do not modify these blocks. */
258 /* OVERLAY must be defined with MOVERLAY or VROOMM */
259 #if (defined(MOVERLAY) || defined(VROOMM))
260 #ifndef OVERLAY
261 #define OVERLAY
262 #endif
263 #endif
265 #if defined(FUNCTION_LEVEL_LINKING)
266 #define OVERLAY
267 #endif
269 #if defined(OVERLAY) && !defined(MOVERLAY) && !defined(VROOMM) \
270 && !defined(FUNCTION_LEVEL_LINKING)
271 #define USE_TRAMPOLI
272 #endif
274 #if defined(MSDOS) && defined(NO_TERMS)
275 #ifdef TERMLIB
276 #if defined(_MSC_VER) || defined(__SC__)
277 #pragma message("Warning -- TERMLIB defined with NO_TERMS in pcconf.h")
278 #pragma message(" Forcing undef of TERMLIB")
279 #endif
280 #undef TERMLIB
281 #endif
282 #ifdef ANSI_DEFAULT
283 #if defined(_MSC_VER) || defined(__SC__)
284 #pragma message("Warning -- ANSI_DEFAULT defined with NO_TERMS in pcconf.h")
285 #pragma message(" Forcing undef of ANSI_DEFAULT")
286 #endif
287 #undef ANSI_DEFAULT
288 #endif
289 /* only one screen package is allowed */
290 #if defined(SCREEN_BIOS) && defined(SCREEN_DJGPPFAST)
291 #if defined(_MSC_VER) || defined(__SC__)
292 #pragma message("Warning -- More than one screen package defined in pcconf.h")
293 #endif
294 #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__SC__)
295 #if defined(SCREEN_DJGPPFAST)
296 #if defined(_MSC_VER) || defined(__SC__)
297 #pragma message(" Forcing undef of SCREEN_DJGPPFAST")
298 #endif
299 #undef SCREEN_DJGPPFAST /* Can't use djgpp fast with other compilers anyway \
301 #endif
302 #else
303 /* djgpp C compiler */
304 #if defined(SCREEN_BIOS)
305 #undef SCREEN_BIOS
306 #endif
307 #endif
308 #endif
309 #define ASCIIGRAPH
310 #ifdef TEXTCOLOR
311 #define VIDEOSHADES
312 #endif
313 /* SCREEN_8514, SCREEN_VESA are only placeholders presently - sub VGA instead
315 #if defined(SCREEN_8514)
316 #undef SCREEN_8514
317 #define SCREEN_VGA
318 #endif
319 /* Graphical tile sanity checks */
320 #ifdef SCREEN_VGA
321 #define SIMULATE_CURSOR
322 #define POSITIONBAR
323 /* Select appropriate tile file format, and map size */
324 #define PLANAR_FILE
325 #define SMALL_MAP
326 #endif
327 #endif /* End of sanity check block */
329 #if defined(MSDOS) && defined(DLB)
330 #define FILENAME_CMP stricmp /* case insensitive */
331 #endif
333 #if defined(_MSC_VER) && (_MSC_VER >= 7)
334 #pragma warning(disable : 4131)
335 #pragma warning(disable : 4135)
336 #pragma warning(disable : 4309)
337 #pragma warning(disable : 4746)
338 #pragma warning(disable : 4761)
339 #endif
341 #ifdef TIMED_DELAY
342 #ifdef __DJGPP__
343 #define msleep(k) (void) usleep((k) *1000)
344 #endif
345 #ifdef __BORLANDC__
346 #define msleep(k) delay(k)
347 #endif
348 #ifdef __SC__
349 #define msleep(k) (void) usleep((long)((k) *1000))
350 #endif
351 #endif
353 #endif /* PCCONF_H */