Merge branch 'NetHack-3.6.2'

This commit is contained in:
nhmall
2018-11-30 20:25:40 -05:00
31 changed files with 1189 additions and 793 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 pcmain.c $NHDT-Date: 1524413707 2018/04/22 16:15:07 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.74 $ */
/* NetHack 3.6 pcmain.c $NHDT-Date: 1543465755 2018/11/29 04:29:15 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.101 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */
@@ -87,9 +87,12 @@ unsigned _stklen = STKSIZ;
* to help MinGW decide which entry point to choose. If both main and
* WinMain exist, the resulting executable won't work correctly.
*/
#ifndef __MINGW32__
int
#ifndef __MINGW32__
main(argc, argv)
#else
mingw_main(argc, argv)
#endif
int argc;
char *argv[];
{
@@ -115,7 +118,6 @@ char *argv[];
/*NOTREACHED*/
return 0;
}
#endif
boolean
pcmain(argc, argv)
@@ -177,7 +179,7 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/
choose_windows(DEFAULT_WINDOW_SYS);
#else
choose_windows(default_window_sys);
if (argc > 1
if (argc >= 1
&& !strcmpi(default_window_sys, "mswin")
&& strstri(argv[0], "nethackw.exe"))
iflags.windowtype_locked = TRUE;

View File

@@ -1,5 +1,5 @@
# NetHack Makefile (VMS) - for building nethack itself.
# NetHack 3.6 Makefile.src $NHDT-Date: 1542388601 2018/11/16 17:16:41 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.31 $
# NetHack 3.6 Makefile.src $NHDT-Date: 1543545915 2018/11/30 02:45:15 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.32 $
# Copyright (c) 2011 by Robert Patrick Rankin
# NetHack may be freely redistributed. See license for details.
@@ -140,9 +140,9 @@ VERSOURCES = $(HACKCSRC) $(SYSSRC) $(WINSRC) $(RANDSRC) $(GENCSRC)
HACKINCL = align.h amiconf.h artifact.h artilist.h attrib.h beconf.h color.h \
config.h config1.h context.h coord.h decl.h def_os2.h display.h \
dlb.h dungeon.h engrave.h extern.h flag.h func_tab.h global.h \
hack.h lev.h macconf.h mextra.h mfndpos.h micro.h \
mkroom.h monattk.h mondata.h monflag.h monst.h monsym.h obj.h \
objclass.h os2conf.h patchlevel.h pcconf.h permonst.h prop.h rect.h \
hack.h lev.h macconf.h mextra.h mfndpos.h micro.h mkroom.h \
monattk.h mondata.h monflag.h monst.h monsym.h obj.h objclass.h \
os2conf.h patchlevel.h pcconf.h permonst.h prop.h rect.h \
region.h rm.h sp_lev.h spell.h sys.h system.h tcap.h timeout.h \
tosconf.h tradstdc.h trampoli.h trap.h unixconf.h vision.h \
vmsconf.h wintty.h winX.h winprocs.h wintype.h you.h youprop.h
@@ -206,8 +206,8 @@ nethack.opt : $(MAKEFILE) # this file
@ write f f$edit("$(HOBJ5)","COLLAPSE")
@ write f f$edit("$(HOBJ6)","COLLAPSE")
@ write f "sys$library:starlet.olb/Include=(lib$initialize)
@ write f \
"psect_attr=lib$initialize, Con,Usr,noPic,Rel,Gbl,noShr,noExe,Rd,noWrt,Long"
@ write f "! psect_attributes Usr, noPic, and Long removed"
@ write f "psect_attr=lib$initialize, Con,Rel,Gbl,noShr,noExe,Rd,noWrt"
@ write f "iosegment=128"
close f
@@ -378,7 +378,7 @@ attrib.obj : attrib.c $(HACK_H)
ball.obj : ball.c $(HACK_H)
bones.obj : bones.c $(HACK_H) $(INC)lev.h
botl.obj : botl.c $(HACK_H)
cmd.obj : cmd.c $(HACK_H) $(INC)func_tab.h
cmd.obj : cmd.c $(HACK_H) $(INC)lev.h $(INC)func_tab.h
dbridge.obj : dbridge.c $(HACK_H)
decl.obj : decl.c $(HACK_H)
detect.obj : detect.c $(HACK_H) $(INC)artifact.h

File diff suppressed because it is too large Load Diff

View File

@@ -71,8 +71,7 @@ DEBUGINFO = Y
#
# You'll have to set PDCURSES_H to the correct location of the
# PDCurses header (.h) files and PDCURSES_C to the location
# of your PDCurses C files which must already be resident on
# your machine.
# of your PDCurses C files.
#
ADD_CURSES=Y
PDCURSES_TOP=..\..\pdcurses
@@ -90,9 +89,13 @@ PDCURSES_TOP=..\..\pdcurses
# Nothing below here should have to be changed.#
# #
################################################
#
#==============================================================================
# Set the gamedir according to your preference.
# If not present prior to compilation it gets created.
#
# Source directories. Makedefs hardcodes these, don't change them.
#
@@ -115,10 +118,11 @@ WSHR = ..\win\share # Tile support files
OBJ = o
cc=cl
link=link
rc=Rc
#
#==========================================
# Exe File Info.
#==========================================
#
#
# Optional high-quality BSD random number generation routines
@@ -151,93 +155,6 @@ DLBFLG =
#ZLIB = zlib.lib
#==========================================
#==========================================
# Setting up the compiler and linker
#==========================================
#==========================================
# Before we get started, this section is used to determine the version of
# Visual Studio we are using. We set VSVER to 0000 to flag any version that
# is too old or untested.
#
#NMAKE version 1414264330 is distributed with VS 15.7.5
#!MESSAGE $(MAKEFLAGS)
#!MESSAGE $(MAKEDIR)
#!MESSAGE $(MAKE)
MAKEVERSION=$(_NMAKE_VER:.= )
MAKEVERSION=$(MAKEVERSION: =)
#!MESSAGE $(_NMAKE_VER)
#!MESSAGE $(MAKEVERSION)
VSNEWEST=2017
!IF ($(MAKEVERSION) < 1000000000)
VSVER=0000 #untested ancient version
!ELSEIF ($(MAKEVERSION) > 1000000000) && ($(MAKEVERSION) < 1100000000)
VSVER=2010
!ELSEIF ($(MAKEVERSION) > 1100000000) && ($(MAKEVERSION) < 1200000000)
VSVER=2012
!ELSEIF ($(MAKEVERSION) > 1200000000) && ($(MAKEVERSION) < 1400000000)
VSVER=2013
!ELSEIF ($(MAKEVERSION) > 1400000000) && ($(MAKEVERSION) < 1411000000)
VSVER=2015
!ELSEIF ($(MAKEVERSION) > 1411000000) && ($(MAKEVERSION) < 1414264331)
VSVER=$(VSNEWEST)
!ELSEIF ($(MAKEVERSION) > 1414264330)
VSVER=2999 #untested future version
!ENDIF
!IF ($(VSVER) >= 2012)
!MESSAGE Autodetected Visual Studio $(VSVER)
!ELSEIF ($(VSVER) == 2999
!MESSAGE The version of Visual Studio is newer than the most recent at
!MESSAGE the time this Makefile was crafted (Visual Studio $(VSNEWEST)).
!MESSAGE Because it is newer we'll proceed expecting that the
!MESSAGE VS$(VSNEWEST) processing will still work.
!ELSEIF ($(VSVER) == 0000)
!MESSAGE The version of Visual Studio appears to be quite old, older
!MESSAGE than VS2010 which is the oldest supported version by this
!MESSAGE Makefile, so we'll stop now.
!ERROR Untested old Visual Studio version with NMAKE $(_NMAKE_VER).
!ENDIF
!IF ($(VSVER) == 2010)
# For VS2010 use "setenv /x86" or "setenv /x64" before invoking make process
# DO NOT DELETE THE FOLLOWING LINE
!include <win32.mak>
! ENDIF
#These will be in the environment variables with one of the VS2017
#developer command prompts.
#VSCMD_ARG_HOST_ARCH=x64
#VSCMD_ARG_TGT_ARCH=x86
!IFDEF VSCMD_ARG_HOST_ARCH
!MESSAGE Host architecture is $(VSCMD_ARG_HOST_ARCH)
!MESSAGE Target architecture is $(VSCMD_ARG_TGT_ARCH)
! IFNDEF TARGET_CPU
! IF "$(VSCMD_ARG_TGT_ARCH)"=="x64"
TARGET_CPU=x64
! ELSE
TARGET_CPU=x86
! ENDIF
! ENDIF
!ENDIF
!IF "$(TARGET_CPU)" == ""
TARGET_CPU=x86
!ENDIF
!IF ($(VSVER) == 2010)
CL_RECENT=
!ELSE
! IF ($(VSVER) > 2010)
CL_RECENT=-sdl
! ENDIF
!ENDIF
#==========================================
#================ MACROS ==================
@@ -272,7 +189,7 @@ RECOVOBJS = $(O)recover.o
TILEFILES = $(WSHR)\monsters.txt $(WSHR)\objects.txt $(WSHR)\other.txt
#
# These are not invoked during a normal game build in 3.4+
# These are not invoked during a normal game build in 3.4
#
TEXT_IO = $(O)tiletext.o $(O)tiletxt.o $(O)drawing.o \
$(O)decl.o $(O)monst.o $(O)objects.o
@@ -298,19 +215,19 @@ VOBJ06 = $(O)dothrow.o $(O)drawing.o $(O)dungeon.o $(O)eat.o
VOBJ07 = $(O)end.o $(O)engrave.o $(O)exper.o $(O)explode.o
VOBJ08 = $(O)extralev.o $(O)files.o $(O)fountain.o $(O)hack.o
VOBJ09 = $(O)hacklib.o $(O)invent.o $(O)light.o $(O)lock.o
VOBJ10 = $(O)mail.o $(O)pcmain.o $(O)makemon.o $(O)mapglyph.o
VOBJ11 = $(O)mcastu.o $(O)mhitm.o $(O)mhitu.o $(O)minion.o
VOBJ12 = $(O)mklev.o $(O)mkmap.o $(O)mkmaze.o $(O)mkobj.o
VOBJ13 = $(O)mkroom.o $(O)mon.o $(O)mondata.o $(O)monmove.o
VOBJ14 = $(O)monst.o $(O)mplayer.o $(O)mthrowu.o $(O)muse.o
VOBJ15 = $(O)music.o $(O)o_init.o $(O)objects.o $(O)objnam.o
VOBJ16 = $(O)options.o $(O)pager.o $(O)pickup.o $(O)pline.o
VOBJ17 = $(O)polyself.o $(O)potion.o $(O)pray.o $(O)priest.o
VOBJ18 = $(O)quest.o $(O)questpgr.o $(RANDOM) $(O)read.o
VOBJ19 = $(O)rect.o $(O)region.o $(O)restore.o $(O)rip.o
VOBJ20 = $(O)rnd.o $(O)role.o $(O)rumors.o $(O)save.o
VOBJ21 = $(O)shk.o $(O)shknam.o $(O)sit.o $(O)sounds.o
VOBJ22 = $(O)sp_lev.o $(O)spell.o $(O)steal.o $(O)steed.o
VOBJ10 = $(O)mail.o $(O)pcmain.o $(O)makemon.o $(O)mapglyph.o $(O)mcastu.o
VOBJ11 = $(O)mhitm.o $(O)mhitu.o $(O)minion.o $(O)mklev.o
VOBJ12 = $(O)mkmap.o $(O)mkmaze.o $(O)mkobj.o $(O)mkroom.o
VOBJ13 = $(O)mon.o $(O)mondata.o $(O)monmove.o $(O)monst.o
VOBJ14 = $(O)mplayer.o $(O)mthrowu.o $(O)muse.o
VOBJ15 = $(O)music.o $(O)o_init.o $(O)objects.o $(O)objnam.o
VOBJ16 = $(O)options.o $(O)pager.o $(O)pickup.o $(O)pline.o
VOBJ17 = $(O)polyself.o $(O)potion.o $(O)pray.o $(O)priest.o
VOBJ18 = $(O)quest.o $(O)questpgr.o $(RANDOM) $(O)read.o
VOBJ19 = $(O)rect.o $(O)region.o $(O)restore.o $(O)rip.o
VOBJ20 = $(O)rnd.o $(O)role.o $(O)rumors.o $(O)save.o
VOBJ21 = $(O)shk.o $(O)shknam.o $(O)sit.o $(O)sounds.o
VOBJ22 = $(O)sp_lev.o $(O)spell.o $(O)steal.o $(O)steed.o
VOBJ23 = $(O)sys.o $(O)teleport.o $(O)timeout.o $(O)topten.o
VOBJ24 = $(O)track.o $(O)trap.o $(O)u_init.o $(O)uhitm.o
VOBJ25 = $(O)vault.o $(O)vis_tab.o $(O)vision.o $(O)weapon.o
@@ -354,8 +271,7 @@ GUIHDR = $(MSWIN)\mhaskyn.h $(MSWIN)\mhdlg.h $(MSWIN)\mhfont.h \
COMCTRL = comctl32.lib
KEYDLLS = $(GAMEDIR)\nhdefkey.dll $(GAMEDIR)\nh340key.dll \
$(GAMEDIR)\nhraykey.dll
KEYDLLS = $(GAMEDIR)\nhdefkey.dll $(GAMEDIR)\nh340key.dll $(GAMEDIR)\nhraykey.dll
TILEUTIL16 = $(UTIL)\tile2bmp.exe
TILEBMP16 = $(SRC)\tiles.bmp
@@ -437,31 +353,109 @@ TILE_H = ..\win\share\tile.h
DATABASE = $(DAT)\data.base
#==========================================
#==========================================
# Setting up the compiler and linker
#==========================================
#==========================================
cc=cl
link=link
rc=Rc
# Before we get started, this section is used to determine the version of
# Visual Studio we are using. We set VSVER to 0000 to flag any version that
# is too old or untested.
#
#NMAKE version 1414264330 is distributed with VS 15.7.5
#!MESSAGE $(MAKEFLAGS)
#!MESSAGE $(MAKEDIR)
#!MESSAGE $(MAKE)
MAKEVERSION=$(_NMAKE_VER:.= )
MAKEVERSION=$(MAKEVERSION: =)
#!MESSAGE $(_NMAKE_VER)
#!MESSAGE $(MAKEVERSION)
VSNEWEST=2017
!IF ($(MAKEVERSION) < 1000000000)
VSVER=0000 #untested ancient version
!ELSEIF ($(MAKEVERSION) > 1000000000) && ($(MAKEVERSION) < 1100000000)
VSVER=2010
!ELSEIF ($(MAKEVERSION) > 1100000000) && ($(MAKEVERSION) < 1200000000)
VSVER=2012
!ELSEIF ($(MAKEVERSION) > 1200000000) && ($(MAKEVERSION) < 1400000000)
VSVER=2013
!ELSEIF ($(MAKEVERSION) > 1400000000) && ($(MAKEVERSION) < 1411000000)
VSVER=2015
!ELSEIF ($(MAKEVERSION) > 1411000000) && ($(MAKEVERSION) < 1414264331)
VSVER=$(VSNEWEST)
!ELSEIF ($(MAKEVERSION) > 1414264330)
VSVER=2999 #untested future version
!ENDIF
!IF ($(VSVER) >= 2012)
!MESSAGE Autodetected Visual Studio $(VSVER)
!ELSEIF ($(VSVER) == 2999
!MESSAGE The version of Visual Studio is newer than the most recent at
!MESSAGE the time this Makefile was crafted (Visual Studio $(VSNEWEST)).
!MESSAGE Because it is newer we'll proceed expecting that the
!MESSAGE VS$(VSNEWEST) processing will still work.
!ELSEIF ($(VSVER) == 0000)
!MESSAGE The version of Visual Studio appears to be quite old, older
!MESSAGE than VS2010 which is the oldest supported version by this
!MESSAGE Makefile, so we'll stop now.
!ERROR Untested old Visual Studio version with NMAKE $(_NMAKE_VER).
!ENDIF
!IF ($(VSVER) == 2010)
# For VS2010 use "setenv /x86" or "setenv /x64" before invoking make process
# DO NOT DELETE THE FOLLOWING LINE
!include <win32.mak>
! ENDIF
#These will be in the environment variables with one of the VS2017
#developer command prompts.
#VSCMD_ARG_HOST_ARCH=x64
#VSCMD_ARG_TGT_ARCH=x86
!IFDEF VSCMD_ARG_HOST_ARCH
!MESSAGE Host architecture is $(VSCMD_ARG_HOST_ARCH)
!MESSAGE Target architecture is $(VSCMD_ARG_TGT_ARCH)
! IFNDEF TARGET_CPU
! IF "$(VSCMD_ARG_TGT_ARCH)"=="x64"
TARGET_CPU=x64
! ELSE
TARGET_CPU=x86
! ENDIF
! ENDIF
!ENDIF
!IF "$(TARGET_CPU)" == ""
TARGET_CPU=x86
!ENDIF
!IF ($(VSVER) == 2010)
CL_RECENT=
!ELSE
! IF ($(VSVER) > 2010)
CL_RECENT=-sdl
! ENDIF
!ENDIF
#==========================================
# More compiler setup post-macros
#==========================================
#----------------------------------------------------------------
!IF "$(ADD_CURSES)" == "Y"
#CURSESDEF=-D"PDC_DLL_BUILD" -D"CURSES_GRAPHICS" -D"CURSES_BRIEF_INCLUDE"
CURSESDEF=-D"CURSES_GRAPHICS" -D"CURSES_BRIEF_INCLUDE"
CURSESINCL=..\win\curses
!ELSE
CURSDEF=
CURSESLIB=
CURSESINCL=
!ENDIF
!IFNDEF ADD_CURSES
INCLDIR= /I..\include /I..\sys\winnt
!ELSE
INCLDIR= /I..\include /I..\sys\winnt /I$(CURSESINCL)
!ENDIF
#===========================================
#---- start of Visual Studio Specific macros
#===========================================
ccommon= -c -nologo -D"_CONSOLE" -D"_CRT_NONSTDC_NO_DEPRECATE" -D"_CRT_SECURE_NO_DEPRECATE" \
-D"_LIB" -D"_SCL_SECURE_NO_DEPRECATE" -D"_VC80_UPGRADE=0x0600" -D"DLB" -D"_MBCS" \
-DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -D"NDEBUG" -D"YY_NO_UNISTD_H" $(CURSESDEF) \
@@ -531,6 +525,12 @@ conlibs = $(baselibs)
guilibs = $(winlibs)
#
!IFNDEF ADD_CURSES
INCLDIR= /I..\include /I..\sys\winnt
!ELSE
INCLDIR= /I..\include /I..\sys\winnt
!ENDIF
#==========================================
# Util builds
#==========================================
@@ -550,10 +550,6 @@ DLB = nhdat
DLB =
! ENDIF
#==========================================
#---- end of Visual Studio Specific macros
#==========================================
#==========================================
#================ RULES ==================
#==========================================
@@ -632,6 +628,9 @@ DLB =
{$(WCURSES)}.c{$(OBJ)}.o:
@$(cc) $(PDCINCL) $(cflagsBuild) -Fo$@ $<
#{$(WCURSES)}.txt{$(DAT)}.txt:
# @copy $< $@
#==========================================
# Rules for files in PDCurses
#==========================================
@@ -683,12 +682,10 @@ $(O)install.tag: $(DAT)\data $(DAT)\rumors $(DAT)\dungeon \
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
$(U)makedefs -c
-if not exist $(GAMEDIR)\defaults.nh copy fixed_defaults.nh $(GAMEDIR)\defaults.nh
-if not exist $(GAMEDIR)\defaults.nh copy $(MSWSYS)\defaults.nh $(GAMEDIR)\defaults.nh
-if not exist $(GAMEDIR)\record. goto>$(GAMEDIR)\record.
@if exist $(GAMEDIR)\NetHack.PDB echo NOTE: You may want to remove $(GAMEDIR:\=/)/NetHack.PDB to conserve space
@if exist $(GAMEDIR)\NetHackW.PDB echo NOTE: You may want to remove $(GAMEDIR:\=/)/NetHackW.PDB to conserve space
-if not exist $(GAMEDIR)\defaults.nh copy $(MSWSYS)\defaults.nh $(GAMEDIR)\defaults.nh
-if not exist $(GAMEDIR)\record. goto>$(GAMEDIR)\record.
echo install done > $@
# copy $(MSWSYS)\winnt.hlp $(GAMEDIR)
@@ -753,10 +750,10 @@ $(O)console.res: $(MSWSYS)\console.rc $(MSWSYS)\NetHack.ico
@$(rc) -r -fo$@ -i$(MSWSYS) -dNDEBUG $(MSWSYS)\console.rc
#==========================================================================
#==========================================
# The game targets.
#==========================================================================
#[VS-start] Visual C
#==========================================
# The section for linking the NetHack image looks a little strange at
# first, especially if you are used to UNIX makes, or NDMAKE. It is
# Microsoft nmake specific, and it gets around the problem of the
@@ -778,8 +775,6 @@ $(O)console.res: $(MSWSYS)\console.rc $(MSWSYS)\NetHack.ico
# with ^ as we have done below. Every occurence
# of a <tab> in $(ALLOBJ) is replaced by
# <+><return><tab>.
#[VS-end]
#==========================================================================
GAMEOBJ=$(ALLOBJ:^ =^
)
@@ -898,14 +893,20 @@ $(GAMEDIR)\nhraykey.dll : $(O)$(@B).o $(O)gamedir.tag $(O)$(@B).def
/PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).map" /DEF:$(O)$(@B).def \
/IMPLIB:$(O)$(@B).lib -out:$@ $(O)$(@B).o
#==========================================
#=========== SECONDARY TARGETS ============
#==========================================
#
# Secondary Targets.
#
#==========================================
# Makedefs Stuff
#==========================================
$(U)nhsizes.exe: $(O)nhsizes.o
@echo Linking $(@:\=/)
$(link) $(lflagsBuild) -out:$@ $(O)nhsizes.o $(O)panic.o $(O)alloc.o
$(O)nhsizes.o: $(CONFIG_H) nhsizes.c
@$(cc) $(cflagsBuild) -Fo$@ nhsizes.c
$(U)makedefs.exe: $(MAKEOBJS)
@echo Linking $(@:\=/)
@$(link) $(lflagsBuild) /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).MAP" -out:$@ $(MAKEOBJS)
@@ -1057,24 +1058,6 @@ $(U)dgncomp.exe: $(DGNCOMPOBJS)
)
<<
#=================================================
# For a couple of devteam utilities
#=================================================
$(U)nhsizes.exe: $(O)nhsizes.o
@echo Linking $(@:\=/)
$(link) $(lflagsBuild) -out:$@ $(O)nhsizes.o $(O)panic.o $(O)alloc.o
$(U)nhsizes2.exe: $(O)nhsizes2.o
@echo Linking $(@:\=/)
$(link) $(lflagsBuild) -out:$@ $(O)nhsizes2.o $(O)panic.o $(O)alloc.o
$(O)nhsizes.o: $(CONFIG_H) nhsizes.c
@$(cc) $(cflagsBuild) -Fo$@ nhsizes.c
$(O)nhsizes2.o: $(CONFIG_H) nhsizes2.c
@$(cc) $(cflagsBuild) -Fo$@ nhsizes2.c
#=================================================
# Create directory for holding object files
#=================================================
@@ -1084,6 +1067,34 @@ $(O)obj.tag:
@if not exist $(OBJ)\*.* mkdir $(OBJ)
@echo directory created >$@
#==========================================
# Notify of any CL environment variables
# in effect since they change the compiler
# options.
#==========================================
$(O)envchk.tag: $(O)obj.tag
! IF "$(TARGET_CPU)"=="x64"
@echo Windows x64 64-bit target build
! ELSE
@echo Windows x86 32-bit target build
! ENDIF
!IFDEF TTYOBJ
@echo tty window support included
! IF "$(ADD_CURSES)"=="Y"
@echo curses window support also included
! ENDIF
!ENDIF
! IF "$(CL)"!=""
# @echo Warning, the CL Environment variable is defined:
# @echo CL=$(CL)
! ENDIF
echo envchk >$@
#==========================================
#=========== SECONDARY TARGETS ============
#==========================================
#==========================================
# DLB utility and nhdat file creation
#==========================================
@@ -1244,40 +1255,19 @@ $(O)tile2bmp.o: $(WSHR)\tile2bmp.c $(HACK_H) $(TILE_H) $(MSWSYS)\win32api.h
$(O)til2bm32.o: $(WSHR)\tile2bmp.c $(HACK_H) $(TILE_H) $(MSWSYS)\win32api.h
@$(cc) $(cflagsBuild) -I$(WSHR) /DPACKED_FILE /DTILE_X=32 /DTILE_Y=32 /Fo$@ $(WSHR)\tile2bmp.c
#==========================================
# PDCurses Library
#==========================================
#===============================================================================
# PDCurses
#===============================================================================
$(O)pdcurses.lib : $(PDCLIBOBJS) $(PDCOBJS)
lib -nologo /out:$@ $(PDCLIBOBJS) $(PDCOBJS)
#==========================================
# Notify of any CL environment variables
# in effect since they change the compiler
# options.
#==========================================
$(O)pdcscrn.o : $(PDCURSES_HEADERS) $(PDCWINCON)\pdcscrn.c $(MSWSYS)\stub-pdcscrn.c
$(cc) $(PDCINCL) $(cflagsBuild) -Fo$@ $(MSWSYS)\stub-pdcscrn.c
$(O)envchk.tag: $(O)obj.tag
! IF "$(TARGET_CPU)"=="x64"
@echo Windows x64 64-bit target build
! ELSE
@echo Windows x86 32-bit target build
! ENDIF
!IFDEF TTYOBJ
@echo tty window support included
! IF "$(ADD_CURSES)"=="Y"
@echo curses window support also included
! ENDIF
!ENDIF
! IF "$(CL)"!=""
# @echo Warning, the CL Environment variable is defined:
# @echo CL=$(CL)
! ENDIF
echo envchk >$@
#==========================================
#===============================================================================
# Housekeeping
#==========================================
#===============================================================================
spotless: clean
! IF ("$(OBJ)"!="")
@@ -1370,7 +1360,6 @@ clean:
if exist $(U)dgncomp.exe del $(U)dgncomp.exe
if exist $(SRC)\*.lnk del $(SRC)\*.lnk
if exist $(SRC)\*.map del $(SRC)\*.map
if exist $(SRC)\fixed_defaults.nh del $(SRC)\fixed_defaults.nh
if exist $(O)install.tag del $(O)install.tag
if exist $(O)console.res del $(O)console.res
if exist $(O)dgncomp.MAP del $(O)dgncomp.MAP
@@ -1480,8 +1469,6 @@ $(O)winhack.o: $(HACK_H) $(MSWIN)\winhack.c
$(O)ttystub.o: $(HACK_H) $(MSWSYS)\stubs.c
@$(cc) $(cflagsBuild) -DTTYSTUB -Fo$@ $(MSWSYS)\stubs.c
$(O)tile.o: $(SRC)\tile.c $(HACK_H)
#
# util dependencies
#
@@ -1495,21 +1482,18 @@ $(O)panic.o: $(U)panic.c $(CONFIG_H)
(O)cppregex.o: $(O)cppregex.cpp $(HACK_H)
@$(CC) $(cflagsBuild) -Fo$@ ..\sys\share\cppregex.cpp
#
# Other dependencies needed by some ports
#
# curses window port dependencies
$(O)cursdial.o: $(WCURSES)\cursdial.c $(WCURSES)\cursdial.h $(INCL)\wincurs.h
$(O)cursinit.c: $(WCURSES)\cursinit.c $(WCURSES)\cursinit.h $(INCL)\wincurs.h
$(O)cursinvt.c: $(WCURSES)\cursinvt.c $(WCURSES)\cursinvt.h $(INCL)\wincurs.h
$(O)cursmain.c: $(WCURSES)\cursmain.c $(WCURSES)\cursmain.h $(INCL)\wincurs.h
$(O)cursmesg.c: $(WCURSES)\cursmesg.c $(WCURSES)\cursmesg.h $(INCL)\wincurs.h
$(O)cursmisc.c: $(WCURSES)\cursmisc.c $(WCURSES)\cursmisc.h $(INCL)\wincurs.h
$(O)cursstat.c: $(WCURSES)\cursstat.c $(WCURSES)\cursstat.h $(INCL)\wincurs.h
$(O)curswins.c: $(WCURSES)\curswins.c $(WCURSES)\curswins.h $(INCL)\wincurs.h
#
$(O)\cursdial.o: $(WCURSES)\cursdial.c $(WCURSES)\cursdial.h $(INCL)\wincurs.h
$(O)\cursinit.c: $(WCURSES)\cursinit.c $(WCURSES)\cursinit.h $(INCL)\wincurs.h
$(O)\cursinvt.c: $(WCURSES)\cursinvt.c $(WCURSES)\cursinvt.h $(INCL)\wincurs.h
$(O)\cursmain.c: $(WCURSES)\cursmain.c $(WCURSES)\cursmain.h $(INCL)\wincurs.h
$(O)\cursmesg.c: $(WCURSES)\cursmesg.c $(WCURSES)\cursmesg.h $(INCL)\wincurs.h
$(O)\cursmisc.c: $(WCURSES)\cursmisc.c $(WCURSES)\cursmisc.h $(INCL)\wincurs.h
$(O)\cursstat.c: $(WCURSES)\cursstat.c $(WCURSES)\cursstat.h $(INCL)\wincurs.h
$(O)\curswins.c: $(WCURSES)\curswins.c $(WCURSES)\curswins.h $(INCL)\wincurs.h
#
# The rest are stolen from sys/unix/Makefile.src,
# with the following changes:
@@ -1582,6 +1566,7 @@ $(O)wintext.o: ..\win\X11\wintext.c $(HACK_H) $(INCL)\winX.h $(INCL)\xwindow.h
@$(CC) $(cflagsBuild) -Fo$@ ..\win\X11\wintext.c
$(O)winval.o: ..\win\X11\winval.c $(HACK_H) $(INCL)\winX.h
@$(CC) $(cflagsBuild) -Fo$@ ..\win\X11\winval.c
$(O)tile.o: $(SRC)\tile.c $(HACK_H)
$(O)gnaskstr.o: ..\win\gnome\gnaskstr.c ..\win\gnome\gnaskstr.h \
..\win\gnome\gnmain.h
@$(CC) $(cflagsBuild) $(GNOMEINC) -Fo$@ ..\win\gnome\gnaskstr.c

View File

@@ -1889,7 +1889,7 @@ void nethack_enter_nttty()
error("Unable to load nhraykey.dll");
}
}
#endif TTY_GRAPHICS
#endif /* TTY_GRAPHICS */
/* this is used as a printf() replacement when the window
* system isn't initialized yet

15
sys/winnt/stub-pdcscrn.c Normal file
View File

@@ -0,0 +1,15 @@
/*
* Use this stub to insert a needed pragma prior
* to compiling $(PDCWINCON)\pdcscrn.c in the
* PDCurses distribution.
*
* We don't want to ask NetHack builders to
* modify the PDCurses distribution in any way,
* we only ask that they have the original intact
* PDCurses source tree available during the build.
*
*/
#pragma warning(disable : 4996)
#include "pdcscrn.c"

View File

@@ -7,7 +7,7 @@
#ifdef GUISTUB
#ifdef TTYSTUB
#error You can't compile this with both GUISTUB and TTYSTUB defined.
#error You cannot compile this with both GUISTUB and TTYSTUB defined.
#endif
int GUILaunched;
@@ -29,6 +29,7 @@ mswin_destroy_reg()
*/
#ifdef __MINGW32__
extern char default_window_sys[];
extern int mingw_main(int argc, char **argv);
int
main(argc, argv)
@@ -37,10 +38,7 @@ char *argv[];
{
boolean resuming;
sys_early_init();
Strcpy(default_window_sys, "tty");
resuming = pcmain(argc, argv);
moveloop(resuming);
resuming = mingw_main(argc, argv);
nethack_exit(EXIT_SUCCESS);
/*NOTREACHED*/
return 0;