win32 updates (from <Someone>)

- restructured Install.nt quite a bit. It now contains instructions
to build a graphical nethack using NMAKE, too. I merged
the instructions for command line builds, and separated the IDE
build; that made more sense to me. It is shorter, too.
- added some lines to all Makefiles so they now build
NetHackW.exe when GRAPHICAL is "Y", and NetHack.exe
otherwise. I espacially did not test this on Borland.
Previously, the makefiles would always build NetHack.exe.
- changed the IDE files to build NetHackW.exe instead of
nethackw.exe. This is only cosmetic, but consistent with the
other executable.
- made a small change to pcmain.c, as the MinGW linker
cannot decide between main() and WinMain() when both are
present, as explained in <Someone>'s original
message. (I used a #ifndef instead of comments ;-)
The MinGW graphical build indeed seems to work.
This commit is contained in:
nethack.allison
2002-12-09 03:12:47 +00:00
parent 7f50893e13
commit bea789ea2d
7 changed files with 241 additions and 255 deletions
+6
View File
@@ -80,6 +80,11 @@ extern unsigned _stklen;
#endif #endif
#ifdef OVL0 #ifdef OVL0
/* If the graphics version is built, we don't need a main; it is skipped
* to help MinGW decide which entry point to choose. If both main and
* WinMain exist, the resulting executable won't work correctly.
*/
#ifndef MSWIN_GRAPHICS
int int
main(argc,argv) main(argc,argv)
int argc; int argc;
@@ -94,6 +99,7 @@ char *argv[];
/*NOTREACHED*/ /*NOTREACHED*/
return 0; return 0;
} }
#endif /*MSWIN_GRAPHICS*/
#endif /*OVL0*/ #endif /*OVL0*/
#ifdef OVL1 #ifdef OVL1
+200 -236
View File
@@ -2,16 +2,16 @@
NetHack may be freely redistributed. See license for details. NetHack may be freely redistributed. See license for details.
============================================================== ==============================================================
Instructions for compiling and installing Instructions for compiling and installing
NetHack 3.4 on a Windows 9x, Me, NT, 2000, or XP system NetHack 3.4 on a Windows 9x, NT, 2000, or XP system
============================================================== ==============================================================
Last revision: $Date$ Last revision: $Date$
Credit for the porting of NetHack to the Win32 Console Subsystem goes to Credit for the porting of NetHack to the Win32 Console Subsystem goes to
the NT Porting Team started by Michael Allison. the NT Porting Team started by Michael Allison.
Credit for the Win32 Graphical version of NetHack (aka Credit for the Win32 Graphical version of NetHack (aka "NetHack for
"NetHack for Windows" or Nethackw) goes to Alex Kompel who initially Windows" or NetHackW) goes to Alex Kompel who initially developed and
developed and contributed the port. contributed the port.
The PC Windows porting team consisting of Michael Allison, David Cohrs, The PC Windows porting team consisting of Michael Allison, David Cohrs,
Alex Kompel, Dion Nicolaas, Yitzhak Sapir, and Janet Walz maintained the Alex Kompel, Dion Nicolaas, Yitzhak Sapir, and Janet Walz maintained the
@@ -22,8 +22,8 @@ version. In either case you can use one of the following build
environments: environments:
o A copy of Microsoft Visual C V6.0 SP3 or later. Things may work with o A copy of Microsoft Visual C V6.0 SP3 or later. Things may work with
an earlier version of the compiler, but the current code has not been an earlier version of the compiler, but the current code has not
tested with an earlier version. been tested with an earlier version.
OR OR
@@ -32,17 +32,23 @@ environments:
registration at: registration at:
http://www.borland.com/bcppbuilder/freecompiler/. http://www.borland.com/bcppbuilder/freecompiler/.
Additionally, you can build a TTY version of NetHack with the following OR
build environment:
o A copy of MinGW 1.0. MinGW is a collection of header files and import o A copy of MinGW 2.0. MinGW is a collection of header files and import
libraries with which native Windows32 programs can be made; MinGW 1.0 libraries with which native Windows32 programs can be made; the
ships with the GNU Compiler Collection. MinGW 2.0 distribution contains the GNU Compiler Collection.
You can download MinGW at You can download MinGW at
http://www.mingw.org/ http://www.mingw.org/
Earlier versions of MinGW will not allow you to build the Windows
Graphical version.
In addition to the makefiles that allow you to build NetHack from the
command line, there is also a set of project files and a workspace file
that allow you to build the Windows Graphical version from Microsoft
Visual C's IDE (Integrated Development Environment.)
FIRST STEP: FIRST STEP
The first step in building either version of NetHack is to execute The first step in building either version of NetHack is to execute
sys/winnt/nhsetup.bat. sys/winnt/nhsetup.bat.
@@ -61,20 +67,29 @@ A build subdirectory will also be created off the top of the NetHack
source tree, and many files appropriate for a graphical build will be source tree, and many files appropriate for a graphical build will be
moved there. moved there.
If you wish to build the TTY version, proceed now to "BUILDING TTY VERSION." If you wish to build from the command line, proceed to "BUILDING FROM
If you wish to build the graphical version, proceed now to "BUILDING GRAPHICAL VERSION." THE COMMAND LINE."
If you wish to build using Visual C's IDE, proceed now to "BUILDING
USING VISUAL C'S IDE."
------------------------ BUILDING FROM THE COMMAND LINE
| BUILDING TTY VERSION |
------------------------
This version of NetHack for Win32 is a tty port utilizing the WIN32 You can built two different versions of NetHack for Win32 from the
Console I/O subsystem. command line:
A tty port utilizing the Win32 Console I/O subsystem, Console
NetHack;
A Win32 native port built on the Windows API, Graphical NetHack or
NetHackW.
The executable for Console NetHack will be named NetHack.exe. The
executable for Graphical NetHack will be named NetHackW.exe. You can opt
to build both; they will be able to use the same datafiles, save files
and bones files.
I. Dispelling the Myths: I. Dispelling the Myths:
Compiling NetHack for WIN32 TTY is not as easy as it sounds, nor as hard Compiling NetHack for Win32 is not as easy as it sounds, nor as hard
as it looks, however it will behoove you to read this entire section as it looks, however it will behoove you to read this entire section
through before beginning the task. through before beginning the task.
@@ -82,48 +97,48 @@ I. Dispelling the Myths:
o Microsoft Visual C++ V6.0 SP3 or greater o Microsoft Visual C++ V6.0 SP3 or greater
o Borland C 5.5.1 o Borland C 5.5.1
o MinGW 1.0 with GCC 2.95.3-6 o MinGW 2.0 (with GCC 3.2)
The Microsoft Visual C Makefile was created for use with MS NMAKE The Microsoft Visual C Makefile was created for use with MS NMAKE
which is provided with the Microsoft compiler. The supplied Makefile which is provided with the Microsoft compiler. The supplied Makefile
may work with earlier versions of the Microsoft 32-bit compiler, but may work with earlier versions of the Microsoft 32-bit compiler, but
that has not been tested. that has not been tested.
The Borland C Makefile was created for use with Borland MAKE The Borland C Makefile was created for use with Borland MAKE which
which is provided with the Borland compiler. is provided with the Borland compiler.
The GCC Makefile was created for use with GNU Make version 3.79.1, The GCC Makefile was created for use with GNU Make version 3.79.1,
which comes with the MinGW package. which comes with the MinGW package.
You may find it useful to obtain copies of lex (flex) and yacc (bison, You may find it useful to obtain copies of lex (flex) and yacc
or byacc). While not strictly necessary to compile nethack, they are (bison, or byacc). While not strictly necessary to compile nethack,
required should you desire to make any changes to the level and dungeon they are required should you desire to make any changes to the level
compilers. and dungeon compilers.
II. To compile your copy of NetHack on a Windows NT/2000/XP machine:
II. To compile your copy of NetHack on a 32 bit Windows machine (NT or 2000):
(Note: build has not been tested on Windows XP. That isn't to say that
it doesn't work, it just hasn't been tried by us.)
Setting Up Setting Up
1. It almost goes without saying that you should make sure that your tools 1. It almost goes without saying that you should make sure that your
are set up and running correctly. That includes ensuring that all the tools are set up and running correctly. That includes ensuring that
necessary environment variables for the compiler environment all the necessary environment variables for the compiler environment
are set correctly. (Examples: For the Microsoft compiler by are set correctly. (Examples: For the Microsoft compiler by
executing vcvars32.bat, which is probably in the bin directory of executing vcvars32.bat, which is probably in the bin directory of
your compilers directory tree. For the Borland Makefile, you can your compilers directory tree. For the Borland Makefile, you can
simply invoke the Make utility from the Makefile's directory (For simply invoke the Make utility from the Makefile's directory (For
the standard Borland compiler installation you can just the standard Borland compiler installation you can just use the
use the explicit path "c:\borland\bcc55\bin\make /f Makefile.bcc". explicit path "c:\borland\bcc55\bin\make /f Makefile.bcc". For the
For the GCC Makefile, add <mingw>\bin to your path, where <mingw> is GCC Makefile, add <mingw>\bin to your path, where <mingw> is your
your MinGW root directory.) MinGW root directory.)
2. Make sure all the NetHack files are in the appropriate directory 2. Make sure all the NetHack files are in the appropriate directory
structure. You should have a main directory with subdirectories structure. You should have a main directory with subdirectories
dat, doc, include, src, sys\share, sys\winnt, util, win\tty, and dat, doc, include, src, sys\share, sys\winnt, util, and binary (The
binary (The "binary" directory was created by nhsetup.bat earlier "binary" directory was created by nhsetup.bat earlier if you
if you followed the steps appropriately). followed the steps appropriately).
For Console NetHack you need win\tty in addition to these; for
Graphical NetHack you need win\win32 in addition to these.
Other subdirectories may also be included in your distribution, but Other subdirectories may also be included in your distribution, but
they are not necessary for building the TTY version for the Win32 they are not necessary for building the TTY version for the Win32
@@ -142,6 +157,18 @@ Setting Up
share winnt tty share winnt tty
Required Directories for a Win32 Graphical NetHack:
top
|
----------------------------------------------------/ /-----
| | | | | | | |
util dat doc include src sys win binary
| |
------ -----
| | |
share winnt win32
Check the file "Files" in your top level directory for an exact Check the file "Files" in your top level directory for an exact
listing of what file is in which directory. In order for the listing of what file is in which directory. In order for the
Makefiles to work, all the source files must be in the proper Makefiles to work, all the source files must be in the proper
@@ -149,38 +176,38 @@ Setting Up
If you downloaded or ftp'd the sources from a UNIX system, the lines If you downloaded or ftp'd the sources from a UNIX system, the lines
will probably end in UNIX-style newlines, instead of the carriage will probably end in UNIX-style newlines, instead of the carriage
return and line feed pairs used by Windows. Some programs have trouble return and line feed pairs used by Windows. Some programs have
with them, so you may need to convert them. The compiler should not trouble with them, so you may need to convert them. The compiler
have any problems with them however. should not have any problems with them however.
3. Now go to the include subdirectory to check a couple of the header 3. Now go to the include subdirectory to check a couple of the header
files there. Things *should* work as they are, but since you have files there. Things *should* work as they are, but since you have
probably set up your system in some sort of custom configuration probably set up your system in some sort of custom configuration it
it doesn't hurt to check out the following: doesn't hurt to check out the following:
First check config.h according to the comments to match your system and First check config.h according to the comments to match your system
desired set of features. Mostly you need to check the WIZARD option. and desired set of features. Mostly you need to check section 4 and
5.
You may include all or as few of the special game features as you wish You may include all or as few of the special game features as you
(they are located last in the file). wish (they are located last in the file).
4. Edit your Makefile. 4. Edit your Makefile.
For building the TTY version, ensure that GRAPHICAL is set to "N", For building Console NetHack, ensure that GRAPHICAL is set to "N",
or commented out. (If you aren't building the TTY version, you are or commented out. For building Graphical NetHack, set GRAPHICAL to
currently reading the wrong section, and following the wrong set of "Y".
steps. In that case, you may wish to start reading from the top
again.)
Optional step: Optional step:
If you elected not to use the high-quality BSD random number routines by If you elected not to use the high-quality BSD random number
commenting out RANDOM in ntconf.h, comment out (or set equal to nothing) routines by commenting out RANDOM in ntconf.h, comment out (or
the RANDOM macro in your Makefile. set equal to nothing) the RANDOM macro in your Makefile.
If you are recompiling after patching your sources, or if you got your If you are recompiling after patching your sources, or if you got
files from somewhere other than the official distribution, "touch your files from somewhere other than the official distribution,
makedefs.c" to ensure that certain files (onames.h and pm.h) are remade, "touch makedefs.c" to ensure that certain files (onames.h and pm.h)
lest potentially troublesome timestamps fool your make (or nmake) utility. are remade, lest potentially troublesome timestamps fool your make
(or nmake) utility.
Compiling Compiling
@@ -196,54 +223,20 @@ Compiling
make -f Makefile.gcc install make -f Makefile.gcc install
If you get any errors along the way then something has not been set If you get any errors along the way then something has not been set
up correctly. The time it takes to compile depends on your particular up correctly. The time it takes to compile depends on your
machine of course, but you should be able to go for lunch and return particular machine of course, but you should be able to go for lunch
to find everything finished. The less memory, and slower your machine, and return to find everything finished. The less memory, and slower
the longer the lunch you may take. :-) your machine, the longer the lunch you may take. :-)
In any case, it is likely that the command prompt window where you are In any case, it is likely that the command prompt window where you
doing the compiling will be occupied for a while. If all goes well, are doing the compiling will be occupied for a while. If all goes
you will get an NetHack executable. well, you will get an NetHack executable.
Running NetHack
6. Make sure all of the support files -- Guidebook.txt, license,
Defaults.nh, NetHack.exe, nhdat, and recover.exe -- were copied to the
game directory. If not, move them there yourself.
Edit Defaults.nh to reflect your particular setup and personal
preferences, by following the comments. As with all releases since
3.2.1, HACKDIR defaults to the same directory as that where the NetHack.exe
executable resides. You only need to set HACKDIR in defaults.nh if,
for some reason, you wish to override that (be careful).
7. Executing the game
a) Running from the command prompt:
If you add the directory containing the NetHack executable
to your PATH, you can just type "nethack" or "nethack -umike"
to start it up. Alternatively, you can explicitly invoke it with
a command such as "c:\nethack\binary\nethack.exe" (specifying whatever
drive and directory your NetHack executable resides in) each time.
b) Running from a Windows shortcut.
If you will be running it by launching it from a shortcut, just
use the following information when setting up the shortcut.
Description : NetHack 3.4.1
Command Line : C:\NETHACK\BINARY\NETHACK.EXE
(changing the directory to the appropriate one of course)
8. Play NetHack. If it works, you're done!
Notes: Notes:
1) To install an update of NetHack after changing something, change 1. To install an update of NetHack after changing something, change
your current directory to src and issue the appropriate command your current directory to src and issue the appropriate command for
for your compiler: your compiler:
For Microsoft compiler: For Microsoft compiler:
nmake nmake
@@ -254,61 +247,65 @@ Notes:
For GCC: For GCC:
make -f Makefile.gcc make -f Makefile.gcc
If you add, delete, or reorder monsters or objects, or you change the If you add, delete, or reorder monsters or objects, or you change
format of saved level files, delete any save and bones files. (Trying the format of saved level files, delete any save and bones files.
to use such files sometimes produces amusing confusions on the game's (Trying to use such files sometimes produces amusing confusions on
part, but usually crashes.) the game's part, but usually crashes.)
If you made changes to any of the level compiler software, you may have If you made changes to any of the level compiler software, you may
to delete dgn_flex.c, dgn_yacc.c, lev_flex.c, and lev_yacc.c from the have to delete dgn_flex.c, dgn_yacc.c, lev_flex.c, and lev_yacc.c
util directory to ensure that they are remade. from the util directory to ensure that they are remade.
2) The executable produced by the TTY build is a 32-bit, flat-address space, 2. The executable produced by the TTY build is a 32-bit, flat-address
non-overlayed .exe file, which should run on any true Win32 environment space, non-overlayed .exe file, which should run on any true Win32
with console I/O support. environment with console I/O support.
The executable built by the graphical built is a 32-bit,
flat-address space, non-overlayed .exe file, which should run on any
true Win32 graphical environment.
To run NetHack, proceed to RUNNING NETHACK.
------------------------------ BUILDING USING VISUAL C'S IDE
| BUILDING GRAPHICAL VERSION |
------------------------------
Only the Win32 native port built on the Windows API, or Graphical
This version of NetHack is a Win32 native port built on the Windows API. NetHack, can be built using the Visual C IDE.
I. Dispelling the Myths: I. Dispelling the Myths:
Compiling NetHack for Windows is straightforward, as long as you have Compiling NetHack using the Visual C IDE is straightforward, as long
your compiler and tools correctly installed. as you have your compiler and tools correctly installed.
It is also assumed that you already changed your directory to It is again assumed that you already changed your directory to
sys\winnt and executed: sys\winnt and executed:
nhsetup nhsetup
as described at the top of this document. If you didn't, you must as described at the top of this document. If you didn't, you must go
go back and do so before proceeding. back and do so before proceeding.
II. To compile your copy of NetHack for Windows on a II. To compile your copy of NetHack for Windows on a Windows NT/2000/XP
Windows NT/2000/XP machine: machine using the Visual C IDE:
Setting Up Setting Up
1. It almost goes without saying that you should make sure that your tools 1. It almost goes without saying that you should make sure that your
are set up and running correctly. (Examples: For the Microsoft Visual tools are set up and running correctly. (For the Microsoft Visual C
Studio C compiler it should correctly fire up when you choose it in IDE it should correctly fire up when you choose it in your Start |
your Start | Programs menus, and for Borland make sure that the compiler Programs menus.)
is in your PATH, or that you know where the make.exe executable resides.)
2. Make sure all the NetHack files are in the appropriate directory 2. Make sure all the NetHack files are in the appropriate directory
structure. You should have a main directory with subdirectories structure. You should have a main directory with subdirectories
dat, doc, include, src, sys\share, sys\winnt, util, win\win32, dat, doc, include, src, sys\share, sys\winnt, util, win\win32, and
and at this point you should also have a build directory and a at this point you should also have a build directory and a binary
binary directory (both created by nhsetup.bat executed from directory (both created by nhsetup.bat executed from sys\winnt
sys\winnt earlier.) earlier.)
Other subdirectories may also be included in your distribution, but Other subdirectories may also be included in your distribution, but
they are not necessary for building the graphical version of NetHack they are not necessary for building the graphical version of NetHack
(you can delete them to save space if you wish.) (you can delete them to save space if you wish.)
Required Directories for a Win32 Graphical NetHack: Required Directories for building Graphical NetHack with the Visual
C IDE:
top top
| |
@@ -322,52 +319,36 @@ Setting Up
Those last two (build and binary) are created during the building Those last two (build and binary) are created during the building
process. They are not disributed as part of the NetHack source process. They are not disributed as part of the NetHack source
distribution. nhsetup.bat creates the build directory and moves distribution. nhsetup.bat creates the build directory and moves a
a few files into it, including the Visual C project files. few files into it, including the Visual C project files. The
The "binary" directory will house everything you need to play the "binary" directory will house everything you need to play the game
game after building is complete. after building is complete.
Check the file "Files" in your top level directory for an exact Check the file "Files" in your top level directory for an exact
listing of what file is in which directory. In order for the listing of what file is in which directory. In order for the build
build process to work, all the source files must be in the proper process to work, all the source files must be in the proper
locations. Remember that nhsetup.bat moves/copies many files around locations. Remember that nhsetup.bat moves/copies many files around
to their intended locations for building NetHack. to their intended locations for building NetHack.
If you downloaded or ftp'd the sources from a UNIX system, the lines If you downloaded or ftp'd the sources from a UNIX system, the lines
will probably end in UNIX-style newlines, instead of the carriage will probably end in UNIX-style newlines, instead of the carriage
return and line feed pairs used by Windows. Visual Studio project return and line feed pairs used by Windows. Visual C project files
files and workspace files (dsp and dsw files) in particular need to and workspace files (dsp and dsw files) in particular need to have
have their lines end in carriage-return-line-feed or they won't work their lines end in carriage-return-line-feed or they won't work
properly. properly.
3. Ready your tool. 3. Ready your tool.
Microsoft compiler users, perform step 3a. Note: It's possible to build a graphical version using the Makefile,
Borland compiler users, perform step 3b. as explained above. However, the IDE build has full game
functionality and is the officially released build.
Note for Microsoft users: It's possible to build a graphical version Start the Visual C IDE. In the Visual C IDE menus, choose:
using the Makefile. For simplicity's sake, however, only the Visual
C IDE build will be explained. The IDE build has full game
functionality and is the officially released build.s
a) Microsoft compiler:
Start the Visual C IDE. In the Visual C IDE Menus, choose:
File | Open Workspace File | Open Workspace
b) Borland compiler:
Chdir to the NetHack src directory:
chdir ../../src
if your current directory was still sys/winnt,
or:
chdir src
if your current directory was the top of the NetHack tree.
4. Set up for the build. 4. Set up for the build.
Microsoft compiler users, perform step 4a.
Borland compiler users, perform step 4b.
a) Microsoft compiler only: In the Visual C "Open Workspace" dialog box, navigate to the top of
o In the Visual C "Open Workspace" dialog box, navigate to the top your NetHack source directory.
of your NetHack source directory.
In there, highlight "nethack.dsw" and click on Open. In there, highlight "nethack.dsw" and click on Open.
Once the workspace has been opened, you should see the following Once the workspace has been opened, you should see the following
@@ -384,95 +365,76 @@ Setting Up
+ tilemap files + tilemap files
+ uudecode files + uudecode files
o On the Visual C menus, choose: On the Visual C menus, choose:
Project | Set Active Project | nethackw Project | Set Active Project | NetHackW
o On the Visual C menus again, choose either: On the Visual C menus again, choose either:
Build | Set Active Configuration | nethackw - Win32 Release Build | Set Active Configuration | NetHackW - Win32 Release
or or
Build | Set Active Configuration | nethackw - Win32 Debug Build | Set Active Configuration | NetHackW - Win32 Debug
The first will create the Release build of NetHackW which does The first will create the Release build of NetHackW which does not
not contain all the debugging information and is smaller, and contain all the debugging information and is smaller, and runs
runs quicker. The second will create the Debug build of NetHackW quicker. The second will create the Debug build of NetHackW and
and will spend a lot of time writing debug information to the disk will spend a lot of time writing debug information to the disk as
as the game is played. Unless you are debugging or enhancing NetHack the game is played. Unless you are debugging or enhancing NetHack
for Windows, choose the Release build. for Windows, choose the Release build.
o For Microsoft compiler build, you may now proceed to step 5.
b) Borland Compiler only:
o Edit the Makefile. Ensure the following are set correctly.
GRAPHICAL should be set to "Y"
o Ensure that all your tools directories are set up properly.
By default, your tools are assumed to be in the same
directory as the MAKE program.
Building Building
5. Start your build. 5. Start your build.
Microsoft compiler users, perform step 5a.
Borland compiler users, perform step 5b.
a) Microsoft Compiler only: On the Visual C menus once again, choose:
o On the Visual C menus once again, choose: Build | Build NetHackW.exe
Build | Build nethackw.exe
This starts the build. It is likely that the IDE message window This starts the build. It is likely that the IDE message window
where you are doing the compiling will be occupied for a while. where you are doing the compiling will be occupied for a while.
If all goes well, you will get an NetHack executable called
nethackw.exe in the "binary" directory, along with all the support
files that it needs.
o For Microsoft compiler build, you may now proceed to step 6. 6. If all has gone well to this point, you should now have a NetHack
executable called NetHackW.exe in the "binary" directory, along with
b) Borland Compiler only: all the support files that it needs.
o With your current directory the NetHack src directory,
issue the following command:
make /f Makefile.bcc install
6. If all has gone well to this point, you should now have a playable
game of "NetHack for Windows" in the "binary" directory.
Running NetHack RUNNING NETHACK
7. Make sure all of the support files -- Guidebook.txt, license, I. Checking the installation:
Defaults.nh, nethackw.exe, nhdat, and recover.exe Make sure all of the support files -- Guidebook.txt, license,
-- were copied to the binary directory. Defaults.nh, NetHack.exe or NetHackW.exe, nhdat, and recover.exe --
(If not, find them in the tree and move them there yourself if they were copied to the game directory. If not, move them there
exist. If they don't exist, something has gone wrong) yourself.
Edit Defaults.nh to reflect your particular setup and personal Edit Defaults.nh to reflect your particular setup and personal
preferences, by following the comments. As with all releases since preferences, by following the comments. As with all releases since
3.2.1, HACKDIR defaults to the same directory as that where the nethackw.exe 3.2.1, HACKDIR defaults to the same directory as that where the
executable resides. You only need to set HACKDIR in Defaults.nh if, NetHack.exe or NetHackW.exe executable resides. You only need to
for some reason, you wish to override that (be careful). set HACKDIR in defaults.nh if, for some reason, you wish to override
that (be careful).
8. Executing the game II. Executing the game
a) Running from the command prompt:
If you add the directory containing the NetHack executable 1. Running from the command prompt:
to your PATH,
You can just type "nethackw" to start it up. Alternatively, you
can explicitly invoke it with a command such as
"c:\nethack\binary\nethackw.exe" (specifying whatever drive
and directory your NetHack executable resides in) each time.
b) Running from a Windows shortcut If you add the directory containing the NetHack executable to your
PATH, you can just type "nethack" or "nethack -umike" or "nethackw"
or "nethackw -umike" to start it up. Alternatively, you can
explicitly invoke it with a command such as
"c:\nethack\binary\nethack.exe" or "c:\nethack\binary\nethackw.exe"
(specifying whatever drive and directory your NetHack executable
resides in) each time.
If you will be running it by launching it from program manager 2. Running from a Windows shortcut.
or from a shortcut, just use the following information when
setting up the icon or shortcut.
Description : NetHack 3.4.1 If you will be running it by launching it from a shortcut, just use
the following information when setting up the shortcut.
Description : NetHack 3.4.1 Console version
Command Line : C:\NETHACK\BINARY\NETHACK.EXE
Description : NetHack 3.4.1 Graphical Interface
Command Line : C:\NETHACK\BINARY\NETHACKW.EXE Command Line : C:\NETHACK\BINARY\NETHACKW.EXE
(changing the directory in the Command Line to the appropriate one of course) (changing the directory to the appropriate one of course)
9. Play NetHack for Windows. If it works, you're done! III. Play NetHack. If it works, you're done!
PROBLEMS PROBLEMS
@@ -480,11 +442,13 @@ PROBLEMS
If you encounter a bug and wish to report it, please send e-mail to: If you encounter a bug and wish to report it, please send e-mail to:
nethack-bugs@nethack.org nethack-bugs@nethack.org
If you have any comments or suggestions, feel free to drop us a line c/o: If you have any comments or suggestions, feel free to drop us a line
c/o:
DevTeam@nethack.org DevTeam@nethack.org
You may wish to vist the NetHack Development Team's website occasionally You may wish to vist the NetHack Development Team's website
to check for updates or known bugs. The website can be found at: occasionally to check for updates or known bugs. The website can be
found at:
http://www.nethack.org/ http://www.nethack.org/
Happy NetHacking! Happy NetHacking!
+4
View File
@@ -92,7 +92,11 @@ libsmt = $(bcclib)\cw32mt.lib $(bcclib)\import32.lib
# Set the gamedir according to your preference. # Set the gamedir according to your preference.
# It must be present prior to compilation. # It must be present prior to compilation.
!IF "$(GRAPHICAL)" == "Y"
GAME = NetHackW # Game Name
!ELSE
GAME = NetHack # Game Name GAME = NetHack # Game Name
!ENDIF
GAMEDIR = ..\binary # Game directory GAMEDIR = ..\binary # Game directory
# #
+13 -6
View File
@@ -58,8 +58,13 @@ endif
# Set the gamedir according to your preference. # Set the gamedir according to your preference.
# If not present prior to compilation it gets created. # If not present prior to compilation it gets created.
ifeq "$(GRAPHICAL)" "Y"
# Game Name
GAME = NetHackW
else
# Game Name # Game Name
GAME = NetHack GAME = NetHack
endif
# Game directory # Game directory
GAMEDIR = ../binary GAMEDIR = ../binary
@@ -156,19 +161,21 @@ WINPORT = $(O)tile.o $(O)mhaskyn.o $(O)mhdlg.o \
$(O)mhstatus.o $(O)mhtext.o $(O)mswproc.o $(O)winhack.o $(O)mhstatus.o $(O)mhtext.o $(O)mswproc.o $(O)winhack.o
# WIN32_IE=0x400 is currently unsupported by MinGW # WIN32_IE=0x400 is currently unsupported by MinGW
WINPFLAG = -DTILES -DMSWIN_GRAPHICS -D_WIN32_IE=0x0400 WINPFLAG = -DTILES -DMSWIN_GRAPHICS -D_WIN32_IE=0x0400
NHRES = $(O)winhack.o NHRES = $(O)winres.o
WINPINC = -I$(WIN32) WINPINC = -I$(WIN32)
WINPHDR = $(WIN32)/mhaskyn.h $(WIN32)/mhdlg.h $(WIN32)/mhfont.h \ WINPHDR = $(WIN32)/mhaskyn.h $(WIN32)/mhdlg.h $(WIN32)/mhfont.h \
$(WIN32)/mhinput.h $(WIN32)/mhmain.h $(WIN32)/mhmap.h \ $(WIN32)/mhinput.h $(WIN32)/mhmain.h $(WIN32)/mhmap.h \
$(WIN32)/mhmenu.h $(WIN32)/mhmsg.h $(WIN32)/mhmsgwnd.h \ $(WIN32)/mhmenu.h $(WIN32)/mhmsg.h $(WIN32)/mhmsgwnd.h \
$(WIN32)/mhrip.h $(WIN32)/mhstatus.h \ $(WIN32)/mhrip.h $(WIN32)/mhstatus.h \
$(WIN32)/mhtext.h $(WIN32)/resource.h $(WIN32)/winMS.h $(WIN32)/mhtext.h $(WIN32)/resource.h $(WIN32)/winMS.h
WINPLIBS = -lcomctl32
else else
WINPORT = $(O)nttty.o WINPORT = $(O)nttty.o
WINPFLAG= -DWIN32CON WINPFLAG= -DWIN32CON
WINPHDR = WINPHDR =
NHRES = $(O)console.o NHRES = $(O)console.o
WINPINC = WINPINC =
WINPLIBS =
endif endif
TILEUTIL16 = $(UTIL)/tile2bmp.exe TILEUTIL16 = $(UTIL)/tile2bmp.exe
@@ -555,10 +562,10 @@ tileutil: $(U)gif2txt.exe $(U)gif2tx32.exe $(U)txt2ppm.exe
@echo Optional tile development utilities are up to date. @echo Optional tile development utilities are up to date.
ifeq "$(GRAPHICAL)" "Y" ifeq "$(GRAPHICAL)" "Y"
$(NHRES): $(TILEBMP16) $(WIN32)\winhack.rc $(WIN32)\mnsel.bmp \ $(NHRES): $(TILEBMP16) $(WIN32)/winhack.rc $(WIN32)/mnsel.bmp \
$(WIN32)\mnselcnt.bmp $(WIN32)\mnunsel.bmp \ $(WIN32)/mnselcnt.bmp $(WIN32)/mnunsel.bmp \
$(WIN32)\petmark.bmp $(WIN32)\NetHack.ico $(WIN32)\rip.bmp \ $(WIN32)/petmark.bmp $(WIN32)/NetHack.ico $(WIN32)/rip.bmp \
$(WIN32)\splash.bmp $(WIN32)/splash.bmp
@$(rc) -o$@ --include-dir $(WIN32) -i $(WIN32)/winhack.rc @$(rc) -o$@ --include-dir $(WIN32) -i $(WIN32)/winhack.rc
else else
$(NHRES): $(NTSYS)/console.rc $(NTSYS)/NetHack.ico $(NHRES): $(NTSYS)/console.rc $(NTSYS)/NetHack.ico
@@ -571,7 +578,7 @@ endif
$(GAMEFILE) : $(ALLOBJ) $(NHRES) $(GAMEFILE) : $(ALLOBJ) $(NHRES)
@echo Linking.... @echo Linking....
@$(link) $(lflags) -o$@ $(ALLOBJ) $(NHRES) @$(link) $(lflags) -o$@ $(ALLOBJ) $(NHRES) $(WINPLIBS)
$(subst /,\,@if exist $(O)install.tag del $(O)install.tag) $(subst /,\,@if exist $(O)install.tag del $(O)install.tag)
$(GAME)_.ico : $(NTSYS)/$(GAME).ico $(GAME)_.ico : $(NTSYS)/$(GAME).ico
+5
View File
@@ -38,7 +38,12 @@ APPVER=4.0
# Set the gamedir according to your preference. # Set the gamedir according to your preference.
# If not present prior to compilation it gets created. # If not present prior to compilation it gets created.
!IF "$(GRAPHICAL)" == "Y"
GAME = NetHack # Game Name GAME = NetHack # Game Name
!ELSE
GAME = NetHackW # Game Name
!ENDIF
GAMEDIR = ..\binary # Game directory GAMEDIR = ..\binary # Game directory
# #
+1 -1
View File
@@ -96,7 +96,7 @@ Package=<4>
############################################################################### ###############################################################################
Project: "nethackw"=.\build\nethackw.dsp - Package Owner=<4> Project: "NetHackW"=.\build\NetHackW.dsp - Package Owner=<4>
Package=<5> Package=<5>
{{{ {{{
+12 -12
View File
@@ -1,24 +1,24 @@
# Microsoft Developer Studio Project File - Name="nethackw" - Package Owner=<4> # Microsoft Developer Studio Project File - Name="NetHackW" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00 # Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT ** # ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101 # TARGTYPE "Win32 (x86) Application" 0x0101
CFG=nethackw - Win32 Debug CFG=NetHackW - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run !MESSAGE use the Export Makefile command and run
!MESSAGE !MESSAGE
!MESSAGE NMAKE /f "nethackw.mak". !MESSAGE NMAKE /f "NetHackW.mak".
!MESSAGE !MESSAGE
!MESSAGE You can specify a configuration when running NMAKE !MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE !MESSAGE
!MESSAGE NMAKE /f "nethackw.mak" CFG="nethackw - Win32 Debug" !MESSAGE NMAKE /f "NetHackW.mak" CFG="NetHackW - Win32 Debug"
!MESSAGE !MESSAGE
!MESSAGE Possible choices for configuration are: !MESSAGE Possible choices for configuration are:
!MESSAGE !MESSAGE
!MESSAGE "nethackw - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "NetHackW - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "nethackw - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE "NetHackW - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE !MESSAGE
# Begin Project # Begin Project
@@ -29,7 +29,7 @@ CPP=cl.exe
MTL=midl.exe MTL=midl.exe
RSC=rc.exe RSC=rc.exe
!IF "$(CFG)" == "nethackw - Win32 Release" !IF "$(CFG)" == "NetHackW - Win32 Release"
# PROP BASE Use_MFC 0 # PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0 # PROP BASE Use_Debug_Libraries 0
@@ -60,7 +60,7 @@ LINK32=link.exe
OutDir=.\Release OutDir=.\Release
SOURCE="$(InputPath)" SOURCE="$(InputPath)"
PostBuild_Desc=Install exe PostBuild_Desc=Install exe
PostBuild_Cmds=copy $(OutDir)\nethackw.exe ..\binary \ PostBuild_Cmds=copy $(OutDir)\NetHackW.exe ..\binary \
copy ..\dat\nhdat ..\binary \ copy ..\dat\nhdat ..\binary \
copy ..\dat\license ..\binary \ copy ..\dat\license ..\binary \
if exist tiles.bmp copy tiles.bmp ..\binary \ if exist tiles.bmp copy tiles.bmp ..\binary \
@@ -70,7 +70,7 @@ if exist ..\doc\recover.txt copy ..\doc\recover.txt ..\binary\recover.txt \
copy ..\sys\winnt\defaults.nh ..\binary\defaults.nh copy ..\sys\winnt\defaults.nh ..\binary\defaults.nh
# End Special Build Tool # End Special Build Tool
!ELSEIF "$(CFG)" == "nethackw - Win32 Debug" !ELSEIF "$(CFG)" == "NetHackW - Win32 Debug"
# PROP BASE Use_MFC 0 # PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1 # PROP BASE Use_Debug_Libraries 1
@@ -101,7 +101,7 @@ OutDir=.\Debug
SOURCE="$(InputPath)" SOURCE="$(InputPath)"
PostBuild_Desc=Install exe PostBuild_Desc=Install exe
PostBuild_Cmds=if NOT exist ..\binary\*.* mkdir ..\binary \ PostBuild_Cmds=if NOT exist ..\binary\*.* mkdir ..\binary \
copy $(OutDir)\nethackw.exe ..\binary \ copy $(OutDir)\NetHackW.exe ..\binary \
copy ..\dat\nhdat ..\binary \ copy ..\dat\nhdat ..\binary \
copy ..\dat\license ..\binary \ copy ..\dat\license ..\binary \
if exist tiles.bmp copy tiles.bmp ..\binary \ if exist tiles.bmp copy tiles.bmp ..\binary \
@@ -115,8 +115,8 @@ copy ..\sys\winnt\defaults.nh ..\binary\defaults.nh
# Begin Target # Begin Target
# Name "nethackw - Win32 Release" # Name "NetHackW - Win32 Release"
# Name "nethackw - Win32 Debug" # Name "NetHackW - Win32 Debug"
# Begin Group "Source Files" # Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"