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#define TIMED_DELAY	/* enable the `timed_delay' run-time option */
137
138# ifdef PCMUSIC
139#define TIMED_DELAY	/* need it anyway */
140# endif
141#define NOCWD_ASSUMPTIONS	/* Allow paths to be specified for HACKDIR,
142				   LEVELDIR, SAVEDIR, BONESDIR, DATADIR,
143				   SCOREDIR, LOCKDIR, CONFIGDIR, and TROUBLEDIR. */
144
145#endif /* MSDOS configuration stuff */
146
147#define PATHLEN		64	/* maximum pathlength */
148#define FILENAME	80	/* maximum filename length (conservative) */
149#ifndef MICRO_H
150#include "micro.h"		/* contains necessary externs for [os_name].c */
151#endif
152
153
154/* ===================================================
155 *  The remaining code shouldn't need modification.
156 */
157
158#ifndef SYSTEM_H
159#include "system.h"
160#endif
161
162#ifdef __DJGPP__
163#include <unistd.h> /* close(), etc. */
164/* lock() in io.h interferes with lock[] in decl.h */
165#define lock djlock
166#include <io.h>
167#undef lock
168#include <pc.h> /* kbhit() */
169#define PC_LOCKING
170#define HOLD_LOCKFILE_OPEN
171#define SELF_RECOVER		/* NetHack itself can recover games */
172#endif
173
174# ifdef MSDOS
175#  ifndef EXEPATH
176#define EXEPATH		/* HACKDIR is .exe location if not explicitly defined */
177#  endif
178# endif
179
180# if defined(_MSC_VER) && defined(MSDOS)
181#  if (_MSC_VER >= 700) && !defined(FUNCTION_LEVEL_LINKING)
182#   ifndef MOVERLAY
183#define MOVERLAY	/* Microsoft's MOVE overlay system (MSC >= 7.0) */
184#   endif
185#  endif
186#define PC_LOCKING
187# endif
188
189/* Borland Stuff */
190# if defined(__BORLANDC__)
191#  if defined(__OVERLAY__) && !defined(VROOMM)
192/* __OVERLAY__ is automatically defined by Borland C if overlay option is on */
193#define VROOMM		/* Borland's VROOMM overlay system */
194#  endif
195#  if !defined(STKSIZ)
196#define STKSIZ	5*1024	/* Use a default of 5K stack for Borland C	*/
197			/* This macro is used in any file that contains */
198			/* a main() function.				*/
199#  endif
200#define PC_LOCKING
201# endif
202
203#ifdef PC_LOCKING
204#define HLOCK "NHPERM"
205#endif
206
207#ifndef index
208# define index	strchr
209#endif
210#ifndef rindex
211# define rindex strrchr
212#endif
213
214#ifndef AMIGA
215#include <time.h>
216#endif
217
218#ifdef RANDOM
219/* Use the high quality random number routines. */
220# define Rand() random()
221#else
222# define Rand() rand()
223#endif
224
225#ifndef TOS
226# define FCMASK 0660	/* file creation mask */
227#endif
228
229#include <fcntl.h>
230
231#ifndef REDO
232# undef Getchar
233# define Getchar nhgetch
234#endif
235
236#ifdef MSDOS
237# define TEXTCOLOR /* */
238# define PORT_HELP "msdoshlp.txt" /* msdos port specific help file */
239#endif
240
241
242/* Sanity check, do not modify these blocks. */
243
244/* OVERLAY must be defined with MOVERLAY or VROOMM */
245#if (defined(MOVERLAY) || defined(VROOMM))
246# ifndef OVERLAY
247#  define OVERLAY
248# endif
249#endif
250
251#if defined(FUNCTION_LEVEL_LINKING)
252#define OVERLAY
253#define OVL0
254#define OVL1
255#define OVL2
256#define OVL3
257#define OVLB
258#endif
259
260#if defined(OVERLAY) && !defined(MOVERLAY) && !defined(VROOMM) && !defined(FUNCTION_LEVEL_LINKING)
261#define USE_TRAMPOLI
262#endif
263
264#if defined(MSDOS) && defined(NO_TERMS)
265# ifdef TERMLIB
266#  if defined(_MSC_VER) || defined(__SC__)
267#   pragma message("Warning -- TERMLIB defined with NO_TERMS in pcconf.h")
268#   pragma message("           Forcing undef of TERMLIB")
269#  endif
270#undef TERMLIB
271# endif
272# ifdef ANSI_DEFAULT
273#  if defined(_MSC_VER) || defined(__SC__)
274#   pragma message("Warning -- ANSI_DEFAULT defined with NO_TERMS in pcconf.h")
275#   pragma message("           Forcing undef of ANSI_DEFAULT")
276#  endif
277#undef ANSI_DEFAULT
278# endif
279/* only one screen package is allowed */
280# if defined(SCREEN_BIOS) && defined(SCREEN_DJGPPFAST)
281#  if defined(_MSC_VER) || defined(__SC__)
282#   pragma message("Warning -- More than one screen package defined in pcconf.h")
283#  endif
284#  if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__SC__)
285#   if defined(SCREEN_DJGPPFAST)
286#    if defined(_MSC_VER) || defined(__SC__)
287#    pragma message("           Forcing undef of SCREEN_DJGPPFAST")
288#    endif
289#undef SCREEN_DJGPPFAST   /* Can't use djgpp fast with other compilers anyway */
290#   endif
291#  else
292/* djgpp C compiler	*/
293#   if defined(SCREEN_BIOS)
294#undef SCREEN_BIOS
295#   endif
296#  endif
297# endif
298# define ASCIIGRAPH
299# ifdef TEXTCOLOR
300#  define VIDEOSHADES
301# endif
302/* SCREEN_8514, SCREEN_VESA are only placeholders presently - sub VGA instead */
303# if defined(SCREEN_8514) || defined(SCREEN_VESA)
304#  undef SCREEN_8514
305#  undef SCREEN_VESA
306#  define SCREEN_VGA
307# endif
308/* Graphical tile sanity checks */
309# ifdef SCREEN_VGA
310#  define SIMULATE_CURSOR
311#  define POSITIONBAR
312/* Select appropriate tile file format, and map size */
313#  define PLANAR_FILE
314#  define SMALL_MAP
315# endif
316#endif			/* End of sanity check block */
317
318#if defined(MSDOS) && defined(DLB)
319#define FILENAME_CMP  stricmp		      /* case insensitive */
320#endif
321
322#ifdef MSC7_WARN	/* define with cl /DMSC7_WARN	*/
323#pragma warning(disable:4131)
324#endif
325
326#ifdef TIMED_DELAY
327# ifdef __DJGPP__
328# define msleep(k) (void) usleep((k)*1000)
329# endif
330# ifdef __BORLANDC__
331# define msleep(k) delay(k)
332# endif
333# ifdef __SC__
334# define msleep(k) (void) usleep((long)((k)*1000))
335# endif
336#endif
337
338#endif /* PCCONF_H */
339