[comp.binaries.ibm.pc.d] Minor bug in nethack 2.3e

maa@nbires.nbi.com (Mark Armbrust) (05/27/89)

I had a bit of a problem getting nethack 2.3e running on my system.  I tracked
the problem down to the fact that nethack discards the TERMCAP environment
variable if it does not begin with a "/" or a "\".  (For my system, TERMCAP=
C:\MISC\TERMCAP.)  Here is a simple patch to make it accept all values of
TERMCAP:

at offset 5487Eh (346,238 dec) in NETHACK.EXE, change 74h to EBh.  This forces
it to accept any value of TERMCAP.  (You did save BPE.EXE from comp.binaries.
ibm.pc last week, didn't you?  If not, ...)

>ren nethack.exe nethack
>debug nethack
-r
AX=0000  BX=0006  CX=B82E  DX=0000  SP=FFEE  BP=0000  SI=0000  DI=0000
DS=20F8  ES=20F8  SS=20F8  CS=20F8  IP=0100   NV UP EI PL NZ NA PO NC
20F8:0100 4D            DEC     BP
-e 70f8:497e     [note:  70f8 is DS + 5000]
70F8:497E  74.eb
-w
Writing 6B82E bytes
-q
>ren nethack nethack.exe
>

Happy Hacking,

Mark Armbrust
maa@nbires.nbi.com
maa@nbires.UUCP

edlee@chinet.chi.il.us (Edward Lee) (05/28/89)

In article <401@nbires.nbi.com> maa@nbires.UUCP (Mark Armbrust) writes:
>
>I had a bit of a problem getting nethack 2.3e running on my system.  I tracked
>the problem down to the fact that nethack discards the TERMCAP environment
>variable if it does not begin with a "/" or a "\".  (For my system, TERMCAP=
>C:\MISC\TERMCAP.)  Here is a simple patch to make it accept all values of
>TERMCAP:
>[....]

I discovered a simple way to eliminate the TERMCAP environment variable.  All 
you have to do is create a subdirectory called ETC under the root directory 
and put the TERMCAP file in it.  Once you run Nethack v2.3e, it will find 
the TERMCAP file even if the environment variable is not set.  The program 
seems default to the Unix file directory convention.  This slightly reduces 
the time required to start up Nethack.


-Ed L

mhoffman@infocenter.UUCP (Mike Hoffman) (05/31/89)

in article <401@nbires.nbi.com>, maa@nbires.nbi.com (Mark Armbrust) says:
> 
> at offset 5487Eh (346,238 dec) in NETHACK.EXE, change 74h to EBh. 
              ^

Mark goes on to say:
> -e 70f8:497e     [note:  70f8 is DS + 5000]
> 70F8:497E  74.eb
        ^

Well, is it 5487E, or 5497E?

We somehow haven't received Nethack at all yet (communications problems
with our feeder) but I'll keep this on file and keep my fingers
crossed :-)

---
Michael J. Hoffman                                    Voice: (407)255-8116
Manufacturing Engineering                               FAX: (407)255-8186
Encore Computer Corporation                           Email: mhoffman
                                                     USnail: 100 N. Babcock St.
UUCP: {uunet,codas!novavax,sun,pur-ee}!gould!mhoffman        Melbourne, Fl 32935
	"Curiouser and Curiouser" -- Alice in Wonderland

maa@nbires.nbi.com (Mark Armbrust) (05/31/89)

In article <2415@infocenter.UUCP> mhoffman@infocenter.UUCP (Mike Hoffman) writes:
>in article <401@nbires.nbi.com>, maa@nbires.nbi.com (Mark Armbrust) says:
>> 
>> at offset 5487Eh (346,238 dec) in NETHACK.EXE, change 74h to EBh. 
>              ^
>
>Mark goes on to say:
>> -e 70f8:497e     [note:  70f8 is DS + 5000]
>> 70F8:497E  74.eb
>        ^
>
>Well, is it 5487E, or 5497E?

The OFFSET in the file is 5487Eh.  This is the number that you need if you are
using a binary file editor like BPE to do the patch.

When you load a file into memory using the DEBUG command, the file is loaded
starting at DS:100h; therefore, you need to add 100h to the file offset to get
the memory address to patch.

Since the offset is greater than FEFFh, you also need too compute the segment
address as noted above.

if you compare the posted/patched files using "FC /B", the miscompare will be
at the correct file offset.

Hope this clear things up.


Mark Armbrust
maa@nbires.nbi.com
maa@nbires.UUCP
-- 

Mark Armbrust
maa@nbires.nbi.com
maa@nbires.UUCP

kevin@kosman.UUCP (Kevin O'Gorman) (05/31/89)

In article <2415@infocenter.UUCP> mhoffman@infocenter.UUCP (Mike Hoffman) writes:
>in article <401@nbires.nbi.com>, maa@nbires.nbi.com (Mark Armbrust) says:
>> 
>> at offset 5487Eh (346,238 dec) in NETHACK.EXE, change 74h to EBh. 
...

>Well, is it 5487E, or 5497E?

The original article never made it here.  What was this supposed to fix?

There are a couple of candidates I would really like to see fixed: all those
random commas on the screen (seems to be related to monster motion out of
sight of the adventurer), and running into all those nasty Xorn on level 2.
The Xorn really get me -- they keep running me into a horde of Orcs.

While I'm at it: a burning question: are those folks who claim a 50% win rate
for real?  I thought I was pretty good, but I'm content if I get 50% of my
characters to the level where they can take on Orc hordes without worry: i.e.
about 50% of my games get interesting.  One in a few hundred is a win.
There just seem to be too many random ways to die: impassable ghost levels,
Xorn on level 2, lucky hits by the first monster of the game, system shocks,
freshly created acid blobs blocking the only retreat, etc, etc.

I think I could improve the score only a little by being fanatically careful
and calculating, but that would take the fun out of it for me, since I'm
more of a barbarian type myself.

Anyone care to tell me what I'm missing?

steve@eros.ame.arizona.edu (Steve Cannon) (06/01/89)

In article <401@nbires.nbi.com> maa@nbires.UUCP (Mark Armbrust) writes:
>I had a bit of a problem getting nethack 2.3e running on my system.  ...

Besides the aforementioned problem, I found no instructions on how to use 
nethack or what it does. Is figuring out it's functionality a part of the 
test of installing it, or were instructions posted elsewhere that I missed?

For anyone who is willing to take the e-mail time to help me out - Thanks!

(My appologies to those I may have let down by not figuring this out on my
 own.)

Steve Cannon <X> UUCP: ...{uunet,allegra,cmc12,hao!noao,att}!arizona!eros!steve
AME Dept.    <XXXXXXXXXX> Internet: eros!steve@ARIZONA.EDU
University of Arizona <X> Bitnet: scannon@arizrvax
Tucson, AZ 85721      <X> Phone: +1 602 621 6091

hartung@amos.ling.ucsd.edu (Jeff Hartung) (06/02/89)

In article <779@kosman.UUCP> kevin@kosman.UUCP (Root) writes:
>There are a couple of candidates I would really like to see fixed: all those
>random commas on the screen (seems to be related to monster motion out of
>sight of the adventurer), and running into all those nasty Xorn on level 2.
>The Xorn really get me -- they keep running me into a horde of Orcs.

I'm not really sure about the Xorn on level 2 that occasionally shows up
(although I'm pretty sure where in the code this problem might come from), but
the random comma chars can be cleared up by changing the 39 value of the
GRAPHICS option in 'nethack.cnf' to 32.

>I think I could improve the score only a little by being fanatically careful
>and calculating, but that would take the fun out of it for me, since I'm
>more of a barbarian type myself.
>
>Anyone care to tell me what I'm missing?

Although I have it on good authority that this "feature" will be gone from
version 3.0 (whenever it comes out), you can greatly improve your score by
using the #sacrifice command more (which raises your luck).  Edible things
with a food value over 500 will work for this.  ANY food item (hint hint :-)

 --Jeff Hartung--  	
 Disclaimer: My opinions only, etc., etc., BLAH! BLAH! BLAH!...
 ARPA - hartung@amos.ucsd.edu          
 UUCP - ucsd!amos.ucsd.edu!hartung

fisher@sc2a.unige.ch (Markus Fischer) (06/06/89)

In article <2415@infocenter.UUCP>, mhoffman@infocenter.UUCP (Mike Hoffman) writes:
> in article <401@nbires.nbi.com>, maa@nbires.nbi.com (Mark Armbrust) says:
>> 
>> at offset 5487Eh (346,238 dec) in NETHACK.EXE, change 74h to EBh. 
>              ^
> Mark goes on to say:
>> -e 70f8:497e     [note:  70f8 is DS + 5000]
>> 70F8:497E  74.eb
>        ^
> Well, is it 5487E, or 5497E?

It's at offset 5487E !  But debug loads the file at DS:0100 (for the *.com PSP)
or in other words, DS is at file-start -100h.  In this example, the file starts
at 20F8:0100.

Markus Fischer                -|--|--|--|--|--|--I   Department of Anthropology
                        -|--|--|--|--|--|--|-(#)-I   University of Geneva
      -|--|--|--|--|--|--|--|--|-(#)-|-(#)(#)(_)-I   CH-1227  Carouge (GE)
   -&-(_)-|--|--|-(#)-&--|-(#)(#)(_)(#)-&-(_)(#)-I   Switzerland
            -|--|--|--|--|-(#)(_)-|-(_)(_)(_)(#)-I
black (#) to kill ! --|--|-(#)(_)(_)(_)(#)(#)(_)(_)  fisher@sc2a.unige.ch
=+==+==+==+==+==+==+==+==+==+==+==+==+==+==+=(#)=+   fisher@cgeuge52.bitnet