1 /*	SCCS Id: @(#)pcconf.h	3.3	95/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.3.0 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 /*# define PC_LOCKING	/* Allow confirmation before overwriting game  */
103 			/* that is in progress or aborted when another */
104 			/* game is started with the same player name.  */
105 
106 /* The following is needed for prototypes of certain functions */
107 
108 #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__SC__)
109 #include <process.h>	/* Provides prototypes of exit(), spawn()      */
110 #endif
111 
112 #if defined(__BORLANDC__) && defined(STRNCMPI)
113 #include <string.h>	/* Provides prototypes of strncmpi(), etc.     */
114 #endif
115 
116 #if defined(__DJGPP__)
117 #define _NAIVE_DOS_REGS
118 #include <stdlib.h>
119 #include <string.h>	/* Provides prototypes of strncmpi(), etc.     */
120 #endif
121 
122 /*
123  * On the VMS and unix, this option controls whether a delay is done by
124  * the clock, or whether it is done by excess output.  On the PC, however,
125  * there is always a clock to use for the delay.  The TIMED_DELAY option
126  * on MSDOS (without the termcap routines) is used to determine whether to
127  * include the delay routines in the code (and thus, provides a compile time
128  * method to turn off napping for visual effect).  However, it is also used
129  * in the music code to wait between different notes.  So it is needed in that
130  * case as well.
131 
132  * Whereas on the VMS and unix, flags.nap is a run-time option controlling
133  * whether there is a delay by clock or by excess output, on MSDOS it is
134  * simply a flag to turn on or off napping for visual effects at run-time.
135  */
136 
137 #define TIMED_DELAY	/* enable the `timed_delay' run-time option */
138 
139 # ifdef PCMUSIC
140 #define TIMED_DELAY	/* need it anyway */
141 # endif
142 #endif /* MSDOS configuration stuff */
143 
144 #define PATHLEN		64	/* maximum pathlength */
145 #define FILENAME	80	/* maximum filename length (conservative) */
146 #ifndef MICRO_H
147 #include "micro.h"		/* contains necessary externs for [os_name].c */
148 #endif
149 
150 /* ===================================================
151  *  The remaining code shouldn't need modification.
152  */
153 
154 #ifndef SYSTEM_H
155 #include "system.h"
156 #endif
157 
158 #ifdef __GO32__
159 #include <unistd.h> /* close(), etc. */
160 /* setmode is in io.h but lock() in io.h interferes with lock[] in decl.h */
161 extern int FDECL(setmode, (int,int));
162 #include <pc.h> /* kbhit() */
163 #define PC_LOCKING
164 #endif
165 
166 # ifdef MSDOS
167 #  ifndef EXEPATH
168 #define EXEPATH		/* HACKDIR is .exe location if not explicitly defined */
169 #  endif
170 # endif
171 
172 # if defined(_MSC_VER) && defined(MSDOS)
173 #  if (_MSC_VER >= 700) && !defined(FUNCTION_LEVEL_LINKING)
174 #   ifndef MOVERLAY
175 #define MOVERLAY	/* Microsoft's MOVE overlay system (MSC >= 7.0) */
176 #   endif
177 #  endif
178 #define PC_LOCKING
179 # endif
180 
181 /* Borland Stuff */
182 # if defined(__BORLANDC__)
183 #  if defined(__OVERLAY__) && !defined(VROOMM)
184 /* __OVERLAY__ is automatically defined by Borland C if overlay option is on */
185 #define VROOMM		/* Borland's VROOMM overlay system */
186 #  endif
187 #  if !defined(STKSIZ)
188 #define STKSIZ	5*1024	/* Use a default of 5K stack for Borland C	*/
189 			/* This macro is used in any file that contains */
190 			/* a main() function.				*/
191 #  endif
192 #define PC_LOCKING
193 # endif
194 
195 #ifdef PC_LOCKING
196 #define HLOCK "NHPERM"
197 #endif
198 
199 #ifndef index
200 # define index	strchr
201 #endif
202 #ifndef rindex
203 # define rindex strrchr
204 #endif
205 
206 #ifndef AMIGA
207 #include <time.h>
208 #endif
209 
210 #ifdef RANDOM
211 /* Use the high quality random number routines. */
212 # define Rand() random()
213 #else
214 # define Rand() rand()
215 #endif
216 
217 #ifndef TOS
218 # define FCMASK 0660	/* file creation mask */
219 #endif
220 
221 #include <fcntl.h>
222 
223 #ifndef REDO
224 # undef Getchar
225 # define Getchar nhgetch
226 #endif
227 
228 #ifdef MSDOS
229 # define TEXTCOLOR /* */
230 # define PORT_HELP "msdoshlp.txt" /* msdos port specific help file */
231 #endif
232 
233 
234 /* Sanity check, do not modify these blocks. */
235 
236 /* OVERLAY must be defined with MOVERLAY or VROOMM */
237 #if (defined(MOVERLAY) || defined(VROOMM))
238 # ifndef OVERLAY
239 #  define OVERLAY
240 # endif
241 #endif
242 
243 #if defined(FUNCTION_LEVEL_LINKING)
244 #define OVERLAY
245 #define OVL0
246 #define OVL1
247 #define OVL2
248 #define OVL3
249 #define OVLB
250 #endif
251 
252 #if defined(OVERLAY) && !defined(MOVERLAY) && !defined(VROOMM) && !defined(FUNCTION_LEVEL_LINKING)
253 #define USE_TRAMPOLI
254 #endif
255 
256 #if defined(MSDOS) && defined(NO_TERMS)
257 # ifdef TERMLIB
258 #  if defined(_MSC_VER) || defined(__SC__)
259 #   pragma message("Warning -- TERMLIB defined with NO_TERMS in pcconf.h")
260 #   pragma message("           Forcing undef of TERMLIB")
261 #  endif
262 #undef TERMLIB
263 # endif
264 # ifdef ANSI_DEFAULT
265 #  if defined(_MSC_VER) || defined(__SC__)
266 #   pragma message("Warning -- ANSI_DEFAULT defined with NO_TERMS in pcconf.h")
267 #   pragma message("           Forcing undef of ANSI_DEFAULT")
268 #  endif
269 #undef ANSI_DEFAULT
270 # endif
271 /* only one screen package is allowed */
272 # if defined(SCREEN_BIOS) && defined(SCREEN_DJGPPFAST)
273 #  if defined(_MSC_VER) || defined(__SC__)
274 #   pragma message("Warning -- More than one screen package defined in pcconf.h")
275 #  endif
276 #  if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__SC__)
277 #   if defined(SCREEN_DJGPPFAST)
278 #    if defined(_MSC_VER) || defined(__SC__)
279 #    pragma message("           Forcing undef of SCREEN_DJGPPFAST")
280 #    endif
281 #undef SCREEN_DJGPPFAST   /* Can't use djgpp fast with other compilers anyway */
282 #   endif
283 #  else
284 /* djgpp C compiler	*/
285 #   if defined(SCREEN_BIOS)
286 #undef SCREEN_BIOS
287 #   endif
288 #  endif
289 # endif
290 # define ASCIIGRAPH
291 # ifdef TEXTCOLOR
292 #  define VIDEOSHADES
293 # endif
294 /* SCREEN_8514, SCREEN_VESA are only placeholders presently - sub VGA instead */
295 # if defined(SCREEN_8514) || defined(SCREEN_VESA)
296 #  undef SCREEN_8514
297 #  undef SCREEN_VESA
298 #  define SCREEN_VGA
299 # endif
300 /* Graphical tile sanity checks */
301 # ifdef SCREEN_VGA
302 #  define SIMULATE_CURSOR
303 #  define POSITIONBAR
304 /* Select appropriate tile file format, and map size */
305 #  define PLANAR_FILE
306 #  define SMALL_MAP
307 # endif
308 #endif			/* End of sanity check block */
309 
310 #if defined(MSDOS) && defined(DLB)
311 #define FILENAME_CMP  stricmp		      /* case insensitive */
312 #endif
313 
314 #ifdef MSC7_WARN	/* define with cl /DMSC7_WARN	*/
315 #pragma warning(disable:4131)
316 #endif
317 
318 #ifdef TIMED_DELAY
319 # ifdef __DJGPP__
320 # define msleep(k) (void) usleep((k)*1000)
321 # endif
322 # ifdef __BORLANDC__
323 # define msleep(k) delay(k)
324 # endif
325 # ifdef __SC__
326 # define msleep(k) (void) usleep((long)((k)*1000))
327 # endif
328 #endif
329 
330 #endif /* PCCONF_H */
331