page@swan.ulowell.edu (Bob Page) (12/02/88)
Submitted-by: u211344@hnykun11.bitnet (Olaf 'Rhialto' Seibert) Posting-number: Volume 2, Issue 71 Archive-name: fun/nethack.d2 # This is a shell archive. # Remove everything above and including the cut line. # Then run the rest of the file through sh. #----cut here-----cut here-----cut here-----cut here----# #!/bin/sh # shar: Shell Archiver # Run the following text with /bin/sh to create: # diffs.2 # This archive created: Thu Dec 1 17:55:20 1988 cat << \SHAR_EOF > diffs.2 } if(!isok(u.ux+u.dx, u.uy+u.dy)){ *************** *** 251,256 } tmpr = &levl[u.ux+u.dx][u.uy+u.dy]; ! if(IS_ROCK(tmpr->typ) || ! (u.dx && u.dy && (tmpr->typ == DOOR || ust->typ == DOOR))){ flags.move = 0; nomul(0); --- 251,256 ----- } tmpr = &levl[u.ux+u.dx][u.uy+u.dy]; ! if(IS_ROCK(RM_TYP(*tmpr)) || ! (u.dx && u.dy && (RM_TYP(*tmpr) == DOOR || RM_TYP(*ust) == DOOR))){ flags.move = 0; nomul(0); *************** *** 258,263 } if(moverock() < 0) return; ! if(u.dx && u.dy && IS_ROCK(levl[u.ux][u.uy+u.dy].typ) && ! IS_ROCK(levl[u.ux+u.dx][u.uy].typ) && invent && inv_weight()+40 > 0) { pline("You are carrying too much to get through."); --- 258,263 ----- } if(moverock() < 0) return; ! if(u.dx && u.dy && IS_ROCK(RM_TYP(levl[u.ux][u.uy+u.dy])) && ! IS_ROCK(RM_TYP(levl[u.ux+u.dx][u.uy])) && invent && inv_weight()+40 > 0) { pline("You are carrying too much to get through."); *************** *** 296,300 u.uy += u.dy; if(flags.run) { ! if(tmpr->typ == DOOR || (xupstair == u.ux && yupstair == u.uy) || (xdnstair == u.ux && ydnstair == u.uy) --- 296,300 ----- u.uy += u.dy; if(flags.run) { ! if(RM_TYP(*tmpr) == DOOR || (xupstair == u.ux && yupstair == u.uy) || (xdnstair == u.ux && ydnstair == u.uy) *************** *** 300,304 (xdnstair == u.ux && ydnstair == u.uy) #ifdef FOUNTAINS ! || IS_FOUNTAIN(levl[u.ux][u.uy].typ) #endif #ifdef NEWCLASS --- 300,304 ----- (xdnstair == u.ux && ydnstair == u.uy) #ifdef FOUNTAINS ! || IS_FOUNTAIN(RM_TYP(levl[u.ux][u.uy])) #endif #ifdef NEWCLASS *************** *** 303,307 #endif #ifdef NEWCLASS ! || IS_THRONE(levl[u.ux][u.uy].typ) #endif #ifdef SINKS --- 303,307 ----- #endif #ifdef NEWCLASS ! || IS_THRONE(RM_TYP(levl[u.ux][u.uy])) #endif #ifdef SINKS *************** *** 306,310 #endif #ifdef SINKS ! || IS_SINK(levl[u.ux][u.uy].typ) #endif ) --- 306,310 ----- #endif #ifdef SINKS ! || IS_SINK(RM_TYP(levl[u.ux][u.uy])) #endif ) *************** *** 313,317 #ifdef SINKS ! if(IS_SINK(levl[u.ux][u.uy].typ) && Levitation) dosinkfall(); #endif --- 313,317 ----- #ifdef SINKS ! if(IS_SINK(RM_TYP(levl[u.ux][u.uy])) && Levitation) dosinkfall(); #endif *************** *** 316,320 dosinkfall(); #endif ! if(tmpr->typ == POOL && !Levitation) drown(); /* not necessarily fatal */ --- 316,320 ----- dosinkfall(); #endif ! if(RM_TYP(*tmpr) == POOL && !Levitation) drown(); /* not necessarily fatal */ *************** *** 329,335 setsee(); #else ! if(ust->lit) { ! if(tmpr->lit) { ! if(tmpr->typ == DOOR) prl1(u.ux+u.dx,u.uy+u.dy); else if(ust->typ == DOOR) --- 329,335 ----- setsee(); #else ! if(RM_LIT(*ust)) { ! if(RM_LIT(*tmpr)) { ! if(RM_TYP(*tmpr) == DOOR) prl1(u.ux+u.dx,u.uy+u.dy); else if(RM_TYP(*ust) == DOOR) *************** *** 333,337 if(tmpr->typ == DOOR) prl1(u.ux+u.dx,u.uy+u.dy); ! else if(ust->typ == DOOR) nose1(u.ux0-u.dx,u.uy0-u.dy); } else { --- 333,337 ----- if(RM_TYP(*tmpr) == DOOR) prl1(u.ux+u.dx,u.uy+u.dy); ! else if(RM_TYP(*ust) == DOOR) nose1(u.ux0-u.dx,u.uy0-u.dy); } else { *************** *** 340,344 } } else { ! if(tmpr->lit) setsee(); else { prl1(u.ux+u.dx,u.uy+u.dy); --- 340,344 ----- } } else { ! if(RM_LIT(*tmpr)) setsee(); else { prl1(u.ux+u.dx,u.uy+u.dy); *************** *** 343,347 else { prl1(u.ux+u.dx,u.uy+u.dy); ! if(tmpr->typ == DOOR) { if(u.dy) { prl(u.ux-1,u.uy); --- 343,347 ----- else { prl1(u.ux+u.dx,u.uy+u.dy); ! if(RM_TYP(*tmpr) == DOOR) { if(u.dy) { prl(u.ux-1,u.uy); *************** *** 671,675 #endif if(Blind || flags.run == 0) return; ! if(flags.run == 1 && levl[u.ux][u.uy].typ == ROOM) return; #ifdef QUEST if(u.ux0 == u.ux+u.dx && u.uy0 == u.uy+u.dy) goto stop; --- 671,675 ----- #endif if(Blind || flags.run == 0) return; ! if(flags.run == 1 && RM_TYP(levl[u.ux][u.uy]) == ROOM) return; #ifdef QUEST if(u.ux0 == u.ux+u.dx && u.uy0 == u.uy+u.dy) goto stop; *************** *** 677,681 for(x = u.ux-1; x <= u.ux+1; x++) for(y = u.uy-1; y <= u.uy+1; y++){ if(x == u.ux && y == u.uy) continue; ! if(!levl[x][y].typ) continue; if((mtmp = m_at(x,y)) && !mtmp->mimic && (!mtmp->minvis || See_invisible)){ --- 677,681 ----- for(x = u.ux-1; x <= u.ux+1; x++) for(y = u.uy-1; y <= u.uy+1; y++){ if(x == u.ux && y == u.uy) continue; ! if(!RM_TYP(levl[x][y])) continue; if((mtmp = m_at(x,y)) && !mtmp->mimic && (!mtmp->minvis || See_invisible)){ *************** *** 782,786 if(d < 3) return(1); if(d > u.uhorizon*u.uhorizon) return(0); ! if(!levl[x][y].lit) return(0); dx = x - u.ux; adx = abs(dx); sdx = sgn(dx); --- 782,786 ----- if(d < 3) return(1); if(d > u.uhorizon*u.uhorizon) return(0); ! if(!RM_LIT(levl[x][y])) return(0); dx = x - u.ux; adx = abs(dx); sdx = sgn(dx); *************** *** 810,814 rroom(x,y) register int x,y; { ! return(IS_ROOM(levl[u.ux+x][u.uy+y].typ)); } --- 810,814 ----- rroom(x,y) register int x,y; { ! return(IS_ROOM(RM_TYP(levl[u.ux+x][u.uy+y]))); } *************** *** 818,822 if(Blind || u.uswallow) return(0); if(dist(x,y) < 3) return(1); ! if(levl[x][y].lit && seelx <= x && x <= seehx && seely <= y && y <= seehy) return(1); return(0); --- 818,822 ----- if(Blind || u.uswallow) return(0); if(dist(x,y) < 3) return(1); ! if(RM_LIT(levl[x][y]) && seelx <= x && x <= seehx && seely <= y && y <= seehy) return(1); return(0); *************** *** 854,858 return; } ! if(!levl[u.ux][u.uy].lit) { seelx = u.ux-1; seehx = u.ux+1; --- 854,858 ----- return; } ! if(!RM_LIT(levl[u.ux][u.uy])) { seelx = u.ux-1; seehx = u.ux+1; *************** *** 860,867 seehy = u.uy+1; } else { ! for(seelx = u.ux; levl[seelx-1][u.uy].lit; seelx--); ! for(seehx = u.ux; levl[seehx+1][u.uy].lit; seehx++); ! for(seely = u.uy; levl[u.ux][seely-1].lit; seely--); ! for(seehy = u.uy; levl[u.ux][seehy+1].lit; seehy++); } for(y = seely; y <= seehy; y++) --- 860,867 ----- seehy = u.uy+1; } else { ! for(seelx = u.ux; RM_LIT(levl[seelx-1][u.uy]); seelx--); ! for(seehx = u.ux; RM_LIT(levl[seehx+1][u.uy]); seehx++); ! for(seely = u.uy; RM_LIT(levl[u.ux][seely-1]); seely--); ! for(seehy = u.uy; RM_LIT(levl[u.ux][seehy+1]); seehy++); } for(y = seely; y <= seehy; y++) *************** *** 869,873 prl(x,y); } ! if(!levl[u.ux][u.uy].lit) seehx = 0; /* seems necessary elsewhere */ else { if(seely == u.uy) for(x = u.ux-1; x <= u.ux+1; x++) prl(x,seely-1); --- 869,873 ----- prl(x,y); } ! if(!RM_LIT(levl[u.ux][u.uy])) seehx = 0; /* seems necessary elsewhere */ else { if(seely == u.uy) for(x = u.ux-1; x <= u.ux+1; x++) prl(x,seely-1); diff -bc2 invent.c df1:invent.c *** invent.c Wed May 4 15:08:10 1988 --- df1:invent.c Fri Jul 22 21:36:54 1988 *************** *** 802,806 /* added by GAN 10/30/86 */ #ifdef FOUNTAINS ! if(IS_FOUNTAIN(levl[u.ux][u.uy].typ)) { fd++; pline("There is a fountain here."); --- 802,806 ----- /* added by GAN 10/30/86 */ #ifdef FOUNTAINS ! if(IS_FOUNTAIN(RM_TYP(levl[u.ux][u.uy]))) { fd++; pline("There is a fountain here."); *************** *** 808,812 #endif #ifdef NEWCLASS ! if(IS_THRONE(levl[u.ux][u.uy].typ)) { fd++; pline("There is an opulent throne here."); --- 808,812 ----- #endif #ifdef NEWCLASS ! if(IS_THRONE(RM_TYP(levl[u.ux][u.uy]))) { fd++; pline("There is an opulent throne here."); *************** *** 814,818 #endif #ifdef SINKS ! if(IS_SINK(levl[u.ux][u.uy].typ)) { fd++; pline("There is a kitchen sink here."); --- 814,818 ----- #endif #ifdef SINKS ! if(IS_SINK(RM_TYP(levl[u.ux][u.uy]))) { fd++; pline("There is a kitchen sink here."); diff -bc2 lev.c df1:lev.c *** lev.c Wed May 4 15:08:12 1988 --- df1:lev.c Thu Aug 4 12:43:17 1988 *************** *** 34,37 { if (mode & COUNT) { count_only = TRUE; bytes_counted = 0; --- 34,42 ----- { if (mode & COUNT) { + #ifdef COMPRESS /* Should be superfluous */ + if (!count_only) /* Did we just write? */ + bflush(0); + /*dbg();*/ + #endif count_only = TRUE; bytes_counted = 0; *************** *** 42,45 } if (mode & WRITE) { count_only = FALSE; bytes_counted = 0; --- 47,54 ----- } if (mode & WRITE) { + #ifdef COMPRESS + if (mode & COUNT) /* Did we just count? */ + bflush(fd); + #endif count_only = FALSE; bytes_counted = 0; *************** *** 114,117 } bwrite(fd,loc,num) register fd; --- 123,246 ----- } + #ifdef COMPRESS + + #define RLESC '\0' /* Leading character for run of LRESC's */ + #define flushoutrun(ln) bputc(RLESC); bputc(ln); ln = -1; + + static unsigned char outbuf[BUFSZ]; + static unsigned short outbufp = 0; + static short outrunlength = -1; + static int bwritefd; + + /*dbg() + { + printf("outbufp %d outrunlength %d\n", outbufp,outrunlength); + }*/ + + static bputc(c) + unsigned char c; + { + #ifdef DGK + bytes_counted++; + if (count_only) + return; + #endif + if (outbufp >= BUFSZ) { + write(bwritefd, outbuf, (int) BUFSZ); + outbufp = 0; + } + outbuf[outbufp++] = c; + } + + bflush(fd) /* flush run and buffer */ + register fd; + { + bwritefd = fd; + if (outrunlength >= 0) { /* flush run */ + flushoutrun(outrunlength); + } + if (outbufp) { + #ifdef DGK + if (!count_only) /* flush buffer */ + #endif + write(fd, outbuf, outbufp); + outbufp = 0; + } + /*printf("bflush()"); getret();*/ + } + + bwrite(fd, loc, num) + register fd; + register char *loc; + register unsigned num; + { + bwritefd = fd; + for (; num; num--, loc++) { + if (*loc == RLESC) { /* One more char in run */ + if (++outrunlength == 0xFF) { + flushoutrun(outrunlength); + } + } else { /* end of run */ + if (outrunlength >= 0) { /* flush run */ + flushoutrun(outrunlength); + } + bputc(*loc); + } + } + } + + static unsigned char inbuf[BUFSZ]; + static unsigned short inbufp = 0; + static unsigned short inbufsz = 0; + static short inrunlength = -1; + static int mreadfd; + + static int mgetc() + { + if (inbufp >= inbufsz) { + inbufsz = read(mreadfd, (char *)inbuf, (int)sizeof inbuf); + if (!inbufsz) { + if (inbufp > sizeof inbuf) + error("EOF on file #%d.\n", mreadfd); + inbufp = 1 + sizeof inbuf; /* exactly one warning :-) */ + return -1; + } + inbufp = 0; + } + return inbuf[inbufp++]; + } + + minit() + { + inbufsz = 0; + inbufp = 0; + inrunlength = -1; + } + + mread(fd, buf, len) + int fd; + register char *buf; + register unsigned len; + { + /*register int readlen = 0;*/ + mreadfd = fd; + while (len--) { + if (inrunlength > 0) { + inrunlength--; + *buf++ = '\0'; + } else { + register short ch = mgetc(); + if (ch < 0) return -1; /*readlen;*/ + if ((*buf++ = ch) == RLESC) { + inrunlength = mgetc(); + } + } + /*readlen++;*/ + } + return 0; /*readlen;*/ + } + + #else /* COMPRESS */ + bwrite(fd,loc,num) register fd; *************** *** 128,131 } saveobjchn(fd,otmp) register fd; --- 257,280 ----- } + mread(fd, buf, len) + register fd; + register char *buf; + register unsigned len; + { + register int rlen; + extern boolean restoring; + + rlen = read(fd, buf, (int) len); + if(rlen != len){ + pline("Read %d instead of %u bytes.\n", rlen, len); + if(restoring) { + (void) unlink(SAVEF); + error("Error restoring old game."); + } + panic("Error reading level file."); + } + } + #endif + saveobjchn(fd,otmp) register fd; *************** *** 167,170 bwrite(fd, (char *) mtmp, xl + sizeof(struct monst)); if(mtmp->minvent) saveobjchn(fd,mtmp->minvent); free((char *) mtmp); mtmp = mtmp2; --- 316,322 ----- bwrite(fd, (char *) mtmp, xl + sizeof(struct monst)); if(mtmp->minvent) saveobjchn(fd,mtmp->minvent); + #ifdef DGK + if (!count_only) + #endif free((char *) mtmp); mtmp = mtmp2; *************** *** 234,237 if((pid && pid != hpid) || (lev && dlvl != lev)) { pline("Strange, this map is not as I remember it."); pline("Somebody is trying some trickery here ..."); pline("This game is void ..."); --- 386,390 ----- if((pid && pid != hpid) || (lev && dlvl != lev)) { pline("Strange, this map is not as I remember it."); + /* pline("pid = %x (%x), lev = %d (%d).", hpid, pid, dlvl, lev); */ pline("Somebody is trying some trickery here ..."); pline("This game is void ..."); *************** *** 254,258 osym = levl[x][y].scrsym; nsym = 0; ! switch (levl[x][y].typ) { case 0: case SCORR: --- 407,411 ----- osym = levl[x][y].scrsym; nsym = 0; ! switch (RM_TYP(levl[x][y])) { case 0: case SCORR: *************** *** 282,289 /* Now the ugly stuff */ case HWALL: ! up = (y > 0) ? levl[x][y-1].typ : 0; ! dn = (y < ROWNO-1) ?levl[x][y+1].typ : 0; ! lt = (x > 0) ? levl[x-1][y].typ : 0; ! rt = (x < COLNO-1) ?levl[x+1][y].typ : 0; up = up && (up == VWALL || up == DOOR || up == SDOOR); --- 435,442 ----- /* Now the ugly stuff */ case HWALL: ! up = (y > 0) ? RM_TYP(levl[x][y-1]) : 0; ! dn = (y < ROWNO-1) ? RM_TYP(levl[x][y+1]) : 0; ! lt = (x > 0) ? RM_TYP(levl[x-1][y]) : 0; ! rt = (x < COLNO-1) ? RM_TYP(levl[x+1][y]) : 0; up = up && (up == VWALL || up == DOOR || up == SDOOR); *************** *** 397,407 } - mread(fd, buf, len) - register fd; - register char *buf; - register unsigned len; - { - register int rlen; - extern boolean restoring; rlen = read(fd, buf, (int) len); --- 550,553 ----- } mklev() *************** *** 405,419 extern boolean restoring; - rlen = read(fd, buf, (int) len); - if(rlen != len){ - pline("Read %d instead of %u bytes.\n", rlen, len); - if(restoring) { - (void) unlink(SAVEF); - error("Error restoring old game."); - } - panic("Error reading level file."); - } - } - mklev() { --- 551,554 ----- mklev() { *************** *** 488,492 int nfrom, nto, fdfrom, fdto; ! if ((fdfrom = open(from, O_RDONLY | O_BINARY | O_CREAT, FMASK)) < 0) panic("Can't copy from %s !?", from); if ((fdto = open(to, O_WRONLY | O_BINARY | O_CREAT, FMASK)) < 0) --- 623,627 ----- int nfrom, nto, fdfrom, fdto; ! if ((fdfrom = open(from, O_RDONLY | O_BINARY, FMASK)) < 0) panic("Can't copy from %s !?", from); if ((fdto = open(to, O_WRONLY|O_BINARY|O_CREAT|O_TRUNC, FMASK)) < 0) *************** *** 490,494 if ((fdfrom = open(from, O_RDONLY | O_BINARY | O_CREAT, FMASK)) < 0) panic("Can't copy from %s !?", from); ! if ((fdto = open(to, O_WRONLY | O_BINARY | O_CREAT, FMASK)) < 0) panic("Can't copy to %s", to); do { --- 625,629 ----- if ((fdfrom = open(from, O_RDONLY | O_BINARY, FMASK)) < 0) panic("Can't copy from %s !?", from); ! if ((fdto = open(to, O_WRONLY|O_BINARY|O_CREAT|O_TRUNC, FMASK)) < 0) panic("Can't copy to %s", to); do { diff -bc2 makemon.c df1:makemon.c *** makemon.c Wed May 4 15:08:16 1988 --- df1:makemon.c Mon Jul 25 01:42:37 1988 *************** *** 101,105 } gotmon: ! #if defined(KJSMODS) && defined(ROCKMOLE) /* make a giant rat */ if((zlevel < 4 && ptr->mlet == 'r') --- 101,107 ----- } gotmon: ! /* #if defined(KJSMODS) && defined(ROCKMOLE) */ ! #ifdef KJSMODS ! # ifdef ROCKMOLE /* make a giant rat */ if((zlevel < 4 && ptr->mlet == 'r') *************** *** 107,110 || (zlevel == 2 && (ptr->mlet == 'o' || ptr->mlet == 'y')) ) ptr = &giant_rat; #endif mtmp = newmonst(ptr->pxlth); --- 109,113 ----- || (zlevel == 2 && (ptr->mlet == 'o' || ptr->mlet == 'y')) ) ptr = &giant_rat; + # endif #endif mtmp = newmonst(ptr->pxlth); *************** *** 181,185 &mons[zlevel+14+rn2(CMNUM-14-zlevel)]); # else ! 0); # endif #endif --- 184,188 ----- &mons[zlevel+14+rn2(CMNUM-14-zlevel)]); # else ! Null(permonst)); # endif #endif *************** *** 363,367 return( ! (x < 1 || x > COLNO-2 || y < 1 || y > ROWNO-2 || ! m_at(x,y) || !ACCESSIBLE(levl[x][y].typ) || (x == u.ux && y == u.uy) || sobj_at(ENORMOUS_ROCK, x, y) --- 366,370 ----- return( ! (x < 1 || x > COLNO-2 || y < 1 || y > ROWNO-2 || ! m_at(x,y) || !ACCESSIBLE(RM_TYP(levl[x][y])) || (x == u.ux && y == u.uy) || sobj_at(ENORMOUS_ROCK, x, y) diff -bc2 mhitu.c df1:mhitu.c *** mhitu.c Wed May 4 15:08:20 1988 --- df1:mhitu.c Mon Jul 25 01:45:27 1988 *************** *** 128,132 u.ustuck = mtmp; } else if(u.ustuck == mtmp && ! levl[mtmp->mx][mtmp->my].typ == POOL) { pline("%s drowns you ...", Monnam(mtmp)); done("drowned"); --- 128,132 ----- u.ustuck = mtmp; } else if(u.ustuck == mtmp && ! RM_TYP(levl[mtmp->mx][mtmp->my]) == POOL) { pline("%s drowns you ...", Monnam(mtmp)); done("drowned"); diff -bc2 mklev.c df1:mklev.c *** mklev.c Wed May 4 15:08:22 1988 --- df1:mklev.c Mon Jul 25 02:14:04 1988 *************** *** 91,95 ydnstair = somey(); levl[xdnstair][ydnstair].scrsym = DN_SYM; ! levl[xdnstair][ydnstair].typ = STAIRS; #ifdef RPH { struct monst *mtmp; --- 91,95 ----- ydnstair = somey(); levl[xdnstair][ydnstair].scrsym = DN_SYM; ! RM_SET_TYP(levl[xdnstair][ydnstair], STAIRS); #ifdef RPH { struct monst *mtmp; *************** *** 128,132 yupstair = somey(); levl[xupstair][yupstair].scrsym = UP_SYM; ! levl[xupstair][yupstair].typ = STAIRS; /* for each room: put things inside */ --- 128,132 ----- yupstair = somey(); levl[xupstair][yupstair].scrsym = UP_SYM; ! RM_SET_TYP(levl[xupstair][yupstair], STAIRS); /* for each room: put things inside */ *************** *** 378,382 for(x = xl; x <= xh; x++) for(y = yl; y <= yh; y++) ! if(levl[x][y].typ == DOOR || levl[x][y].typ == SDOOR) goto gotit; /* cannot find something reasonable -- strange */ --- 378,382 ----- for(x = xl; x <= xh; x++) for(y = yl; y <= yh; y++) ! if(RM_TYP(levl[x][y]) == DOOR || RM_TYP(levl[x][y]) == SDOOR) goto gotit; /* cannot find something reasonable -- strange */ *************** *** 393,401 register x,y; { ! if(levl[x-1][y].typ == DOOR || levl[x+1][y].typ == DOOR || ! levl[x][y+1].typ == DOOR || levl[x][y-1].typ == DOOR || ! levl[x-1][y].typ == SDOOR || levl[x+1][y].typ == SDOOR || ! levl[x][y-1].typ == SDOOR || levl[x][y+1].typ == SDOOR || ! (levl[x][y].typ != HWALL && levl[x][y].typ != VWALL) || doorindex >= DOORMAX) return(0); --- 393,401 ----- register x,y; { ! if(RM_TYP(levl[x-1][y]) == DOOR || RM_TYP(levl[x+1][y]) == DOOR || ! RM_TYP(levl[x][y+1]) == DOOR || RM_TYP(levl[x][y-1]) == DOOR || ! RM_TYP(levl[x-1][y]) == SDOOR || RM_TYP(levl[x+1][y]) == SDOOR || ! RM_TYP(levl[x][y-1]) == SDOOR || RM_TYP(levl[x][y+1]) == SDOOR || ! (RM_TYP(levl[x][y]) != HWALL && RM_TYP(levl[x][y]) != VWALL) || doorindex >= DOORMAX) return(0); *************** *** 424,428 register tmp; ! if(!IS_WALL(levl[x][y].typ)) /* avoid SDOORs with DOOR_SYM as scrsym */ type = DOOR; levl[x][y].typ = type; --- 424,428 ----- register tmp; ! if(!IS_WALL(RM_TYP(levl[x][y]))) /* avoid SDOORs with DOOR_SYM as scrsym */ type = DOOR; RM_SET_TYP(levl[x][y], type); *************** *** 426,430 if(!IS_WALL(levl[x][y].typ)) /* avoid SDOORs with DOOR_SYM as scrsym */ type = DOOR; ! levl[x][y].typ = type; if(type == DOOR) levl[x][y].scrsym = DOOR_SYM; --- 426,430 ----- if(!IS_WALL(RM_TYP(levl[x][y]))) /* avoid SDOORs with DOOR_SYM as scrsym */ type = DOOR; ! RM_SET_TYP(levl[x][y], type); if(type == DOOR) levl[x][y].scrsym = DOOR_SYM; *************** *** 459,463 for(x = lowx - xlim; x <= hix + xlim; x++) { for(y = lowy - ylim; y <= hiy + ylim; y++) { ! if(levl[x][y].typ) { #ifdef WIZARD if(wizard && !secret) --- 459,463 ----- for(x = lowx - xlim; x <= hix + xlim; x++) { for(y = lowy - ylim; y <= hiy + ylim; y++) { ! if(RM_TYP(levl[x][y])) { #ifdef WIZARD if(wizard && !secret) *************** *** 485,489 for(x = lowx-1; x <= hix+1; x++) for(y = lowy-1; y <= hiy+1; y++) ! levl[x][y].lit = 1; croom->rlit = 1; } else --- 485,489 ----- for(x = lowx-1; x <= hix+1; x++) for(y = lowy-1; y <= hiy+1; y++) ! RM_SET_LIT(levl[x][y]); croom->rlit = 1; } else *************** *** 499,503 for(y = lowy-1; y <= hiy+1; y += (hiy-lowy+2)) { levl[x][y].scrsym = HWALL_SYM; ! levl[x][y].typ = HWALL; } for(x = lowx-1; x <= hix+1; x += (hix-lowx+2)) --- 499,503 ----- for(y = lowy-1; y <= hiy+1; y += (hiy-lowy+2)) { levl[x][y].scrsym = HWALL_SYM; ! RM_SET_TYP(levl[x][y], HWALL); } for(x = lowx-1; x <= hix+1; x += (hix-lowx+2)) *************** *** 504,508 for(y = lowy; y <= hiy; y++) { levl[x][y].scrsym = VWALL_SYM; ! levl[x][y].typ = VWALL; } for(x = lowx; x <= hix; x++) --- 504,508 ----- for(y = lowy; y <= hiy; y++) { levl[x][y].scrsym = VWALL_SYM; ! RM_SET_TYP(levl[x][y], VWALL); } for(x = lowx; x <= hix; x++) *************** *** 509,513 for(y = lowy; y <= hiy; y++) { levl[x][y].scrsym = ROOM_SYM; ! levl[x][y].typ = ROOM; } levl[lowx-1][lowy-1].scrsym = TLCORN_SYM; --- 509,513 ----- for(y = lowy; y <= hiy; y++) { levl[x][y].scrsym = ROOM_SYM; ! RM_SET_TYP(levl[x][y], ROOM); } levl[lowx-1][lowy-1].scrsym = TLCORN_SYM; *************** *** 594,598 tx = tt.x - dx; ty = tt.y - dy; ! if(nxcor && levl[xx+dx][yy+dy].typ) return; dodoor(xx,yy,croom); --- 594,598 ----- tx = tt.x - dx; ty = tt.y - dy; ! if(nxcor && RM_TYP(levl[xx+dx][yy+dy])) return; dodoor(xx,yy,croom); *************** *** 611,615 crm = &levl[xx][yy]; ! if(!(crm->typ)) { if(rn2(100)) { crm->typ = CORR; --- 611,615 ----- crm = &levl[xx][yy]; ! if(!(RM_TYP(*crm))) { if(rn2(100)) { RM_SET_TYP(*crm, CORR); *************** *** 613,617 if(!(crm->typ)) { if(rn2(100)) { ! crm->typ = CORR; crm->scrsym = CORR_SYM; if(nxcor && !rn2(50)) --- 613,617 ----- if(!(RM_TYP(*crm))) { if(rn2(100)) { ! RM_SET_TYP(*crm, CORR); crm->scrsym = CORR_SYM; if(nxcor && !rn2(50)) *************** *** 618,622 (void) mkobj_at(ROCK_SYM, xx, yy); } else { ! crm->typ = SCORR; crm->scrsym = STONE_SYM; } --- 618,622 ----- (void) mkobj_at(ROCK_SYM, xx, yy); } else { ! RM_SET_TYP(*crm, SCORR); crm->scrsym = STONE_SYM; } *************** *** 622,626 } } else ! if(crm->typ != CORR && crm->typ != SCORR) { /* strange ... */ return; --- 622,626 ----- } } else ! if(RM_TYP(*crm) != CORR && RM_TYP(*crm) != SCORR) { /* strange ... */ return; *************** *** 636,640 crm = &levl[xx+ddx][yy]; ! if(!crm->typ || crm->typ == CORR || crm->typ == SCORR) { dx = ddx; dy = 0; --- 636,640 ----- crm = &levl[xx+ddx][yy]; ! if(!RM_TYP(*crm) || RM_TYP(*crm) == CORR || RM_TYP(*crm) == SCORR) { dx = ddx; dy = 0; *************** *** 645,649 crm = &levl[xx][yy+ddy]; ! if(!crm->typ || crm->typ == CORR || crm->typ == SCORR) { dy = ddy; dx = 0; --- 645,649 ----- crm = &levl[xx][yy+ddy]; ! if(!RM_TYP(*crm) || RM_TYP(*crm) == CORR || RM_TYP(*crm) == SCORR) { dy = ddy; dx = 0; *************** *** 654,658 /* continue straight on? */ crm = &levl[xx+dx][yy+dy]; ! if(!crm->typ || crm->typ == CORR || crm->typ == SCORR) continue; --- 654,658 ----- /* continue straight on? */ crm = &levl[xx+dx][yy+dy]; ! if(!RM_TYP(*crm) || RM_TYP(*crm) == CORR || RM_TYP(*crm) == SCORR) continue; *************** *** 662,666 dy = (ty < yy) ? -1 : 1; crm = &levl[xx+dx][yy+dy]; ! if(!crm->typ || crm->typ == CORR || crm->typ == SCORR) continue; dy = -dy; --- 662,666 ----- dy = (ty < yy) ? -1 : 1; crm = &levl[xx+dx][yy+dy]; ! if(!RM_TYP(*crm) || RM_TYP(*crm) == CORR || RM_TYP(*crm) == SCORR) continue; dy = -dy; *************** *** 670,674 dx = (tx < xx) ? -1 : 1; crm = &levl[xx+dx][yy+dy]; ! if(!crm->typ || crm->typ == CORR || crm->typ == SCORR) continue; dx = -dx; --- 670,674 ----- dx = (tx < xx) ? -1 : 1; crm = &levl[xx+dx][yy+dy]; ! if(!RM_TYP(*crm) || RM_TYP(*crm) == CORR || RM_TYP(*crm) == SCORR) continue; dx = -dx; *************** *** 767,771 xx = dd.x; yy = dd.y; ! if((rm = &levl[xx][yy+dy])->typ) continue; if(trap_type || !rn2(4)) { --- 767,771 ----- xx = dd.x; yy = dd.y; ! if((rm = &levl[xx][yy+dy]), RM_TYP(*rm)) continue; if(trap_type || !rn2(4)) { *************** *** 770,774 if(trap_type || !rn2(4)) { ! rm->typ = SCORR; rm->scrsym = STONE_SYM; if(trap_type) { --- 770,774 ----- if(trap_type || !rn2(4)) { ! RM_SET_TYP(*rm, SCORR); rm->scrsym = STONE_SYM; if(trap_type) { *************** *** 780,784 dosdoor(xx, yy, aroom, SDOOR); } else { ! rm->typ = CORR; rm->scrsym = CORR_SYM; if(rn2(7)) --- 780,784 ----- dosdoor(xx, yy, aroom, SDOOR); } else { ! RM_SET_TYP(*rm, CORR); rm->scrsym = CORR_SYM; if(rn2(7)) *************** *** 887,891 my = somey(); } ! } while(m_at(mx,my) || levl[mx][my].typ == STAIRS); if(mtmp = makemon(PM_MIMIC,mx,my)) { mtmp->mimic = 1; --- 887,891 ----- my = somey(); } ! } while(m_at(mx,my) || RM_TYP(levl[mx][my]) == STAIRS); if(mtmp = makemon(PM_MIMIC,mx,my)) { mtmp->mimic = 1; *************** *** 914,918 my = somey(); } ! } while(t_at(mx, my) || levl[mx][my].typ == STAIRS); ttmp = maketrap(mx, my, kind); #ifdef SPIDERS --- 914,918 ----- my = somey(); } ! } while(t_at(mx, my) || RM_TYP(levl[mx][my]) == STAIRS); ttmp = maketrap(mx, my, kind); #ifdef SPIDERS *************** *** 943,947 my = somey(); } ! } while(t_at(mx, my) || levl[mx][my].typ == STAIRS #ifdef NEWCLASS || IS_THRONE(levl[mx][my].typ) --- 943,947 ----- my = somey(); } ! } while(t_at(mx, my) || RM_TYP(levl[mx][my]) == STAIRS #ifdef NEWCLASS || IS_THRONE(RM_TYP(levl[mx][my])) *************** *** 945,949 } while(t_at(mx, my) || levl[mx][my].typ == STAIRS #ifdef NEWCLASS ! || IS_THRONE(levl[mx][my].typ) #endif ); --- 945,949 ----- } while(t_at(mx, my) || RM_TYP(levl[mx][my]) == STAIRS #ifdef NEWCLASS ! || IS_THRONE(RM_TYP(levl[mx][my])) #endif ); *************** *** 951,955 /* Put a fountain at mx, my */ ! levl[mx][my].typ = FOUNTAIN; levl[mx][my].scrsym = FOUNTAIN_SYM; --- 951,955 ----- /* Put a fountain at mx, my */ ! RM_SET_TYP(levl[mx][my], FOUNTAIN); levl[mx][my].scrsym = FOUNTAIN_SYM; *************** *** 969,973 mx = somex(); my = somey(); ! } while(t_at(mx, my) || levl[mx][my].typ == STAIRS #ifdef FOUNTAINS || IS_FOUNTAIN(levl[mx][my].typ) --- 969,973 ----- mx = somex(); my = somey(); ! } while(t_at(mx, my) || RM_TYP(levl[mx][my]) == STAIRS #ifdef FOUNTAINS || IS_FOUNTAIN(RM_TYP(levl[mx][my])) *************** *** 971,975 } while(t_at(mx, my) || levl[mx][my].typ == STAIRS #ifdef FOUNTAINS ! || IS_FOUNTAIN(levl[mx][my].typ) #endif #ifdef NEWCLASS --- 971,975 ----- } while(t_at(mx, my) || RM_TYP(levl[mx][my]) == STAIRS #ifdef FOUNTAINS ! || IS_FOUNTAIN(RM_TYP(levl[mx][my])) #endif #ifdef NEWCLASS *************** *** 974,978 #endif #ifdef NEWCLASS ! || IS_THRONE(levl[mx][my].typ) #endif ); --- 974,978 ----- #endif #ifdef NEWCLASS ! || IS_THRONE(RM_TYP(levl[mx][my])) #endif ); *************** *** 980,984 /* Put a sink at mx, my */ ! levl[mx][my].typ = SINK; levl[mx][my].scrsym = SINK_SYM; --- 980,984 ----- /* Put a sink at mx, my */ ! RM_SET_TYP(levl[mx][my], SINK); levl[mx][my].scrsym = SINK_SYM; diff -bc2 mon.c df1:mon.c *** mon.c Wed May 4 15:08:28 1988 --- df1:mon.c Sat Jul 23 00:32:30 1988 *************** *** 45,49 extern struct permonst pm_gremlin; ! inpool = (levl[mtmp->mx][mtmp->my].typ == POOL); iseel = (mtmp->data->mlet == ';'); isgremlin = (mtmp->data->mlet == 'G' && mtmp->isgremlin); --- 45,49 ----- extern struct permonst pm_gremlin; ! inpool = (RM_TYP(levl[mtmp->mx][mtmp->my]) == POOL); iseel = (mtmp->data->mlet == ';'); isgremlin = (mtmp->data->mlet == 'G' && mtmp->isgremlin); *************** *** 48,52 iseel = (mtmp->data->mlet == ';'); isgremlin = (mtmp->data->mlet == 'G' && mtmp->isgremlin); ! infountain = (levl[mtmp->mx][mtmp->my].typ == FOUNTAIN); if((inpool || infountain) && isgremlin && rn2(3)) { coord mm; --- 48,52 ----- iseel = (mtmp->data->mlet == ';'); isgremlin = (mtmp->data->mlet == 'G' && mtmp->isgremlin); ! infountain = (RM_TYP(levl[mtmp->mx][mtmp->my]) == FOUNTAIN); if((inpool || infountain) && isgremlin && rn2(3)) { coord mm; *************** *** 231,235 x = mon->mx; y = mon->my; ! nowtyp = levl[x][y].typ; pool = (mon->data->mlet == ';'); --- 231,235 ----- x = mon->mx; y = mon->my; ! nowtyp = RM_TYP(levl[x][y]); pool = (mon->data->mlet == ';'); *************** *** 243,247 if(nx != x || ny != y) if(isok(nx,ny)) #ifdef ROCKMOLE ! if(!IS_ROCK(ntyp = levl[nx][ny].typ) || (flag & ALLOW_WALL)) #else if(!IS_ROCK(ntyp = levl[nx][ny].typ)) --- 243,247 ----- if(nx != x || ny != y) if(isok(nx,ny)) #ifdef ROCKMOLE ! if(!IS_ROCK(ntyp = RM_TYP(levl[nx][ny])) || (flag & ALLOW_WALL)) #else if(!IS_ROCK(ntyp = RM_TYP(levl[nx][ny]))) *************** *** 245,249 if(!IS_ROCK(ntyp = levl[nx][ny].typ) || (flag & ALLOW_WALL)) #else ! if(!IS_ROCK(ntyp = levl[nx][ny].typ)) #endif if(!(nx != x && ny != y && (nowtyp == DOOR || ntyp == DOOR))) --- 245,249 ----- if(!IS_ROCK(ntyp = RM_TYP(levl[nx][ny])) || (flag & ALLOW_WALL)) #else ! if(!IS_ROCK(ntyp = RM_TYP(levl[nx][ny]))) #endif if(!(nx != x && ny != y && (nowtyp == DOOR || ntyp == DOOR))) *************** *** 627,631 # endif #endif ! if(!ACCESSIBLE(levl[x][y].typ)) { /* might be mimic in wall or dead eel*/ newsym(x,y); --- 627,631 ----- # endif #endif ! if(!ACCESSIBLE(RM_TYP(levl[x][y]))) { /* might be mimic in wall or dead eel*/ newsym(x,y); *************** *** 817,821 && !rn2(3)) { mtmp->mimic = 1; ! mtmp->mappearance = (levl[mtmp->mx][mtmp->my].typ == DOOR) ? DOOR_SYM : GOLD_SYM; return(1); } --- 817,821 ----- && !rn2(3)) { mtmp->mimic = 1; ! mtmp->mappearance = (RM_TYP(levl[mtmp->mx][mtmp->my]) == DOOR) ? DOOR_SYM : GOLD_SYM; return(1); } *************** *** 825,829 && !rn2(3)) { ! if(levl[mtmp->mx][mtmp->my].typ == ROOM) { maketrap(mtmp->mx, mtmp->my, PIERC); --- 825,829 ----- && !rn2(3)) { ! if(RM_TYP(levl[mtmp->mx][mtmp->my]) == ROOM) { maketrap(mtmp->mx, mtmp->my, PIERC); diff -bc2 monmove.c df1:monmove.c *** monmove.c Wed May 4 15:08:32 1988 --- df1:monmove.c Sun Jul 24 14:01:44 1988 *************** *** 192,196 if((msym == 't' && !rn2(5)) || (msym == '1' && (mtmp->mhp < 7 || (!xdnstair && !rn2(5)) ! || levl[u.ux][u.uy].typ == STAIRS))) { if(mtmp->mhp < 7 || (msym == 't' && rn2(2))) rloc(mtmp); --- 192,196 ----- if((msym == 't' && !rn2(5)) || (msym == '1' && (mtmp->mhp < 7 || (!xdnstair && !rn2(5)) ! || RM_TYP(levl[u.ux][u.uy]) == STAIRS))) { if(mtmp->mhp < 7 || (msym == 't' && rn2(2))) rloc(mtmp); *************** *** 425,430 && dlevel > 3 #endif ! && IS_ROCK(levl[mtmp->mx][mtmp->my].typ) && ! levl[mtmp->mx][mtmp->my].typ != POOL){ register int pile = rnd(25); /* Just ate something. */ --- 425,430 ----- && dlevel > 3 #endif ! && IS_ROCK(RM_TYP(levl[mtmp->mx][mtmp->my])) && ! RM_TYP(levl[mtmp->mx][mtmp->my]) != POOL){ register int pile = rnd(25); /* Just ate something. */ *************** *** 429,436 register int pile = rnd(25); /* Just ate something. */ ! if(levl[mtmp->mx][mtmp->my].typ == 0) ! levl[mtmp->mx][mtmp->my].typ = CORR; ! else if(IS_WALL(levl[mtmp->mx][mtmp->my].typ)) ! levl[mtmp->mx][mtmp->my].typ = DOOR; mnewsym(mtmp->mx,mtmp->my); /* Left behind a pile? */ --- 429,436 ----- register int pile = rnd(25); /* Just ate something. */ ! if (RM_TYP(levl[mtmp->mx][mtmp->my]) == 0) ! RM_SET_TYP(levl[mtmp->mx][mtmp->my], CORR); ! else if (IS_WALL(RM_TYP(levl[mtmp->mx][mtmp->my]))) ! RM_SET_TYP(levl[mtmp->mx][mtmp->my], DOOR); mnewsym(mtmp->mx,mtmp->my); /* Left behind a pile? */ diff -bc2 msdos.c df1:msdos.c *** msdos.c Wed May 4 15:08:36 1988 --- df1:msdos.c Sun Jul 24 23:52:30 1988 *************** *** 520,524 #ifdef GRAPHICS } else if (!strncmp(buf, "GRAPHICS", 4)) { ! char translate[17]; short i; --- 520,524 ----- #ifdef GRAPHICS } else if (!strncmp(buf, "GRAPHICS", 4)) { ! unsigned int translate[MAXPCHARS]; short i; *************** *** 523,527 short i; ! if ((i = sscanf(bufp, "%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u", &translate[0], &translate[1], &translate[2], &translate[3], &translate[4], &translate[5], --- 523,527 ----- short i; ! if ((i = sscanf(bufp, "%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d", &translate[0], &translate[1], &translate[2], &translate[3], &translate[4], &translate[5], *************** *** 529,533 &translate[9], &translate[10], &translate[11], &translate[12], &translate[13], &translate[14], ! &translate[15], &translate[16])) < 0) { msmsg ("Syntax error in GRAPHICS\n"); getreturn("to continue"); --- 529,533 ----- &translate[9], &translate[10], &translate[11], &translate[12], &translate[13], &translate[14], ! &translate[15], &translate[16], &translate[17])) < 0) { msmsg ("Syntax error in GRAPHICS\n"); getreturn("to continue"); *************** *** 533,537 getreturn("to continue"); } - translate[i] = '\0'; #endif /* GRAPHICS /**/ /* --- 533,536 ----- getreturn("to continue"); } #endif /* GRAPHICS /**/ /* *************** *** 539,543 * in or out and forget to change the tail entries in your graphics string. */ ! #define SETPCHAR(f, n) showsyms.f = (strlen(translate) > n) ? translate[n] : defsyms.f SETPCHAR(stone, 0); SETPCHAR(vwall, 1); --- 538,542 ----- * in or out and forget to change the tail entries in your graphics string. */ ! #define SETPCHAR(f, n) showsyms.f = (i > n) ? translate[n] : defsyms.f SETPCHAR(stone, 0); SETPCHAR(vwall, 1); *************** *** 562,565 #ifdef SPIDERS SETPCHAR(web, 16); #endif #undef SETPCHAR --- 561,567 ----- #ifdef SPIDERS SETPCHAR(web, 16); + #endif + #ifdef SINKS + SETPCHAR(sink, 17); #endif #undef SETPCHAR diff -bc2 o_init.c Amiga:o_init.c *** o_init.c Tue May 3 16:58:02 1988 --- Amiga:o_init.c Thu Jul 28 23:15:29 1988 *************** *** 60,63 while(--j > first) /* NOTE: longest color name must be default */ if(!strcmp(objects[j].oc_name,"turquoise")) { if(rn2(2)) /* change from green? */ --- 60,64 ----- while(--j > first) /* NOTE: longest color name must be default */ + /* NOTE: these names won't get saved (OIS)*/ if(!strcmp(objects[j].oc_name,"turquoise")) { if(rn2(2)) /* change from green? */ *************** *** 130,135 register int i; unsigned len; ! struct objclass *now = &objects[0]; ! bwrite(fd, (char *) &now, sizeof now); bwrite(fd, (char *) bases, sizeof bases); bwrite(fd, (char *) objects, sizeof objects); --- 131,138 ----- register int i; unsigned len; ! /* char *now = objects[0].oc_name; */ ! /* The place where the string literals are put seems */ ! /* like a better reference point to me (OIS) */ ! /* bwrite(fd, (char *) &now, sizeof now); */ bwrite(fd, (char *) bases, sizeof bases); bwrite(fd, (char *) objects, sizeof objects); *************** *** 137,140 need not save oc_name and oc_descr, but we must save oc_uname for all objects */ for(i=0; i < SIZE(objects); i++) { if(objects[i].oc_uname) { --- 140,145 ----- need not save oc_name and oc_descr, but we must save oc_uname for all objects */ + /* we also save food, weapons, tools, balls, chains, rocks, + armor, which is a real waste... (OIS) */ for(i=0; i < SIZE(objects); i++) { if(objects[i].oc_uname) { *************** *** 149,153 register int i; unsigned len; ! struct objclass *then; long differ; mread(fd, (char *) &then, sizeof then); --- 154,158 ----- register int i; unsigned len; ! /* char *then; */ long differ; /* mread(fd, (char *) &then, sizeof then); */ *************** *** 151,155 struct objclass *then; long differ; ! mread(fd, (char *) &then, sizeof then); mread(fd, (char *) bases, sizeof bases); mread(fd, (char *) objects, sizeof objects); --- 156,161 ----- /* char *then; */ long differ; ! /* mread(fd, (char *) &then, sizeof then); */ ! differ = (long) objects[0].oc_name; mread(fd, (char *) bases, sizeof bases); mread(fd, (char *) objects, sizeof objects); *************** *** 155,159 mread(fd, (char *) objects, sizeof objects); #ifndef MSDOS ! differ = (char *)&objects[0] - (char *)then; #else differ = (long)&objects[0] - (long)then; --- 161,166 ----- mread(fd, (char *) objects, sizeof objects); #ifndef MSDOS ! /* differ = (char *)&objects[0] - (char *)then; */ ! differ = differ /* == our refpoint */ - objects[0].oc_name /* old */; #else differ = differ - (long)objects[0].oc_name; *************** *** 157,161 differ = (char *)&objects[0] - (char *)then; #else ! differ = (long)&objects[0] - (long)then; #endif for(i=0; i < SIZE(objects); i++) { --- 164,168 ----- differ = differ /* == our refpoint */ - objects[0].oc_name /* old */; #else ! differ = differ - (long)objects[0].oc_name; #endif for(i=0; i < SIZE(objects); i++) { diff -bc2 obj.h Amiga:obj.h No differences encountered diff -bc2 objclass.h Amiga:objclass.h No differences encountered diff -bc2 objects.h Amiga:objects.h No differences encountered diff -bc2 pcmain.c Amiga:pcmain.c *** pcmain.c Wed May 4 15:08:46 1988 --- Amiga:pcmain.c Wed Jul 27 23:33:56 1988 *************** *** 1,5 /* SCCS Id: @(#)pcmain.c 2.3 87/12/12 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ ! /* main.c - (PC) version */ #include <stdio.h> --- 1,5 ----- /* SCCS Id: @(#)pcmain.c 2.3 87/12/12 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ ! /* main.c - (PC and AMIGA) version */ #include <stdio.h> *************** *** 7,12 #include "hack.h" ! #ifdef QUEST ! #define gamename "PC NetQuest" #else #define gamename "PC NetHack" --- 7,16 ----- #include "hack.h" ! #ifdef AMIGA ! # ifdef QUEST ! # define gamename "Amiga NetQuest" ! # else ! # define gamename "Amiga NetHack" ! # endif #else # ifdef QUEST *************** *** 10,14 #define gamename "PC NetQuest" #else ! #define gamename "PC NetHack" #endif --- 14,22 ----- # endif #else ! # ifdef QUEST ! # define gamename "PC NetQuest" ! # else ! # define gamename "PC NetHack" ! # endif #endif *************** *** 13,16 #endif char orgdir[PATHLEN], *getcwd(); --- 21,27 ----- #endif + #ifdef AMIGA + extern char orgdir[1]; + #else char orgdir[PATHLEN], *getcwd(); #endif *************** *** 14,17 char orgdir[PATHLEN], *getcwd(); extern struct permonst mons[CMNUM+2]; --- 25,29 ----- #else char orgdir[PATHLEN], *getcwd(); + #endif extern struct permonst mons[CMNUM+2]; *************** *** 37,40 register char *dir; extern struct monst *makedog(); #ifdef MSDOS static void moveloop(); /* a helper function for MSC optimizer */ --- 49,66 ----- register char *dir; extern struct monst *makedog(); + + #ifdef AMIGA + char ch; + int abort; + + /* + * Make sure screen IO is initialized before anything happens. + */ + + gettty(); + startup(); + hackpid = getpid(); + #endif + #ifdef MSDOS # ifndef AMIGA *************** *** 38,41 extern struct monst *makedog(); #ifdef MSDOS static void moveloop(); /* a helper function for MSC optimizer */ --- 64,68 ----- #ifdef MSDOS + # ifndef AMIGA static void moveloop(); /* a helper function for MSC optimizer */ *************** *** 53,56 */ signal(SIGINT, funcp); /* restore original directory */ #endif --- 80,84 ----- */ signal(SIGINT, funcp); /* restore original directory */ + # endif #endif *************** *** 69,73 (void) strcpy(hackdir, orgdir); dir = hackdir; ! #else dir = getenv("HACKDIR"); if(argc > 1 && !strncmp(argv[1], "-d", 2)) { --- 97,101 ----- (void) strcpy(hackdir, orgdir); dir = hackdir; ! #else /* DGK */ dir = getenv("HACKDIR"); if(argc > 1 && !strncmp(argv[1], "-d", 2)) { *************** *** 100,103 * Remember tty modes, to be restored on exit. */ gettty(); setbuf(stdout,obuf); --- 128,132 ----- * Remember tty modes, to be restored on exit. */ + #ifndef AMIGA gettty(); setbuf(stdout,obuf); *************** *** 102,106 gettty(); setbuf(stdout,obuf); - setrandom(); startup(); init_corpses(); /* initialize optional corpse names */ --- 131,134 ----- gettty(); setbuf(stdout,obuf); startup(); #endif /* !AMIGA */ *************** *** 104,107 setrandom(); startup(); init_corpses(); /* initialize optional corpse names */ cls(); --- 132,137 ----- setbuf(stdout,obuf); startup(); + #endif /* !AMIGA */ + setrandom(); init_corpses(); /* initialize optional corpse names */ cls(); *************** *** 125,129 # ifdef MSDOS wizard = TRUE; ! # else if(!strcmp(getlogin(), WIZARD)) wizard = TRUE; SHAR_EOF # End of shell archive exit 0 -- Bob Page, U of Lowell CS Dept. page@swan.ulowell.edu ulowell!page Have five nice days.