Path: utzoo!utgpu!watserv1!watmath!att!linac!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!caen!spool.mu.edu!news.cs.indiana.edu!ariel.unm.edu!triton.unm.edu!schaker From: schaker@triton.unm.edu (Stefan Chakerian) Newsgroups: comp.sources.games.bugs Subject: Re: Running MDG under Ultrix 4.2 Message-ID: <1991Jun19.173756.726@ariel.unm.edu> Date: 19 Jun 91 17:37:56 GMT References: <1991Jun14.045857.2837@spock.UUCP> Organization: University of New Mexico, Albuquerque Lines: 615 In the days of yore <1991Jun14.045857.2837@spock.UUCP> gandalf@spock.UUCP (Mark Halstead) writes: < 'z' || ch < 'a')); *************** *** 279,284 **** --- 283,289 ---- } addstr("; do it? (y/n) "); + refresh(); /* schaker */ while((yesno = tolower(getch())) != 'n' && yesno != 'y'); addch(yesno); *************** *** 460,465 **** --- 465,471 ---- park_csr(); clrtoeol(); addstr(" Enter new name: "); + refresh(); /* schaker */ getword(p->name, 20); *************** *** 623,628 **** --- 629,635 ---- pos--; buf[pos] = '\0'; addstr("\b \b"); + refresh(); /* schaker */ } break; case '\n' : *************** *** 637,642 **** --- 644,650 ---- buf[pos++] = ch; buf[pos] = '\0'; addch(ch); + refresh(); /* schaker */ } break; } *** ../combat.c Wed Jun 19 10:52:56 1991 --- combat.c Sat Jun 8 20:08:57 1991 *************** *** 696,702 **** switch(rnd(2)) { case 1 : ! put_item_tr(sector, x, y); break; case 2 : put_treasure(tval * 20, sector, x, y); --- 696,702 ---- switch(rnd(2)) { case 1 : ! put_item_tr(tval, sector, x, y); break; case 2 : put_treasure(tval * 20, sector, x, y); *************** *** 741,760 **** } ! put_item_tr(sector, x, y) ! int sector, x, y; { ! int i, choice; choice = -1; ! for(i = 0; i < pseg->item_count; i++) { ! if(pseg->itm[i].loc.sector == LOC_NONESUCH ! && pseg->itm[i].type != CRYSTAL ! && pseg->itm[i].type != CASH) { ! if(choice == -1 || rnd(2) == 1) ! choice = i; ! } } if(choice == -1) --- 741,764 ---- } ! put_item_tr(mval, sector, x, y) ! int mval, sector, x, y; { ! register int i, tmpi, tmpv, choice; choice = -1; ! for (i = 0; i < (pseg->item_count / 4) && choice < 0; i++) { ! tmpi = rnd(pseg->item_count) - 1; ! if (pseg->itm[tmpi].loc.sector == LOC_NONESUCH ! && pseg->itm[tmpi].type != CRYSTAL ! && pseg->itm[tmpi].type != CASH) { ! if (rnd(tmpv=pseg->itm[tmpi].value)/10 > mval ! || tmpv/40 > mval ! || (tmpv>10 && tmpv * 2 < mval)) ! continue; ! choice = tmpi; ! } } if(choice == -1) *** ../dmain.c Wed Jun 19 10:53:14 1991 --- dmain.c Wed Jun 5 08:39:50 1991 *************** *** 72,81 **** exit(1); } ! if((tmp = creat(LOCKFILE, 0)) == -1) { ! fprintf(stderr, "%s: daemon lock found, aborting...\n", ! progname); ! exit(99); } close(tmp); --- 72,90 ---- exit(1); } ! if((tmp = creat(LOCKFILE, 0444)) == -1) { ! char tmpa[20]; ! tmp = open(LOCKFILE, 0, O_RDONLY); ! (void) read(tmp, tmpa, 20); ! tmpa[19] = '\0'; ! fprintf(stderr, "%s: daemon lock found on %s, aborting...\n", ! progname, tmpa); ! exit(99); ! } else { /* schaker */ ! char tmpa[20]; ! gethostname(tmpa,20); ! tmpa[19] = '\0'; ! write(tmp, tmpa, strlen(tmpa)); } close(tmp); *************** *** 240,246 **** } ! int rename(oldname, newname) char *oldname, *newname; { unlink(newname); --- 249,255 ---- } ! int mdg_rename(oldname, newname) /* schaker */ char *oldname, *newname; { unlink(newname); *************** *** 272,278 **** return fp; } else if(mode[0] == 'w') { strcat(altfile, OLDEXT); ! rename(savefile, altfile); return fopen(savefile, "w"); } --- 281,287 ---- return fp; } else if(mode[0] == 'w') { strcat(altfile, OLDEXT); ! mdg_rename(savefile, altfile); /* schaker */ return fopen(savefile, "w"); } *** ../files.h Wed Jun 19 10:53:27 1991 --- files.h Tue Jun 4 10:50:34 1991 *************** *** 8,14 **** SCCSID @(#) files.h (1.1) created 12/25/90 */ ! #define GAME_HOME "/usr/games/mdg_dir" #define LOCKFILE "LOCK.daemon" --- 8,14 ---- SCCSID @(#) files.h (1.1) created 12/25/90 */ ! #define GAME_HOME "/u18/schaker/lib/mdg_dir" #define LOCKFILE "LOCK.daemon" *** ../gmain.c Wed Jun 19 10:52:39 1991 --- gmain.c Wed Jun 19 09:47:40 1991 *************** *** 10,15 **** --- 10,16 ---- static char *sccsx = "@(#) MDG Copyright 1990 John C. Gonnerman"; static char *sccsvers = "@(#) gmain.c\t(1.4)\tcreated 1/3/91"; + #include #include #include #include *************** *** 70,87 **** exit(1); } ! setupterm(NULL, 2, NULL); tputs(tigetstr("clear"), 1, eputc); fputs(BAR, stderr); fputs(TITLE, stderr); fputs(COPYRIGHT, stderr); ! fputs(PRESSMSG, stderr); fputs(INDENT, stderr); io_init(); (void)getchar(); io_reset(); fputs(WAITMSG, stderr); --- 71,94 ---- exit(1); } ! /* setupterm(NULL, 2, NULL); tputs(tigetstr("clear"), 1, eputc); + schaker */ fputs(BAR, stderr); fputs(TITLE, stderr); fputs(COPYRIGHT, stderr); ! /* fputs(PRESSMSG, stderr); */ fputs(INDENT, stderr); + /* + * Use ioctls if you must do this. tty(4) gives the appropriate calls. + */ + #if 0 io_init(); (void)getchar(); io_reset(); + #endif /* 0 */ fputs(WAITMSG, stderr); *************** *** 115,122 **** if((gseg = (struct game_msg *)shmat(gseg_id, 0, 0)) == (struct game_msg *)-1) { ! fprintf(CANTERR, progname, "attach private segment", ! sys_errlist[errno]); exit(1); } --- 122,129 ---- if((gseg = (struct game_msg *)shmat(gseg_id, 0, 0)) == (struct game_msg *)-1) { ! fprintf(stderr, CANTERR, progname, ! "attach private segment", sys_errlist[errno]); exit(1); } *************** *** 156,163 **** /* set up the terminal */ initscr(); ! curs_set(0); ! io_init(); /* we got it, let's do it! */ --- 163,170 ---- /* set up the terminal */ initscr(); ! cbreak(); ! noecho(); /* we got it, let's do it! */ *************** *** 226,231 **** --- 233,239 ---- putc(ch, stderr); } + #if 0 io_init() { *************** *** 245,250 **** --- 253,259 ---- ioctl(0, TCSETA, &save); } + #endif seg_attach() { *************** *** 282,288 **** kill(pid, SIGTERM); wait(&status); ! io_reset(); noecho(); while(getch() != '\n'); --- 291,297 ---- kill(pid, SIGTERM); wait(&status); ! /* io_reset(); schaker */ noecho(); while(getch() != '\n'); *************** *** 289,295 **** endwin(); ! tputs(tigetstr("clear"), 1, eputc); shmdt(mseg); shmdt(pseg); --- 298,304 ---- endwin(); ! /* tputs(tigetstr("clear"), 1, eputc); schaker */ shmdt(mseg); shmdt(pseg); *** ../setup.h Wed Jun 19 10:53:23 1991 --- setup.h Tue Jun 4 19:13:26 1991 *************** *** 33,40 **** #define CRYSTAL_ODDS 4 ! #define HEAL_DIV 15 ! #define CHARGE_INC 1 #define TICKSPERPACE 8 --- 33,40 ---- #define CRYSTAL_ODDS 4 ! #define HEAL_DIV 35 ! #define CHARGE_INC 2 #define TICKSPERPACE 8 *************** *** 41,47 **** #define P_ATTACKS 1 #define M_ATTACKS 1 ! #define TIME_TO_HEAL 15 #define RESURRECTION 75 #define MAX_MONSTERS 6 --- 41,47 ---- #define P_ATTACKS 1 #define M_ATTACKS 1 ! #define TIME_TO_HEAL 5 #define RESURRECTION 75 #define MAX_MONSTERS 6 -- _---_ Stefan Chakerian / o o \ schaker@triton.unm.edu, schaker@unmb.bitnet | \___/ | \_____/ Have a nice day... somewhere else.