diff --git a/.travis.yml b/.travis.yml index 7866ecd0b..8ccc6a525 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,16 +1,20 @@ language: c - -script: "cd sys/unix/ && sh setup.sh hints/$HINTS && cd ../../ && QT_SELECT=5 make MOC=moc install" - matrix: include: - - env: HINTS=linux + - os: linux + env: HINTS=linux compiler: gcc - - env: HINTS=linux + script: "cd sys/unix/ && sh setup.sh hints/$HINTS && cd ../../ && make install" + - os: linux + env: HINTS=linux compiler: clang - - env: HINTS=linux-x11 + script: "cd sys/unix/ && sh setup.sh hints/$HINTS && cd ../../ && make install" + - os: linux + env: HINTS=linux-x11 compiler: gcc - - env: HINTS=linux-qt5 + script: "cd sys/unix/ && sh setup.sh hints/$HINTS && cd ../../ && make install" + - os: linux + env: HINTS=linux-qt5 compiler: gcc addons: apt: @@ -18,7 +22,9 @@ matrix: - qtbase5-dev - qtmultimedia5-dev - qtbase5-dev-tools - - env: HINTS=linux-minimal + script: "cd sys/unix/ && sh setup.sh hints/$HINTS && cd ../../ && QT_SELECT=5 make MOC=moc install" + - os: linux + env: HINTS=linux-minimal compiler: gcc script: | cd sys/unix/ && sh setup.sh hints/$HINTS && cd ../../ @@ -43,10 +49,59 @@ matrix: sed -i 's/^#define TEXTCOLOR//' include/unixconf.h make install cat dat/options - + - os: windows + env: HINTS=windows-visual-studio + language: shell + script: +# - find /c/Program\ Files\ \(x86\) -iname 'rc.exe' -print +# - export + - export VSVER=2017 + - export MSVER=14.16.27023 + - export SDKVER=10.0.17763.0 + - export FRAMEVER=4.0.30319 + - export NETFXVER=4.6.1 + - export WKITVER=10.0.17134.0 +# - export TOOLSVER=Community + - export TOOLSVER=BuildTools + - export PATH=/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/$VSVER/$TOOLSVER/Common7/IDE/VC/VCPackages:$PATH + - export PATH=/c/Program\ Files\ \(x86\)/Windows\ Kits/10/bin/$WKITVER/x64:$PATH + - export PATH=/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/$VSVER/$TOOLSVER/VC/Tools/MSVC/$MSVER/bin/HostX64/x64:$PATH + - export PATH=/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/$VSVER/$TOOLSVER/VC/Tools/MSVC/$MSVER/bin/HostX64/x86:$PATH + - export PATH=$PATH:/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/$VSVER/$TOOLSVER/Common7/IDE/CommonExtensions/Microsoft/TestWindow + - export PATH=$PATH:/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/$VSVER/$TOOLSVER/MSBuild/Current/bin/Roslyn + - export INCLUDE=/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/2017/$TOOLSVER/VC/Tools/MSVC/$MSVER/include + - export INCLUDE=$INCLUDE:/c/Program\ Files\ \(x86\)/Windows\ Kits/10/Include/$WKITVER/ucrt + - export INCLUDE=$INCLUDE:/c/Program\ Files\ \(x86\)/Windows\ Kits/10/include/$WKITVER/ucrt + - export INCLUDE=$INCLUDE:/c/Program\ Files\ \(x86\)/Windows\ Kits/10/include/$WKITVER/shared + - export INCLUDE=$INCLUDE:/c/Program\ Files\ \(x86\)/Windows\ Kits/10/include/$WKITVER/um + - export INCLUDE=$INCLUDE:/c/Program\ Files\ \(x86\)/Windows\ Kits/10/include/$WKITVER/winrt + - export INCLUDE=$INCLUDE:/c/Program\ Files\ \(x86\)/Windows\ Kits/10/include/$WKITVER/cppwinrt + - export LIB=/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/$VSVER/$TOOLSVER/VC/Tools/MSVC/$MSVER/ATLMFC/lib/x86 + - export LIB=/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/$VSVER/$TOOLSVER/VC/Tools/MSVC/$MSVER/lib/x86:$LIB + - export LIB=/c/Program\ Files\ \(x86\)/Windows\ Kits/10/lib/$WKITVER/ucrt/x86:$LIB + - export LIB=/c/Program\ Files\ \(x86\)/Windows\ Kits/10/lib/$WKITVER/um/x86:$LIB +# - export + - cd src + - cp ../sys/winnt/Makefile.msc ./Makefile + - nmake install + - os: windows +# install: choco install mingw + env: HINTS=windows-mingw + script: + - cd src + - cp ../sys/winnt/Makefile.gcc ./Makefile + - mingw32-make install + exclude: + - os: osx + osx_image: xcode10.2 + env: HINTS=macosx10.14 + compiler: clang + script: "cd sys/unix/ && sh setup.sh hints/$HINTS && cd ../../ && make install" +# sudo: false - notifications: email: recipients: - - devteam@nethack.org +# - devteam@nethack.org + + diff --git a/doc/fixes36.3 b/doc/fixes36.3 index 5b177c06e..648ef6902 100644 --- a/doc/fixes36.3 +++ b/doc/fixes36.3 @@ -1,4 +1,4 @@ -$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.77 $ $NHDT-Date: 1561751390 2019/06/28 19:49:50 $ +$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.78 $ $NHDT-Date: 1561766416 2019/06/29 00:00:16 $ This fixes36.3 file is here to capture information about updates in the 3.6.x lineage following the release of 3.6.2 in May 2019. Please note, however, @@ -177,6 +177,9 @@ curses+'popup_dialog': show the text cursor at the end of prompts for single character input curses+EDIT_GETLIN: when a prompt's answer was preloaded, using ESC to discard it deleted it from the answer buffer but didn't erase it from screen +curses+EDIT_GETLIN: the preceding fix handled an answer which spanned more + than one line but didn't remove the answer properly if the prompt + portion of prompt+answer spanned more than one line tty: re-do one optimization used when status conditions have all been removed and remove another that tried to check whether condition text to be displayed next was the same as the existing value; sometimes new diff --git a/sys/winnt/Makefile.gcc b/sys/winnt/Makefile.gcc index 1f1272ab4..5fd3181da 100644 --- a/sys/winnt/Makefile.gcc +++ b/sys/winnt/Makefile.gcc @@ -138,6 +138,13 @@ SKIP_NETHACKW=Y #============================================================================== +# The version of the game this Makefile was designed for +NETHACK_VERSION="3.6.3" + +# A brief version for use in macros +NHV1=$(subst .,,$(NETHACK_VERSION)) +NHV=$(subst ",,$(NHV1)) + # # Source directories. Makedefs hardcodes these, don't change them. # @@ -336,7 +343,7 @@ ifneq "$(SKIP_NETHACKW)" "Y" GUIOBJ = $(O)mhaskyn.o $(O)mhdlg.o \ $(O)mhfont.o $(O)mhinput.o $(O)mhmain.o $(O)mhmap.o \ $(O)mhmenu.o $(O)mhmsgwnd.o $(O)mhrip.o $(O)mhsplash.o \ - $(O)mhstatus.o $(O)mhtext.o $(O)mswproc.o $(O)winhack.o + $(O)mhstatus.o $(O)mhtext.o $(O)mswproc.o $(O)NetHackW.o endif @@ -475,10 +482,18 @@ endif #========================================== #========================================== +ifndef TRAVIS_COMPILER cc = i686-w64-mingw32-gcc.exe cxx = g++ rc = windres link = i686-w64-mingw32-gcc.exe +else +cc = gcc +cxx = g++ +rc = windres +link = gcc +endif + ifeq "$(WANT_WIN_QT4)" "Y" link = g++ endif @@ -547,7 +562,7 @@ lflags = $(LFLAGSBASEC) $(linkdebuf) CXXFLAGS = $(CFLAGS) ifeq "$(USE_DLB)" "Y" -DLB = nhdat +DLB = nhdat$(NHV) else DLB = endif @@ -620,11 +635,11 @@ $(OBJ)/%.o : $(MSWIN)/%.c $(cc) $(CFLAGS) -o$@ $< #========================================== -# Rules for files in win\curses +# Rules for files in win/curses #========================================== $(OBJ)/%.o : $(WCURSES)/%.c - $(cc) $(PDCINCL) $(CFLAGS) -o$@ $< + $(cc) -DPDC_NCMOUSE $(PDCINCL) $(CFLAGS) -o$@ $< #========================================== # Rules for files in PDCurses @@ -728,16 +743,20 @@ default : install all : install -install: initialchk $(GAMEDIR)/NetHack.exe $(U)uudecode.exe $(O)winres.o \ - $(NETHACKW_EXE) install.tag $(EXTRA_FILES) +install: initialchk $(O)utility.tag $(GAMEDIR)/NetHack.exe $(NETHACKW_EXE) \ + $(O)install.tag $(EXTRA_FILES) @echo NetHack is up to date. @echo Done. - -install.tag: $(DAT)/data $(DAT)/rumors $(DAT)/dungeon \ - $(DAT)/oracles $(DAT)/quest.dat sp_lev.tag $(DLB) +$(O)install.tag: $(DAT)/data $(DAT)/rumors $(DAT)/dungeon \ + $(DAT)/oracles $(DAT)/quest.dat $(O)sp_lev.tag $(DLB) +ifdef TRAVIS_COMPILER + ls -l $(SRC) + ls -l $(DAT) + ls -l $(UTIL) +endif ifeq "$(USE_DLB)" "Y" - $(subst /,\,copy nhdat $(GAMEDIR)) + $(subst /,\,copy nhdat$(NHV) $(GAMEDIR)) $(subst /,\,copy $(DAT)/license $(GAMEDIR)) $(subst /,\,copy $(DAT)/opthelp $(GAMEDIR)) else @@ -762,7 +781,7 @@ recover: $(U)recover.exe $(subst /,\,if exist $(U)recover.exe copy $(U)recover.exe $(GAMEDIR)) $(subst /,\,if exist $(DOC)/recover.txt copy $(DOC)/recover.txt $(GAMEDIR)/recover.txt) -sp_lev.tag: utility.tag $(DAT)/bigroom.des $(DAT)/castle.des \ +$(O)sp_lev.tag: $(O)utility.tag $(DAT)/bigroom.des $(DAT)/castle.des \ $(DAT)/endgame.des $(DAT)/gehennom.des $(DAT)/knox.des \ $(DAT)/medusa.des $(DAT)/oracle.des $(DAT)/tower.des \ $(DAT)/yendor.des $(DAT)/arch.des $(DAT)/barb.des \ @@ -796,9 +815,9 @@ sp_lev.tag: utility.tag $(DAT)/bigroom.des $(DAT)/castle.des \ $(subst /,\,$(U)levcomp $(DAT)/wizard.des) $(subst /,\,copy *.lev $(DAT)) $(subst /,\,del *.lev) - $(subst /,\,echo sp_levs done > sp_lev.tag) + $(subst /,\,echo sp_levs done > $(O)sp_lev.tag) -utility.tag: $(INCL)/date.h $(INCL)/onames.h $(INCL)/pm.h \ +$(O)utility.tag: $(INCL)/date.h $(INCL)/onames.h $(INCL)/pm.h \ $(SRC)/vis_tab.c $(U)levcomp.exe $(INCL)/vis_tab.h \ $(U)dgncomp.exe $(TILEUTIL16) $(subst /,\,@echo utilities made >$@) @@ -807,11 +826,11 @@ utility.tag: $(INCL)/date.h $(INCL)/onames.h $(INCL)/pm.h \ tileutil: $(U)gif2txt.exe $(U)gif2tx32.exe $(U)txt2ppm.exe @echo Optional tile development utilities are up to date. -$(O)winres.o: $(TILEBMP16) $(MSWIN)/winhack.rc $(MSWIN)/mnsel.bmp \ +$(O)winres.o: $(TILEBMP16) $(MSWIN)/NetHackW.rc $(MSWIN)/mnsel.bmp \ $(MSWIN)/mnselcnt.bmp $(MSWIN)/mnunsel.bmp \ $(MSWIN)/petmark.bmp $(MSWIN)/pilemark.bmp $(MSWIN)/NetHack.ico $(MSWIN)/rip.bmp \ $(MSWIN)/splash.bmp - $(rc) -o$@ --include-dir $(MSWIN) -i $(MSWIN)/winhack.rc + $(rc) -o$@ --include-dir $(MSWIN) -i $(MSWIN)/NetHackW.rc $(O)conres.o: $(MSWSYS)/console.rc $(MSWSYS)/NetHack.ico $(rc) -o$@ --include-dir $(MSWSYS) -i $(MSWSYS)/console.rc @@ -830,7 +849,7 @@ $(GAMEDIR)/NetHack.exe : gamedir.tag $(PDCLIB) $(O)tile.o $(O)nttty.o $(O)guistu @echo Linking $@... $(link) $(lflags) -o$@ $(ALLOBJ) $(TTYOBJ) $(O)nttty.o $(O)tile.o \ $(O)guistub.o $(O)conres.o $(PDCLIB) $(conlibs) -static -lstdc++ - $(subst /,\,@if exist install.tag del install.tag) + $(subst /,\,@if exist $(O)install.tag del $(O)install.tag) # NetHackW # full tty linkage libs: @@ -846,7 +865,7 @@ $(GAMEDIR)/NetHackW.exe : gamedir.tag $(PDCLIB) $(O)tile.o $(O)ttystub.o \ @echo Linking $@... $(link) $(lflags) -mwindows -o$@ $(ALLOBJ) $(GUIOBJ) $(O)tile.o $(O)ttystub.o \ $(O)winres.o $(PDCLIB) $(guilibs) -static -lstdc++ - $(subst /,\,@if exist install.tag del install.tag) + $(subst /,\,@if exist $(O)install.tag del $(O)install.tag) endif $(O)nhdefkey.o: @@ -926,16 +945,16 @@ $(INCL)/vis_tab.h: $(U)makedefs.exe $(SRC)/vis_tab.c: $(U)makedefs.exe $(subst /,\,$(U)makedefs -z) -$(DAT)/data: utility.tag $(DATABASE) +$(DAT)/data: $(O)utility.tag $(DATABASE) $(subst /,\,$(U)makedefs -d) -$(DAT)/rumors: utility.tag $(DAT)/rumors.tru $(DAT)/rumors.fal +$(DAT)/rumors: $(O)utility.tag $(DAT)/rumors.tru $(DAT)/rumors.fal $(subst /,\,$(U)makedefs -r) -$(DAT)/quest.dat: utility.tag $(DAT)/quest.txt +$(DAT)/quest.dat: $(O)utility.tag $(DAT)/quest.txt $(subst /,\,$(U)makedefs -q) -$(DAT)/oracles: utility.tag $(DAT)/oracles.txt +$(DAT)/oracles: $(O)utility.tag $(DAT)/oracles.txt $(subst /,\,$(U)makedefs -h) $(DAT)/engrave: $(DAT)/engrave.txt $(U)makedefs.exe @@ -947,7 +966,7 @@ $(DAT)/epitaph: $(DAT)/epitaph.txt $(U)makedefs.exe $(DAT)/bogusmon: $(DAT)/bogusmon.txt $(U)makedefs.exe $(subst /,\,$(U)makedefs -s) -$(DAT)/dungeon: utility.tag $(DAT)/dungeon.def +$(DAT)/dungeon: $(O)utility.tag $(DAT)/dungeon.def $(subst /,\,$(U)makedefs -e) $(subst /,\,$(U)dgncomp $(DAT)/dungeon.pdf) @@ -1099,10 +1118,11 @@ $(O)dlb_main.o: $(UTIL)/dlb_main.c $(INCL)/config.h $(INCL)/dlb.h $(DAT)/porthelp: $(MSWSYS)/porthelp $(subst /,\,@copy $(MSWSYS)/porthelp $@ >nul) -nhdat: $(U)dlb_main.exe $(DAT)/data $(DAT)/oracles $(OPTIONS_FILE) \ +nhdat$(NHV): $(U)dlb_main.exe $(DAT)/data $(DAT)/oracles $(OPTIONS_FILE) \ $(DAT)/quest.dat $(DAT)/rumors $(DAT)/help $(DAT)/hh $(DAT)/cmdhelp $(DAT)/keyhelp \ $(DAT)/history $(DAT)/opthelp $(DAT)/wizhelp $(DAT)/dungeon \ - $(DAT)/porthelp $(DAT)/license $(DAT)/engrave $(DAT)/epitaph $(DAT)/bogusmon $(DAT)/tribute sp_lev.tag + $(DAT)/porthelp $(DAT)/license $(DAT)/engrave \ + $(DAT)/epitaph $(DAT)/bogusmon $(DAT)/tribute $(O)sp_lev.tag $(subst /,\,echo data >$(DAT)/dlb.lst) $(subst /,\,echo oracles >>$(DAT)/dlb.lst) $(subst /,\,if exist $(DAT)/options echo options >>$(DAT)/dlb.lst) @@ -1235,13 +1255,13 @@ ifneq "$(W_GAMEDIR)" "" if exist $(W_GAMEDIR)\nhraykey.dll del $(W_GAMEDIR)\nhraykey.dll if exist $(W_GAMEDIR)\NetHack.exe del $(W_GAMEDIR)\NetHack.exe if exist $(W_GAMEDIR)\NetHack.pdb del $(W_GAMEDIR)\NetHack.pdb - if exist $(W_GAMEDIR)\nhdat del $(W_GAMEDIR)\nhdat + if exist $(W_GAMEDIR)\nhdat$(NHV) del $(W_GAMEDIR)\nhdat$(NHV) endif ifneq "$(W_SRC)" "" if exist $(W_SRC)\vis_tab.c del $(W_SRC)\vis_tab.c if exist $(W_SRC)\tile.c del $(W_SRC)\tile.c if exist $(W_SRC)\vis_tab.c del $(W_SRC)\vis_tab.c - if exist nhdat. del nhdat. + if exist $(W_SRC)\nhdat$(NHV). del $(W_SRC)\nhdat$(NHV). endif ifneq "$(W_DAT)" "" if exist $(W_DAT)\data del $(W_DAT)\data @@ -1334,8 +1354,8 @@ endif clean: if exist initialchk del initialchk - if exist install.tag del install.tag - if exist utility.tag del utility.tag + if exist $(O)install.tag del $(O)install.tag + if exist $(O)utility.tag del $(O)utility.tag ifneq "$(W_UTIL)" "" if exist $(W_UTIL)\makedefs.exe del $(W_UTIL)\makedefs.exe if exist $(W_UTIL)\levcomp.exe del $(W_UTIL)\levcomp.exe @@ -1392,8 +1412,8 @@ endif $(subst /,\,if exist $(TILEBMP32) del $(TILEBMP32)) #clean: -# -test -f install.tag && del install.tag -# -test -f utility.tag && del utility.tag +# -test -f $(O)install.tag && del $(O)install.tag +# -test -f $(O)utility.tag && del $(O)utility.tag # -test -f $(U)makedefs.exe && del $(U)makedefs.exe # -test -f $(U)levcomp.exe && del $(U)levcomp.exe # -test -f $(U)dgncomp.exe && del $(U)dgncomp.exe diff --git a/sys/winnt/Makefile.msc b/sys/winnt/Makefile.msc index 0038e12ab..7954b30c2 100644 --- a/sys/winnt/Makefile.msc +++ b/sys/winnt/Makefile.msc @@ -379,6 +379,7 @@ TSRC = $(SRC:\=/) cc=cl +cpp=cpp link=link rc=Rc @@ -596,7 +597,7 @@ DLB = @$(cc) $(cflagsBuild) -Fo$@ $< {$(SSYS)}.cpp{$(OBJ)}.o: - @$(CC) $(cflagsBuild) /EHsc -Fo$@ $< + @$(cc) $(cflagsBuild) /EHsc -Fo$@ $< #========================================== # Rules for files in sys\winnt @@ -648,8 +649,7 @@ DLB = #========================================== {$(WCURSES)}.c{$(OBJ)}.o: - @$(cc) -DPDC_NCMOUSE -DCURSES_DEFINE_ERASE_CHAR \ - $(PDCINCL) $(cflagsBuild) -Fo$@ $< + @$(cc) -DPDC_NCMOUSE $(PDCINCL) $(cflagsBuild) -Fo$@ $< #{$(WCURSES)}.txt{$(DAT)}.txt: # @copy $< $@ @@ -852,7 +852,6 @@ $(GAMEDIR)\NetHackW.exe : $(O)gamedir.tag $(O)tile.o $(O)ttystub.o \ $(O)ttystub.o $(O)NetHackW.res << - @if exist $(O)install.tag del $(O)install.tag $(O)gamedir.tag: @if not exist $(GAMEDIR)\*.* echo creating directory $(GAMEDIR:\=/) diff --git a/sys/winnt/stubs.c b/sys/winnt/stubs.c index ea38e3a57..ca7313b5b 100644 --- a/sys/winnt/stubs.c +++ b/sys/winnt/stubs.c @@ -64,6 +64,9 @@ HANDLE hConIn; HANDLE hConOut; int GUILaunched; struct window_procs tty_procs = { "-ttystubs" }; +#ifdef CURSES_GRAPHICS +char erase_char, kill_char; +#endif void win_tty_init(dir) diff --git a/win/curses/cursmesg.c b/win/curses/cursmesg.c index b0a28b15b..0e67787a0 100644 --- a/win/curses/cursmesg.c +++ b/win/curses/cursmesg.c @@ -550,12 +550,13 @@ curses_message_win_getline(const char *prompt, char *answer, int buffer) if that is called for; find where the end of the prompt will be without the answer appended */ while (ltmp2 > 0) { - ltmp2 -= ltmp; + if ((ltmp2 -= ltmp) < 0) { + ltmp = -ltmp2; + break; + } promptline -= 1; - ltmp = (int) strlen(linestarts[promptline]); + ltmp = linestarts[promptline + 1] - linestarts[promptline]; } - if (ltmp2 < 0) - ltmp = -ltmp2; promptx = ltmp + border_space; } #endif @@ -597,11 +598,11 @@ curses_message_win_getline(const char *prompt, char *answer, int buffer) #endif curs_set(0); - if (erase_char && ch == erase_char) { + if (erase_char && ch == (int) (uchar) erase_char) { ch = '\177'; /* match switch-case below */ /* honor kill_char if it's ^U or similar, but not if it's '@' */ - } else if (kill_char && ch == kill_char + } else if (kill_char && ch == (int) (uchar) kill_char && (ch < ' ' || ch >= '\177')) { /*ASCII*/ if (len == 0) /* nothing to kill; just start over */ continue;