pcconf.h

Go to the documentation of this file.
00001 /*      SCCS Id: @(#)pcconf.h   3.4     1995/10/11      */
00002 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
00003 /* NetHack may be freely redistributed.  See license for details. */
00004 
00005 #ifndef PCCONF_H
00006 #define PCCONF_H
00007 
00008 #define MICRO           /* always define this! */
00009 
00010 #ifdef MSDOS            /* some of this material is MS-DOS specific */
00011 
00012 /*
00013  *  Automatic Defines:
00014  *
00015  *     __GO32__ is defined automatically by the djgpp port of gcc.
00016  *     __DJGPP__ is defined automatically by djgpp version 2 and above.
00017  *     _MSC_VER is defined automatically by Microsoft C.
00018  *     __BORLANDC__ is defined automatically by Borland C.
00019  *     __SC__ is defined automatically by Symantec C.
00020  *      Note: 3.4.1 was not verified with Symantec C.
00021  */
00022 
00023 /*
00024  *  The following options are somewhat configurable depending on
00025  *  your compiler.
00026  */
00027 
00028 /*
00029  *  For pre-V7.0 Microsoft Compilers only, manually define OVERLAY here.
00030  */
00031 
00032 /*#define OVERLAY */    /* Manual overlay definition (MSC 6.0ax only) */
00033 
00034 # ifndef __GO32__
00035 #define MFLOPPY         /* Support for floppy drives and ramdisks by dgk */
00036 # endif
00037 
00038 # define SHELL          /* via exec of COMMAND.COM */
00039 
00040 # ifdef __BORLANDC__
00041 #define PCMUSIC         /* Music option, enable very basic pc speaker music notes */
00042 # endif
00043 
00044 /*
00045  * Screen control options
00046  *
00047  * You may uncomment:
00048  *                     ANSI_DEFAULT
00049  *                or   TERMLIB
00050  *                or   ANSI_DEFAULT and TERMLIB
00051  *                or   NO_TERMS
00052  */
00053 
00054 /* # define TERMLIB */     /* enable use of termcap file /etc/termcap */
00055                         /* or ./termcap for MSDOS (SAC) */
00056                         /* compile and link in Fred Fish's termcap library, */
00057                         /* enclosed in TERMCAP.ARC, to use this */
00058 
00059 /* # define ANSI_DEFAULT */   /* allows NetHack to run without a ./termcap */
00060 
00061 # define NO_TERMS       /* Allows Nethack to run without ansi.sys by linking */
00062                         /* screen routines into the .exe     */
00063 
00064 # ifdef NO_TERMS        /* if NO_TERMS select one screen package below */
00065 #define SCREEN_BIOS             /* Use bios calls for all screen control */
00066 /* #define SCREEN_DJGPPFAST */  /* Use djgpp fast screen routines       */
00067 # endif
00068 
00069 
00070 /* # define PC9800 */   /* Allows NetHack to run on NEC PC-9800 machines */
00071                         /* Yamamoto Keizo */
00072 
00073 
00074 /*
00075  * PC video hardware support options (for graphical tile support)
00076  *
00077  * You may uncomment any/all of the options below.
00078  *
00079  */
00080 # ifndef SUPPRESS_GRAPHICS
00081 #  if (defined(SCREEN_BIOS) || defined(SCREEN_DJGPPFAST)) && !defined(PC9800)
00082 #   ifdef USE_TILES
00083 #define SCREEN_VGA      /* Include VGA    graphics routines in the build */
00084 #   endif
00085 #  endif
00086 # else
00087 # undef NO_TERMS
00088 # undef SCREEN_BIOS
00089 # undef SCREEN_DJGPPFAST
00090 # undef SCREEN_VGA
00091 # undef TERMLIB
00092 # define ANSI_DEFAULT
00093 # endif
00094 
00095 # define RANDOM         /* have Berkeley random(3) */
00096 
00097 # define MAIL           /* Allows for fake mail daemon to deliver mail */
00098                         /* in the MSDOS version.  (For AMIGA MAIL see  */
00099                         /* amiconf.h).  In the future this will be the */
00100                         /* hook for mail reader implementation.        */
00101 
00102 /* The following is needed for prototypes of certain functions */
00103 
00104 #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__SC__)
00105 #include <process.h>    /* Provides prototypes of exit(), spawn()      */
00106 #endif
00107 
00108 #if defined(__BORLANDC__) && defined(STRNCMPI)
00109 #include <string.h>     /* Provides prototypes of strncmpi(), etc.     */
00110 #endif
00111 
00112 #if defined(__DJGPP__)
00113 #define _NAIVE_DOS_REGS
00114 #include <stdlib.h>
00115 #include <string.h>     /* Provides prototypes of strncmpi(), etc.     */
00116 # ifndef M
00117 #define M(c)            ((char) (0x80 | (c)))
00118 # endif
00119 #endif
00120 
00121 /*
00122  * On the VMS and unix, this option controls whether a delay is done by
00123  * the clock, or whether it is done by excess output.  On the PC, however,
00124  * there is always a clock to use for the delay.  The TIMED_DELAY option
00125  * on MSDOS (without the termcap routines) is used to determine whether to
00126  * include the delay routines in the code (and thus, provides a compile time
00127  * method to turn off napping for visual effect).  However, it is also used
00128  * in the music code to wait between different notes.  So it is needed in that
00129  * case as well.
00130 
00131  * Whereas on the VMS and unix, flags.nap is a run-time option controlling
00132  * whether there is a delay by clock or by excess output, on MSDOS it is
00133  * simply a flag to turn on or off napping for visual effects at run-time.
00134  */
00135 
00136 #ifndef AUTOCONF
00137 #define TIMED_DELAY     /* enable the `timed_delay' run-time option */
00138 #endif
00139 
00140 # ifdef PCMUSIC
00141 #define TIMED_DELAY     /* need it anyway */
00142 # endif
00143 #define NOCWD_ASSUMPTIONS       /* Allow paths to be specified for HACKDIR,
00144                                    LEVELDIR, SAVEDIR, BONESDIR, DATADIR,
00145                                    SCOREDIR, LOCKDIR, CONFIGDIR, and TROUBLEDIR. */
00146 
00147 #endif /* MSDOS configuration stuff */
00148 
00149 #define PATHLEN         64      /* maximum pathlength */
00150 #define FILENAME        80      /* maximum filename length (conservative) */
00151 #ifndef MICRO_H
00152 #include "micro.h"              /* contains necessary externs for [os_name].c */
00153 #endif
00154 
00155 
00156 /* ===================================================
00157  *  The remaining code shouldn't need modification.
00158  */
00159 
00160 #ifndef SYSTEM_H
00161 #include "system.h"
00162 #endif
00163 
00164 #ifdef __DJGPP__
00165 #include <unistd.h> /* close(), etc. */
00166 /* lock() in io.h interferes with lock[] in decl.h */
00167 #define lock djlock
00168 #include <io.h>
00169 #undef lock
00170 #include <pc.h> /* kbhit() */
00171 #define PC_LOCKING
00172 #define HOLD_LOCKFILE_OPEN
00173 #define SELF_RECOVER            /* NetHack itself can recover games */
00174 #endif
00175 
00176 # ifdef MSDOS
00177 #  ifndef EXEPATH
00178 #define EXEPATH         /* HACKDIR is .exe location if not explicitly defined */
00179 #  endif
00180 # endif
00181 
00182 # if defined(_MSC_VER) && defined(MSDOS)
00183 #  if (_MSC_VER >= 700) && !defined(FUNCTION_LEVEL_LINKING)
00184 #   ifndef MOVERLAY
00185 #define MOVERLAY        /* Microsoft's MOVE overlay system (MSC >= 7.0) */
00186 #   endif
00187 #  endif
00188 #define PC_LOCKING
00189 # endif
00190 
00191 /* Borland Stuff */
00192 # if defined(__BORLANDC__)
00193 #  if defined(__OVERLAY__) && !defined(VROOMM)
00194 /* __OVERLAY__ is automatically defined by Borland C if overlay option is on */
00195 #define VROOMM          /* Borland's VROOMM overlay system */
00196 #  endif
00197 #  if !defined(STKSIZ)
00198 #define STKSIZ  5*1024  /* Use a default of 5K stack for Borland C      */
00199                         /* This macro is used in any file that contains */
00200                         /* a main() function.                           */
00201 #  endif
00202 #define PC_LOCKING
00203 # endif
00204 
00205 #ifdef PC_LOCKING
00206 #define HLOCK "NHPERM"
00207 #endif
00208 
00209 #ifndef index
00210 # define index  strchr
00211 #endif
00212 #ifndef rindex
00213 # define rindex strrchr
00214 #endif
00215 
00216 #ifndef AMIGA
00217 #include <time.h>
00218 #endif
00219 
00220 #ifdef RANDOM
00221 /* Use the high quality random number routines. */
00222 # define Rand() random()
00223 #else
00224 # define Rand() rand()
00225 #endif
00226 
00227 #ifndef TOS
00228 # define FCMASK 0660    /* file creation mask */
00229 #endif
00230 
00231 #include <fcntl.h>
00232 
00233 #ifndef REDO
00234 # undef Getchar
00235 # define Getchar nhgetch
00236 #endif
00237 
00238 #ifdef MSDOS
00239 # define TEXTCOLOR /* */
00240 # define PORT_HELP "msdoshlp.txt" /* msdos port specific help file */
00241 #endif
00242 
00243 
00244 /* Sanity check, do not modify these blocks. */
00245 
00246 /* OVERLAY must be defined with MOVERLAY or VROOMM */
00247 #if (defined(MOVERLAY) || defined(VROOMM))
00248 # ifndef OVERLAY
00249 #  define OVERLAY
00250 # endif
00251 #endif
00252 
00253 #if defined(FUNCTION_LEVEL_LINKING)
00254 #define OVERLAY
00255 #define OVL0
00256 #define OVL1
00257 #define OVL2
00258 #define OVL3
00259 #define OVLB
00260 #endif
00261 
00262 #if defined(OVERLAY) && !defined(MOVERLAY) && !defined(VROOMM) && !defined(FUNCTION_LEVEL_LINKING)
00263 #define USE_TRAMPOLI
00264 #endif
00265 
00266 #if defined(MSDOS) && defined(NO_TERMS)
00267 # ifdef TERMLIB
00268 #  if defined(_MSC_VER) || defined(__SC__)
00269 #   pragma message("Warning -- TERMLIB defined with NO_TERMS in pcconf.h")
00270 #   pragma message("           Forcing undef of TERMLIB")
00271 #  endif
00272 #undef TERMLIB
00273 # endif
00274 # ifdef ANSI_DEFAULT
00275 #  if defined(_MSC_VER) || defined(__SC__)
00276 #   pragma message("Warning -- ANSI_DEFAULT defined with NO_TERMS in pcconf.h")
00277 #   pragma message("           Forcing undef of ANSI_DEFAULT")
00278 #  endif
00279 #undef ANSI_DEFAULT
00280 # endif
00281 /* only one screen package is allowed */
00282 # if defined(SCREEN_BIOS) && defined(SCREEN_DJGPPFAST)
00283 #  if defined(_MSC_VER) || defined(__SC__)
00284 #   pragma message("Warning -- More than one screen package defined in pcconf.h")
00285 #  endif
00286 #  if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__SC__)
00287 #   if defined(SCREEN_DJGPPFAST)
00288 #    if defined(_MSC_VER) || defined(__SC__)
00289 #    pragma message("           Forcing undef of SCREEN_DJGPPFAST")
00290 #    endif
00291 #undef SCREEN_DJGPPFAST   /* Can't use djgpp fast with other compilers anyway */
00292 #   endif
00293 #  else
00294 /* djgpp C compiler     */
00295 #   if defined(SCREEN_BIOS)
00296 #undef SCREEN_BIOS
00297 #   endif
00298 #  endif
00299 # endif
00300 # define ASCIIGRAPH
00301 # ifdef TEXTCOLOR
00302 #  define VIDEOSHADES
00303 # endif
00304 /* SCREEN_8514, SCREEN_VESA are only placeholders presently - sub VGA instead */
00305 # if defined(SCREEN_8514) || defined(SCREEN_VESA)
00306 #  undef SCREEN_8514
00307 #  undef SCREEN_VESA
00308 #  define SCREEN_VGA
00309 # endif
00310 /* Graphical tile sanity checks */
00311 # ifdef SCREEN_VGA
00312 #  define SIMULATE_CURSOR
00313 #  define POSITIONBAR
00314 /* Select appropriate tile file format, and map size */
00315 #  define PLANAR_FILE
00316 #  define SMALL_MAP
00317 # endif
00318 #endif                  /* End of sanity check block */
00319 
00320 #if defined(MSDOS) && defined(DLB)
00321 #define FILENAME_CMP  stricmp                 /* case insensitive */
00322 #endif
00323 
00324 #ifdef MSC7_WARN        /* define with cl /DMSC7_WARN   */
00325 #pragma warning(disable:4131)
00326 #endif
00327 
00328 #ifdef TIMED_DELAY
00329 # ifdef __DJGPP__
00330 # define msleep(k) (void) usleep((k)*1000)
00331 # endif
00332 # ifdef __BORLANDC__
00333 # define msleep(k) delay(k)
00334 # endif
00335 # ifdef __SC__
00336 # define msleep(k) (void) usleep((long)((k)*1000))
00337 # endif
00338 #endif
00339 
00340 #endif /* PCCONF_H */