[comp.sources.games.bugs] NetHack 3.0p5 vs. THINKC4

sho@maxwell.physics.purdue.edu (Sho Kuwamoto) (10/22/89)

>2. Has anyone managed to compile NetHack with THINK C 4?  After a few 
>   hours writing functions to replace the macros getuid() and getpid(), 
>   running around fixing swapping botched #ifdef SMALLDATA and #ifdef MACOS,
>   splitting the pray.c etc. segment (86 bytes too big) and doing other 
>   irksome patches I've managed to get the project to compile (with 5 MB
>   of RAM you can just barely squeeze the source and a project file into
>   a 3.5 MB RAM disk and still have room to run THINK C), but now I find
>   that Rez won't compile the resource file.  Argh....  Did someone test
>   this before it was shipped?
>
>John

If you've been through this already, please skip to the bottom to read
an exciting plea.

We had basically the same problems, plus more...

1) same problems with getuid()  (write one yourself, or be sure to 
   #include <unix.h> when needed.)
2) there was a bug (sort of) in makedefs.c, which was passing a
   C string to OpenResFile.  (works in MPW, not in THINKC)  This
   occred when writing the monster info as a resource.
3) cmd.c seemed to redefine M(c) and C(c). (minor)
4) theres a problem with enexto() in makemon.c.  It calls rn2 without
   casting to an integer first.  This causes a lot of calls to rn2
   with zero argument which gives a division by zero error.  Ah, those
   16 bit integers!
5) makedefs has more than 32K of global data.  We got around this by
   getting rid of a large chunk of data, (e.g., the monsters) making
   all the files which didn't rely on the data, restoring it, nuking
   something else, and making the remaining files.
6) the final project has just barely enough global data to push it over 
   32K, with SMALLDATA #defined.  We set all options except for STRONGHOLD, 
   and were over by around 100 bytes.  Berkeley's random() had to go.

Rez compiled our resource file fine....  What kinds of errors are you
getting?

---

ok.  Here's the deal.  Everything seems to be working ok, except we
get a lot of "75% dark gray block" characters (a character which is a
rectangle filled with the inverse of the pattern in a scrollbar...)
where I'm guessing they're probably not supposed to be.  Spiders are
gray blocks, spellbooks are gray blocks sometimes, rings, scrolls,
chests, etc.  No problem with some things, like potions, I think, but
it could be chance, I suppose.  What is the scoop?  The FONT resource
seems to be healthy...

-Sho
--
sho@physics.purdue.edu  <<-- baggy eyes.

6600pete@ucsbuxa.ucsb.edu (10/27/89)

> 2) there was a bug (sort of) in makedefs.c, which was passing a
>    C string to OpenResFile.  (works in MPW, not in THINKC)  This
>    occred when writing the monster info as a resource.

Known quirk of the ROMs. Has to do with 32-bit cleanliness and a printer
driver bug. There's a tech note on it. MPW probably knows about it and
has a fix for it in glue, whereas THINK probably doesn't.
--
  | GurgleKat (Pete Gontier), pete@cavevax.ucsb.edu
  | .UUCP reply addresses bounce; try another path.
  | ...if you'd gone to Dartmouth, you'd not have had to take the math.