Commit Graph

1078 Commits

Author SHA1 Message Date
Bart House
6ae5931a63 Updateda PDCurses Visual Studio project to latest PDCurses content. 2018-12-15 19:52:58 -08:00
Bart House
3af29b4f26 Merge branch 'win-minor' of https://rodney.nethack.org:20040/git/NHsource into win-minor 2018-12-15 17:35:43 -08:00
Bart House
6cec6a88a5 Added PDCurses project to VS 2017 build. 2018-12-15 17:35:27 -08:00
nhmall
718c029994 Merge branch 'win-minor' into NetHack-3.6.2-beta01 2018-12-15 19:34:56 -05:00
nhmall
902f76d1fa more win32 gui fuzzer work 2018-12-15 19:31:42 -05:00
PatR
594cb5f226 tty SIGHUP
We still don't know whether this will be of any help against
disconnected processes that hog the CPU instead of exiting, but I
don't think it imposes significant overhead on ones which aren't
disconnected.  Install it before it suffers from more bit rot.
2018-12-15 16:24:59 -08:00
Bart House
d77545128b Merge branch 'win-minor' of https://rodney.nethack.org:20040/git/NHsource into win-minor 2018-12-15 14:50:14 -08:00
Bart House
266b5e3891 Small improvements to fuzzer for NetHackW.
Can toggle fuzzer on/off using "Pause" key if attached to debugger.
Extended command selected randomly.
2018-12-15 14:49:59 -08:00
nhmall
56051e0b9b Merge branch 'NetHack-3.6.2-beta01' into win-minor 2018-12-14 23:11:37 -05:00
nhmall
16cda0882c fix up PDCurses cursor placement for prompts 2018-12-14 23:08:41 -05:00
PatR
436f8a9fde tty status condition: Cf, Hl, Rd
While the fuzzer was running, amidst the continual screen updating I
caught a glimpse of "Cn" and was puzzled about how the hero became
cancelled.  I quickly realized it actually meant confused, but I
think "Cf" is a better abbreviation for that.  I've also changed "Ha"
to "Hl" for hallucination and "Ri" to "Rd" for riding.  The rest is
formatting.
2018-12-14 18:51:07 -08:00
PatR
cf7536b167 random_response() buffer overflow
'sz' is the size of the buffer; 'if (count < sz) buf[count++] = c;'
can fill the entire buffer, leaving count==sz, so buf[count] = '\0';
would be out of bounds.

Formatting was way off.  Indentation these days should be multiples
of 4 spaces, never tabs.
2018-12-13 02:12:31 -08:00
Bart House
0cd50847fb Changes to get fuzzer working in NetHackW. 2018-12-12 21:46:14 -08:00
Bart House
ce7c9d5077 Terminal font when not fitting to screen. Consolas for fit to screen. 2018-12-11 20:52:07 -08:00
Bart House
1aec267c09 NetHackW default font changed from "Terminal" to "Courier New" 2018-12-09 14:06:25 -08:00
Bart House
a8d5f49837 Merge branch 'win-minor' into win-fontmap
# Conflicts:
#	win/win32/mhmap.c
2018-12-09 14:02:57 -08:00
Bart House
88bbf781d1 Three fixes to NetHackW font handling.
Check that player level is valid before checking if it is rogue.
Prevent attempting to pick a font that is too small.
Don't leak fonts when trying to find a font that fits.
2018-12-09 11:57:50 -08:00
Bart House
fccc3cbee6 Render the two block glyphs using FillRect instead of DrawText. 2018-12-09 11:30:29 -08:00
nhmall
46d2724f58 some early startup adjustments 2018-12-09 13:09:30 -05:00
nhmall
afc34d3016 a late bot() call was observed on GUI Windows so prevent such a crash 2018-12-08 22:08:55 -05:00
nhmall
01625455d9 more startup tweaking for Windows 2018-12-08 21:17:34 -05:00
nhmall
547f0a32cc Update Visual Studio projects to reflect recent change 2018-12-08 20:24:24 -05:00
nhmall
a9342107c8 relocate safeproc.c from sys/share to win/share 2018-12-08 20:09:58 -05:00
nhmall
dc1e2da359 Windows startup modifications
Changes to be committed:
	modified:   include/winprocs.h
	modified:   src/options.c
	modified:   sys/share/pcmain.c
	new file:   sys/share/safeproc.c
	modified:   sys/winnt/Makefile.msc
	modified:   sys/winnt/stubs.c
	new file:   sys/winnt/windmain.c
	modified:   sys/winnt/winnt.c
	modified:   win/win32/vs2017/NetHack.vcxproj
	modified:   win/win32/vs2017/NetHackW.vcxproj
	modified:   win/win32/winhack.c

Because multiple window ports are supported on Windows
now, even in the same executable and selectable via
config file in some cases, some adjustments became
necessary. There will likely be some further refining
of this over the next day or two.

List of changes:

Move Windows startup from sys/share/pcmain.c and
into its own sys/winnt/windmain.c so that it can
be modified to fix some current breakage, and
allow altering the order of some things.

There is startup processing code that is common to
all of the Windows WindowPorts, but that startup
processing code needs to have no dependency on
any one of those WindowPorts.

Yet, during startup processing, some of the initialization
routines can end up calling NetHack functions that
expect an active Window port underneath, and if there
isn't one, routines like pline, impossible, panic can
end up invoking null function pointers.

Place a new file sys/share/safeproc.c, in which a complete
window port is available for early startup processing
purposes. It's WindowPort name field is set to
"safe-startup" just for reference.  The prototypes in
include/winprocs.h require that SAFEPROCS be

Usage:

 windowprocs = get_safe_procs(0);
initializes a set of winprocs function pointers that ensure
none of the function pointers are left null, but that's all it does.

 windowprocs = get_safe_procs(1);
initializes a set of winprocs functions pointers that ensure
none of the function pointers are left null, but also
provides some basic output and input functionality using nothing
other than C stdio routines (no platform or OS specific code).

The conditional code related to WIN32 has been removed from
sys/share/pcmain.c

The code common to all of the Windows WindowPorts calls
get_safe_procs() almost immediately to ensure that
there is a set of WindowPort winprocs available.
2018-12-08 17:56:20 -05:00
Pasi Kallinen
8319227b55 Clear the getlin buffer
Recent change to this bit of code didn't clear the buffer,
which causes garbage in the string if compiled with EDIT_GETLIN
2018-12-07 22:18:53 +02:00
nhmall
1baa20dfc5 header update on cursstat.c 2018-12-05 23:43:59 -05:00
nhmall
c4930c6782 update header on curswins 2018-12-05 17:45:40 -05:00
nhmall
9c873712b6 update header on cursstat 2018-12-05 17:45:15 -05:00
nhmall
2458281d42 update header on cursmisc 2018-12-05 17:44:08 -05:00
nhmall
c260911f38 update header on cursmesg 2018-12-05 17:43:33 -05:00
nhmall
661ffb0133 update header on cursmain 2018-12-05 17:42:49 -05:00
nhmall
86281c5555 update header on cursinvt 2018-12-05 17:42:11 -05:00
nhmall
14335ea90c update header on cursinit 2018-12-05 17:41:30 -05:00
nhmall
c258f9c3f8 update header on cursdial 2018-12-05 17:40:33 -05:00
PatR
f2195c1212 more !SHELL, !SUSPEND
Update tty command completion to ignore #shell and #suspend when
they're disabled.  (Since they aren't flagged for command completion,
this should be unnoticeable.)

Update X11 extended command selection to not show shell and suspend
in the menu when they're disabled.  (Trickier than I expected.)

X11 currently rejects #suspend (at run time, not compile time) but
allows #shell.  If it was launched syncronously from a terminal
window, shell escape behaves sanely.  Otherwise, that seems like
asking for trouble.
2018-12-03 01:46:01 -08:00
Bart House
06fba14091 Merge branch 'win-minor' of https://rodney.nethack.org:20040/git/NHsource into win-minor 2018-12-02 20:23:03 -08:00
Bart House
f081e53876 Fix for NetHackW.exe menu icon rendering. 2018-12-02 20:22:47 -08:00
nhmall
5d9c172497 Merge branch 'win-minor' into NetHack-3.6.2-beta01 2018-12-02 21:26:54 -05:00
Bart House
92612b8f0c Added some missing header files to VS2017 NetHackW project. 2018-12-02 18:15:02 -08:00
Bart House
f3dcdc7fda Splash dialog and main window handle dpi change notifications. 2018-12-02 18:09:34 -08:00
nhmall
7e9bc20c3a Merge branch 'win-minor' into NetHack-3.6.2-beta01 2018-12-02 19:42:12 -05:00
nhmall
6fe706f274 'curses_display_nhmenu' should return a value
Caught by automated build test

../win/curses/cursdial.c:598:9: error: non-void function 'curses_display_nhmenu' should return a value [-Wreturn-type]
        return;
        ^
../win/curses/cursdial.c:605:9: error: non-void function 'curses_display_nhmenu' should return a value [-Wreturn-type]
        return;
2018-12-02 18:47:23 -05:00
Bart House
796bdce828 Update comment within mswin_status_string. 2018-12-02 13:35:48 -08:00
Bart House
6ee48481b1 Respect BL_FLUSH and BL_RESET indications to mswin_status_update. 2018-12-02 13:33:07 -08:00
Bart House
0f679b3109 NetHackW status hilite support improved to include support for attributes. 2018-12-02 13:25:03 -08:00
nhmall
a9ff2a296a remove slipped-in partial bits from another feature
Some bits from another feature by Tangles had
slipped into our merge of curses a while back.

Remove the partial bits as feature bits should
be complete or not at all, unless foundational
for something to come.
2018-12-02 11:54:42 -05:00
Tangles
7c025fc344 curses - reinstate guicolors 2018-12-02 11:22:54 -05:00
Tangles
c3ecb5c43d curses - don't use popup for count selection.
There are issues with dismissing the popup afterwards.  These
were not really investigated as a count-selection doesn't really
warrant a popup anyway.
2018-12-02 11:20:46 -05:00
Tangles
2af7a74b7d curses - fix hero turning into # when selecting a count of items.
Why was that line in there anyway?
2018-12-02 11:20:21 -05:00
Tangles
69d9a7a51b curses - don't autocomplete wiz cmds except in wizmode 2018-12-02 11:19:56 -05:00