home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
games
/
volume7
/
nethack3
/
patch4h
/
patches04h
Wrap
Text File
|
1989-10-02
|
57KB
|
2,025 lines
*** auxil/Old/help Wed Sep 27 10:17:39 1989
--- auxil/help Thu Sep 14 13:20:36 1989
***************
*** 139,149 ****
the commands you can use with "#" type "#?". The extended
commands you can use depends upon what options the game was
compiled with, along with your class and what type of monster
! you most closely resemble at a given moment. If your keyboard
! has a meta key (that is, one which when pressed in combination
! with another key modified it by turning on the 'meta' or 0x80
! bit) these extended commands can be invoked by meta-ing the
! first letter of the command.
If the "number_pad" option is on, some additional letter commands
are available:
--- 139,149 ----
the commands you can use with "#" type "#?". The extended
commands you can use depends upon what options the game was
compiled with, along with your class and what type of monster
! you most closely resemble at a given moment. If your keyboard
! has a meta key (which, when pressed in combination with another
! key, modifies it by setting the 'meta' (8th, or 'high') bit),
! these extended commands can be invoked by meta-ing the first
! letter of the command.
If the "number_pad" option is on, some additional letter commands
are available:
*** auxil/Old/hh Wed Sep 27 10:17:53 1989
--- auxil/hh Thu Sep 14 13:20:41 1989
***************
*** 7,59 ****
G<dir>, same, except a branching corridor isn't
^<dir>: considered interesting
m<dir>: move without picking up objects
! If the numberpad option is set, the number keys move instead.
! Meta commands:
! ? help print one of several informative texts
Q quit end the game
S save save the game (to be continued later)
! sh escape to some SHELL (if allowed)
^Z suspend suspend the game (independent of your current suspend char)
O options set options
! / whatis give name (and sometimes more info) of specified monster
! \ known print list of what's been discovered
! v version print version number
! V history print game history
! ^A again redo the previous command
! ^R redraw redraw the screen (^R denotes the symbol CTRL/R)
! ^P print repeat last message (subsequent ^P's repeat earlier messages)
! # introduces a long command (# ? for list of long commands)
Game commands:
- ^T 'port teleport (if you can)
^D kick kick (a door, or something else)
a apply apply or use a tool (pick-axe, key, camera, etc.)
! A remove take off all armor
c close close a door
! C name name an individual monster (e.g., baptize your dog)
d drop drop an object. d7a: drop seven items of object 'a'
! D drop drop several things
e eat eat something
E engrave write a message in the dust on the floor (E- use fingers)
! i invent list the inventory (all objects you are carrying)
! I invent list selected parts of the inventory
Iu: list unpaid objects
Ix: list unpaid but used up items
I$: count your money
o open open a door
! p pay pay your bill
! P wear put on a ring
q quaff drink a potion
r read read a scroll or spell book
R remove remove a ring
s search search for secret doors, hidden traps and monsters
t throw throw or shoot a weapon
! T remove take off some armor
w wield wield a weapon (w- wield nothing)
W wear put on some armor
z zap zap a wand
! Z cast cast a spell
< up go up the stairs
> down go down the stairs
^ trap_id identify a previously found trap
--- 7,59 ----
G<dir>, same, except a branching corridor isn't
^<dir>: considered interesting
m<dir>: move without picking up objects
! If the number_pad option is set, the number keys move instead.
! General commands:
! ? help display one of several informative texts
Q quit end the game
S save save the game (to be continued later)
! sh escape to some SHELL (if allowed)
^Z suspend suspend the game (independent of your current suspend char)
O options set options
! / whatis tell what a map symbol represents
! \ known display list of what's been discovered
! v version display version number
! V history display game history
! ^A again redo the previous command (^A denotes the keystroke CTRL-A)
! ^R redraw redraw the screen
! ^P prevmsg repeat previous message (subsequent ^P's repeat earlier ones)
! # introduces an extended command (#? for a list of them)
Game commands:
^D kick kick (a door, or something else)
+ ^T 'port teleport (if you can)
a apply apply or use a tool (pick-axe, key, camera, etc.)
! A armor take off all armor
c close close a door
! C call name an individual monster (ex. baptize your dog)
d drop drop an object. d7a: drop seven items of object 'a'
! D Drop drop selected types of objects
e eat eat something
E engrave write a message in the dust on the floor (E- use fingers)
! i invent list your inventory (all objects you are carrying)
! I Invent list selected parts of your inventory
Iu: list unpaid objects
Ix: list unpaid but used up items
I$: count your money
o open open a door
! p pay pay your bill (in a shop)
! P puton put on a ring
q quaff drink a potion
r read read a scroll or spell book
R remove remove a ring
s search search for secret doors, hidden traps and monsters
t throw throw or shoot a weapon
! T takeoff take off some armor
w wield wield a weapon (w- wield nothing)
W wear put on some armor
z zap zap a wand
! Z Zap cast a spell
< up go up the stairs
> down go down the stairs
^ trap_id identify a previously found trap
***************
*** 62,78 ****
+ spells list the spells you know
. rest wait a moment
, pickup pick up all you can carry
! @ turn "autopickup" on and off
: look look at what is here
! And if the "number_pad" option is on, these additional commands:
n followed by number of times to repeat the next command
! j jump jump to a location
! k kick kick a door
l loot loot a box on the floor
! N name name an object or type of object
! u untrap untrap a trapped object
!
! If your keyboard has a meta key, 'jump' 'loot', 'name' and 'untrap' are
! available as M-j, M-l, M-N or M-u respectively.
--- 62,92 ----
+ spells list the spells you know
. rest wait a moment
, pickup pick up all you can carry
! @ toggle "pickup" (auto pickup) option on and off
: look look at what is here
! Keyboards that have a meta key can also use these extended commands:
!
! M-c chat talk to someone
! M-d dip dip an object into something
! M-f force force a lock
! M-j jump jump to another location
! M-l loot loot a box on the floor
! M-m monster use a monster's special ability (only if defined)
! M-N name name an item or type of object
! M-o offer offer a sacrifice to the gods (only if defined)
! M-p pray pray to the gods for help (only if defined)
! M-r rub rub a lamp
! M-s sit sit down
! M-t turn turn undead
! M-u untrap untrap something (usually a trapped object)
! M-w wipe wipe off your face
+ If the "number_pad" option is on, these additional commands are available:
+
n followed by number of times to repeat the next command
! j jump jump to another location
! k kick kick something (usually a door)
l loot loot a box on the floor
! N name name an item or type of object
! u untrap untrap something (usually a trapped object)
*** auxil/Old/history Wed Sep 27 10:18:08 1989
--- auxil/history Sat Sep 16 17:54:33 1989
***************
*** 29,34 ****
--- 29,35 ----
Timo Hakulinen ported NetHack 3.0 to OS/2.
+ David Gentzel ported NetHack 3.0 to VMS.
From time to time, some depraved individual out there in netland sends a
particularly intriguing modification to help out with the game. The Gods of
*** auxil/Old/nethack.6 Wed Sep 27 10:18:41 1989
--- auxil/nethack.6 Sun Sep 17 12:29:03 1989
***************
*** 99,106 ****
.B \-D
or
.B \-X
! option will start the game in a special non-scoring discovery mode
! (or in debugging (wizard) mode if the player is the game administrator).
.PP
The
.B \-d
--- 99,108 ----
.B \-D
or
.B \-X
! option will start the game in a special non-scoring discovery mode.
! .B \-D
! will, if the player is the game administrator, start in debugging (wizard)
! mode instead.
.PP
The
.B \-d
*** auxil/Old/opthelp Wed Sep 27 10:19:01 1989
--- auxil/opthelp Thu Sep 14 14:46:43 1989
***************
*** 34,43 ****
null allow nulls to be sent to your terminal [TRUE]
standout use standout mode for --More-- on messages [FALSE]
! Any Boolean option can be negated by prefixing it with a '!' or 'no'.
!
!
--- 34,43 ----
null allow nulls to be sent to your terminal [TRUE]
standout use standout mode for --More-- on messages [FALSE]
! Boolean option if TEXTCOLOR was set at compile time:
! color use different colors for objects on screen [TRUE]
! Any Boolean option can be negated by prefixing it with a '!' or 'no'.
*** include/Old/amiconf.h Wed Sep 27 13:08:56 1989
--- include/amiconf.h Thu Sep 14 23:31:24 1989
***************
*** 1,4 ****
! /* SCCS Id: @(#)amiconf.h 3.0 89/04/28
/* NetHack may be freely redistributed. See license for details. */
#ifndef AMICONF_H
--- 1,4 ----
! /* SCCS Id: @(#)amiconf.h 3.0 89/09/04
/* NetHack may be freely redistributed. See license for details. */
#ifndef AMICONF_H
***************
*** 22,27 ****
--- 22,30 ----
#undef index
#undef rindex
+ extern char *index P((const char *,int));
+ extern char *rindex P((const char *,int));
+ #define memcpy(dest, source, size) movmem(source, dest, size)
/*
* Configurable Amiga options:
*** include/Old/artifact.h Wed Sep 27 13:09:09 1989
--- include/artifact.h Mon Sep 25 20:58:06 1989
***************
*** 6,32 ****
#ifndef ARTIFACT_H
#define ARTIFACT_H
! #define SPFX_NONE 0x00 /* no special effects, just a bonus */
! #define SPFX_NOGEN 0x01 /* item is special, bequeathed by gods */
! #define SPFX_RESTR 0x02 /* item is restricted - can't be named */
! #define SPFX_INTEL 0x04 /* item is self-willed - intelligent */
! #define SPFX_SPEEK 0x08 /* item can speak */
! #define SPFX_SEEK 0x10 /* item helps you search for things */
! #define SPFX_WARN 0x20 /* item warns you of danger */
! #define SPFX_ATTK 0x40 /* item has a special attack (attk) */
! #define SPFX_DEFN 0x80 /* item has a special defence (defn) */
! #define SPFX_DMONS 0x100 /* attack bonus on one type of monster */
! #define SPFX_DCLAS 0x200 /* attack bonus on one class of monster */
! #define SPFX_DRLI 0x400 /* drains a level from monsters */
! #define SPFX_SEARCH 0x800 /* helps searching */
struct artifact {
unsigned otyp;
char *name;
unsigned spfx;
! unsigned mtype;
struct attack attk, defn;
! unsigned align;
};
#endif /* ARTIFACT_H /* */
--- 6,37 ----
#ifndef ARTIFACT_H
#define ARTIFACT_H
! #define SPFX_NONE 0x0000 /* no special effects, just a bonus */
! #define SPFX_NOGEN 0x0001 /* item is special, bequeathed by gods */
! #define SPFX_RESTR 0x0002 /* item is restricted - can't be named */
! #define SPFX_INTEL 0x0004 /* item is self-willed - intelligent */
! #define SPFX_SPEEK 0x0008 /* item can speak */
! #define SPFX_SEEK 0x0010 /* item helps you search for things */
! #define SPFX_WARN 0x0020 /* item warns you of danger */
! #define SPFX_ATTK 0x0040 /* item has a special attack (attk) */
! #define SPFX_DEFN 0x0080 /* item has a special defence (defn) */
! #define SPFX_DRLI 0x0100 /* drains a level from monsters */
! #define SPFX_SEARCH 0x0200 /* helps searching */
! #define SPFX_DMONS 0x1000 /* attack bonus on one monster type */
! #define SPFX_DCLAS 0x2000 /* attack bonus on monsters w/ symbol mtype */
! #define SPFX_DFLAG1 0x4000 /* attack bonus on monsters w/ mflags1 flag */
! #define SPFX_DFLAG2 0x8000 /* attack bonus on monsters w/ mflags2 flag */
+ #define SPFX_DBONUS 0xF000 /* attack bonus mask */
+
struct artifact {
unsigned otyp;
char *name;
unsigned spfx;
! unsigned long mtype; /* monster type, symbol, or flag */
struct attack attk, defn;
! uchar align; /* alignment of bequeathing gods */
! char class; /* character class associated with */
};
#endif /* ARTIFACT_H /* */
*** include/Old/config.h Wed Sep 27 13:09:29 1989
--- include/config.h Mon Sep 25 20:55:44 1989
***************
*** 9,15 ****
/*
* Section 1: OS selection.
* Select the version of the OS you are using.
! * For "UNIX" select either SYSV or BSD in unixconf.h
*/
#define UNIX /* delete if no fork(), exec() available */
--- 9,17 ----
/*
* Section 1: OS selection.
* Select the version of the OS you are using.
! * For "UNIX" select either SYSV or BSD in unixconf.h.
! * A "VMS" option is not needed since the VMS C-compiler
! * provides it (comment out the default OS option here).
*/
#define UNIX /* delete if no fork(), exec() available */
*** include/Old/decl.h Wed Sep 27 13:09:52 1989
--- include/decl.h Tue Sep 26 12:59:11 1989
***************
*** 13,24 ****
E int nroom;
E int multi;
E int hackpid;
! #ifdef UNIX
E int locknum;
#ifdef DEF_PAGER
E char *catmore;
#endif /* DEF_PAGER */
- #endif /* UNIX */
E char SAVEF[];
E char *hname;
E const char *hu_stat[]; /* defined in eat.c */
--- 13,24 ----
E int nroom;
E int multi;
E int hackpid;
! #if defined(UNIX) || defined(VMS)
E int locknum;
+ #endif
#ifdef DEF_PAGER
E char *catmore;
#endif /* DEF_PAGER */
E char SAVEF[];
E char *hname;
E const char *hu_stat[]; /* defined in eat.c */
***************
*** 97,103 ****
E coord dig_pos;
E boolean dig_down;
! E long moves;
E long wailmsg;
E boolean in_mklev;
--- 97,103 ----
E coord dig_pos;
E boolean dig_down;
! E long moves, monstermoves;
E long wailmsg;
E boolean in_mklev;
***************
*** 121,134 ****
#endif
#ifdef TEXTCOLOR
#define RED 1
#define GREEN 2
! #define YELLOW 3
#define BLUE 4
#define MAGENTA 5
#define CYAN 6
#define WHITE 7
! E char *HI_COLOR[8]; /* termcap.c */
#endif
#ifndef OBJ_H
--- 121,158 ----
#endif
#ifdef TEXTCOLOR
+
+ #define BLACK 0
#define RED 1
#define GREEN 2
! #define BROWN 3 /* on IBM, lo-intensity yellow is brown */
#define BLUE 4
#define MAGENTA 5
#define CYAN 6
#define WHITE 7
! #define GRAY 7 /* lo-intensity white */
! #define BRIGHT 8
! #define ORANGE_COLORED 9
! #define YELLOW 11
! #define MAXCOLORS 16 /* 8 basic + 8 bright */
!
! /* these can be configured */
! # define HI_MON RED + BRIGHT /* red slaps! */
! # define HI_OBJ MAGENTA
! # define HI_METAL CYAN
! # define HI_COPPER YELLOW
! # define HI_SILVER GRAY
! # define HI_GOLD YELLOW
! # define HI_LEATHER BROWN
! # define HI_CLOTH BROWN
! # define HI_ORGANIC GREEN
! # define HI_WOOD BROWN
! # define HI_PAPER BROWN
! # define HI_GLASS CYAN + BRIGHT
! # define HI_MINERAL GRAY
! # define HI_ZAP BLUE + BRIGHT /* blue zaps! */
!
! E char *hilites[MAXCOLORS];
#endif
#ifndef OBJ_H
*** include/Old/extern.h Wed Sep 27 13:10:43 1989
--- include/extern.h Tue Sep 26 19:11:23 1989
***************
*** 5,11 ****
#ifndef EXTERN_H
#define EXTERN_H
! #if defined(MSDOS) && !defined(__TURBOC__)
/* MSC include files do not contain "extern" keyword */
#define E
#else
--- 5,11 ----
#ifndef EXTERN_H
#define EXTERN_H
! #if defined(MSDOS) && defined(MSC)
/* MSC include files do not contain "extern" keyword */
#define E
#else
***************
*** 12,17 ****
--- 12,25 ----
#define E extern
#endif
+ /* ### allmain.c ### */
+
+ E int (*occupation)();
+ E int (*afternmv)();
+ E void moveloop();
+ E void stop_occupation();
+ E void newgame();
+
/* ### alloc.c ### */
#ifndef __TURBOC__
***************
*** 341,348 ****
E void delobj P((struct obj *));
E void freeobj P((struct obj *));
E void freegold P((struct gold *));
- E struct monst *m_at P((int,int));
- E struct obj *o_at P((int,int));
E struct obj *sobj_at P((int,int,int));
E int carried P((struct obj *));
E struct obj *carrying P((int));
--- 349,354 ----
***************
*** 404,410 ****
E void enexto P((coord *,XCHAR_P,XCHAR_P,struct permonst *));
E int goodpos P((int,int, struct permonst *));
E void rloc P((struct monst *));
- E struct monst *mkmon_at P((char *,int,int));
E void init_monstr();
E struct permonst *rndmonst();
E struct permonst *mkclass P((CHAR_P));
--- 410,415 ----
***************
*** 490,496 ****
E boolean is_rustprone P((struct obj *));
E boolean is_corrodeable P((struct obj *));
#endif
- E boolean OBJ_AT P((int,int));
E void place_object P((struct obj *,int,int));
E void move_object P((struct obj *,int,int));
E void remove_object P((struct obj *));
--- 495,500 ----
***************
*** 528,534 ****
E void unstuck P((struct monst *));
E void killed P((struct monst *));
E void xkilled P((struct monst *,int));
- E void kludge V((char *,char *,...));
E void rescham();
E void restartcham();
E int newcham P((struct monst *,struct permonst *));
--- 532,537 ----
***************
*** 578,583 ****
--- 581,592 ----
E int m_move P((struct monst *,int));
E void set_apparxy P((struct monst *));
E boolean mdig_tunnel P((struct monst *));
+ #ifdef STUPID_CPP
+ E void place_monster P((struct monst *, int, int));
+ E void place_worm_seg P((struct monst *, int, int));
+ E void remove_monster P((int, int));
+ E struct monst *m_at P((int, int));
+ #endif
/* ### monst.c ### */
***************
*** 617,627 ****
#ifdef TOS
E int _copyfile P((char *, char *));
E int kbhit();
#endif /* TOS */
/* ### mthrowu.c ### */
! E int thitu P((int,int,char *));
E int thrwmu P((struct monst *));
E int spitmu P((struct monst *));
E int breamu P((struct monst *,struct attack *));
--- 626,638 ----
#ifdef TOS
E int _copyfile P((char *, char *));
E int kbhit();
+ E void restore_colors();
+ E void set_colors();
#endif /* TOS */
/* ### mthrowu.c ### */
! E int thitu P((int,int,struct obj *,char *));
E int thrwmu P((struct monst *));
E int spitmu P((struct monst *));
E int breamu P((struct monst *,struct attack *));
***************
*** 657,663 ****
E void lcase P((char *));
E char *makeplural P((char *));
E struct obj *readobjnam P((char *));
- E boolean uses_known P((struct obj *));
/* ### options.c ### */
--- 668,673 ----
***************
*** 689,708 ****
#ifdef SHELL
E int dosh();
#endif /* SHELL */
E int child P((int));
#endif /* UNIX */
/* ### pcmain.c ### */
#ifdef MSDOS
- E int (*occupation)();
- E int (*afternmv)();
E void askname();
- E void impossible V((char *,...));
#ifdef CHDIR
E void chdirx P((char *,BOOLEAN_P));
#endif /* CHDIR */
- E void stop_occupation();
#endif /* MSDOS */
/* ### pctty.c ### */
--- 699,716 ----
#ifdef SHELL
E int dosh();
#endif /* SHELL */
+ #if defined(SHELL) || defined(DEF_PAGER) || defined(DEF_MAILREADER)
E int child P((int));
+ #endif
#endif /* UNIX */
/* ### pcmain.c ### */
#ifdef MSDOS
E void askname();
#ifdef CHDIR
E void chdirx P((char *,BOOLEAN_P));
#endif /* CHDIR */
#endif /* MSDOS */
/* ### pctty.c ### */
***************
*** 957,963 ****
E void pay_for_door P((int,int,char *));
E void addtobill P((struct obj *,BOOLEAN_P));
E void splitbill P((struct obj *,struct obj *));
! E void subfrombill P((struct obj *));
E int doinvbill P((int));
E int shkcatch P((struct obj *));
E int shk_move P((struct monst *));
--- 965,971 ----
E void pay_for_door P((int,int,char *));
E void addtobill P((struct obj *,BOOLEAN_P));
E void splitbill P((struct obj *,struct obj *));
! E void sellobj P((struct obj *));
E int doinvbill P((int));
E int shkcatch P((struct obj *));
E int shk_move P((struct monst *));
***************
*** 1060,1072 ****
--- 1068,1087 ----
E void more();
E void cmore P((char *));
E void clrlin();
+ #ifdef NEED_VARARGS
+ #if defined(USE_STDARG) || defined(USE_VARARGS)
+ E void vpline P((const char *, va_list));
+ #endif
+ #endif
E void pline V((const char *,...));
E void Norep V((const char *,...));
E void You V((const char *,...));
E void Your V((const char *,...));
+ E void kludge V((char *,char *,...));
E void putsym P((CHAR_P));
E void putstr P((char *));
E char yn_function P((char *,CHAR_P));
+ E void impossible V((char *,...));
/* ### topten.c ### */
***************
*** 1129,1140 ****
/* ### unixmain.c ### */
#ifdef UNIX
- E int (*occupation)();
- E int (*afternmv)();
E void glo P((int));
E void askname();
- E void impossible V((char *,...));
- E void stop_occupation();
#endif /* UNIX */
/* ### unixtty.c ### */
--- 1144,1151 ----
***************
*** 1175,1180 ****
--- 1186,1241 ----
/* ### version.c ### */
E int doversion();
+
+ /* ### vmsmain.c ### */
+
+ #ifdef VMS
+ #ifdef CHDIR
+ E void chdirx P((char *,char));
+ #endif /* CHDIR */
+ E void glo P((int));
+ E void askname();
+ #endif /* VMS */
+
+ /* ### vmsmisc.c ### */
+
+ #ifdef VMS
+ E void vms_abort();
+ E void vms_exit();
+ #endif /* VMS */
+
+ /* ### vmstty.c ### */
+
+ #ifdef VMS
+ E void gettty();
+ E void settty P((char *));
+ E void setftty();
+ E void intron();
+ E void introff();
+ E void error V((char *,...));
+ #endif /* VMS */
+
+ /* ### vmsunix.c ### */
+
+ #ifdef VMS
+ E void setrandom();
+ E int getyear();
+ E char *getdate();
+ E int phase_of_the_moon();
+ E int night();
+ E int midnight();
+ E void gethdate P((char *));
+ E int uptodate P((int));
+ E void getlock();
+ E void regularize P((char *));
+ E int vms_creat P((char *,unsigned int));
+ E int vms_getuid();
+ E void privoff();
+ E void privon();
+ # ifdef SHELL
+ E int dosh();
+ # endif
+ #endif /* VMS */
/* ### weapon.c ### */
*** include/Old/flag.h Wed Sep 27 13:11:28 1989
--- include/flag.h Thu Sep 14 14:46:21 1989
***************
*** 51,56 ****
--- 51,59 ----
boolean silent; /* whether the bell rings or not */
boolean pickup; /* whether you pickup or move and look */
boolean num_pad; /* use numbers for movement commands */
+ #ifdef TEXTCOLOR
+ boolean use_color; /* use color grapics */
+ #endif
#ifdef DGK
boolean IBMBIOS; /* whether we can use a BIOS call for
* redrawing the screen and character input */
*** include/Old/global.h Wed Sep 27 13:11:49 1989
--- include/global.h Mon Sep 25 20:55:26 1989
***************
*** 9,15 ****
/* #define BETA /* if a beta-test copy [MRS] */
! #define VERSION "3.0f" /* version number. */
/*
* Files expected to exist in the playground directory.
--- 9,15 ----
/* #define BETA /* if a beta-test copy [MRS] */
! #define VERSION "3.0g" /* version number. */
/*
* Files expected to exist in the playground directory.
***************
*** 117,122 ****
--- 117,127 ----
#ifndef COORD_H
#include "coord.h"
#endif
+
+ #if defined(VMS) && !defined(VMSCONF_H)
+ # include "vmsconf.h"
+ #endif
+
#if defined(UNIX) && !defined(UNIXCONF_H)
# include "unixconf.h"
#endif
*** include/Old/monst.h Wed Sep 27 13:13:23 1989
--- include/monst.h Thu Sep 14 14:24:49 1989
***************
*** 68,74 ****
#define newmonst(xl) (struct monst *) alloc((unsigned)(xl) + sizeof(struct monst))
- extern struct monst *fmon;
extern struct monst *mydogs, *fallen_down;
/* these are in mspeed */
--- 68,73 ----
*** include/Old/obj.h Wed Sep 27 13:13:52 1989
--- include/obj.h Sat Sep 23 01:27:18 1989
***************
*** 7,12 ****
--- 7,13 ----
struct obj {
struct obj *nobj;
+ struct obj *nexthere; /* for location lists */
struct obj *cobj; /* id of container object is in */
/* unsigned o_cwt; /* container weight capacity */
unsigned o_id;
***************
*** 45,54 ****
Bitfield(onamelth,6);
long age; /* creation date */
long owornmask;
/* note that TIMEOUT in you.h is defined as 07777L; no bits for items that
! * confer properties may overlap that mask, or timeout.c will happily rearrange
! * the bits behind the back of the property code
* shirts, balls, and chains are currently safe
*/
#define W_BALL 02000L
--- 46,56 ----
Bitfield(onamelth,6);
long age; /* creation date */
long owornmask;
+ #define oeaten rustfree
/* note that TIMEOUT in you.h is defined as 07777L; no bits for items that
! * confer properties may overlap that mask, or timeout.c will happily
! * rearrange the bits behind the back of the property code
* shirts, balls, and chains are currently safe
*/
#define W_BALL 02000L
***************
*** 75,88 ****
is flexible; amount for tmp gold objects */
};
- extern struct obj *fobj;
-
#define newobj(xl) (struct obj *) alloc((unsigned)(xl) + sizeof(struct obj))
#define ONAME(otmp) ((char *) otmp->oextra)
#define OGOLD(otmp) (otmp->oextra[0])
# ifndef STUPID_CPP /* otherwise these macros are functions */
- /* #define OBJ_AT(x,y) (levl[x][y].omask) */
#define Is_container(otmp) (otmp->otyp >= ICE_BOX && otmp->otyp <= BAG_OF_TRICKS)
#define Is_box(otmp) (otmp->otyp == LARGE_BOX || otmp->otyp == CHEST)
--- 77,88 ----
is flexible; amount for tmp gold objects */
};
#define newobj(xl) (struct obj *) alloc((unsigned)(xl) + sizeof(struct obj))
#define ONAME(otmp) ((char *) otmp->oextra)
#define OGOLD(otmp) (otmp->oextra[0])
+ #define OEATEN(otmp) (otmp->oeaten)
# ifndef STUPID_CPP /* otherwise these macros are functions */
#define Is_container(otmp) (otmp->otyp >= ICE_BOX && otmp->otyp <= BAG_OF_TRICKS)
#define Is_box(otmp) (otmp->otyp == LARGE_BOX || otmp->otyp == CHEST)
*** include/Old/objclass.h Wed Sep 27 13:14:06 1989
--- include/objclass.h Thu Sep 14 14:53:21 1989
***************
*** 13,18 ****
--- 13,22 ----
char *oc_uname; /* called by user */
Bitfield(oc_name_known,1);
Bitfield(oc_merge,1); /* merge otherwise equal objects */
+ Bitfield(oc_uses_known,1); /* obj->known affects full decription */
+ /* otherwise, obj->dknown and obj->bknown */
+ /* tell all, and obj->known should always */
+ /* be set for proper merging behavior */
Bitfield(oc_bool,1);
#define oc_bimanual oc_bool /* for weapons */
#define oc_bulky oc_bool /* for armor */
***************
*** 35,40 ****
--- 39,47 ----
int oc_cost; /* base cost in shops */
schar oc_oc1, oc_oc2;
int oc_oi;
+ #ifdef TEXTCOLOR
+ uchar oc_color; /* color of the object */
+ #endif /* TEXTCOLOR */
#define nutrition oc_oi /* for foods */
#define w_propellor oc_oi /* for weapons */
#define WP_BOW 1
*** include/Old/patchlevel.h Wed Sep 27 13:14:18 1989
--- include/patchlevel.h Wed Sep 27 13:08:27 1989
***************
*** 17,27 ****
--- 17,29 ----
* add better screen-size sensing
* expand color use for PCs and introduce it for SVR3 UNIX machines
* extend '/' to multiple identifications
+ * allow meta key to be used to invoke extended commands
* fix various minor bugs, and do further code cleaning
*/
/*
* Patch 3, September 6, 1989
+ * add war hammers and revise object prices
* extend prototypes to ANSI compilers in addition to the previous MSDOS ones
* move object-on-floor references into functions in preparation for planned
* data structures to allow faster access and better colors
***************
*** 29,32 ****
* patches
*/
! #define PATCHLEVEL 3
--- 31,46 ----
* patches
*/
! /*
! * Patch 4, September 27, 1989
! * add support for VMS (courtesy David Gentzel)
! * move monster-on-floor references into functions and implement the new
! * lookup structure for both objects and monsters
! * extend the definitions of objects and monsters to provide "living color"
! * in the dungeon, instead of a single monster color
! * ifdef varargs usage to satisfy ANSI compilers
! * standardize on the color 'gray'
! * assorted bug fixes
! */
!
! #define PATCHLEVEL 4
*** include/Old/pcconf.h Wed Sep 6 23:46:25 1989
--- include/pcconf.h Tue Sep 19 01:14:13 1989
***************
*** 93,107
# define TEXTCOLOR /* */
#endif
! #ifdef TEXTCOLOR
! /* configurable colors */
! # define HI_MON RED /* red slaps! */
! # define HI_OBJ MAGENTA
! # define HI_METAL CYAN
! # define HI_ORGANIC GREEN
! # define HI_GOLD YELLOW
! # define HI_ZAP BLUE /* blue zaps! */
! #endif
!
! #endif
#endif /* MSDOS /* */
--- 93,97 -----
# define TEXTCOLOR /* */
#endif
! #endif /* PCCONF_H /* */
#endif /* MSDOS /* */
*** include/Old/permonst.h Wed Sep 27 13:14:41 1989
--- include/permonst.h Thu Sep 14 14:49:22 1989
***************
*** 46,51 ****
--- 46,54 ----
uchar msound; /* noise it makes */
long mflags1, /* boolean bitflags */
mflags2; /* more boolean bitflags */
+ # ifdef TEXTCOLOR
+ uchar mcolor; /* color to use */
+ # endif
};
extern struct permonst mons[]; /* the master list of monster types */
*** include/Old/rm.h Wed Sep 27 13:15:00 1989
--- include/rm.h Fri Sep 15 11:45:15 1989
***************
*** 206,213 ****
Bitfield(seen,1);
Bitfield(lit,1);
Bitfield(doormask,5);
- Bitfield(mmask,1);
- Bitfield(omask,1);
Bitfield(gmask,1);
};
--- 206,211 ----
***************
*** 216,222 ****
#define ladder doormask
#define drawbridgemask doormask
! extern struct rm levl[COLNO][ROWNO];
#if defined(DGK) && !defined(OLD_TOS)
#define ACTIVE 1
--- 214,249 ----
#define ladder doormask
#define drawbridgemask doormask
! typedef struct
! {
! struct rm locations[COLNO][ROWNO];
! struct obj *objects[COLNO][ROWNO];
! struct monst *monsters[COLNO][ROWNO];
! struct obj *objlist;
! struct monst *monlist;
! }
! level_t;
!
! extern level_t level; /* structure describing the current level */
!
! /*
! * Macros for compatibility with old code. Someday these will go away.
! */
! #define OBJ_AT(x, y) (level.objects[x][y] != (struct obj *)0)
! #define MON_AT(x, y) (level.monsters[x][y] != (struct monst *)0)
! #define levl level.locations
! #define fobj level.objlist
! #define fmon level.monlist
!
! #ifndef STUPID_CPP /* otherwise these macros are functions in monmove.c */
! /*
! * Macros for encapsulation of level.monsters references.
! */
! #define place_monster(m, x, y) level.monsters[m->mx=x][m->my=y] = m
! #define place_worm_seg(m, x, y) level.monsters[x][y] = m
! #define remove_monster(x, y) level.monsters[x][y] = (struct monst *)0
! #define m_at(x, y) level.monsters[x][y]
! #endif /* STUPID_CPP */
#if defined(DGK) && !defined(OLD_TOS)
#define ACTIVE 1
*** include/Old/system.h Wed Sep 27 13:15:31 1989
--- include/system.h Sun Sep 17 14:26:28 1989
***************
*** 37,42 ****
--- 37,46 ----
# endif
#endif
+ #ifdef VMS
+ # define off_t long
+ #endif
+
/* You may want to change this to fit your system, as this is almost
* impossible to get right automatically.
* This is the type of signal handling functions.
***************
*** 170,179 ****
--- 174,199 ----
#endif
#endif
+ #ifdef NEED_VARARGS
+ #if defined(USE_STDARG) || defined(USE_VARARGS)
+ E int vsprintf P((char *, const char *, va_list));
+ E int vprintf P((const char *, va_list));
+ #else
+ # define vprintf printf
+ # define vsprintf sprintf
+ # define vpline pline
+ #endif
+ #endif /* NEED_VARARGS */
+
#define Sprintf (void) sprintf
#define Strcat (void) strcat
#define Strcpy (void) strcpy
#define Printf (void) printf
+
+ #ifdef NEED_VARARGS
+ #define Vprintf (void) vprintf
+ #define Vsprintf (void) vsprintf
+ #endif
E int tgetent P((char *,char *));
E int tgetnum P((char *));
*** include/Old/tosconf.h Wed Sep 27 13:15:45 1989
--- include/tosconf.h Thu Sep 14 14:46:25 1989
***************
*** 33,41 ****
--- 33,43 ----
#define Srand() srand()
#endif
+ /* configurable options */
#define DGK
#define RANDOM
#define SHELL
+ #define TEXTCOLOR
#ifndef MSDOS_H
#include "msdos.h"
*** include/Old/tradstdc.h Wed Sep 27 13:15:56 1989
--- include/tradstdc.h Sun Sep 17 14:26:33 1989
***************
*** 15,20 ****
--- 15,76 ----
* Makes substitutes for compatibility with the old C standard.
*/
+ /* Decide how to handle variable parameter lists:
+ * USE_STDARG means use the ANSI <stdarg.h> facilities (only ANSI compilers
+ * should do this, and only if the library supports it).
+ * USE_VARARGS means use the <varargs.h> facilities. Again, this should only
+ * be done if the library supports it. ANSI is *not* required for this.
+ * Otherwise, the kludgy old methods are used.
+ * The defaults are USE_STDARG for ANSI compilers, and USE_OLDARGS for
+ * others.
+ */
+
+ /* #define USE_VARARGS /* use <varargs.h> instead of <stdarg.h> */
+ /* #define USE_OLDARGS /* don't use any variable argument facilites */
+
+ #ifdef __STDC__
+ # if !(defined(AMIGA) || defined(USE_VARARGS) || defined(USE_OLDARGS))
+ # define USE_STDARG
+ # endif
+ #endif
+
+ #ifdef NEED_VARARGS /* only define these if necessary */
+ #ifdef USE_STDARG
+ # include <stdarg.h>
+ # define VA_DECL(typ1,var1) (typ1 var1, ...) { va_list the_args;
+ # define VA_DECL2(typ1,var1,typ2,var2) \
+ (typ1 var1, typ2 var2, ...) { va_list the_args;
+ # define VA_INIT(var1,typ1)
+ # define VA_NEXT(var1,typ1) var1 = va_arg(the_args, typ1)
+ # define VA_ARGS the_args
+ # define VA_START(x) va_start(the_args, x)
+ # define VA_END() va_end(the_args)
+ #else
+ # ifdef USE_VARARGS
+ # include <varargs.h>
+ # define VA_DECL(typ1,var1) (va_alist) va_dcl {\
+ va_list the_args; typ1 var1;
+ # define VA_DECL2(typ1,var1,typ2,var2) (va_alist) va_dcl {\
+ va_list the_args; typ1 var1; typ2 var2;
+ # define VA_ARGS the_args
+ # define VA_START(x) va_start(the_args)
+ # define VA_INIT(var1,typ1) va_arg(var1, typ1)
+ # define VA_NEXT(var1,typ1) var1 = va_arg(the_args,typ1)
+ # define VA_END() va_end(the_args)
+ # else
+ # define VA_ARGS arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9
+ # define VA_DECL(typ1,var1) (var1,VA_ARGS) typ1 var1; \
+ char *arg1,*arg2,*arg3,*arg4,*arg5,*arg6,*arg7,*arg8,*arg9; {
+ # define VA_DECL2(typ1,var1,typ2,var2) (var1,var2,VA_ARGS) \
+ typ1 var1; typ2 var2;\
+ char *arg1,*arg2,*arg3,*arg4,*arg5,*arg6,*arg7,*arg8,*arg9; {
+ # define VA_START(x)
+ # define VA_INIT(var1,typ1)
+ # define VA_END()
+ # endif
+ #endif
+ #endif /* NEED_VARARGS */
+
#if (defined(__STDC__) || defined(MSDOS)) && !defined(AMIGA)
/* Used for robust ANSI parameter forward declarations:
***************
*** 27,33 ****
*/
# define P(s) s
! # ifdef MSDOS
# define V(s) s
# else
# define V(s) ()
--- 83,89 ----
*/
# define P(s) s
! # if defined(MSDOS) || defined(USE_STDARG)
# define V(s) s
# else
# define V(s) ()
*** include/Old/unixconf.h Wed Sep 6 23:47:19 1989
--- include/unixconf.h Sat Sep 16 23:12:56 1989
***************
*** 73,80
* A stat system call is done on the mailbox every MAILCKFREQ moves.
*/
! #define MAIL
! #if defined(BSD) || defined(ULTRIX)
#define DEF_MAILREADER "/usr/ucb/Mail"
#else
# ifdef SYSV
--- 73,82 -----
* A stat system call is done on the mailbox every MAILCKFREQ moves.
*/
! #define MAIL /* Deliver mail during the game */
! #ifdef MAIL
!
! # if defined(BSD) || defined(ULTRIX)
#define DEF_MAILREADER "/usr/ucb/Mail"
# else
# if defined(SYSV) || defined(DGUX)
***************
*** 76,84
#define MAIL
#if defined(BSD) || defined(ULTRIX)
#define DEF_MAILREADER "/usr/ucb/Mail"
- #else
- # ifdef SYSV
- #define DEF_MAILREADER "/usr/bin/mailx"
# else
#define DEF_MAILREADER "/bin/mail"
# endif
--- 78,83 -----
# if defined(BSD) || defined(ULTRIX)
#define DEF_MAILREADER "/usr/ucb/Mail"
# else
# if defined(SYSV) || defined(DGUX)
# ifdef M_XENIX
***************
*** 80,85
# ifdef SYSV
#define DEF_MAILREADER "/usr/bin/mailx"
# else
#define DEF_MAILREADER "/bin/mail"
# endif
#endif
--- 79,91 -----
# if defined(BSD) || defined(ULTRIX)
#define DEF_MAILREADER "/usr/ucb/Mail"
# else
+ # if defined(SYSV) || defined(DGUX)
+ # ifdef M_XENIX
+ #define DEF_MAILREADER "/usr/bin/mail"
+ # else
+ #define DEF_MAILREADER "/usr/bin/mailx"
+ # endif
+ # else
#define DEF_MAILREADER "/bin/mail"
# endif
# endif
***************
*** 81,86
#define DEF_MAILREADER "/usr/bin/mailx"
# else
#define DEF_MAILREADER "/bin/mail"
# endif
#endif
#define MAILCKFREQ 50
--- 87,93 -----
# endif
# else
#define DEF_MAILREADER "/bin/mail"
+ # endif
# endif
#define MAILCKFREQ 50
***************
*** 82,88
# else
#define DEF_MAILREADER "/bin/mail"
# endif
! #endif
#define MAILCKFREQ 50
#ifdef COMPRESS
--- 89,95 -----
#define DEF_MAILREADER "/bin/mail"
# endif
# endif
!
#define MAILCKFREQ 50
#endif /* MAIL */
***************
*** 84,89
# endif
#endif
#define MAILCKFREQ 50
#ifdef COMPRESS
/* Some implementations of compress need a 'quiet' option.
--- 91,97 -----
# endif
#define MAILCKFREQ 50
+ #endif /* MAIL */
#ifdef COMPRESS
/* Some implementations of compress need a 'quiet' option.
***************
*** 146,160
# undef hc
#endif
! #ifdef TEXTCOLOR
! /* configurable colors */
! # define HI_MON RED /* red slaps! */
! # define HI_OBJ MAGENTA
! # define HI_METAL CYAN
! # define HI_ORGANIC GREEN
! # define HI_GOLD YELLOW
! # define HI_ZAP BLUE /* blue zaps! */
! #endif
!
! #endif
#endif /* UNIX /* */
--- 154,158 -----
# undef hc
#endif
! #endif /* UNIXCONF_H /* */
#endif /* UNIX /* */
*** ./Old/Install.unix Wed Sep 27 10:11:25 1989
--- ./Install.unix Sat Sep 23 00:47:12 1989
***************
*** 49,64 ****
Notes:
! 1. No, your old save files and bones files will not work with NetHack 3.0.
Don't bother trying to keep them. The old score list will work fine; the
only problem is that you may have trouble beating your old scores in this
version.
! 2. If you insisted on doing the final installation by hand, you probably
forgot to make a save directory. If you don't go back and do this, you
won't be able to save games.
! 3. To install an update of this version of NetHack after changing something,
type 'make update' from the main directory. If you created the new
version yourself, it should be safe to use 'make update' as long as you
did not add, delete, or reorder monsters or objects and you did not change
--- 49,70 ----
Notes:
! 1. A number of systems, such as Xenix, support both the termcap and terminfo
! terminal capability libraries. Make sure that the TERMINFO definition in
! unixconf.h and TERMLIB in the source Makefile correspond.
! If spurious characters appear on the screen while kicking, zapping, etc.
! it is likely that you have linked the source to the wrong library.
!
! 2. No, your old save files and bones files will not work with NetHack 3.0.
Don't bother trying to keep them. The old score list will work fine; the
only problem is that you may have trouble beating your old scores in this
version.
! 3. If you insisted on doing the final installation by hand, you probably
forgot to make a save directory. If you don't go back and do this, you
won't be able to save games.
! 4. To install an update of this version of NetHack after changing something,
type 'make update' from the main directory. If you created the new
version yourself, it should be safe to use 'make update' as long as you
did not add, delete, or reorder monsters or objects and you did not change
***************
*** 65,67 ****
--- 71,81 ----
the format of saved level files. If you did any of these things, you
should also remove any saved games and bones levels. (Trying to use such
files often produces amusing but useless confusions on the game's part.)
+
+ 5. Xenix/286's lex generates a faulty lexical analyser from lev_comp.l.
+ The beta-release of flex 2.1 (avaliable from uunet, osu-cis,
+ prep.ai.mit.edu, etc.) can be used to generate the lexer.
+ The only change to flex is to change "#define yyleng (yy_cp - yy_bp)"
+ to "#define yyleng (int)(yy_cp - yy_bp)" in flex.skel.
+ Flex is not needed with Xenix/386, as its lex generates a proper lexical
+ analyser. [Xenix instructions by J.T. Conklin]
*** ./Old/Makefile.top Wed Sep 27 10:11:38 1989
--- ./Makefile.top Tue Sep 19 18:52:15 1989
***************
*** 1,6 ****
--- 1,18 ----
# Hack Makefile.
# SCCS Id: @(#)Makefile.top 3.0 89/03/23
+ # newer makes predefine $(MAKE) to 'make' and do smarter processing of
+ # recursive make calls if $(MAKE) is used
+ # these makes allow $(MAKE) to be overridden by the environment if someone
+ # wants to (or has to) use something other than the standard make, so we do
+ # not want to unconditionally set $(MAKE) here
+ #
+ # unfortunately, some older makes do not predefine $(MAKE); if you have one of
+ # these, uncomment the following line
+ # (you will know that you have one if you get complaints about unable to
+ # execute things like 'data' and 'rumors')
+ # MAKE = make
+
# make NetHack
GAME = nethack
GAMEUID = games
***************
*** 55,60 ****
--- 67,73 ----
# (don't yank the old version out from under people who're playing it)
mv $(GAMEDIR)/$(GAME) $(GAMEDIR)/$(GAME).old
cp src/$(GAME) $(GAMEDIR)
+ -rm -f $(SHELLDIR)/$(GAME)
sed -e 's;/usr/games/lib/nethackdir;$(GAMEDIR);' \
-e 's;HACKDIR/nethack;HACKDIR/$(GAME);' \
< auxil/nethack.sh \
***************
*** 82,87 ****
--- 95,101 ----
# copy over the game files
( cd auxil ; cp $(AUX) $(GAMEDIR) )
cp src/$(GAME) $(GAMEDIR)
+ -rm -f $(SHELLDIR)/$(GAME)
sed -e 's;/usr/games/lib/nethackdir;$(GAMEDIR);' \
-e 's;HACKDIR/nethack;HACKDIR/$(GAME);' \
< auxil/nethack.sh \
*** ./Old/Files Wed Sep 27 10:11:03 1989
--- ./Files Tue Sep 26 23:04:12 1989
***************
*** 1,7 ****
! This is a listing of all files in a full NetHack 3.0 distribution, organized in
! their standard manner on a UNIX system. It indicates which files are necessary
! for which versions, so that you can tell which files may be deleted from or not
! transferred to your system if you wish.
(files in top directory)
--- 1,7 ----
! This is a listing of all files in a full NetHack 3.0 distribution, organized
! in their standard manner on a UNIX system. It indicates which files are
! necessary for which versions, so that you can tell which files may be deleted
! from or not transferred to your system if you wish.
(files in top directory)
***************
*** 27,34 ****
others:
(files for MSDOS version)
! Make.ini Makefile.msc Makefile.os2 Makefile.tcc Maketcc.ini
! NetHack.cnf termcap termcap.uu
(files for MSDOS, Amiga, and Atari versions)
pcmain.c pctty.c pcunix.c
(file for MSDOS and new Atari versions)
--- 27,34 ----
others:
(files for MSDOS version)
! Make.ini Makefile.msc Makefile.pc Makefile.os2 Makefile.tcc
! Maketcc.ini NetHack.cnf termcap termcap.uu
(files for MSDOS, Amiga, and Atari versions)
pcmain.c pctty.c pcunix.c
(file for MSDOS and new Atari versions)
***************
*** 37,43 ****
Makefile.st
(file for old Atari version)
oldtos.c
! (file with random number routines, which may be included in any version)
random.c
--- 37,43 ----
Makefile.st
(file for old Atari version)
oldtos.c
! (Berkeley random number file, which may be included in any version)
random.c
***************
*** 51,57 ****
obj.h objclass.h patchlevel.h pcconf.h permonst.h
prop.h rm.h sp_lev.h spell.h system.h
tosconf.h tradstdc.h trap.h trapname.h unixconf.h
! vault.h wseg.h you.h youprop.h
(file for special level compiler (STRONGHOLD option))
lev_comp.h
--- 51,57 ----
obj.h objclass.h patchlevel.h pcconf.h permonst.h
prop.h rm.h sp_lev.h spell.h system.h
tosconf.h tradstdc.h trap.h trapname.h unixconf.h
! vault.h vmsconf.h wseg.h you.h youprop.h
(file for special level compiler (STRONGHOLD option))
lev_comp.h
***************
*** 79,81 ****
--- 79,88 ----
lev_comp.c lev_comp.l lev_comp.y lev_lex.c lev_main.c
(files for UNIX versions)
Makefile.src unixmain.c unixtty.c unixunix.c
+
+ vms:
+ (files for VMS version)
+ Install.vms spec_lev.com vmsbuild.com vmsmain.c vmsmisc.c
+ vmstty.c vmsunix.c
+ (GNU termcap files that support VMS version)
+ vmstermcap.c vmstparam.c
*** ./Old/README Wed Sep 27 10:11:59 1989
--- ./README Sun Sep 17 13:12:06 1989
***************
*** 37,43 ****
directory as the 'Top' directory. It makes no difference what you
call it.
! 2. If there is no flaw in the packaging, FIVE sub-directories will be
automatically created, and files will be deposited in them:
a. A 'src' directory, which will contain general *.c files.
--- 37,43 ----
directory as the 'Top' directory. It makes no difference what you
call it.
! 2. If there is no flaw in the packaging, SIX sub-directories will be
automatically created, and files will be deposited in them:
a. A 'src' directory, which will contain general *.c files.
***************
*** 45,50 ****
--- 45,51 ----
c. An 'auxil' directory, which will contain a variety of data files.
d. An 'amiga' directory, which will contain the Amiga-specific files.
e. An 'others' directory, which will contain MSDOS and TOS files.
+ f. A 'vms' directory, which will contain VMS files.
The names of these directories should not be changed, unless you are
ready to go through the makefiles and the makedefs program and change
***************
*** 86,91 ****
--- 87,94 ----
Commodore Amiga (probably -- there have been some changes since
the Amiga port was done, but we believe it should still work)
Atari 1040ST under TOS
+ DEC vaxen running VMS (probably still requires tweaking)
+ Data General AViiON systems under DG/UX
- - - - - - - - - - -
*** /dev/null Thu Sep 28 00:44:19 1989
--- include/vmsconf.h Thu Sep 28 00:44:04 1989
***************
*** 0
--- 1,69 -----
+ /* SCCS Id: @(#)vmsconf.h 3.0 88/07/21
+ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
+ /* NetHack may be freely redistributed. See license for details. */
+
+ #ifdef VMS
+ #ifndef VMSCONF_H
+ #define VMSCONF_H
+
+ #undef UNIX
+ #undef HACKDIR
+ #define HACKDIR "USR$ROOT0:[GENTZEL.NHDIR]"
+ #undef RECORD
+ #define RECORD "record;1"
+
+ #undef COMPRESS
+ #undef ZEROCOMP
+
+ /*
+ * If you define MAIL, then the player will be notified of new broadcasts
+ * when they arrive.
+ */
+ #define MAIL
+
+ #define RANDOM /* if neither random/srandom nor lrand48/srand48
+ is available from your system */
+
+ #define FCMASK 0660 /* file creation mask */
+
+
+ /*
+ * The remainder of the file should not need to be changed.
+ */
+
+ #include <time.h>
+ #include <file.h>
+
+ #define HLOCK "perm;1" /* an empty file used for locking purposes */
+ #define LLOCK "safelock;1" /* link to previous */
+
+ #ifndef REDO
+ # define Getchar vms_getchar
+ #else
+ # define tgetch vms_getchar
+ #endif
+
+ #define SHELL /* do not delete the '!' command */
+
+ #include "system.h"
+
+ #define index strchr
+ #define rindex strrchr
+
+ /* Use the high quality random number routines. */
+ #if defined(RANDOM)
+ #define Rand() random()
+ #define Srand(seed) srandom(seed)
+ #else
+ #define Rand() rand()
+ #define Srand(seed) srand(seed)
+ #endif
+
+ #define unlink(x) delete(x)
+ #define exit(x) vms_exit(x)
+ #define getuid() vms_getuid()
+ #define abort() vms_abort()
+ #define creat(f,m) vms_creat(f,m)
+
+ #endif
+ #endif /* VMS /* */
*** /dev/null Wed Sep 27 12:48:12 1989
--- vms/vmsunix.c Tue Sep 26 18:51:29 1989
***************
*** 0 ****
--- 1,397 ----
+ /* SCCS Id: @(#)vmsunix.c 3.0 88/04/13
+ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
+ /* NetHack may be freely redistributed. See license for details. */
+
+ /* This file collects some Unix dependencies; pager.c contains some more */
+
+ /*
+ * The time is used for:
+ * - seed for rand()
+ * - year on tombstone and yymmdd in record file
+ * - phase of the moon (various monsters react to NEW_MOON or FULL_MOON)
+ * - night and midnight (the undead are dangerous at midnight)
+ * - determination of what files are "very old"
+ */
+
+ #include "hack.h"
+
+ #include <rms.h>
+ #include <jpidef.h>
+ #include <ssdef.h>
+ #include <errno.h>
+ #include <signal.h>
+ #undef off_t
+ #include <sys/stat.h>
+
+ void
+ setrandom()
+ {
+ (void) Srand((long) time ((time_t *) 0));
+ }
+
+ static struct tm *
+ getlt()
+ {
+ time_t date;
+
+ (void) time(&date);
+ return(localtime(&date));
+ }
+
+ int
+ getyear()
+ {
+ return(1900 + getlt()->tm_year);
+ }
+
+ char *
+ getdate()
+ {
+ static char datestr[7];
+ register struct tm *lt = getlt();
+
+ Sprintf(datestr, "%2d%2d%2d",
+ lt->tm_year, lt->tm_mon + 1, lt->tm_mday);
+ if(datestr[2] == ' ') datestr[2] = '0';
+ if(datestr[4] == ' ') datestr[4] = '0';
+ return(datestr);
+ }
+
+ int
+ phase_of_the_moon() /* 0-7, with 0: new, 4: full */
+ { /* moon period: 29.5306 days */
+ /* year: 365.2422 days */
+ register struct tm *lt = getlt();
+ register int epact, diy, goldn;
+
+ diy = lt->tm_yday;
+ goldn = (lt->tm_year % 19) + 1;
+ epact = (11 * goldn + 18) % 30;
+ if ((epact == 25 && goldn > 11) || epact == 24)
+ epact++;
+
+ return( (((((diy + epact) * 6) + 11) % 177) / 22) & 7 );
+ }
+
+ int
+ night()
+ {
+ register int hour = getlt()->tm_hour;
+
+ return(hour < 6 || hour > 21);
+ }
+
+ int
+ midnight()
+ {
+ return(getlt()->tm_hour == 0);
+ }
+
+ static struct stat buf, hbuf;
+
+ void
+ gethdate(name) char *name; {
+ register char *np;
+
+ if(stat(name, &hbuf))
+ error("Cannot get status of %s.",
+ (np = rindex(name, ']')) ? np+1 : name);
+ }
+
+ int
+ uptodate(fd)
+ int fd;
+ {
+ if(fstat(fd, &buf)) {
+ pline("Cannot get status of saved level? ");
+ return(0);
+ }
+ if(buf.st_mtime < hbuf.st_mtime) {
+ pline("Saved level is out of date. ");
+ return(0);
+ }
+ return(1);
+ }
+
+ static int
+ veryold(fd)
+ int fd;
+ {
+ register int i;
+ time_t date;
+
+ if(fstat(fd, &buf)) return(0); /* cannot get status */
+ if(buf.st_size != sizeof(int)) return(0); /* not an xlock file */
+ (void) time(&date);
+ if(date - buf.st_mtime < 3L*24L*60L*60L) { /* recent */
+ int lockedpid; /* should be the same size as hackpid */
+ int status, dummy, code = JPI$_PID;
+
+ if(read(fd, (char *)&lockedpid, sizeof(lockedpid)) !=
+ sizeof(lockedpid))
+ /* strange ... */
+ return(0);
+ if(!(!((status = LIB$GETJPI(&code, &lockedpid, 0, &dummy)) & 1)
+ && status == SS$_NONEXPR))
+ return(0);
+ }
+ (void) close(fd);
+ for(i = 1; i <= MAXLEVEL+1; i++) { /* try to remove all */
+ glo(i);
+ (void) delete(lock);
+ }
+ glo(0);
+ if(delete(lock)) return(0); /* cannot remove it */
+ return(1); /* success! */
+ }
+
+ void
+ getlock()
+ {
+ register int i = 0, fd;
+
+ #ifdef HARD
+ /* idea from rpick%ucqais@uccba.uc.edu
+ * prevent automated rerolling of characters
+ * test input (fd0) so that tee'ing output to get a screen dump still
+ * works
+ * also incidentally prevents development of any hack-o-matic programs
+ */
+ if (!isatty(0))
+ error("You must play from a terminal.");
+ #endif
+
+ (void) fflush(stdout);
+
+ /* we ignore QUIT and INT at this point */
+ if (link(HLOCK, LLOCK) == -1) {
+ register int errnosv = errno;
+
+ perror(HLOCK);
+ Printf("Cannot link %s to %s\n", LLOCK, HLOCK);
+ switch(errnosv) {
+ case ENOENT:
+ Printf("Perhaps there is no (empty) file %s ?\n", HLOCK);
+ break;
+ case EACCES:
+ Printf("It seems you don't have write permission here.\n");
+ break;
+ case EEXIST:
+ Printf("(Try again or rm %s.)\n", LLOCK);
+ break;
+ default:
+ Printf("I don't know what is wrong.");
+ }
+ getret();
+ error("");
+ /*NOTREACHED*/
+ }
+
+ regularize(lock);
+ glo(0);
+ if(locknum > 25) locknum = 25;
+
+ do {
+ if(locknum) lock[0] = 'a' + i++;
+
+ if((fd = open(lock, 0)) == -1) {
+ if(errno == ENOENT) goto gotlock; /* no such file */
+ perror(lock);
+ (void) delete(LLOCK);
+ error("Cannot open %s", lock);
+ }
+
+ if(veryold(fd)) /* if true, this closes fd and unlinks lock */
+ goto gotlock;
+ (void) close(fd);
+ } while(i < locknum);
+
+ (void) delete(LLOCK);
+ error(locknum ? "Too many hacks running now."
+ : "There is a game in progress under your name.");
+ gotlock:
+ fd = creat(lock, FCMASK);
+ if(delete(LLOCK) == -1)
+ error("Cannot delete %s.", LLOCK);
+ if(fd == -1) {
+ error("cannot creat lock file.");
+ } else {
+ if(write(fd, (char *) &hackpid, sizeof(hackpid))
+ != sizeof(hackpid)){
+ error("cannot write lock");
+ }
+ if(close(fd) == -1) {
+ error("cannot close lock");
+ }
+ }
+ }
+
+ void
+ regularize(s) /* normalize file name */
+ register char *s;
+ {
+ register char *lp;
+
+ for (lp = s; *lp; lp++)
+ if (!((*lp >= 'A' && *lp <= 'Z')
+ || (*lp >= 'a' && *lp <= 'z')
+ || (*lp >= '0' && *lp <= '9')
+ || *lp == '$' || *lp == '_'
+ || (lp > s && *lp == '-')))
+ *lp = '_';
+ }
+
+ int link(file, new)
+ char *file, *new;
+ {
+ int status;
+ struct FAB fab;
+ struct NAM nam;
+ unsigned short fid[3];
+ char esa[NAM$C_MAXRSS];
+
+ fab = cc$rms_fab;
+ fab.fab$l_fop = FAB$M_OFP;
+ fab.fab$l_fna = file;
+ fab.fab$b_fns = strlen(file);
+ fab.fab$l_nam = &nam;
+
+ nam = cc$rms_nam;
+ nam.nam$l_esa = esa;
+ nam.nam$b_ess = NAM$C_MAXRSS;
+
+ if (!((status = SYS$PARSE(&fab)) & 1)
+ || !((status = SYS$SEARCH(&fab)) & 1))
+ {
+ C$$TRANSLATE(status);
+ return -1;
+ }
+
+ fid[0] = nam.nam$w_fid[0];
+ fid[1] = nam.nam$w_fid[1];
+ fid[2] = nam.nam$w_fid[2];
+
+ fab.fab$l_fna = new;
+ fab.fab$b_fns = strlen(new);
+
+ if (!((status = SYS$PARSE(&fab)) & 1))
+ {
+ C$$TRANSLATE(status);
+ return -1;
+ }
+
+ nam.nam$w_fid[0] = fid[0];
+ nam.nam$w_fid[1] = fid[1];
+ nam.nam$w_fid[2] = fid[2];
+
+ nam.nam$l_esa = nam.nam$l_name;
+ nam.nam$b_esl = nam.nam$b_name + nam.nam$b_type + nam.nam$b_ver;
+
+ if (!((status = SYS$ENTER(&fab)) & 1))
+ {
+ C$$TRANSLATE(status);
+ return -1;
+ }
+
+ return 0;
+ }
+
+ #undef unlink
+ int unlink(file)
+ char *file;
+ {
+ int status;
+ struct FAB fab = cc$rms_fab;
+ struct NAM nam = cc$rms_nam;
+ char esa[NAM$C_MAXRSS];
+
+ fab.fab$l_fop = FAB$M_DLT;
+ fab.fab$l_fna = file;
+ fab.fab$b_fns = strlen(file);
+ fab.fab$l_nam = &nam;
+ nam.nam$l_esa = esa;
+ nam.nam$b_ess = NAM$C_MAXRSS;
+
+ if (!((status = SYS$PARSE(&fab)) & 1)
+ || !((status = SYS$REMOVE(&fab)) & 1))
+ {
+ C$$TRANSLATE(status);
+ return -1;
+ }
+
+ return 0;
+ }
+
+ #undef creat
+ int vms_creat(file, mode)
+ char *file;
+ unsigned int mode;
+ {
+ if (index(file, ';'))
+ (void) delete(file);
+ return creat(file, mode);
+ }
+
+ #undef getuid
+ int
+ vms_getuid()
+ {
+ return (getgid() << 16) | getuid();
+ }
+
+ #ifdef CHDIR
+ unsigned int oprv[2];
+
+ void
+ privoff()
+ {
+ unsigned int prv[2] = { -1, -1 }, code = JPI$_PROCPRIV;
+
+ (void) SYS$SETPRV(0, prv, 0, oprv);
+ (void) LIB$GETJPI(&code, 0, 0, prv);
+ (void) SYS$SETPRV(1, prv, 0, 0);
+ }
+
+ void
+ privon()
+ {
+ (void) SYS$SETPRV(1, oprv, 0, 0);
+ }
+ #endif
+
+ #ifdef SHELL
+ unsigned int dosh_pid = 0;
+
+ int
+ dosh()
+ {
+ int status;
+
+ settty((char *) NULL); /* also calls end_screen() */
+ (void) signal(SIGINT,SIG_IGN);
+ (void) signal(SIGQUIT,SIG_IGN);
+ if (!dosh_pid || !((status = LIB$ATTACH(&dosh_pid)) & 1))
+ {
+ #ifdef CHDIR
+ (void) chdir(getenv("PATH"));
+ privoff();
+ #endif
+ dosh_pid = 0;
+ status = LIB$SPAWN(0, 0, 0, 0, 0, &dosh_pid);
+ #ifdef CHDIR
+ privon();
+ chdirx((char *) 0, 0);
+ #endif
+ }
+ gettty();
+ setftty();
+ (void) signal(SIGINT, (SIG_RET_TYPE) done1);
+ #ifdef WIZARD
+ if(wizard) (void) signal(SIGQUIT,SIG_DFL);
+ #endif
+ docrt();
+ if (!(status & 1))
+ pline("Spawn failed. Try again.");
+ return 0;
+ }
+ #endif