Source:NetHack 3.4.3/include/pcconf.h

From NetHackWiki
Jump to: navigation, search

Below is the full text to include/pcconf.h from NetHack 3.4.3. To link to a particular line, write [[pcconf.h#line123]], for example.

  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. */

The NetHack General Public License applies to screenshots, source code and other content from NetHack.

This content was modified from the original NetHack source code distribution (by splitting up NetHack content between wiki pages, and possibly further editing). See the page history for a list of who changed it, and on what dates.

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