gaa@moscom.UUCP (Gary Algier) (08/08/85)
: Start of shell archive : " : This is a shell archive, meaning: : 1. Remove everything above the : Start of shell archive line. : 2. Save the resulting text in a file. : 3. Execute the file with /bin/sh (not csh) to create the files: : Read.Me : fixnames : oldnames : edscript : msdos.mak : This archive created: Thu Aug 8 16:53:44 1985 : " export PATH; PATH=/bin:$PATH echo shar: extracting "'Read.Me'" '(1855 characters)' if test -f 'Read.Me' then echo shar: will not over-write existing file "'Read.Me'" else sed 's/^X//' << \SHAR_EOF > 'Read.Me' X This is posting will create an MSDOS compatible version of XHack from the latest release (1.0.3). All changes are done such that Xa single set of sources may be used for both UNIX and MSDOS. X X Prerequisites: X X 1) An unmodified copy of the 1.0.3 sources. X 2) An MSDOS machine with >=512k RAM and lots X of (hard) disk space for the sources. X 3) A copy of the MicroSoft C Compiler Version 3.0 X or greater. Don't even think of trying Lattice, X there are too many incompatabilties between them X and "standard C". X 4) "make" for MSDOS. Sorry I can't help here, X we purchased one from Polytron Corp. X 5) ANSI.SYS, or its equivalent, must be installed in X CONFIG.SYS. This is to allow the UNIX termcap.c X to be used to do the screen handling. X X The postings consist of a shell archive containing: X Read.Me this file X fixnames to convert names to single dot form. X oldnames a list of the old names for above. X edscript will edit sources X msdos.mak a makefile for MSDOS X X To use: X 1) copy the unmodified 1.0.3 sources to a directory X of their own and cd to there. X 2) execute: "sh part1" -- to unshar. X 3) execute: "sh fixnames" -- to convert filenames. X 4) execute: "sh edscript" -- to edit conveted files. X 5) make any local mods to config.h, etc. -- note X that MSDOS is automatically defined by the X preprocessor. X 6) transfer to your MSDOS machine. X 7) on your pc execute: "ren msdos.mak makefile" X 8) on your pc execute: "make > make.out" X 9) go to lunch (or on vacation) -- it takes about X 1-1/2 hours on an AT&T 6300 (8086+10meg HD) X 10) create your hack directories (default: /lib/hack) X 11) play. X X Gary A. Algier X Xuucp: {allegra,seismo}!rochester!{ritcv!,}moscom!gaa Xpost: Moscom,300 Main St.,E.Roch.,NY,14445 Xradio: WB2FWZ, 146.715/R/Voice, 145.010/Packet Xphone: 716 385 6440 x363 SHAR_EOF if test 1855 -ne "`wc -c < 'Read.Me'`" then echo shar: error transmitting "'Read.Me'" '(should have been 1855 characters)' fi fi echo shar: extracting "'fixnames'" '(414 characters)' if test -f 'fixnames' then echo shar: will not over-write existing file "'fixnames'" else sed 's/^X//' << \SHAR_EOF > 'fixnames' Xwhile read oldname Xdo X case $oldname in X hack.Decl.c) X file=decl.c X mv $oldname $file X ;; X hack.*.*) X file=`expr $oldname : '.....\(.*\)'` X mv $oldname $file X ;; X def.*.*) X file=`expr $oldname : '....\(.*\)'` X mv $oldname $file X ;; X *) X file=$oldname X ;; X esac X ed - $file <<'EOF' Xg/hack\.Decl\./s//decl./g Xg/hack\.\([a-zA-Z0-9_]*\.\)/s//\1/g Xg/def\.\([a-zA-Z0-9_]*\.\)/s//\1/g Xw Xq XEOF X Xdone < oldnames SHAR_EOF if test 414 -ne "`wc -c < 'fixnames'`" then echo shar: error transmitting "'fixnames'" '(should have been 414 characters)' fi fi echo shar: extracting "'oldnames'" '(954 characters)' if test -f 'oldnames' then echo shar: will not over-write existing file "'oldnames'" else sed 's/^X//' << \SHAR_EOF > 'oldnames' XMakefile Xalloc.c Xconfig.h Xdate.h Xdef.edog.h Xdef.eshk.h Xdef.flag.h Xdef.func_tab.h Xdef.gen.h Xdef.gold.h Xdef.mkroom.h Xdef.monst.h Xdef.obj.h Xdef.objclass.h Xdef.objects.h Xdef.permonst.h Xdef.rm.h Xdef.trap.h Xdef.wseg.h Xhack.Decl.c Xhack.apply.c Xhack.bones.c Xhack.c Xhack.cmd.c Xhack.do.c Xhack.do_name.c Xhack.do_wear.c Xhack.dog.c Xhack.eat.c Xhack.end.c Xhack.engrave.c Xhack.fight.c Xhack.h Xhack.invent.c Xhack.ioctl.c Xhack.lev.c Xhack.main.c Xhack.makemon.c Xhack.mfndpos.h Xhack.mhitu.c Xhack.mklev.c Xhack.mkmaze.c Xhack.mkobj.c Xhack.mkshop.c Xhack.mon.c Xhack.monst.c Xhack.o_init.c Xhack.objnam.c Xhack.onames.h Xhack.options.c Xhack.pager.c Xhack.potion.c Xhack.pri.c Xhack.read.c Xhack.rip.c Xhack.rumors.c Xhack.save.c Xhack.search.c Xhack.shk.c Xhack.shknam.c Xhack.steal.c Xhack.termcap.c Xhack.timeout.c Xhack.topl.c Xhack.track.c Xhack.trap.c Xhack.tty.c Xhack.u_init.c Xhack.unix.c Xhack.vault.c Xhack.version.c Xhack.wield.c Xhack.wizard.c Xhack.worm.c Xhack.worn.c Xhack.zap.c Xmakedefs.c Xrnd.c SHAR_EOF if test 954 -ne "`wc -c < 'oldnames'`" then echo shar: error transmitting "'oldnames'" '(should have been 954 characters)' fi fi echo shar: extracting "'edscript'" '(7540 characters)' if test -f 'edscript' then echo shar: will not over-write existing file "'edscript'" else sed 's/^X//' << \SHAR_EOF > 'edscript' Xed - cmd.c <<'EOF' X212c Xint X. X205c Xint X. X90c Xchar *parse(); Xint lowc(), unctrl(); Xextern char quitchars[]; X. Xw Xq XEOF Xed - config.h <<'EOF' X111c Xtypedef unsigned int uchar; X. X83a X#endif X. X82a X#ifndef MSDOS /* meaningless for msdos */ X. X74a X#endif X. X73a X#ifdef MSDOS X#define HACKDIR "/lib/hack" X#else X. X28a X#ifdef MSDOS X# define NOWAITINCLUDE X#endif X. X24a X#ifdef MSDOS X#define REGBUG /* get rid of this when they get rid of "infinite spill" bug */ X#else X#define UNIX /* delete if no fork(), exec() available */ X#endif X X. X23c X/* #define BSD /* define for BSD */ X/* #define SYSV /* define for System V */ X/* #define MSDOS /* define for MS-DOS (actually defined by compiler) */ X. X7d Xw Xq XEOF Xed - do_wear.c <<'EOF' X218c X case RIN_PROTECTION_FROM_SHAPE_CHAN: X. Xw Xq XEOF Xed - dog.c <<'EOF' X0a X#ifdef REGBUG X#define register X#endif X X. Xw Xq XEOF Xed - end.c <<'EOF' X466a X#endif X. X465a X#ifdef SIGHUP X. X237a X#endif X. X225a X#ifndef MSDOS X. X201a X#endif X. X200a X#ifndef MSDOS X. X81a X#endif X. X80a X#endif X#ifdef SIGHUP X. X79a X#ifdef SIGQUIT X. X39a X#endif X. X38a X#ifdef SIGHUP X. X34a X#endif X. X33a X#ifdef SIGQUIT X. Xw Xq XEOF Xed - hack.h <<'EOF' X84c X#endif X. X78c X int last_str_turn; /* 0: none, 1: half turn, 2: full turn */ X. X72c X#endif X. X13a X#ifdef SYSV X#include <string.h> /* idem on System V */ X#define index strchr X#define rindex strrchr X#endif X X. X12c X#define exit(x) msexit(x) /* do chdir first! */ X#endif X. X8c X#endif X X#ifdef MSDOS X. Xw Xq XEOF Xed - ioctl.c <<'EOF' X31c X#endif X. X29c X#endif X#ifdef SYSV X. X23c X#endif X. X21c X#endif X#ifdef SYSV X. X12c X#endif X#ifdef SYSV X. Xw Xq XEOF Xed - lev.c <<'EOF' X166a X#ifdef MSDOS X setmode(fd,O_BINARY); X#endif X. X117a X mtmp->data = saveperm; /* restore the pointer */ X. X116a X /* store an index where the pointer used to be */ X saveperm = mtmp->data; X if (saveperm == &li_dog) X monstidx = -1; /* special fake index */ X else if (saveperm == &dog) X monstidx = -2; /* special fake index */ X else if (saveperm == &la_dog) X monstidx = -3; /* special fake index */ X else X monstidx = saveperm - &mons[0]; X *((int*)&mtmp->data) = monstidx; X. X111,112d X109c X struct permonst *saveperm; X int monstidx; X. X32a X#ifdef MSDOS X setmode(fd,O_BINARY); X#endif X. X14a Xextern struct permonst li_dog, dog, la_dog; X. X6a X X#ifdef MSDOS X# include <fcntl.h> X#endif X X. Xw Xq XEOF Xed - main.c <<'EOF' X495a X X/* for ms-dos, the best we can do is use an environment variable */ X#ifdef MSDOS Xchar * Xgetlogin() X{ X register char X *p; X X if ((p = getenv("USER")) != NULL && *p != '\0') X return p; X if ((p = getenv("LOGNAME")) != NULL && *p != '\0') X return p; X} X Xint Xgetuid() X{ X return 0; X} X X/* replacement exit for msdos. allows us to chdir back. */ X#undef exit X Xint Xmsexit(status) Xint X status; X{ X chdir(orgdir); X exit(status); X} X#endif X. X219,220d X201a X#endif X. X200a X#ifdef SIGQUIT X. X118a X#endif X. X117a X#ifdef SIGHUP X. X47a X#ifdef MSDOS X if (getcwd(orgdir,sizeof orgdir) == NULL) { X fprintf(stderr,"hack: current directory path too long\n"); X _exit(1); X } X#endif X X X. X16a Xextern struct permonst mons[CMNUM+2]; Xextern char genocided[], fut_geno[]; X X. X7a X#if defined(MSDOS) && defined(CHDIR) X static char X orgdir[100]; X char X *getcwd(); X#endif X X. Xw Xq XEOF Xed - makedefs.c <<'EOF' X51c Xint eof = 0; X. X40c X printf("#define %.*s %d\n", MAXLEN, string, index); X. X32,33c X printf("#define %.*s u.uprops[%d].p_flgs\n", X MAXLEN,string+4, propct++); X. X7a X#define MAXLEN 30 /* maximum length to generate */ X. Xw Xq XEOF Xed - makemon.c <<'EOF' X65c X { X. X8a Xextern boolean in_mklev; X. Xw Xq XEOF Xed - mklev.c <<'EOF' X664c Xregister int num,mazeflag; X. X621c X register int dy,xx,yy; X. X559c X register int ddy = (yy > ty) ? -1 : 1; X. X550c X register int ddx = (xx > tx) ? -1 : 1; X. X469c X register int dx, dy, dix, diy, cct; X. X466c X register int tx, ty, xx, yy; X. X463c Xregister int a,b; X. X441c X register int a,b; X. X367,368c X register int x, y, hix = lowx+ddx, hiy = lowy+ddy; X register int xlim = XLIM + secret, ylim = YLIM + secret; X. X344c X register int tmp; X. X341c Xregister int type; X. X339c Xregister int x,y; X. X326c Xregister int x,y; X. X313c Xregister int x,y; X. X288c X register int x,y; X. X41c X register int x,y; X. X0a X#ifdef REGBUG X#define register X#endif X X. Xw Xq XEOF Xed - mon.c <<'EOF' X783c X register int mhp, hpn, hpd; X. X237c X register int nx,ny,omx,omy,appr,nearer,cnt,i,j; X. X155c X register int tmp, nearby, scared; X. X135,138c Xregister int x = mtmp->mx; Xregister int y = mtmp->my; Xregister int d = dochug(mtmp); Xregister int dd; X. X120c Xregister int dam,die; X. X0a X#ifdef REGBUG X#define register X#endif X X. Xw Xq XEOF Xed - onames.h <<'EOF' X191c X#define RIN_PROTECTION_FROM_SHAPE_CHAN 188 X. Xw Xq XEOF Xed - pri.c <<'EOF' X548c X || u.uprops[PROP(RIN_PROTECTION_FROM_SHAPE_CHAN)].p_flgs X. Xw Xq XEOF Xed - save.c <<'EOF' X227,228c X /* convert the index into a pointer */ X monstidx = *((int*)&mtmp->data); X if (monstidx == -1) X mtmp->data = &li_dog; X else if (monstidx == -2) X mtmp->data = &dog; X else if (monstidx == -3) X mtmp->data = &la_dog; X else X mtmp->data = &mons[*((int*)&mtmp->data)]; X. X208,213d X206a X int monstidx; X. X37a X#endif X. X36a X#ifdef SIGHUP X. X13a Xextern struct permonst li_dog, dog, la_dog; X. Xw Xq XEOF Xed - shk.c <<'EOF' X744c Xregister int tmp = u.uhunger; X. X408c X *bp = bill[--ESHK(shopkeeper)->billct]; X. X227c Xregister int roomno; X. X131c Xregister int roomno = inroom(u.ux,u.uy); X. X121c Xregister int ct = ESHK(shopkeeper)->billct; X. X0a X#ifdef REGBUG X#define register X#endif X X. Xw Xq XEOF Xed - termcap.c <<'EOF' X257a X#endif X. X237a X#ifndef MSDOS X. X205c X cmov(1,1); X. X176a X#endif X. X175a X#ifdef MSDOS X if (s != NULL) X while (*s != '\0') X xputc(*s++); X#else X. X115a X#endif X. X105a X#ifdef MSDOS X cmov(x,y); X#else X. X77a X#endif X. X23a X#ifndef MSDOS X. X20a X#else Xstatic char X *HO = "\033[H", X *CL = "\033[H\033[2J", X *CE = "\033[K", X *UP = "\033[A", X *CM = "\033[%d;%dH", /* non-standard -- see tgoto macro */ X *ND = "\033[C", X *XD = NULL, X *BC = "\b", X *SO = "\033[7m", X *SE = "\033[m", X *TI = NULL, X *TE = NULL, X *VS = NULL, X *VE = NULL; Xstatic int X SG = 0; Xstatic int X PC = '\0'; Xchar X *CD = "\033"; Xint X CO = 80, X LI = 24; Xstatic char X gotobufr[32]; X#define tgoto(s,x,y) (sprintf(gotobufr,(s),(y)+1,(x)+1),gotobufr) X#endif X. X14d X9a Xstatic char tbuf[512]; X#ifndef MSDOS X. Xw Xq XEOF Xed - tty.c <<'EOF' X301a X X#ifdef MSDOS X#include <dos.h> X Xstatic int Xgetkey() X{ X int X c; X union REGS X inregs, X outregs; X X do { X inregs.x.ax = 0; X int86(22,&inregs,&outregs); X } while (outregs.h.al == 0); X c = (int) outregs.h.al; X return (c == '\r') ? '\n' : c; X} X#endif X. X283c X if((sym = GETCHAR()) != EOF) goto noteof; X. X273c X if((sym = GETCHAR()) == EOF) X. X261c X inline[1] = GETCHAR(); X. X256c X if(inline[1] == foo) inline[2] = GETCHAR(); else X. X254c X inline[1] = GETCHAR(); X. X162c X if((c = GETCHAR()) == EOF) { X. X141a X#endif X. X139a X#ifndef MSDOS X. X133a X#endif X. X127c X#endif X. X123c X#ifdef SYSV X. X108a X#ifdef MSDOS X flags.cbreak = ON; X flags.echo = OFF; X#else X. X104a X#endif X. X102a X#ifndef MSDOS X. X99a X#endif X. X94a X#ifdef MSDOS X flags.echo = ON; X flags.cbreak = OFF; X#else X. X86a X#endif X. X72a X#ifdef MSDOS X erase_char = '\b'; X kill_char = '\033'; /* escape */ X#else X. X66a X#endif X X#ifdef MSDOS X#define GETCHAR() getkey() X#endif X Xstatic char erase_char, kill_char; X X. X63d X60,61d X58a X#define GETCHAR() getchar() X. X45a X#endif X X#ifdef BSD X X. X44c Xextern short ospeed; Xstatic boolean settty_needed = FALSE; Xstruct termstruct inittyb, curttyb; X. X42a X#define GETCHAR() getchar() X. X28c X#ifdef SYSV X. X10,19d Xw Xq XEOF Xed - unix.c <<'EOF' X247a X#endif X. X181a X#ifndef MSDOS X. X178a X#endif X. X146a X#ifndef MSDOS X. X143a X#endif X. X135a X#ifndef MSDOS X. X132a X#endif X. X92a X#ifndef MSDOS X. Xw Xq XEOF SHAR_EOF if test 7540 -ne "`wc -c < 'edscript'`" then echo shar: error transmitting "'edscript'" '(should have been 7540 characters)' fi fi echo shar: extracting "'msdos.mak'" '(2468 characters)' if test -f 'msdos.mak' then echo shar: will not over-write existing file "'msdos.mak'" else sed 's/^X//' << \SHAR_EOF > 'msdos.mak' X# Large memory model: XM=l X# X# Makefile X# X X.c.obj: X cl -c -M$M -w $< X XOBJ1 = decl.obj apply.obj bones.obj cmd.obj do.obj\ X do_name.obj do_wear.obj dog.obj eat.obj end.obj\ X engrave.obj fight.obj invent.obj ioctl.obj\ X lev.obj main.obj makemon.obj mhitu.obj mklev.obj\ X mkmaze.obj mkobj.obj mkshop.obj mon.obj\ X monst.obj XOBJ2 = o_init.obj objnam.obj options.obj\ X pager.obj potion.obj pri.obj\ X read.obj rip.obj rumors.obj save.obj\ X search.obj shk.obj shknam.obj steal.obj\ X termcap.obj timeout.obj topl.obj\ X track.obj trap.obj\ X tty.obj unix.obj u_init.obj vault.obj wield.obj\ X wizard.obj worm.obj worn.obj zap.obj\ X version.obj rnd.obj alloc.obj X X# X# targets X# Xall: hack.exe X X# X# hack.exe -- main target X# Xhack.exe: hack.obj hacklib.lib X cl -o $@ hack.obj -F 3800 -link hacklib.lib < nul X Xhacklib.lib: $(OBJ1) $(OBJ2) X echo $@ > temp.cmd X !echo -$? & >> temp.cmd X !echo +$? & >> temp.cmd X echo ; >> temp.cmd X lib @temp.cmd < nul X Xmakedefs.exe: makedefs.obj X cl -o $@ makedefs.obj < nul X Xonames.h: objects.h makedefs.exe X makedefs > $@ X XDecl.obj: hack.h mkroom.h Xapply.obj: hack.h edog.h mkroom.h Xbones.obj: hack.h Xhack.obj: hack.h Xcmd.obj: hack.h func_tab.h Xdo.obj: hack.h Xdo_name.obj: hack.h Xdo_wear.obj: hack.h Xdog.obj: hack.h mfndpos.h edog.h mkroom.h Xeat.obj: hack.h Xend.obj: hack.h Xengrave.obj: hack.h Xfight.obj: hack.h Xinvent.obj: hack.h wseg.h Xioctl.obj: config.h Xlev.obj: hack.h mkroom.h wseg.h Xmain.obj: hack.h Xmakemon.obj: hack.h Xmhitu.obj: hack.h Xmklev.obj: hack.h mkroom.h Xmkmaze.obj: hack.h mkroom.h Xmkobj.obj: hack.h Xmkshop.obj: hack.h mkroom.h eshk.h Xmon.obj: hack.h mfndpos.h Xmonst.obj: hack.h eshk.h Xo_init.obj: config.h objects.h onames.h Xobjnam.obj: hack.h Xoptions.obj: config.h hack.h Xpager.obj: hack.h Xpotion.obj: hack.h Xpri.obj: hack.h wseg.h Xread.obj: hack.h Xrip.obj: hack.h Xrumors.obj: config.h Xsave.obj: hack.h Xsearch.obj: hack.h Xshk.obj: hack.h mfndpos.h mkroom.h eshk.h Xshknam.obj: hack.h Xsteal.obj: hack.h Xtermcap.obj: config.h flag.h Xtimeout.obj: hack.h Xtopl.obj: hack.h Xtrack.obj: hack.h Xtrap.obj: hack.h mkroom.h Xtty.obj: hack.h Xunix.obj: hack.h mkroom.h Xu_init.obj: hack.h Xvault.obj: hack.h mkroom.h Xwield.obj: hack.h Xwizard.obj: hack.h Xworm.obj: hack.h wseg.h Xworn.obj: hack.h Xzap.obj: hack.h Xversion.obj: date.h Xhack.h: config.h objclass.h monst.h gold.h trap.h obj.h flag.h rm.h permonst.h onames.h X touch hack.h Xobjects.h: config.h objclass.h X touch objects.h SHAR_EOF if test 2468 -ne "`wc -c < 'msdos.mak'`" then echo shar: error transmitting "'msdos.mak'" '(should have been 2468 characters)' fi fi : End of shell archive exit 0 -- -- Gary A. Algier uucp: {allegra,seismo}!rochester!{ritcv!,}moscom!gaa post: Moscom,300 Main St.,E.Roch.,NY,14445 radio: WB2FWZ, 146.715/R/Voice, 145.010/Packet phone: 716 385 6440 x363