Merge branch 'master' into nhmall-booktribute

Conflicts:
	sys/winnt/Makefile.msc
This commit is contained in:
nhmall
2015-03-22 15:22:17 -04:00
13 changed files with 288 additions and 103 deletions

View File

@@ -1,9 +1,9 @@
/* NetHack 3.5 pcmain.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
/* NetHack 3.5 pcmain.c $NHDT-Date: 1426966701 2015/03/21 19:38:21 $ $NHDT-Branch: master $:$NHDT-Revision: 1.51 $ */
/* NetHack 3.5 pcmain.c $Date: 2012/01/20 03:41:31 $ $Revision: 1.48 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
/* main.c - MSDOS, OS/2, ST, Amiga, and NT NetHack */
/* main.c - MSDOS, OS/2, ST, Amiga, and Windows NetHack */
#include "hack.h"
#include "dlb.h"
@@ -244,6 +244,9 @@ char *argv[];
#if defined(CHDIR) && !defined(NOCWD_ASSUMPTIONS)
chdirx(hackdir,0);
#endif
#ifdef SYSCF
initoptions();
#endif
prscore(argc, argv);
nethack_exit(EXIT_SUCCESS);

View File

@@ -1,4 +1,4 @@
/* NetHack 3.5 unixmain.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
/* NetHack 3.5 unixmain.c $NHDT-Date: 1426966705 2015/03/21 19:38:25 $ $NHDT-Branch: master $:$NHDT-Revision: 1.44 $ */
/* NetHack 3.5 unixmain.c $Date: 2012/01/27 20:15:31 $ $Revision: 1.42 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -648,20 +648,4 @@ get_unix_pw()
return pw;
}
#ifdef SYSCF_FILE
void
assure_syscf_file(){
/* All we really care about is the end result - can we read the file?
* So just check that directly. */
int fd;
fd = open(SYSCF_FILE, O_RDONLY);
if(fd >= 0){
/* readable */
close(fd);
return;
}
raw_printf("Unable to open SYSCF_FILE.\n");
exit(EXIT_FAILURE);
}
#endif
/*unixmain.c*/

View File

@@ -1,4 +1,4 @@
# NetHack 3.5 Makefile.msc $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
# NetHack 3.5 Makefile.msc $NHDT-Date: 1426967393 2015/03/21 19:49:53 $ $NHDT-Branch: master $:$NHDT-Revision: 1.72 $ */
# Copyright (c) NetHack PC Development Team 1993-2015
#
#==============================================================================
@@ -79,6 +79,13 @@ TARGET_CPU=x86
GAMEDIR = ..\binary # Game directory
#
#---------------------------------------------------------------
# 4. Do you want debug information in the executable?
#
DEBUGINFO = Y
# This marks the end of the BUILD DECISIONS section.
#==============================================================================
#
@@ -111,7 +118,7 @@ DOC = ..\doc # NetHack documentation files
UTIL = ..\util # Utility source
SRC = ..\src # Main source
SSYS = ..\sys\share # Shared system files
NTSYS = ..\sys\winnt # NT Win32 specific files
MSWSYS= ..\sys\winnt # mswin specific files
TTY = ..\win\tty # window port files (tty)
WIN32 = ..\win\win32 # window port files (Win32)
WSHR = ..\win\share # Tile support files
@@ -144,7 +151,7 @@ TARGET_CPU=x86
# -Zd - generate only public symbols and line numbers for debugging
# -GS - enable security checks
#
ccommon=-c -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -c
ccommon=-c $(CDBFLAG) -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -c
lflags=/INCREMENTAL:NO /NOLOGO
!IF "$(TARGET_CPU)" == "x86"
@@ -201,18 +208,6 @@ guilibs = $(winlibs)
RANDOM = $(OBJ)\random.o
#RANDOM =
#
# Uncomment the next 2 lines _ONLY_ if you DO NOT want any
# debug capability in the object files, or in the NetHack executable.
# Comment them if you want debug capability.
#ldebug =
#cdebug =
#
# Compiler and Linker flags
#
PRECOMPHEAD = N # set to Y if you want to use precomp. headers
#
@@ -276,12 +271,19 @@ DLBFLG =
#==========================================
#==========================================
PDBFILE= /PDB:"$(O)$(GAME).PDB"
MAPFILE= /MAP:"$(O)$(GAME).MAP"
INCLDIR= /I..\include
ldebug=/DEBUG
!IF "$(DEBUGINFO)" == "Y"
CDBGFLAG=-Zi
LDBGFLAG=/debug
cdebug = -Zi -Od
ldebug = /DEBUG
!ELSE
CDBGFLAG=
LDBGFLAG=
ldebug =
cdebug =
!ENDIF
!IF ("$(ldebug)" != "")
!IF ("$(ldebug)" != "/RELEASE")
@@ -365,10 +367,10 @@ DLB =
# Rules for files in sys\winnt
#==========================================
{$(NTSYS)}.c{$(OBJ)}.o:
{$(MSWSYS)}.c{$(OBJ)}.o:
@$(CC) $(cflagsUtil) -Fo$@ $<
{$(NTSYS)}.h{$(INCL)}.h:
{$(MSWSYS)}.h{$(INCL)}.h:
@copy $< $@
#==========================================
@@ -413,7 +415,7 @@ DLB =
# referenced later on in the Makefile.
#
DEFFILE = $(NTSYS)\$(GAME).def
DEFFILE = $(MSWSYS)\$(GAME).def
#
# Shorten up the location for some files
@@ -599,15 +601,16 @@ $(O)install.tag: $(DAT)\data $(DAT)\rumors $(DAT)\dungeon \
copy $(DAT)\*.lev $(GAMEDIR)
if exist $(GAMEDIR)\makefile del $(GAMEDIR)\makefile
! ENDIF
if not exist $(GAMEDIR)\sysconf copy $(MSWSYS)\sysconf $(GAMEDIR)
if exist $(DAT)\symbols copy $(DAT)\symbols $(GAMEDIR)
if exist $(DOC)\guidebook.txt copy $(DOC)\guidebook.txt $(GAMEDIR)\Guidebook.txt
if exist $(DOC)\nethack.txt copy $(DOC)\nethack.txt $(GAMEDIR)\NetHack.txt
@if exist $(O)$(GAME).PDB copy $(O)$(GAME).pdb $(GAMEDIR)\$(GAME).pdb
@if exist $(GAMEDIR)\$(GAME).PDB echo NOTE: You may want to remove $(GAMEDIR)\$(GAME).pdb to conserve space
-copy $(NTSYS)\defaults.nh $(GAMEDIR)\defaults.nh
-copy $(MSWSYS)\defaults.nh $(GAMEDIR)\defaults.nh
echo install done > $@
# copy $(NTSYS)\winnt.hlp $(GAMEDIR)
# copy $(MSWSYS)\winnt.hlp $(GAMEDIR)
recover: $(U)recover.exe
if exist $(U)recover.exe copy $(U)recover.exe $(GAMEDIR)
@@ -666,8 +669,8 @@ $(NHRES): $(TILEBMP16) $(WIN32)\winhack.rc $(WIN32)\mnsel.bmp \
$(WIN32)\splash.bmp
@$(rc) -r -fo$@ -i$(WIN32) -dNDEBUG $(WIN32)\winhack.rc
!ELSE
$(NHRES): $(NTSYS)\console.rc $(NTSYS)\NetHack.ico
@$(rc) -r -fo$@ -i$(NTSYS) -dNDEBUG $(NTSYS)\console.rc
$(NHRES): $(MSWSYS)\console.rc $(MSWSYS)\NetHack.ico
@$(rc) -r -fo$@ -i$(MSWSYS) -dNDEBUG $(MSWSYS)\console.rc
!ENDIF
#==========================================
@@ -838,12 +841,12 @@ $(U)uudecode.exe: $(O)uudecode.o
$(O)uudecode.o: $(SSYS)\uudecode.c
@$(CC) $(cflagsUtil) /D_CRT_SECURE_NO_DEPRECATE -Fo$@ $(SSYS)\uudecode.c
$(NTSYS)\NetHack.ico : $(U)uudecode.exe $(NTSYS)\nhico.uu
chdir $(NTSYS)
$(MSWSYS)\NetHack.ico : $(U)uudecode.exe $(MSWSYS)\nhico.uu
chdir $(MSWSYS)
..\..\util\uudecode.exe nhico.uu
chdir ..\..\src
$(WIN32)\NetHack.ico : $(U)uudecode.exe $(NTSYS)\nhico.uu
$(WIN32)\NetHack.ico : $(U)uudecode.exe $(MSWSYS)\nhico.uu
chdir $(WIN32)
..\..\util\uudecode.exe ../../sys/winnt/nhico.uu
chdir ..\..\src
@@ -978,8 +981,8 @@ envchk:
# Header files NOT distributed in $(INCL)
#===========================================
$(INCL)\win32api.h: $(NTSYS)\win32api.h
copy $(NTSYS)\win32api.h $@
$(INCL)\win32api.h: $(MSWSYS)\win32api.h
copy $(MSWSYS)\win32api.h $@
#==========================================
@@ -1000,8 +1003,8 @@ $(O)dlb.o: $(O)dlb_main.o $(O)alloc.o $(O)panic.o $(INCL)\dlb.h
$(O)dlb_main.o: $(UTIL)\dlb_main.c $(INCL)\config.h $(INCL)\dlb.h
@$(CC) $(cflagsUtil) /Fo$@ $(UTIL)\dlb_main.c
$(DAT)\porthelp: $(NTSYS)\porthelp
@copy $(NTSYS)\porthelp $@ >nul
$(DAT)\porthelp: $(MSWSYS)\porthelp
@copy $(MSWSYS)\porthelp $@ >nul
nhdat: $(U)dlb_main.exe $(DAT)\data $(DAT)\oracles $(OPTIONS_FILE) \
$(DAT)\quest.dat $(DAT)\rumors $(DAT)\help $(DAT)\hh $(DAT)\cmdhelp \
@@ -1296,14 +1299,14 @@ $(DAT)\dungeon: $(O)utility.tag $(DAT)\dungeon.def
# NT dependencies
#
$(O)nttty.o: $(HACK_H) $(TILE_H) $(INCL)\win32api.h $(NTSYS)\nttty.c
@$(CC) $(cflagsUtil) -I$(WSHR) -Fo$@ $(NTSYS)\nttty.c
$(O)nhkeys.o: $(HACK_H) $(TILE_H) $(INCL)\win32api.h $(NTSYS)\nhkeys.c
@$(CC) $(cflagsUtil) -I$(WSHR) -Fo$@ $(NTSYS)\nhkeys.c
$(O)winnt.o: $(HACK_H) $(INCL)\win32api.h $(NTSYS)\winnt.c
@$(CC) $(cflagsUtil) -Fo$@ $(NTSYS)\winnt.c
$(O)ntsound.o: $(HACK_H) $(NTSYS)\ntsound.c
@$(CC) $(cflagsUtil) -Fo$@ $(NTSYS)\ntsound.c
$(O)nttty.o: $(HACK_H) $(TILE_H) $(INCL)\win32api.h $(MSWSYS)\nttty.c
@$(CC) $(cflagsUtil) -I$(WSHR) -Fo$@ $(MSWSYS)\nttty.c
$(O)nhkeys.o: $(HACK_H) $(TILE_H) $(INCL)\win32api.h $(MSWSYS)\nhkeys.c
@$(CC) $(cflagsUtil) -I$(WSHR) -Fo$@ $(MSWSYS)\nhkeys.c
$(O)winnt.o: $(HACK_H) $(INCL)\win32api.h $(MSWSYS)\winnt.c
@$(CC) $(cflagsUtil) -Fo$@ $(MSWSYS)\winnt.c
$(O)ntsound.o: $(HACK_H) $(MSWSYS)\ntsound.c
@$(CC) $(cflagsUtil) -Fo$@ $(MSWSYS)\ntsound.c
#
# util dependencies

78
sys/winnt/sysconf Normal file
View File

@@ -0,0 +1,78 @@
#
# NetHack 3.5 sysconf $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$
# NetHack 3.5 sysconf $Date: 2012/01/27 20:15:31 $ $Revision: 1.6 $
#
# Sample sysconf file.
# The sysconf file is only used if NetHack is compiled with SYSCF defined.
# This file uses the same syntax as nethack.cf.
# Which users can use WIZARD (debugging) mode (the -D flag).
# A value of * allows anyone to enter debugging mode.
WIZARDS=*
# Users allowed to use the ! (shell escape) command or to suspend the game.
# Uses the same syntax as the WIZARDS option above.
#SHELLERS=
# Show debugging information originating from these source files.
# Use '*' for all, or list source files separated by spaces.
# Only available if game has been compiled with DEBUG.
#DEBUGFILES=*
# Limit the number of simultaneous games (see also nethack.sh).
#MAXPLAYERS=10
# If not null, added to string "To get local support, " in the support
# information help.
#SUPPORT=call Izchak at extension 42.
# Uncomment the next line to disable the SEDUCE option.
#SEDUCE=0
# Record (high score) file options.
# CAUTION: changing these after people have started playing games can
# lead to lost high scores!
# Maximum entries for one person.
#PERSMAX=10
# Maximum entries in the record file.
#ENTRYMAX=100
# Minimum points to get an entry.
#POINTSMIN=1
# Determine identity of "person" in the score file with name (0) or
# numeric (1) user id.
#PERS_IS_UID=1
# Maximum number of score file entries to use for random statue names
#MAX_STATUENAME_RANK=10
# *** LOCATIONS ***
# IMPORTANT: If you change any of these locations, the directories they
# point at must exist. NetHack will not create them for you.
#
# HACKDIR is the default location for everything.
# Note: On Windows HACKDIR defaults to the location
# of the NetHack.exe or NetHackw.exe file so
# setting HACKDIR below to override that is
# not usually necessary or recommended.
#HACKDIR=c:\games\nethack
#
# The location that users can adjust their config file startup options
#CONFIGDIR=c:\games\nethack
#
# The location that level files in progress are stored (default=HACKDIR, writeable)
#LEVELDIR=c:\nethack\levels
#
# The location where saved games are kept (default=HACKDIR, writeable)
#SAVEDIR=c:\nethack\save
#
# The location that bones files are kept (default=HACKDIR, writeable)
#BONESDIR=c:\nethack\save
#
# The location that file synchronization locks are stored (default=HACKDIR, writeable)
#LOCKDIR=c:\nethack\levels
#
# The location that a record of game aborts and self-diagnosed game problems
# is kept (default=HACKDIR, writeable)
#TROUBLEDIR=c:\nethack\trouble