Home > Programming > Nethack on OS X 10.6 (Snow Leopard)

Nethack on OS X 10.6 (Snow Leopard)

November 13th, 2009

O.K. So, this is kind of a followup to a previous post I did about how I like to setup Nethack on my Mac. However, more recently, some of the patches I had used stopped working on later versions of Mac OS (10.5 and 10.6). So I spent a bit of time looking into this today and I got some positive results. (update: I think the problem I had with Menucolor compiling was that it didn’t like the regexp method – I changed this to simply use the wildcard matching.)

Nethack with Status Colors and Menu Colors

Nethack with Status Colors and Menu Colors

Unfortunately, because the two patches I’m applying have resulting conflicts- it meant manually applying the patches to the source code in some cases (also: I’m lazy). I, therefore, don’t have an elegant method of actually applying the two patches that I can pass on. What I am doing instead is providing two things: The complete refined archive of the patched Nethack source which should be ready-to-compile on OS 10.6; And also the .diff file produced from a vanilla copy of the source and my own patched version. I will also provide my new updated nethackrc file. (ok… 3 things :-) )

Here’s some details about the setup this provides:

  1. The Status Colors patch is applied. This is a configurable patch allowing you to color code status effects – hunger, blindness, HP, Gold, AC, etc. It’s very, very cool! :-)
  2. Menucolors patch applied. This is a configurable patch that let’s you apply colors to popup menus. e.g. inventory items can be red for cursed, green for blessed, etc. Again, this patch is very neat!
  3. The initial configuration for getting Nethack to build on mac has been taken care of.

So Here are the links to get everything up and running. I should say at this point that this stuff works on my machine and YMMV. If something is broken and you want my to take a look at it just leave a comment of send an email – I’ll try to fix it if I have time. You may also want to dig through the changes in the patch.

  1. nethack-3.4.3-patched.zip
  2. nh343-_menustatus_orig.diff
  3. .nethackrc

I hope this is useful for someone who wants a nice shiny setup of Nethack on Snow Leopard. :-)

Programming , , , , ,

  1. Rhoda
    November 13th, 2009 at 22:26 | #1

    Thanks for enabling my addiction. I was able to enable full regexp with the menucolor patch by uncommenting #define MENU_COLOR_REGEX_POSIX in include/config.h and then changing the menucolor config line in the nethackrc file to escape the parentheses e.g.

    MENUCOLOR=” cursed .* \(being worn\)”=red&underline

    Also I ran into a Bus Error crash with the statuscolor patch when I became encumbered. To fix this I had to change line 453 in src/botl.c from:

    add_colored_text(enc_stat[cap]);
    to:
    add_colored_text(enc_stat[cap], newbot2);

    Hope this helps. Happy hacking!

  2. November 13th, 2009 at 23:51 | #2

    Thanks for the heads up, I’ll add these fixes. :-)
    (and also do a sanity check on the other changes- I guess that would have been a good idea. :-P )

  1. No trackbacks yet.