Source:NetHack 3.6.3/include/pcconf.h

From NetHackWiki
Jump to navigation Jump to search

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