Commit Graph

1201 Commits

Author SHA1 Message Date
nhmall
a9342107c8 relocate safeproc.c from sys/share to win/share 2018-12-08 20:09:58 -05:00
nhmall
b853c6a75b Makefile.msc update 2018-12-08 18:45:48 -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
nhmall
dc2539701a Revert "some fixes provided from Hardfought"
This reverts commit ab9e28d1aa.
2018-12-04 11:59:41 -05:00
nhmall
ab9e28d1aa some fixes provided from Hardfought 2018-12-04 11:58:05 -05:00
Bart House
f3dcdc7fda Splash dialog and main window handle dpi change notifications. 2018-12-02 18:09:34 -08:00
nhmall
4a4b3fb8f1 add a macro to ease conditional testing based on active window port
Add WINDOWPORT macro

example:
if (WINDOWPORT("tty"))
	pline("Look at me, I'm on tty at the moment!");
2018-12-02 09:56:44 -05:00
nhmall
37b5e0e479 make curses commented out by default (again) 2018-12-01 11:31:08 -05:00
nhmall
802c22ed98 more gcc work for Windows
tty builds and executes
curses builds but crashes

gui - not even trying right now
2018-11-30 20:17:42 -05:00
nhmall
c0897f2f0d more Windows Makefile synch and gcc Makefile updates
The gcc-built tty version builds fully now, but it won't play.

The GUI version definitely does not build right now.
2018-11-30 18:44:37 -05:00
nhmall
8a9f98f179 curses follow-up bits
Move the curses global variable defininitions to cursmain.c.

Make the references to those global variables extern in
include/wincurs.h

Get rid of a warning:
../win/curses/cursmesg.c:379:9: warning: declaration shadows a
variable in the global scope [-Wshadow] int orig_cursor = curs_set(0);

Kludge for Visual Studio compiler: Add a stub- file for use
in Windows curses port builds to ensure that a needed #pragma
is invoked prior to compiling the file pdcscrn.c in the
PDCurses source distribution. All command line options and
compile of the file. It is unreasonable to expect a NetHack
builder to have to tinker with the PDCurses source files in
order to build NetHack. This kludge means the NetHack builder
doesn't have to.
The file stub-pdcscrn.c contains only two lines:
	#pragma warning(disable : 4996)
	#include "pdcscrn.c"
Some day, if the PDCurses sources corrects the issue, this
can go away.
2018-11-30 16:00:24 -05:00
nhmall
ad838f2236 typos 2018-11-29 22:37:54 -05:00
nhmall
7495d0f2f4 more Windows gcc cleanup
Still not finished
2018-11-29 22:32:36 -05:00
nhmall
2a2107c3a4 Merge branch 'NetHack-3.6.2-beta01' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.6.2-beta01 2018-11-29 22:23:58 -05:00
nhmall
3811845dbf more Makefile.gcc work
Still not completed
2018-11-29 22:23:17 -05:00
PatR
bb8ba53ed9 vms/Makefile.src
Catch up with recent changes to vmsbuild.com and unix/Makefile.src.
2018-11-29 18:45:37 -08:00
nhmall
5049d23ce0 make some progress on mingw build
Still not quite there yet though.
Focusing on tty (maybe curses) right now.

The gui has had significant code deviation from
prior gcc builds for windows and will take more
work.
2018-11-29 20:59:03 -05:00
nhmall
d45b8e4fb3 More Makefiles 2018-11-29 17:41:20 -05:00
nhmall
5f02f2455b more Makefile for Windows 2018-11-29 16:36:07 -05:00
nhmall
f2da47a347 Windows Makefile updates (first batch) 2018-11-29 16:27:02 -05:00
nhmall
c52fc366a0 not everyone has PDCurses so re-comment it in the official sources 2018-11-29 00:15:34 -05:00
nhmall
0ab9e7d087 Merge branch 'win-minor' into NetHack-3.6.2-beta01 2018-11-29 00:08:09 -05:00
Bart House
22af9a3bbf Adding manifest to NetHackW.exe in nmake build. 2018-11-28 21:06:39 -08:00
nhmall
3634d16582 fix nethackw start without arguments
The Windows graphical version in NetHackW.exe is meant to lock
itself to its own windowtype and ignore the OPTIONS=windowtype
setting in the config file, but the code to perform the lock
only did so if (argc > 1).
2018-11-28 23:29:28 -05:00
nhmall
ec1f3d3f57 bring ms and gcc Makefiles into better alignment
Makefile.msc has been tested.
Makefile.gcc has not been tested yet.
2018-11-28 19:47:58 -05:00
PatR
a8fe565912 'make depend' update for unix/Makefile.src
The dependency for pcmain.o is different from depend.awk generates
so re-running 'make depend' after this will think another change is
needed.
2018-11-28 15:23:02 -08:00
Pasi Kallinen
9e6ba48dbd Typofix 2018-11-28 15:59:48 +02:00
nhmall
e9b2f47e62 add a comment to sample config file showing how to enable curses 2018-11-28 08:43:05 -05:00
nhmall
478b53b4c2 Merge branch 'mouse_support' into NetHack-3.6.2-beta01 2018-11-27 22:58:42 -05:00
nhmall
d18bf800ae expand mouse_support to three values rather than boolean
On Windows only:
   0 = turn off mouse_support
   1 = turn on mouse_support and turn off QuickEdit mode
   2 = turn on mouse_support and leave QuickEdit mode untouched

More generally, but not implemented anywhere:
   0 = turn off mouse_support
   1 = turn on mouse_support and make supporting O/S adjustments
       (O/S adjustments not implented beyond Windows as yet)
   2 = turn on mouse_support and do not make OS adjustments
       (unimplemented as yet so behaves as 1)
2018-11-27 22:15:34 -05:00
PatR
b1f1594fbd updated sys/share/lev_comp.h, lev_{lex,yacc}.c
dgn_comp isn't affected.
2018-11-27 18:42:47 -08:00
Bart House
f38dc942c0 Macosx post install script fix to avoid changing save games owner to root. 2018-11-26 22:47:51 -08:00
Bart House
7d3103ad9d Merge branch 'NetHack-3.6.2-beta01' into macosx-minor 2018-11-26 22:45:22 -08:00
nhmall
03e6c26af6 adjust sample config file when STATUS_HILITES isn't defined
On Windows, if you build without STATUS_HILITES defined,
you'll be greeted by the following barrage of errors when
you start the game.

On Windows, use makedefs to detect that STATUS_HILITES
isn't defined, and comment out the offending lines in
the sample config file.

Errors received before this change:

OPTIONS=statushilites
  * Line 197: 'statushilites' is not supported.

 OPTIONS=hilite_status:hitpoints/100%/gray&normal
  * Line 200: 'hilite_status' is not supported.

 OPTIONS=hilite_status:hitpoints/<100%/green&normal
  * Line 201: 'hilite_status' is not supported.

 OPTIONS=hilite_status:hitpoints/<66%/yellow&normal
  * Line 202: 'hilite_status' is not supported.

 OPTIONS=hilite_status:hitpoints/<50%/orange&normal
  * Line 203: 'hilite_status' is not supported.

 OPTIONS=hilite_status:hitpoints/<33%/red&bold
  * Line 204: 'hilite_status' is not supported.

 OPTIONS=hilite_status:hitpoints/<15%/red&inverse
  * Line 205: 'hilite_status' is not supported.

 OPTIONS=hilite_status:power/100%/gray&normal
  * Line 208: 'hilite_status' is not supported.

 OPTIONS=hilite_status:power/<100%/green&normal
  * Line 209: 'hilite_status' is not supported.

 OPTIONS=hilite_status:power/<66%/yellow&normal
  * Line 210: 'hilite_status' is not supported.

 OPTIONS=hilite_status:power/<50%/orange&normal
  * Line 211: 'hilite_status' is not supported.

 OPTIONS=hilite_status:power/<33%/red&bold
  * Line 212: 'hilite_status' is not supported.

 OPTIONS=hilite_status:cap/burdened/yellow/stressed/orange/strained/red&bold/ove
 rtaxed/red&inverse/overloaded/red&inverse&blink
  * Line 215: 'hilite_status' is not supported.

 OPTIONS=hilite_status:hunger/satiated/yellow/hungry/orange/weak/red&bold/fainti
 ng/red&inverse/fainted/red&inverse&blink
  * Line 218: 'hilite_status' is not supported.
 Hit <Enter> to continue.
2018-11-24 23:14:20 -05:00
nhmall
c5b283a839 Revert "Added decl_early_init() which is called when PLAYAGAIN is supported."
This reverts commit acbe4d9242.
2018-11-23 22:17:24 -05:00
nhmall
162018060a Revert "Initial check in of icontext."
This reverts commit 5bbe3cd6bb.
2018-11-23 22:17:18 -05:00
nhmall
4590c9c0dd Revert "Instance variable work check-point."
This reverts commit 8e316df117.
2018-11-23 22:17:12 -05:00
nhmall
7ad3f32e16 Revert "Renamed instance_variables to global_variables and iv to g."
This reverts commit f9a0db6c44.
2018-11-23 22:17:07 -05:00
nhmall
9db124f650 Revert "Fix compiler warnings in macos build."
This reverts commit 0d59f1a22b.
2018-11-23 22:16:49 -05:00
nhmall
3cbc6d4cf5 Revert "Modified objects initialization to support re-entry."
This reverts commit c3eefefc99.
2018-11-23 22:16:24 -05:00
Bart House
c3eefefc99 Modified objects initialization to support re-entry. 2018-11-23 15:22:55 -08:00
Bart House
0d59f1a22b Fix compiler warnings in macos build. 2018-11-23 15:22:54 -08:00
Bart House
f9a0db6c44 Renamed instance_variables to global_variables and iv to g. 2018-11-23 15:22:53 -08:00
Bart House
8e316df117 Instance variable work check-point. 2018-11-23 15:22:53 -08:00
Bart House
5bbe3cd6bb Initial check in of icontext. 2018-11-23 15:22:51 -08:00
Bart House
acbe4d9242 Added decl_early_init() which is called when PLAYAGAIN is supported.
decl_early_init() is called when we are starting a game.  On first
start, it validates that global state is in the expected state.
When called on subsequent starts, it initializes global state to
expected state.
2018-11-23 15:22:51 -08:00
Pasi Kallinen
3517277467 Add some commented out flags to linux hints file 2018-11-23 19:26:13 +02:00
Patric Mueller
a7ebb35d5e Adding a travis job for a minimal build 2018-11-23 17:44:31 +01:00
Bart House
d7b77d0625 Additional cleanup of macosx10.14. 2018-11-21 22:58:05 -08:00
Bart House
e321b6d1d2 Added ability to sign tty package. 2018-11-21 21:23:30 -08:00