Patching

Here is a short guide on Patching your NetHack sources. Assuming you have already managed to compile your copy.

On Windows
Please see the article on compiling, the following assumes you have installed MinGW and NetHack's sources to the locations shown in that article.


 * Download the patch binary zip package from http://gnuwin32.sourceforge.net/packages/patch.htm


 * Unpack that into the same directory as MinGW, so that the patch.exe will be in the same place as mingw32-make.

Note that linux-style line endings will cause problems, you need to convert those into Windows-style ones! You can do this for example copypasting the contents of that file from a browser window into Notepad, and then saving the notepad file. In this example, we'll be using the menucolors-patch available at http://bilious.homelinux.org/~paxed/nethack/nh343-menucolor.diff We'll assume the file is saved in c:\nh343\ as nh343-menucolor.diff
 * Find the diff-file you want to patch, and download it on to your computer, preferably in the NetHack sources root directory, c:\nh343.

cd c:\nh343 path=c:\mingw\bin patch -p1 < nh343-menucolor.diff
 * Start cmd.exe and do the following:

The 1 after the -p might need to be changed to 0 or possibly 2 for other patches.

to /* # define MENU_COLOR_REGEX */ Menucolors also comes with it's own short README file, which should be c:\nh343\README.menucolor</tt>
 * Some patches require extra configuration steps before compiling. For menucolors, you need to edit c:\nh343\include\config.h</tt> by changing the line
 * 1) define MENU_COLOR_REGEX


 * Run install.bat</tt> (Assuming you created one when compiling the source)

OPTIONS=menucolors MENUCOLOR="* blessed *"=green MENUCOLOR="* holy *"=green MENUCOLOR="* cursed *"=red MENUCOLOR="* unholy *"=red
 * Add the following to your NetHack configuration file, so the menucolors actually does something:


 * Start NetHack. Now all blessed and holy items in your inventory should be shown in green, cursed and unholy in red.