« Return to Thread: Biodiversity patch

Re: Biodiversity patch

by xkernigh :: Rate this Message:

Reply to Author | View in Thread

T. J. Brumfield wrote:
> There are a few places such as: sys/mac/Files.r

sys/mac contains the Mac OS Classic port. I stopped using Mac OS
Classic about four years ago. Without reading documentation for the
Macintosh Programmer's Workshop or MPW, I will have to guess what .r or
.make files might do. MPW has a home page at
http://developer.apple.com/tools/mpw-tools/

Maybe someone else on the mailing list knows more than I do...

(quote from Levels.make)
> "{LibDir}"valley.lev    Ä "{Dat}"gehennom.des "{ObjDir}"LevComp
>        "{ObjDir}"LevComp "{Dat}"gehennom.des
>        SetFile -t "{FileType}" -c "{FileCreator}" Å.lev
>        Move -y Å.lev "{LibDir}"

I guess that this is a makefile rule for MPW. This rule seems to make
the valley.lev file using gehennom.des and LevComp as dependencies.
Because it runs LevComp, it should also make the other .lev files that
use gehennom.des as the source.

This file looks less weird if you open a UTF-8 terminal and use GNU
iconv to convert it from MacRoman to UTF-8.

$ iconv -f MAC -t UTF-8 Levels.make | less

> "{LibDir}"valley.lev    ƒ "{Dat}"gehennom.des "{ObjDir}"LevComp
>                 "{ObjDir}"LevComp "{Dat}"gehennom.des
>                 SetFile -t "{FileType}" -c "{FileCreator}" ≈.lev
>                 Move -y ≈.lev "{LibDir}"

I guess that ƒ means 'from' and ≈.lev is like *.lev in Unix. The three
commands here run LevComp, set some Mac file attributes, and move any
and all .lev files to {LibDir}.

> From the patch, these lines are supposed to be added to
sys/mac/Files.r
> + read 'File' (1165,"heck-a-1.lev") ":lib:heck-a-1.lev";
> + read 'File' (1166,"heck-a-2.lev") ":lib:heck-a-2.lev";
> ...
> + read 'File' (1205,"heck-e-8.lev") ":lib:heck-e-8.lev";
> + read 'File' (1206,"heck-e-9.lev") ":lib:heck-e-9.lev";

Files.r seems to be a resources file. 'File' is a four-letter resource
type, the numbers 1165..1206 are resource ids. This tells the resource
compiler to copy those .lev files into the resource fork of a Mac
application.

As you said, SLASH'EM is different from NetHack because it does not
list the .lev files in Files.r. However, it still needs to copy the
.lev files to the resource fork somehow. Fortunately, SLASH'EM seems to
take care of this automatically. In Macintosh.make I found this rule:

> "{LibDir}"Levels.r ƒ Levels
>         Set Pwd `Directory`
>         Directory "{LibDir}"
>         Echo "" > "{LibDir}"Levels.r
>         Set index 1200
>         For file in ≈.lev
>                 Echo "read 'File' ({index},∂"{file}∂")
∂"::lib:{file}∂";" >> "{LibDir}"Levels.r
>                 Set index `Evaluate {index} + 1`
>         End
>         Echo "" >> "{LibDir}"Levels.list
>         Directory "{Pwd}"

This seems to generate a Levels.r file with all the .lev files from
{LibDir}. So you would not add any lines to Files.r, because this rule
automatically notices any new .lev files.

> What changes if any do I need to make to Levels.make?  Do I do the
following:

> "{LibDir}"heck-a-1.lev  Ä "{Dat}"gehennom.des "{ObjDir}"LevComp
>         "{ObjDir}"LevComp "{Dat}"gehennom.des
>         SetFile -t "{FileType}" -c "{FileCreator}" Å.lev
>         Move -y Å.lev "{LibDir}"

No, you would not add this, because the rule for valley.lev will
generate heck-a-1.lev too.

I could be wrong. I do not have a Mac OS Classic machine. I have a Mac
OS X machine, but without the Classic emulator, so I cannot run MPW. I
am writing this email from an OpenBSD machine.

> Secondly, this is a pretty stupid/basic question, but at work I'm on a
> Windows box, and I'm using Mingw.  I'm used to a Linux box where I can
> select various options at configure time.  The biodiversity patch has
> plenty of compile-time options, but the build instructions for
> Windows/Mingw just says to run setup.bat and then make.  How do I turn
> on/off these compile-time options?

Edit the include/config.h file. This is the normal way to configure
SLASH'EM if you are not using the configure script.

--Kernigh http://nethack.wikia.com/wiki/User:Kernigh



________________________________________________________________________
Check Out the new free AIM(R) Mail -- Unlimited storage and
industry-leading spam and email virus protection.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Slashem-devel mailing list
Slashem-devel@...
https://lists.sourceforge.net/lists/listinfo/slashem-devel

 « Return to Thread: Biodiversity patch