diff --git a/dat/tribute b/dat/tribute index bacde1efe..3d7b56850 100644 --- a/dat/tribute +++ b/dat/tribute @@ -1,4 +1,4 @@ -# NetHack 3.6 tribute $NHDT-Date: 1565090653 2019/08/06 11:24:13 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.83 $ +# NetHack 3.6 tribute $NHDT-Date: 1573777025 2019/11/15 00:17:05 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.84 $ # Copyright (c) 2017 by Robert Patrick Rankin # NetHack may be freely redistributed. See license for details. # A tribute introduced in NetHack 3.6.0 to: @@ -3694,7 +3694,7 @@ reader's brain. For example, the big volume open in front of him contained some of the collected drawings of Leonard of Quirm, skilled artist and certified -genious, with a mind that wandered so much it came back with souvenirs. +genius, with a mind that wandered so much it came back with souvenirs. Leonard's books were full of sketches--of kittens, of the way water flows, of the wives of influential Ankh-Morporkian merchants whose portraits had diff --git a/doc/fixes36.3 b/doc/fixes36.3 index 1f7985f01..c7bf521dc 100644 --- a/doc/fixes36.3 +++ b/doc/fixes36.3 @@ -1,4 +1,4 @@ -$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.168 $ $NHDT-Date: 1573290414 2019/11/09 09:06:54 $ +$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.176 $ $NHDT-Date: 1573777025 2019/11/15 00:17:05 $ This fixes36.3 file is here to capture information about updates in the 3.6.x lineage following the release of 3.6.2 in May 2019. Please note, however, @@ -115,7 +115,8 @@ for multi-shot shooting by monsters, a typo checked hero's weapon for when a boulder was teleported, if it landed in a pit or trap door or hole its former location wasn't updated to show that it wasn't there anymore (noticed in Sokoban but not limited to there) -Terry Pratchett tribute, fix typo in passage #4 for Mort ("the" -> "they") +Terry Pratchett tribute, fix typo in passage #4 for Mort ("the" -> "they"); + also passage #7 for Soul Music ("genious" -> "genius") fix typo in end_of_input() present since 3.6.0 that would prevent compilation for NOSAVEONHANGUP+INSURANCE configuration when a status condition becomes fatal, keep it listed as an active condition @@ -221,6 +222,9 @@ playing music while hallucinating: message misspelled "butterflies" putting on gloves while having slippery fingers transfered slipperiness to those gloves; taking off slippery gloves directly was disallowed but losing them in other ways transfered slipperiness to bare fingers +when a monster reads a scroll of fire to cure sliming, don't access that + scroll's memory after it has been used up (bcsign) +monster vs monster attacks didn't handle shades or silver weapon feedback Fixes to Post-3.6.2 Problems that Were Exposed Via git Repository @@ -249,6 +253,7 @@ in symset:curses, symbol S_tree was accidentally set to horizontal line where percentage highlighting for Xp broke up/down/changed highlighting for it; it was flagged as having gone up every time the percentage changed deaf change to zap_over_floor needed to be restricted to player actions only +monster vs shade attack inflicted damage despite "passes harmlessly through" curses: sometimes the message window would show a blank line after a prompt curses: the change to show map in columns 1..79 instead of 2..80 made the highlight for '@' show up in the wrong place if clipped map had been @@ -328,6 +333,7 @@ curses: enable the 'use_inverse' boolean option (via wincap WC_INVERSE flag) to override default of False (for tty's benefit) curses: force 'O' command's menus for 'symset' and 'roguesymset' options to be wider so that fewer entries with set descriptions will wrap +curses: stop restricting menu width to half the display width curses+'perm_invent': entries were wrapping without any control; usually not noticeable because next entry overwrote, but visible for final entry when whole inventory fit within the available height; looked ok with @@ -351,6 +357,13 @@ curses+EDIT_GETLIN: the preceding fix handled an answer which spanned more than one line but didn't remove the answer properly if the prompt portion of prompt+answer spanned more than one line msdos: code fixes to allow a build with curses and PDCurses +msdos: added Makefile1.cross (host portion) and Makefile2.cross (target + platform portion) to assist in moving this port toward a cross-compiled + build hosted on linux/OSX/Windows with recent C dialect support; that + will also pave the way for CI automation and testing of the msdos port + build in future should the port remain on the radar; currently only + useful for testing the msdos port compile as it cannot yet build a + complete game tty: re-do one optimization used when status conditions have all been removed and remove another that tried to check whether condition text to be displayed next was the same as the existing value; sometimes new diff --git a/doc/tmac.nh b/doc/tmac.nh index 6165c6c82..5a1bd0a60 100644 --- a/doc/tmac.nh +++ b/doc/tmac.nh @@ -117,10 +117,10 @@ .\" .BR - hard line break with vertical padding inserted .\" $1 - repeat count for amount of padding (optional; default is 1) .de BR -.nr bR (\\$1-0) -.if \\n(bR<1 .nr bR 1 -.nr bR \\n(bR*\\n(pd -.sn \\n(bRu +.ie \\.$==0 .nr bR 1v +.el .nr bR (\\$1-0)v +\0 +.sp \\n(bR .br .. .\" .UR url diff --git a/include/extern.h b/include/extern.h index 8a5e51113..9a8febdbd 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1,4 +1,4 @@ -/* NetHack 3.6 extern.h $NHDT-Date: 1573346164 2019/11/10 00:36:04 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.738 $ */ +/* NetHack 3.6 extern.h $NHDT-Date: 1573688684 2019/11/13 23:44:44 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.739 $ */ /* Copyright (c) Steve Creps, 1988. */ /* NetHack may be freely redistributed. See license for details. */ @@ -2632,6 +2632,8 @@ E int FDECL(find_roll_to_hit, (struct monst *, UCHAR_P, struct obj *, int *, int *)); E boolean FDECL(attack, (struct monst *)); E boolean FDECL(hmon, (struct monst *, struct obj *, int, int)); +E boolean FDECL(shade_miss, (struct monst *, struct monst *, struct obj *, + BOOLEAN_P, BOOLEAN_P)); E int FDECL(damageum, (struct monst *, struct attack *, int)); E void FDECL(missum, (struct monst *, struct attack *, BOOLEAN_P)); E int FDECL(passive, (struct monst *, struct obj *, BOOLEAN_P, int, diff --git a/src/dothrow.c b/src/dothrow.c index 50943d025..8bf4d7de8 100644 --- a/src/dothrow.c +++ b/src/dothrow.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 dothrow.c $NHDT-Date: 1569276989 2019/09/23 22:16:29 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.161 $ */ +/* NetHack 3.6 dothrow.c $NHDT-Date: 1573688688 2019/11/13 23:44:48 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.164 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2013. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1149,6 +1149,10 @@ boolean twoweap; /* used to restore twoweapon mode if wielded weapon returns */ will be left with a stale pointer. */ if (u.uswallow) { + if (obj == uball) { + uball->ox = uchain->ox = u.ux; + uball->oy = uchain->oy = u.uy; + } mon = u.ustuck; g.bhitpos.x = mon->mx; g.bhitpos.y = mon->my; @@ -1283,7 +1287,7 @@ boolean twoweap; /* used to restore twoweapon mode if wielded weapon returns */ (void) snuff_candle(obj); g.notonhead = (g.bhitpos.x != mon->mx || g.bhitpos.y != mon->my); obj_gone = thitmonst(mon, obj); - /* Monster may have been tamed; this frees old mon */ + /* Monster may have been tamed; this frees old mon [obsolete] */ mon = m_at(g.bhitpos.x, g.bhitpos.y); /* [perhaps this should be moved into thitmonst or hmon] */ @@ -1308,8 +1312,8 @@ boolean twoweap; /* used to restore twoweapon mode if wielded weapon returns */ clear_thrownobj = TRUE; goto throwit_return; } else { - /* Mjollnir must we wielded to be thrown--caller verifies this; - aklys must we wielded as primary to return when thrown */ + /* Mjollnir must be wielded to be thrown--caller verifies this; + aklys must be wielded as primary to return when thrown */ if (iflags.returning_missile) { /* Mjollnir or aklys */ if (rn2(100)) { if (tethered_weapon) diff --git a/src/files.c b/src/files.c index 274934c47..2de453dca 100644 --- a/src/files.c +++ b/src/files.c @@ -56,7 +56,7 @@ const #endif #if defined(MSDOS) || defined(OS2) || defined(TOS) || defined(WIN32) -#ifndef GNUDOS +#ifndef __DJGPP__ #include #else #include diff --git a/src/mhitm.c b/src/mhitm.c index 7420cc1ab..ba19dc957 100644 --- a/src/mhitm.c +++ b/src/mhitm.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 mhitm.c $NHDT-Date: 1560161806 2019/06/10 10:16:46 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.116 $ */ +/* NetHack 3.6 mhitm.c $NHDT-Date: 1573773926 2019/11/14 23:25:26 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.118 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2011. */ /* NetHack may be freely redistributed. See license for details. */ @@ -52,16 +52,35 @@ struct attack *mattk; { const char *fmt; char buf[BUFSZ]; + boolean showit = FALSE; + + /* unhiding or unmimicking happens even if hero can't see it + because the formerly concealed monster is now in action */ + if (M_AP_TYPE(mdef)) { + seemimic(mdef); + showit |= g.vis; + } else if (mdef->mundetected) { + mdef->mundetected = 0; + showit |= g.vis; + } + if (M_AP_TYPE(magr)) { + seemimic(magr); + showit |= g.vis; + } else if (magr->mundetected) { + magr->mundetected = 0; + showit |= g.vis; + } if (g.vis) { if (!canspotmon(magr)) map_invisible(magr->mx, magr->my); + else if (showit) + newsym(magr->mx, magr->my); if (!canspotmon(mdef)) map_invisible(mdef->mx, mdef->my); - if (M_AP_TYPE(mdef)) - seemimic(mdef); - if (M_AP_TYPE(magr)) - seemimic(magr); + else if (showit) + newsym(mdef->mx, mdef->my); + fmt = (could_seduce(magr, mdef, mattk) && !magr->mcan) ? "%s pretends to be friendly to" : "%s misses"; @@ -381,9 +400,9 @@ register struct monst *magr, *mdef; || mdef->data == &mons[PM_BROWN_PUDDING]) && (g.otmp && (objects[g.otmp->otyp].oc_material == IRON || objects[g.otmp->otyp].oc_material == METAL)) - && mdef->mhp > 1 - && !mdef->mcan) { + && mdef->mhp > 1 && !mdef->mcan) { struct monst *mclone; + if ((mclone = clone_mon(mdef, 0, 0)) != 0) { if (g.vis && canspotmon(mdef)) { char buf[BUFSZ]; @@ -425,6 +444,13 @@ register struct monst *magr, *mdef; break; case AT_ENGL: + if (mdef->data == &mons[PM_SHADE]) { /* no silver teeth... */ + if (g.vis) + pline("%s attempt to engulf %s is futile.", + s_suffix(Monnam(magr)), mon_nam(mdef)); + strike = 0; + break; + } if (u.usteed && mdef == u.usteed) { strike = 0; break; @@ -501,23 +527,49 @@ hitmm(magr, mdef, mattk) register struct monst *magr, *mdef; struct attack *mattk; { + boolean weaponhit = ((mattk->aatyp == AT_WEAP + || (mattk->aatyp == AT_CLAW && g.otmp))), + silverhit = (weaponhit && g.otmp + && objects[g.otmp->otyp].oc_material == SILVER), + showit = FALSE; + + /* unhiding or unmimicking happens even if hero can't see it + because the formerly concealed monster is now in action */ + if (M_AP_TYPE(mdef)) { + seemimic(mdef); + showit |= g.vis; + } else if (mdef->mundetected) { + mdef->mundetected = 0; + showit |= g.vis; + } + if (M_AP_TYPE(magr)) { + seemimic(magr); + showit |= g.vis; + } else if (magr->mundetected) { + magr->mundetected = 0; + showit |= g.vis; + } + if (g.vis) { int compat; char buf[BUFSZ]; if (!canspotmon(magr)) map_invisible(magr->mx, magr->my); + else if (showit) + newsym(magr->mx, magr->my); if (!canspotmon(mdef)) map_invisible(mdef->mx, mdef->my); - if (M_AP_TYPE(mdef)) - seemimic(mdef); - if (M_AP_TYPE(magr)) - seemimic(magr); + else if (showit) + newsym(mdef->mx, mdef->my); + if ((compat = could_seduce(magr, mdef, mattk)) && !magr->mcan) { Sprintf(buf, "%s %s", Monnam(magr), mdef->mcansee ? "smiles at" : "talks to"); pline("%s %s %s.", buf, mon_nam(mdef), compat == 2 ? "engagingly" : "seductively"); + } else if (shade_miss(magr, mdef, g.otmp, FALSE, TRUE)) { + return MM_MISS; /* bypass mdamagem() */ } else { char magr_name[BUFSZ]; @@ -548,6 +600,28 @@ struct attack *mattk; Sprintf(buf, "%s hits", magr_name); } pline("%s %s.", buf, mon_nam_too(mdef, magr)); + + if (mon_hates_silver(mdef) && silverhit) { + char *mdef_name = mon_nam_too(mdef, magr); + + /* note: mon_nam_too returns a modifiable buffer; so + does s_suffix, but it returns a single static buffer + and we might be calling it twice for this message */ + Strcpy(magr_name, s_suffix(magr_name)); + if (!noncorporeal(mdef->data) && !amorphous(mdef->data)) { + if (mdef != magr) { + mdef_name = s_suffix(mdef_name); + } else { + (void) strsubst(mdef_name, "himself", "his own"); + (void) strsubst(mdef_name, "herself", "her own"); + (void) strsubst(mdef_name, "itself", "its own"); + } + Strcat(mdef_name, " flesh"); + } + + pline("%s %s sears %s!", magr_name, /*s_suffix(magr_name), */ + simpleonames(g.otmp), mdef_name); + } } } else noises(magr, mattk); @@ -775,11 +849,12 @@ mdamagem(magr, mdef, mattk) register struct monst *magr, *mdef; register struct attack *mattk; { - struct obj *obj; + struct obj *obj, dmgwep; char buf[BUFSZ]; struct permonst *pa = magr->data, *pd = mdef->data; - int armpro, num, tmp = d((int) mattk->damn, (int) mattk->damd), - res = MM_MISS; + int armpro, num, + tmp = d((int) mattk->damn, (int) mattk->damd), + res = MM_MISS; boolean cancelled; if ((touch_petrifies(pd) /* or flesh_petrifies() */ @@ -882,15 +957,26 @@ register struct attack *mattk; case AD_HEAL: case AD_PHYS: physical: - if (mattk->aatyp == AT_KICK && thick_skinned(pd)) { + /* this shade check is necessary in case any attacks which + dish out physical damage bypass hitmm() to get here */ + if ((mattk->aatyp == AT_WEAP || mattk->aatyp == AT_CLAW) && g.otmp) + dmgwep = *g.otmp; + else + dmgwep = cg.zeroobj; + + if (shade_miss(magr, mdef, &dmgwep, FALSE, TRUE)) { tmp = 0; - } else if (mattk->aatyp == AT_WEAP) { + } else if (mattk->aatyp == AT_KICK && thick_skinned(pd)) { + tmp = 0; + } else if (mattk->aatyp == AT_WEAP + || (mattk->aatyp == AT_CLAW && g.otmp)) { if (g.otmp) { struct obj *marmg; if (g.otmp->otyp == CORPSE && touch_petrifies(&mons[g.otmp->corpsenm])) goto do_stone; + tmp += dmgval(g.otmp, mdef); if ((marmg = which_armor(magr, W_ARMG)) != 0 && marmg->otyp == GAUNTLETS_OF_POWER) diff --git a/src/mhitu.c b/src/mhitu.c index b063ba367..08970c232 100644 --- a/src/mhitu.c +++ b/src/mhitu.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 mhitu.c $NHDT-Date: 1562800504 2019/07/10 23:15:04 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.166 $ */ +/* NetHack 3.6 mhitu.c $NHDT-Date: 1573688693 2019/11/13 23:44:53 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.167 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2012. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1789,8 +1789,7 @@ struct attack *mattk; if (!engulf_target(mtmp, &g.youmonst)) return 0; - if ((t && is_pit(t->ttyp)) - && sobj_at(BOULDER, u.ux, u.uy)) + if ((t && is_pit(t->ttyp)) && sobj_at(BOULDER, u.ux, u.uy)) return 0; if (Punished) @@ -1873,6 +1872,14 @@ struct attack *mattk; if (mtmp != u.ustuck) return 0; + if (Punished) { + /* ball&chain are in limbo while swallowed; update their internal + location to be at swallower's spot */ + if (uchain->where == OBJ_FREE) + uchain->ox = mtmp->mx, uchain->oy = mtmp->my; + if (uball->where == OBJ_FREE) + uball->ox = mtmp->mx, uball->oy = mtmp->my; + } if (u.uswldtim > 0) u.uswldtim -= 1; diff --git a/src/mthrowu.c b/src/mthrowu.c index 504cb533a..a1b36476a 100644 --- a/src/mthrowu.c +++ b/src/mthrowu.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 mthrowu.c $NHDT-Date: 1564767726 2019/08/02 17:42:06 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.85 $ */ +/* NetHack 3.6 mthrowu.c $NHDT-Date: 1573688695 2019/11/13 23:44:55 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.86 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Pasi Kallinen, 2016. */ /* NetHack may be freely redistributed. See license for details. */ @@ -346,6 +346,10 @@ boolean verbose; /* give message(s) even when you can't see what happened */ damage = dmgval(otmp, mtmp); if (otmp->otyp == ACID_VENOM && resists_acid(mtmp)) damage = 0; +#if 0 /* can't use this because we don't have the attacker */ + if (is_orc(mtmp->data) && is_elf(?magr?)) + damage++; +#endif if (ismimic) seemimic(mtmp); mtmp->msleeping = 0; @@ -376,10 +380,19 @@ boolean verbose; /* give message(s) even when you can't see what happened */ } if (objects[otmp->otyp].oc_material == SILVER && mon_hates_silver(mtmp)) { - if (vis) - pline_The("silver sears %s flesh!", s_suffix(mon_nam(mtmp))); - else if (verbose && !g.mtarget) - pline("Its flesh is seared!"); + boolean flesh = (!noncorporeal(mtmp->data) + && !amorphous(mtmp->data)); + + /* note: extra silver damage is handled by dmgval() */ + if (vis) { + char *m_name = mon_nam(mtmp); + + if (flesh) /* s_suffix returns a modifiable buffer */ + m_name = strcat(s_suffix(m_name), " flesh"); + pline_The("silver sears %s!", m_name); + } else if (verbose && !g.mtarget) { + pline("%s is seared!", flesh ? "Its flesh" : "It"); + } } if (otmp->otyp == ACID_VENOM && cansee(mtmp->mx, mtmp->my)) { if (resists_acid(mtmp)) { @@ -531,7 +544,12 @@ struct obj *obj; /* missile (or stack providing it) */ while (range-- > 0) { /* Actually the loop is always exited by break */ g.bhitpos.x += dx; g.bhitpos.y += dy; - if ((mtmp = m_at(g.bhitpos.x, g.bhitpos.y)) != 0) { + mtmp = m_at(g.bhitpos.x, g.bhitpos.y); + if (mtmp && shade_miss(mon, mtmp, singleobj, TRUE, TRUE)) { + /* if mtmp is a shade and missile passes harmlessly through it, + give message and skip it in order to keep going */ + mtmp = (struct monst *) 0; + } else if (mtmp) { if (ohitmon(mtmp, singleobj, range, TRUE)) break; } else if (g.bhitpos.x == u.ux && g.bhitpos.y == u.uy) { @@ -746,7 +764,7 @@ struct attack *mattk; break; default: impossible("bad attack type in spitmu"); - /* fall through */ + /*FALLTHRU*/ case AD_ACID: otmp = mksobj(ACID_VENOM, TRUE, FALSE); break; diff --git a/src/options.c b/src/options.c index fef599d4a..3eb4f389e 100644 --- a/src/options.c +++ b/src/options.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 options.c $NHDT-Date: 1572303730 2019/10/28 23:02:10 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.383 $ */ +/* NetHack 3.6 options.c $NHDT-Date: 1573505739 2019/11/11 20:55:39 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.386 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Michael Allison, 2008. */ /* NetHack may be freely redistributed. See license for details. */ @@ -5367,44 +5367,6 @@ boolean setinitial, setfromfile; tmpwin = create_nhwindow(NHW_MENU); start_menu(tmpwin); any = cg.zeroany; -#ifdef CURSES_GRAPHICS /* this ought to be handled within curses... */ - /* - * Symbol sets are formatted in two columns, "name description", - * on selectable lines. curses bases menu width on the length - * of non-selectable lines (main header, separators if present, - * with trailing spaces ignored) and defaults to half the map. - * Without something like this separator (shown after the menu - * title and a blank line which follows that) to force a wider - * menu, entries with long descriptions wrap. That would be - * ok if wrapping operated on the same two columns, but the - * menu doesn't know anything about those and the description - * is wrapping into the next line's name column, making long - * descriptions--and menus containing them--hard to read. - */ - if (WINDOWPORT("curses")) { - char tmp1[BUFSZ], tmp2[BUFSZ], bigbuf[BUFSZ + 1 + BUFSZ]; - - /* 4: room for space+letter+paren+space, fake selector; - 2: added to 'biggest' when constructing 'fmtstr'; - 1: space between symset name+2 and symset description */ - if (4 + biggest + 2 + 1 > (int) sizeof tmp1 - 1) - biggest = (int) sizeof tmp1 - 1 - (4 + 2 + 1); - (void) memset((genericptr_t) tmp1, '-', biggest); - tmp1[biggest] = '\0'; - if (big_desc > (int) sizeof tmp2 - 1) - big_desc = (int) sizeof tmp2 - 1; - (void) memset((genericptr_t) tmp2, '-', big_desc); - tmp2[big_desc] = '\0'; - Sprintf(bigbuf, "%4s", ""); - Sprintf(eos(bigbuf), fmtstr, tmp1, tmp2); - bigbuf[BUFSZ - 1] = '\0'; - any.a_int = 0; - add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, - bigbuf, MENU_UNSELECTED); - } -#else - nhUse(big_desc); -#endif any.a_int = 1; /* -1 + 2 [see 'if (sl->name) {' below]*/ if (!symset_name) defindx = any.a_int; diff --git a/src/uhitm.c b/src/uhitm.c index 0848d9513..9f2b1236a 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 uhitm.c $NHDT-Date: 1567805813 2019/09/06 21:36:53 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.212 $ */ +/* NetHack 3.6 uhitm.c $NHDT-Date: 1573764936 2019/11/14 20:55:36 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.215 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2012. */ /* NetHack may be freely redistributed. See license for details. */ @@ -691,10 +691,8 @@ int dieroll; long silverhit = 0L; int wtype; struct obj *monwep; - char unconventional[BUFSZ]; /* substituted for word "attack" in msg */ char saved_oname[BUFSZ]; - unconventional[0] = '\0'; saved_oname[0] = '\0'; wakeup(mon, TRUE); @@ -867,7 +865,6 @@ int dieroll; } else { if (mdat == &mons[PM_SHADE] && !shade_aware(obj)) { tmp = 0; - Strcpy(unconventional, cxname(obj)); } else { switch (obj->otyp) { case BOULDER: /* 1d20 */ @@ -1138,21 +1135,14 @@ int dieroll; poiskilled = TRUE; } if (tmp < 1) { + boolean mon_is_shade = (mon->data == &mons[PM_SHADE]); + /* make sure that negative damage adjustment can't result in inadvertently boosting the victim's hit points */ - tmp = 0; - if (mdat == &mons[PM_SHADE]) { - if (!hittxt) { - const char *what = *unconventional ? unconventional : "attack"; - - Your("%s %s harmlessly through %s.", what, - vtense(what, "pass"), mon_nam(mon)); - hittxt = TRUE; - } - } else { - if (get_dmg_bonus) - tmp = 1; - } + tmp = (get_dmg_bonus && !mon_is_shade) ? 1 : 0; + if (mon_is_shade && !hittxt + && thrown != HMON_THROWN && thrown != HMON_KICKED) + hittxt = shade_miss(&g.youmonst, mon, obj, FALSE, TRUE); } if (jousting) { @@ -1362,6 +1352,44 @@ struct obj *obj; return FALSE; } +/* used for hero vs monster and monster vs monster; also handles + monster vs hero but that won't happen because hero can't be a shade */ +boolean +shade_miss(magr, mdef, obj, thrown, verbose) +struct monst *magr, *mdef; +struct obj *obj; +boolean thrown, verbose; +{ + const char *what, *whose, *target; + boolean youagr = (magr == &g.youmonst), youdef = (mdef == &g.youmonst); + + /* we're using dmgval() for zero/not-zero, not for actual damage amount */ + if (mdef->data != &mons[PM_SHADE] || (obj && dmgval(obj, mdef))) + return FALSE; + + if (verbose + && ((youdef || cansee(mdef->mx, mdef->my) || sensemon(mdef)) + || (magr == &g.youmonst && distu(mdef->mx, mdef->my) <= 2))) { + static const char harmlessly_thru[] = " harmlessly through "; + + what = (!obj || shade_aware(obj)) ? "attack" : cxname(obj); + target = youdef ? "you" : mon_nam(mdef); + if (!thrown) { + whose = youagr ? "Your" : s_suffix(Monnam(magr)); + pline("%s %s %s%s%s.", whose, what, + vtense(what, "pass"), harmlessly_thru, target); + } else { + pline("%s %s%s%s.", The(what), /* note: not pline_The() */ + vtense(what, "pass"), harmlessly_thru, target); + } + if (!youdef && !canspotmon(mdef)) + map_invisible(mdef->mx, mdef->my); + } + if (!youdef) + mdef->msleeping = 0; + return TRUE; +} + /* check whether slippery clothing protects from hug or wrap attack */ /* [currently assumes that you are the attacker] */ static boolean diff --git a/src/zap.c b/src/zap.c index 1151297b5..a9adec794 100644 --- a/src/zap.c +++ b/src/zap.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 zap.c $NHDT-Date: 1561927499 2019/06/30 20:44:59 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.312 $ */ +/* NetHack 3.6 zap.c $NHDT-Date: 1573688696 2019/11/13 23:44:56 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.316 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2013. */ /* NetHack may be freely redistributed. See license for details. */ @@ -3341,13 +3341,20 @@ struct obj **pobj; /* object tossed/used, set to NULL if (range > 3) /* another bounce? */ skiprange(range, &skiprange_start, &skiprange_end); } else if (mtmp && M_IN_WATER(mtmp->data)) { - if ((!Blind && canseemon(mtmp)) || sensemon(mtmp)) + if (!Blind && canspotmon(mtmp)) pline("%s %s over %s.", Yname2(obj), otense(obj, "pass"), mon_nam(mtmp)); + mtmp = (struct monst *) 0; } } - if (mtmp && !(in_skip && M_IN_WATER(mtmp->data))) { + /* if mtmp is a shade and missile passes harmlessly through it, + give message and skip it in order to keep going */ + if (mtmp && (weapon == THROWN_WEAPON || weapon == KICKED_WEAPON) + && shade_miss(&g.youmonst, mtmp, obj, TRUE, TRUE)) + mtmp = (struct monst *) 0; + + if (mtmp) { g.notonhead = (g.bhitpos.x != mtmp->mx || g.bhitpos.y != mtmp->my); if (weapon == FLASHED_LIGHT) { /* FLASHED_LIGHT hitting invisible monster should diff --git a/sys/msdos/Makefile1.cross b/sys/msdos/Makefile1.cross new file mode 100644 index 000000000..e24bbab3f --- /dev/null +++ b/sys/msdos/Makefile1.cross @@ -0,0 +1,709 @@ +# NetHack 3.6 Makefile1.cross +# Cross-compile msdos version of NetHack using a +# linux-hosted djgpp cross-compiler. +# +# Makefile1.cross (this file) is for the host-side obj files and +# utilities that will run on the host platform only. +# +# Makefile2.cross is the the target platform obj files +# and utilities. +# +# Makefile2 utilizes the djgpp cross-compiler from Andrew Wu: +# https://github.com/andrewwutw/build-djgpp +# +# Currently, in NetHack 3.6, the cross-compile for msdos cannot be +# used to build the entire game to a playable point but it is useful +# for testing the msdos port build of the evolving NetHack code.0 +# +# The GNU Make has a problem if you include a drive spec below. +GAMEDIR =../binary + +# +#============================================================================== +# This marks the end of the BUILD DECISIONS section. +#============================================================================== +# +# Directories, gcc likes unix style directory specs +# + +OBJ = o +HOBJ = host_o +DAT = ../dat +DOC = ../doc +INCL = ../include +MSYS = ../sys/msdos +SRC = ../src +SSHR = ../sys/share +UTIL = ../util +WIN = ../win/tty +WCURSES = ../win/curses +WSHR = ../win/share + +# +# Executables. +# +HOST_CC = gcc +HOST_LINK = gcc +MAKEBIN = make + +# +# Special libraries and how to link them in. +# +LIBS = -lpc +LIBRARIES = $(LIBS) + +# +# Yacc/Lex off +# +YACC_LEX = N + +# +# Uncomment the line below if you want to store all the level files, +# help files, etc. in a single library file. +# +USE_DLB = Y + +#=============================================== +#======= End of Modification Section =========== +#=============================================== +################################################ +# # +# Nothing below here should have to be changed.# +# # +################################################ + +# Changing this conditional block is not recommended +ifeq "$(USE_DLB)" "Y" +DLBFLG = -DDLB +else +DLBFLG = +endif + +TERMLIB = + +#========================================== +#================ MACROS ================== +#========================================== +# This section creates shorthand macros for many objects +# referenced later on in the Makefile. +# +# Have windows path styles available for use in commands +# +W_OBJ =$(subst /,\, $(OBJ)) +W_INCL =$(subst /,\, $(INCL)) +W_DAT =$(subst /,\, $(DAT)) +W_DOC =$(subst /,\, $(DOC)) +W_UTIL =$(subst /,\, $(UTIL)) +W_SRC =$(subst /,\, $(SRC)) +W_SSYS =$(subst /,\, $(SSYS)) +W_MSWSYS =$(subst /,\, $(MSWSYS)) +W_TTY =$(subst /,\, $(TTY)) +W_MSWIN =$(subst /,\, $(MSWIN)) +ifeq "$(ADD_CURSES)" "Y" +W_WCURSES =$(subst /,\, $(WCURSES)) +endif +W_WSHR =$(subst /,\, $(WSHR)) +W_GAMEDIR =$(subst /,\, $(GAMEDIR)) + +# +# Shorten up the location for some files +# + +O = $(OBJ)/ +HOST_O = $(HOBJ)/ +U = $(UTIL)/ + +#========================================== +# Utility Objects. +#========================================== + +MAKESRC = makedefs.c + +MAKEDEFSOBJS = $(HOST_O)makedefs.o $(HOST_O)monst.o $(HOST_O)objects.o + +#SPLEVSRC = lev_yacc.c lev_$(LEX).c lev_main.c panic.c +#DGNCOMPSRC = dgn_yacc.c dgn_$(LEX).c dgn_main.c +#SPLEVOBJS = $(HOST_O)lev_yacc.o $(HOST_O)lev_$(LEX).o $(HOST_O)lev_main.o $(HOST_O)alloc.o \ +# $(HOST_O)monst.o $(HOST_O)objects.o $(HOST_O)panic.o \ +# $(HOST_O)drawing.o $(HOST_O)decl.o $(HOST_O)stubvid.o +#DGNCOMPOBJS = $(HOST_O)dgn_yacc.o $(HOST_O)dgn_$(LEX).o $(HOST_O)dgn_main.o $(HOST_O)alloc.o \ +# $(HOST_O)panic.o + +#========================================== +# Tile related object files. +#========================================== + +TILOBJ = $(HOST_O)tile.o $(VGAOBJ) + +TILOBJ2 = $(HOST_O)tileset.o $(HOST_O)bmptiles.o $(HOST_O)giftiles.o + +TEXTIO = $(HOST_O)tiletext.o $(HOST_O)tiletxt.o $(HOST_O)drawing.o $(HOST_O)decl.o $(HOST_O)monst.o \ + $(HOST_O)objects.o + +TEXTIO2 = $(HOST_O)tiletex2.o $(HOST_O)tiletxt2.o $(HOST_O)drawing.o $(HOST_O)decl.o $(HOST_O)monst.o \ + $(HOST_O)objects.o + +TILE_BMP = $(DAT)/nhtiles.bmp + +TILEUTIL = $(TILOBJ) $(U)tile2bin $(U)til2bin2 $(TILE_BMP) + +TILEFILES = $(WSHR)/monsters.txt $(WSHR)/objects.txt $(WSHR)/other.txt + +TILEFILES2 = $(WSHR)/monthin.txt $(WSHR)/objthin.txt $(WSHR)/oththin.txt + +GIFREADERS = $(HOST_O)gifread.o $(HOST_O)alloc.o $(HOST_O)panic.o + +GIFREAD2 = $(HOST_O)gifread2.o $(HOST_O)alloc.o $(HOST_O)panic.o + +PPMWRITERS = $(HOST_O)ppmwrite.o $(HOST_O)alloc.o $(HOST_O)panic.o + +PPMWRIT2 = $(HOST_O)ppmwrit2.o $(HOST_O)alloc.o $(HOST_O)panic.o + +#========================================== +# Object files. +#========================================== + +DLBOBJ = $(HOST_O)dlb.o + +ALLOBJ = $(MAKEDEFSOBJS) $(TILOBJ) $(TILOBJ2) $(TEXTIO) $(TEXTIO2) + +#========================================== +# Header file macros +#========================================== + +PATCHLEV_H = $(INCL)/patchlev.h +DGN_FILE_H = $(INCL)/align.h $(INCL)/dgn_file.h +DUNGEON_H = $(INCL)/align.h $(INCL)/dungeon.h +MONDATA_H = $(INCL)/align.h $(INCL)/mondata.h +MONST_H = $(INCL)/align.h $(INCL)/monst.h $(INCL)/mextra.h +PERMONST_H = $(INCL)/monattk.h $(INCL)/monflag.h $(INCL)/align.h \ + $(INCL)/permonst.h +REGION_H = $(INCL)/region.h +RM_H = $(INCL)/align.h $(INCL)/rm.h +SKILLS_H = $(INCL)/skills.h +SP_LEV_H = $(INCL)/align.h $(INCL)/sp_lev.h +YOUPROP_H = $(PERMONST_H) $(MONDATA_H) $(INCL)/prop.h \ + $(INCL)/pm.h $(INCL)/youprop.h +YOU_H = $(MONST_H) $(YOUPROP_H) $(INCL)/align.h \ + $(INCL)/attrib.h $(INCL)/you.h +DISPLAY_H = $(MONDATA_H) $(INCL)/vision.h $(INCL)/display.h +PCCONF_H = $(INCL)/micro.h $(INCL)/system.h $(INCL)/pcconf.h \ + $(MSYS)/pcvideo.h +CONFIG_H = $(GLOBAL_H) $(INCL)/tradstdc.h $(INCL)/config1.h \ + $(INCL)/config.h +DECL_H = $(YOU_H) $(INCL)/spell.h $(INCL)/color.h \ + $(INCL)/obj.h $(INCL)/onames.h $(INCL)/pm.h \ + $(INCL)/decl.h +GLOBAL_H = $(PCCONF_H) $(INCL)/coord.h $(INCL)/global.h +HACK_H = $(CONFIG_H) $(INCL)/context.h $(DUNGEON_H) \ + $(DECL_H) $(DISPLAY_H) $(INCL)/monsym.h \ + $(INCL)/mkroom.h $(INCL)/objclass.h $(INCL)/trap.h \ + $(INCL)/flag.h $(RM_H) $(INCL)/vision.h \ + $(INCL)/wintype.h $(INCL)/engrave.h $(INCL)/rect.h \ + $(INCL)/trampoli.h $(INCL)/hack.h $(REGION_H) \ + $(INCL)/sys.h +DLB_H = $(INCL)/dlb.h + +ifeq ($(SUPPRESS_GRAPHICS),Y) +TILE_H = +else +TILE_H = $(WSHR)/tile.h $(INCL)/tileset.h +endif + +ifeq ($(USE_DLB),Y) +DLB = dlb +DLBOBJS = $(HOST_O)dlb_main.o $(HOST_O)dlb.o $(HOST_O)alloc.o $(HOST_O)panic.o +else +DLB = +DLBOBJS = +endif + +#========================================== +# More compiler setup macros +#========================================== +# +CURSESDEF= +CURSESLIB= +INCLDIR=-I../include -I../sys/msdos +# Debugging +#cflags = -pg -c $(INCLDIR) $(DLBFLG) $(CURSESDEF) -DSUPPRESS_GRAPHICS +#LFLAGS = -pg +# +cflags = -c -O $(INCLDIR) $(DLBFLG) $(CURSESDEF) -DSUPPRESS_GRAPHICS +LFLAGS = +# +# Debugging +#cflags = -g -c $(INCLDIR) $(DLBFLG) $(CURSESDEF) -DUSE_TILES +#LFLAGS = -g +# +# Normal +cflags = -c -O $(INCLDIR) $(DLBFLG) $(CURSESDEF) -DUSE_TILES +LFLAGS = + +#========================================== +#================ RULES ================== +#========================================== + +.SUFFIXES: .o .til .uu .c .y .l + +#========================================== +# Rules for host files in src +#========================================== + +$(HOST_O)%.o : $(SRC)/%.c + $(HOST_CC) $(cflags) -o$@ $< + +#========================================== +# Rules for host files in sys/msdos +#========================================== + +$(HOST_O)%.o : $(MSYS)/%.c + $(HOST_CC) $(cflags) -I../sys/msdos -o$@ $< + +#========================================== +# Rules for host files in util +#========================================== + +$(HOST_O)%.o : $(SRC)/%.c + $(HOST_CC) $(cflags) -o$@ $< + +$(HOST_O)%.o : %.c + $(HOST_CC) $(cflags) -o$@ $< + +#========================================== +# Rules for host files in win/share +#========================================== + +$(HOST_O)%.o : $(WSHR)/%.c + $(HOST_CC) $(cflags) -I../win/share -o$@ $< + +#========================================== +# Primary Targets. +#========================================== + +# The default target. + +all : prereq + +prereq: $(HOST_O)prereq.tag + @echo Done. + +default: prereq + +util: $(HOST_O)utility.tag + +$(HOST_O)utility.tag: $(INCL)/date.h $(INCL)/trap.h $(INCL)/onames.h \ + $(INCL)/pm.h vis_tab.c $(TILEUTIL) + echo host utilities made > $@ + +tileutil: $(U)gif2txt $(U)txt2ppm + @echo Optional tile development utilities are up to date. + +$(HOST_O)prereq.tag: hobj.tag $(U)makedefs $(HOST_O)utility.tag \ + $(HOST_O)thintile.tag $(DAT)/nhdat + echo prereq done >$@ + +#========================================== +# Other host targets. +#========================================== + +#note that dir below assumes bin/dir from djgpp distribution +# +$(DAT)/nhdat: $(U)dlb_main $(DAT)/data $(DAT)/rumors \ + $(DAT)/oracles $(DAT)/quest.dat \ + $(DAT)/bogusmon $(DAT)/engrave $(DAT)/epitaph $(DAT)/tribute + cd $(DAT); \ + pwd; \ + cp $(MSYS)/msdoshlp.txt .; \ + ls -1 data oracles options quest.dat rumors help hh >dlb.lst; \ + ls -1 cmdhelp history opthelp wizhelp license >>dlb.lst; \ + ls -1 bogusmon engrave epitaph tribute msdoshlp.txt >>dlb.lst; \ + $(U)dlb_main cvIf dlb.lst nhdat + cd $(SRC) + +$(U)dlb_main: $(DLBOBJS) + $(HOST_LINK) $(LFLAGS) -o$@ $(DLBOBJS) + +$(HOST_O)dlb_main.o: $(U)dlb_main.c $(INCL)/config.h $(DLB_H) + $(HOST_CC) $(cflags) -o$@ $(U)dlb_main.c + + +$(INCL)/date.h : $(U)makedefs + -$(U)makedefs -v + +$(INCL)/onames.h: $(U)makedefs + -$(U)makedefs -o + +$(INCL)/pm.h: $(U)makedefs + -$(U)makedefs -p + +#monstr.c: $(U)makedefs +# -$(U)makedefs -m + +$(INCL)/vis_tab.h: $(U)makedefs + -$(U)makedefs -z + +vis_tab.c: $(U)makedefs + -$(U)makedefs -z + +# make data.base an 8.3 filename to prevent an make warning +DATABASE = $(DAT)/data.bas + +$(DAT)/data: $(HOST_O)utility.tag $(DATABASE) + $(U)makedefs -d + +$(DAT)/rumors: $(HOST_O)utility.tag $(DAT)/rumors.tru $(DAT)/rumors.fal + $(U)makedefs -r + +$(DAT)/quest.dat: $(HOST_O)utility.tag $(DAT)/quest.txt + $(U)makedefs -q + +$(DAT)/oracles: $(HOST_O)utility.tag $(DAT)/oracles.txt + $(U)makedefs -h + +$(DAT)/bogusmon: $(HOST_O)utility.tag $(DAT)/bogusmon.txt + $(U)makedefs -s + +$(DAT)/engrave: $(HOST_O)utility.tag $(DAT)/engrave.txt + $(U)makedefs -s + +$(DAT)/epitaph: $(HOST_O)utility.tag $(DAT)/epitaph.txt + $(U)makedefs -s + +#=============================================== +# Create directory for holding host object files +#=============================================== + +hobj.tag: + mkdir -p ./$(HOBJ) + echo directory ready ./$(HOBJ) + +#========================================== +# Makedefs Stuff +#========================================== + +$(U)makedefs: $(MAKEDEFSOBJS) + $(HOST_LINK) $(LFLAGS) -o$@ $(MAKEDEFSOBJS) + +$(HOST_O)makedefs.o: $(CONFIG_H) $(PERMONST_H) $(INCL)/objclass.h \ + $(INCL)/monsym.h $(INCL)/qtext.h $(U)makedefs.c + $(HOST_CC) $(cflags) -o$@ $(U)makedefs.c + +#========================================== +# Level Compiler Dependencies +#========================================== + +#$(U)lev_comp: $(SPLEVOBJS) +# -rm -f temp.a +# ar r temp.a $(SPLEVOBJS) +# $(HOST_LINK) $(LFLAGS) -o$@ temp.a +# +#$(HOST_O)lev_yacc.o: $(HACK_H) $(SP_LEV_H) $(INCL)/lev_comp.h $(U)lev_yacc.c +# $(HOST_CC) $(cflags) -o$@ $(U)lev_yacc.c +# +#$(HOST_O)lev_$(LEX).o: $(HACK_H) $(SP_LEV_H) $(INCL)/lev_comp.h \ +# $(U)lev_$(LEX).c +# $(HOST_CC) $(cflags) -o$@ $(U)lev_$(LEX).c +# +#$(HOST_O)lev_main.o: $(HACK_H) $(INCL)/sp_lev.h $(INCL)/date.h $(U)lev_main.c +# +#$(U)lev_yacc.c: $(SSHR)/lev_yacc.c +# @echo --- +# @echo For now, we will copy the prebuilt +# @echo lev_comp.c from $(SSHR) into $(U) and use that. +# @cp $(SSHR)/lev_yacc.c $(U)lev_yacc.c +# @echo.>>$(U)lev_yacc.c +# +#$(INCL)/lev_comp.h : $(SSHR)/lev_comp.h +# @echo For now, we will copy the prebuilt lev_comp.h +# @echo from $(SSHR) into $(INCL) and use that. +# @cp $(SSHR)/lev_comp.h $@ +#$(U)lev_lex.c: $(SSHR)/lev_lex.c +# @echo.>>$(INCL)/lev_comp.h +# @echo For now, we will copy the prebuilt lev_lex.c +# @echo from $(SSHR) into $(U) and use it. +# @cp $(SSHR)/lev_lex.c $@ +# @echo.>>$@ + +#========================================== +# Dungeon Dependencies +#========================================== + +#$(U)dgn_comp: $(DGNCOMPOBJS) +# $(HOST_LINK) $(LFLAGS) -o$@ $(DGNCOMPOBJS) +# +#$(U)dgn_yacc.c: $(SSHR)/dgn_yacc.c +# @echo --- +# @echo For now, we will copy the prebuilt $(U)dgn_yacc.c and +# @echo dgn_comp.h from $(SSHR) into $(U) and use that. +# @cp $(SSHR)/dgn_yacc.c $(U)dgn_yacc.c +# @echo.>>$(U)dgn_yacc.c +# +#$(INCL)/dgn_comp.h: $(SSHR)/dgn_comp.h +# @echo --- +# @echo For now, we will copy the prebuilt dgn_comp.h +# @echo from $(SSHR) into $(INCL) and use that. +# @cp $(SSHR)/dgn_comp.h $@ +# @echo.>>$(INCL)/dgn_comp.h +# +#$(U)dgn_$(LEX).c: $(SSHR)/dgn_lex.c $(INCL)/dgn_comp.h +# @echo --- +# @echo For now, we will copy the prebuilt dgn_lex.c +# @echo from $(SSHR) into $(U) and use it. +# @cp $(SSHR)/dgn_lex.c $@ +# @echo.>>$@ + +#========================================== +# Header file moves required for tile support +#========================================== + +ifeq ($(SUPPRESS_GRAPHICS),Y) + +else +# +# Tile Mapping +# + +$(SRC)/tile.c: $(U)tilemap + @$(U)tilemap + @echo A new $@ has been created + +$(U)tilemap: $(HOST_O)tilemap.o + $(HOST_LINK) $(LFLAGS) -o$@ $(HOST_O)tilemap.o + +$(HOST_O)tilemap.o: $(WSHR)/tilemap.c $(HACK_H) $(TILE_H) + $(HOST_CC) $(cflags) -I$(WSHR) -I$(MSYS) -o$@ $(WSHR)/tilemap.c + + +#========================================== +# Tile Utilities +# Required for tile support +#========================================== + +$(DAT)/nhtiles.bmp: $(TILEFILES) $(U)tile2bmp + @echo Creating binary tile files which may take some time + @cd $(DAT) + @$(U)tile2bmp $@ + @cd $(SRC) + +$(U)tile2bmp: $(HOST_O)tile2bmp.o $(TEXTIO) + -rm -f temp.a + ar r temp.a $(TEXTIO) + $(HOST_LINK) $(LFLAGS) -o$@ $(HOST_O)tile2bmp.o temp.a + +$(U)tile2bin: $(HOST_O)tile2bin.o $(TEXTIO) + -rm -f temp.a + ar r temp.a $(TEXTIO) + $(HOST_LINK) $(LFLAGS) -o$@ $(HOST_O)tile2bin.o temp.a + +$(U)til2bin2: $(HOST_O)til2bin2.o $(TEXTIO2) + -rm -f temp.a + ar r temp.a $(TEXTIO2) + $(HOST_LINK) $(LFLAGS) -o$@ $(HOST_O)til2bin2.o temp.a + +$(U)thintile: $(HOST_O)thintile.o + $(HOST_LINK) $(LFLAGS) -o$@ $(HOST_O)thintile.o + +#$(HOST_O)thintile.o: $(HACK_H) $(WSHR)/tile.h $(WSHR)/thintile.c +# -rm -f temp.a +# ar r temp.a $(TEXTIO) +# $(HOST_LINK) $(LFLAGS) -o$@ $(HOST_O)tile2bmp.o temp.a + +$(HOST_O)thintile.o: $(HACK_H) $(WSHR)/tile.h $(WSHR)/thintile.c + $(HOST_CC) $(cflags) -I$(MSYS) -I$(WSHR) -DTILE -DOVERVIEW_FILE -o$@ $(WSHR)/thintile.c + +$(HOST_O)thintile.tag: $(U)thintile $(TILEFILES) + $(U)thintile + echo thintiles created >$@ + +$(HOST_O)tile2bmp.o: $(HACK_H) $(TILE_H) $(WSHR)/tile2bmp.c + $(HOST_CC) $(cflags) -I$(MSYS) -I$(WSHR) -o$@ $(WSHR)/tile2bmp.c + +$(HOST_O)tile2bin.o: $(HACK_H) $(TILE_H) $(MSYS)/pctiles.h $(MSYS)/pcvideo.h $(MSYS)/tile2bin.c + $(HOST_CC) $(cflags) -I$(MSYS) -I$(WSHR) -o$@ $(MSYS)/tile2bin.c + +$(HOST_O)til2bin2.o: $(HACK_H) $(TILE_H) $(MSYS)/pctiles.h $(MSYS)/pcvideo.h $(MSYS)/tile2bin.c + $(HOST_CC) $(cflags) -I$(MSYS) -I$(WSHR) -DTILE_X=8 -DOVERVIEW_FILE -o$@ $(MSYS)/tile2bin.c + +$(HOST_O)tiletext.o: $(CONFIG_H) $(TILE_H) $(WSHR)/tiletext.c + $(HOST_CC) $(cflags) -I$(MSYS) -I$(WSHR) -o$@ $(WSHR)/tiletext.c + +$(HOST_O)tiletex2.o: $(CONFIG_H) $(TILE_H) $(WSHR)/tiletext.c + $(HOST_CC) $(cflags) -I$(MSYS) -I$(WSHR) -DTILE_X=8 -o$@ $(WSHR)/tiletext.c + +$(HOST_O)tiletxt.o: $(CONFIG_H) $(TILE_H) $(WSHR)/tilemap.c + $(HOST_CC) $(cflags) -I$(MSYS) -I$(WSHR) -DTILETEXT -o$@ $(WSHR)/tilemap.c + +$(HOST_O)tiletxt2.o: $(CONFIG_H) $(TILE_H) $(WSHR)/tilemap.c + $(HOST_CC) $(cflags) -I$(MSYS) -I$(WSHR) -DTILETEXT -DTILE_X=8 -o$@ $(WSHR)/tilemap.c +# +# Optional GIF Utilities (for development) +# + +$(U)gif2txt: $(GIFREADERS) $(TEXTIO) + $(HOST_LINK) $(LFLAGS) -o$@ $(GIFREADERS) $(TEXTIO) + +$(U)gif2txt2: $(GIFREAD2) $(TEXTIO2) + $(HOST_LINK) $(LFLAGS) -o$@ $(GIFREAD2) $(TEXTIO2) + +$(U)txt2ppm: $(PPMWRITERS) $(TEXTIO) + $(HOST_LINK) $(LFLAGS) -o$@ $(PPMWRITERS) $(TEXTIO) + +$(U)txt2ppm2: $(PPMWRIT2) $(TEXTIO2) + $(HOST_LINK) $(LFLAGS) -o$@ $(PPMWRIT2) $(TEXTIO2) + +$(HOST_O)gifread.o: $(CONFIG_H) $(WSHR)/tile.h $(WSHR)/gifread.c + +$(HOST_O)gifread2.o: $(CONFIG_H) $(WSHR)/tile.h $(WSHR)/gifread.c + $(HOST_CC) $(cflags) -DTILE_X=8 -o$@ $(WSHR)/gifread.c + +ppmwrite.c: $(WSHR)/ppmwrite.c + cp $(WSHR)/ppmwrite.c . + +$(HOST_O)ppmwrite.o: $(CONFIG_H) $(WSHR)/tile.h + +$(HOST_O)ppmwrit2.o: $(CONFIG_H) $(WSHR)/tile.h ppmwrite.c + $(HOST_CC) $(cflags) -DTILE_X=8 -o$@ ppmwrite.c + +# +# Optional tile viewer (development sources only) +# + +$(U)viewtib: $(HOST_O)viewtib.o + $(HOST_LINK) $(LFLAGS) -o$@ $(HOST_O)viewtib.o $(LIBRARIES) + +$(HOST_O)viewtib.o: $(MSYS)/viewtib.c + +endif + +#========================================== +# Other host Util Dependencies. +#========================================== + +$(HOST_O)monst.o: $(CONFIG_H) $(PERMONST_H) $(INCL)/monsym.h \ + $(INCL)/color.h monst.c + $(HOST_CC) $(cflags) -o$@ monst.c + +$(HOST_O)objects.o: $(CONFIG_H) $(INCL)/obj.h $(INCL)/objclass.h \ + $(INCL)/prop.h $(INCL)/color.h objects.c + $(HOST_CC) $(cflags) -o$@ objects.c + +$(HOST_O)panic.o: $(CONFIG_H) $(U)panic.c + $(HOST_CC) $(cflags) -o$@ $(U)panic.c + +#$(HOST_O)sp_lev.tag: $(HOST_O)utility.tag \ +# $(DAT)/bigroom.des $(DAT)/castle.des \ +# $(DAT)/endgame.des $(DAT)/gehennom.des $(DAT)/knox.des \ +# $(DAT)/medusa.des $(DAT)/oracle.des $(DAT)/tower.des \ +# $(DAT)/yendor.des $(DAT)/arch.des $(DAT)/barb.des \ +# $(DAT)/caveman.des $(DAT)/healer.des $(DAT)/knight.des \ +# $(DAT)/monk.des $(DAT)/priest.des $(DAT)/ranger.des \ +# $(DAT)/rogue.des $(DAT)/samurai.des $(DAT)/tourist.des \ +# $(DAT)/valkyrie.des $(DAT)/wizard.des +# cd $(DAT) +# $(U)lev_comp bigroom.des +# $(U)lev_comp castle.des +# $(U)lev_comp endgame.des +# $(U)lev_comp gehennom.des +# $(U)lev_comp knox.des +# $(U)lev_comp mines.des +# $(U)lev_comp medusa.des +# $(U)lev_comp oracle.des +# $(U)lev_comp sokoban.des +# $(U)lev_comp tower.des +# $(U)lev_comp yendor.des +# $(U)lev_comp arch.des +# $(U)lev_comp barb.des +# $(U)lev_comp caveman.des +# $(U)lev_comp healer.des +# $(U)lev_comp knight.des +# $(U)lev_comp monk.des +# $(U)lev_comp priest.des +# $(U)lev_comp ranger.des +# $(U)lev_comp rogue.des +# $(U)lev_comp samurai.des +# $(U)lev_comp tourist.des +# $(U)lev_comp valkyrie.des +# $(U)lev_comp wizard.des +# cd $(SRC) +# echo sp_levs done > $@ + +#$(DAT)/dungeon: $(HOST_O)utility.tag $(DAT)/dungeon.def +# $(U)makedefs -e +# cd $(DAT) +# $(U)dgn_comp dungeon.pdf +# cd $(SRC) + +#========================================== +# Housekeeping for host side. +#========================================== + +clean: + rm ./host_o/*.o + if [ -f $(HOST_O)prereq.tag ]; then rm $(HOST_O)prereq.tag; fi; + if [ -f hobj.tag ]; then rm hobj.tag; fi; + if [ -f $(HOST_O)utility.tag ]; then rm $(HOST_O)utility.tag; fi; + if [ -f temp.a ]; then rm temp.a; fi; + +spotless: clean + + if [ -f $(INCL)/pm.h ]; then rm $(INCL)/pm.h; fi; +# if [ -f $(U)dgn_flex.c ]; then rm $(U)dgn_flex.c; fi; +# if [ -f $(U)dgn_lex.c ]; then rm $(U)dgn_lex.c; fi; +# if [ -f $(U)makedefs ]; then rm $(U)makedefs; fi; +# if [ -f $(U)dgn_comp ]; then rm $(U)dgn_comp; fi; +# if [ -f $(U)recover.exe ]; then rm $(U)recover.exe; fi; +# if [ -f $(U)tilemap ]; then rm $(U)tilemap; fi; +# if [ -f $(U)tile2bmp ]; then rm $(U)tile2bmp; fi; +# if [ -f $(U)tile2bin ]; then rm $(U)tile2bin; fi; +# if [ -f $(U)til2bin2 ]; then rm $(U)til2bin2; fi; +# if [ -f $(U)thintile ]; then rm $(U)thintile; fi; +# if [ -f $(U)dlb_main ]; then rm $(U)dlb_main; fi; +# if [ -f $(INCL)/vis_tab.h ]; then rm $(INCL)/vis_tab.h; fi; +# if [ -f $(INCL)/onames.h ]; then rm $(INCL)/onames.h; fi; +# if [ -f $(INCL)/pm.h ]; then rm $(INCL)/pm.h; fi; +# if [ -f $(INCL)/date.h ]; then rm $(INCL)/date.h; fi; +# if [ -f $(INCL)/dgn_comp.h ]; then rm $(INCL)/dgn_comp.h; fi; +# if [ -f $(INCL)/lev_comp.h ]; then rm $(INCL)/lev_comp.h; fi; +# if [ -f $(SRC)/vis_tab.c ]; then rm $(SRC)/vis_tab.c; fi; +# if [ -f $(SRC)/tile.c ]; then rm $(SRC)/tile.c; fi; +# if [ -f $(DAT)/options ]; then rm $(DAT)/options; fi; +# if [ -f $(DAT)/data ]; then rm $(DAT)/data; fi; +# if [ -f $(DAT)/rumors ]; then rm $(DAT)/rumors; fi; +# if [ -f $(DAT)/dungeon.pdf ]; then rm $(DAT)/dungeon.pdf; fi; +# if [ -f $(DAT)/dungeon ]; then rm $(DAT)/dungeon; fi; +# if [ -f $(DAT)/oracles ]; then rm $(DAT)/oracles; fi; +# if [ -f $(DAT)/quest.dat ]; then rm $(DAT)/quest.dat; fi; +# if [ -f $(DAT)/bogusmon ]; then rm $(DAT)/bogusmon; fi; +# if [ -f $(DAT)/engrave ]; then rm $(DAT)/engrave; fi; +# if [ -f $(DAT)/epitaph ]; then rm $(DAT)/epitaph; fi; +# if [ -f $(DAT)/dlb.lst ]; then rm $(DAT)/dlb.lst; fi; +# if [ -f $(DAT)/nhdat ]; then rm $(DAT)/nhdat; fi; +# if [ -f $(DAT)/*.lev ]; then rm $(DAT)/*.lev; fi; +# if [ -f $(TILE_BMP) ]; then rm $(TILE_BMP); fi; +# if [ -f $(WSHR)/monthin.txt ]; then rm $(WSHR)/monthin.txt; fi; +# if [ -f $(WSHR)/objthin.txt ]; then rm $(WSHR)/objthin.txt; fi; +# if [ -f $(WSHR)/oththin.txt ]; then rm $(WSHR)/oththin.txt; fi; + +#========================================== +# Game Dependencies +#========================================== + +# src dependencies + +$(HOST_O)tile.o: tile.c $(HACK_H) +$(HOST_O)vis_tab.o: vis_tab.c $(CONFIG_H) $(INCL)/vis_tab.h +$(HOST_O)alloc.o: alloc.c $(CONFIG_H) +$(HOST_O)dlb.o: dlb.c $(CONFIG_H) $(INCL)/dlb.h + $(HOST_CC) $(cflags) -I../sys/msdos -o$@ dlb.c +$(HOST_O)monst.o: monst.c $(CONFIG_H) $(INCL)/permonst.h $(INCL)/align.h \ + $(INCL)/monattk.h $(INCL)/monflag.h $(INCL)/monsym.h \ + $(INCL)/color.h +$(HOST_O)objects.o: objects.c $(CONFIG_H) $(INCL)/obj.h $(INCL)/objclass.h \ + $(INCL)/prop.h $(INCL)/skills.h $(INCL)/color.h +$(HOST_O)tileset.o: $(WSHR)/tileset.c $(HACK_H) +$(HOST_O)bmptiles.o: $(WSHR)/bmptiles.c $(INCL)/config.h $(INCL)/tileset.h $(INCL)/integer.h +$(HOST_O)giftiles.o: $(WSHR)/giftiles.c $(INCL)/config.h $(INCL)/tileset.h $(INCL)/integer.h + +# end of file + diff --git a/sys/msdos/Makefile2.cross b/sys/msdos/Makefile2.cross new file mode 100644 index 000000000..2d25a3d6b --- /dev/null +++ b/sys/msdos/Makefile2.cross @@ -0,0 +1,1263 @@ +# NetHack 3.6 Makefile2.cross +# Cross-compile msdos version of NetHack using a +# linux-hosted djgpp cross-compiler. +# +# Makefile1.cross is for the host-side obj files and utilities that +# will run on the host platform only. +# +# Makefile2.cross (this file) is the the target platform obj files +# and utilities. +# +# Makefile2 utilizes the djgpp cross-compiler from Andrew Wu: +# https://github.com/andrewwutw/build-djgpp +# +# Currently, in NetHack 3.6, the cross-compile for msdos cannot be +# used to build the entire game to a playable point but it is useful +# for testing the msdos port build of the evolving NetHack code. +# + +# Game Installation Variables +# NOTE: Make sure GAMEDIR exists before make is started. + +GAME = nethack +# The GNU Make has a problem if you include a drive spec below (unfortunately). +GAMEDIR =../binary + +# Optional PDCurses support +# Uncomment these and set them appropriately if you want to +# include curses port support alongside TTY support in your +# NetHack.exe binary. +# +# You'll have to set PDCURSES_H to the correct location of the +# PDCurses header (.h) files and PDCURSES_C to the location +# of your PDCurses C files which must already be resident on +# your machine. +# +ADD_CURSES=Y +PDCURSES_TOP=../../pdcurses + +# Set top of djgpp if not specified through ENV variables prior to make: +#DJGPP_TOP = $(HOME)/djgpp + +# +#============================================================================== +# This marks the end of the BUILD DECISIONS section. +#============================================================================== +# +# Directories, gcc likes unix style directory specs +# + +OBJ = o +HOBJ = host_o +DAT = ../dat +DOC = ../doc +INCL = ../include +MSYS = ../sys/msdos +SRC = ../src +SSHR = ../sys/share +UTIL = ../util +WIN = ../win/tty +WCURSES = ../win/curses +WSHR = ../win/share + +# +# Executables. +ifndef DJGPP_TOP +ifdef TRAVIS_BUILD_DIR +DJGPP_TOP = TRAVIS_BUILD_DIR/djgpp +else +DJGPP_TOP = $(HOME)/djgpp +endif +endif + +TARGET_CC = $(DJGPP_TOP)/i586-pc-msdosdjgpp/bin/gcc +TARGET_LINK = $(DJGPP_TOP)/i586-pc-msdosdjgpp/bin/gcc +TARGET_STUBEDIT = $(DJGPP_TOP)/i586-pc-msdosdjgpp/bin/stubedit +MAKEBIN = make + +# +# Special libraries and how to link them in. + +LIBS = -lpc + +# If TERMLIB is defined in pcconf.h, comment out the upper line and +# uncomment the lower. Note that you must build the termc library +# and place it in djgpp's lib directory. See termcap.zip for details + +TERMLIB = +#TERMLIB = -ltermc + +LIBRARIES = $(LIBS) $(TERMLIB) + +# +# Yacc/Lex ... if you got 'em. +# +# If you have yacc/lex or a work-alike set YACC_LEX to Y +# +YACC_LEX = N + +ifeq "$(YACC_LEX)" "Y" +DO_YACC = YACC_ACT +DO_LEX = LEX_ACT +endif + +# If YACC_LEX is Y above, set the following to values appropriate for +# your tools. +# +YACC = bison -y +LEX = lex +# +# If your flex and bison port mess with the output names directly +# you must set the file names to the appropriate output file names +# here +#YTABC = y_tab.c +#YTABH = y_tab.h +#LEXYYC = lexyy.c +# +# If your flex and bison are able to produce files named +# y.tab.c, y.tab.h or lex.yy.c you might have to set these +# to the short file name equivalent (DIR /X to reveal them): +YTABC = ytab~1.c +YTABH = ytab~1.h +LEXYYC = lexyy~1.c + +# +# Uncomment the line below if you want to store all the level files, +# help files, etc. in a single library file. + +USE_DLB = Y + +# djgpp includes ls.exe and touch.exe in fil41b.zip from the v2gnu +# folder so be sure to include that when downloading djgpp. Doing +# so will make changing this unnecessary. + +LS = ls -1 # ls.exe from djgpp distribution +#LS = dir /l/b # DOS command + +# To build a binary without any graphics +# suitable for blind players, +# set SUPPRESS_GRAPHICS to Y +# (Note: binary will require ANSI.SYS driver or equivalent loaded) +# SUPPRESS_GRAPHICS = Y +SUPPRESS_GRAPHICS = + +# ZLIB Support +# To support zlib compression in bones and save files, you must +# define ZLIB_COMP in include/config.h. +# You must also have a zlib library to link NetHack with, and +# for the djgpp build, you need one compatible with djgpp. +# At the time that this was written (post-NetHack 3.4.3) the +# following URL was a valid place to get a pre-built djgpp library +# to add to your djgpp tools directory tree. +# http://www.delorie.com/pub/djgpp/current/v2tk/zlib114b.zip +# +# If you defined ZLIB_COMP in include/config.h to build in support +# for ZLIB compression, you need to uncomment the line below. +#ZLIB= -lz + +#=============================================== +#======= End of Modification Section =========== +#=============================================== +################################################ +# # +# Nothing below here should have to be changed.# +# # +################################################ + +GAMEFILE = $(GAMEDIR)/$(GAME).exe + +# Changing this conditional block is not recommended +ifeq "$(USE_DLB)" "Y" +DLBFLG = -DDLB +else +DLBFLG = +endif + +TERMLIB = +# Build NetHack suitable for blind players + +#========================================== +#================ MACROS ================== +#========================================== +# This section creates shorthand macros for many objects +# referenced later on in the Makefile. +# +# Have windows path styles available for use in commands +# +W_OBJ =$(subst /,\, $(OBJ)) +W_INCL =$(subst /,\, $(INCL)) +W_DAT =$(subst /,\, $(DAT)) +W_DOC =$(subst /,\, $(DOC)) +W_UTIL =$(subst /,\, $(UTIL)) +W_SRC =$(subst /,\, $(SRC)) +W_SSYS =$(subst /,\, $(SSYS)) +W_MSWSYS =$(subst /,\, $(MSWSYS)) +W_TTY =$(subst /,\, $(TTY)) +W_MSWIN =$(subst /,\, $(MSWIN)) +ifeq "$(ADD_CURSES)" "Y" +W_WCURSES =$(subst /,\, $(WCURSES)) +endif +W_WSHR =$(subst /,\, $(WSHR)) +W_GAMEDIR =$(subst /,\, $(GAMEDIR)) + +# +# Shorten up the location for some files +# + +O = $(OBJ)/ +HOST_O = $(HOBJ)/ +U = $(UTIL)/ + +#========================================== +# Utility Objects. +#========================================== + +VGAOBJ = $(O)vidvga.o $(O)vidvesa.o + +MAKESRC = makedefs.c + +#SPLEVSRC = lev_yacc.c lev_$(LEX).c lev_main.c panic.c + +#DGNCOMPSRC = dgn_yacc.c dgn_$(LEX).c dgn_main.c + +MAKEDEFSOBJS = $(HOST_O)makedefs.o $(HOST_O)monst.o $(HOST_O)objects.o + +#SPLEVOBJS = $(HOST_O)lev_yacc.o $(HOST_O)lev_$(LEX).o $(HOST_O)lev_main.o $(HOST_O)alloc.o \ +# $(HOST_O)monst.o $(HOST_O)objects.o $(HOST_O)panic.o \ +# $(HOST_O)drawing.o $(HOST_O)decl.o $(O)stubvid.o + +#DGNCOMPOBJS = $(HOST_O)dgn_yacc.o $(HOST_O)dgn_$(LEX).o $(HOST_O)dgn_main.o $(HOST_O)alloc.o \ +# $(HOST_O)panic.o + +RECOVOBJS = $(O)recover.o + + +#========================================== +# Tile related object files. +#========================================== + +ifeq ($(SUPPRESS_GRAPHICS),Y) +TILOBJ = +TILOBJ2 = +TEXTIO = +TEXTIO2 = +TILE_BMP = +TILEUTIL = +TILEFILES = +TILEFILES2 = +GIFREADERS = +GIFREAD2 = +PPMWRITERS = +PPMWRIT2 = + +else + +TILOBJ = $(O)tile.o $(VGAOBJ) + +TILOBJ2 = $(O)tileset.o $(O)bmptiles.o $(O)giftiles.o + +TEXTIO = $(HOST_O)tiletext.o $(HOST_O)tiletxt.o $(HOST_O)drawing.o $(HOST_O)decl.o $(HOST_O)monst.o \ + $(HOST_O)objects.o $(HOST_O)stubvid.o + +TEXTIO2 = $(HOST_O)tiletex2.o $(HOST_O)tiletxt2.o $(HOST_O)drawing.o $(HOST_O)decl.o $(HOST_O)monst.o \ + $(HOST_O)objects.o $(HOST_O)stubvid.o + +TILE_BMP = $(DAT)/nhtiles.bmp + +TILEUTIL = $(TILOBJ) $(U)tile2bin $(U)til2bin2 $(TILE_BMP) + +TILEFILES = $(WSHR)/monsters.txt $(WSHR)/objects.txt $(WSHR)/other.txt + +TILEFILES2 = $(WSHR)/monthin.txt $(WSHR)/objthin.txt $(WSHR)/oththin.txt + +GIFREADERS = $(HOST_O)gifread.o $(HOST_O)alloc.o $(HOST_O)panic.o + +GIFREAD2 = $(HOST_O)gifread2.o $(HOST_O)alloc.o $(HOST_O)panic.o + +PPMWRITERS = $(HOST_O)ppmwrite.o $(HOST_O)alloc.o $(HOST_O)panic.o + +PPMWRIT2 = $(HOST_O)ppmwrit2.o $(HOST_O)alloc.o $(HOST_O)panic.o +endif + +#REGEX = $(O)pmatchregex.o +#REGEX = $(O)cppregex.o +REGEX = $(O)posixreg.o + +DLBOBJ = $(O)dlb.o + +# Object files for the game itself. + + +VOBJ01 = $(O)allmain.o $(O)alloc.o $(O)apply.o $(O)artifact.o $(O)attrib.o +VOBJ02 = $(O)ball.o $(O)bones.o $(O)botl.o $(O)cmd.o $(O)dbridge.o +VOBJ03 = $(O)decl.o $(O)detect.o $(O)display.o $(O)do.o $(O)do_name.o +VOBJ04 = $(O)do_wear.o $(O)dog.o $(O)dogmove.o $(O)dokick.o $(O)dothrow.o +VOBJ05 = $(O)drawing.o $(O)dungeon.o $(O)eat.o $(O)end.o $(O)engrave.o +VOBJ06 = $(O)exper.o $(O)explode.o $(O)extralev.o $(O)files.o $(O)fountain.o +VOBJ07 = $(O)getline.o $(O)hack.o $(O)hacklib.o $(O)invent.o $(O)lock.o +VOBJ08 = $(O)mail.o $(O)main.o $(O)makemon.o $(O)mapglyph.o $(O)mcastu.o $(O)mhitm.o +VOBJ09 = $(O)mhitu.o $(O)minion.o $(O)mkmap.o $(O)mklev.o $(O)mkmaze.o +VOBJ10 = $(O)mkobj.o $(O)mkroom.o $(O)mon.o $(O)mondata.o $(O)monmove.o +VOBJ11 = $(O)monst.o $(O)mplayer.o $(O)mthrowu.o $(O)muse.o +VOBJ12 = $(O)music.o $(O)o_init.o $(O)objects.o $(O)objnam.o $(O)options.o +VOBJ13 = $(O)pickup.o $(O)pline.o $(O)polyself.o $(O)potion.o $(O)quest.o +VOBJ14 = $(O)questpgr.o $(O)pager.o $(O)pray.o $(O)priest.o $(O)read.o +VOBJ15 = $(O)rect.o $(O)restore.o $(O)rip.o $(O)rnd.o $(O)role.o +VOBJ16 = $(O)rumors.o $(O)save.o $(O)shk.o $(O)shknam.o $(O)sit.o +VOBJ17 = $(O)sounds.o $(O)sp_lev.o $(O)spell.o $(O)steal.o $(O)steed.o +VOBJ18 = $(O)termcap.o $(O)timeout.o $(O)topl.o $(O)topten.o $(O)track.o +VOBJ19 = $(O)trap.o $(O)u_init.o $(O)uhitm.o $(O)vault.o $(O)vision.o +VOBJ20 = $(O)vis_tab.o $(O)weapon.o $(O)were.o $(O)wield.o $(O)windows.o +VOBJ21 = $(O)wintty.o $(O)wizard.o $(O)worm.o $(O)worn.o $(O)write.o +VOBJ22 = $(O)zap.o $(O)light.o $(O)dlb.o $(O)dig.o $(O)teleport.o +VOBJ23 = $(O)region.o $(O)sys.o $(REGEX) $(O)isaac64.o + +SOBJ = $(O)msdos.o $(O)sound.o $(O)pcsys.o $(O)tty.o $(O)unix.o \ + $(O)video.o $(O)vidtxt.o $(O)pckeys.o + +VVOBJ = $(O)version.o + +ifeq "$(ADD_CURSES)" "Y" +CURSESOBJ= $(O)cursdial.o $(O)cursinit.o $(O)cursinvt.o $(O)cursmain.o \ + $(O)cursmesg.o $(O)cursmisc.o $(O)cursstat.o $(O)curswins.o +else +CURSESOBJ= +endif + +VOBJ = $(VOBJ01) $(VOBJ02) $(VOBJ03) $(VOBJ04) $(VOBJ05) \ + $(VOBJ06) $(VOBJ07) $(VOBJ08) $(VOBJ09) $(VOBJ10) \ + $(VOBJ11) $(VOBJ12) $(VOBJ13) $(VOBJ14) $(VOBJ15) \ + $(VOBJ16) $(VOBJ17) $(VOBJ18) $(VOBJ19) $(VOBJ20) \ + $(VOBJ21) $(VOBJ22) $(VOBJ23) \ + $(CURSESOBJ) + +ALLOBJ = $(VOBJ) $(SOBJ) $(TILOBJ) $(TILOBJ2) $(VVOBJ) + +ifeq "$(ADD_CURSES)" "Y" +#========================================== +# PDCurses build macros +#========================================== +PDCURSES_CURSES_H = $(PDCURSES_TOP)/curses.h +PDCURSES_CURSPRIV_H = $(PDCURSES_TOP)/curspriv.h +PDCURSES_HEADERS = $(PDCURSES_CURSES_H) $(PDCURSES_CURSPRIV_H) +PDCSRC = $(PDCURSES_TOP)/pdcurses +PDCDOS = $(PDCURSES_TOP)/dos +PDCLIBOBJS1 = $(O)addch.o $(O)addchstr.o $(O)addstr.o $(O)attr.o $(O)beep.o \ + $(O)bkgd.o $(O)border.o $(O)clear.o $(O)color.o $(O)delch.o $(O)deleteln.o \ + $(O)getch.o +PDCLIBOBJS2 = $(O)getstr.o $(O)getyx.o $(O)inch.o $(O)inchstr.o $(O)initscr.o \ + $(O)inopts.o $(O)insch.o $(O)insstr.o $(O)instr.o $(O)kernel.o \ + $(O)keyname.o $(O)mouse.o +PDCLIBOBJS3 = $(O)move.o $(O)outopts.o $(O)overlay.o $(O)pad.o $(O)panel.o \ + $(O)printw.o $(O)refresh.o $(O)scanw.o $(O)scr_dump.o $(O)scroll.o \ + $(O)slk.o $(O)termattr.o +PDCLIBOBJS4 = $(O)touch.o $(O)util.o $(O)window.o $(O)debug.o +PDCLIBOBJS = $(PDCLIBOBJS1) $(PDCLIBOBJS2) $(PDCLIBOBJS3) $(PDCLIBOBJS4) + +PDCOBJS = $(O)pdcclip.o $(O)pdcdisp.o $(O)pdcgetsc.o $(O)pdckbd.o \ + $(O)pdcscrn.o $(O)pdcsetsc.o $(O)pdcutil.o + +#PDCOBJS = $(O)pdcclip.o $(O)pdcdisp.o $(O)pdcgetsc.o $(O)pdckbd.o $(O)pdcscrn.o \ +# $(O)pdcsetsc.o $(O)pdcutil.o + +PDCLIB = $(O)pdcurses.a + +#PDCINCL = -I$(PDCURSES_TOP) -I$(PDCSRC) -I$(PDCDOS) +PDCINCL = -I$(PDCURSES_TOP) -I$(PDCDOS) +else +PDCLIB = +endif + +#========================================== +# Header file macros +#========================================== + +PATCHLEV_H = $(INCL)/patchlev.h +DGN_FILE_H = $(INCL)/align.h $(INCL)/dgn_file.h +DUNGEON_H = $(INCL)/align.h $(INCL)/dungeon.h +MONDATA_H = $(INCL)/align.h $(INCL)/mondata.h +MONST_H = $(INCL)/align.h $(INCL)/monst.h $(INCL)/mextra.h +PERMONST_H = $(INCL)/monattk.h $(INCL)/monflag.h $(INCL)/align.h \ + $(INCL)/permonst.h +REGION_H = $(INCL)/region.h +RM_H = $(INCL)/align.h $(INCL)/rm.h +SKILLS_H = $(INCL)/skills.h +SP_LEV_H = $(INCL)/align.h $(INCL)/sp_lev.h +YOUPROP_H = $(PERMONST_H) $(MONDATA_H) $(INCL)/prop.h \ + $(INCL)/pm.h $(INCL)/youprop.h +YOU_H = $(MONST_H) $(YOUPROP_H) $(INCL)/align.h \ + $(INCL)/attrib.h $(INCL)/you.h +DISPLAY_H = $(MONDATA_H) $(INCL)/vision.h $(INCL)/display.h +PCCONF_H = $(INCL)/micro.h $(INCL)/system.h $(INCL)/pcconf.h \ + $(MSYS)/pcvideo.h +CONFIG_H = $(GLOBAL_H) $(INCL)/tradstdc.h $(INCL)/config1.h \ + $(INCL)/config.h +DECL_H = $(YOU_H) $(INCL)/spell.h $(INCL)/color.h \ + $(INCL)/obj.h $(INCL)/onames.h $(INCL)/pm.h \ + $(INCL)/decl.h +GLOBAL_H = $(PCCONF_H) $(INCL)/coord.h $(INCL)/global.h +HACK_H = $(CONFIG_H) $(INCL)/context.h $(DUNGEON_H) \ + $(DECL_H) $(DISPLAY_H) $(INCL)/monsym.h \ + $(INCL)/mkroom.h $(INCL)/objclass.h $(INCL)/trap.h \ + $(INCL)/flag.h $(RM_H) $(INCL)/vision.h \ + $(INCL)/wintype.h $(INCL)/engrave.h $(INCL)/rect.h \ + $(INCL)/trampoli.h $(INCL)/hack.h $(REGION_H) \ + $(INCL)/sys.h +DLB_H = $(INCL)/dlb.h + +ifeq ($(SUPPRESS_GRAPHICS),Y) +TILE_H = +else +TILE_H = $(WSHR)/tile.h $(INCL)/tileset.h +endif + +ifeq ($(USE_DLB),Y) +DLB = dlb +DLBOBJS = $(O)dlb_main.o $(O)dlb.o $(O)alloc.o $(O)panic.o +else +DLB = +DLBOBJS = +endif + +ifdef DJGPP +DJ1 = $(dir $(DJGPP)) +CWSDPMI = $(subst /,\,$(DJ1))bin\CWSDPMI.* +endif + +#========================================== +# More compiler setup macros +#========================================== +# +ifeq "$(ADD_CURSES)" "Y" +CURSESDEF=-D"CURSES_GRAPHICS" -D"CURSES_BRIEF_INCLUDE" +else +CURSESDEF= +CURSESLIB= +endif + +INCLDIR=-I../include -I../sys/msdos + +# Debugging +#cflags = -pg -c $(INCLDIR) $(DLBFLG) $(CURSESDEF) -DSUPPRESS_GRAPHICS +#LFLAGS = -pg + +cflags = -c -O $(INCLDIR) $(DLBFLG) $(CURSESDEF) -DSUPPRESS_GRAPHICS +LFLAGS = + +# Debugging +#cflags = -g -c $(INCLDIR) $(DLBFLG) $(CURSESDEF) -DUSE_TILES +#LFLAGS = -g + +# Normal +cflags = -c -O $(INCLDIR) $(DLBFLG) $(CURSESDEF) -DUSE_TILES +LFLAGS = + +#========================================== +#================ RULES ================== +#========================================== + +.SUFFIXES: .o .til .uu .c .y .l + +#========================================== +# Rules for files in src +#========================================== + +$(OBJ)/%.o : %.c + $(TARGET_CC) $(cflags) -o$@ $< + +$(OBJ)/%.o : $(SRC)/%.c + $(TARGET_CC) $(cflags) -o$@ $< + +#========================================== +# Rules for files in sys/share +#========================================== + +$(OBJ)/%.o : $(SSHR)/%.c + $(TARGET_CC) $(cflags) -o$@ $< + +#========================================== +# Rules for files in sys/msdos +#========================================== + +$(OBJ)/%.o : $(MSYS)/%.c + $(TARGET_CC) $(cflags) -I../sys/msdos -o$@ $< + +#========================================== +# Rules for files in util +#========================================== + +$(OBJ)/%.o : $(UTIL)/%.c + $(TARGET_CC) $(cflags) -o$@ $< + +#========================================== +# Rules for files in win/share +#========================================== + +$(OBJ)/%.o : $(WSHR)/%.c + $(TARGET_CC) $(cflags) -I../win/share -o$@ $< + +#========================================== +# Rules for files in win/tty +#========================================== + +$(OBJ)/%.o : $(TTY)/%.c + $(TARGET_CC) $(cflags) -o$@ $< + +#========================================== +# Rules for files in win/curses +#========================================== + +$(OBJ)/%.o : $(WCURSES)/%.c + $(TARGET_CC) -DPDC_NCMOUSE $(PDCINCL) $(cflags) -o$@ $< + +#========================================== +# Rules for files in PDCurses +#========================================== + +$(OBJ)/%.o : $(PDCURSES_TOP)/%.c + $(TARGET_CC) $(PDCINCL) $(cflags) -o$@ $< + +$(OBJ)/%.o : $(PDCSRC)/%.c + $(TARGET_CC) $(PDCINCL) $(cflags) -o$@ $< + +$(OBJ)/%.o : $(PDCDOS)/%.c + $(TARGET_CC) $(PDCINCL) $(cflags) -o$@ $< + +#========================================== +# Primary Targets. +#========================================== + +# The default target. + +all : install + +install: $(GAMEFILE) $(O)install.tag + @echo Done. + +default: $(GAMEFILE) + +util: $(O)utility.tag + +#LEVCOMPEXE = $(U)lev_comp + +$(O)utility.tag: $(INCL)/date.h $(INCL)/trap.h $(INCL)/onames.h \ + $(INCL)/pm.h vis_tab.c $(TILEUTIL) + echo utilities made > $@ + +tileutil: $(U)gif2txt $(U)txt2ppm + @echo Optional tile development utilities are up to date. + +recover.exe: $(U)recover +# @$(subst /,\,if exist $(U)recover copy $(U)recover $(GAMEDIR)) +# @$(subst /,\,if exist $(DOC)/recover.txt copy $(DOC)/recover.txt $(GAMEDIR)) + +$(O)install.tag: $(DAT)/nhdat $(GAMEFILE) +ifeq ($(USE_DLB),Y) + cp $(DAT)/nhdat $(GAMEDIR) + cp $(DAT)/license $(GAMEDIR) +else + cp $(DAT)/*. $(GAMEDIR) + cp $(DAT)/*.dat $(GAMEDIR) + cp $(DAT)/*.lev $(GAMEDIR) + cp $(MSYS)/msdoshlp.txt $(GAMEDIR)) +endif +ifdef TERMLIB + cp $(SSHR)/termcap $(GAMEDIR)) +endif +# if [ -f $(TILE_BMP) ]; then rm $(TILE_BMP); fi; + if [ -f $(TILE_BMP) ]; then cp $(TILE_BMP) $(GAMEDIR); fi; + if [ -f $(DAT)/symbols ]; then cp $(DAT)/symbols $(GAMEDIR); fi; + if [ -f $(SSHR)/NetHack.cnf ]; then cp $(SSHR)/NetHack.cnf $(GAMEDIR); fi; + -touch $(GAMEDIR)/record + if [ -f ../sys/winnt/sysconf ]; then cp ../sys/winnt/sysconf $(GAMEDIR); fi; + if [ -f $(DOC)/nethack.txt ]; then cp $(DOC)/nethack.txt $(GAMEDIR); fi; +ifdef CWSDPMI + if [ -f $(CWSDPMI) ]; then cp $(CWSDPMI) $(GAMEDIR); fi; +else + @echo Could not find a copy of CWSDPMI.EXE to put into $(GAMEDIR) +endif + @echo install done > $@ + +#========================================== +# The main target. +#========================================== + +$(GAMEFILE): $(O)obj.tag $(PATCHLEV_H) $(PDCLIB) \ + $(O)utility.tag $(ALLOBJ) $(O)$(GAME).lnk + if [ -f temp.a ]; then rm temp.a; fi; + @ar r temp.a $(VOBJ01) + @ar r temp.a $(VOBJ02) + @ar r temp.a $(VOBJ03) + @ar r temp.a $(VOBJ04) + @ar r temp.a $(VOBJ05) + @ar r temp.a $(VOBJ06) + @ar r temp.a $(VOBJ07) + @ar r temp.a $(VOBJ08) + @ar r temp.a $(VOBJ09) + @ar r temp.a $(VOBJ10) + @ar r temp.a $(VOBJ11) + @ar r temp.a $(VOBJ12) + @ar r temp.a $(VOBJ13) + @ar r temp.a $(VOBJ14) + @ar r temp.a $(VOBJ15) + @ar r temp.a $(VOBJ16) + @ar r temp.a $(VOBJ17) + @ar r temp.a $(VOBJ18) + @ar r temp.a $(VOBJ19) + @ar r temp.a $(VOBJ20) + @ar r temp.a $(VOBJ21) + @ar r temp.a $(VOBJ22) + @ar r temp.a $(VOBJ23) + @ar r temp.a $(VOBJ24) + @ar r temp.a $(VOBJ25) + @ar r temp.a $(SOBJ) + @ar r temp.a $(TILOBJ) + @ar r temp.a $(TILOBJ2) + @ar r temp.a $(VVOBJ) +ifeq "$(ADD_CURSES)" "Y" + @ar r temp.a $(CURSESOBJ) +endif + $(TARGET_LINK) $(LFLAGS) -o$(GAME).exe temp.a $(PDCLIB) $(LIBRARIES) $(ZLIB) + $(TARGET_STUBEDIT) $(GAME).exe minstack=2048K + cp $(GAME).exe $(GAMEFILE) + rm $(GAME).exe + +$(O)$(GAME).lnk: $(ALLOBJ) + echo $(VOBJ01) > $(subst /,\,$@) + echo $(VOBJ02) >> $(subst /,\,$@) + echo $(VOBJ03) >> $(subst /,\,$@) + echo $(VOBJ04) >> $(subst /,\,$@) + echo $(VOBJ05) >> $(subst /,\,$@) + echo $(VOBJ06) >> $(subst /,\,$@) + echo $(VOBJ07) >> $(subst /,\,$@) + echo $(VOBJ08) >> $(subst /,\,$@) + echo $(VOBJ09) >> $(subst /,\,$@) + echo $(VOBJ10) >> $(subst /,\,$@) + echo $(VOBJ11) >> $(subst /,\,$@) + echo $(VOBJ12) >> $(subst /,\,$@) + echo $(VOBJ13) >> $(subst /,\,$@) + echo $(VOBJ14) >> $(subst /,\,$@) + echo $(VOBJ15) >> $(subst /,\,$@) + echo $(VOBJ16) >> $(subst /,\,$@) + echo $(VOBJ17) >> $(subst /,\,$@) + echo $(VOBJ18) >> $(subst /,\,$@) + echo $(VOBJ19) >> $(subst /,\,$@) + echo $(VOBJ20) >> $(subst /,\,$@) + echo $(VOBJ21) >> $(subst /,\,$@) + echo $(VOBJ22) >> $(subst /,\,$@) + echo $(VOBJ23) >> $(subst /,\,$@) + echo $(VOBJ24) >> $(subst /,\,$@) + echo $(VOBJ25) >> $(subst /,\,$@) + echo $(SOBJ) >> $(subst /,\,$@) + echo $(TILOBJ) >> $(subst /,\,$@) + echo $(TILOBJ2) >> $(subst /,\,$@) + echo $(VVOBJ) >> $(subst /,\,$@) +ifeq "$(ADD_CURSES)" "Y" + echo $(CURSESOBJ) >> $(subst /,\,$@) +endif + +#========================================== +#=========== SECONDARY TARGETS ============ +#========================================== +# +# The following include files depend on makedefs to be created. +# +# date.h should be remade every time any of the source or include +# files is modified. +# +# +#$(INCL)/date.h : $(U)makedefs +# -$(U)makedefs -v +# +#$(INCL)/onames.h: $(U)makedefs +# -$(U)makedefs -o +# +#$(INCL)/pm.h: $(U)makedefs +# -$(U)makedefs -p +# +#monstr.c: $(U)makedefs +# -$(U)makedefs -m +# +#$(INCL)/vis_tab.h: $(U)makedefs +# -$(U)makedefs -z +# +#vis_tab.c: $(U)makedefs +# -$(U)makedefs -z +# +#========================================== +# Level Compiler Dependencies +#========================================== +# +#$(U)lev_comp: $(SPLEVOBJS) +# -rm -f temp.a +# @ar ru temp.a $(SPLEVOBJS) +# $(HOST_LINK) $(LFLAGS) -o$@ temp.a +# +#$(HOST_O)lev_yacc.o: $(HACK_H) $(SP_LEV_H) $(INCL)/lev_comp.h $(U)lev_yacc.c +# $(HOST_CC) $(cflags) -o$@ $(U)lev_yacc.c +# +#$(HOST_O)lev_$(LEX).o: $(HACK_H) $(SP_LEV_H) $(INCL)/lev_comp.h \ +# $(U)lev_$(LEX).c +# $(HOST_CC) $(cflags) -o$@ $(U)lev_$(LEX).c +# +#$(HOST_O)lev_main.o: $(HACK_H) $(INCL)/sp_lev.h $(INCL)/date.h $(U)lev_main.c +# +#$(U)lev_yacc.c: $(SSHR)/lev_yacc.c +# @echo --- +# @echo For now, we will copy the prebuilt +# @echo lev_comp.c from $(SSHR) into $(U) and use that. +# @cp $(SSHR)/lev_yacc.c $(U)lev_yacc.c +# @echo.>>$(U)lev_yacc.c +# +#$(INCL)/lev_comp.h : $(SSHR)/lev_comp.h +# @echo For now, we will copy the prebuilt lev_comp.h +# @echo from $(SSHR) into $(INCL) and use that. +# @cp $(SSHR)/lev_comp.h $@ +#$(U)lev_lex.c: $(SSHR)/lev_lex.c +# @echo.>>$(INCL)/lev_comp.h +# @echo For now, we will copy the prebuilt lev_lex.c +# @echo from $(SSHR) into $(U) and use it. +# @cp $(SSHR)/lev_lex.c $@ +# @echo.>>$@ +# +#========================================== +# Dungeon Dependencies +#========================================== +# +#$(U)dgn_comp: $(DGNCOMPOBJS) +# $(HOST_LINK) $(LFLAGS) -o$@ $(DGNCOMPOBJS) +# +#$(U)dgn_yacc.c: $(SSHR)/dgn_yacc.c +# @echo --- +# @echo For now, we will copy the prebuilt $(U)dgn_yacc.c and +# @echo dgn_comp.h from $(SSHR) into $(U) and use that. +# @cp $(SSHR)/dgn_yacc.c $(U)dgn_yacc.c +# @echo.>>$(U)dgn_yacc.c +# +#$(INCL)/dgn_comp.h: $(SSHR)/dgn_comp.h +# @echo --- +# @echo For now, we will copy the prebuilt dgn_comp.h +# @echo from $(SSHR) into $(INCL) and use that. +# @cp $(SSHR)/dgn_comp.h $@ +# @echo.>>$(INCL)/dgn_comp.h +# +#$(U)dgn_$(LEX).c: $(SSHR)/dgn_lex.c $(INCL)/dgn_comp.h +# @echo --- +# @echo For now, we will copy the prebuilt dgn_lex.c +# @echo from $(SSHR) into $(U) and use it. +# @cp $(SSHR)/dgn_lex.c $@ +# @echo.>>$@ + +#========================================== +# Recover Utility +#========================================== + +$(U)recover.exe: $(RECOVOBJS) + $(TARGET_LINK) $(LFLAGS) -o$@ $(O)recover.o + +$(O)recover.o: $(CONFIG_H) $(U)recover.c + $(TARGET_CC) $(cflags) -o$@ $(U)recover.c + +#========================================== +# Header file moves required for tile support +#========================================== + +ifeq ($(SUPPRESS_GRAPHICS),Y) + +else +# +# Tile Mapping +# + +#$(SRC)/tile.c: $(U)tilemap +# @$(U)tilemap +# @echo A new $@ has been created + +endif + +#========================================== +# PDCurses Library +#========================================== + +$(O)pdcurses.a : $(PDCLIBOBJS) $(PDCOBJS) + ar rcS $@ $(PDCLIBOBJS1) + ar rcS $@ $(PDCLIBOBJS2) + ar rcS $@ $(PDCLIBOBJS3) + ar rcS $@ $(PDCLIBOBJS4) + ar rcs $@ $(PDCOBJS) + +#========================================== +# Other Util Dependencies. +#========================================== + +$(O)alloc.o: $(CONFIG_H) alloc.c + $(TARGET_CC) $(cflags) -o$@ alloc.c + +$(O)drawing.o: $(CONFIG_H) drawing.c $(MSYS)/pcvideo.h + $(TARGET_CC) $(cflags) -I$(MSYS) -o$@ drawing.c + +$(O)decl.o: $(CONFIG_H) decl.c + $(TARGET_CC) $(cflags) -o$@ decl.c + +$(O)monst.o: $(CONFIG_H) $(PERMONST_H) $(INCL)/monsym.h \ + $(INCL)/color.h monst.c + $(TARGET_CC) $(cflags) -o$@ monst.c + +$(O)objects.o: $(CONFIG_H) $(INCL)/obj.h $(INCL)/objclass.h \ + $(INCL)/prop.h $(INCL)/color.h objects.c + $(TARGET_CC) $(cflags) -o$@ objects.c + +$(O)dat.tag: $(DAT)/nhdat + @echo dat done >$@ + +#$(HOST_O)monst.o: $(CONFIG_H) $(PERMONST_H) $(INCL)/monsym.h \ +# $(INCL)/color.h monst.c +# $(HOST_CC) $(cflags) -o$@ monst.c + +#$(HOST_O)objects.o: $(CONFIG_H) $(INCL)/obj.h $(INCL)/objclass.h \ +# $(INCL)/prop.h $(INCL)/color.h objects.c +# $(HOST_CC) $(cflags) -o$@ objects.c + +#$(O)panic.o: $(CONFIG_H) $(U)panic.c + +# make data.base an 8.3 filename to prevent an make warning +#DATABASE = $(DAT)/data.bas +# +# +# +#$(DAT)/data: $(O)utility.tag $(DATABASE) +# $(U)makedefs -d +# +#$(DAT)/rumors: $(O)utility.tag $(DAT)/rumors.tru $(DAT)/rumors.fal +# $(U)makedefs -r +# +#$(DAT)/quest.dat: $(O)utility.tag $(DAT)/quest.txt +# $(U)makedefs -q +# +#$(DAT)/oracles: $(O)utility.tag $(DAT)/oracles.txt +# $(U)makedefs -h +# +#$(DAT)/bogusmon: $(O)utility.tag $(DAT)/bogusmon.txt +# $(U)makedefs -s +# +#$(DAT)/engrave: $(O)utility.tag $(DAT)/engrave.txt +# $(U)makedefs -s +# +#$(DAT)/epitaph: $(O)utility.tag $(DAT)/epitaph.txt +# $(U)makedefs -s +# +#$(O)sp_lev.tag: $(O)utility.tag \ +# $(DAT)/bigroom.des $(DAT)/castle.des \ +# $(DAT)/endgame.des $(DAT)/gehennom.des $(DAT)/knox.des \ +# $(DAT)/medusa.des $(DAT)/oracle.des $(DAT)/tower.des \ +# $(DAT)/yendor.des $(DAT)/arch.des $(DAT)/barb.des \ +# $(DAT)/caveman.des $(DAT)/healer.des $(DAT)/knight.des \ +# $(DAT)/monk.des $(DAT)/priest.des $(DAT)/ranger.des \ +# $(DAT)/rogue.des $(DAT)/samurai.des $(DAT)/tourist.des \ +# $(DAT)/valkyrie.des $(DAT)/wizard.des +# cd $(DAT) +# $(U)lev_comp bigroom.des +# $(U)lev_comp castle.des +# $(U)lev_comp endgame.des +# $(U)lev_comp gehennom.des +# $(U)lev_comp knox.des +# $(U)lev_comp mines.des +# $(U)lev_comp medusa.des +# $(U)lev_comp oracle.des +# $(U)lev_comp sokoban.des +# $(U)lev_comp tower.des +# $(U)lev_comp yendor.des +# $(U)lev_comp arch.des +# $(U)lev_comp barb.des +# $(U)lev_comp caveman.des +# $(U)lev_comp healer.des +# $(U)lev_comp knight.des +# $(U)lev_comp monk.des +# $(U)lev_comp priest.des +# $(U)lev_comp ranger.des +# $(U)lev_comp rogue.des +# $(U)lev_comp samurai.des +# $(U)lev_comp tourist.des +# $(U)lev_comp valkyrie.des +# $(U)lev_comp wizard.des +# cd $(SRC) +# echo sp_levs done > $@ +# +#$(DAT)/dungeon: $(O)utility.tag $(DAT)/dungeon.def +# $(U)makedefs -e +# cd $(DAT) +# $(U)dgn_comp dungeon.pdf +# cd $(SRC) + +#========================================== +# DLB stuff +#========================================== + +#note that dir below assumes bin/dir from djgpp distribution +# +#$(DAT)/nhdat: $(U)dlb_main $(DAT)/data $(DAT)/rumors $(DAT)/dungeon \ +# $(DAT)/oracles $(DAT)/quest.dat $(O)sp_lev.tag \ +# $(DAT)/bogusmon $(DAT)/engrave $(DAT)/epitaph $(DAT)/tribute +# echo dat done >$(O)dat.tag +# cd $(DAT) +# copy $(MSYS)/msdoshlp.txt . +# @$(LS) data dungeon oracles options quest.dat rumors help hh >dlb.lst +# @$(LS) cmdhelp history opthelp wizhelp license msdoshlp.txt >>dlb.lst +# @$(LS) bogusmon engrave epitaph tribute >>dlb.lst +# $(LS) $(subst /,\,*.lev) >>dlb.lst +# $(U)dlb_main cvIf dlb.lst nhdat +# cd $(SRC) +# +#$(U)dlb_main: $(DLBOBJS) +# $(HOST_LINK) $(LFLAGS) -o$@ $(DLBOBJS) +# +#$(HOST_O)dlb_main.o: $(U)dlb_main.c $(INCL)/config.h $(DLB_H) +# $(HOST_CC) $(cflags) -o$@ $(U)dlb_main.c + +#========================================== +# Housekeeping. +#========================================== + +clean: + rm ./o/*.o + if [ -f $(O)install.tag ]; then rm $(O)install.tag; fi; + if [ -f $(O)obj.tag ]; then rm $(O)obj.tag; fi; + if [ -f $(O)$(GAME).lnk ]; then rm temp.a; fi; + if [ -f temp.a ]; then rm temp.a; fi; + +spotless: clean + + if [ -f dgn_flex.c ]; then rm dgn_flex.c; fi; + if [ -f dgn_lex.c ]; then rm dgn_lex.c; fi; + if [ -f $(U)dgn_comp.exe ]; then rm $(U)dgn_comp.exe; fi; + if [ -f $(U)recover.exe ]; then rm $(U)recover.exe; fi; + if [ -f $(INCL)/vis_tab.h ]; then rm $(INCL)/vis_tab.h; fi; + if [ -f $(INCL)/onames.h ]; then rm $(INCL)/onames.h; fi; + if [ -f $(INCL)/pm.h ]; then rm $(INCL)/pm.h; fi; + if [ -f $(INCL)/date.h ]; then rm $(INCL)/date.h; fi; + if [ -f $(INCL)/dgn_comp.h ]; then rm $(INCL)/dgn_comp.h; fi; + if [ -f $(INCL)/lev_comp.h ]; then rm $(INCL)/lev_comp.h; fi; +# if [ -f $(SRC)/monstr.c ]; then rm $(SRC)/monstr.c; fi; + if [ -f $(SRC)/vis_tab.c ]; then rm $(SRC)/vis_tab.c; fi; + if [ -f $(SRC)/tile.c ]; then rm $(SRC)/tile.c; fi; + if [ -f $(DAT)/options ]; then rm $(DAT)/options; fi; + if [ -f $(DAT)/data ]; then rm $(DAT)/data; fi; + if [ -f $(DAT)/rumors ]; then rm $(DAT)/rumors; fi; + if [ -f $(DAT)/dungeon.pdf ]; then rm $(DAT)/dungeon.pdf; fi; + if [ -f $(DAT)/dungeon ]; then rm $(DAT)/dungeon; fi; + if [ -f $(DAT)/oracles ]; then rm $(DAT)/oracles; fi; + if [ -f $(DAT)/quest.dat ]; then rm $(DAT)/quest.dat; fi; + if [ -f $(DAT)/bogusmon ]; then rm $(DAT)/bogusmon; fi; + if [ -f $(DAT)/engrave ]; then rm $(DAT)/engrave; fi; + if [ -f $(DAT)/epitaph ]; then rm $(DAT)/epitaph; fi; + if [ -f $(DAT)/dlb.lst ]; then rm $(DAT)/dlb.lst; fi; + if [ -f $(TILE_BMP) ]; then rm $(TILE_BMP); fi; + if [ -f $(WSHR)/monthin.txt ]; then rm $(WSHR)/monthin.txt; fi; + if [ -f $(WSHR)/objthin.txt ]; then rm $(WSHR)/objthin.txt; fi; + if [ -f $(WSHR)/oththin.txt ]; then rm $(WSHR)/oththin.txt; fi; + -rm $(DAT)/*.lev + +#========================================== +# Create directory for holding object files +#========================================== + +$(O)obj.tag: + -mkdir -p $(OBJ) + @echo directory ready $(OBJ) + +#========================================== +# Game Dependencies +#========================================== + +# sys/share +$(O)main.o: $(HACK_H) $(DLB_H) $(SSHR)/pcmain.c + $(TARGET_CC) $(cflags) -o$@ $(SSHR)/pcmain.c + +$(O)tty.o: $(HACK_H) $(INCL)/wintty.h $(SSHR)/pctty.c + $(TARGET_CC) $(cflags) -o$@ $(SSHR)/pctty.c + +$(O)unix.o: $(HACK_H) $(SSHR)/pcunix.c + $(TARGET_CC) $(cflags) -o$@ $(SSHR)/pcunix.c + +$(O)pcsys.o : $(HACK_H) $(SSHR)/pcsys.c + $(TARGET_CC) $(cflags) -o$@ $(SSHR)/pcsys.c + +$(O)posixreg.o : $(HACK_H) $(SSHR)/posixreg.c + $(TARGET_CC) $(cflags) -o$@ $(SSHR)/posixreg.c + +$(O)cppregex.o : $(HACK_H) $(SSHR)/cppregex.cpp + gpp $(cflags) -std=c++11 -o$@ $(SSHR)/cppregex.cpp + +$(O)pmatchre.o : $(HACK_H) $(SSHR)/pmatchre.c + $(TARGET_CC) $(cflags) -o$@ $(SSHR)/pmatchre.c + +# sys/msdos +$(O)msdos.o : $(HACK_H) $(MSYS)/msdos.c +$(O)pckeys.o : $(HACK_H) $(MSYS)/pckeys.c +$(O)pctiles.o : $(HACK_H) $(MSYS)/pctiles.c $(MSYS)/portio.h + $(TARGET_CC) $(cflags) -I$(MSYS) -I$(WSHR) -o$@ $(MSYS)/pctiles.c +$(O)sound.o : $(HACK_H) $(MSYS)/sound.c $(MSYS)/portio.h +$(O)video.o : $(HACK_H) $(MSYS)/pcvideo.h $(MSYS)/portio.h $(MSYS)/video.c +$(O)vidvga.o : $(HACK_H) $(MSYS)/pcvideo.h $(MSYS)/portio.h $(TILE_H) $(MSYS)/vidvga.c + $(TARGET_CC) $(cflags) -I$(MSYS) -I$(WSHR) -o$@ $(MSYS)/vidvga.c +$(O)vidvesa.o : $(HACK_H) $(MSYS)/pcvideo.h $(MSYS)/portio.h $(TILE_H) $(MSYS)/vidvesa.c + $(TARGET_CC) $(cflags) -I$(MSYS) -I$(WSHR) -o$@ $(MSYS)/vidvesa.c +$(O)vidtxt.o : $(HACK_H) $(MSYS)/pcvideo.h $(MSYS)/portio.h $(TILE_H) $(MSYS)/vidtxt.c +$(O)stubvid.o : $(HACK_H) $(MSYS)/pcvideo.h $(MSYS)/video.c + $(TARGET_CC) $(cflags) -I$(MSYS) -DSTUBVIDEO -o$@ $(MSYS)/video.c +# +# The rest are stolen from sys/unix/Makefile.src, +# with the following changes: +# o -c (which is included in cflags) substituted with -o$@ , +# o an explicit build instruction for dlb.o because it requires +# a .h file in ../sys/msdos. +# o the PATCHLEV_H macro is substitued for $(INCL)/patchlevel.h +# to work around a long filename issue. +# o $(CFLAGS) changed to $(cflags) +# Other than that, these dependencies are untouched. +# That means that there is some irrelevant stuff +# in here, but maintenance should be easier. +# +# +# src dependencies +#$(O)tos.o: ../sys/atari/tos.c $(HACK_H) $(INCL)/tcap.h + $(TARGET_CC) $(cflags) -o$@ ../sys/atari/tos.c +$(O)pcmain.o: ../sys/share/pcmain.c $(HACK_H) $(INCL)/dlb.h \ + #$(INCL)/win32api.h + $(TARGET_CC) $(cflags) -o$@ ../sys/share/pcmain.c +$(O)pctty.o: ../sys/share/pctty.c $(HACK_H) + $(TARGET_CC) $(cflags) -o$@ ../sys/share/pctty.c +$(O)pcunix.o: ../sys/share/pcunix.c $(HACK_H) + $(TARGET_CC) $(cflags) -o$@ ../sys/share/pcunix.c +$(O)random.o: ../sys/share/random.c $(HACK_H) + $(TARGET_CC) $(cflags) -o$@ ../sys/share/random.c +$(O)ioctl.o: ../sys/share/ioctl.c $(HACK_H) $(INCL)/tcap.h + $(TARGET_CC) $(cflags) -o$@ ../sys/share/ioctl.c +$(O)unixtty.o: ../sys/share/unixtty.c $(HACK_H) + $(TARGET_CC) $(cflags) -o$@ ../sys/share/unixtty.c +$(O)unixmain.o: ../sys/unix/unixmain.c $(HACK_H) $(INCL)/dlb.h + $(TARGET_CC) $(cflags) -o$@ ../sys/unix/unixmain.c +$(O)unixunix.o: ../sys/unix/unixunix.c $(HACK_H) + $(TARGET_CC) $(cflags) -o$@ ../sys/unix/unixunix.c +$(O)unixres.o: ../sys/unix/unixres.c $(CONFIG_H) + $(TARGET_CC) $(cflags) -o$@ ../sys/unix/unixres.c +$(O)bemain.o: ../sys/be/bemain.c $(HACK_H) $(INCL)/dlb.h + $(TARGET_CC) $(cflags) -o$@ ../sys/be/bemain.c +$(O)getline.o: ../win/tty/getline.c $(HACK_H) $(INCL)/func_tab.h + $(TARGET_CC) $(cflags) -o$@ ../win/tty/getline.c +$(O)termcap.o: ../win/tty/termcap.c $(HACK_H) $(INCL)/tcap.h + $(TARGET_CC) $(cflags) -o$@ ../win/tty/termcap.c +$(O)topl.o: ../win/tty/topl.c $(HACK_H) $(INCL)/tcap.h + $(TARGET_CC) $(cflags) -o$@ ../win/tty/topl.c +$(O)wintty.o: ../win/tty/wintty.c $(HACK_H) $(INCL)/dlb.h \ + $(INCL)/date.h $(PATCHLEV_H) $(INCL)/tcap.h + $(TARGET_CC) $(cflags) -o$@ ../win/tty/wintty.c +$(O)Window.o: ../win/X11/Window.c $(INCL)/xwindowp.h $(INCL)/xwindow.h \ + $(CONFIG_H) + $(TARGET_CC) $(cflags) -o$@ ../win/X11/Window.c +$(O)dialogs.o: ../win/X11/dialogs.c $(CONFIG_H) + $(TARGET_CC) $(cflags) -o$@ ../win/X11/dialogs.c +$(O)winX.o: ../win/X11/winX.c $(HACK_H) $(INCL)/winX.h $(INCL)/dlb.h \ + $(PATCHLEV_H) ../win/X11/nh72icon \ + ../win/X11/nh56icon ../win/X11/nh32icon + $(TARGET_CC) $(cflags) -o$@ ../win/X11/winX.c +$(O)winmap.o: ../win/X11/winmap.c $(INCL)/xwindow.h $(HACK_H) $(INCL)/dlb.h \ + $(INCL)/winX.h $(INCL)/tile2x11.h + $(TARGET_CC) $(cflags) -o$@ ../win/X11/winmap.c +$(O)winmenu.o: ../win/X11/winmenu.c $(HACK_H) $(INCL)/winX.h + $(TARGET_CC) $(cflags) -o$@ ../win/X11/winmenu.c +$(O)winmesg.o: ../win/X11/winmesg.c $(INCL)/xwindow.h $(HACK_H) $(INCL)/winX.h + $(TARGET_CC) $(cflags) -o$@ ../win/X11/winmesg.c +$(O)winmisc.o: ../win/X11/winmisc.c $(HACK_H) $(INCL)/func_tab.h \ + $(INCL)/winX.h + $(TARGET_CC) $(cflags) -o$@ ../win/X11/winmisc.c +$(O)winstat.o: ../win/X11/winstat.c $(HACK_H) $(INCL)/winX.h + $(TARGET_CC) $(cflags) -o$@ ../win/X11/winstat.c +$(O)wintext.o: ../win/X11/wintext.c $(HACK_H) $(INCL)/winX.h $(INCL)/xwindow.h + $(TARGET_CC) $(cflags) -o$@ ../win/X11/wintext.c +$(O)winval.o: ../win/X11/winval.c $(HACK_H) $(INCL)/winX.h + $(TARGET_CC) $(cflags) -o$@ ../win/X11/winval.c +$(O)tile.o: tile.c $(HACK_H) +$(HOST_O)tile.o: tile.c $(HACK_H) +$(O)gnaskstr.o: ../win/gnome/gnaskstr.c ../win/gnome/gnaskstr.h \ + ../win/gnome/gnmain.h + $(TARGET_CC) $(cflags) $(GNOMEINC) -o$@ ../win/gnome/gnaskstr.c +$(O)gnbind.o: ../win/gnome/gnbind.c ../win/gnome/gnbind.h ../win/gnome/gnmain.h \ + ../win/gnome/gnaskstr.h ../win/gnome/gnyesno.h + $(TARGET_CC) $(cflags) $(GNOMEINC) -o$@ ../win/gnome/gnbind.c +$(O)gnglyph.o: ../win/gnome/gnglyph.c ../win/gnome/gnglyph.h $(INCL)/tile2x11.h + $(TARGET_CC) $(cflags) $(GNOMEINC) -o$@ ../win/gnome/gnglyph.c +$(O)gnmain.o: ../win/gnome/gnmain.c ../win/gnome/gnmain.h ../win/gnome/gnsignal.h \ + ../win/gnome/gnbind.h ../win/gnome/gnopts.h $(HACK_H) \ + $(INCL)/date.h + $(TARGET_CC) $(cflags) $(GNOMEINC) -o$@ ../win/gnome/gnmain.c +$(O)gnmap.o: ../win/gnome/gnmap.c ../win/gnome/gnmap.h ../win/gnome/gnglyph.h \ + ../win/gnome/gnsignal.h $(HACK_H) + $(TARGET_CC) $(cflags) $(GNOMEINC) -o$@ ../win/gnome/gnmap.c +$(O)gnmenu.o: ../win/gnome/gnmenu.c ../win/gnome/gnmenu.h ../win/gnome/gnmain.h \ + ../win/gnome/gnbind.h + $(TARGET_CC) $(cflags) $(GNOMEINC) -o$@ ../win/gnome/gnmenu.c +$(O)gnmesg.o: ../win/gnome/gnmesg.c ../win/gnome/gnmesg.h ../win/gnome/gnsignal.h + $(TARGET_CC) $(cflags) $(GNOMEINC) -o$@ ../win/gnome/gnmesg.c +$(O)gnopts.o: ../win/gnome/gnopts.c ../win/gnome/gnopts.h ../win/gnome/gnglyph.h \ + ../win/gnome/gnmain.h ../win/gnome/gnmap.h $(HACK_H) + $(TARGET_CC) $(cflags) $(GNOMEINC) -o$@ ../win/gnome/gnopts.c +$(O)gnplayer.o: ../win/gnome/gnplayer.c ../win/gnome/gnplayer.h \ + ../win/gnome/gnmain.h $(HACK_H) + $(TARGET_CC) $(cflags) $(GNOMEINC) -o$@ ../win/gnome/gnplayer.c +$(O)gnsignal.o: ../win/gnome/gnsignal.c ../win/gnome/gnsignal.h \ + ../win/gnome/gnmain.h + $(TARGET_CC) $(cflags) $(GNOMEINC) -o$@ ../win/gnome/gnsignal.c +$(O)gnstatus.o: ../win/gnome/gnstatus.c ../win/gnome/gnstatus.h \ + ../win/gnome/gnsignal.h ../win/gnome/gn_xpms.h \ + ../win/gnome/gnomeprv.h + $(TARGET_CC) $(cflags) $(GNOMEINC) -o$@ ../win/gnome/gnstatus.c +$(O)gntext.o: ../win/gnome/gntext.c ../win/gnome/gntext.h ../win/gnome/gnmain.h \ + ../win/gnome/gn_rip.h + $(TARGET_CC) $(cflags) $(GNOMEINC) -o$@ ../win/gnome/gntext.c +$(O)gnworn.o: ../win/gnome/gnworn.c ../win/gnome/gnworn.h ../win/gnome/gnglyph.h \ + ../win/gnome/gnsignal.h ../win/gnome/gnomeprv.h + $(TARGET_CC) $(cflags) $(GNOMEINC) -o$@ ../win/gnome/gnworn.c +$(O)gnyesno.o: ../win/gnome/gnyesno.c ../win/gnome/gnbind.h ../win/gnome/gnyesno.h + $(TARGET_CC) $(cflags) $(GNOMEINC) -o$@ ../win/gnome/gnyesno.c +$(O)wingem.o: ../win/gem/wingem.c $(HACK_H) $(INCL)/func_tab.h $(INCL)/dlb.h \ + $(PATCHLEV_H) $(INCL)/wingem.h + $(TARGET_CC) $(cflags) -o$@ ../win/gem/wingem.c +$(O)wingem1.o: ../win/gem/wingem1.c $(INCL)/gem_rsc.h $(INCL)/load_img.h \ + $(INCL)/gr_rect.h $(INCL)/wintype.h $(INCL)/wingem.h + $(TARGET_CC) $(cflags) -o$@ ../win/gem/wingem1.c +$(O)load_img.o: ../win/gem/load_img.c $(INCL)/load_img.h + $(TARGET_CC) $(cflags) -o$@ ../win/gem/load_img.c +$(O)gr_rect.o: ../win/gem/gr_rect.c $(INCL)/gr_rect.h + $(TARGET_CC) $(cflags) -o$@ ../win/gem/gr_rect.c +$(O)tile.o: tile.c $(HACK_H) +$(O)qt_win.o: ../win/Qt/qt_win.cpp $(HACK_H) $(INCL)/func_tab.h \ + $(INCL)/dlb.h $(PATCHLEV_H) $(INCL)/tile2x11.h \ + $(INCL)/qt_win.h $(INCL)/qt_clust.h $(INCL)/qt_kde0.h \ + $(INCL)/qt_xpms.h qt_win.moc qt_kde0.moc qttableview.moc + $(CXX) $(CXXFLAGS) -o$@ ../win/Qt/qt_win.cpp +$(O)qt_clust.o: ../win/Qt/qt_clust.cpp $(INCL)/qt_clust.h + $(CXX) $(CXXFLAGS) -o$@ ../win/Qt/qt_clust.cpp +$(O)qttableview.o: ../win/Qt/qttableview.cpp $(INCL)/qttableview.h + $(CXX) $(CXXFLAGS) -o$@ ../win/Qt/qttableview.cpp +#$(O)monstr.o: monstr.c $(CONFIG_H) +$(O)vis_tab.o: vis_tab.c $(CONFIG_H) $(INCL)/vis_tab.h +$(O)allmain.o: allmain.c $(HACK_H) +$(O)alloc.o: alloc.c $(CONFIG_H) +$(O)apply.o: apply.c $(HACK_H) +$(O)artifact.o: artifact.c $(HACK_H) $(INCL)/artifact.h $(INCL)/artilist.h +$(O)attrib.o: attrib.c $(HACK_H) +$(O)ball.o: ball.c $(HACK_H) +$(O)bones.o: bones.c $(HACK_H) $(INCL)/lev.h +$(O)botl.o: botl.c $(HACK_H) +$(O)cmd.o: cmd.c $(HACK_H) $(INCL)/func_tab.h +$(O)dbridge.o: dbridge.c $(HACK_H) +$(O)decl.o: decl.c $(HACK_H) +$(O)detect.o: detect.c $(HACK_H) $(INCL)/artifact.h +$(O)dig.o: dig.c $(HACK_H) +$(O)display.o: display.c $(HACK_H) +$(O)dlb.o: dlb.c $(CONFIG_H) $(INCL)/dlb.h + $(TARGET_CC) $(cflags) -I../sys/msdos -o$@ dlb.c +$(O)do.o: do.c $(HACK_H) $(INCL)/lev.h +$(O)do_name.o: do_name.c $(HACK_H) +$(O)do_wear.o: do_wear.c $(HACK_H) +$(O)dog.o: dog.c $(HACK_H) +$(O)dogmove.o: dogmove.c $(HACK_H) $(INCL)/mfndpos.h +$(O)dokick.o: dokick.c $(HACK_H) +$(O)dothrow.o: dothrow.c $(HACK_H) +$(O)drawing.o: drawing.c $(HACK_H) $(INCL)/tcap.h +$(O)dungeon.o: dungeon.c $(HACK_H) $(INCL)/dgn_file.h $(INCL)/dlb.h +$(O)eat.o: eat.c $(HACK_H) +$(O)end.o: end.c $(HACK_H) $(INCL)/lev.h $(INCL)/dlb.h +$(O)engrave.o: engrave.c $(HACK_H) $(INCL)/lev.h +$(O)exper.o: exper.c $(HACK_H) +$(O)explode.o: explode.c $(HACK_H) +$(O)extralev.o: extralev.c $(HACK_H) +$(O)files.o: files.c $(HACK_H) $(INCL)/dlb.h +$(O)fountain.o: fountain.c $(HACK_H) +$(O)hack.o: hack.c $(HACK_H) +$(O)hacklib.o: hacklib.c $(HACK_H) +$(O)invent.o: invent.c $(HACK_H) +$(O)light.o: light.c $(HACK_H) $(INCL)/lev.h +$(O)lock.o: lock.c $(HACK_H) +$(O)mail.o: mail.c $(HACK_H) $(INCL)/mail.h +$(O)makemon.o: makemon.c $(HACK_H) +$(O)mapglyph.o: mapglyph.c $(HACK_H) +$(O)mcastu.o: mcastu.c $(HACK_H) +$(O)mhitm.o: mhitm.c $(HACK_H) $(INCL)/artifact.h +$(O)mhitu.o: mhitu.c $(HACK_H) $(INCL)/artifact.h +$(O)minion.o: minion.c $(HACK_H) +$(O)mklev.o: mklev.c $(HACK_H) +$(O)mkmap.o: mkmap.c $(HACK_H) $(INCL)/sp_lev.h +$(O)mkmaze.o: mkmaze.c $(HACK_H) $(INCL)/sp_lev.h $(INCL)/lev.h +$(O)mkobj.o: mkobj.c $(HACK_H) +$(O)mkroom.o: mkroom.c $(HACK_H) +$(O)mon.o: mon.c $(HACK_H) $(INCL)/mfndpos.h +$(O)mondata.o: mondata.c $(HACK_H) +$(O)monmove.o: monmove.c $(HACK_H) $(INCL)/mfndpos.h $(INCL)/artifact.h +$(O)monst.o: monst.c $(CONFIG_H) $(INCL)/permonst.h $(INCL)/align.h \ + $(INCL)/monattk.h $(INCL)/monflag.h $(INCL)/monsym.h \ + $(INCL)/color.h +$(O)mplayer.o: mplayer.c $(HACK_H) +$(O)mthrowu.o: mthrowu.c $(HACK_H) +$(O)muse.o: muse.c $(HACK_H) +$(O)music.o: music.c $(HACK_H) #interp.c +$(O)o_init.o: o_init.c $(HACK_H) $(INCL)/lev.h +$(O)objects.o: objects.c $(CONFIG_H) $(INCL)/obj.h $(INCL)/objclass.h \ + $(INCL)/prop.h $(INCL)/skills.h $(INCL)/color.h +$(O)objnam.o: objnam.c $(HACK_H) +$(O)options.o: options.c $(CONFIG_H) $(INCL)/objclass.h $(INCL)/flag.h \ + $(HACK_H) $(INCL)/tcap.h +$(O)pager.o: pager.c $(HACK_H) $(INCL)/dlb.h +$(O)pickup.o: pickup.c $(HACK_H) +$(O)pline.o: pline.c $(HACK_H) +$(O)polyself.o: polyself.c $(HACK_H) +$(O)potion.o: potion.c $(HACK_H) +$(O)pray.o: pray.c $(HACK_H) +$(O)priest.o: priest.c $(HACK_H) $(INCL)/mfndpos.h +$(O)quest.o: quest.c $(HACK_H) $(INCL)/qtext.h +$(O)questpgr.o: questpgr.c $(HACK_H) $(INCL)/dlb.h $(INCL)/qtext.h +$(O)read.o: read.c $(HACK_H) +$(O)rect.o: rect.c $(HACK_H) +$(O)region.o: region.c $(HACK_H) $(INCL)/lev.h +$(O)restore.o: restore.c $(HACK_H) $(INCL)/lev.h $(INCL)/tcap.h +$(O)rip.o: rip.c $(HACK_H) +$(O)rnd.o: rnd.c $(HACK_H) +$(O)role.o: role.c $(HACK_H) +$(O)rumors.o: rumors.c $(HACK_H) $(INCL)/lev.h $(INCL)/dlb.h +$(O)save.o: save.c $(HACK_H) $(INCL)/lev.h +$(O)shk.o: shk.c $(HACK_H) +$(O)shknam.o: shknam.c $(HACK_H) +$(O)sit.o: sit.c $(HACK_H) $(INCL)/artifact.h +$(O)sounds.o: sounds.c $(HACK_H) +$(O)sp_lev.o: sp_lev.c $(HACK_H) $(INCL)/dlb.h $(INCL)/sp_lev.h +$(O)spell.o: spell.c $(HACK_H) +$(O)steal.o: steal.c $(HACK_H) +$(O)steed.o: steed.c $(HACK_H) +$(O)sys.o: sys.c $(HACK_H) +$(O)teleport.o: teleport.c $(HACK_H) +$(O)timeout.o: timeout.c $(HACK_H) $(INCL)/lev.h +$(O)topten.o: topten.c $(HACK_H) $(INCL)/dlb.h $(PATCHLEV_H) +$(O)track.o: track.c $(HACK_H) +$(O)trap.o: trap.c $(HACK_H) +$(O)u_init.o: u_init.c $(HACK_H) +$(O)uhitm.o: uhitm.c $(HACK_H) +$(O)vault.o: vault.c $(HACK_H) +$(O)version.o: version.c $(HACK_H) $(INCL)/date.h $(PATCHLEV_H) +$(O)vision.o: vision.c $(HACK_H) $(INCL)/vis_tab.h +$(O)weapon.o: weapon.c $(HACK_H) +$(O)were.o: were.c $(HACK_H) +$(O)wield.o: wield.c $(HACK_H) +$(O)windows.o: windows.c $(HACK_H) $(INCL)/wingem.h $(INCL)/winGnome.h +$(O)wizard.o: wizard.c $(HACK_H) $(INCL)/qtext.h +$(O)worm.o: worm.c $(HACK_H) $(INCL)/lev.h +$(O)worn.o: worn.c $(HACK_H) +$(O)write.o: write.c $(HACK_H) +$(O)zap.o: zap.c $(HACK_H) +$(O)pmatchre.o: $(SSHR)/pmatchre.c $(HACK_H) +$(O)tileset.o: $(WSHR)/tileset.c $(HACK_H) +$(O)bmptiles.o: $(WSHR)/bmptiles.c $(INCL)/config.h $(INCL)/tileset.h $(INCL)/integer.h +$(O)giftiles.o: $(WSHR)/giftiles.c $(INCL)/config.h $(INCL)/tileset.h $(INCL)/integer.h + +# end of file + diff --git a/sys/share/pcmain.c b/sys/share/pcmain.c index 83649856a..477ce34a3 100644 --- a/sys/share/pcmain.c +++ b/sys/share/pcmain.c @@ -15,13 +15,11 @@ #include -#if !defined(AMIGA) && !defined(GNUDOS) +#if !defined(AMIGA) && !defined(__DJGPP__) #include #else -#ifdef GNUDOS #include #endif -#endif #ifdef __DJGPP__ #include /* for getcwd() prototype */ diff --git a/sys/winnt/windmain.c b/sys/winnt/windmain.c index c65a8037d..28f823164 100644 --- a/sys/winnt/windmain.c +++ b/sys/winnt/windmain.c @@ -24,7 +24,7 @@ static void FDECL(process_options, (int argc, char **argv)); static void NDECL(nhusage); static char *NDECL(get_executable_path); -char *FDECL(translate_path_variables, (char *, char *)); +char *FDECL(translate_path_variables, (const char *, char *)); char *NDECL(exename); boolean NDECL(fakeconsole); void NDECL(freefakeconsole); diff --git a/win/curses/cursdial.c b/win/curses/cursdial.c index f4044c598..72c5f23e7 100644 --- a/win/curses/cursdial.c +++ b/win/curses/cursdial.c @@ -759,11 +759,10 @@ curses_display_nhmenu(winid wid, int how, MENU_ITEM_P ** _selected) menu_determine_pages(current_menu); /* Display pre and post-game menus centered */ - if (((g.moves <= 1) && !g.invent) || g.program_state.gameover) { + if ((g.moves <= 1 && !g.invent) || g.program_state.gameover) { win = curses_create_window(current_menu->width, current_menu->height, CENTER); } else { /* Display during-game menus on the right out of the way */ - win = curses_create_window(current_menu->width, current_menu->height, RIGHT); } @@ -1000,13 +999,13 @@ static void menu_win_size(nhmenu *menu) { int maxwidth, maxheight, curentrywidth, lastline; - int maxentrywidth = (int) strlen(menu->prompt); - int maxheaderwidth = 0; + int maxentrywidth = 0; + int maxheaderwidth = menu->prompt ? (int) strlen(menu->prompt) : 0; nhmenu_item *menu_item_ptr; if (g.program_state.gameover) { /* for final inventory disclosure, use full width */ - maxwidth = term_cols - 2; + maxwidth = term_cols - 2; /* +2: borders assumed */ } else { /* this used to be 38, which is 80/2 - 2 (half a 'normal' sized screen minus room for a border box), but some data files @@ -1029,7 +1028,7 @@ menu_win_size(nhmenu *menu) maxheaderwidth = curentrywidth; } } else { - /* Add space for accelerator */ + /* Add space for accelerator (selector letter) */ curentrywidth += 4; #if 0 /* FIXME: menu glyphs */ if (menu_item_ptr->glyph != NO_GLYPH && iflags.use_menu_glyphs) @@ -1041,20 +1040,20 @@ menu_win_size(nhmenu *menu) } } - /* If widest entry is smaller than maxwidth, reduce maxwidth - accordingly (but not too far; minimum width will be applied below) */ - if (maxentrywidth < maxwidth) { - maxwidth = maxentrywidth; - } - - /* Try not to wrap headers/normal text lines if possible. We can - go wider than half the screen for this purpose if need be */ - - if (maxheaderwidth > maxwidth) { - if (maxheaderwidth < (term_cols - 2)) - maxwidth = maxheaderwidth; - else - maxwidth = term_cols - 2; + /* + * 3.6.3: This used to set maxwidth to maxheaderwidth when that was + * bigger but only set it to maxentrywidth if the latter was smaller, + * so entries wider than the default would always wrap unless at + * least one header or separator line was long, even when there was + * lots of space available to display them without wrapping. The + * reason to force narrow menus isn't known. It may have been to + * reduce the amount of map rewriting when menu is dismissed, but if + * so, that was an issue due to excessive screen writing for the map + * (output was flushed for each character) which was fixed long ago. + */ + maxwidth = max(maxentrywidth, maxheaderwidth); + if (maxwidth > term_cols - 2) { /* -2: space for left and right borders */ + maxwidth = term_cols - 2; } /* Possibly reduce height if only 1 page */ diff --git a/win/curses/cursmain.c b/win/curses/cursmain.c index 3561ddc1e..aaf343f3f 100644 --- a/win/curses/cursmain.c +++ b/win/curses/cursmain.c @@ -24,6 +24,15 @@ extern char erase_char, kill_char; extern long curs_mesg_suppress_turn; /* from cursmesg.c */ +/* stubs for curses_procs{} */ +#ifdef POSITIONBAR +static void dummy_update_position_bar(char *); +#endif +#ifdef CHANGE_COLOR +static void dummy_change_color(int, long, int); +static char *dummy_get_color_string(VOID_ARGS); +#endif + /* Public functions for curses NetHack interface */ /* Interface definition, for windows.c */ @@ -69,7 +78,7 @@ struct window_procs curses_procs = { curses_cliparound, #endif #ifdef POSITIONBAR - donull, + dummy_update_position_bar, #endif curses_print_glyph, curses_raw_print, @@ -83,9 +92,13 @@ struct window_procs curses_procs = { curses_get_ext_cmd, curses_number_pad, curses_delay_output, -#ifdef CHANGE_COLOR /* only a Mac option currently */ - donull, - donull, +#ifdef CHANGE_COLOR + dummy_change_color, +#ifdef MAC /* old OS 9, not OSX */ + (void (*)(int)) 0, + (short (*)(winid, char *)) 0, +#endif + dummy_get_color_string, #endif curses_start_screen, curses_end_screen, @@ -945,4 +958,28 @@ curs_reset_windows(boolean redo_main, boolean redo_status) } } +/* stubs for curses_procs{} */ + +#ifdef POSITIONBAR +static void +dummy_update_position_bar(char *arg UNUSED) +{ + return; +} +#endif + +#ifdef CHANGE_COLOR +static void +dummy_change_color(int a1 UNUSED, long a2 UNUSED, int a3 UNUSED) +{ + return; +} + +static char * +dummy_get_color_string(VOID_ARGS) +{ + return (char *) 0; +} +#endif + /*cursmain.c*/