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