Source:NetHack 3.6.1/include/pcconf.h

From NetHackWiki
(Redirected from Pcconf.h)
Jump to: navigation, search

Below is the full text to pcconf.h from the source code of NetHack 3.6.1. To link to a particular line, write [[Source:NetHack 3.6.1/include/pcconf.h#line123]], for example.

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