build both tty NetHack.exe and gui NetHackW.exe

Changes to be committed:
	modified:   include/config.h
	modified:   include/extern.h
	modified:   include/flag.h
	modified:   include/global.h
	modified:   include/ntconf.h
	modified:   include/wintty.h
	modified:   src/cmd.c
	modified:   src/files.c
	modified:   src/options.c
	modified:   sys/share/pcmain.c
	modified:   sys/share/pcsys.c
	modified:   sys/share/pcunix.c
	modified:   sys/winnt/Makefile.gcc
	modified:   sys/winnt/Makefile.msc
	modified:   sys/winnt/nttty.c
	new file:   sys/winnt/stubs.c
	modified:   sys/winnt/winnt.c
	modified:   util/makedefs.c
	modified:   win/tty/wintty.c

Adjust the code and the command line Makefile so that
you no longer have to choose whether to build the tty
version NetHack.exe, or the gui version NetHackW.exe.

Both will now be built in a single 'nmake install' pass.
This commit is contained in:
nhmall
2015-04-22 00:07:46 -04:00
parent 9b63abf2b0
commit aaca36a6d5
19 changed files with 804 additions and 684 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.5 config.h $NHDT-Date: 1428084467 2015/04/03 18:07:47 $ $NHDT-Branch: scshunt-regex $:$NHDT-Revision: 1.76 $ */
/* NetHack 3.5 config.h $NHDT-Date: 1429675530 2015/04/22 04:05:30 $ $NHDT-Branch: win32-x64-working $:$NHDT-Revision: 1.81 $ */
/* NetHack 3.5 config.h $Date: 2012/01/27 20:15:26 $ $Revision: 1.37 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -109,9 +109,6 @@
#endif
#ifdef MSWIN_GRAPHICS
# ifdef TTY_GRAPHICS
# undef TTY_GRAPHICS
# endif
# ifndef DEFAULT_WINDOW_SYS
# define DEFAULT_WINDOW_SYS "mswin"
# endif

View File

@@ -1,4 +1,4 @@
/* NetHack 3.5 extern.h $NHDT-Date: 1429135323 2015/04/15 22:02:03 $ $NHDT-Branch: win32-x64-working $:$NHDT-Revision: 1.464 $ */
/* NetHack 3.5 extern.h $NHDT-Date: 1429675537 2015/04/22 04:05:37 $ $NHDT-Branch: win32-x64-working $:$NHDT-Revision: 1.471 $ */
/* Copyright (c) Steve Creps, 1988. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1500,10 +1500,10 @@ E void FDECL(regex_free, (struct nhregex *));
/* ### nttty.c ### */
#ifdef WIN32CON
#ifdef WIN32
E void NDECL(get_scr_size);
E int NDECL(nttty_kbhit);
E void NDECL(nttty_open);
E void FDECL(nttty_open,(int));
E void NDECL(nttty_rubout);
E int NDECL(tgetch);
E int FDECL(ntposkey,(int *, int *, int *));

View File

@@ -1,4 +1,4 @@
/* NetHack 3.5 flag.h $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: master $:$NHDT-Revision: 1.60 $ */
/* NetHack 3.5 flag.h $NHDT-Date: 1429675538 2015/04/22 04:05:38 $ $NHDT-Branch: win32-x64-working $:$NHDT-Revision: 1.78 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -305,7 +305,7 @@ struct instance_flags {
struct autopickup_exception *autopickup_exceptions[2];
#define AP_LEAVE 0
#define AP_GRAB 1
#ifdef WIN32CON
#ifdef WIN32
#define MAX_ALTKEYHANDLER 25
char altkeyhandler[MAX_ALTKEYHANDLER];
#endif

View File

@@ -1,4 +1,4 @@
/* NetHack 3.5 global.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
/* NetHack 3.5 global.h $NHDT-Date: 1429675538 2015/04/22 04:05:38 $ $NHDT-Branch: win32-x64-working $:$NHDT-Revision: 1.41 $ */
/* NetHack 3.5 global.h $Date: 2012/01/29 03:00:14 $ $Revision: 1.31 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -197,13 +197,6 @@ typedef uchar nhsym;
# endif
# ifdef WIN32
# define PORT_ID "Windows"
# ifndef PORT_SUB_ID
# ifdef MSWIN_GRAPHICS
# define PORT_SUB_ID "graphical"
# else
# define PORT_SUB_ID "tty"
# endif
# endif
# endif
#endif
@@ -234,7 +227,7 @@ typedef uchar nhsym;
# define EXIT_FAILURE 1
#endif
#if defined(X11_GRAPHICS) || defined(QT_GRAPHICS) || defined(GNOME_GRAPHICS) || defined(MSWIN_GRAPHICS)
#if defined(X11_GRAPHICS) || defined(QT_GRAPHICS) || defined(GNOME_GRAPHICS) || defined(WIN32)
# ifndef USE_TILES
# define USE_TILES /* glyph2tile[] will be available */
# endif

View File

@@ -1,4 +1,4 @@
/* NetHack 3.5 ntconf.h $NHDT-Date: 1426966690 2015/03/21 19:38:10 $ $NHDT-Branch: master $:$NHDT-Revision: 1.37 $ */
/* NetHack 3.5 ntconf.h $NHDT-Date: 1429675540 2015/04/22 04:05:40 $ $NHDT-Branch: win32-x64-working $:$NHDT-Revision: 1.44 $ */
/* SCCS Id: @(#)ntconf.h 3.5 2002/03/10 */
/* Copyright (c) NetHack PC Development Team 1993, 1994. */
/* NetHack may be freely redistributed. See license for details. */
@@ -13,9 +13,8 @@
#define EXEPATH /* Allow .exe location to be used as HACKDIR */
#define TRADITIONAL_GLYPHMAP /* Store glyph mappings at level change time */
#ifdef WIN32CON
#define LAN_FEATURES /* Include code for lan-aware features. Untested in 3.4.0*/
#endif
#define PC_LOCKING /* Prevent overwrites of aborted or in-progress games */
/* without first receiving confirmation. */
@@ -29,10 +28,8 @@
#define USER_SOUNDS
#ifdef WIN32CON
#define CHANGE_COLOR /* allow palette changes in win32 console */
/*#define CHANGE_COLOR*/ /* allow palette changes */
#define SELECTSAVED /* Provide menu of saved games to choose from at start */
#endif
/*
* -----------------------------------------------------------------
@@ -56,18 +53,12 @@
#ifdef OPTIONS_USED
#undef OPTIONS_USED
#endif
#ifdef MSWIN_GRAPHICS
#define OPTIONS_USED "guioptions"
#else
#define OPTIONS_USED "ttyoptions"
#endif
#define OPTIONS_USED "options"
#define OPTIONS_FILE OPTIONS_USED
#define PORT_HELP "porthelp"
#ifdef WIN32CON
#define PORT_DEBUG /* include ability to debug international keyboard issues */
#endif
#define SAFERHANGUP /* Define SAFERHANGUP to delay hangup processing
* until the main command loop. 'safer' because it
@@ -199,13 +190,11 @@ extern char hackdir[];
#define getuid() 1
#define getlogin() ((char *)0)
extern void NDECL(win32_abort);
#ifdef WIN32CON
extern void FDECL(nttty_preference_update, (const char *));
extern void NDECL(toggle_mouse_support);
extern void FDECL(map_subkeyvalue, (char *));
extern void NDECL(load_keyboard_handler);
extern void NDECL(raw_clear_screen);
#endif
#include <fcntl.h>
#ifndef __BORLANDC__
@@ -237,7 +226,6 @@ int _RTLENTRY _EXPFUNC read (int __handle, void _FAR *__buf, unsigned __len);
#endif
extern int FDECL(set_win32_option, (const char *, const char *));
#ifdef WIN32CON
#define LEFTBUTTON FROM_LEFT_1ST_BUTTON_PRESSED
#define RIGHTBUTTON RIGHTMOST_BUTTON_PRESSED
#define MIDBUTTON FROM_LEFT_2ND_BUTTON_PRESSED
@@ -245,6 +233,5 @@ extern int FDECL(set_win32_option, (const char *, const char *));
#ifdef CHANGE_COLOR
extern int FDECL(alternative_palette, (char *));
#endif
#endif /* WIN32CON */
#endif /* NTCONF_H */

View File

@@ -1,4 +1,4 @@
/* NetHack 3.5 wintty.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
/* NetHack 3.5 wintty.h $NHDT-Date: 1429675543 2015/04/22 04:05:43 $ $NHDT-Branch: win32-x64-working $:$NHDT-Revision: 1.18 $ */
/* NetHack 3.5 wintty.h $Date: 2012/01/23 10:45:26 $ $Revision: 1.12 $ */
/* Copyright (c) David Cohrs, 1991,1992 */
/* NetHack may be freely redistributed. See license for details. */
@@ -241,15 +241,15 @@ E int FDECL(term_putc, (int c));
E int FDECL(term_flush, (void *desc));
E int FDECL(term_puts, (const char *str));
# endif /* MAC */
# if defined(MSDOS) || defined(WIN32CON)
# if defined(SCREEN_BIOS) || defined(SCREEN_DJGPPFAST) || defined(WIN32CON)
# if defined(MSDOS) || defined(WIN32)
# if defined(SCREEN_BIOS) || defined(SCREEN_DJGPPFAST) || defined(WIN32)
# undef putchar
# undef putc
# undef puts
# define putchar(x) xputc(x) /* these are in video.c, nttty.c */
# define putc(x) xputc(x)
# define puts(x) xputs(x)
# endif/*SCREEN_BIOS || SCREEN_DJGPPFAST || WIN32CON */
# endif/*SCREEN_BIOS || SCREEN_DJGPPFAST || WIN32 */
# ifdef POSITIONBAR
E void FDECL(video_update_positionbar, (char *));
# endif