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