1 /*	SCCS Id: @(#)pcconf.h	3.4	1995/10/11	*/
2 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3 /* NetHack may be freely redistributed.  See license for details. */
4 
5 #ifndef PCCONF_H
6 #define PCCONF_H
7 
8 #define MICRO		/* always define this! */
9 
10 #ifdef MSDOS		/* some of this material is MS-DOS specific */
11 
12 /*
13  *  Automatic Defines:
14  *
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.4.1 was not verified with Symantec C.
21  */
22 
23 /*
24  *  The following options are somewhat configurable depending on
25  *  your compiler.
26  */
27 
28 /*
29  *  For pre-V7.0 Microsoft Compilers only, manually define OVERLAY here.
30  */
31 
32 /*#define OVERLAY */	/* Manual overlay definition (MSC 6.0ax only) */
33 
34 # ifndef __GO32__
35 #define MFLOPPY		/* Support for floppy drives and ramdisks by dgk */
36 # endif
37 
38 # define SHELL		/* via exec of COMMAND.COM */
39 
40 # ifdef __BORLANDC__
41 #define PCMUSIC		/* Music option, enable very basic pc speaker music notes */
42 # endif
43 
44 /*
45  * Screen control options
46  *
47  * You may uncomment:
48  *		       ANSI_DEFAULT
49  *		  or   TERMLIB
50  *		  or   ANSI_DEFAULT and TERMLIB
51  *		  or   NO_TERMS
52  */
53 
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 */
58 
59 /* # define ANSI_DEFAULT */   /* allows NetHack to run without a ./termcap */
60 
61 # define NO_TERMS	/* Allows Nethack to run without ansi.sys by linking */
62 			/* screen routines into the .exe     */
63 
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
68 
69 
70 /* # define PC9800 */	/* Allows NetHack to run on NEC PC-9800 machines */
71 			/* Yamamoto Keizo */
72 
73 
74 /*
75  * PC video hardware support options (for graphical tile support)
76  *
77  * You may uncomment any/all of the options below.
78  *
79  */
80 # ifndef SUPPRESS_GRAPHICS
81 #  if (defined(SCREEN_BIOS) || defined(SCREEN_DJGPPFAST)) && !defined(PC9800)
82 #   ifdef USE_TILES
83 #define SCREEN_VGA	/* Include VGA	  graphics routines in the build */
84 #   endif
85 #  endif
86 # else
87 # undef NO_TERMS
88 # undef SCREEN_BIOS
89 # undef SCREEN_DJGPPFAST
90 # undef SCREEN_VGA
91 # undef TERMLIB
92 # define ANSI_DEFAULT
93 # endif
94 
95 # define RANDOM		/* have Berkeley random(3) */
96 
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.        */
101 
102 /* The following is needed for prototypes of certain functions */
103 
104 #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__SC__)
105 #include <process.h>	/* Provides prototypes of exit(), spawn()      */
106 #endif
107 
108 #if defined(__BORLANDC__) && defined(STRNCMPI)
109 #include <string.h>	/* Provides prototypes of strncmpi(), etc.     */
110 #endif
111 
112 #if defined(__DJGPP__)
113 #define _NAIVE_DOS_REGS
114 #include <stdlib.h>
115 #include <string.h>	/* Provides prototypes of strncmpi(), etc.     */
116 # ifndef M
117 #define M(c)		((char) (0x80 | (c)))
118 # endif
119 #endif
120 
121 /*
122  * On the VMS and unix, this option controls whether a delay is done by
123  * the clock, or whether it is done by excess output.  On the PC, however,
124  * there is always a clock to use for the delay.  The TIMED_DELAY option
125  * on MSDOS (without the termcap routines) is used to determine whether to
126  * include the delay routines in the code (and thus, provides a compile time
127  * method to turn off napping for visual effect).  However, it is also used
128  * in the music code to wait between different notes.  So it is needed in that
129  * case as well.
130 
131  * Whereas on the VMS and unix, flags.nap is a run-time option controlling
132  * whether there is a delay by clock or by excess output, on MSDOS it is
133  * simply a flag to turn on or off napping for visual effects at run-time.
134  */
135 
136 #ifndef AUTOCONF
137 #define TIMED_DELAY	/* enable the `timed_delay' run-time option */
138 #endif
139 
140 # ifdef PCMUSIC
141 #define TIMED_DELAY	/* need it anyway */
142 # endif
143 #define NOCWD_ASSUMPTIONS	/* Allow paths to be specified for HACKDIR,
144 				   LEVELDIR, SAVEDIR, BONESDIR, DATADIR,
145 				   SCOREDIR, LOCKDIR, CONFIGDIR, and TROUBLEDIR. */
146 
147 #endif /* MSDOS configuration stuff */
148 
149 #define PATHLEN		64	/* maximum pathlength */
150 #define FILENAME	80	/* maximum filename length (conservative) */
151 #ifndef MICRO_H
152 #include "micro.h"		/* contains necessary externs for [os_name].c */
153 #endif
154 
155 
156 /* ===================================================
157  *  The remaining code shouldn't need modification.
158  */
159 
160 #ifndef SYSTEM_H
161 #include "system.h"
162 #endif
163 
164 #ifdef __DJGPP__
165 #include <unistd.h> /* close(), etc. */
166 /* lock() in io.h interferes with lock[] in decl.h */
167 #define lock djlock
168 #include <io.h>
169 #undef lock
170 #include <pc.h> /* kbhit() */
171 #define PC_LOCKING
172 #define HOLD_LOCKFILE_OPEN
173 #define SELF_RECOVER		/* NetHack itself can recover games */
174 #endif
175 
176 # ifdef MSDOS
177 #  ifndef EXEPATH
178 #define EXEPATH		/* HACKDIR is .exe location if not explicitly defined */
179 #  endif
180 # endif
181 
182 # if defined(_MSC_VER) && defined(MSDOS)
183 #  if (_MSC_VER >= 700) && !defined(FUNCTION_LEVEL_LINKING)
184 #   ifndef MOVERLAY
185 #define MOVERLAY	/* Microsoft's MOVE overlay system (MSC >= 7.0) */
186 #   endif
187 #  endif
188 #define PC_LOCKING
189 # endif
190 
191 /* Borland Stuff */
192 # if defined(__BORLANDC__)
193 #  if defined(__OVERLAY__) && !defined(VROOMM)
194 /* __OVERLAY__ is automatically defined by Borland C if overlay option is on */
195 #define VROOMM		/* Borland's VROOMM overlay system */
196 #  endif
197 #  if !defined(STKSIZ)
198 #define STKSIZ	5*1024	/* Use a default of 5K stack for Borland C	*/
199 			/* This macro is used in any file that contains */
200 			/* a main() function.				*/
201 #  endif
202 #define PC_LOCKING
203 # endif
204 
205 #ifdef PC_LOCKING
206 #define HLOCK "NHPERM"
207 #endif
208 
209 #ifndef index
210 # define index	strchr
211 #endif
212 #ifndef rindex
213 # define rindex strrchr
214 #endif
215 
216 #ifndef AMIGA
217 #include <time.h>
218 #endif
219 
220 #ifdef RANDOM
221 /* Use the high quality random number routines. */
222 # define Rand() random()
223 #else
224 # define Rand() rand()
225 #endif
226 
227 #ifndef TOS
228 # define FCMASK 0660	/* file creation mask */
229 #endif
230 
231 #include <fcntl.h>
232 
233 #ifndef REDO
234 # undef Getchar
235 # define Getchar nhgetch
236 #endif
237 
238 #ifdef MSDOS
239 # define TEXTCOLOR /* */
240 # define PORT_HELP "msdoshlp.txt" /* msdos port specific help file */
241 #endif
242 
243 
244 /* Sanity check, do not modify these blocks. */
245 
246 /* OVERLAY must be defined with MOVERLAY or VROOMM */
247 #if (defined(MOVERLAY) || defined(VROOMM))
248 # ifndef OVERLAY
249 #  define OVERLAY
250 # endif
251 #endif
252 
253 #if defined(FUNCTION_LEVEL_LINKING)
254 #define OVERLAY
255 #define OVL0
256 #define OVL1
257 #define OVL2
258 #define OVL3
259 #define OVLB
260 #endif
261 
262 #if defined(OVERLAY) && !defined(MOVERLAY) && !defined(VROOMM) && !defined(FUNCTION_LEVEL_LINKING)
263 #define USE_TRAMPOLI
264 #endif
265 
266 #if defined(MSDOS) && defined(NO_TERMS)
267 # ifdef TERMLIB
268 #  if defined(_MSC_VER) || defined(__SC__)
269 #   pragma message("Warning -- TERMLIB defined with NO_TERMS in pcconf.h")
270 #   pragma message("           Forcing undef of TERMLIB")
271 #  endif
272 #undef TERMLIB
273 # endif
274 # ifdef ANSI_DEFAULT
275 #  if defined(_MSC_VER) || defined(__SC__)
276 #   pragma message("Warning -- ANSI_DEFAULT defined with NO_TERMS in pcconf.h")
277 #   pragma message("           Forcing undef of ANSI_DEFAULT")
278 #  endif
279 #undef ANSI_DEFAULT
280 # endif
281 /* only one screen package is allowed */
282 # if defined(SCREEN_BIOS) && defined(SCREEN_DJGPPFAST)
283 #  if defined(_MSC_VER) || defined(__SC__)
284 #   pragma message("Warning -- More than one screen package defined in pcconf.h")
285 #  endif
286 #  if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__SC__)
287 #   if defined(SCREEN_DJGPPFAST)
288 #    if defined(_MSC_VER) || defined(__SC__)
289 #    pragma message("           Forcing undef of SCREEN_DJGPPFAST")
290 #    endif
291 #undef SCREEN_DJGPPFAST   /* Can't use djgpp fast with other compilers anyway */
292 #   endif
293 #  else
294 /* djgpp C compiler	*/
295 #   if defined(SCREEN_BIOS)
296 #undef SCREEN_BIOS
297 #   endif
298 #  endif
299 # endif
300 # define ASCIIGRAPH
301 # ifdef TEXTCOLOR
302 #  define VIDEOSHADES
303 # endif
304 /* SCREEN_8514, SCREEN_VESA are only placeholders presently - sub VGA instead */
305 # if defined(SCREEN_8514) || defined(SCREEN_VESA)
306 #  undef SCREEN_8514
307 #  undef SCREEN_VESA
308 #  define SCREEN_VGA
309 # endif
310 /* Graphical tile sanity checks */
311 # ifdef SCREEN_VGA
312 #  define SIMULATE_CURSOR
313 #  define POSITIONBAR
314 /* Select appropriate tile file format, and map size */
315 #  define PLANAR_FILE
316 #  define SMALL_MAP
317 # endif
318 #endif			/* End of sanity check block */
319 
320 #if defined(MSDOS) && defined(DLB)
321 #define FILENAME_CMP  stricmp		      /* case insensitive */
322 #endif
323 
324 #ifdef MSC7_WARN	/* define with cl /DMSC7_WARN	*/
325 #pragma warning(disable:4131)
326 #endif
327 
328 #ifdef TIMED_DELAY
329 # ifdef __DJGPP__
330 # define msleep(k) (void) usleep((k)*1000)
331 # endif
332 # ifdef __BORLANDC__
333 # define msleep(k) delay(k)
334 # endif
335 # ifdef __SC__
336 # define msleep(k) (void) usleep((long)((k)*1000))
337 # endif
338 #endif
339 
340 #endif /* PCCONF_H */
341