From f8ea34489f15e909e552d83ec6c7b5119dc33c33 Mon Sep 17 00:00:00 2001 From: Ingo Paschke Date: Mon, 11 May 2026 15:29:32 +0200 Subject: [PATCH 01/20] Amiga: fix three latent bugs found in code review amiv_lprint_glyph used uninitialized 'base'; amii_clear_nhwindow compared cw->type to a winid; amii_sethipens fell through. --- sys/amiga/winchar.c | 2 +- sys/amiga/winfuncs.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/amiga/winchar.c b/sys/amiga/winchar.c index 0c9dbc6b2..1b62c390f 100644 --- a/sys/amiga/winchar.c +++ b/sys/amiga/winchar.c @@ -563,7 +563,7 @@ amiv_flush_glyph_buffer(struct Window *vw) void amiv_lprint_glyph(winid window, int color_index, int glyph) { - int base; + int base = 0; struct amii_WinDesc *cw; struct Window *w; int curx; diff --git a/sys/amiga/winfuncs.c b/sys/amiga/winfuncs.c index db32e2e8b..788964b77 100644 --- a/sys/amiga/winfuncs.c +++ b/sys/amiga/winfuncs.c @@ -1354,6 +1354,7 @@ amii_sethipens(struct Window *w, int type, int attr) case NHW_TEXT: SetAPen(w->RPort, attr ? C_BLACK : amii_textAPen); SetBPen(w->RPort, amii_textBPen); + break; case -2: SetBPen(w->RPort, amii_otherBPen); SetAPen(w->RPort, attr ? C_RED : amii_otherAPen); @@ -1445,7 +1446,7 @@ amii_clear_nhwindow(winid win) /* Clear the overview window too if it is displayed */ if (WINVERS_AMIV - && (cw->type == WIN_MAP && WIN_OVER != WIN_ERR && reclip == 0)) { + && (cw->type == NHW_MAP && WIN_OVER != WIN_ERR && reclip == 0)) { amii_clear_nhwindow(WIN_OVER); } From 22ddba7c1e0f7d95195d1308a6b9e2163c2e20c4 Mon Sep 17 00:00:00 2001 From: Ingo Paschke Date: Mon, 11 May 2026 15:47:45 +0200 Subject: [PATCH 02/20] Amiga: more review fixes - NHW_BASE / NHW_OVER collided with NHW_PERMINVENT=6; renumber off NHW_LAST_TYPE. - GlyphToIcon used > 10000 instead of >=. - make_menu_items sized array by sizeof(amii_menu_item) instead of menu_item. - DoMenuScroll could deref NULL amip on SELECTUP. - get_nhuuid uses ISAAC64 rn2() instead of hand-rolled LCG. - fopenp's bound check fired one byte too late. - winami.p had stale signatures for amii_end_menu, amii_select_menu, amii_suspend_nhwindows. --- include/winami.h | 4 ++-- sys/amiga/amidos.c | 21 +++++---------------- sys/amiga/winamenu.c | 6 +++--- sys/amiga/winami.c | 5 +++++ sys/amiga/winami.p | 6 +++--- sys/amiga/winchar.c | 2 +- 6 files changed, 19 insertions(+), 25 deletions(-) diff --git a/include/winami.h b/include/winami.h index 686d37f91..913b130c3 100644 --- a/include/winami.h +++ b/include/winami.h @@ -117,8 +117,8 @@ typedef struct WEVENT { /* port specific variable declarations */ extern winid WIN_BASE; extern winid WIN_OVER; -#define NHW_BASE 6 -#define NHW_OVER 7 /* overview window */ +#define NHW_BASE (NHW_LAST_TYPE + 1) +#define NHW_OVER (NHW_LAST_TYPE + 2) /* overview window */ extern struct amii_WinDesc *amii_wins[MAXWIN + 1]; diff --git a/sys/amiga/amidos.c b/sys/amiga/amidos.c index c06fc1b1c..9de6a0810 100644 --- a/sys/amiga/amidos.c +++ b/sys/amiga/amidos.c @@ -47,30 +47,19 @@ amiga_self_assign(void) UnLock(dup); } -/* Generate an RFC 4122 v4 UUID for this game. Entropy comes from - DateStamp + the running task's address mixed through a small LCG. */ +/* Generate an RFC 4122 v4 UUID for this game. Draw bytes from the + core's ISAAC64 RNG, which init_random() seeded before we get here. */ void get_nhuuid(void) { uchar bytes[16]; - struct DateStamp ds; - unsigned long x; int i; if (svn.nhuuid[0]) return; - DateStamp(&ds); - x = (unsigned long) ds.ds_Days - ^ ((unsigned long) ds.ds_Minute << 16) - ^ ((unsigned long) ds.ds_Tick << 8) - ^ (unsigned long) FindTask(NULL); - /* Classic glibc/POSIX rand() LCG (Knuth, C99 7.22.2.1). Full period - 2^32; we read bits 16-23 to skip the LCG's bad low bits. */ - for (i = 0; i < 16; i++) { - x = x * 1103515245u + 12345u; - bytes[i] = (uchar) (x >> 16); - } + for (i = 0; i < 16; i++) + bytes[i] = (uchar) rn2(256); /* RFC 4122: version=4 (random), variant=10. */ bytes[6] = (bytes[6] & 0x0F) | 0x40; bytes[8] = (bytes[8] & 0x3F) | 0x80; @@ -481,7 +470,7 @@ fopenp(const char *name, const char *mode) while (pp && *pp) { bp = buf; while (*pp && *pp != PATHSEP) { - if (bp > buf + BUFSIZ - 1) + if (bp >= buf + BUFSIZ - 1) return (NULL); lastch = *bp++ = *pp++; } diff --git a/sys/amiga/winamenu.c b/sys/amiga/winamenu.c index 9cc2a0fb3..6d2310bc4 100644 --- a/sys/amiga/winamenu.c +++ b/sys/amiga/winamenu.c @@ -215,7 +215,7 @@ make_menu_items(struct amii_WinDesc *cw, menu_item **rmip) } if (idx) { - mmip = *rmip = (menu_item *) alloc(idx * sizeof(*mip)); + mmip = *rmip = (menu_item *) alloc(idx * sizeof(menu_item)); for (mip = cw->menu.items; mip; mip = mip->next) { if (mip->selected) { mmip->item = mip->identifier; @@ -982,8 +982,8 @@ DoMenuScroll(int win, int blocking, int how, menu_item **retmip) amip->str[SOFF + 2] = '-'; } } - if (counting && amip->selected && amip->canselect - && amip->selector) { + if (amip && counting && amip->selected + && amip->canselect && amip->selector) { amip->count = count; reset_counting = TRUE; amip->str[SOFF + 2] = '#'; diff --git a/sys/amiga/winami.c b/sys/amiga/winami.c index 7770a3547..e1276e986 100644 --- a/sys/amiga/winami.c +++ b/sys/amiga/winami.c @@ -340,6 +340,11 @@ struct win_setup new_wins[] = { 22, 78 }, + /* NHW_PERMINVENT — placeholder; port does not implement persistent + inventory yet, but the slot must exist because new_wins[] is + indexed by NHW_* type. */ + { { 0 } }, + /* NHW_BASE */ { { 0, 0, WIDTH, WINDOWHEIGHT, 0xff, 0xff, RAWKEY | MENUPICK | MOUSEBUTTONS, diff --git a/sys/amiga/winami.p b/sys/amiga/winami.p index dfb588177..57b9af93c 100644 --- a/sys/amiga/winami.p +++ b/sys/amiga/winami.p @@ -6,8 +6,8 @@ void amii_raw_print(const char *); void amii_raw_print_bold(const char *); void amii_start_menu(winid , unsigned long ); void amii_add_menu(winid, const glyph_info *, const anything *, char, char, int, int, const char *, unsigned int); -void amii_end_menu(winid , char , const char * , const char *); -char amii_select_menu(winid ); +void amii_end_menu(winid, const char *); +int amii_select_menu(winid, int, menu_item **); void amii_update_inventory(int); void amii_mark_synch (void); void amii_wait_synch (void); @@ -46,7 +46,7 @@ void cursor_on(winid ); void amii_getret (void); void amii_getlin(const char * , char *); void getlind(const char * , char * , const char *); -void amii_suspend_nhwindows(char * ); +void amii_suspend_nhwindows(const char *); void amii_resume_nhwindows(void); void amii_bell(void); void EditColor(void); diff --git a/sys/amiga/winchar.c b/sys/amiga/winchar.c index 1b62c390f..7e17ea574 100644 --- a/sys/amiga/winchar.c +++ b/sys/amiga/winchar.c @@ -805,7 +805,7 @@ GlyphToIcon(int glyph) glyph_info gi; map_glyphinfo(0, 0, glyph, 0, &gi); - if (glyph > 10000) + if (glyph >= 10000) return glyph; return (gi.gm.tileidx); } From f0b6ddc6f8680eb1f4150276ee7c381230be2760 Mon Sep 17 00:00:00 2001 From: Ingo Paschke Date: Mon, 11 May 2026 15:55:03 +0200 Subject: [PATCH 03/20] Amiga: drop legacy non-gcc compiler guards Remove AZTEC_C, _DCC, SASC, LATTICE, MANX arms. The port targets bebbo gcc. --- sys/amiga/amidos.c | 9 --------- sys/amiga/amigst.c | 15 --------------- sys/amiga/amirip.c | 16 ---------------- sys/amiga/amistack.c | 19 ++----------------- sys/amiga/amitty.c | 7 ------- sys/amiga/amiwind.c | 28 ---------------------------- sys/amiga/winami.c | 12 +----------- sys/amiga/winchar.c | 2 -- sys/amiga/windefs.h | 44 -------------------------------------------- sys/amiga/winfuncs.c | 22 ---------------------- 10 files changed, 3 insertions(+), 171 deletions(-) diff --git a/sys/amiga/amidos.c b/sys/amiga/amidos.c index 9de6a0810..47b793762 100644 --- a/sys/amiga/amidos.c +++ b/sys/amiga/amidos.c @@ -20,10 +20,8 @@ #undef COUNT -#if defined(__SASC_60) || defined(__GNUC__) #include #include -#endif /* POSIX stubs needed by libnix (-noixemul) */ #ifdef __noixemul__ @@ -85,11 +83,6 @@ free_nhuuid(void) } } -#ifdef AZTEC_50 -#include -#undef strcmpi -#endif - /* Prototypes */ #ifndef CROSS_TO_AMIGA #include "NH:sys/amiga/amiwind.p" @@ -107,9 +100,7 @@ extern struct window_procs amii_procs; struct ami_sysflags sysflags = {0}; FILE *fopenp(const char *, const char *); -#ifndef __SASC_60 int Enable_Abort = 0; /* for stdio package */ -#endif /* Initial path, so we can find NetHack.cnf */ char PATH[PATHLEN] = "NetHack:"; diff --git a/sys/amiga/amigst.c b/sys/amiga/amigst.c index 8f6a74f64..6e6697111 100644 --- a/sys/amiga/amigst.c +++ b/sys/amiga/amigst.c @@ -17,25 +17,10 @@ #include #include -#ifdef __SASC -#include /* for __emit */ -#include -#include -#include -#include -#include -#include -#include -#endif - #include "hack.h" #include "winprocs.h" #include "winami.h" -#ifdef AZTEC -#include -#endif - #ifndef CROSS_TO_AMIGA #include "NH:sys/amiga/winami.p" #include "NH:sys/amiga/amiwind.p" diff --git a/sys/amiga/amirip.c b/sys/amiga/amirip.c index 5f4aa52af..6c23a4f6c 100644 --- a/sys/amiga/amirip.c +++ b/sys/amiga/amirip.c @@ -28,20 +28,10 @@ static struct RastPort *rp; #undef NULL #define NULL 0 -#ifdef AZTEC_C -#include -#else -#ifdef _DCC -#include -#include -#include -#include -#else #include #include #include #include -#endif static BitMapHeader tomb_bmhd; static struct BitMap *tombimg = NULL; @@ -58,14 +48,8 @@ static int xoff, yoff; /* image centering */ #undef red #undef green #undef blue -#ifdef _DCC -#include -#include -#else #include #include -#endif -#endif /* AZTEC_C */ static struct Window *ripwin = 0; static void tomb_text(char *); diff --git a/sys/amiga/amistack.c b/sys/amiga/amistack.c index 690bea07c..50abff355 100644 --- a/sys/amiga/amistack.c +++ b/sys/amiga/amistack.c @@ -2,30 +2,15 @@ /* Copyright (c) Janne Salmijärvi, Tampere, Finland, 2000 */ /* NetHack may be freely redistributed. See license for details. */ -/* - * Increase stack size to allow deep recursions. - * - * Note: This is SAS/C specific, using other compiler probably - * requires another method for increasing stack. - * - */ - -#ifdef __SASC_60 -#include -#endif - /* * Increase stack size to allow deep recursions. * NetHack 5.0 with Lua needs significantly more stack than 3.6. + * + * libnix needs __stkinit referenced to pull swapstack.o from libnix.a. */ -#ifdef __SASC_60 -long __stack = 256 * 1024; -#else -/* libnix needs __stkinit referenced to pull swapstack.o from libnix.a */ unsigned long __stack = 256 * 1024; #ifdef CROSS_TO_AMIGA extern void __stkinit(void); void *__nh_force_stkinit = __stkinit; #endif -#endif diff --git a/sys/amiga/amitty.c b/sys/amiga/amitty.c index 22036c8f5..e47f3b693 100644 --- a/sys/amiga/amitty.c +++ b/sys/amiga/amitty.c @@ -13,13 +13,6 @@ #include #include -#ifdef _DCC -#define getch() getchar() -#endif -#ifdef __SASC_60 -#include -#endif - void tty_change_color(void); char *tty_get_color_string(void); diff --git a/sys/amiga/amiwind.c b/sys/amiga/amiwind.c index d931697b7..beaf3cb89 100644 --- a/sys/amiga/amiwind.c +++ b/sys/amiga/amiwind.c @@ -711,7 +711,6 @@ amii_cleanup(void) void Abort(long rc) { - int fault = 1; #ifdef CHDIR extern char orgdir[]; chdir(orgdir); @@ -724,38 +723,11 @@ Abort(long rc) } else #endif printf("\n\nAbort with alert code %08lx...\n", rc); -/* Alert(rc); this is too severe */ -#ifdef __SASC -#ifdef INTUI_NEW_LOOK - if (IntuitionBase->LibNode.lib_Version >= 37) { - struct EasyStruct es = { - sizeof(struct EasyStruct), 0, "NetHack Panic Request", - "NetHack is Aborting with code == 0x%08lx", - "Continue Abort|Return to Program|Clean up and exit", - }; - fault = EasyRequest(NULL, &es, NULL, (long) rc); - if (fault == 2) - return; - } -#endif - if (fault == 1) { - /* __emit(0x4afc); */ /* illegal instruction */ - __emit(0x40fc); /* divide by */ - __emit(0x0000); /* #0 */ - /* NOTE: don't move amii_cleanup() above here - */ - /* it is too likely to kill the system */ - /* before it can get the SnapShot out, if */ - /* there is something really wrong. */ - } -#endif #ifdef AMII_GRAPHICS if (windowprocs.win_init_nhwindows == amii_procs.win_init_nhwindows) amii_cleanup(); #endif #undef exit -#ifdef AZTEC_C - _abort(); -#endif exit((int) rc); } diff --git a/sys/amiga/winami.c b/sys/amiga/winami.c index e1276e986..c190a7c39 100644 --- a/sys/amiga/winami.c +++ b/sys/amiga/winami.c @@ -1161,17 +1161,7 @@ amii_display_file(const char *fn, boolean complain) if ((fp = dlb_fopen(fn, RDTMODE)) == (dlb *) NULL) { if (complain) { - sprintf(buf, "Can't display %s: %s", fn, -#if defined(_DCC) || defined(__GNUC__) - strerror(errno) -#else -#ifdef __SASC_60 - __sys_errlist[errno] -#else - sys_errlist[errno] -#endif -#endif - ); + sprintf(buf, "Can't display %s: %s", fn, strerror(errno)); amii_addtopl(buf); } return; diff --git a/sys/amiga/winchar.c b/sys/amiga/winchar.c index 7e17ea574..c2281c914 100644 --- a/sys/amiga/winchar.c +++ b/sys/amiga/winchar.c @@ -7,9 +7,7 @@ #include #include #include -#ifndef _DCC #include -#endif #ifdef TESTING #include "hack.h" diff --git a/sys/amiga/windefs.h b/sys/amiga/windefs.h index cb6cbd3db..617c095f1 100644 --- a/sys/amiga/windefs.h +++ b/sys/amiga/windefs.h @@ -5,9 +5,6 @@ #include #include #include -#if !defined(_DCC) && !defined(__GNUC__) -#include -#endif #include #include #include @@ -19,25 +16,10 @@ #include #include #include -/* stddef.h is included in the precompiled version of hack.h . If we include - * it here normally (through string.h) we'll get an "illegal typedef" later - * on. This is the easiest way I can think of to fix it without messing - * around with the rest of the #includes. --AMC - */ -#if defined(_DCC) && !defined(HACK_H) -#define ptrdiff_t ptrdiff_t_ -#define size_t size_t_ -#define wchar_t wchar_t_ -#endif #include #undef strcmpi #include #include -#if defined(_DCC) && !defined(HACK_H) -#undef ptrdiff_t -#undef size_t -#undef wchar_T -#endif #ifdef IDCMP_CLOSEWINDOW #ifndef INTUI_NEW_LOOK @@ -62,17 +44,6 @@ CLIPPING must be defined for the AMIGA version /*#define TOPL_GETLINE /* Don't use a window for getlin() */ /*#define WINDOW_YN /* Use a window for y/n questions */ -#ifdef AZTEC_C -#include -#else -#ifdef _DCC -#include -#include -#include -#include -#include -#include -#else #include #include #include @@ -80,28 +51,13 @@ CLIPPING must be defined for the AMIGA version #include #include #include -#endif /* kludge - see amirip for why */ #undef red #undef green #undef blue -#ifdef _DCC -#include -#else #include -#endif - -#ifdef _DCC -#define __asm /* DICE doesn't like __asm */ -#endif - -#ifdef _DCC -#include -#else #include -#endif -#endif #ifdef SHAREDLIB #include "NH:sys/amiga/lib/libmacs.h" diff --git a/sys/amiga/winfuncs.c b/sys/amiga/winfuncs.c index 788964b77..aec3939c7 100644 --- a/sys/amiga/winfuncs.c +++ b/sys/amiga/winfuncs.c @@ -252,7 +252,6 @@ struct FillParams { WORD offsety; }; -#ifdef __GNUC__ #ifdef __PPC__ void PPC_LayerFillHook(void); struct EmulLibEntry LayerFillHook = { TRAP_LIB, 0, @@ -281,16 +280,6 @@ void LayerFillHook_impl(struct Hook *hk, struct RastPort *rp, struct FillParams *fp) { -#endif -#else -void -#ifndef _DCC - __interrupt -#endif - __saveds __asm LayerFillHook(__a0 struct Hook *hk, - __a2 struct RastPort *rp, - __a1 struct FillParams *fp) -{ #endif long x, y, xmax, ymax; @@ -828,7 +817,6 @@ amii_create_nhwindow(int type) return (newid); } -#ifdef __GNUC__ #ifdef __PPC__ int PPC_SM_Filter(void); struct EmulLibEntry SM_Filter = { TRAP_LIB, 0, @@ -857,16 +845,6 @@ int SM_Filter_impl(struct Hook *hk, ULONG modeID, struct ScreenModeRequester *smr) { -#endif -#else -int -#ifndef _DCC - __interrupt -#endif - __saveds __asm SM_Filter( - __a0 struct Hook *hk, __a1 ULONG modeID, - __a2 struct ScreenModeRequester *smr) -{ #endif struct DimensionInfo dims; struct DisplayInfo disp; From 7b67da20b7105b80c71bb3ce6301f07669f9e58e Mon Sep 17 00:00:00 2001 From: Ingo Paschke Date: Mon, 11 May 2026 16:01:00 +0200 Subject: [PATCH 04/20] Amiga: make INTUI_NEW_LOOK unconditional OS 2.0+ Intuition is required; the pre-2.0 fallback paths are unreachable. --- include/winami.h | 10 +------ sys/amiga/amiwind.c | 5 +--- sys/amiga/winamenu.c | 4 --- sys/amiga/winami.c | 66 ++------------------------------------------ sys/amiga/windefs.h | 12 +------- sys/amiga/winfuncs.c | 16 ----------- sys/amiga/winreq.c | 31 +++------------------ 7 files changed, 9 insertions(+), 135 deletions(-) diff --git a/include/winami.h b/include/winami.h index 913b130c3..2b084a68c 100644 --- a/include/winami.h +++ b/include/winami.h @@ -59,16 +59,8 @@ struct amii_WinDesc { char *morestr; /* string to display instead of default */ /* amiga stuff */ struct Window *win; /* Intuition window pointer */ -#ifdef INTUI_NEW_LOOK - struct ExtNewWindow *newwin; /* NewWindow alloc'd */ -#else - struct NewWindow *newwin; /* ExtNewWindow alloc'd */ -#endif -#ifdef INTUI_NEW_LOOK + struct ExtNewWindow *newwin; /* NewWindow alloc'd */ struct TagItem wintags[MAXWINTAGS]; /* Tag items for this window */ -#else - long wintags[MAXWINTAGS * 2]; -#endif void *hook; /* Hook structure pointer for tiles version */ #define FLMAP_INGLYPH 1 /* An NHW_MAP window is in glyph mode */ #define FLMAP_CURSUP 2 /* An NHW_MAP window has the cursor displayed */ diff --git a/sys/amiga/amiwind.c b/sys/amiga/amiwind.c index beaf3cb89..fc33d9e29 100644 --- a/sys/amiga/amiwind.c +++ b/sys/amiga/amiwind.c @@ -630,7 +630,6 @@ amii_cleanup(void) * be visitors, so check close status and wait till everyone is gone. */ if (HackScreen) { -#ifdef INTUI_NEW_LOOK if (IntuitionBase->LibNode.lib_Version >= 37) { if (MenuStrip) FreeMenus(MenuStrip); @@ -643,9 +642,7 @@ amii_cleanup(void) }; EasyRequest(NULL, &easy, NULL, NULL); } - } else -#endif - { + } else { CloseScreen(HackScreen); } HackScreen = NULL; diff --git a/sys/amiga/winamenu.c b/sys/amiga/winamenu.c index 6d2310bc4..a6d203e65 100644 --- a/sys/amiga/winamenu.c +++ b/sys/amiga/winamenu.c @@ -271,11 +271,9 @@ DoMenuScroll(int win, int blocking, int how, menu_item **retmip) topidx = 0; if (w == NULL) { -#ifdef INTUI_NEW_LOOK if (IntuitionBase->LibNode.lib_Version >= 37) { PropScroll.Flags |= PROPNEWLOOK; } -#endif nw = (void *) DupNewWindow((void *) (&new_wins[cw->type].newwin)); if (!alwaysinvent || win != WIN_INVEN) { xsize = scrn->WBorLeft + scrn->WBorRight + MenuScroll.Width + 1 @@ -1415,11 +1413,9 @@ SetPropInfo(struct Window *win, struct Gadget *gad, long vis, long total, long t pot = 0; mflags = AUTOKNOB | FREEVERT; -#ifdef INTUI_NEW_LOOK if (IntuitionBase->LibNode.lib_Version >= 37) { mflags |= PROPNEWLOOK; } -#endif NewModifyProp(gad, win, NULL, mflags, 0, pot, MAXBODY, body, 1); } diff --git a/sys/amiga/winami.c b/sys/amiga/winami.c index c190a7c39..ec7548242 100644 --- a/sys/amiga/winami.c +++ b/sys/amiga/winami.c @@ -207,14 +207,12 @@ int wincnt = 0; /* # of nh windows opened */ * while they are playing... like compiling... */ -#ifdef INTUI_NEW_LOOK extern struct Hook fillhook; struct TagItem tags[] = { { WA_BackFill, (ULONG) &fillhook }, { WA_PubScreenName, (ULONG) "NetHack" }, { TAG_DONE, 0 }, }; -#endif /* * The default dimensions and status values for each window type. The @@ -230,16 +228,10 @@ struct win_setup new_wins[] = { { { 0, 1, 640, 11, 0xff, 0xff, NEWSIZE | GADGETUP | GADGETDOWN | MOUSEMOVE | MOUSEBUTTONS | RAWKEY, BORDERLESS | ACTIVATE | SMART_REFRESH -#ifdef INTUI_NEW_LOOK | WFLG_NW_EXTENDED -#endif , NULL, NULL, (UBYTE *) "Messages", NULL, NULL, 320, 40, 0xffff, 0xffff, -#ifdef INTUI_NEW_LOOK PUBLICSCREEN, tags -#else - CUSTOMSCREEN -#endif }, 0, 0, @@ -251,16 +243,10 @@ struct win_setup new_wins[] = { /* NHW_STATUS */ { { 0, 181, 640, 24, 0xff, 0xff, RAWKEY | MENUPICK | DISKINSERTED, BORDERLESS | ACTIVATE | SMART_REFRESH | BACKDROP -#ifdef INTUI_NEW_LOOK | WFLG_NW_EXTENDED -#endif , NULL, NULL, (UBYTE *) "Game Status", NULL, NULL, 0, 0, 0xffff, 0xffff, -#ifdef INTUI_NEW_LOOK PUBLICSCREEN, tags -#else - CUSTOMSCREEN -#endif }, 0, 0, @@ -273,17 +259,11 @@ struct win_setup new_wins[] = { { { 0, 0, WIDTH, WINDOWHEIGHT, 0xff, 0xff, RAWKEY | MENUPICK | MOUSEBUTTONS | ACTIVEWINDOW | MOUSEMOVE, BORDERLESS | ACTIVATE | SMART_REFRESH | BACKDROP -#ifdef INTUI_NEW_LOOK | WFLG_NW_EXTENDED -#endif , NULL, NULL, (UBYTE *) "Dungeon Map", NULL, NULL, 64, 64, 0xffff, 0xffff, -#ifdef INTUI_NEW_LOOK PUBLICSCREEN, tags -#else - CUSTOMSCREEN -#endif }, 0, 0, @@ -298,16 +278,10 @@ struct win_setup new_wins[] = { | GADGETDOWN | CLOSEWINDOW | VANILLAKEY | NEWSIZE | INACTIVEWINDOW, WINDOWSIZING | WINDOWCLOSE | WINDOWDRAG | ACTIVATE | SMART_REFRESH -#ifdef INTUI_NEW_LOOK | WFLG_NW_EXTENDED -#endif , &MenuScroll, NULL, NULL, NULL, NULL, 64, 32, 0xffff, 0xffff, -#ifdef INTUI_NEW_LOOK PUBLICSCREEN, tags -#else - CUSTOMSCREEN -#endif }, 0, 0, @@ -321,17 +295,11 @@ struct win_setup new_wins[] = { RAWKEY | MENUPICK | DISKINSERTED | MOUSEMOVE | GADGETUP | CLOSEWINDOW | VANILLAKEY | NEWSIZE, WINDOWSIZING | WINDOWCLOSE | WINDOWDRAG | ACTIVATE | SMART_REFRESH -#ifdef INTUI_NEW_LOOK | WFLG_NW_EXTENDED -#endif , &MenuScroll, NULL, (UBYTE *) NULL, NULL, NULL, 100, 32, 0xffff, 0xffff, -#ifdef INTUI_NEW_LOOK PUBLICSCREEN, tags -#else - CUSTOMSCREEN -#endif }, 0, 0, @@ -349,16 +317,10 @@ struct win_setup new_wins[] = { { { 0, 0, WIDTH, WINDOWHEIGHT, 0xff, 0xff, RAWKEY | MENUPICK | MOUSEBUTTONS, BORDERLESS | ACTIVATE | SMART_REFRESH | BACKDROP -#ifdef INTUI_NEW_LOOK | WFLG_NW_EXTENDED -#endif , NULL, NULL, (UBYTE *) NULL, NULL, NULL, -1, -1, 0xffff, 0xffff, -#ifdef INTUI_NEW_LOOK PUBLICSCREEN, tags -#else - CUSTOMSCREEN -#endif }, 0, 0, @@ -370,16 +332,10 @@ struct win_setup new_wins[] = { /* NHW_OVER */ { { 320, 20, 319, 179, 0xff, 0xff, RAWKEY | MENUPICK | MOUSEBUTTONS, BORDERLESS | ACTIVATE | SMART_REFRESH | BACKDROP -#ifdef INTUI_NEW_LOOK | WFLG_NW_EXTENDED -#endif , NULL, NULL, (UBYTE *) NULL, NULL, NULL, 64, 32, 0xffff, 0xffff, -#ifdef INTUI_NEW_LOOK PUBLICSCREEN, tags -#else - CUSTOMSCREEN -#endif }, 0, 0, @@ -394,7 +350,6 @@ const char winpanicstr[] = "Bad winid %d in %s()"; /* The opened windows information */ struct amii_WinDesc *amii_wins[MAXWIN + 1]; -#ifdef INTUI_NEW_LOOK /* * NUMDRIPENS varies based on headers, so don't use it * here, its value is used elsewhere. @@ -413,23 +368,14 @@ struct TagItem scrntags[] = { { TAG_DONE, 0 }, }; -#endif - struct NewScreen NewHackScreen = { 0, 0, WIDTH, SCREENHEIGHT, 3, 0, 1, /* DetailPen, BlockPen */ - HIRES, CUSTOMSCREEN -#ifdef INTUI_NEW_LOOK - | NS_EXTENDED -#endif - , + HIRES, CUSTOMSCREEN | NS_EXTENDED, &Hack80, /* Font */ NULL, /*(UBYTE *)" NetHack X.Y.Z" */ NULL, /* Gadgets */ NULL, /* CustomBitmap */ -#ifdef INTUI_NEW_LOOK - scrntags -#endif -}; + scrntags }; /* * plname is filled either by an option (-u Player or -uPlayer) or @@ -507,13 +453,11 @@ amii_player_selection(void) if( WINVERS_AMIV ) { -#ifdef INTUI_NEW_LOOK Type_NewWindowStructure1.Extension = wintags; Type_NewWindowStructure1.Flags |= WFLG_NW_EXTENDED; fillhook.h_Entry = (void *) &LayerFillHook; fillhook.h_Data = (void *)-2; fillhook.h_SubEntry = 0; -#endif } Type_NewWindowStructure1.Screen = HackScreen; @@ -679,13 +623,11 @@ allocerr: if( WINVERS_AMIV ) { -#ifdef INTUI_NEW_LOOK Rnd_NewWindowStructure1.Extension = wintags; Rnd_NewWindowStructure1.Flags |= WFLG_NW_EXTENDED; fillhook.h_Entry = (void *) &LayerFillHook; fillhook.h_Data = (void *)-2; fillhook.h_SubEntry = 0; -#endif } Rnd_NewWindowStructure1.Screen = HackScreen; @@ -1200,11 +1142,8 @@ SetBorder(struct Gadget *gd) int borders = 6; int hipen = sysflags.amii_dripens[SHINEPEN], shadowpen = sysflags.amii_dripens[SHADOWPEN]; -#ifdef INTUI_NEW_LOOK struct DrawInfo *dip; -#endif -#ifdef INTUI_NEW_LOOK if (IntuitionBase->LibNode.lib_Version >= 37) { if ((dip = GetScreenDrawInfo(HackScreen)) != 0) { hipen = dip->dri_Pens[SHINEPEN]; @@ -1212,7 +1151,6 @@ SetBorder(struct Gadget *gd) FreeScreenDrawInfo(HackScreen, dip); } } -#endif /* Allocate two border structures one for up image and one for down * image, plus vector arrays for the border lines. */ diff --git a/sys/amiga/windefs.h b/sys/amiga/windefs.h index 617c095f1..010b933ea 100644 --- a/sys/amiga/windefs.h +++ b/sys/amiga/windefs.h @@ -21,12 +21,6 @@ #include #include -#ifdef IDCMP_CLOSEWINDOW -#ifndef INTUI_NEW_LOOK -#define INTUI_NEW_LOOK -#endif -#endif - #ifndef HACK_H #include "hack.h" #endif @@ -63,9 +57,7 @@ CLIPPING must be defined for the AMIGA version #include "NH:sys/amiga/lib/libmacs.h" #endif -#ifdef INTUI_NEW_LOOK #include -#endif #define WINVERS_AMII (strcmp("amii", windowprocs.name) == 0) #define WINVERS_AMIV (strcmp("amiv", windowprocs.name) == 0) @@ -109,11 +101,9 @@ CLIPPING must be defined for the AMIGA version #define MAPFTHEIGHT 8 #define MAPFTBASELN 6 -/* If Compiling with the "New Look", redefine these now */ -#ifdef INTUI_NEW_LOOK +/* Use the OS 2.0+ "new look" Intuition structs unconditionally. */ #define NewWindow ExtNewWindow #define NewScreen ExtNewScreen -#endif #define SIZEOF_DISKNAME 8 diff --git a/sys/amiga/winfuncs.c b/sys/amiga/winfuncs.c index aec3939c7..26d7a0e6d 100644 --- a/sys/amiga/winfuncs.c +++ b/sys/amiga/winfuncs.c @@ -143,7 +143,6 @@ ami_wininit_data(int dir) sizeof(sysflags.amii_dripens)); } -#ifdef INTUI_NEW_LOOK struct Hook SM_FilterHook; struct Hook fillhook; struct TagItem wintags[] = { @@ -151,7 +150,6 @@ struct TagItem wintags[] = { { WA_PubScreenName, (ULONG) "NetHack" }, { TAG_END, 0 }, }; -#endif void amii_destroy_nhwindow(winid win) /* just hide */ @@ -244,7 +242,6 @@ amii_destroy_nhwindow(winid win) /* just hide */ WIN_INVEN = WIN_ERR; } -#ifdef INTUI_NEW_LOOK struct FillParams { struct Layer *layer; struct Rectangle bounds; @@ -323,7 +320,6 @@ LayerFillHook_impl(struct Hook *hk, struct RastPort *rp, SetDrMd(&rptmp, JAM2); RectFill(&rptmp, x, y, xmax, ymax); } -#endif winid amii_create_nhwindow(int type) @@ -508,12 +504,10 @@ amii_create_nhwindow(int type) if (nw->Height + stath + maph < HackScreen->Height - nw->TopEdge) nw->Height = HackScreen->Height - nw->TopEdge - 1 - maph - stath; -#ifdef INTUI_NEW_LOOK if (IntuitionBase->LibNode.lib_Version >= 37) { MsgPropScroll.Flags |= PROPNEWLOOK; PropScroll.Flags |= PROPNEWLOOK; } -#endif } nw->IDCMPFlags |= MENUPICK; @@ -980,7 +974,6 @@ amii_init_nhwindows(int *argcp, char **argv) /* Use Intuition sizes for overscan screens... */ amiIDisplay->xpix = 0; -#ifdef INTUI_NEW_LOOK if (IntuitionBase->LibNode.lib_Version >= 37) { if (wbscr = LockPubScreen("Workbench")) { amiIDisplay->xpix = wbscr->Width; @@ -988,7 +981,6 @@ amii_init_nhwindows(int *argcp, char **argv) UnlockPubScreen(NULL, wbscr); } } -#endif if (amiIDisplay->xpix == 0) { amiIDisplay->ypix = GfxBase->NormalDisplayRows; amiIDisplay->xpix = GfxBase->NormalDisplayColumns; @@ -1118,7 +1110,6 @@ amii_init_nhwindows(int *argcp, char **argv) NewHackScreen.BlockPen = C_BLACK; NewHackScreen.DetailPen = C_WHITE; #endif -#ifdef INTUI_NEW_LOOK if (IntuitionBase->LibNode.lib_Version >= 37) { int i; struct DimensionInfo dims; @@ -1137,11 +1128,7 @@ amii_init_nhwindows(int *argcp, char **argv) if (amii_scrnmode == 0xffffffff) { struct ScreenModeRequester *SMR; -#ifdef __GNUC__ SM_FilterHook.h_Entry = (void *) &SM_Filter; -#else - SM_FilterHook.h_Entry = (ULONG (*) ()) SM_Filter; -#endif SM_FilterHook.h_Data = 0; SM_FilterHook.h_SubEntry = 0; SMR = AllocAslRequest(ASL_ScreenModeRequest, NULL); @@ -1231,7 +1218,6 @@ amii_init_nhwindows(int *argcp, char **argv) } } } -#endif if (WINVERS_AMIV) { extern char *tilefile; @@ -1278,10 +1264,8 @@ amii_init_nhwindows(int *argcp, char **argv) else bigscreen = 0; -#ifdef INTUI_NEW_LOOK if (IntuitionBase->LibNode.lib_Version >= 37) PubScreenStatus(HackScreen, 0); -#endif amiIDisplay->ypix = HackScreen->Height; amiIDisplay->xpix = HackScreen->Width; diff --git a/sys/amiga/winreq.c b/sys/amiga/winreq.c index 910adeb86..f25806f22 100644 --- a/sys/amiga/winreq.c +++ b/sys/amiga/winreq.c @@ -117,21 +117,17 @@ EditColor(void) svcolors[i] = colors[i] = GetRGB4(scrn->ViewPort.ColorMap, i); Col_NewWindowStructure1.Screen = scrn; -#ifdef INTUI_NEW_LOOK if (IntuitionBase->LibNode.lib_Version >= 37) { ((struct PropInfo *) Col_BluePen.SpecialInfo)->Flags |= PROPNEWLOOK; ((struct PropInfo *) Col_RedPen.SpecialInfo)->Flags |= PROPNEWLOOK; ((struct PropInfo *) Col_GreenPen.SpecialInfo)->Flags |= PROPNEWLOOK; } -#endif if (WINVERS_AMIV || WINVERS_AMII) { -#ifdef INTUI_NEW_LOOK Col_NewWindowStructure1.Extension = wintags; Col_NewWindowStructure1.Flags |= WFLG_NW_EXTENDED; fillhook.h_Entry = (void *) &LayerFillHook; fillhook.h_Data = (void *) -2; fillhook.h_SubEntry = 0; -#endif } nw = OpenWindow((void *) &Col_NewWindowStructure1); @@ -372,22 +368,18 @@ EditClipping(void) once = 1; } ClipNewWindowStructure1.Screen = scrn; -#ifdef INTUI_NEW_LOOK if (IntuitionBase->LibNode.lib_Version >= 37) { ((struct PropInfo *) ClipXSIZE.SpecialInfo)->Flags |= PROPNEWLOOK; ((struct PropInfo *) ClipYSIZE.SpecialInfo)->Flags |= PROPNEWLOOK; ((struct PropInfo *) ClipXCLIP.SpecialInfo)->Flags |= PROPNEWLOOK; ((struct PropInfo *) ClipYCLIP.SpecialInfo)->Flags |= PROPNEWLOOK; } -#endif if (WINVERS_AMIV || WINVERS_AMII) { -#ifdef INTUI_NEW_LOOK ClipNewWindowStructure1.Extension = wintags; ClipNewWindowStructure1.Flags |= WFLG_NW_EXTENDED; fillhook.h_Entry = (void *) &LayerFillHook; fillhook.h_Data = (void *) -2; fillhook.h_SubEntry = 0; -#endif } nw = OpenWindow((void *) &ClipNewWindowStructure1); @@ -399,11 +391,9 @@ EditClipping(void) ShowClipValues(nw); mflags = AUTOKNOB | FREEHORIZ; -#ifdef INTUI_NEW_LOOK if (IntuitionBase->LibNode.lib_Version >= 37) { mflags |= PROPNEWLOOK; } -#endif for (i = 0; i < 7; ++i) { if (mxsize <= sizes[i]) @@ -582,12 +572,9 @@ filecopy(char *from, char *to) if (buf) { sprintf(buf, "c:copy \"%s\" \"%s\" clone", from, to); -/* Check SysBase instead? Shouldn't matter */ -#ifdef INTUI_NEW_LOOK if (IntuitionBase->LibNode.lib_Version >= 37) i = System(buf, NULL); else -#endif Execute(buf, NULL, NULL); free(buf); } else { @@ -716,11 +703,9 @@ DrawCol(struct Window *w, int idx, UWORD *colors) b = colors[idx] & 0x00f; mflags = AUTOKNOB | FREEHORIZ; -#ifdef INTUI_NEW_LOOK if (IntuitionBase->LibNode.lib_Version >= 37) { mflags |= PROPNEWLOOK; } -#endif NewModifyProp(&Col_RedPen, w, NULL, mflags, (r * MAXPOT) / 15, 0, MAXPOT / 15, 0, 1); NewModifyProp(&Col_GreenPen, w, NULL, mflags, (g * MAXPOT) / 15, 0, @@ -759,7 +744,6 @@ DispCol(struct Window *w, int idx, UWORD *colors) void amii_setpens(int count) { -#ifdef INTUI_NEW_LOOK struct EasyStruct ea = { sizeof(struct EasyStruct), 0l, "NetHack Request", "Number of pens requested(%ld) not correct", "Use default pens|Use requested pens" }; @@ -768,12 +752,9 @@ amii_setpens(int count) "Number of pens requested(%ld) not\ncompatible " "with game configuration(%ld)", "Use default pens|Use requested pens" }; -#endif -/* If the pens in amii_curmap are - * more pens than in amii_numcolors, then we choose to ignore - * those pens. - */ -#ifdef INTUI_NEW_LOOK + + /* If the pens in amii_curmap are more than in amii_numcolors, ignore + * the extras. */ if (IntuitionBase && IntuitionBase->LibNode.lib_Version >= 39) { if (count != amii_numcolors) { long args[2]; @@ -791,9 +772,7 @@ amii_setpens(int count) amii_numcolors * sizeof(amii_initmap[0])); } } - } else -#endif - if (count != amii_numcolors) { + } else if (count != amii_numcolors) { memcpy(sysflags.amii_curmap, amii_initmap, amii_numcolors * sizeof(amii_initmap[0])); } @@ -849,13 +828,11 @@ getlind(const char *prompt, char *bufp, const char *dflt) } if (WINVERS_AMIV || WINVERS_AMII) { -#ifdef INTUI_NEW_LOOK StrWindow.Extension = wintags; StrWindow.Flags |= WFLG_NW_EXTENDED; fillhook.h_Entry = (void *) &LayerFillHook; fillhook.h_Data = (void *) -2; fillhook.h_SubEntry = 0; -#endif } if ((cwin = OpenWindow((void *) &StrWindow)) == NULL) { From a8e54185ebb92165b53b738c3c8e60368d55b89a Mon Sep 17 00:00:00 2001 From: Ingo Paschke Date: Mon, 11 May 2026 16:03:33 +0200 Subject: [PATCH 05/20] Amiga: drop SHAREDLIB dead build flavor --- sys/amiga/amiwind.c | 11 ----------- sys/amiga/winami.c | 3 +-- sys/amiga/windefs.h | 4 ---- sys/amiga/winext.h | 27 --------------------------- sys/amiga/winproto.h | 16 ---------------- 5 files changed, 1 insertion(+), 60 deletions(-) diff --git a/sys/amiga/amiwind.c b/sys/amiga/amiwind.c index fc33d9e29..80032deb1 100644 --- a/sys/amiga/amiwind.c +++ b/sys/amiga/amiwind.c @@ -690,13 +690,6 @@ amii_cleanup(void) IntuitionBase = NULL; } -#ifdef SHAREDLIB - if (DOSBase) { - CloseLibrary((struct Library *) DOSBase); - DOSBase = NULL; - } -#endif - ((struct Process *) FindTask(NULL))->pr_WindowPtr = (APTR) pr_WindowPtr; Initialized = 0; @@ -704,7 +697,6 @@ amii_cleanup(void) #endif /* AMII_GRAPHICS */ -#ifndef SHAREDLIB void Abort(long rc) { @@ -733,7 +725,6 @@ CleanUp(void) { amii_cleanup(); } -#endif #ifdef AMII_GRAPHICS @@ -849,7 +840,6 @@ amii_number_pad(int state) } #endif /* AMII_GRAPHICS */ -#ifndef SHAREDLIB void amiv_loadlib(void) { @@ -879,4 +869,3 @@ VA_DECL(const char *, s) VA_END(); Abort(0L); } -#endif diff --git a/sys/amiga/winami.c b/sys/amiga/winami.c index ec7548242..8e448fed5 100644 --- a/sys/amiga/winami.c +++ b/sys/amiga/winami.c @@ -159,8 +159,7 @@ unsigned short amiv_init_map[AMII_MAXCOLORS] = { 0x0fff, /* color #31 */ }; -#if !defined(TTY_GRAPHICS) \ - || defined(SHAREDLIB) /* this should be shared better */ +#ifndef TTY_GRAPHICS char morc; /* the character typed in response to a --more-- prompt */ #endif char spaces[76] = " " diff --git a/sys/amiga/windefs.h b/sys/amiga/windefs.h index 010b933ea..85a800633 100644 --- a/sys/amiga/windefs.h +++ b/sys/amiga/windefs.h @@ -53,10 +53,6 @@ CLIPPING must be defined for the AMIGA version #include #include -#ifdef SHAREDLIB -#include "NH:sys/amiga/lib/libmacs.h" -#endif - #include #define WINVERS_AMII (strcmp("amii", windowprocs.name) == 0) diff --git a/sys/amiga/winext.h b/sys/amiga/winext.h index 068593337..e3ef8ef86 100644 --- a/sys/amiga/winext.h +++ b/sys/amiga/winext.h @@ -18,7 +18,6 @@ extern int LI; extern int scrollmsg; extern int alwaysinvent; -#ifndef SHAREDLIB extern unsigned short amii_defpens[20]; extern struct amii_DisplayDesc *amiIDisplay; /* the Amiga Intuition descriptor */ @@ -33,21 +32,6 @@ extern long amii_scrnmode; extern winid amii_rawprwin; extern struct Screen *HackScreen; extern char Initialized; -/* These have already been defined elsewhere (and some are conflicting) - * ... going ... going once ... going twice .... - * extern const char *roles[]; - * extern struct Library *ConsoleDevice; - * extern char toplines[ TBUFSZ ]; - * extern NEARDATA winid WIN_MESSAGE; - * extern NEARDATA winid WIN_MAP; - * extern NEARDATA winid WIN_STATUS; - * extern NEARDATA winid WIN_INVEN; - * extern winid WIN_OVER; - * extern struct GfxBase *GfxBase; - * extern struct Library *DiskfontBase; - * extern struct IntuitionBase *IntuitionBase; - * extern struct Library *LayersBase; - */ extern int amii_msgAPen; extern int amii_msgBPen; extern int amii_statAPen; @@ -58,9 +42,6 @@ extern int amii_textAPen; extern int amii_textBPen; extern int amii_otherAPen; extern int amii_otherBPen; -#else -extern WinamiBASE *WinamiBase; -#endif /* All kinds of shared stuff */ extern struct TextAttr Hack160; extern struct TextAttr Hack40; @@ -132,17 +113,9 @@ typedef enum { extern struct PDAT pictdata; extern struct Hook fillhook; extern struct TagItem wintags[]; -#ifndef SHAREDLIB -#ifndef __GNUC__ -void __asm LayerFillHook(register __a0 struct Hook *hk, - register __a2 struct RastPort *rp, - register __a1 struct FillParams *fp); -#else #ifdef __PPC__ struct EmulLibEntry LayerFillHook; #else void LayerFillHook(void); #endif -#endif -#endif extern int mxsize, mysize; diff --git a/sys/amiga/winproto.h b/sys/amiga/winproto.h index d855e50fe..6bd486dfb 100644 --- a/sys/amiga/winproto.h +++ b/sys/amiga/winproto.h @@ -58,9 +58,7 @@ int amikbhit(void); int WindowGetchar(void); WETYPE WindowGetevent(void); void amii_cleanup(void); -#ifndef SHAREDLIB void Abort(long rc); -#endif void CleanUp(void); void flush_glyph_buffer(struct Window *w); void amiga_print_glyph(winid window, int color_index, int glyph); @@ -71,10 +69,8 @@ void FreeNewWindow(struct NewWindow *win); void bell(void); void amii_delay_output(void); void amii_number_pad(int state); -#ifndef SHAREDLIB void amiv_loadlib(void); void amii_loadlib(void); -#endif void preserve_icon(void); void clear_icon(void); @@ -114,10 +110,6 @@ BitMapHeader ReadTileImageFiles(void); void FreeTileImageFiles(void); /* winami.c */ -#ifdef SHAREDLIB -int __UserLibInit(void); -void __UserLibCleanup(void); -#endif void amii_askname(void); void amii_player_selection(void); void RandomWindow(char *name); @@ -127,15 +119,7 @@ void amii_display_file(const char *fn, boolean complain); void SetBorder(struct Gadget *gd); /* malloc/free provided by stdlib.h */ -#ifdef SHAREDLIB -/* amilib.c */ -void amii_loadlib(void); -void amiv_loadlib(void); -void CleanUp(void); -void setup_librefs(WinamiBASE *base); -#else void Abort(long rc); -#endif win_request_info *amii_ctrl_nhwindow(winid, int, win_request_info *); From 00433c799859c6e14b8a4c8d3b821bdf7e9f8b16 Mon Sep 17 00:00:00 2001 From: Ingo Paschke Date: Mon, 11 May 2026 16:07:21 +0200 Subject: [PATCH 06/20] Amiga: drop TESTING dev toggle in winchar.c --- sys/amiga/winchar.c | 124 +------------------------------------------- 1 file changed, 2 insertions(+), 122 deletions(-) diff --git a/sys/amiga/winchar.c b/sys/amiga/winchar.c index c2281c914..154b559b2 100644 --- a/sys/amiga/winchar.c +++ b/sys/amiga/winchar.c @@ -9,15 +9,11 @@ #include #include -#ifdef TESTING -#include "hack.h" -#else #ifndef CROSS_TO_AMIGA #include "NH:src/tile.c" #else #include "../src/tile.c" #endif -#endif #ifndef CROSS_TO_AMIGA #include "NH:win/share/tile.h" @@ -94,85 +90,6 @@ struct PDAT pictdata; char *tilefile; struct BitMap *tileimg, *tile; -#ifdef TESTING -short pens[NUMDRIPENS] = { 8, 3, 15, 0, 15, 7, 7, 8, 0 }; -main(int argc, char **argv) -{ - BitMapHeader bmhd; - struct IntuiMessage *imsg; - long code, class; - char buf[100]; - int i, x, y, tbl, done = 0, num; - struct Window *w; - struct Screen *scr; - - bmhd = ReadTileImageFiles(); - - scr = OpenScreenTags( - NULL, SA_Depth, pictdata.nplanes + amii_extraplanes, SA_DisplayID, - DBLNTSC_MONITOR_ID | HIRESLACE_KEY, SA_Overscan, OSCAN_TEXT, SA_Top, - 0, SA_Left, 0, SA_Width, STDSCREENWIDTH, SA_Height, STDSCREENHEIGHT, - SA_Type, CUSTOMSCREEN, SA_DetailPen, 0, SA_BlockPen, 1, SA_Title, - "NetHack Chars", SA_Pens, pens, TAG_DONE); - if (scr == NULL) { - printf("no screen\n"); -#undef exit - exit(1); - } - - w = OpenWindowTags( - 0, WA_CustomScreen, scr, WA_Flags, - WFLG_DRAGBAR | WFLG_SIZEGADGET | WFLG_DEPTHGADGET | WFLG_CLOSEGADGET, - WA_IDCMP, IDCMP_CLOSEWINDOW | IDCMP_NEWSIZE | IDCMP_MOUSEBUTTONS, - WA_Left, 0, WA_Top, scr->WBorTop + 1 + 13, WA_MinWidth, 100, - WA_MinHeight, 100, WA_MaxWidth, 700, WA_MaxHeight, 1000, WA_Width, - 640, WA_Height, 340, WA_SmartRefresh, TRUE, TAG_DONE); - if (w) { - while (!done) { - for (i = 0; i < NUMTILEIMAGES * IMGPAGESIZE; ++i) { - int dx, dy; - tbl = i / IMGPAGESIZE; - x = i % IMGPAGESIZE; - y = x / IMGCOLUMNS; - x = x % IMGCOLUMNS; - dx = i % (IMGCOLUMNS * 2); - dy = i / (IMGCOLUMNS * 2); - BltBitMapRastPort(tileimg, x * pictdata.xsize, - y * pictdata.ysize, w->RPort, - w->BorderLeft + 1 + dx * pictdata.xsize, - w->BorderTop + 1 + dy * pictdata.ysize, - pictdata.xsize, pictdata.ysize, 0xc0); - } - WaitPort(w->UserPort); - while (imsg = (struct IntuiMessage *) GetMsg(w->UserPort)) { - class = imsg->Class; - code = imsg->Code; - ReplyMsg((struct Message *) imsg); - switch (class) { - case IDCMP_MOUSEBUTTONS: { - x = imsg->MouseX - w->BorderLeft; - y = imsg->MouseY - w->BorderTop; - num = ((y / pictdata.ysize) * IMGCOLUMNS * 2) - + (x / pictdata.xsize); - sprintf(buf, "Char #%d", num); - SetWindowTitles(w, buf, buf); - } break; - case IDCMP_CLOSEWINDOW: - done = 1; - break; - } - } - } - CloseWindow(w); - CloseScreen(scr); - } - - FreeTileImageFiles(); - - return (0); -} -#endif - /* * Read a single BMAP IFF file into a BitMap. * Returns the BitMapHeader; *bmp receives the bitmap. @@ -327,25 +244,6 @@ MyFreeBitMap(struct BitMap *bmp) free(bm); } -#ifdef TESTING -void -panic(char *s, long a1, long a2, long a3, long a4) -{ - printf(s, a1, a2, a3, a4); - putchar('\n'); -} -long * -alloc(unsigned int x) -{ - long *p = (long *) malloc(x); - if (!p) { - panic("malloc failed"); - exit(1); - } - return p; -} -#endif - void FreeTileImageFiles(void) { @@ -353,7 +251,6 @@ FreeTileImageFiles(void) FreeImageFile(&tile); } -#ifndef TESTING /* * Define some stuff for our special glyph drawing routines */ @@ -807,17 +704,8 @@ GlyphToIcon(int glyph) return glyph; return (gi.gm.tileidx); } -#endif #ifdef AMII_GRAPHICS -#ifdef TESTING -/* - * Define some stuff for our special glyph drawing routines - */ -static unsigned short glyph_node_index, glyph_buffer_index; -#define NUMBER_GLYPH_NODES 80 -#define GLYPH_BUFFER_SIZE 512 -#endif /* TESTING */ struct amii_glyph_node { short x; @@ -864,7 +752,6 @@ int backg[AMII_MAXCOLORS] = { #define CLR_MAX 16 #endif -#ifndef TESTING /* * Begin Revamped Text display routines * @@ -1002,18 +889,14 @@ amii_lprint_glyph(winid window, int color_index, int glyph) ++glyph_node_index; } } -#endif /* !TESTING */ -#ifdef TESTING /* - * Define some variables which will be used to save context when toggling - * back and forth between low level text and console I/O. + * Variables used to save context when toggling between low level text + * and console I/O. */ static long xsave, ysave, modesave, apensave, bpensave; static int usecolor; -#endif /* TESTING */ -#ifndef TESTING /* * The function is called before any glyphs are driven to the screen. It * removes the cursor, saves internal state of the window, then returns. @@ -1050,7 +933,6 @@ amii_start_glyphout(winid window) iflags.use_color = FALSE; cw->wflags |= FLMAP_INGLYPH; } -#endif /* !TESTING */ #if 0 /* @@ -1090,7 +972,6 @@ amii_end_glyphout(window) #endif #endif -#ifndef TESTING #ifdef OPT_DISPMAP /* don't use dispmap unless x & y are 8,16,24,32,48 and equal */ void @@ -1108,4 +989,3 @@ dispmap_sanity1(int x) return !strchr((char *)valid, x); } #endif /* OPT_DISPMAP */ -#endif /* TESTING */ From e90a297021f6617b16103390065aa3607bb4013f Mon Sep 17 00:00:00 2001 From: Ingo Paschke Date: Mon, 11 May 2026 16:13:31 +0200 Subject: [PATCH 07/20] Amiga: drop #if 0 dead-code blocks Includes a dead amii_player_selection / RandomWindow pair (~280 lines), eraseall / CopyFile in amidos.c, and smaller fragments. --- sys/amiga/amidos.c | 68 ---------- sys/amiga/winamenu.c | 7 - sys/amiga/winami.c | 301 ------------------------------------------- sys/amiga/winchar.c | 56 -------- sys/amiga/winfuncs.c | 18 --- sys/amiga/winstr.c | 6 - 6 files changed, 456 deletions(-) diff --git a/sys/amiga/amidos.c b/sys/amiga/amidos.c index 47b793762..43c276dbc 100644 --- a/sys/amiga/amidos.c +++ b/sys/amiga/amidos.c @@ -256,74 +256,6 @@ filesize(char *file) return size; } -#if 0 -void -void -eraseall(const char *path, const char *files) -{ - BPTR dirLock, dirLock2; - struct FileInfoBlock *fibp; - int chklen; -#if (NH_DEVEL_STATUS != NH_STATUS_RELEASED) - if(files != g.alllevels)panic("eraseall"); -#endif - chklen=(int)index(files,'*')-(int)files; - - if (dirLock = Lock( (char *)path ,SHARED_LOCK)) { - dirLock2=DupLock(dirLock); - dirLock2= CurrentDir(dirLock2); - fibp=AllocMem(sizeof(struct FileInfoBlock),0); - if(fibp){ - if(Examine(dirLock,fibp)){ - while(ExNext(dirLock,fibp)){ - if(!strncmp(fibp->fib_FileName,files,chklen)){ - DeleteFile(fibp->fib_FileName); - } - } - } - FreeMem(fibp,sizeof(struct FileInfoBlock)); - } - UnLock(dirLock); - UnLock(CurrentDir(dirLock2)); - } -} -#endif - -/* This size makes that most files can be copied with two Read()/Write()s */ - -#if 0 /* Unused */ -#define COPYSIZE 4096 - -char *CopyFile(const char *from, const char *to) -{ - BPTR fromFile, toFile; - char *buffer; - long size; - char *error = NULL; - - buffer = (char *) alloc(COPYSIZE); - if (fromFile = Open( (char *)from, MODE_OLDFILE)) { - if (toFile = Open( (char *)to, MODE_NEWFILE)) { - while (size = Read(fromFile, buffer, (long)COPYSIZE)) { - if (size == -1){ - error = "Read error"; - break; - } - if (size != Write(toFile, buffer, size)) { - error = "Write error"; - break; - } - } - Close(toFile); - } else - error = "Cannot open destination"; - Close(fromFile); - } else - error = "Cannot open source (this should not occur)"; - free(buffer); - return error; -} -#endif #ifdef MFLOPPY /* this should be replaced */ diff --git a/sys/amiga/winamenu.c b/sys/amiga/winamenu.c index a6d203e65..5ab2d7af8 100644 --- a/sys/amiga/winamenu.c +++ b/sys/amiga/winamenu.c @@ -445,13 +445,6 @@ DoMenuScroll(int win, int blocking, int how, menu_item **retmip) morc = 0; oidx = -1; -#if 0 - /* Make sure there are no selections left over from last time. */ -/* XXX potential problem for preselection if this is really needed */ - for( amip = cw->menu.items; amip; amip = amip->next ) - amip->selected = 0; -#endif - DisplayData(win, topidx); /* Make the prop gadget the right size and place */ diff --git a/sys/amiga/winami.c b/sys/amiga/winami.c index 8e448fed5..97782356b 100644 --- a/sys/amiga/winami.c +++ b/sys/amiga/winami.c @@ -408,290 +408,6 @@ amii_askname(void) /* Get the player selection character */ -#if 0 /* New function at the bottom */ -void -amii_player_selection(void) -{ - struct Window *cwin; - struct IntuiMessage *imsg; - int aredone = 0; - struct Gadget *gd; - static int once = 0; - long class, code; - - amii_clear_nhwindow( WIN_BASE ); - if (validrole(flags.initrole)) - return; - else { - flags.initrole = randrole(FALSE); - return; - } -#if 0 /* Don't query the user ... instead give random character -jhsa */ - -#if 0 /* OBSOLETE */ - if( *svp.pl_character ){ - svp.pl_character[ 0 ] = toupper( svp.pl_character[ 0 ] ); - if( strchr( pl_classes, svp.pl_character[ 0 ] ) ) - return; - } -#endif - - if( !once ){ - if( bigscreen ){ - Type_NewWindowStructure1.TopEdge = - (HackScreen->Height/2) - (Type_NewWindowStructure1.Height/2); - } - for( gd = Type_NewWindowStructure1.FirstGadget; gd; - gd = gd->NextGadget ) - { - if( gd->GadgetID != 0 ) - SetBorder( gd ); - } - once = 1; - } - - if( WINVERS_AMIV ) - { - Type_NewWindowStructure1.Extension = wintags; - Type_NewWindowStructure1.Flags |= WFLG_NW_EXTENDED; - fillhook.h_Entry = (void *) &LayerFillHook; - fillhook.h_Data = (void *)-2; - fillhook.h_SubEntry = 0; - } - - Type_NewWindowStructure1.Screen = HackScreen; - if( ( cwin = OpenShWindow( (void *)&Type_NewWindowStructure1 ) ) == NULL ) - { - return; - } -#if 0 - WindowToFront( cwin ); -#endif - - while( !aredone ) - { - WaitPort( cwin->UserPort ); - while( ( imsg = (void *) GetMsg( cwin->UserPort ) ) != NULL ) - { - class = imsg->Class; - code = imsg->Code; - gd = (struct Gadget *)imsg->IAddress; - ReplyMsg( (struct Message *)imsg ); - - switch( class ) - { - case VANILLAKEY: - if( strchr( pl_classes, toupper( code ) ) ) - { - svp.pl_character[0] = toupper( code ); - aredone = 1; - } - else if( code == ' ' || code == '\n' || code == '\r' ) - { - flags.initrole = randrole(FALSE); -#if 0 /* OBSOLETE */ - strcpy( svp.pl_character, roles[ rnd( 11 ) ] ); -#endif - aredone = 1; - amii_clear_nhwindow( WIN_BASE ); - CloseShWindow( cwin ); - RandomWindow( svp.pl_character ); - return; - } - else if( code == 'q' || code == 'Q' ) - { - CloseShWindow( cwin ); - clearlocks(); - exit_nhwindows(NULL); - nh_terminate(0); - } - else - DisplayBeep( NULL ); - break; - - case GADGETUP: - switch( gd->GadgetID ) - { - case 1: /* Random Character */ - flags.initrole = randrole(FALSE); -#if 0 /* OBSOLETE */ - strcpy( svp.pl_character, roles[ rnd( 11 ) ] ); -#endif - amii_clear_nhwindow( WIN_BASE ); - CloseShWindow( cwin ); - RandomWindow( svp.pl_character ); - return; - - default: - svp.pl_character[0] = gd->GadgetID; - break; - } - aredone = 1; - break; - - case CLOSEWINDOW: - CloseShWindow( cwin ); - clearlocks(); - exit_nhwindows(NULL); - nh_terminate(0); - break; - } - } - } - amii_clear_nhwindow( WIN_BASE ); - CloseShWindow( cwin ); -#endif /* Do not query user ... -jhsa */ -} -#endif /* Function elsewhere */ - -#if 0 /* Unused ... -jhsa */ - -#include "NH:sys/amiga/randwin.c" - -void -RandomWindow(char *name) -{ - struct MsgPort *tport; - struct timerequest *trq; - static int once = 0; - struct Gadget *gd; - struct Window *w; - struct IntuiMessage *imsg; - int ticks = 0, aredone = 0, timerdone = 0; - long mask, got; - - tport = CreateMsgPort(); - trq = (struct timerequest *)CreateIORequest( tport, sizeof( *trq ) ); - if( tport == NULL || trq == NULL ) - { -allocerr: - if( tport ) DeleteMsgPort( tport ); - if( trq ) DeleteIORequest( (struct IORequest *)trq ); - Delay( 8 * 50 ); - return; - } - - if( OpenDevice( TIMERNAME, UNIT_VBLANK, (struct IORequest *)trq, 0L ) != 0 ) - goto allocerr; - - trq->tr_node.io_Command = TR_ADDREQUEST; - trq->tr_time.tv_secs = 8; - trq->tr_time.tv_micro = 0; - - SendIO( (struct IORequest *)trq ); - - /* Place the name in the center of the screen */ - Rnd_IText5.IText = name; - Rnd_IText6.LeftEdge = Rnd_IText4.LeftEdge + - (strlen(Rnd_IText4.IText)+1)*8; - Rnd_NewWindowStructure1.Width = ( - (strlen( Rnd_IText2.IText )+1) * 8 ) + - HackScreen->WBorLeft + HackScreen->WBorRight; - Rnd_IText5.LeftEdge = (Rnd_NewWindowStructure1.Width - - (strlen(name)*8))/2; - - gd = Rnd_NewWindowStructure1.FirstGadget; - gd->LeftEdge = (Rnd_NewWindowStructure1.Width - gd->Width)/2; - /* Chose correct modifier */ - Rnd_IText6.IText = "a"; - switch( *name ) - { - case 'a': case 'e': case 'i': case 'o': - case 'u': case 'A': case 'E': case 'I': - case 'O': case 'U': - Rnd_IText6.IText = "an"; - break; - } - - if( !once ) - { - if( bigscreen ) - { - Rnd_NewWindowStructure1.TopEdge = - (HackScreen->Height/2) - (Rnd_NewWindowStructure1.Height/2); - } - for( gd = Rnd_NewWindowStructure1.FirstGadget; gd; gd = gd->NextGadget ) - { - if( gd->GadgetID != 0 ) - SetBorder( gd ); - } - Rnd_NewWindowStructure1.IDCMPFlags |= VANILLAKEY; - - once = 1; - } - - if( WINVERS_AMIV ) - { - Rnd_NewWindowStructure1.Extension = wintags; - Rnd_NewWindowStructure1.Flags |= WFLG_NW_EXTENDED; - fillhook.h_Entry = (void *) &LayerFillHook; - fillhook.h_Data = (void *)-2; - fillhook.h_SubEntry = 0; - } - - Rnd_NewWindowStructure1.Screen = HackScreen; - if( ( w = OpenShWindow( (void *)&Rnd_NewWindowStructure1 ) ) == NULL ) - { - AbortIO( (struct IORequest *)trq ); - WaitIO( (struct IORequest *)trq ); - CloseDevice( (struct IORequest *)trq ); - DeleteIORequest( (struct IORequest *) trq ); - DeleteMsgPort( tport ); - Delay( 50 * 8 ); - return; - } - - PrintIText( w->RPort, &Rnd_IntuiTextList1, 0, 0 ); - - mask = (1L << tport->mp_SigBit)|(1L << w->UserPort->mp_SigBit); - while( !aredone ) - { - got = Wait( mask ); - if( got & (1L << tport->mp_SigBit ) ) - { - aredone = 1; - timerdone = 1; - GetMsg( tport ); - } - while( w && ( imsg = (struct IntuiMessage *) GetMsg( w->UserPort ) ) ) - { - switch( (long)imsg->Class ) - { - /* Must be up for a little while... */ - case INACTIVEWINDOW: - if( ticks >= 40 ) - aredone = 1; - break; - - case INTUITICKS: - ++ticks; - break; - - case GADGETUP: - aredone = 1; - break; - - case VANILLAKEY: - if(imsg->Code=='\n' || imsg->Code==' ' || imsg->Code=='\r') - aredone = 1; - break; - } - ReplyMsg( (struct Message *)imsg ); - } - } - - if( !timerdone ) - { - AbortIO( (struct IORequest *)trq ); - WaitIO( (struct IORequest *)trq ); - } - - CloseDevice( (struct IORequest *)trq ); - DeleteIORequest( (struct IORequest *) trq ); - DeleteMsgPort( tport ); - if(w) CloseShWindow( w ); -} -#endif /* Discarded randwin ... -jhsa */ /* this should probably not be needed (or be renamed) void @@ -992,23 +708,6 @@ amii_yn_function(const char *query, const char *resp, char def) cursor_on(WIN_MESSAGE); q = lowc(WindowGetchar()); cursor_off(WIN_MESSAGE); -#if 0 -/* fix for PL2 */ - if (q == '\020') { /* ctrl-P */ - if(!doprev) - (void) tty_doprev_message(); /* need two initially */ - (void) tty_doprev_message(); - q = (char)0; - doprev = 1; - continue; - } else if (doprev) { - tty_clear_nhwindow(WIN_MESSAGE); - cw->maxcol = cw->maxrow; - doprev = 0; - amii_addtopl(prompt); - continue; - } -#endif /*0*/ digit_ok = allow_num && isdigit(q); if (q == '\033') { if (strchr(resp, 'q')) diff --git a/sys/amiga/winchar.c b/sys/amiga/winchar.c index 154b559b2..5872e706f 100644 --- a/sys/amiga/winchar.c +++ b/sys/amiga/winchar.c @@ -732,26 +732,6 @@ int foreg[AMII_MAXCOLORS] = { int backg[AMII_MAXCOLORS] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 4, 1, 6, 5, 3, 0 }; -#if 0 -#define CLR_BLACK 0 -#define CLR_RED 1 -#define CLR_GREEN 2 -#define CLR_BROWN 3 /* on IBM, low-intensity yellow is brown */ -#define CLR_BLUE 4 -#define CLR_MAGENTA 5 -#define CLR_CYAN 6 -#define CLR_GRAY 7 /* low-intensity white */ -#define NO_COLOR 8 -#define CLR_ORANGE 9 -#define CLR_BRIGHT_GREEN 10 -#define CLR_YELLOW 11 -#define CLR_BRIGHT_BLUE 12 -#define CLR_BRIGHT_MAGENTA 13 -#define CLR_BRIGHT_CYAN 14 -#define CLR_WHITE 15 -#define CLR_MAX 16 -#endif - /* * Begin Revamped Text display routines * @@ -934,42 +914,6 @@ amii_start_glyphout(winid window) cw->wflags |= FLMAP_INGLYPH; } -#if 0 -/* - * General cleanup routine -- flushes and restores cursor - */ -void -amii_end_glyphout(window) - winid window; -{ - struct amii_WinDesc *cw; - struct Window *w; - - if( ( cw = amii_wins[ window ] ) == (struct amii_WinDesc *)NULL ) - panic("bad window id %d in amii_end_glyphout()", window ); - - if( ( cw->wflags & FLMAP_INGLYPH ) == 0 ) - return; - cw->wflags &= ~(FLMAP_INGLYPH); - - if( !(w = cw->win ) ) - panic( "bad winid %d, no window ptr set", window ); - - /* - * Clean up whatever is left in the buffer - */ - iflags.use_color = usecolor; - - /* - * Reset internal data structs - */ - SetAPen(w->RPort, apensave); - SetBPen(w->RPort, bpensave); - SetDrMd(w->RPort, modesave); - - Move(w->RPort, xsave, ysave); -} -#endif #endif #ifdef OPT_DISPMAP diff --git a/sys/amiga/winfuncs.c b/sys/amiga/winfuncs.c index 26d7a0e6d..919c63830 100644 --- a/sys/amiga/winfuncs.c +++ b/sys/amiga/winfuncs.c @@ -1106,10 +1106,6 @@ amii_init_nhwindows(int *argcp, char **argv) PATCHLEVEL); NewHackScreen.DefaultTitle = fname; } -#if 0 - NewHackScreen.BlockPen = C_BLACK; - NewHackScreen.DetailPen = C_WHITE; -#endif if (IntuitionBase->LibNode.lib_Version >= 37) { int i; struct DimensionInfo dims; @@ -1687,11 +1683,6 @@ amii_curs(winid window, int x, int y) if (WINVERS_AMIV) { if (cw->type == NHW_MAP) { if (Is_rogue_level(&u.uz)) { -#if 0 -int qqx= (x * w->RPort->TxWidth) + w->BorderLeft; -int qqy= w->BorderTop + ( (y+1) * w->RPort->TxHeight ) + 1; -printf("pos: (%d,%d)->(%d,%d)\n",x,y,qqx,qqy); -#endif SetAPen(w->RPort, C_WHITE); /* XXX should be elsewhere (was 4)*/ Move(rp, (x * w->RPort->TxWidth) + w->BorderLeft, @@ -2038,15 +2029,6 @@ amii_print_glyph(winid win, coordxy x, coordxy y, panic(winpanicstr, win, "amii_print_glyph"); } -#if 0 -{ -static int x=-1; -if(u.uz.dlevel != x){ - fprintf(stderr,"lvlchg: %d (%d)\n",u.uz.dlevel,Is_rogue_level(&u.uz)); - x = u.uz.dlevel; -} -} -#endif if (WINVERS_AMIV && !Is_rogue_level(&u.uz)) { amii_curs(win, x, y); amiga_print_glyph(win, 0, glyph); diff --git a/sys/amiga/winstr.c b/sys/amiga/winstr.c index a3801fff1..e6cfd4f45 100644 --- a/sys/amiga/winstr.c +++ b/sys/amiga/winstr.c @@ -144,12 +144,6 @@ amii_putstr(winid window, int attr, const char *str) p++; str = p; -#if 0 - if( str != ostr ) { - outsubstr( cw, "+", 1, fudge ); - cw->curx+=2; - } -#endif if (*str) amii_scrollmsg(w, cw); amii_cl_end(cw, cw->curx); From beaed3aa08a53ceb9e725b0197e86bd8ea4bde13 Mon Sep 17 00:00:00 2001 From: Ingo Paschke Date: Mon, 11 May 2026 16:15:49 +0200 Subject: [PATCH 08/20] Amiga: delete the .p prototype headers amidos.p, amiwind.p, winami.p duplicated and partly contradicted winproto.h. Switch amidos.c and amigst.c to winproto.h. --- sys/amiga/amidos.c | 12 ++-------- sys/amiga/amidos.p | 43 ---------------------------------- sys/amiga/amigst.c | 12 +++------- sys/amiga/amiwind.p | 40 ------------------------------- sys/amiga/winami.p | 57 --------------------------------------------- 5 files changed, 5 insertions(+), 159 deletions(-) delete mode 100644 sys/amiga/amidos.p delete mode 100644 sys/amiga/amiwind.p delete mode 100644 sys/amiga/winami.p diff --git a/sys/amiga/amidos.c b/sys/amiga/amidos.c index 43c276dbc..475fb4824 100644 --- a/sys/amiga/amidos.c +++ b/sys/amiga/amidos.c @@ -83,16 +83,8 @@ free_nhuuid(void) } } -/* Prototypes */ -#ifndef CROSS_TO_AMIGA -#include "NH:sys/amiga/amiwind.p" -#include "NH:sys/amiga/winami.p" -#include "NH:sys/amiga/amidos.p" -#else -#include "amiwind.p" -#include "winami.p" -#include "amidos.p" -#endif +#include "winext.h" +#include "winproto.h" extern char Initialized; diff --git a/sys/amiga/amidos.p b/sys/amiga/amidos.p deleted file mode 100644 index 83decbc17..000000000 --- a/sys/amiga/amidos.p +++ /dev/null @@ -1,43 +0,0 @@ -/* NetHack 3.6 amidos.p $NHDT-Date: 1432512796 2015/05/25 00:13:16 $ $NHDT-Branch: master $:$NHDT-Revision: 1.7 $ */ -/* Copyright (c) Kenneth Lorber, Bethesda, Maryland, 1992, 1993. */ -/* NetHack may be freely redistributed. See license for details. */ - -/* amidos.c */ -void flushout (void); -#ifndef getuid -int getuid (void); -#endif -#ifndef getpid -int getpid (void); -#endif -#ifndef getlogin -char *getlogin (void); -#endif -#ifndef abs -int abs(int ); -#endif -int tgetch (void); -int dosh (void); -void amiga_self_assign (void); -long freediskspace(char *); -long filesize(char *); -void eraseall(const char * , const char *); -char *CopyFile(const char * , const char *); -void copybones(int ); -void playwoRAMdisk (void); -int saveDiskPrompt(int ); -void gameDiskPrompt (void); -void append_slash(char *); -void getreturn(const char *); -#ifndef msmsg -void msmsg( const char *, ... ); -#endif -#if !defined(__SASC_60) && !defined(_DCC) && !defined(CROSS_TO_AMIGA) -int chdir(char *); -#endif -#ifndef strcmpi -int strcmpi(char * , char *); -#endif -#if !defined(memcmp) && !defined(AZTEC_C) && !defined(_DCC) && !defined(__GNUC__) -int memcmp(unsigned char * , unsigned char * , int ); -#endif diff --git a/sys/amiga/amigst.c b/sys/amiga/amigst.c index 6e6697111..c0ace8cdf 100644 --- a/sys/amiga/amigst.c +++ b/sys/amiga/amigst.c @@ -21,14 +21,8 @@ #include "winprocs.h" #include "winami.h" -#ifndef CROSS_TO_AMIGA -#include "NH:sys/amiga/winami.p" -#include "NH:sys/amiga/amiwind.p" -#include "NH:sys/amiga/amidos.p" -#else -#include "winami.p" -#include "amiwind.p" -#include "amidos.p" -#endif +#include "windefs.h" +#include "winext.h" +#include "winproto.h" /* end amigst.c */ diff --git a/sys/amiga/amiwind.p b/sys/amiga/amiwind.p deleted file mode 100644 index 762646dc2..000000000 --- a/sys/amiga/amiwind.p +++ /dev/null @@ -1,40 +0,0 @@ -/* NetHack 3.6 amiwind.p $NHDT-Date: 1432512795 2015/05/25 00:13:15 $ $NHDT-Branch: master $:$NHDT-Revision: 1.6 $ */ -/* Copyright (c) Gregg Wonderly, Naperville, IL, 1992, 1993 */ -/* NetHack may be freely redistributed. See license for details. */ - -/* amiwind.c */ -#ifdef INTUI_NEW_LOOK -struct Window * OpenShWindow(struct ExtNewWindow *) ; -#else -struct Window * OpenShWindow(struct NewWindow *) ; -#endif -void CloseShWindow(struct Window *); -int kbhit (void); -int amikbhit (void); -int WindowGetchar (void); -WETYPE WindowGetevent (void); -void WindowFlush (void); -void WindowPutchar(char ); -void WindowFPuts(const char *); -void WindowPuts(const char *); -void WindowPrintf( char *,... ); -void CleanUp (void); -int ConvertKey( struct IntuiMessage * ); -#ifndef SHAREDLIB -void Abort(long ); -#endif -void flush_glyph_buffer(struct Window *); -void amiga_print_glyph(winid , int , int ); -void start_glyphout(winid ); -void amii_end_glyphout(winid ); -#ifdef INTUI_NEW_LOOK -struct ExtNewWindow * DupNewWindow(struct ExtNewWindow *); -void FreeNewWindow(struct ExtNewWindow *); -#else -struct NewWindow * DupNewWindow(struct NewWindow *); -void FreeNewWindow(struct NewWindow *); -#endif -void bell (void); -void amii_delay_output (void); -void amii_number_pad(int ); -void amii_cleanup( void ); diff --git a/sys/amiga/winami.p b/sys/amiga/winami.p deleted file mode 100644 index 57b9af93c..000000000 --- a/sys/amiga/winami.p +++ /dev/null @@ -1,57 +0,0 @@ -/* NetHack 3.6 winami.p $NHDT-Date: 1433806595 2015/06/08 23:36:35 $ $NHDT-Branch: master $:$NHDT-Revision: 1.7 $ */ -/* Copyright (c) Gregg Wonderly, Naperville, IL, 1992, 1993 */ -/* NetHack may be freely redistributed. See license for details. */ -/* winami.c */ -void amii_raw_print(const char *); -void amii_raw_print_bold(const char *); -void amii_start_menu(winid , unsigned long ); -void amii_add_menu(winid, const glyph_info *, const anything *, char, char, int, int, const char *, unsigned int); -void amii_end_menu(winid, const char *); -int amii_select_menu(winid, int, menu_item **); -void amii_update_inventory(int); -void amii_mark_synch (void); -void amii_wait_synch (void); -void amii_setclipped (void); -void amii_cliparound(int , int ); -void amii_askname (void); -void amii_player_selection (void); -void flush_output (void); -void amii_destroy_nhwindow(winid ); -int amii_create_nhwindow(int ); -void amii_init_nhwindows (void); -int amii_get_ext_cmd(void); -char amii_yn_function(const char * , const char * , char ); -void amii_addtopl(const char *); -void TextSpaces(struct RastPort * , int ); -void amii_putstr(winid , int , const char *); -void amii_putsym(winid , int , int , CHAR_P ); -void amii_clear_nhwindow(winid ); -void amii_exit_nhwindows(const char *); -int amii_nh_poskey(coordxy *, coordxy *, int *); -int amii_nhgetch (void); -void amii_get_nh_event (void); -void amii_remember_topl (void); -int amii_doprev_message (void); -void amii_display_nhwindow(winid , boolean ); -void amii_display_file(const char * , boolean ); -void amii_curs(winid , int , int ); -void amii_print_glyph(winid, coordxy, coordxy, const glyph_info *, const glyph_info *); -void DoMenuScroll(int , int ); -void DisplayData(int , int , int ); -void SetPropInfo(struct Window * , struct Gadget * , long , long , long ); -void kill_nhwindows(int ); -void amii_cl_end(struct amii_WinDesc * , int ); -void cursor_off(winid ); -void cursor_on(winid ); -void amii_getret (void); -void amii_getlin(const char * , char *); -void getlind(const char * , char * , const char *); -void amii_suspend_nhwindows(const char *); -void amii_resume_nhwindows(void); -void amii_bell(void); -void EditColor(void); -void DrawCol( struct Window *, int, UWORD * ) ; -void DispCol( struct Window *w, int idx, UWORD * ) ; -void SetBorder(struct Gadget *) ; -void port_help (void); -void dismiss_nhwindow(winid) ; From 7b559f4d02e896ca00ae14df19e70b8e51062985 Mon Sep 17 00:00:00 2001 From: Ingo Paschke Date: Mon, 11 May 2026 16:40:00 +0200 Subject: [PATCH 09/20] Amiga: delete dead files and dead-macro code Delete amigst.c (empty) and amitty.c (TTY/BBS stub). Drop WINVERS_AMIT, SUPERBITMAP_MAP, EXTMENU, SHELL/dosh(), and the bbs_id reference in src/files.c. --- include/amiconf.h | 2 - src/files.c | 9 ---- sys/amiga/amidos.c | 21 -------- sys/amiga/amigst.c | 28 ---------- sys/amiga/amitty.c | 78 --------------------------- sys/amiga/winami.c | 46 ---------------- sys/amiga/windefs.h | 1 - sys/amiga/winext.h | 3 -- sys/unix/hints/include/cross-post.500 | 2 - sys/unix/hints/include/cross-pre2.500 | 8 +-- 10 files changed, 4 insertions(+), 194 deletions(-) delete mode 100644 sys/amiga/amigst.c delete mode 100644 sys/amiga/amitty.c diff --git a/include/amiconf.h b/include/amiconf.h index a362c94f8..6ce9cbae5 100644 --- a/include/amiconf.h +++ b/include/amiconf.h @@ -180,8 +180,6 @@ typedef unsigned short AMII_COLOR_TYPE; #define ANSI_DEFAULT #endif -extern int amibbs; /* BBS mode? */ - #ifdef AMII_GRAPHICS extern int amii_numcolors; void amii_setpens(int); diff --git a/src/files.c b/src/files.c index 1891ba604..16c0f32c8 100644 --- a/src/files.c +++ b/src/files.c @@ -110,10 +110,6 @@ static char fqn_filename_buffer[FQN_NUMBUF][FQN_MAX_FILENAME]; #ifdef AMIGA extern char PATH[]; /* see sys/amiga/amidos.c */ -extern char bbs_id[]; -#ifdef __SASC_60 -#include -#endif #include extern void amii_set_text_font(char *, int); @@ -1065,11 +1061,6 @@ set_savefile_name(boolean regularize_it) #if defined(MICRO) && !defined(WIN32) && !defined(MSDOS) if (strlen(gs.SAVEP) < (SAVESIZE - 1)) Strcpy(gs.SAVEF, gs.SAVEP); - else -#ifdef AMIGA - if (strlen(gs.SAVEP) + strlen(bbs_id) < (SAVESIZE - 1)) - strncat(gs.SAVEF, bbs_id, PATHLEN); -#endif { int i = strlen(gs.SAVEP); #ifdef AMIGA diff --git a/sys/amiga/amidos.c b/sys/amiga/amidos.c index 475fb4824..e7b22259a 100644 --- a/sys/amiga/amidos.c +++ b/sys/amiga/amidos.c @@ -123,27 +123,6 @@ getlogin(void) /* abs() provided by libnix/stdlib */ -#ifdef SHELL -int -dosh(void) -{ - int i = 0; - char buf[BUFSZ]; - extern struct ExecBase *SysBase; - - /* Only under 2.0 and later ROMs do we have System() */ - if (SysBase->LibNode.lib_Version >= 37 && !amibbs) { - getlin("Enter CLI Command...", buf); - if (buf[0] != '\033') - i = System(buf, NULL); - } else { - i = 0; - pline("No mysterious force prevented you from using multitasking."); - } - return i; -} -#endif /* SHELL */ - #ifdef MFLOPPY #include diff --git a/sys/amiga/amigst.c b/sys/amiga/amigst.c deleted file mode 100644 index c0ace8cdf..000000000 --- a/sys/amiga/amigst.c +++ /dev/null @@ -1,28 +0,0 @@ -/* NetHack 3.6 amigst.c $NHDT-Date: 1432512794 2015/05/25 00:13:14 $ $NHDT-Branch: master $:$NHDT-Revision: 1.7 $ */ -/* Copyright (c) Gregg Wonderly, Naperville, IL, 1992, 1993 */ -/* NetHack may be freely redistributed. See license for details. */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#undef strcmpi -#include -#include - -#include "hack.h" -#include "winprocs.h" -#include "winami.h" - -#include "windefs.h" -#include "winext.h" -#include "winproto.h" - -/* end amigst.c */ diff --git a/sys/amiga/amitty.c b/sys/amiga/amitty.c deleted file mode 100644 index e47f3b693..000000000 --- a/sys/amiga/amitty.c +++ /dev/null @@ -1,78 +0,0 @@ -/* NetHack 3.6 amitty.c $NHDT-Date: 1432512795 2015/05/25 00:13:15 $ $NHDT-Branch: master $:$NHDT-Revision: 1.7 $ */ -/* Copyright (c) Kenneth Lorber, Bethesda, Maryland 1993,1996 */ -/* NetHack may be freely redistributed. See license for details. */ - -/* TTY-specific code for the Amiga - * This is still experimental. - * Still to do: - * add real termcap handling - currently requires ANSI_DEFAULT - */ - -#include "hack.h" -#include "tcap.h" -#include -#include - -void tty_change_color(void); -char *tty_get_color_string(void); - -int amibbs = 0; /* BBS mode */ -char bbs_id[80] = ""; /* BBS uid equivalent */ -long afh_in, afh_out; /* BBS mode Amiga filehandles */ - -#ifdef TTY_GRAPHICS - -void -settty(const char *s) -{ - end_screen(); - if (s) - raw_print(s); - iflags.cbreak = ON; /* this is too easy: probably wrong */ -#if 1 /* should be version>=36 */ - /* if(IsInteractive(afh_in)){ */ - SetMode(afh_in, 0); /* con mode */ -/* } */ -#endif -} -void -gettty() -{ -#if 1 /* should be VERSION >=36 */ - /* if(IsInteractive(afh_in)){ */ - SetMode(afh_in, 1); /* raw mode */ -/* } */ -#endif -} -void -setftty() -{ - iflags.cbreak = ON; /* ditto */ -} -char kill_char = 'X' - '@'; -char erase_char = '\b'; -int -tgetch(void) -{ - unsigned char x; - Read(afh_in, &x, 1); - return (x == '\r') ? '\n' : x; -} -void -get_scr_size() -{ - CO = 80; - LI = 24; -} - -#endif - -void -tty_change_color() -{ -} -char * -tty_get_color_string() -{ - return (""); -} diff --git a/sys/amiga/winami.c b/sys/amiga/winami.c index 97782356b..28f041884 100644 --- a/sys/amiga/winami.c +++ b/sys/amiga/winami.c @@ -422,11 +422,6 @@ amii_get_ext_cmd(void) menu_item *mip; anything id; struct amii_WinDesc *cw; -#ifdef EXTMENU - winid win; - int i; - char buf[256]; -#endif int colx; int bottom = 0; @@ -444,47 +439,6 @@ amii_get_ext_cmd(void) bottom = amii_msgborder(w); colx = 3; -#ifdef EXTMENU - if (iflags.extmenu) { - win = amii_create_nhwindow(NHW_MENU); - amii_start_menu(win, MENU_BEHAVE_STANDARD); - pline("#"); - amii_putstr(WIN_MESSAGE, -1, " "); - - for (i = 0; extcmdlist[i].ef_txt != NULL; ++i) { - id.a_char = *extcmdlist[i].ef_txt; - sprintf(buf, "%-10s - %s ", extcmdlist[i].ef_txt, - extcmdlist[i].ef_desc); - amii_add_menu(win, (const glyph_info *) 0, &id, - extcmdlist[i].ef_txt[0], 0, 0, NO_COLOR, - buf, MENU_ITEMFLAGS_NONE); - } - - amii_end_menu(win, (char *) 0); - sel = amii_select_menu(win, PICK_ONE, &mip); - amii_destroy_nhwindow(win); - - if (sel == 1) { - sel = mip->item.a_char; - for (i = 0; extcmdlist[i].ef_txt != NULL; ++i) { - if (sel == extcmdlist[i].ef_txt[0]) - break; - } - - /* copy in the text */ - if (extcmdlist[i].ef_txt != NULL) { - amii_clear_nhwindow(WIN_MESSAGE); - (void) put_ext_cmd((char *) extcmdlist[i].ef_txt, 0, cw, - bottom); - return (i); - } else - DisplayBeep(NULL); - } - - return (-1); - } -#endif - amii_clear_nhwindow(WIN_MESSAGE); /* Was NHW_MESSAGE */ if (scrollmsg) { pline("#"); diff --git a/sys/amiga/windefs.h b/sys/amiga/windefs.h index 85a800633..07f6da180 100644 --- a/sys/amiga/windefs.h +++ b/sys/amiga/windefs.h @@ -57,7 +57,6 @@ CLIPPING must be defined for the AMIGA version #define WINVERS_AMII (strcmp("amii", windowprocs.name) == 0) #define WINVERS_AMIV (strcmp("amiv", windowprocs.name) == 0) -#define WINVERS_AMIT (strcmp("amitty", windowprocs.name) == 0) /* cw->data[x] contains 2 characters worth of special information. These * characters are stored at the offsets as described here. diff --git a/sys/amiga/winext.h b/sys/amiga/winext.h index e3ef8ef86..02d1436a6 100644 --- a/sys/amiga/winext.h +++ b/sys/amiga/winext.h @@ -59,9 +59,6 @@ extern struct IOStdReq ConsoleIO; extern struct MsgPort *HackPort; extern int txwidth, txheight, txbaseline; -#ifdef SUPERBITMAP_MAP -extern struct BitMap amii_vbm; -#endif /* This gadget data is replicated for menu/text windows... */ extern struct PropInfo PropScroll; diff --git a/sys/unix/hints/include/cross-post.500 b/sys/unix/hints/include/cross-post.500 index 73ba215d7..51357dafb 100644 --- a/sys/unix/hints/include/cross-post.500 +++ b/sys/unix/hints/include/cross-post.500 @@ -232,10 +232,8 @@ endif # CROSS_TO_MIPS ifdef CROSS_TO_AMIGA $(TARGETPFX)amidos.o : ../sys/amiga/amidos.c $(HACK_H) -$(TARGETPFX)amigst.o : ../sys/amiga/amigst.c $(HACK_H) $(TARGETPFX)amirip.o : ../sys/amiga/amirip.c $(HACK_H) $(TARGETPFX)amistack.o : ../sys/amiga/amistack.c $(HACK_H) -$(TARGETPFX)amitty.o : ../sys/amiga/amitty.c $(HACK_H) $(TARGETPFX)amiwind.o : ../sys/amiga/amiwind.c \ ../sys/amiga/amimenu.c $(HACK_H) $(TARGETPFX)winami.o : ../sys/amiga/winami.c $(HACK_H) diff --git a/sys/unix/hints/include/cross-pre2.500 b/sys/unix/hints/include/cross-pre2.500 index 6a1331c6a..44dafac51 100644 --- a/sys/unix/hints/include/cross-pre2.500 +++ b/sys/unix/hints/include/cross-pre2.500 @@ -511,9 +511,9 @@ endif override TARGET_LFLAGS= $(TOOLARCH) -noixemul -Wl,--allow-multiple-definition override TARGET_LIBS += $(LIBLM) VARDATND += nhtiles.bmp -override SYSSRC = ../sys/amiga/amidos.c ../sys/amiga/amigst.c \ +override SYSSRC = ../sys/amiga/amidos.c \ ../sys/amiga/amimenu.c ../sys/amiga/amirip.c \ - ../sys/amiga/amistack.c ../sys/amiga/amitty.c \ + ../sys/amiga/amistack.c \ ../sys/amiga/amiwind.c ../sys/amiga/clipwin.c \ ../sys/amiga/colorwin.c \ ../sys/amiga/winami.c ../sys/amiga/winchar.c \ @@ -522,9 +522,9 @@ override SYSSRC = ../sys/amiga/amidos.c ../sys/amiga/amigst.c \ ../sys/amiga/winstr.c ../sys/share/pcmain.c \ ../win/share/bmptiles.c ../win/share/giftiles.c \ ../win/share/tileset.c -override SYSOBJ = $(TARGETPFX)amidos.o $(TARGETPFX)amigst.o \ +override SYSOBJ = $(TARGETPFX)amidos.o \ $(TARGETPFX)amirip.o $(TARGETPFX)amistack.o \ - $(TARGETPFX)amitty.o $(TARGETPFX)amiwind.o \ + $(TARGETPFX)amiwind.o \ $(TARGETPFX)winami.o $(TARGETPFX)winchar.o \ $(TARGETPFX)winfuncs.o $(TARGETPFX)winkey.o \ $(TARGETPFX)winamenu.o $(TARGETPFX)winreq.o \ From 94a74b84d8674fad44bd32113bb1aeff7d7291ee Mon Sep 17 00:00:00 2001 From: Ingo Paschke Date: Mon, 11 May 2026 16:44:06 +0200 Subject: [PATCH 10/20] Amiga: drop OPT_DISPMAP / display_map / fast_map machinery display_map() was never integrated; no .c defines it. All OPT_DISPMAP / DISPMAP / sysflags.fast_map conditionals were unreachable. --- include/amiconf.h | 4 --- sys/amiga/amiwind.c | 3 -- sys/amiga/winchar.c | 82 +++----------------------------------------- sys/amiga/winfuncs.c | 10 +----- sys/amiga/winproto.h | 4 --- sys/amiga/winreq.c | 6 ---- 6 files changed, 5 insertions(+), 104 deletions(-) diff --git a/include/amiconf.h b/include/amiconf.h index 6ce9cbae5..4d1cb8089 100644 --- a/include/amiconf.h +++ b/include/amiconf.h @@ -154,7 +154,6 @@ extern char *gets(char *); #define MAIL /* Get mail at unexpected occasions */ #define DEFAULT_ICON "NetHack:default.icon" /* private icon */ #define AMIFLUSH /* toss typeahead (select flush in .cnf) */ -/* #define OPT_DISPMAP /* enable fast_map option */ /* new window system options */ /* WRONG - AMIGA_INTUITION should go away */ @@ -201,9 +200,6 @@ struct ami_sysflags { unsigned short amii_dripens[20]; /* DrawInfo Pens currently there are 13 in v39 */ AMII_COLOR_TYPE amii_curmap[AMII_MAXCOLORS]; /* colormap */ #endif -#ifdef OPT_DISPMAP - boolean fast_map; /* use optimized, less flexible map display */ -#endif #ifdef MFLOPPY boolean asksavedisk; #endif diff --git a/sys/amiga/amiwind.c b/sys/amiga/amiwind.c index 80032deb1..705cb88e9 100644 --- a/sys/amiga/amiwind.c +++ b/sys/amiga/amiwind.c @@ -328,9 +328,6 @@ ConvertKey(struct IntuiMessage *message) got = 0; break; } -#ifdef OPT_DISPMAP - dispmap_sanity(); -#endif if (got) { CO = (w->Width - w->BorderLeft - w->BorderRight) / mxsize; diff --git a/sys/amiga/winchar.c b/sys/amiga/winchar.c index 5872e706f..a13a378b3 100644 --- a/sys/amiga/winchar.c +++ b/sys/amiga/winchar.c @@ -27,10 +27,6 @@ #include "winproto.h" #endif -#ifdef OPT_DISPMAP -#define DISPMAP /* use display_map() from dispmap.s */ -#endif - /* NH:sys/amiga/winvchar.c */ int main(int, char **); struct BitMap *MyAllocBitMap(int, int, int, long); @@ -54,10 +50,6 @@ extern int reclip; struct BitMap *MyAllocBitMap(int xsize, int ysize, int depth, long mflags); void MyFreeBitMap(struct BitMap *bmp); -#ifdef DISPMAP -extern void display_map(struct Window *); -#endif - #ifdef TILES_IN_GLYPHMAP extern int maxmontile, maxobjtile, maxothtile; /* from tile.c */ #define MAXMONTILE maxmontile @@ -280,7 +272,6 @@ flush_glyph_buffer(struct Window *vw) void amiv_flush_glyph_buffer(struct Window *vw) { -#if !defined(DISPMAP) || defined(OPT_DISPMAP) int xsize, ysize, x, y; struct BitScaleArgs bsa; struct BitScaleArgs bsm; @@ -290,7 +281,6 @@ amiv_flush_glyph_buffer(struct Window *vw) int i, k; int scaling_needed; struct RastPort *rp = vw->RPort; -#endif /* If nothing is buffered, return before we do anything */ if (glyph_node_index == 0) @@ -299,20 +289,8 @@ amiv_flush_glyph_buffer(struct Window *vw) cursor_off(WIN_MAP); amiv_start_glyphout(WIN_MAP); -#ifdef OPT_DISPMAP - if (sysflags.fast_map) { -#endif -#ifdef DISPMAP - display_map(vw); -#endif -#ifdef OPT_DISPMAP - } else { -#endif -#if !defined(DISPMAP) || defined(OPT_DISPMAP) - /* XXX fix indent */ - /* This is a dynamic value based on this relationship. */ - scaling_needed = - (pictdata.xsize != mxsize || pictdata.ysize != mysize); + /* This is a dynamic value based on this relationship. */ + scaling_needed = (pictdata.xsize != mxsize || pictdata.ysize != mysize); /* If overview window is up, set up to render the correct scale there */ @@ -441,10 +419,6 @@ amiv_flush_glyph_buffer(struct Window *vw) MyFreeBitMap(imgbm); if (bm) MyFreeBitMap(bm); -#endif /* DISPMAP */ -#ifdef OPT_DISPMAP - } -#endif amii_end_glyphout(WIN_MAP); @@ -520,27 +494,8 @@ amiv_lprint_glyph(winid window, int color_index, int glyph) amiv_g_nodes[glyph_node_index].dsty = min(w->BorderTop + (cury * mysize), w->Height - 1); -#ifdef OPT_DISPMAP - if (sysflags.fast_map) { -#endif /* keni */ -#ifdef DISPMAP - /* display_map() needs byte-aligned destinations, and we don't - * want to - * overwrite the window border. - */ - amiv_g_nodes[glyph_node_index].dstx = - (w->BorderLeft + 8 + (curx * mxsize)) & -8; -#endif -#ifdef OPT_DISPMAP - } else { -#endif -#if !defined(DISPMAP) || defined(OPT_DISPMAP) - amiv_g_nodes[glyph_node_index].dstx = - min(w->BorderLeft + (curx * mxsize), w->Width - 1); -#endif -#ifdef OPT_DISPMAP - } -#endif + amiv_g_nodes[glyph_node_index].dstx = + min(w->BorderLeft + (curx * mxsize), w->Width - 1); amiv_g_nodes[glyph_node_index].odsty = cw->cury; amiv_g_nodes[glyph_node_index].odstx = cw->curx; amiv_g_nodes[glyph_node_index].srcx = xoff; @@ -552,17 +507,6 @@ amiv_lprint_glyph(winid window, int color_index, int glyph) int j, k, x, y, apen; struct RastPort *rp = w->RPort; x = rp->cp_x - pictdata.xsize - 3; -#ifdef OPT_DISPMAP - if (sysflags.fast_map) { -#endif -#ifdef DISPMAP - x &= -8; - if (x == 0) - x = 8; -#endif -#ifdef OPT_DISPMAP - } -#endif y = rp->cp_y - pictdata.ysize + 1; @@ -915,21 +859,3 @@ amii_start_glyphout(winid window) } #endif - -#ifdef OPT_DISPMAP -/* don't use dispmap unless x & y are 8,16,24,32,48 and equal */ -void -dispmap_sanity(void) -{ - if (mxsize != mysize || dispmap_sanity1(mxsize) - || dispmap_sanity1(mysize)) { - sysflags.fast_map = 0; - } -} -int -dispmap_sanity1(int x) -{ - static unsigned char valid[] = { 8, 16, 24, 32, 48, 0 }; - return !strchr((char *)valid, x); -} -#endif /* OPT_DISPMAP */ diff --git a/sys/amiga/winfuncs.c b/sys/amiga/winfuncs.c index 919c63830..86fed632f 100644 --- a/sys/amiga/winfuncs.c +++ b/sys/amiga/winfuncs.c @@ -136,9 +136,6 @@ ami_wininit_data(int dir) memcpy(amii_initmap, amiv_init_map, sizeof(amii_initmap)); } -#ifdef OPT_DISPMAP - dispmap_sanity(); -#endif memcpy(sysflags.amii_dripens, amii_defpens, sizeof(sysflags.amii_dripens)); } @@ -1886,12 +1883,7 @@ cursor_on(winid window) /* Save the current information */ -#ifdef DISPMAP - if (WINVERS_AMIV && cw->type == NHW_MAP && !Is_rogue_level(&u.uz)) - x = cw->cursx = (rp->cp_x & -8) + 8; - else -#endif - x = cw->cursx = rp->cp_x; + x = cw->cursx = rp->cp_x; y = cw->cursy = rp->cp_y; apen = rp->FgPen; bpen = rp->BgPen; diff --git a/sys/amiga/winproto.h b/sys/amiga/winproto.h index 6bd486dfb..51e4f26b8 100644 --- a/sys/amiga/winproto.h +++ b/sys/amiga/winproto.h @@ -129,7 +129,3 @@ void amii_outrip(winid tmpwin, int how, time_t when); /* winchar.c */ void SetMazeType(MazeType); int GlyphToIcon(int glyph); -#ifdef OPT_DISPMAP -void dispmap_sanity(void); -int dispmap_sanity1(int); -#endif diff --git a/sys/amiga/winreq.c b/sys/amiga/winreq.c index f25806f22..bf6f21974 100644 --- a/sys/amiga/winreq.c +++ b/sys/amiga/winreq.c @@ -460,9 +460,6 @@ EditClipping(void) yclipbord = aidx + 2; } ShowClipValues(nw); -#ifdef OPT_DISPMAP - dispmap_sanity(); -#endif } else if (gd->GadgetID == GADOKAY) { done = 1; okay = 1; @@ -508,9 +505,6 @@ EditClipping(void) SetBPen(nw->RPort, amii_otherBPen); SetDrMd(nw->RPort, JAM2); Text(nw->RPort, buf, strlen(buf)); -#ifdef OPT_DISPMAP - dispmap_sanity(); -#endif break; } } From 010c068861161c06eed1bcf406dea3fd64606fd2 Mon Sep 17 00:00:00 2001 From: Ingo Paschke Date: Mon, 11 May 2026 16:46:28 +0200 Subject: [PATCH 11/20] Amiga: clean up amiconf.h Remove legacy compiler guards and stale extern declarations (the ami_wbench_* family, CopyFile, ami_argset, ami_mkargline, FromWBench). Drop unused AMII_*_VOLUME / DEFAULT_ICON macros and the IDCMP_CLOSEWINDOW auto-define. --- include/amiconf.h | 98 +---------------------------------------------- 1 file changed, 2 insertions(+), 96 deletions(-) diff --git a/include/amiconf.h b/include/amiconf.h index 4d1cb8089..eda8b3022 100644 --- a/include/amiconf.h +++ b/include/amiconf.h @@ -7,41 +7,17 @@ #define AMICONF_H #undef abs /* avoid using macro form of abs */ -#ifndef __SASC_60 #undef min /* this gets redefined */ #undef max /* this gets redefined */ -#endif #include /* get time_t defined before use! */ -#ifdef CROSS_TO_AMIGA #include #include #include #include #include #include -#endif - -#ifdef __SASC_60 /* since SAS can prevent re-inclusion */ -#include /* general things, including builtins */ -#include -#endif - -#ifdef AZTEC_50 -#include -#define AZTEC_C_WORKAROUND /* Bug which turns up in sounds.c. Bummer... */ -#define NO_SIGNAL /* 5.0 signal handling doesn't like SIGINT... */ -#endif - -#ifdef _DCC -#include -#define _SIZE_T -#endif - -#ifndef __GNUC__ -typedef long off_t; -#endif #define MICRO /* must be defined to allow some inclusions */ @@ -56,66 +32,30 @@ typedef long off_t; /* nhsdat sound library not used in 5.0 */ #undef DLBFILE2 -#ifndef CROSS_TO_AMIGA -#define FILENAME_CMP stricmp /* case insensitive */ -#else #define FILENAME_CMP strcmpi /* case insensitive */ -#endif - -#ifndef __SASC_60 #define O_BINARY 0 -#endif - -/* Compile in New Intuition look for 2.0 */ -#ifdef IDCMP_CLOSEWINDOW -#ifndef INTUI_NEW_LOOK -#define INTUI_NEW_LOOK 1 -#endif -#endif #define MFLOPPY /* You'll probably want this; provides assistance \ * for typical personal computer configurations \ */ -#ifndef CROSS_TO_AMIGA -#define RANDOM -#endif /* ### amidos.c ### */ extern void nethack_exit(int); -/* ### amiwbench.c ### */ - -extern void ami_wbench_init(void); -extern void ami_wbench_args(void); -extern int ami_wbench_getsave(int); -extern void ami_wbench_unlink(char *); -extern int ami_wbench_iconsize(char *); -extern void ami_wbench_iconwrite(char *); -extern int ami_wbench_badopt(const char *); -extern void ami_wbench_cleanup(void); -extern void getlind(const char *, char *, const char *); - /* ### winreq.c ### */ extern void amii_setpens(int); +extern void getlind(const char *, char *, const char *); extern void exit(int); extern void CleanUp(void); extern void Abort(long); extern int getpid(void); -extern char *CopyFile(const char *, const char *); extern int kbhit(void); extern int WindowGetchar(void); -extern void ami_argset(int *, char *[]); -extern void ami_mkargline(int *, char **[]); extern void ami_wininit_data(int); -#define FromWBench 0 /* A hint for compiler ... */ -/* extern boolean FromWBench; /* how were we run? */ -extern int ami_argc; -extern char **ami_argv; - #ifndef MICRO_H #include "micro.h" #endif @@ -125,34 +65,14 @@ extern char **ami_argv; #endif #define remove(x) unlink(x) - -/* DICE wants rewind() to return void. We want it to return int. */ -#if defined(_DCC) || defined(__GNUC__) #define rewind(f) fseek(f, 0, 0) -#endif - -#ifdef AZTEC_C -extern FILE *freopen(const char *, const char *, FILE *); -extern char *gets(char *); -#endif - -/* - * If AZTEC_C we can't use the long cpath in vision.c.... - */ -#ifdef AZTEC_C -#undef MACRO_CPATH -#endif /* * (Possibly) configurable Amiga options: */ #define HACKFONT /* Use special hack.font */ -#ifndef CROSS_TO_AMIGA /* issues with prototype and spawnl */ -#define SHELL /* Have a shell escape command (!) */ -#endif #define MAIL /* Get mail at unexpected occasions */ -#define DEFAULT_ICON "NetHack:default.icon" /* private icon */ #define AMIFLUSH /* toss typeahead (select flush in .cnf) */ /* new window system options */ @@ -170,32 +90,18 @@ typedef unsigned short AMII_COLOR_TYPE; #undef TERMLIB -#define AMII_MUFFLED_VOLUME 40 -#define AMII_SOFT_VOLUME 50 -#define AMII_OKAY_VOLUME 60 -#define AMII_LOUDER_VOLUME 80 - -#ifdef TTY_GRAPHICS -#define ANSI_DEFAULT -#endif - #ifdef AMII_GRAPHICS extern int amii_numcolors; void amii_setpens(int); #endif -/* for cmd.c: override version in micro.h */ -#ifdef __SASC_60 -#undef M -#define M(c) ((c) -128) -#endif struct ami_sysflags { char sysflagsid[10]; #ifdef AMIFLUSH boolean altmeta; /* use ALT keys as META */ boolean amiflush; /* kill typeahead */ #endif -#ifdef AMII_GRAPHICS +#ifdef AMII_GRAPHICS int numcols; unsigned short amii_dripens[20]; /* DrawInfo Pens currently there are 13 in v39 */ AMII_COLOR_TYPE amii_curmap[AMII_MAXCOLORS]; /* colormap */ From c5d8ab1985b6c9e1e3184f353ccbd196506ca5f8 Mon Sep 17 00:00:00 2001 From: Ingo Paschke Date: Mon, 11 May 2026 16:49:11 +0200 Subject: [PATCH 12/20] Amiga: collapse #ifndef CROSS_TO_AMIGA include forks Every #include block had a paired NH: assign path for native builds. Only the cross-compile path is built now. --- sys/amiga/amiwind.c | 10 ---------- sys/amiga/winamenu.c | 6 ------ sys/amiga/winami.c | 10 ---------- sys/amiga/winchar.c | 11 ----------- sys/amiga/winfuncs.c | 10 ---------- sys/amiga/winkey.c | 6 ------ sys/amiga/winreq.c | 14 -------------- sys/amiga/winstr.c | 6 ------ 8 files changed, 73 deletions(-) diff --git a/sys/amiga/amiwind.c b/sys/amiga/amiwind.c index 705cb88e9..5ad6cb503 100644 --- a/sys/amiga/amiwind.c +++ b/sys/amiga/amiwind.c @@ -3,15 +3,9 @@ /* Copyright (c) Kenneth Lorber, Bethesda, Maryland 1993,1996 */ /* NetHack may be freely redistributed. See license for details. */ -#ifndef CROSS_TO_AMIGA -#include "NH:sys/amiga/windefs.h" -#include "NH:sys/amiga/winext.h" -#include "NH:sys/amiga/winproto.h" -#else #include "windefs.h" #include "winext.h" #include "winproto.h" -#endif /* Have to undef CLOSE as display.h and intuition.h both use it */ #undef CLOSE @@ -38,11 +32,7 @@ struct Library *GadToolsBase = NULL; struct Library *LayersBase = NULL; struct Library *AslBase = NULL; -#ifndef CROSS_TO_AMIGA -#include "NH:sys/amiga/amimenu.c" -#else #include "amimenu.c" -#endif /* Now our own variables */ diff --git a/sys/amiga/winamenu.c b/sys/amiga/winamenu.c index 5ab2d7af8..2c53563b8 100644 --- a/sys/amiga/winamenu.c +++ b/sys/amiga/winamenu.c @@ -3,15 +3,9 @@ */ /* NetHack may be freely redistributed. See license for details. */ -#ifndef CROSS_TO_AMIGA -#include "NH:sys/amiga/windefs.h" -#include "NH:sys/amiga/winext.h" -#include "NH:sys/amiga/winproto.h" -#else #include "windefs.h" #include "winext.h" #include "winproto.h" -#endif /* Start building the text for a menu */ void diff --git a/sys/amiga/winami.c b/sys/amiga/winami.c index 28f041884..f2788fbcb 100644 --- a/sys/amiga/winami.c +++ b/sys/amiga/winami.c @@ -3,15 +3,9 @@ */ /* NetHack may be freely redistributed. See license for details. */ -#ifndef CROSS_TO_AMIGA -#include "NH:sys/amiga/windefs.h" -#include "NH:sys/amiga/winext.h" -#include "NH:sys/amiga/winproto.h" -#else #include "windefs.h" #include "winext.h" #include "winproto.h" -#endif #include "dlb.h" @@ -402,10 +396,6 @@ amii_askname(void) } } -/* Discarded ... -jhsa -#include "NH:sys/amiga/char.c" -*/ - /* Get the player selection character */ diff --git a/sys/amiga/winchar.c b/sys/amiga/winchar.c index a13a378b3..9b29152a7 100644 --- a/sys/amiga/winchar.c +++ b/sys/amiga/winchar.c @@ -9,23 +9,12 @@ #include #include -#ifndef CROSS_TO_AMIGA -#include "NH:src/tile.c" -#else #include "../src/tile.c" -#endif -#ifndef CROSS_TO_AMIGA -#include "NH:win/share/tile.h" -#include "NH:sys/amiga/windefs.h" -#include "NH:sys/amiga/winext.h" -#include "NH:sys/amiga/winproto.h" -#else #include "tile.h" #include "windefs.h" #include "winext.h" #include "winproto.h" -#endif /* NH:sys/amiga/winvchar.c */ int main(int, char **); diff --git a/sys/amiga/winfuncs.c b/sys/amiga/winfuncs.c index 86fed632f..46abfd165 100644 --- a/sys/amiga/winfuncs.c +++ b/sys/amiga/winfuncs.c @@ -3,28 +3,18 @@ */ /* NetHack may be freely redistributed. See license for details. */ -#ifndef CROSS_TO_AMIGA -#include "NH:sys/amiga/windefs.h" -#include "NH:sys/amiga/winext.h" -#include "NH:sys/amiga/winproto.h" -#else #include "windefs.h" #include "winext.h" #include "winproto.h" -#endif #include "patchlevel.h" extern struct TagItem scrntags[]; -#ifndef CROSS_TO_AMIGA -extern struct Library *ConsoleDevice; -#else extern struct Device * # ifdef __CONSTLIBBASEDECL__ __CONSTLIBBASEDECL__ # endif /* __CONSTLIBBASEDECL__ */ ConsoleDevice; -#endif static BitMapHeader amii_bmhd; static void cursor_common(struct RastPort *, int, int); diff --git a/sys/amiga/winkey.c b/sys/amiga/winkey.c index f2686bfde..57e47165c 100644 --- a/sys/amiga/winkey.c +++ b/sys/amiga/winkey.c @@ -2,15 +2,9 @@ /* Copyright (c) Gregg Wonderly, Naperville, Illinois, 1991,1992,1993. */ /* NetHack may be freely redistributed. See license for details. */ -#ifndef CROSS_TO_AMIGA -#include "NH:sys/amiga/windefs.h" -#include "NH:sys/amiga/winext.h" -#include "NH:sys/amiga/winproto.h" -#else #include "windefs.h" #include "winext.h" #include "winproto.h" -#endif int amii_nh_poskey(coordxy *x, coordxy *y, int *mod) diff --git a/sys/amiga/winreq.c b/sys/amiga/winreq.c index bf6f21974..76f6c1ec2 100644 --- a/sys/amiga/winreq.c +++ b/sys/amiga/winreq.c @@ -2,15 +2,9 @@ /* Copyright (c) Gregg Wonderly, Naperville, Illinois, 1991,1992,1993. */ /* NetHack may be freely redistributed. See license for details. */ -#ifndef CROSS_TO_AMIGA -#include "NH:sys/amiga/windefs.h" -#include "NH:sys/amiga/winext.h" -#include "NH:sys/amiga/winproto.h" -#else #include "windefs.h" #include "winext.h" #include "winproto.h" -#endif #define GADBLUEPEN 2 #define GADREDPEN 3 @@ -45,11 +39,7 @@ struct NewWindow StrWindow = { &String, NULL, NULL, NULL, NULL, 5, 5, 0xffff, 0xffff, CUSTOMSCREEN }; -#ifndef CROSS_TO_AMIGA -#include "NH:sys/amiga/colorwin.c" -#else #include "colorwin.c" -#endif #define XSIZE 2 #define YSIZE 3 @@ -58,11 +48,7 @@ struct NewWindow StrWindow = { #define GADOKAY 6 #define GADCANCEL 7 -#ifndef CROSS_TO_AMIGA -#include "NH:sys/amiga/clipwin.c" -#else #include "clipwin.c" -#endif void ClearCol(struct Window *w); diff --git a/sys/amiga/winstr.c b/sys/amiga/winstr.c index e6cfd4f45..2f7329467 100644 --- a/sys/amiga/winstr.c +++ b/sys/amiga/winstr.c @@ -2,15 +2,9 @@ /* Copyright (c) Gregg Wonderly, Naperville, Illinois, 1991,1992,1993. */ /* NetHack may be freely redistributed. See license for details. */ -#ifndef CROSS_TO_AMIGA -#include "NH:sys/amiga/windefs.h" -#include "NH:sys/amiga/winext.h" -#include "NH:sys/amiga/winproto.h" -#else #include "windefs.h" #include "winext.h" #include "winproto.h" -#endif /* Put a string into the indicated window using the indicated attribute */ void From 688f9344cd1254cccf132ccfb1d73b95164989f3 Mon Sep 17 00:00:00 2001 From: Ingo Paschke Date: Mon, 11 May 2026 17:00:47 +0200 Subject: [PATCH 13/20] Amiga: route port paths through fqname() Tile loading hard-coded "NetHack:tiles/tiles{16,32}.iff" and PORT_HELP hard-coded "nethack:amii.hlp". Route through fqname(DATAPREFIX) so DATADIR= overrides apply. Refresh amii.hlp to 5.0 content, ship it via amigapkg, and document HACKDIR / SAVEDIR / BONESDIR examples in nethack.cnf. --- include/amiconf.h | 2 +- sys/amiga/amii.hlp | 82 +++++++++++++++++++-------- sys/amiga/amiwind.c | 10 ++-- sys/amiga/nethack.cnf | 14 +++++ sys/amiga/windefs.h | 1 - sys/amiga/winfuncs.c | 16 +++--- sys/unix/hints/include/cross-post.500 | 1 + 7 files changed, 88 insertions(+), 38 deletions(-) diff --git a/include/amiconf.h b/include/amiconf.h index eda8b3022..47306f9d2 100644 --- a/include/amiconf.h +++ b/include/amiconf.h @@ -86,7 +86,7 @@ extern void ami_wininit_data(int); #define AMII_MAXCOLORS (1L << DEPTH) typedef unsigned short AMII_COLOR_TYPE; -#define PORT_HELP "nethack:amii.hlp" +#define PORT_HELP "amii.hlp" #undef TERMLIB diff --git a/sys/amiga/amii.hlp b/sys/amiga/amii.hlp index 88716f05e..13d59ffc6 100644 --- a/sys/amiga/amii.hlp +++ b/sys/amiga/amii.hlp @@ -1,31 +1,63 @@ - Amiga-specific help file for NetHack 3.6 + Amiga-specific help for NetHack 5.0 -The Amiga port of NetHack supports a number of additional commands -and facilities specific to the Amiga. Listed below are the things -which are either specific to the Amiga port or might not appear -in other ports. -While playing NetHack you can press: +Special key combinations +------------------------ + ALT-HELP Edit the screen colour palette. + CTL-HELP Set tile scaling and clipping (amiv only). + SHIFT-HELP Toggle the dungeon overview window (amiv only). - ALT-HELP Color requestor. - CTL-HELP Scale display (amitile only). - SHIFT-HELP Overview window (amitile only). -Amiga-specific run-time options: - altmeta use the alt keys as meta keys - flush throw away keyboard type-ahead +Command-line flags +------------------ + -L Force interlaced (tall) screen. + -l Force non-interlaced screen. -Command line options recognized are +The usual core flags (-D, -X, -u, -p, -r, -@) apply too. - -n No News at game startup. - -X Play in discovery mode. - -D Play in debug mode. - -L Interlaced screen. - -l Never Interlaced screen. - -u Play as player given as - an argument. - -r Pick a race given as an - argument. - -p Pick a profession given - as an argument - -? Gives command line usage. + +Configuration (nethack.cnf in the NetHack: drawer) +-------------------------------------------------- +Window backend selection: + + OPTIONS=windowtype:amiv tile graphics (default) + OPTIONS=windowtype:amii text/character mode + +Amiga-specific runtime options: + + OPTIONS=altmeta ALT+letter sends META+letter (default on). + Disable with !altmeta if your keymap needs + ALT for typing accented characters. + OPTIONS=flush drop any keys queued during long operations + OPTIONS=asksavedisk prompt for a save-disk before saving + (MFLOPPY only) + + +File-location overrides +----------------------- +NetHack: is automatically assigned to the directory the executable was +launched from. All game files default to that volume. Override any of +these in nethack.cnf to relocate parts of the game state: + + HACKDIR=NetHack: program / shared data + LEVELDIR=NetHack: per-level files during play + SAVEDIR=NetHack:save/ save files + BONESDIR=NetHack:bones/ bones files (shared between games) + DATADIR=NetHack: nhdat and other data files + SCOREDIR=NetHack: record / logfile + LOCKDIR=NetHack: lock files + CONFIGDIR=NetHack: per-user config + +You can also override the install path entirely without editing the cnf +by setting the NETHACKDIR or HACKDIR shell environment variable before +launching: + + setenv NETHACKDIR Work:games/nethack-dev/ + Work:games/nethack-dev/nethack + + +Display fallback +---------------- +Tile mode (amiv) requires at least 16 colours and ~384 KB free chip +RAM. If neither is available the game falls back to text mode (amii) +at startup with a one-line note. diff --git a/sys/amiga/amiwind.c b/sys/amiga/amiwind.c index 5ad6cb503..7cb1dcc88 100644 --- a/sys/amiga/amiwind.c +++ b/sys/amiga/amiwind.c @@ -59,15 +59,17 @@ struct TextFont *TextsFont = NULL; struct TextFont *HackFont = NULL; struct TextFont *RogueFont = NULL; -UBYTE FontName[] = "NetHack:hack.font"; -/* # chars in "NetHack:": */ -#define SIZEOF_DISKNAME 8 +/* hack.font is registered via NetHack:hack.font (which references + * NetHack:hack/8). OpenFont()/SetFont() take the bare name; only + * OpenDiskFont() needs the full path. */ +UBYTE HackFontName[] = "hack.font"; +UBYTE HackFontPath[] = "NetHack:hack.font"; #endif struct TextAttr Hack80 = { #ifdef HACKFONT - &FontName[SIZEOF_DISKNAME], + HackFontName, #else (UBYTE *) "topaz.font", #endif diff --git a/sys/amiga/nethack.cnf b/sys/amiga/nethack.cnf index 95952d6a6..b9083d935 100644 --- a/sys/amiga/nethack.cnf +++ b/sys/amiga/nethack.cnf @@ -47,3 +47,17 @@ MENUCOLOR="gray dragon scale"=cyan MENUCOLOR="speed boots"=magenta MENUCOLOR="luckstone"=green MENUCOLOR="unicorn horn"=green + +# *** FILE LOCATIONS *** +# NetHack: is auto-assigned to the directory the binary was launched +# from, so all game files default there. Uncomment any of these to +# relocate part of the game state to a different volume or subdir. +# +#HACKDIR=NetHack: +#LEVELDIR=NetHack: +#SAVEDIR=NetHack:save/ +#BONESDIR=NetHack:bones/ +#DATADIR=NetHack: +#SCOREDIR=NetHack: +#LOCKDIR=NetHack: +#CONFIGDIR=NetHack: diff --git a/sys/amiga/windefs.h b/sys/amiga/windefs.h index 07f6da180..3cd04ee5d 100644 --- a/sys/amiga/windefs.h +++ b/sys/amiga/windefs.h @@ -100,7 +100,6 @@ CLIPPING must be defined for the AMIGA version #define NewWindow ExtNewWindow #define NewScreen ExtNewScreen -#define SIZEOF_DISKNAME 8 #define CSI '\x9b' #define NO_CHAR -1 diff --git a/sys/amiga/winfuncs.c b/sys/amiga/winfuncs.c index 46abfd165..5ccb16313 100644 --- a/sys/amiga/winfuncs.c +++ b/sys/amiga/winfuncs.c @@ -1012,9 +1012,11 @@ amii_init_nhwindows(int *argcp, char **argv) */ if (DiskfontBase = OpenLibrary("diskfont.library", amii_libvers)) { - Hack80.ta_Name -= SIZEOF_DISKNAME; + extern UBYTE HackFontName[], HackFontPath[]; + + Hack80.ta_Name = HackFontPath; HackFont = OpenDiskFont(&Hack80); - Hack80.ta_Name += SIZEOF_DISKNAME; + Hack80.ta_Name = HackFontName; /* Textsfont13 is filled in with "FONT=" settings. The default is * courier/13. @@ -1025,9 +1027,9 @@ amii_init_nhwindows(int *argcp, char **argv) /* Try hack/8 for texts if no user specified font */ if (TextsFont == NULL) { - Hack80.ta_Name -= SIZEOF_DISKNAME; + Hack80.ta_Name = HackFontPath; TextsFont = OpenDiskFont(&Hack80); - Hack80.ta_Name += SIZEOF_DISKNAME; + Hack80.ta_Name = HackFontName; } /* If no fonts, make everything topaz 8 for non-view windows. @@ -1205,10 +1207,10 @@ amii_init_nhwindows(int *argcp, char **argv) if (WINVERS_AMIV) { extern char *tilefile; if (amii_numcolors >= 32) { - tilefile = "NetHack:tiles/tiles32.iff"; + tilefile = (char *) fqname("tiles/tiles32.iff", DATAPREFIX, 0); amii_numcolors = 32; } else { - tilefile = "NetHack:tiles/tiles16.iff"; + tilefile = (char *) fqname("tiles/tiles16.iff", DATAPREFIX, 0); } amii_bmhd = ReadTileImageFiles(); } else @@ -1967,7 +1969,7 @@ removetopl(int cnt) void port_help(void) { - display_file(PORT_HELP, 1); + display_file(fqname(PORT_HELP, DATAPREFIX, 0), 1); } #endif diff --git a/sys/unix/hints/include/cross-post.500 b/sys/unix/hints/include/cross-post.500 index 51357dafb..42e562690 100644 --- a/sys/unix/hints/include/cross-post.500 +++ b/sys/unix/hints/include/cross-post.500 @@ -321,6 +321,7 @@ amigapkg: $(AMITILES) ../util/uudecode ( cd $(TARGETPFX)pkg/NetHack && ../../../../util/uudecode ../../../../sys/amiga/amifont.uu ) cp $(AMISRC)/nethack.cnf $(TARGETPFX)pkg/NetHack/nethack.cnf cp $(AMISRC)/README.amiga $(TARGETPFX)pkg/NetHack/README.amiga + cp $(AMISRC)/amii.hlp $(TARGETPFX)pkg/NetHack/amii.hlp ( cd $(TARGETPFX)pkg/NetHack && ../../../../util/uudecode ../../../../sys/amiga/NHinfo.uu ) ( cd $(TARGETPFX)pkg/NetHack && ../../../../util/uudecode ../../../../sys/amiga/cnf-info.uu ) ( cd $(TARGETPFX)pkg/NetHack && ../../../../util/uudecode ../../../../sys/amiga/license-info.uu ) From 5d86dfccb5b23ecea299515728ecf5d831ac82ef Mon Sep 17 00:00:00 2001 From: Ingo Paschke Date: Mon, 11 May 2026 17:05:13 +0200 Subject: [PATCH 14/20] Amiga: replace WINVERS_AMI* strcmp with WINDOWPORT() id compare The macros were strcmp("amiv", windowprocs.name)==0 at every reference -- 72 sites including inner loops. Use the 5.0 core's WINDOWPORT(wn) which compares wp_id. --- sys/amiga/windefs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/amiga/windefs.h b/sys/amiga/windefs.h index 3cd04ee5d..234d213a8 100644 --- a/sys/amiga/windefs.h +++ b/sys/amiga/windefs.h @@ -55,8 +55,8 @@ CLIPPING must be defined for the AMIGA version #include -#define WINVERS_AMII (strcmp("amii", windowprocs.name) == 0) -#define WINVERS_AMIV (strcmp("amiv", windowprocs.name) == 0) +#define WINVERS_AMII WINDOWPORT(amii) +#define WINVERS_AMIV WINDOWPORT(amiv) /* cw->data[x] contains 2 characters worth of special information. These * characters are stored at the offsets as described here. From c85a8cf60731b0e45b4a6a17a5a00b80ae195e38 Mon Sep 17 00:00:00 2001 From: Ingo Paschke Date: Mon, 11 May 2026 17:07:28 +0200 Subject: [PATCH 15/20] Amiga: drop redundant 'either windowtype' guards Six if(WINVERS_AMIV || WINVERS_AMII) sites are always true with amitty.c gone. --- sys/amiga/winamenu.c | 32 ++++++++++++++------------------ sys/amiga/winfuncs.c | 41 +++++++++++++++++++---------------------- sys/amiga/winreq.c | 36 +++++++++++++++--------------------- 3 files changed, 48 insertions(+), 61 deletions(-) diff --git a/sys/amiga/winamenu.c b/sys/amiga/winamenu.c index 2c53563b8..828ccb4b7 100644 --- a/sys/amiga/winamenu.c +++ b/sys/amiga/winamenu.c @@ -360,10 +360,8 @@ DoMenuScroll(int win, int blocking, int how, menu_item **retmip) } nw->Height = min(ysize, amiIDisplay->ypix - nw->TopEdge); - if (WINVERS_AMIV || WINVERS_AMII) { - /* Make sure we are using the correct hook structure */ - nw->Extension = cw->wintags; - } + /* Make sure we are using the correct hook structure */ + nw->Extension = cw->wintags; /* Now, open the window */ w = cw->win = OpenShWindow((void *) nw); @@ -535,21 +533,19 @@ DoMenuScroll(int win, int blocking, int how, menu_item **retmip) * amii_cl_end if window shrinks and columns decrease. */ - if (WINVERS_AMII || WINVERS_AMIV) { - amii_setfillpens(w, cw->type); - SetDrMd(w->RPort, JAM2); - x2 = w->Width - w->BorderRight; - y2 = w->Height - w->BorderBottom; - x1 = x2 - w->IFont->tf_XSize - w->IFont->tf_XSize; - y1 = w->BorderTop; - if (x1 < w->BorderLeft) - x1 = w->BorderLeft; - RectFill(w->RPort, x1, y1, x2, y2); + amii_setfillpens(w, cw->type); + SetDrMd(w->RPort, JAM2); + x2 = w->Width - w->BorderRight; + y2 = w->Height - w->BorderBottom; + x1 = x2 - w->IFont->tf_XSize - w->IFont->tf_XSize; + y1 = w->BorderTop; + if (x1 < w->BorderLeft) x1 = w->BorderLeft; - y1 = y1 - w->IFont->tf_YSize; - RectFill(w->RPort, x1, y1, x2, y2); - RefreshWindowFrame(w); - } + RectFill(w->RPort, x1, y1, x2, y2); + x1 = w->BorderLeft; + y1 = y1 - w->IFont->tf_YSize; + RectFill(w->RPort, x1, y1, x2, y2); + RefreshWindowFrame(w); /* Make the prop gadget the right size and place */ diff --git a/sys/amiga/winfuncs.c b/sys/amiga/winfuncs.c index 5ccb16313..d22b95c53 100644 --- a/sys/amiga/winfuncs.c +++ b/sys/amiga/winfuncs.c @@ -538,29 +538,26 @@ amii_create_nhwindow(int type) wd = (struct amii_WinDesc *) alloc(sizeof(struct amii_WinDesc)); memset(wd, 0, sizeof(struct amii_WinDesc)); - /* Both, since user may have changed the pen settings so respect those */ - if (WINVERS_AMII || WINVERS_AMIV) { - /* Special backfill for these types of layers */ - switch (type) { - case NHW_MESSAGE: - case NHW_STATUS: - case NHW_TEXT: - case NHW_MENU: - case NHW_BASE: - case NHW_OVER: - case NHW_MAP: - if (wd) { - fillhook.h_Entry = (void *) &LayerFillHook; - fillhook.h_Data = (void *) type; - fillhook.h_SubEntry = 0; - wd->hook = alloc(sizeof(fillhook)); - memcpy(wd->hook, &fillhook, sizeof(fillhook)); - memcpy(wd->wintags, wintags, sizeof(wd->wintags)); - wd->wintags[0].ti_Data = (long) wd->hook; - nw->Extension = (void *) wd->wintags; - } - break; + /* Special backfill for these types of layers */ + switch (type) { + case NHW_MESSAGE: + case NHW_STATUS: + case NHW_TEXT: + case NHW_MENU: + case NHW_BASE: + case NHW_OVER: + case NHW_MAP: + if (wd) { + fillhook.h_Entry = (void *) &LayerFillHook; + fillhook.h_Data = (void *) type; + fillhook.h_SubEntry = 0; + wd->hook = alloc(sizeof(fillhook)); + memcpy(wd->hook, &fillhook, sizeof(fillhook)); + memcpy(wd->wintags, wintags, sizeof(wd->wintags)); + wd->wintags[0].ti_Data = (long) wd->hook; + nw->Extension = (void *) wd->wintags; } + break; } /* Don't open MENU or TEXT windows yet */ diff --git a/sys/amiga/winreq.c b/sys/amiga/winreq.c index 76f6c1ec2..d4a1bc362 100644 --- a/sys/amiga/winreq.c +++ b/sys/amiga/winreq.c @@ -108,13 +108,11 @@ EditColor(void) ((struct PropInfo *) Col_RedPen.SpecialInfo)->Flags |= PROPNEWLOOK; ((struct PropInfo *) Col_GreenPen.SpecialInfo)->Flags |= PROPNEWLOOK; } - if (WINVERS_AMIV || WINVERS_AMII) { - Col_NewWindowStructure1.Extension = wintags; - Col_NewWindowStructure1.Flags |= WFLG_NW_EXTENDED; - fillhook.h_Entry = (void *) &LayerFillHook; - fillhook.h_Data = (void *) -2; - fillhook.h_SubEntry = 0; - } + Col_NewWindowStructure1.Extension = wintags; + Col_NewWindowStructure1.Flags |= WFLG_NW_EXTENDED; + fillhook.h_Entry = (void *) &LayerFillHook; + fillhook.h_Data = (void *) -2; + fillhook.h_SubEntry = 0; nw = OpenWindow((void *) &Col_NewWindowStructure1); @@ -360,13 +358,11 @@ EditClipping(void) ((struct PropInfo *) ClipXCLIP.SpecialInfo)->Flags |= PROPNEWLOOK; ((struct PropInfo *) ClipYCLIP.SpecialInfo)->Flags |= PROPNEWLOOK; } - if (WINVERS_AMIV || WINVERS_AMII) { - ClipNewWindowStructure1.Extension = wintags; - ClipNewWindowStructure1.Flags |= WFLG_NW_EXTENDED; - fillhook.h_Entry = (void *) &LayerFillHook; - fillhook.h_Data = (void *) -2; - fillhook.h_SubEntry = 0; - } + ClipNewWindowStructure1.Extension = wintags; + ClipNewWindowStructure1.Flags |= WFLG_NW_EXTENDED; + fillhook.h_Entry = (void *) &LayerFillHook; + fillhook.h_Data = (void *) -2; + fillhook.h_SubEntry = 0; nw = OpenWindow((void *) &ClipNewWindowStructure1); @@ -807,13 +803,11 @@ getlind(const char *prompt, char *bufp, const char *dflt) once = 1; } - if (WINVERS_AMIV || WINVERS_AMII) { - StrWindow.Extension = wintags; - StrWindow.Flags |= WFLG_NW_EXTENDED; - fillhook.h_Entry = (void *) &LayerFillHook; - fillhook.h_Data = (void *) -2; - fillhook.h_SubEntry = 0; - } + StrWindow.Extension = wintags; + StrWindow.Flags |= WFLG_NW_EXTENDED; + fillhook.h_Entry = (void *) &LayerFillHook; + fillhook.h_Data = (void *) -2; + fillhook.h_SubEntry = 0; if ((cwin = OpenWindow((void *) &StrWindow)) == NULL) { return; From 8dbbbc2fefeffa7a4bfa44d9b98c686ba6225aa5 Mon Sep 17 00:00:00 2001 From: Ingo Paschke Date: Mon, 11 May 2026 17:09:18 +0200 Subject: [PATCH 16/20] Amiga: deduplicate amii_procs and amiv_procs Factor common body into AMI_WIN_PROCS_BODY. The POSITIONBAR / CLIPPING / CHANGE_COLOR guards in the original were dead. --- sys/amiga/winami.c | 97 +++++++++++++--------------------------------- 1 file changed, 28 insertions(+), 69 deletions(-) diff --git a/sys/amiga/winami.c b/sys/amiga/winami.c index f2788fbcb..19a660e42 100644 --- a/sys/amiga/winami.c +++ b/sys/amiga/winami.c @@ -32,76 +32,35 @@ long amii_scrnmode; /* Interface definition, for use by windows.c and winprocs.h to provide * the intuition interface for the amiga... */ -struct window_procs amii_procs = { - WPID(amii), - WC_COLOR | WC_HILITE_PET | WC_INVERSE, - 0L, - {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, /* color availability */ - amii_init_nhwindows, - amii_player_selection, amii_askname, amii_get_nh_event, - amii_exit_nhwindows, amii_suspend_nhwindows, amii_resume_nhwindows, - amii_create_nhwindow, amii_clear_nhwindow, amii_display_nhwindow, - amii_destroy_nhwindow, amii_curs, amii_putstr, genl_putmixed, - amii_display_file, amii_start_menu, amii_add_menu, amii_end_menu, - amii_select_menu, genl_message_menu, - amii_mark_synch, amii_wait_synch, -#ifdef CLIPPING - amii_cliparound, -#endif -#ifdef POSITIONBAR - donull, -#endif - amii_print_glyph, amii_raw_print, amii_raw_print_bold, amii_nhgetch, - amii_nh_poskey, amii_bell, amii_doprev_message, amii_yn_function, - amii_getlin, amii_get_ext_cmd, amii_number_pad, amii_delay_output, -#ifdef CHANGE_COLOR /* only a Mac option currently */ - amii_change_color, amii_get_color_string, -#endif - amii_outrip, genl_preference_update, - genl_getmsghistory, genl_putmsghistory, - genl_status_init, genl_status_finish, genl_status_enablefield, - genl_status_update, - genl_can_suspend_yes, - amii_update_inventory, - amii_ctrl_nhwindow, -}; +/* Both windowports share the same function table -- the AMII (text) / + * AMIV (tile) split happens at runtime based on WINVERS_AMIV checks. */ +#define AMI_WIN_PROCS_BODY \ + WC_COLOR | WC_HILITE_PET | WC_INVERSE, \ + 0L, \ + { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, /* has_color */ \ + amii_init_nhwindows, \ + amii_player_selection, amii_askname, amii_get_nh_event, \ + amii_exit_nhwindows, amii_suspend_nhwindows, amii_resume_nhwindows, \ + amii_create_nhwindow, amii_clear_nhwindow, amii_display_nhwindow, \ + amii_destroy_nhwindow, amii_curs, amii_putstr, genl_putmixed, \ + amii_display_file, amii_start_menu, amii_add_menu, amii_end_menu, \ + amii_select_menu, genl_message_menu, \ + amii_mark_synch, amii_wait_synch, \ + amii_cliparound, \ + amii_print_glyph, amii_raw_print, amii_raw_print_bold, amii_nhgetch,\ + amii_nh_poskey, amii_bell, amii_doprev_message, amii_yn_function, \ + amii_getlin, amii_get_ext_cmd, amii_number_pad, amii_delay_output, \ + amii_change_color, amii_get_color_string, \ + amii_outrip, genl_preference_update, \ + genl_getmsghistory, genl_putmsghistory, \ + genl_status_init, genl_status_finish, genl_status_enablefield, \ + genl_status_update, \ + genl_can_suspend_yes, \ + amii_update_inventory, \ + amii_ctrl_nhwindow -/* The view window layout uses the same function names so we can use - * a shared library to allow the executable to be smaller. - */ -struct window_procs amiv_procs = { - WPID(amiv), - WC_COLOR | WC_HILITE_PET | WC_INVERSE, - 0L, - {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, /* color availability */ - amii_init_nhwindows, - amii_player_selection, amii_askname, amii_get_nh_event, - amii_exit_nhwindows, amii_suspend_nhwindows, amii_resume_nhwindows, - amii_create_nhwindow, amii_clear_nhwindow, amii_display_nhwindow, - amii_destroy_nhwindow, amii_curs, amii_putstr, genl_putmixed, - amii_display_file, amii_start_menu, amii_add_menu, amii_end_menu, - amii_select_menu, genl_message_menu, - amii_mark_synch, amii_wait_synch, -#ifdef CLIPPING - amii_cliparound, -#endif -#ifdef POSITIONBAR - donull, -#endif - amii_print_glyph, amii_raw_print, amii_raw_print_bold, amii_nhgetch, - amii_nh_poskey, amii_bell, amii_doprev_message, amii_yn_function, - amii_getlin, amii_get_ext_cmd, amii_number_pad, amii_delay_output, -#ifdef CHANGE_COLOR /* only a Mac option currently */ - amii_change_color, amii_get_color_string, -#endif - amii_outrip, genl_preference_update, - genl_getmsghistory, genl_putmsghistory, - genl_status_init, genl_status_finish, genl_status_enablefield, - genl_status_update, - genl_can_suspend_yes, - amii_update_inventory, - amii_ctrl_nhwindow, -}; +struct window_procs amii_procs = { WPID(amii), AMI_WIN_PROCS_BODY }; +struct window_procs amiv_procs = { WPID(amiv), AMI_WIN_PROCS_BODY }; unsigned short amii_initmap[AMII_MAXCOLORS]; /* Default pens used unless user overides in nethack.cnf. */ From 344063afb6a0ce09d777b7b8f688fe16c0942179 Mon Sep 17 00:00:00 2001 From: Ingo Paschke Date: Mon, 11 May 2026 17:14:10 +0200 Subject: [PATCH 17/20] Amiga: route non-menu messages from DoMenuScroll to ProcessMessage DoMenuScroll dropped IDCMP messages for non-owner windows -- so a resize of WIN_INVEN or close-gadget on WIN_OVER during a menu never reached the game state. Forward those to ProcessMessage; VANILLAKEY/RAWKEY stay with the menu. --- sys/amiga/amiwind.c | 4 ++-- sys/amiga/winamenu.c | 8 +++++--- sys/amiga/winproto.h | 1 + 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/sys/amiga/amiwind.c b/sys/amiga/amiwind.c index 7cb1dcc88..d259d5128 100644 --- a/sys/amiga/amiwind.c +++ b/sys/amiga/amiwind.c @@ -17,7 +17,7 @@ static struct Message *GetFMsg(struct MsgPort *); #endif static int BufferGetchar(void); -static void ProcessMessage(struct IntuiMessage *message); +void ProcessMessage(struct IntuiMessage *message); #define BufferQueueChar(ch) (KbdBuffer[KbdBuffered++] = (ch)) @@ -354,7 +354,7 @@ ConvertKey(struct IntuiMessage *message) * ahead of input demands, when the user types ahead. */ -static void +void ProcessMessage(struct IntuiMessage *message) { int c; diff --git a/sys/amiga/winamenu.c b/sys/amiga/winamenu.c index 828ccb4b7..19d439563 100644 --- a/sys/amiga/winamenu.c +++ b/sys/amiga/winamenu.c @@ -463,11 +463,13 @@ DoMenuScroll(int win, int blocking, int how, menu_item **retmip) mx = imsg->MouseX; my = imsg->MouseY; - /* Only do our window or VANILLAKEY from other windows */ - + /* Only do our window or VANILLAKEY from other windows. + * Background events (NEWSIZE on inventory, CLOSEWINDOW + * on overview, etc.) get routed to the main dispatcher + * so the game stays in sync. ProcessMessage ReplyMsgs. */ if (imsg->IDCMPWindow != w && class != VANILLAKEY && class != RAWKEY) { - ReplyMsg((struct Message *) imsg); + ProcessMessage(imsg); continue; } diff --git a/sys/amiga/winproto.h b/sys/amiga/winproto.h index 51e4f26b8..831db69a3 100644 --- a/sys/amiga/winproto.h +++ b/sys/amiga/winproto.h @@ -53,6 +53,7 @@ void SetPropInfo(struct Window *win, struct Gadget *gad, long vis, long total, struct Window *OpenShWindow(struct NewWindow *nw); void CloseShWindow(struct Window *win); int ConvertKey(struct IntuiMessage *message); +void ProcessMessage(struct IntuiMessage *message); int kbhit(void); int amikbhit(void); int WindowGetchar(void); From 2e61bf768f05316cf70c7e9e91883c08734aad66 Mon Sep 17 00:00:00 2001 From: Ingo Paschke Date: Mon, 11 May 2026 17:34:03 +0200 Subject: [PATCH 18/20] Amiga: fix port_help double-prefix path display_file -> dlb_fopen -> fopen_datafile already prepends DATAPREFIX; wrapping PORT_HELP in fqname() too produced "NetHack:NetHack:amii.hlp". --- sys/amiga/winfuncs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/amiga/winfuncs.c b/sys/amiga/winfuncs.c index d22b95c53..b964d9ffc 100644 --- a/sys/amiga/winfuncs.c +++ b/sys/amiga/winfuncs.c @@ -1966,7 +1966,9 @@ removetopl(int cnt) void port_help(void) { - display_file(fqname(PORT_HELP, DATAPREFIX, 0), 1); + /* display_file -> dlb_fopen -> fopen_datafile already routes through + DATAPREFIX; pass the bare filename. */ + display_file(PORT_HELP, 1); } #endif From d1a84de8fc03d532300988c6d52ad7ca1d944e37 Mon Sep 17 00:00:00 2001 From: Ingo Paschke Date: Mon, 11 May 2026 18:01:24 +0200 Subject: [PATCH 19/20] Amiga: delete outdated/sys/amiga/ These 3.4.1-era files are superseded: Build/Install.ami -> README.amiga; Makefile.ami/.agc -> sys/unix/hints/include/cross-*.500; NetHack.cnf -> sys/amiga/nethack.cnf; txt2iff/xpm2iff.c -> sys/amiga/*_host.c. --- Files | 5 - outdated/sys/amiga/.gitattributes | 2 - outdated/sys/amiga/Build.ami | 140 --- outdated/sys/amiga/Install.ami | 200 ---- outdated/sys/amiga/Makefile.agc | 1241 ----------------------- outdated/sys/amiga/Makefile.ami | 1578 ----------------------------- outdated/sys/amiga/NetHack.cnf | 213 ---- outdated/sys/amiga/ifchange | 55 - outdated/sys/amiga/mkdmake | 13 - outdated/sys/amiga/txt2iff.c | 446 -------- outdated/sys/amiga/xpm2iff.c | 363 ------- 11 files changed, 4256 deletions(-) delete mode 100644 outdated/sys/amiga/.gitattributes delete mode 100644 outdated/sys/amiga/Build.ami delete mode 100644 outdated/sys/amiga/Install.ami delete mode 100644 outdated/sys/amiga/Makefile.agc delete mode 100644 outdated/sys/amiga/Makefile.ami delete mode 100644 outdated/sys/amiga/NetHack.cnf delete mode 100644 outdated/sys/amiga/ifchange delete mode 100644 outdated/sys/amiga/mkdmake delete mode 100644 outdated/sys/amiga/txt2iff.c delete mode 100644 outdated/sys/amiga/xpm2iff.c diff --git a/Files b/Files index 50d8ecfba..be2f6d514 100644 --- a/Files +++ b/Files @@ -132,11 +132,6 @@ wceconf.h mac-carbon.h mac-qt.h mac-term.h macconf.h macpopup.h mactty.h macwin.h mttypriv.h -outdated/sys/amiga: -(files for Amiga versions - untested for 5.0) -Build.ami Install.ami Makefile.agc Makefile.ami NetHack.cnf -ifchange mkdmake txt2iff.c xpm2iff.c - outdated/sys/atari: (files for Atari version - untested for 5.0) Install.tos atarifnt.uue nethack.mnu setup.g tos.c diff --git a/outdated/sys/amiga/.gitattributes b/outdated/sys/amiga/.gitattributes deleted file mode 100644 index 483f30202..000000000 --- a/outdated/sys/amiga/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -*.p NHSUBST -* NH_filestag=(file%s_for_Amiga_versions_-_untested_for_5.0) diff --git a/outdated/sys/amiga/Build.ami b/outdated/sys/amiga/Build.ami deleted file mode 100644 index 2b435d827..000000000 --- a/outdated/sys/amiga/Build.ami +++ /dev/null @@ -1,140 +0,0 @@ - - Compiling Amiga NetHack 3.4 - Last Revision: 21 February 2002 for NetHack 3.4.1 - - - We would like to thank each and every one of the people who took - the time and effort to report bugs to us. THANK YOU! (And keep - up the good work!) - -I. Introduction - - The Amiga-specific documentation has been split since the 3.1.3 release - - please read the file Install.ami for information specific to the - Amiga port before continuing. - - If you have problems with compilation, installation, or think you have - found a bug in the game, please report it by electronic mail to the - development group at nethack-bugs@nethack.org, where it will be routed - to the appropriate person. Include your configuration, the version of - NetHack you are playing (use the 'v' command or see - include/patchlevel.h), and as much specific information as possible. - As NetHack runs on many different machines, be sure to mention that you - are playing the Amiga version and also mention if you are using the - version for mc68k or ppc. - - If you want to find out about distributing NetHack, read the license - (in NetHack:license or type ?i during the game). - -II. Compiling Amiga NetHack 3.4 - -II.A. Compilation Overview - Compiling NetHack is not very hard - basically you do a little - configuration and start make. It does, however, require a good amount - of disk space and time. It also needs a good bit of memory, especially - for linking. - -II.B. Basic Compilation - - NetHack can be built with SAS/C version 6.5x. The commercial version - of DICE might work, but NetHack version 3.2.2 or later haven't been - compiled with it. The "official" compiler for NetHack 3.6 is SAS/C 6.58 - - we have dropped support for SAS/C 5.x. - - The Manx/Aztec port has not been tested recently and is certainly - broken. Anyone managing to compile NetHack with this compiler is - encouraged to submit context diffs of the required changes. When last - tested, NetHack required version 5.0B of that compiler. - - Compiling with gcc should also work. - -II.B.1. Introduction to Compiling NetHack - Before doing any compilation, read the README files distributed with - the source. These should familiarize you with the source tree layout - and what files are shared with what computers; everything in the - sys/amiga directory is used exclusively by the Amiga. - - The makefile (sys/amiga/Makefile.ami) depends on certain assignments, - providing the developer with a fairly flexible environment. See - sys/amiga/Makefile.ami for assignment assumptions. DICE users should - see section II.B.3 for information on creating a DMakefile usable with - DMake. - - Edit config.h to your liking and system configuration. The defaults - should be satisfactory for most systems. - - Read VERY CAREFULLY through the Makefile to familiarize yourself - with which assignments are assumed. Otherwise, you're going to get - something like "Insert NH: in any drive." You will need uudecode, - and, if you need to modify dgn_comp or lev_comp, flex, and bison. - The first thing Makefile.ami does is build makedefs, which handles - a variety of data file generation, and then lev_comp and dgn_comp - which compile the special levels. Makedefs will then be run to create - a few files, followed by a roughly alphabetically sorted compilation - of the entire source tree. This process will compile selected files - from the sys/amiga, sys/share, win/tty, and src directories, eventually - creating sbin/nethack. After building the main binary, a make install - will build the auxiliary files including help files, special levels, - icons, and the font files and will put these files into their final - positions - most will be in dlb archives (if DLB was defined in config.h). - The first make run should be done in NH:obj and the make install should be - done in NetHack:; for both runs, the makefile is NH:sys/amiga/Makefile.ami - (or NH:sys/amiga/DMakefile for DMake and NH:sys/amiga/Makefile.agc for - gcc). - - Note that not all the source is simple C code. If you are modifying - lev_comp or dgn_comp you may need bison and/or flex (depending on what - modifications you are making). You do not need any of these tools to - simply build NetHack - all the C output files are provided in the source - distribution. Also, the ifchange script requires a version of diff that - produces standard Unix format context diffs for proper operation - the - version shipped with SAS/C is not sufficient. - - If you do not have bison and flex, copy the files from sys/share. The - include files go in include/ and the C files go in util/. If the compile - fails due to prototype errors for malloc and realloc, try deleting - the first line of lev_comp.c and dgn_comp.c. - -II.B.2. Compiling NetHack with SAS/C version 6.58 - - NOTE WELL - Amiga NetHack has dropped support for SAS/C version 5. - This version of NetHack was developed with SAS/C 6.58. Earlier versions - than version of the compiler are known to cause problems - don't use them. - - A couple of notes and warnings from the SAS/C users on the team: - - * Included in the SAS/C port is code for generating a SnapShot.tb - file upon catching various internal disasters. That is why the - debug=l flag is in the makefile. This adds about 270K to the disk - image, but it does not increase the run time memory requirements. - - * The 5.10b optimizer did not produce correct code for NetHack. The - current optimizer has not been tested. - -II.B.3. Compiling NetHack with the commercial version of DICE - - IMPORTANT NOTE: If you are using DMake, you need to create DMakefile - from Makefile.ami. Do the following: - - cd NH:sys/amiga - edit from Makefile.ami to DMakefile with mkdmake opt w255 - - Some versions of DMake have been known to crash horribly on the - makefile - if this happens, you'll need to download another make - utility, such as AMake (ftp://ftp.dragonfire.net/amiga/utils/amake), - which will run in DMake-compatibility mode if invoked with the -C switch - (e.g. "amake -C -f NH:sys/amiga/DMakefile", or just - "alias dmake amake -C"). - - SECOND IMPORTANT NOTE: The score list is currently disabled when - compiling under DICE, due to an as-yet-unknown problem which causes - system crashes when displaying the score list. - - NetHack can be compiled using the commercial version of DICE only. The - registered shareware version had a bug in it which resulted in odd- - aligned procedures. (It is possible to patch DC1 to fix this problem; - however, this is not recommended, and you should upgrade to the - commercial version.) - - During compilation, DICE will output a lot of warnings; they can be - safely ignored. diff --git a/outdated/sys/amiga/Install.ami b/outdated/sys/amiga/Install.ami deleted file mode 100644 index 58ad2409b..000000000 --- a/outdated/sys/amiga/Install.ami +++ /dev/null @@ -1,200 +0,0 @@ - - Using and Installing Amiga NetHack 3.4 - (or Everything You Never Wanted to Know Before NetHacking) - (or Not Everything That Happens Always Comes Knocking) - - Last Revision: 28 March 2000 for NetHack 3.4.1 - - -0. Pre-intro for NetHack 3.4.1: - Amiga-specific changes for 3.4.1: - Most (around 99%) known bugs fixed (volunteers welcome). - HackWB and HackCli are no longer supported. Use the main binary. - - We would like to thank each and every one of the people who took - the time and effort to report bugs to us. THANK YOU! - -I. Introduction - -I.A. Overview - Welcome to Amiga NetHack! If this is your first visit to our fair - city, you are in for an amazing but dangerous journey; if you have - visited us before, beware! the city has changed in many strange and - subtle ways; it has also grown quite a bit. This missive brings to - light those mundane tasks which must be dealt with before beginning - your journey; for those of you who are faced with the task of - installing the pre-fabricated version of our town, section III - (Installing Amiga NetHack 3.6) will guide you through the task at - hand. If you are ready to visit, the local visitors guide is in - section II (Using Amiga NetHack 3.6); please also see the general - guide packaged separately (the file "GuideBook"). - - To all our visitors, a hearty Welcome! - and please be careful. - - [Those responsible for the previous paragraphs have been sacked. The - documentation has been completed at great expense in a more traditional - style. -- The Management] - -I.B. Getting Help - If you have questions about strategy, weapons, or monsters, the best - place to go for help is the Usenet newsgroup rec.games.roguelike.nethack. - - If you have problems with installation or think you have found a bug - in the game, please report it by electronic mail to the development - team at nethack-bugs@nethack.org, where it will be routed to the - appropriate person. Include your configuration, the version of - NetHack you are playing (use the 'v' command), whether or not you are - using an official binary release (and if so which one) and as much - specific information as possible. As NetHack runs on many different - machines, be sure to mention that you are playing the Amiga version. - -I.C. Credits - Olaf Seibert first ported NetHack 2.3 and 3.0 to the Amiga. Richard - Addison, Andrew Church, Jochen Erwied, Mark Gooderum, Ken Lorber, - Greg Olson, Mike Passaretti, and Gregg Wonderly polished and extended - the 3.0 and 3.1 ports. Andrew Church, Ken Lorber, and Gregg Wonderly - are responsible for the 3.2 port. Janne Salmijärvi resurrected the - amigaport for 3.3 and Teemu Suikki joined before 3.4.0. - -II. Using Amiga NetHack 3.4 - Run NetHack from the shell or from some tool that allows that, - ie. ToolManager. See the NetHack.txt file for command line options - and other usage. - -II.A. Sources of Information - Where to go depends on what you want to find out. If you want to find - out about distributing NetHack, read the license (in NetHack:license - or type ?i during the game). For an introduction to NetHack, read - the GuideBook file. To find out what options are compiled into your - copy of NetHack, type #v during the game. Finally, for information - during the game on all kinds of things, type ? and select from the - menu or by pressing Help key. - -II.B. The Amiga NetHack WorkBench Front End - Starting from 3.3.0 HackWB is not supported. - -II.C. The Amiga NetHack CLI Front End - Starting from 3.3.0 CLI Front end is not supported either. - - Instead, use the main binary. See NetHack.txt file for the standard Unix - flags for NetHack. In addition to those flags, Amiga NetHack accepts - the flags -l to force non-interlaced mode and -L to force interlaced mode. - -II.D. Amiga-Specific Information for NetHack - - There are several options that are unique to the Amiga version of - NetHack that may be specified in the NetHack.cnf file or on an - OPTIONS line: - - altmeta allows the ALT keys to function as META keys. The default - is altmeta. - flush flush discards all characters in the queue except the first, - which limits typeahead accidents. The default is !flush. - silent turn off the audio output. The default is silent. - - The current version of Amiga NetHack also supports menu accelerators. - See Guidebook.txt for a detailed description. Also supported is - selecting the number of stacked objects to drop, used with the (D)rop - command. Type the number and then select an item (or items with - accelerators). Items with a count associated with them are denoted - with # in place of -. I.e. 'd - 3 blessed daggers' becomes - 'd # 3 blessed daggers'. You can clear the count by hitting esc - while counting or deselect and reselect the item. The default - is to drop all selected items (as before). - - For other options how to configure the screen setting and colors refer - to Nethack.cnf. - -III. Installing Amiga NetHack 3.4 - -III.A. General Installation - Installation should be easy - basically it consists of putting files - where they belong and adding an assign to your startup. If you are - installing from the official binary distribution, simply unpacking - the archive in the appropriate directory will put the files in the - places they belong. - - IF YOU ALREADY HAVE A PREVIOUS VERSION INSTALLED YOU MUST DELETE THE - OLD SAVE AND BONES FILES - THEY WILL NOT WORK! This includes save - and bones files from all previous versions of NetHack (yes, even 3.3.1). - If you have a game in progress and want to finish it, use your - current version and then update. - -Will NetHack fit on your machine? - NetHack 3.6 is large. NetHack 3.4 is very large. You will need: - > Any standard series Amiga: 500, 600, 1000, 1200, 2000, 2500, 3000, 4000. - > WorkBench 2.04 or later. - > At least 3 meg of RAM. NetHack will NOT run in 1 meg (probably even 2). - > Mass storage: A hard drive with over 3 meg of free space is highly - recommended. - -Hard Disk Installation: - Unpack the archive to your place of choice. Since you are reading this - you've probably done that already. Now just assign NetHack: to - NetHack directory containing the executable and datafiles and other needed - directories. - - Use the table in the next section to see where things should end up. - Be sure that the file 8 ends up in NetHack:hack/8. - -Configuration - Using your favorite text editor, edit NetHack:NetHack.cnf to match - your system. - - Create the save file directory (makedir NetHack:save) and the levels file - directory (makedir NetHack:levels), if they don't already exist. - - Create the score file (echo to NetHack:record) and, if desired, the log - file (echo to NetHack:logfile), if they don't already exist. You may - leave out logfile, but record is needed. - -III.B. File Location Table -NetHack: - amii.hlp Guidebook.txt hack.font - license NetHack NetHack.cnf - NetHack.txt nhdat nhsdat - record Recover Recover.txt - logfile (optional, but useful) -NetHack:hack - 8 -NetHack:tiles - monsters.iff objects.iff other.iff - -IV. BBS Interface - - [Since HackCli and split binary is no longer supported the following - probably doesn't apply anymore. Due to lack of a suitable environment - it is also untested.] - - The BBS mode is based on the standard NetHack tty port and is designed - for use in a BBS setting - it is specifically not recommended for use - on the console. The current TTY mode has changed significantly since - the preliminary version released with 3.1.2. In particular, BBS mode - now works with split binaries (only), and now supports multiple games - in progress at the same time for multi-line boards (note however that - any individual user should not be allowed to run two instances of - NetHack at the same time). - - To set up NetHack for use with a BBS, set OPTIONS=windowtype:tty - and unset DUNGEONS, TRAPS, and EFFECTS in NetHack.cnf. Configure - the BBS to expect I/O through stdin and stdout, and have NetHack - invoked as: - HackCLI :uid -u uname options... - where uid is any string (without embedded spaces, colons, or slashes) - that is unique for each BBS user and uname is some corresponding human- - readable name for that user. Uid is used in constructing file names - to prevent collisions between simultaneous games and to prevent - people from using other people's save files. Uname is the name the - character will have in the game and the name that will appear in the - record file. - - The terminal is assumed to be a 24x80 ANSI-compatible terminal. - The present version does not deal with situations such as low - memory gracefully - as NetHack uses a considerable amount of - memory this is particularly painful with multiple games in - progress. Sysops are reminded to be familiar with the recover - utility, which may be needed from time to time and which should - probably not be available directly to users. Bug reports and - suggestions for improvements are requested from the user community - - this is still considered alpha software. - diff --git a/outdated/sys/amiga/Makefile.agc b/outdated/sys/amiga/Makefile.agc deleted file mode 100644 index 5f36d0049..000000000 --- a/outdated/sys/amiga/Makefile.agc +++ /dev/null @@ -1,1241 +0,0 @@ -# NetHack Makefile. -# Copyright (c) Kenneth Lorber, Bethesda, Maryland, 1991,1992,1993,1996. -# NetHack may be freely redistributed. See license for details. - -### -### modified for gcc by Teemu Suikki (zu@iki.fi) -### -### note: you need to use smake.. sorry -### - -### -### DIRECTORY STRUCTURE -### - -NH = nh: - -SBIN = $(NH)sbin/ -SLIB = $(NH)slib/ -NETHACK = $(NH)NetHack/ -HACKEXE = $(NH)HackExe/ -AMI = $(NH)sys/amiga/ -DAT = $(NH)dat/ -DOC = $(NH)doc/ -I = $(NH)include/ -SHARE = $(NH)sys/share/ -NHS = $(NH)src/ -TTY = $(NH)win/tty/ -WSHARE = $(NH)win/share/ -UTIL = $(NH)util/ -O = $(NH)obj/ -OO = $(NH)objo/ -# NB: O and OO MUST be different directories - -### -### INVOCATION -### - -MAKE = smake - -# Startup makefile with: -# -# $(MAKE) -f $(AMI)Makefile.amigcc -# $(MAKE) -f $(AMI)Makefile.amigcc install -# -# You may use following targets on $(MAKE) command lines: -# all do it all (default) -# link just create binary from object files -# obj just create common object files -# obja just create amiga object files -# objs just create shared object files -# clean deletes the object files -# spotless deletes the object files, main binary, and more -# -# Note: We do not build the Guidebook here since it needs tbl -# (See the file sys/unix/Makefile.doc for more information) - -#[SAS5] [and gcc?] -# If we were to use the precompiled header file feature in a newer version -# of SAS/C, we would comment out these following two lines. -# If we don't use precompiled header files, we uncomment it as well. - -HDEP = $(I)hack.h -CSYM = - -#Pathname for uudecode program: -UUDEC = uudecode - -# Flex/Bison command assignments -- Useful only if you have flex/bison -FLEX = flex -BISON = bison -# FBFIL and FBLIB may be used, if required by your version of flex or bison, -# to specify additional files or libraries to be linked with -FBFIL = -FBLIB = #lib lib:compat.lib - -# If you're compiling this on a 1.3 system, you'll have to uncomment the -# following (for use with the ifchange script below). Also useful instead of -# "protect ifchange +s" -EXECUTE = execute - -# Headers we depend on -AMDEP = $(AMI)winproto.h $(AMI)winext.h $(AMI)windefs.h $(I)winami.h - -# Pathname for the C compiler being used. - -CC = gcc -c -ASM = as - -# Compilation flags for selected C Compiler: -# $(CFLAGS) should appear before filename arguments of $(CC) command line. - -CFLAGS = -O3 -I $(I) - -# Components of various link command lines: -# $(LINK) should be the pathname of the linker being used (with any options -# that should appear at the beginning of the command line). The name of the -# output file should appear immediately after $(LNSPEC). $(LIN) should -# appear before the list of object files in each link command. $(LLINK) -# should appear as the list of object files in the link command line that -# creates the NetHack executable. $(LLIB) should appear at the end of each -# link command line. - -LINK = gcc -noixemul -O3 -LIN = -LLINK = -LLIB = -FLLIB = -OBJSPEC = -o -PNSPEC = -o -LNSPEC = -o -CCLINK = gcc -noixemul -CLFLAGS = -O3 -INCLSPEC = -I -DEFSPEC = -D -IGNSPEC = -j - -### -### FILE LISTS -### - -# A more reasonable random number generator (recommended for the Amiga): - -RANDOBJ = $(O)random.o - -.PRECIOUS: $(I)config.h $(I)decl.h $(I)hack.h $(I)permonst.h $(I)you.h - -# Almost nothing below this line should have to be changed. -# (Exceptions are marked by [SAS6], [MANX], etc.) -# -# Other things that have to be reconfigured are in config.h, -# (amiconf.h, pcconf.h), and possibly system.h, tradstdc.h. - -# Object files for makedefs: - -MAKEOBJS = \ - $(OO)makedefs.o $(O)monst.o $(O)objects.o - -# Object files for special levels compiler: - -SPLEVOBJS = \ - $(OO)lev_yacc.o $(OO)lev_lex.o $(OO)lev_main.o \ - $(O)decl.o $(O)drawing.o $(O)monst.o \ - $(O)objects.o $(OO)panic.o - -# Object files for dungeon compiler - -DGNCOMPOBJS = \ - $(OO)dgn_yacc.o $(OO)dgn_lex.o $(OO)dgn_main.o $(O)alloc.o $(OO)panic.o - -# Object files for NetHack: - -COMMOBJ = \ - $(O)allmain.o $(O)alloc.o $(O)apply.o $(O)artifact.o \ - $(O)attrib.o $(O)ball.o $(O)bones.o $(O)botl.o \ - $(O)cmd.o $(O)dbridge.o $(O)decl.o $(O)detect.o \ - $(O)dig.o $(O)display.o $(O)dlb.o $(O)do.o \ - $(O)do_name.o $(O)do_wear.o $(O)dog.o $(O)dogmove.o \ - $(O)dokick.o $(O)dothrow.o $(O)drawing.o $(O)dungeon.o \ - $(O)eat.o $(O)end.o $(O)engrave.o $(O)exper.o \ - $(O)explode.o $(O)extralev.o $(O)files.o $(O)fountain.o \ - $(O)hack.o $(O)hacklib.o $(O)invent.o $(O)light.o \ - $(O)lock.o $(O)mail.o $(O)makemon.o $(O)mapglyph.o \ - $(O)mcastu.o $(O)mhitm.o $(O)mhitu.o $(O)minion.o \ - $(O)mklev.o $(O)mkmap.o $(O)mkmaze.o $(O)mkobj.o \ - $(O)mkroom.o $(O)mon.o $(O)mondata.o $(O)monmove.o \ - $(O)monst.o $(O)mplayer.o $(O)mthrowu.o $(O)muse.o \ - $(O)music.o $(O)o_init.o $(O)objects.o $(O)objnam.o \ - $(O)options.o $(O)pager.o $(O)pickup.o $(O)pline.o \ - $(O)polyself.o $(O)potion.o $(O)pray.o $(O)priest.o \ - $(O)quest.o $(O)questpgr.o $(O)read.o $(O)rect.o \ - $(O)region.o $(O)restore.o $(O)rnd.o $(O)role.o \ - $(O)rumors.o $(O)save.o $(O)shk.o $(O)shknam.o \ - $(O)sit.o $(O)sounds.o $(O)sp_lev.o $(O)spell.o \ - $(O)steal.o $(O)steed.o $(O)sys.o $(O)teleport.o \ - $(O)timeout.o $(O)topten.o $(O)track.o $(O)trap.o \ - $(O)u_init.o $(O)uhitm.o $(O)vault.o $(O)version.o \ - $(O)vision.o $(O)weapon.o $(O)were.o $(O)wield.o \ - $(O)windows.o $(O)wizard.o $(O)worm.o $(O)worn.o \ - $(O)write.o $(O)zap.o - -MAKEDEFOBJ = \ - $(O)monstr.o - -AMIGAOBJ = \ - $(O)amidos.o $(O)amirip.o $(O)amistack.o \ - $(O)amiwind.o $(O)winami.o $(O)winchar.o $(O)winfuncs.o \ - $(O)winkey.o $(O)winamenu.o $(O)winreq.o $(O)winstr.o - -# Objects from assembly sources (because DMake can't handle default rules) -AMIGAOBJ2 = \ -# $(O)dispmap.o - -SHAREOBJ = \ - $(O)pcmain.o $(RANDOBJ) - -TTYOBJ = \ - $(O)getline.o $(O)termcap.o $(O)topl.o $(O)wintty.o $(O)amitty.o \ - $(O)rip.o - -# Yuck yuck yuck. Have to tell DMake where these are, since they're not -# all in the same place. -TTYSRC = \ - $(TTY)getline.c $(TTY)termcap.c $(TTY)topl.c $(TTY)wintty.c \ - $(AMI)amitty.c $(NHS)rip.c - -# All the object files for NetHack: - -HOBJ = $(COMMOBJ) $(AMIGAOBJ) $(AMIGAOBJ2) $(SHAREOBJ) $(MAKEDEFOBJ) $(TTYOBJ) - -### -### DATA FILES -### - -# quest files -ADFILES1= $(SLIB)Arc-fila.lev $(SLIB)Arc-filb.lev $(SLIB)Arc-loca.lev \ - $(SLIB)Arc-strt.lev -ADFILES= $(SLIB)Arc-goal.lev $(ADFILES1) - -BDFILES1= $(SLIB)Bar-fila.lev $(SLIB)Bar-filb.lev $(SLIB)Bar-loca.lev \ - $(SLIB)Bar-strt.lev -BDFILES= $(SLIB)Bar-goal.lev $(BDFILES1) - -CDFILES1= $(SLIB)Cav-fila.lev $(SLIB)Cav-filb.lev $(SLIB)Cav-loca.lev \ - $(SLIB)Cav-strt.lev -CDFILES= $(SLIB)Cav-goal.lev $(CDFILES1) - -HDFILES1= $(SLIB)Hea-fila.lev $(SLIB)Hea-filb.lev $(SLIB)Hea-loca.lev \ - $(SLIB)Hea-strt.lev -HDFILES= $(SLIB)Hea-goal.lev $(HDFILES1) - -KDFILES1= $(SLIB)Kni-fila.lev $(SLIB)Kni-filb.lev $(SLIB)Kni-loca.lev \ - $(SLIB)Kni-strt.lev -KDFILES= $(SLIB)Kni-goal.lev $(KDFILES1) - -MDFILES1= $(SLIB)Mon-fila.lev $(SLIB)Mon-filb.lev $(SLIB)Mon-loca.lev \ - $(SLIB)Mon-strt.lev -MDFILES= $(SLIB)Mon-goal.lev $(MDFILES1) - -PDFILES1= $(SLIB)Pri-fila.lev $(SLIB)Pri-filb.lev $(SLIB)Pri-loca.lev \ - $(SLIB)Pri-strt.lev -PDFILES= $(SLIB)Pri-goal.lev $(PDFILES1) - -RDFILES1= $(SLIB)Rog-fila.lev $(SLIB)Rog-filb.lev $(SLIB)Rog-loca.lev \ - $(SLIB)Rog-strt.lev -RDFILES= $(SLIB)Rog-goal.lev $(RDFILES1) - -RANFILES1= $(SLIB)Ran-fila.lev $(SLIB)Ran-filb.lev $(SLIB)Ran-loca.lev \ - $(SLIB)Ran-strt.lev -RANFILES= $(SLIB)Ran-goal.lev $(RANFILES1) - -SDFILES1= $(SLIB)Sam-fila.lev $(SLIB)Sam-filb.lev $(SLIB)Sam-loca.lev \ - $(SLIB)Sam-strt.lev -SDFILES= $(SLIB)Sam-goal.lev $(SDFILES1) - -TDFILES1= $(SLIB)Tou-fila.lev $(SLIB)Tou-filb.lev $(SLIB)Tou-loca.lev \ - $(SLIB)Tou-strt.lev -TDFILES= $(SLIB)Tou-goal.lev $(TDFILES1) - -VDFILES1= $(SLIB)Val-fila.lev $(SLIB)Val-filb.lev $(SLIB)Val-loca.lev \ - $(SLIB)Val-strt.lev -VDFILES= $(SLIB)Val-goal.lev $(VDFILES1) - -WDFILES1= $(SLIB)Wiz-fila.lev $(SLIB)Wiz-filb.lev $(SLIB)Wiz-loca.lev \ - $(SLIB)Wiz-strt.lev -WDFILES= $(SLIB)Wiz-goal.lev $(WDFILES1) - -XDFILES= $(ADFILES) $(BDFILES) $(CDFILES) $(HDFILES) $(KDFILES) \ - $(MDFILES) $(PDFILES) $(RDFILES) $(RANFILES) $(SDFILES) $(TDFILES) \ - $(VDFILES) $(WDFILES) - -TILEFILES= \ - $(SBIN)txt2iff \ - $(NETHACK)tiles \ - $(NETHACK)tiles/objects.iff \ - $(NETHACK)tiles/monsters.iff \ - $(NETHACK)tiles/other.iff - -INSTDUNGEONFILES1= \ - $(SLIB)air.lev $(SLIB)asmodeus.lev $(SLIB)astral.lev \ - $(SLIB)baalz.lev $(SLIB)bigrm-1.lev $(SLIB)bigrm-2.lev \ - $(SLIB)bigrm-3.lev $(SLIB)bigrm-4.lev $(SLIB)bigrm-5.lev \ - $(SLIB)castle.lev $(SLIB)dungeon $(SLIB)earth.lev \ - $(SLIB)fakewiz1.lev $(SLIB)fakewiz2.lev $(SLIB)fire.lev \ - $(SLIB)juiblex.lev $(SLIB)knox.lev $(SLIB)medusa-1.lev \ - $(SLIB)medusa-2.lev $(SLIB)minend-1.lev $(SLIB)minend-2.lev \ - $(SLIB)minetn-1.lev $(SLIB)minetn-2.lev $(SLIB)minefill.lev \ - $(SLIB)options $(SLIB)oracle.lev $(SLIB)orcus.lev \ - $(SLIB)sanctum.lev $(SLIB)soko1-1.lev $(SLIB)soko1-2.lev \ - $(SLIB)soko2-1.lev $(SLIB)soko2-2.lev $(SLIB)soko3-1.lev \ - $(SLIB)soko3-2.lev $(SLIB)soko4-1.lev $(SLIB)soko4-2.lev \ - $(SLIB)tower1.lev $(SLIB)tower2.lev $(SLIB)tower3.lev \ - $(SLIB)valley.lev $(SLIB)water.lev $(SLIB)wizard1.lev \ - $(SLIB)wizard2.lev $(SLIB)wizard3.lev \ - $(XDFILES) - -INSTDUNGEONFILES= $(NETHACK)NetHack.cnf $(INSTDUNGEONFILES1) - - -INSTDATAFILES= \ - $(NETHACK)license $(NETHACK)logfile $(NETHACK)record \ - $(NETHACK)tomb.iff $(NETHACK)amii.hlp $(NETHACK)Recover.txt \ - $(NETHACK)GuideBook.txt $(NETHACK)NetHack.txt $(NETHACK)Install.ami \ -# $(NETHACK)HackWB.hlp $(NETHACK)WBDefaults.def - -LIBFILES= \ - $(INSTDUNGEONFILES1) \ - $(SLIB)cmdhelp $(SLIB)data $(SLIB)dungeon \ - $(SLIB)help $(SLIB)hh $(SLIB)history \ - $(SLIB)opthelp $(SLIB)oracles $(SLIB)rumors \ - $(SLIB)quest.dat $(SLIB)wizhelp - -### -### Getting down to business: -### - -all: $(COMPACT_HEADERS) $(SBIN)lev_comp $(SBIN)dgn_comp $(SBIN)NetHack \ - $(SBIN)dlb $(NETHACK)recover #$(NETHACK)HackCli $(SBIN)splitter \ -# $(NETHACK)HackWB - -install: inst-data inst-dungeon inst-fonts inst-tiles \ - $(NETHACK)recover $(NETHACK)NetHack $(NETHACK)nhdat - #$(NETHACK)NetHack.dir inst-icons - -$(SBIN)NetHack: link - -$(NETHACK)NetHack: $(SBIN)NetHack - copy $(SBIN)NetHack $(NETHACK)NetHack - -## uuh this is messy.. smake has weird command line length limit -link: $(HOBJ) - list to t:link lformat="$(O)%s" $(O)\#?.o QUICK NOHEAD - echo "\#sh" to t:cc - echo "$(LINK) $(LNSPEC) $(SBIN)NetHack $(LIN) $(LLIB) $(LLINK) " >>t:cc noline - fmt -u -w 2500 t:link >>t:cc - sh t:cc - delete t:cc t:link - - -## dlb support -$(OO)dlb_main.o: $(UTIL)dlb_main.c $(HDEP) $(I)dlb.h $(I)date.h - $(CC) $(CFLAGS) $(OBJSPEC)$(OO)dlb_main.o $(UTIL)dlb_main.c - -$(SBIN)dlb: $(OO)dlb_main.o $(O)dlb.o $(O)alloc.o $(OO)panic.o - $(LINK) $(PNSPEC) $(SBIN)dlb $(LIN) $(OO)dlb_main.o $(O)dlb.o \ - $(O)alloc.o $(OO)panic.o $(LLIB) - -obj: $(HOBJ) - -obja: $(AMIGAOBJ) - -objs: $(SHAREOBJ) - - -SUFFIXES = .lev .des -.des.lev: - $(SBIN)lev_comp $< - -# The default method for creating object files: - -#$(O)%.o: $(NHS)%.c -.c.o: - $(CC) $(CFLAGS) $(CSYM) $(OBJSPEC)$@ $< - -clean: - -delete $(O)\#?.o $(OO)\#?.o - -spotless: clean - -delete $(SBIN)NetHack $(SBIN)lev_comp $(SBIN)makedefs $(SBIN)dgn_comp - -delete $(SBIN)dlb $(SBIN)txt2iff $(SBIN)splitter - -delete $(SBIN)tilemap - -delete $(SLIB)data $(SLIB)rumors - -delete $(SLIB)\#?.lev - -delete $(SLIB)dungeon - -delete $(SLIB)cmdhelp $(SLIB)help $(SLIB)hh $(SLIB)history - -delete $(SLIB)opthelp $(SLIB)options $(SLIB)oracles - -delete $(SLIB)quest.dat $(SLIB)wizhelp -# -delete $(SLIB)earth.lev $(SLIB)air.lev $(SLIB)fire.lev -# -delete $(SLIB)water.lev $(SLIB)astral.lev -# -delete $(SLIB)tower1.lev $(SLIB)tower2.lev $(SLIB)tower3.lev -# -delete $(SLIB)fakewiz1.lev $(SLIB)fakewiz2.lev -# -delete $(SLIB)medusa-1.lev $(SLIB)medusa-2.lev -# -delete $(SLIB)oracle.lev $(SLIB)wizard1.lev $(SLIB)wizard2.lev -# -delete $(SLIB)wizard3.lev $(DAT)dungeon.pdf $(SLIB)valley.lev -# -delete $(SLIB)minefill.lev -# -delete $(SLIB)minetn-1 $(SLIB)minetn-2 $(SLIB)minend-1 $(SLIB)minend-2 -# -delete $(SLIB)soko1-1.lev $(SLIB)soko1-2.lev $(SLIB)soko2-1.lev -# -delete $(SLIB)soko2-2.lev $(SLIB)soko3-1.lev $(SLIB)soko3-2.lev -# -delete $(SLIB)soko4-1.lev $(SLIB)soko4-2.lev -# -delete $(ADFILES) -# -delete $(BDFILES) -# -delete $(CDFILES) -# -delete $(HDFILES) -# -delete $(KDFILES) -# -delete $(MDFILES) -# -delete $(PDFILES) -# -delete $(RDFILES) -# -delete $(RANFILES) -# -delete $(SDFILES) -# -delete $(TDFILES) -# -delete $(VDFILES) -# -delete $(WDFILES) - -delete $(I)onames.h $(I)pm.h $(I)date.h - -delete $(NHS)tile.c $(NHS)monstr.c - -delete $(I)tile.h -# -echo to $(I)onames.h "" noline -# -c:wait 2 -# -echo to $(I)pm.h "" noline -# -c:wait 2 -# -setdate $(UTIL)makedefs.c -# -c:wait 2 - -# Creating precompiled version of $(I)hack.h to save disk I/O. - -# -# Please note: The dependency lines for the modules here are -# deliberately incorrect. Including "hack.h" in -# the dependency list would cause a dependency -# loop. -# - -$(SBIN)makedefs: $(MAKEOBJS) - $(LINK) $(LNSPEC) $(SBIN)makedefs $(LIN) $(MAKEOBJS) $(LLIB) - -$(OO)makedefs.o: $(UTIL)makedefs.c $(I)config.h $(I)permonst.h $(I)monsym.h \ - $(I)objclass.h $(I)patchlevel.h $(I)artilist.h - $(CC) $(DEFSPEC)MAKEDEFS_C $(CFLAGS) $(OBJSPEC)$@ $(UTIL)makedefs.c - -$(SBIN)lev_comp: $(SPLEVOBJS) - $(LINK) $(LNSPEC) $(SBIN)lev_comp $(LIN) $(SPLEVOBJS) $(FBFIL) $(FLLIB) - -$(SBIN)dgn_comp: $(DGNCOMPOBJS) - $(LINK) $(LNSPEC) $(SBIN)dgn_comp $(LIN) $(DGNCOMPOBJS) $(FBFIL) $(FLLIB) - -$(OO)lev_yacc.o: $(UTIL)lev_yacc.c $(HDEP) $(I)sp_lev.h $(I)pm.h $(I)onames.h -# setdate $(UTIL)lev_yacc.c - $(CC) $(DEFSPEC)LEV_LEX_C $(DEFSPEC)PREFIX="NH:slib/" $(CFLAGS) \ - $(DEFSPEC)alloca=malloc $(OBJSPEC)$@ $(UTIL)lev_yacc.c - -$(OO)lev_lex.o: $(UTIL)lev_lex.c $(HDEP) $(I)lev_comp.h $(I)sp_lev.h - $(CC) $(DEFSPEC)LEV_LEX_C $(CFLAGS) $(OBJSPEC)$@ $(UTIL)lev_lex.c - -$(OO)lev_main.o: $(UTIL)lev_main.c $(HDEP) $(I)pm.h $(I)onames.h $(I)date.h - $(CC) $(DEFSPEC)LEV_LEX_C $(DEFSPEC)AMIGA $(CFLAGS) $(OBJSPEC)$@ \ - $(UTIL)lev_main.c - -$(OO)dgn_yacc.o: $(UTIL)dgn_yacc.c $(HDEP) $(I)dgn_file.h $(I)patchlevel.h - $(CC) $(DEFSPEC)LEV_LEX_C $(CFLAGS) $(DEFSPEC)alloca=malloc \ - $(OBJSPEC)$@ $(UTIL)dgn_yacc.c - -$(OO)dgn_lex.o: $(UTIL)dgn_lex.c $(I)config.h $(I)dgn_comp.h $(I)dgn_file.h - $(CC) $(DEFSPEC)LEV_LEX_C $(CFLAGS) $(OBJSPEC)$@ $(UTIL)dgn_lex.c - -$(OO)dgn_main.o: $(UTIL)dgn_main.c $(I)config.h $(I)date.h - $(CC) $(DEFSPEC)LEV_LEX_C $(DEFSPEC)AMIGA $(CFLAGS) $(OBJSPEC)$@ \ - $(UTIL)dgn_main.c - -$(OO)panic.o: $(UTIL)panic.c $(HDEP) - -$(OO)recover.o: $(UTIL)recover.c $(I)config.h $(I)date.h - $(CC) $(DEFSPEC)LEV_LEX_C $(DEFSPEC)AMIGA $(CFLAGS) $(OBJSPEC)$@ \ - $(UTIL)recover.c - -$(NETHACK)recover: $(OO)recover.o - $(LINK) $(LNSPEC) $(NETHACK)recover $(LIN) $(OO)recover.o $(LLIB) - -# [OPTION] -- If you have flex/bison, leave these uncommented. Otherwise, -# comment them out and be careful! (You're not guaranteed to have the most -# up to date *_comp.c, *_comp.h and *_lex.c) - -$(I)lev_comp.h: $(UTIL)lev_yacc.c $(I)patchlevel.h - -$(UTIL)lev_yacc.c: $(UTIL)lev_comp.y $(I)patchlevel.h - $(BISON) -d $(UTIL)lev_comp.y -# copy y.tab.c $(UTIL)lev_yacc.c -# copy y.tab.h $(I)lev_comp.h - copy $(UTIL)lev_comp.tab.c $(UTIL)lev_yacc.c - copy $(UTIL)lev_comp.tab.h $(I)lev_comp.h -# delete y.tab.c -# delete y.tab.h - delete $(UTIL)lev_comp.tab.c - delete $(UTIL)lev_comp.tab.h - -$(UTIL)lev_lex.c: $(UTIL)lev_comp.l $(I)patchlevel.h - $(FLEX) $(UTIL)lev_comp.l - copy lex.yy.c $(UTIL)lev_lex.c - delete lex.yy.c - -$(I)dgn_comp.h: $(UTIL)dgn_yacc.c $(I)patchlevel.h - -$(UTIL)dgn_yacc.c: $(UTIL)dgn_comp.y $(I)patchlevel.h - $(BISON) -d $(UTIL)dgn_comp.y -# copy y.tab.c $(UTIL)dgn_yacc.c -# copy y.tab.h $(I)dgn_comp.h - copy $(UTIL)dgn_comp.tab.c $(UTIL)dgn_yacc.c - copy $(UTIL)dgn_comp.tab.h $(I)dgn_comp.h -# delete y.tab.c -# delete y.tab.h - delete $(UTIL)dgn_comp.tab.c - delete $(UTIL)dgn_comp.tab.h - -$(UTIL)dgn_lex.c: $(UTIL)dgn_comp.l $(I)patchlevel.h - $(FLEX) $(UTIL)dgn_comp.l - copy lex.yy.c $(UTIL)dgn_lex.c - delete lex.yy.c - -# -# The following include files depend on makedefs to be created. -# As a result, they are not defined in HACKINCL, instead, their -# dependencies are explicitly outlined here. -# - -# -# date.h should be remade any time any of the source or include code -# is modified. Unfortunately, this would make the contents of this -# file far more complex. Since "hack.h" depends on most of the include -# files, we kludge around this by making date.h dependent on hack.h, -# even though it doesn't include this file. -# - -$(I)date.h $(DAT)options: $(HDEP) $(SBIN)makedefs $(AMIGAOBJ) $(I)patchlevel.h - $(SBIN)makedefs -v - $(EXECUTE) ifchange MOVE $(I)t.date.h $(I)date.h - -c:wait 2 - -$(I)onames.h: $(SBIN)makedefs - $(SBIN)makedefs -o - $(EXECUTE) ifchange TOUCH $(I)t.onames.h $(I)onames.h $(I)decl.h - $(EXECUTE) ifchange MOVE $(I)t.onames.h $(I)onames.h - -c:wait 2 - -$(I)pm.h: $(SBIN)makedefs - $(SBIN)makedefs -p - $(EXECUTE) ifchange TOUCH $(I)t.pm.h $(I)pm.h $(I)decl.h $(I)youprop.h - $(EXECUTE) ifchange MOVE $(I)t.pm.h $(I)pm.h - -c:wait 2 - -$(SLIB)quest.dat: $(DAT)quest.txt $(SBIN)makedefs - $(SBIN)makedefs -q - -$(NHS)monstr.c: $(HDEP) $(SBIN)makedefs - $(SBIN)makedefs -m - -c:wait 2 - -$(SLIB)oracles: $(DAT)oracles.txt $(SBIN)makedefs - $(SBIN)makedefs -h - -c:wait 2 - -# -# The following programs vary depending on what OS you are using. -# As a result, they are not defined in HACKSRC and their dependencies -# are explicitly outlined here. -# - -$(O)amidos.o: $(AMI)amidos.c $(HDEP) - -$(O)amirip.o: $(AMI)amirip.c $(HDEP) - -$(O)aglue.o: $(AMI)aglue.a - $(ASM) $(AFLAGS) $(AOBJSPEC)$(O)aglue.o $(AMI)aglue.a - -$(O)winchar.o: $(AMI)winchar.c $(NHS)tile.c $(HDEP) - -$(NHS)tile.c: $(WSHARE)tilemap.c - $(CCLINK) $(CFLAGS) $(PNSPEC) $(SBIN)tilemap $(WSHARE)tilemap.c - $(SBIN)tilemap - -$(O)winstr.o: $(AMI)winstr.c $(HDEP) $(AMDEP) - -$(O)winreq.o: $(AMI)winreq.c $(HDEP) $(AMDEP) $(AMI)colorwin.c $(AMI)clipwin.c - -$(O)winfuncs.o: $(AMI)winfuncs.c $(HDEP) $(AMDEP) $(I)patchlevel.h - -$(O)winkey.o: $(AMI)winkey.c $(HDEP) $(AMDEP) - -$(O)winamenu.o: $(AMI)winamenu.c $(HDEP) $(AMDEP) - -$(O)winami.o: $(AMI)winami.c $(HDEP) $(AMDEP) #$(AMI)char.c $(AMI)randwin.c - -#$(O)amilib.o: $(AMI)amilib.c $(HDEP) $(AMDEP) - -$(O)amiwind.o: $(AMI)amiwind.c $(AMI)amimenu.c $(HDEP) $(AMDEP) - -$(O)amiwbench.o: $(AMI)amiwbench.c $(HDEP) - -$(O)random.o: $(SHARE)random.c - -$(O)pcmain.o: $(SHARE)pcmain.c $(HDEP) $(I)dlb.h - -$(O)dispmap.o: $(AMI)dispmap.s - $(ASM) $(AFLAGS) $(AOBJSPEC)$@ $< - -# Stuff to build the front ends -$(NETHACK)HackWB: $(OO)wb.o $(OO)wbx.o $(OO)loader.o $(OO)multi.o - $(LINK) $(LNSPEC) $(NETHACK)HackWB $(LIN) $(OO)wb.o $(OO)wbx.o \ - $(OO)loader.o $(OO)multi.o $(LLIB) - -$(NETHACK)HackCli: $(OO)cli.o $(OO)loader.o $(OO)multi.o - $(LINK) $(LNSPEC) $(NETHACK)HackCli $(LIN) $(OO)cli.o $(OO)loader.o \ - $(OO)multi.o $(LLIB) - -# This needs to exist to eliminate the HackWB startup message -$(NETHACK)WBDefaults.def: - echo to $(NETHACK)WBDefaults.def - -WBH = $(AMI)wbdefs.h $(AMI)wbstruct.h $(AMI)wbprotos.h -ASP = $(AMI)splitter -$(OO)wb.o: $(WBH) $(AMI)wb.c $(AMI)wbwin.c $(AMI)wbdata.c $(AMI)wbgads.c \ - $(I)patchlevel.h - $(CC) $(WBCFLAGS) $(SPLFLAGS) $(OBJSPEC)$(OO)wb.o $(AMI)wb.c - -$(OO)wbx.o: $(WBH) $(AMI)wbcli.c $(AMI)wbwin.c $(AMI)wbdata.c \ - $(I)patchlevel.h $(I)date.h - $(CC) $(WBCFLAGS) $(SPLFLAGS) $(OBJSPEC)$(OO)wbx.o $(AMI)wbcli.c - -$(OO)loader.o: $(ASP)/loader.c $(ASP)/split.h $(ASP)/amiout.h $(ASP)/multi.h - $(CC) $(WBCFLAGS) $(SPLFLAGS) $(OBJSPEC)$(OO)loader.o $(ASP)/loader.c - -$(OO)multi.o: $(ASP)/multi.c $(ASP)/multi.h - $(CC) $(WBCFLAGS) $(SPLFLAGS) $(OBJSPEC)$(OO)multi.o $(ASP)/multi.c - -$(OO)cli.o: $(WBH) $(AMI)wbcli.c $(I)patchlevel.h $(I)date.h - $(CC) $(WBCFLAGS) $(WBC2FLAGS) $(SPLFLAGS) $(OBJSPEC)$(OO)cli.o \ - $(AMI)wbcli.c - -#### -# splitter support -$(SBIN)splitter: $(OO)splitter.o $(OO)arg.o - $(LINK) $(LNSPEC) $(SBIN)splitter $(LIN) $(OO)splitter.o $(OO)arg.o \ - $(LLIB) - -$(NETHACK)NetHack.dir: $(SBIN)splitter $(SBIN)NetHack - $(SBIN)splitter $(SBIN)NetHack - -$(OO)splitter.o: $(ASP)/splitter.c $(ASP)/split.h $(ASP)/amiout.h $(ASP)/arg.h - $(CC) $(WBCFLAGS) $(SPLFLAGS) $(OBJSPEC)$(OO)splitter.o \ - $(ASP)/splitter.c - -$(OO)arg.o: $(ASP)/arg.c $(ASP)/arg.h - $(CC) $(WBCFLAGS) $(SPLFLAGS) $(OBJSPEC)$(OO)arg.o $(ASP)/arg.c - -# Create/copy other stuff into NetHack: directory: - -$(NETHACK)tomb.iff: $(SBIN)xpm2iff $(AMI)grave16.xpm - $(SBIN)xpm2iff $(AMI)grave16.xpm $(NETHACK)tomb.iff - -$(OO)xpm2iff.o: $(AMI)xpm2iff.c - $(CC) $(CFLAGS) $(INCLSPEC)$(WSHARE) $(OBJSPEC)$@ $(AMI)xpm2iff.c - -$(SBIN)xpm2iff: $(OO)xpm2iff.o - $(LINK) $(LNSPEC) $@ $(LIN) $(OO)xpm2iff.o $(FLLIB) - -# Tile installation for the tile version of the game -inst-tiles: $(TILEFILES) - -$(NETHACK)tiles: - -makedir $(NETHACK)tiles - -$(OO)txt2iff.o: $(AMI)txt2iff.c - $(CC) $(CFLAGS) $(CSYM) $(INCLSPEC)$(WSHARE) $(OBJSPEC)$@ \ - $(AMI)txt2iff.c - -$(OO)ppmwrite.o: $(WSHARE)ppmwrite.c - $(CC) $(CFLAGS) $(CSYM) $(INCLSPEC)$(WSHARE) $(OBJSPEC)$@ $(WSHARE)ppmwrite.c - -$(OO)tiletext.o: $(WSHARE)tiletext.c $(I)config.h $(WSHARE)tile.h - $(CC) $(CFLAGS) $(CSYM) $(INCLSPEC)$(WSHARE) $(OBJSPEC)$@ $(WSHARE)tiletext.c - -$(OO)tiletxt.o: $(WSHARE)tilemap.c $(I)hack.h - $(CC) $(CFLAGS) $(CSYM) $(DEFSPEC)TILETEXT $(INCLSPEC)$(WSHARE) $(OBJSPEC)$@ $(WSHARE)tilemap.c - -NAMEOBJS = $(O)drawing.o $(O)decl.o $(O)monst.o $(O)objects.o - -$(SBIN)txt2ppm: $(OO)ppmwrite.o $(NAMEOBJS) $(O)alloc.o $(OO)panic.o $(OO)tiletext.o $(OO)tiletxt.o - $(LINK) $(LNSPEC) $@ $(LIN) $(OO)ppmwrite.o $(NAMEOBJS) $(OO)tiletext.o $(OO)tiletxt.o $(O)alloc.o $(OO)panic.o $(FLLIB) - -$(SBIN)txt2iff: $(OO)txt2iff.o $(NAMEOBJS) $(OO)tiletext.o $(OO)tiletxt.o - $(LINK) $(LNSPEC) $@ $(LIN) $(OO)txt2iff.o $(NAMEOBJS) $(OO)tiletext.o \ - $(OO)tiletxt.o $(FLLIB) - -$(NETHACK)tiles/objects.iff: $(WSHARE)objects.txt $(SBIN)txt2iff - $(SBIN)txt2iff $(WSHARE)objects.txt $(NETHACK)tiles/objects.iff - -$(NETHACK)tiles/monsters.iff: $(WSHARE)monsters.txt $(SBIN)txt2iff - $(SBIN)txt2iff $(WSHARE)monsters.txt $(NETHACK)tiles/monsters.iff - -$(NETHACK)tiles/other.iff: $(WSHARE)other.txt $(SBIN)txt2iff - $(SBIN)txt2iff $(WSHARE)other.txt $(NETHACK)tiles/other.iff - -inst-dungeon: $(INSTDUNGEONFILES) - -$(NETHACK)options : $(DAT)options - copy $(DAT)options $@ - -# Create compiled dungeon files -BGM= $(SLIB)bigrm-2.lev $(SLIB)bigrm-3.lev $(SLIB)bigrm-4.lev $(SLIB)bigrm-5.lev -$(BGM): $(SLIB)bigrm-1.lev - -$(SLIB)bigrm-1.lev: $(DAT)bigroom.des $(SBIN)lev_comp - -$(SLIB)castle.lev: $(DAT)castle.des $(SBIN)lev_comp - -ENDGAME1= $(SLIB)air.lev $(SLIB)earth.lev $(SLIB)fire.lev $(SLIB)water.lev -$(ENDGAME1): $(SLIB)astral.lev - -$(SLIB)astral.lev: $(DAT)endgame.des $(SBIN)lev_comp - -GEHENNOM1= $(SLIB)asmodeus.lev $(SLIB)baalz.lev $(SLIB)juiblex.lev \ - $(SLIB)orcus.lev $(SLIB)sanctum.lev -$(GEHENNOM1): $(SLIB)valley.lev - -$(SLIB)valley.lev: $(DAT)gehennom.des $(SBIN)lev_comp - -$(SLIB)knox.lev: $(DAT)knox.des $(SBIN)lev_comp - -MINES1= $(SLIB)minend-1.lev $(SLIB)minend-2.lev $(SLIB)minetn-1.lev $(SLIB)minetn-2.lev -$(MINES1): $(SLIB)minefill.lev - -$(SLIB)minefill.lev: $(DAT)mines.des $(SBIN)lev_comp - -$(SLIB)oracle.lev: $(DAT)oracle.des $(SBIN)lev_comp - -TOWER1= $(SLIB)tower1.lev $(SLIB)tower2.lev -$(TOWER1): $(SLIB)tower3.lev - -$(SLIB)tower3.lev: $(DAT)tower.des $(SBIN)lev_comp - -WIZARD1= $(SLIB)wizard1.lev $(SLIB)wizard2.lev $(SLIB)wizard3.lev \ - $(SLIB)fakewiz1.lev -$(WIZARD1): $(SLIB)fakewiz2.lev - -$(SLIB)fakewiz2.lev: $(DAT)yendor.des $(SBIN)lev_comp - -MEDUSA1= $(SLIB)medusa-1.lev -$(MEDUSA1): $(SLIB)medusa-2.lev - -$(SLIB)medusa-2.lev: $(DAT)medusa.des $(SBIN)lev_comp - -SOKOBAN1= $(SLIB)soko1-1.lev $(SLIB)soko1-2.lev $(SLIB)soko2-1.lev \ - $(SLIB)soko2-2.lev $(SLIB)soko3-1.lev $(SLIB)soko3-2.lev \ - $(SLIB)soko4-1.lev -$(SOKOBAN1): $(SLIB)soko4-2.lev - -$(SLIB)soko4-2.lev: $(DAT)sokoban.des $(SBIN)lev_comp - -$(ADFILES1): $(SLIB)Arc-goal.lev - -$(SLIB)Arc-goal.lev: $(DAT)Arch.des $(SBIN)lev_comp - -$(BDFILES1): $(SLIB)Bar-goal.lev - -$(SLIB)Bar-goal.lev: $(DAT)Barb.des $(SBIN)lev_comp - -$(CDFILES1): $(SLIB)Cav-goal.lev - -$(SLIB)Cav-goal.lev: $(DAT)Caveman.des $(SBIN)lev_comp - -$(HDFILES1): $(SLIB)Hea-goal.lev - -$(SLIB)Hea-goal.lev: $(DAT)Healer.des $(SBIN)lev_comp - -$(KDFILES1): $(SLIB)Kni-goal.lev - -$(SLIB)Kni-goal.lev: $(DAT)Knight.des $(SBIN)lev_comp - -$(MDFILES1): $(SLIB)Mon-goal.lev - -$(SLIB)Mon-goal.lev: $(DAT)Monk.des $(SBIN)lev_comp - -$(PDFILES1): $(SLIB)Pri-goal.lev - -$(SLIB)Pri-goal.lev: $(DAT)Priest.des $(SBIN)lev_comp - -$(RDFILES1): $(SLIB)Rog-goal.lev - -$(SLIB)Rog-goal.lev: $(DAT)Rogue.des $(SBIN)lev_comp - -$(RANFILES1): $(SLIB)Ran-goal.lev - -$(SLIB)Ran-goal.lev: $(DAT)Ranger.des $(SBIN)lev_comp - -$(SDFILES1): $(SLIB)Sam-goal.lev - -$(SLIB)Sam-goal.lev: $(DAT)Samurai.des $(SBIN)lev_comp - -$(TDFILES1): $(SLIB)Tou-goal.lev - -$(SLIB)Tou-goal.lev: $(DAT)Tourist.des $(SBIN)lev_comp - -$(VDFILES1): $(SLIB)Val-goal.lev - -$(SLIB)Val-goal.lev: $(DAT)Valkyrie.des $(SBIN)lev_comp - -$(WDFILES1): $(SLIB)Wiz-goal.lev - -$(SLIB)Wiz-goal.lev: $(DAT)Wizard.des $(SBIN)lev_comp - -$(SLIB)dungeon: $(DAT)dungeon.def $(SBIN)makedefs $(SBIN)dgn_comp - $(SBIN)makedefs -e - $(SBIN)dgn_comp $(DAT)dungeon.pdf - copy $(DAT)dungeon $(SLIB)dungeon - delete $(DAT)dungeon - -inst-data: $(INSTDATAFILES) - -$(NETHACK)amii.hlp: $(AMI)amii.hlp - copy $(AMI)amii.hlp $@ - -#$(NETHACK)data: $(DAT)data -# copy $(DAT)data $@ - -$(SLIB)data: $(DAT)data.base $(I)config.h $(SBIN)makedefs - $(SBIN)makedefs -d - -#$(NETHACK)rumors: $(DAT)rumors -# copy $(DAT)rumors $@ - -$(SLIB)rumors: $(DAT)rumors.tru $(DAT)rumors.fal $(SBIN)makedefs - $(SBIN)makedefs -r - -$(SLIB)cmdhelp: $(DAT)cmdhelp - copy $(DAT)cmdhelp $@ - -$(SLIB)help: $(DAT)help - copy $(DAT)help $@ - -$(SLIB)hh: $(DAT)hh - copy $(DAT)hh $@ - -$(NETHACK)HackWB.hlp: $(AMI)HackWB.hlp - copy $(AMI)HackWB.hlp $@ - -$(SLIB)history: $(DAT)history - copy $(DAT)history $@ - -$(NETHACK)license: $(DAT)license - copy $(DAT)license $@ - -$(SLIB)opthelp: $(DAT)opthelp - copy $(DAT)opthelp $@ - -$(NETHACK)Recover.txt: $(DOC)Recover.txt - copy $(DOC)Recover.txt $@ - -$(NETHACK)GuideBook.txt: $(DOC)GuideBook.txt - copy $(DOC)GuideBook.txt $@ - -$(NETHACK)NetHack.txt: $(DOC)NetHack.txt - copy $(DOC)NetHack.txt $@ - -$(NETHACK)Install.ami: $(AMI)Install.ami - copy $(AMI)Install.ami $@ - -$(NETHACK)logfile: - echo to $@ - -$(NETHACK)record: - echo to $@ - -$(SLIB)wizhelp: $(DAT)wizhelp - copy $(DAT)wizhelp $@ - -# Create the directories here because NetHack.cnf puts them there by default -$(NETHACK)NetHack.cnf: $(AMI)NetHack.cnf - copy $(AMI)NetHack.cnf $@ - -makedir $(NETHACK)save - -makedir $(NETHACK)levels - -# Unpack and install fonts - -INSTFONTFILES= $(NETHACK)hack.font $(NETHACK)hack $(NETHACK)hack/8 - -inst-fonts: $(INSTFONTFILES) - -$(NETHACK)hack/8: $(AMI)amifont8.uu $(NETHACK)hack - $(UUDEC) $(AMI)amifont8.uu - copy 8 $(NETHACK)hack/8 - delete 8 - -$(NETHACK)hack.font: $(AMI)amifont.uu - $(UUDEC) $(AMI)amifont.uu - copy hack.font $(NETHACK)hack.font - delete hack.font - -$(NETHACK)hack: - -makedir $@ - -INSTICONFILES= \ - $(NETHACK)default.icon $(NETHACK)NetHack.info $(NETHACK)NewGame.info \ - $(NETHACK)HackWB.info - -inst-icons: $(INSTICONFILES) - -# Unpack the icons into place - -$(NETHACK)default.icon: $(AMI)dflticon.uu - $(UUDEC) $(AMI)dflticon.uu -# copy default.icon $(NETHACK)default.icon -# delete default.icon - -$(NETHACK)NetHack.info: $(AMI)NHinfo.uu - $(UUDEC) $(AMI)NHinfo.uu -# copy NetHack.info $(NETHACK)NetHack.info -# delete NetHack.info - -$(NETHACK)NewGame.info: $(AMI)NewGame.uu - $(UUDEC) $(AMI)NewGame.uu -# copy NewGame.info $(NETHACK)NewGame.info -# delete NewGame.info - -$(NETHACK)HackWB.info: $(AMI)HackWB.uu - $(UUDEC) $(AMI)HackWB.uu -# copy HackWB.info $(NETHACK)HackWB.info -# delete HackWB.info - -# If DLB is defined, create the nhdat library file in the playground -# directory. If not, move all the data files there. -$(NETHACK)nhdat: $(LIBFILES) - list to T:nhdat.lst $(SLIB) QUICK NOHEAD FILES - echo >T:make-nhdat $(SBIN)dlb cCfI $(SLIB) $(NETHACK)nhdat T:nhdat.lst - echo >>T:make-nhdat if not exists $(NETHACK)nhdat - echo >>T:make-nhdat copy $(SLIB)\#? $(NETHACK) - echo >>T:make-nhdat endif - execute T:make-nhdat - -delete T:make-nhdat - -# DO NOT DELETE THIS LINE - -$(O)allmain.o: $(NHS)allmain.c $(HDEP) - -$(O)alloc.o: $(NHS)alloc.c $(I)config.h - -$(O)apply.o: $(NHS)apply.c $(HDEP) - $(CC) $(CFLAGS) $(CFLAGS2) $(OBJSPEC)$@ $(NHS)apply.c - -$(O)artifact.o: $(NHS)artifact.c $(HDEP) $(I)artifact.h $(I)artilist.h - -$(O)attrib.o: $(NHS)attrib.c $(HDEP) $(I)artifact.h - -$(O)ball.o: $(NHS)ball.c $(HDEP) - -$(O)bones.o: $(NHS)bones.c $(HDEP) - -$(O)botl.o: $(NHS)botl.c $(HDEP) - -$(O)cmd.o: $(NHS)cmd.c $(HDEP) $(I)func_tab.h - -$(O)dbridge.o: $(NHS)dbridge.c $(HDEP) - -$(O)decl.o: $(NHS)decl.c $(HDEP) $(I)quest.h - -$(O)detect.o: $(NHS)detect.c $(HDEP) $(I)artifact.h - -$(O)dig.o: $(NHS)dig.c $(HDEP) - -$(O)display.o: $(NHS)display.c $(HDEP) - -$(O)dlb.o: $(NHS)dlb.c $(HDEP) $(I)dlb.h - -$(O)do.o: $(NHS)do.c $(HDEP) - -$(O)do_name.o: $(NHS)do_name.c $(HDEP) - -$(O)do_wear.o: $(NHS)do_wear.c $(HDEP) - -$(O)dog.o: $(NHS)dog.c $(HDEP) - -$(O)dogmove.o: $(NHS)dogmove.c $(HDEP) $(I)mfndpos.h - -$(O)dokick.o: $(NHS)dokick.c $(HDEP) - -$(O)dothrow.o: $(NHS)dothrow.c $(HDEP) - -$(O)drawing.o: $(NHS)drawing.c $(HDEP) $(I)tcap.h - $(CC) $(CFLAGS) $(CFLAGS2) $(OBJSPEC)$@ $(NHS)drawing.c - -$(O)dungeon.o: $(NHS)dungeon.c $(HDEP) $(I)dgn_file.h $(I)dlb.h - -$(O)eat.o: $(NHS)eat.c $(HDEP) - -$(O)end.o: $(NHS)end.c $(HDEP) $(I)dlb.h - -$(O)engrave.o: $(NHS)engrave.c $(HDEP) - -$(O)exper.o: $(NHS)exper.c $(HDEP) - -$(O)explode.o: $(NHS)explode.c $(HDEP) - -$(O)extralev.o: $(NHS)extralev.c $(HDEP) - -$(O)files.o: $(NHS)files.c $(HDEP) $(I)dlb.h $(I)date.h - -$(O)fountain.o: $(NHS)fountain.c $(HDEP) - -$(O)hack.o: $(NHS)hack.c $(HDEP) - -$(O)hacklib.o: $(NHS)hacklib.c $(HDEP) - -$(O)invent.o: $(NHS)invent.c $(HDEP) $(I)artifact.h - -$(O)light.o: $(NHS)light.c $(HDEP) - -$(O)lock.o: $(NHS)lock.c $(HDEP) - -$(O)mail.o: $(NHS)mail.c $(HDEP) $(I)mail.h - -$(O)makemon.o: $(NHS)makemon.c $(HDEP) - -$(O)mapglyph.o: $(NHS)mapglyph.c $(HDEP) - -$(O)mcastu.o: $(NHS)mcastu.c $(HDEP) - -$(O)mhitm.o: $(NHS)mhitm.c $(HDEP) $(I)artifact.h - -$(O)mhitu.o: $(NHS)mhitu.c $(HDEP) $(I)artifact.h - $(CC) $(CFLAGS) $(CFLAGS2) $(OBJSPEC)$@ $(NHS)mhitu.c - -$(O)minion.o: $(NHS)minion.c $(HDEP) - -$(O)mklev.o: $(NHS)mklev.c $(HDEP) - -$(O)mkmap.o: $(NHS)mkmap.c $(HDEP) $(I)sp_lev.h - -$(O)mkmaze.o: $(NHS)mkmaze.c $(HDEP) $(I)sp_lev.h - -$(O)mkobj.o: $(NHS)mkobj.c $(HDEP) $(I)artifact.h $(I)prop.h - -$(O)mkroom.o: $(NHS)mkroom.c $(HDEP) - -$(O)mon.o: $(NHS)mon.c $(HDEP) $(I)mfndpos.h - -$(O)mondata.o: $(NHS)mondata.c $(HDEP) - -$(O)monmove.o: $(NHS)monmove.c $(HDEP) $(I)mfndpos.h $(I)artifact.h - -$(O)monst.o: $(NHS)monst.c $(I)config.h $(I)permonst.h $(I)monsym.h \ - $(I)color.h - -$(O)monstr.o: $(NHS)monstr.c $(HDEP) - -$(O)mplayer.o: $(NHS)mplayer.c $(HDEP) - -$(O)mthrowu.o: $(NHS)mthrowu.c $(HDEP) - -$(O)muse.o: $(NHS)muse.c $(HDEP) - $(CC) $(CFLAGS) $(CFLAGS2) $(OBJSPEC)$@ $(NHS)muse.c - -$(O)music.o: $(NHS)music.c $(HDEP) #interp.c - -$(O)o_init.o: $(NHS)o_init.c $(HDEP) - -$(O)objects.o: $(NHS)objects.c $(I)config.h $(I)obj.h $(I)objclass.h \ - $(I)prop.h $(I)skills.h $(I)color.h - $(CC) $(CFLAGS) $(INCLSPEC)$(NHS) $(OBJSPEC)$@ $(NHS)objects.c - -$(O)objnam.o: $(NHS)objnam.c $(HDEP) - -$(O)options.o: $(NHS)options.c $(HDEP) $(I)tcap.h $(I)config.h \ - $(I)objclass.h $(I)flag.h - -$(O)pager.o: $(NHS)pager.c $(HDEP) $(I)dlb.h - -$(O)pickup.o: $(NHS)pickup.c $(HDEP) - -$(O)pline.o: $(NHS)pline.c $(HDEP) - -$(O)polyself.o: $(NHS)polyself.c $(HDEP) - -$(O)potion.o: $(NHS)potion.c $(HDEP) - -$(O)pray.o: $(NHS)pray.c $(HDEP) - -$(O)priest.o: $(NHS)priest.c $(HDEP) $(I)mfndpos.h - -$(O)quest.o: $(NHS)quest.c $(HDEP) $(I)quest.h - -$(O)questpgr.o: $(NHS)questpgr.c $(HDEP) $(I)dlb.h - -$(O)read.o: $(NHS)read.c $(HDEP) - -$(O)rect.o: $(NHS)rect.c $(HDEP) - -$(O)region.o: $(NHS)region.c $(HDEP) - -$(O)restore.o: $(NHS)restore.c $(HDEP) $(I)tcap.h $(I)quest.h - -$(O)rnd.o: $(NHS)rnd.c $(HDEP) - -$(O)role.o: $(NHS)role.c $(HDEP) - -$(O)rumors.o: $(NHS)rumors.c $(HDEP) $(I)dlb.h - -$(O)save.o: $(NHS)save.c $(HDEP) $(I)quest.h - -$(O)shk.o: $(NHS)shk.c $(HDEP) - $(CC) $(CFLAGS) $(CFLAGS2) $(OBJSPEC)$@ $(NHS)shk.c - -$(O)shknam.o: $(NHS)shknam.c $(HDEP) - -$(O)sit.o: $(NHS)sit.c $(HDEP) $(I)artifact.h - -$(O)sounds.o: $(NHS)sounds.c $(HDEP) - -$(O)sp_lev.o: $(NHS)sp_lev.c $(HDEP) $(I)sp_lev.h $(I)rect.h $(I)dlb.h - -$(O)spell.o: $(NHS)spell.c $(HDEP) - -$(O)steal.o: $(NHS)steal.c $(HDEP) - -$(O)steed.o: $(NHS)steed.c $(HDEP) - -$(O)sys.o: $(NHS)sys.c $(HDEP) - -$(O)teleport.o: $(NHS)teleport.c $(HDEP) - -$(O)timeout.o: $(NHS)timeout.c $(HDEP) - -$(O)topten.o: $(NHS)topten.c $(HDEP) $(I)dlb.h - -$(O)track.o: $(NHS)track.c $(HDEP) - -$(O)trap.o: $(NHS)trap.c $(HDEP) - $(CC) $(CFLAGS) $(CFLAGS2) $(OBJSPEC)$@ $(NHS)trap.c - -$(O)u_init.o: $(NHS)u_init.c $(HDEP) - -$(O)uhitm.o: $(NHS)uhitm.c $(HDEP) - $(CC) $(CFLAGS) $(CFLAGS2) $(OBJSPEC)$@ $(NHS)uhitm.c - -$(O)vault.o: $(NHS)vault.c $(HDEP) - -$(O)version.o: $(NHS)version.c $(HDEP) $(I)date.h $(I)patchlevel.h - -$(O)vision.o: $(NHS)vision.c $(HDEP) #$(I)vis_tab.h - -$(O)weapon.o: $(NHS)weapon.c $(HDEP) - -$(O)were.o: $(NHS)were.c $(HDEP) - -$(O)wield.o: $(NHS)wield.c $(HDEP) - -$(O)windows.o: $(NHS)windows.c $(HDEP) $(I)wintty.h - -$(O)wizard.o: $(NHS)wizard.c $(HDEP) - -$(O)worm.o: $(NHS)worm.c $(HDEP) - -$(O)worn.o: $(NHS)worn.c $(HDEP) - -$(O)write.o: $(NHS)write.c $(HDEP) - -$(O)zap.o: $(NHS)zap.c $(HDEP) - $(CC) $(CFLAGS) $(CFLAGS2) $(OBJSPEC)$@ $(NHS)zap.c - -$(O)getline.o: $(TTY)getline.c $(HDEP) $(I)wintty.h - -$(O)termcap.o: $(TTY)termcap.c $(HDEP) $(I)wintty.h $(I)tcap.h - -$(O)topl.o: $(TTY)topl.c $(HDEP) $(I)wintty.h $(I)tcap.h - -$(O)wintty.o: $(TTY)wintty.c $(HDEP) $(I)wintty.h $(I)tcap.h \ - $(I)date.h $(I)patchlevel.h - -$(O)amitty.o: $(AMI)amitty.c $(HDEP) - -$(O)amistack.o: $(AMI)amistack.c - $(CC) $(CFLAGS3) $(CSYM) $(OBJSPEC)$@ $(AMI)amistack.c - -$(O)rip.o: $(NHS)rip.c $(HDEP) - - -$(I)config.h: $(I)config1.h $(I)tradstdc.h $(I)global.h - -setdate $(I)config.h - -c:wait 2 - -# onames.h handled at onames.h target, pm.h - -$(I)decl.h: $(I)quest.h $(I)spell.h $(I)color.h $(I)obj.h $(I)you.h - -setdate $(I)decl.h - -c:wait 2 - -$(I)global.h: $(I)coord.h $(I)pcconf.h $(I)amiconf.h - -setdate $(I)global.h - -c:wait 2 - -$(I)hack.h: $(I)config.h $(I)context.h $(I)trap.h $(I)decl.h $(I)dungeon.h - $(I)monsym.h $(I)mkroom.h $(I)objclass.h $(I)flag.h $(I)rm.h - $(I)vision.h $(I)display.h $(I)wintype.h $(I)engrave.h - $(I)rect.h $(I)region.h $(I)sys.h - -setdate $(I)hack.h - -c:wait 2 - -$(I)permonst.h: $(I)monattk.h $(I)monflag.h $(I)align.h - -setdate $(I)permonst.h - -c:wait 2 - -$(I)you.h: $(I)align.h $(I)attrib.h $(I)monst.h $(I)mextra.h $(I)youprop.h $(I)skills.h - -setdate $(I)you.h - -c:wait 2 - -# pm.h handled at target - -$(I)youprop.h: $(I)prop.h $(I)permonst.h $(I)mondata.h - -setdate $(I)youprop.h - -c:wait 2 - -$(I)display.h: $(I)vision.h $(I)mondata.h - -setdate $(I)display.h - -c:wait 2 - -$(I)dungeon.h: $(I)align.h - -setdate $(I)dungeon.h - -c:wait 2 - -$(I)engrave.h: $(I)rect.h - -setdate $(I)engrave.h - -c:wait 2 - -$(I)mextra.h: $(I)align.h - -setdate $(I)mextra.h - -c:wait 2 - -$(I)mondata.h: $(I)align.h - -setdate $(I)mondata.h - -c:wait 2 - -$(I)monst.h: $(I)align.h $(I)mextra.h - -setdate $(I)monst.h - -c:wait 2 - -$(I)pcconf.h: $(I)micro.h $(I)system.h - -setdate $(I)pcconf.h - -c:wait 2 - -$(I)rm.h: $(I)align.h - -setdate $(I)rm.h - -c:wait 2 - - -#notes -# install keeps doing re-install because it keeps rebuilding lev_comp??? -# fixed(?) - deleted setdate diff --git a/outdated/sys/amiga/Makefile.ami b/outdated/sys/amiga/Makefile.ami deleted file mode 100644 index d07a6633b..000000000 --- a/outdated/sys/amiga/Makefile.ami +++ /dev/null @@ -1,1578 +0,0 @@ -# NetHack Makefile. -# Copyright (c) Kenneth Lorber, Bethesda, Maryland, 1991,1992,1993,1996. -# NetHack may be freely redistributed. See license for details. - -### -### INTRODUCTION -### - -# This makefile is arranged for compiling for the Amiga with SAS/C 6.51 but -# can be configured for compiling with Manx C 5 or commercial DICE with -# simple changes. The appropriate changes are identified by #[compiler] -# where compiler is one of: SAS6, MANX, or DICE; the options in this -# makefile as should be set according to the compiler being used. (But see -# note 3 below.) - -# Note: When using the Manx compiler, an alternate make utility is -# required. The bundled Aztec make is just too damaged. - -# Note 2: The #SFD_xxx lines are used with mkdmake to generate a DMake- -# compatible makefile (DMakefile) from this file. Any line beginning with -# #SFD_INSTEAD replaces, in DMakefile, the following line from Makefile.ami. -# #SFD_BEGIN, #SFD_ELSE, and #SFD_END bracket multi-line sections for the two -# makefile formats. -# When changing this file, #SFD_INSTEAD lines will need to be inserted for -# the following cases: -# - Dependencies with different numbers of filenames (both > 1) on -# either side. The #SFD_INSTEAD line should immediately precede -# the line with the colon, and should contain a double colon "::" -# instead of a single colon. -# - Special command lists that override the default. A line containing -# "#SFD_INSTEAD #none" should precede such a rule. If the rule is -# more than one line long, precede it with "#SFD_BEGIN" and -# "#SFD_ELSE", and follow it with "#SFD_END". -# - Files not in the src, sys/amiga, sys/share, or win/tty directories -# that rely on the default ".c.o" rule. Following the dependency -# should be "#SFD_INSTEAD " with the filename inserted -# into the default rule where appropriate, then a line contianing -# "#none". -# In any SFD_BEGIN/ELSE/END block added, put a '##' before every line -# between the BEGIN and ELSE. Any line that's really a comment needs three -# '#'s, e.g. "### DICE comment". - -# Note 2A: Whenever an SFD line/block is added, the appropriate repeat count -# in mkdmake must be changed. (The repeat count "0" meaning "repeat -# until end of file" doesn't work as advertised.) - -# Note 3: mkdmake will automatically substitute DICE flags, etc. for SAS -# where appropriate. Since the makefile is already set up for SAS, -# the only people who end up having to make changes here are Manx -# users (or people who want to change the defaults). - -### -### DIRECTORY STRUCTURE -### - -NH = NH: -SBIN = $(NH)sbin/ -SLIB = $(NH)slib/ -NETHACK = $(NH)NetHack/ -HACKEXE = $(NH)HackExe/ -AMI = $(NH)sys/amiga/ -DAT = $(NH)dat/ -DOC = $(NH)doc/ -I = $(NH)include/ -SHARE = $(NH)sys/share/ -NHS = $(NH)src/ -TTY = $(NH)win/tty/ -WSHARE = $(NH)win/share/ -UTIL = $(NH)util/ -O = $(NH)obj/ -OO = $(NH)objo/ -# NB: O and OO MUST be different directories - -### -### INVOCATION -### - -#[SAS6] -#MAKE = smake -#[MANX] -#MAKE = make -#[DICE] -#MAKE = dmake - -# Startup makefile with: -# -#[SAS6] -#[MANX] -# $(MAKE) -f $(AMI)Makefile.ami -# $(MAKE) -f $(AMI)Makefile.ami install -# -#[DICE] -# $(MAKE) -f $(AMI)DMakefile -# $(MAKE) -f $(AMI)DMakefile install -# -# -# You may use following targets on $(MAKE) command lines: -# all do it all (default) -# link just create binary from object files -# obj just create common object files -# obja just create amiga object files -# objs just create shared object files -# clean deletes the object files -# spotless deletes the object files, main binary, and more -# -# Note: We do not build the Guidebook here since it needs tbl -# (See the file sys/unix/Makefile.doc for more information) - -#X# Precompiled header files: -#X# $(HDEP) should appear in any dependency list for an object file where -#X# we would want to make use of the precompiled version of $(I)hack.h, -#X# while $(CSYM) should appear in the C compiler command line that creates -#X# any such object file. (Changes made here should agree with the $(HDEP): -#X# target that appears later in this makefile.) -#X# - -#SFD_BEGIN -## -###[DICE] -### If we were compiling with DICE and wanted to use the symbol table -### pre-loading feature, we would uncomment these following two lines. -## -##HDEP = $(I)hack.sym -##CSYM = -H$(I)hack.sym=hack.h -## -#SFD_ELSE - -#[SAS5] -# If we were to use the precompiled header file feature in a newer version -# of SAS/C, we would comment out these following two lines. -# If we don't use precompiled header files, we uncomment it as well. - -HDEP = $(I)hack.h $(I)pm.h $(I)onames.h -CSYM = - -#[MANX] -# If we were compiling with Aztec, and wanted to use the symbol table -# pre-loading feature, we would uncomment these following two lines. - -#HDEP = Ram:hack.sym -#CSYM = +IRam:hack.sym - -#SFD_END - -#Pathname for uudecode program: -UUDEC = uudecode - -# Flex/Bison command assignments -- Useful only if you have flex/bison -FLEX = flex -BISON = bison -# FBFIL and FBLIB may be used, if required by your version of flex or bison, -# to specify additional files or libraries to be linked with -FBFIL = -FBLIB = #lib lib:compat.lib - -# If you're compiling this on a 1.3 system, you'll have to uncomment the -# following (for use with the ifchange script below). Also useful instead of -# "protect ifchange +s" -EXECUTE = execute - -# Headers we depend on -AMDEP = $(AMI)winproto.h $(AMI)winext.h $(AMI)windefs.h $(I)winami.h - -# Pathname for the C compiler being used. - -#SFD_BEGIN -## -###[DICE] -##CC = dcc -##ASM = das -## -#SFD_ELSE - -#[SAS6] -CC = sc -ASM = asm - -#[MANX] -#CC = cc - -#SFD_END - -# Compilation flags for selected C Compiler: -# $(CFLAGS) should appear before filename arguments of $(CC) command line. - -#SFD_BEGIN -## -###[DICE] -##CFLAGS = -c -I$(I) -mC -mD -ms -// -##CFLAGS2 = -##WBCFLAGS = -c -I$(I) -mC -mD -ms -// -##WBC2FLAGS = -DCLI -##SPLFLAGS = -DSPLIT -## -#SFD_ELSE - -#[SAS6] -# Note: make sure your CLI stack size is large (at least 50K) or lev_comp -# and makedefs may fail terribly - stack checking is disabled. -# -# **** WARNING **** GST support is not fool proof. You must make makedefs -# without a GST first so that the generated headers -# that are part of the GST can be made. -# -#GSTSRC=$(AMI)gst.c -# -#GSTHEAD=$(I)hack.h $(I)pm.h $(I)trap.h $(I)onames.h \ -# $(AMI)winami.p $(AMI)amidos.p $(AMI)amiwind.p -# -#GSTFILE=$(O)NetHack.gst -# undefine this to not compile with GSTs -#GST=gst=$(GSTFILE) -# -DEBUG=debug=symbol -CPU=cpu=68000 -#OPTFLAGS=opt opttime optpeep optgo optinl optsched optcomp=10 optdep=5 optrdep=5 #optalias +OPTTIME -OPTSIZE -CFLAGS = data=far nominc $(DEBUG) idir=$(I) $(CPU) nostkchk nover \ - codename=nhcode dataname=nhdata strmerge $(OPTFLAGS) $(TILES) $(SAVEDS) \ - afp $(ERRREXX) $(GST) -# for files that are too large for the standard flags: -CFLAGS2 = code=far strmerge $(SAVEDS) -WBCFLAGS = ignore=217,62 data=far ansi nminc code=far idir=$(I) $(CPU) afp \ - $(DEBUG) $(ERRREXX) define=AMIGA $(GST) -XXX = data=far ansi nminc idir=$(I) $(CPU) afp opt optinline optinlocal \ - optloop opttime -WBC2FLAGS = define=CLI -SPLFLAGS = define=SPLIT #dollarok -#for amistack.c -CFLAGS3 = data=near dataname=__MERGED nominc $(DEBUG) idir=$(I) $(CPU) nover nostkchk \ - codename=nhcode strmerge $(OPTFLAGS) $(TILES) $(SAVEDS) \ - afp $(ERRREXX) $(GST) - -#[MANX] -#CFLAGS = -i$(I) -mc -md -ms -pa -ps -bs -wo -qq -#WBCFLAGS = -mc -md -ms -pa -ps -bs -wo -qq -pp - -#SFD_END - -# Assembly flags: - -#SFD_BEGIN -## -###[DICE] -##AFLAGS = -##AOBJSPEC = -o -## -#SFD_ELSE - -#[SAS6] -AFLAGS = #what to put here? -AOBJSPEC = -o - -#SFD_END - -# Components of various link command lines: -# $(LINK) should be the pathname of the linker being used (with any options -# that should appear at the beginning of the command line). The name of the -# output file should appear immediately after $(LNSPEC). $(LIN) should -# appear before the list of object files in each link command. $(LLINK) -# should appear as the list of object files in the link command line that -# creates the NetHack executable. $(LLIB) should appear at the end of each -# link command line. - -# Note: amiga.lib added due to missing prototypes/pragmas. -# Should be deleted when this is resolved. - -#SFD_BEGIN -## -###[DICE] -### If you have flex/bison libraries, use the second definition of FLLIB -### instead of the first. -## -##LINK = dcc -mD -##LIN = -##LLINK = @$(AMI)ami.lnk -##LLIB = -##FLLIB = -###FLLIB = -l$(FBLIB) -##OBJSPEC = -o -##PNSPEC = -o -##LNSPEC = -o -##CCLINK = dcc -##CLFLAGS = -I$(I) -mC -mD -ms -// -##INCLSPEC = -I -##DEFSPEC = -D -##IGNSPEC = -j -## -#SFD_ELSE - -#[SAS6] - -LINK = slink noicons verbose maxhunk 262144 stripdebug -LIN = from lib:catch.o -LLINK = with $(AMI)ami.lnk -LLIB = lib lib:scnb.lib BATCH #lib lib:amiga.lib BATCH #scnb.lib or sc.lib -FLLIB = $(FBLIB) lib Lib:sc.lib BATCH -OBJSPEC = objname= -PNSPEC = noicons to #pname= -LNSPEC = to -CCLINK = sc link -INCLSPEC = idir= -DEFSPEC = define= -IGNSPEC = ignore= -COMPACT_HEADERS=$(GSTFILE) - -#[MANX] - -#LINK = ln -g +q +ss -o -#LIN = -#LLINK = -f $(AMI)ami.lnk -#LLIB = -lcl16 -#FLLIB = -lcl16 -#OBJSPEC = -o -#PNSPEC = -o -#LNSPEC = -o -#CCLINK = cc -#INCLSPEC = -i -#DEFSPEC = -d -#IGNSPEC = -j - -#SFD_END - -### -### FILE LISTS -### - -# A more reasonable random number generator (recommended for the Amiga): - -RANDOBJ = $(O)random.o - -#SFD_INSTEAD #none -.PRECIOUS: $(I)config.h $(I)decl.h $(I)hack.h $(I)permonst.h $(I)you.h - -# Almost nothing below this line should have to be changed. -# (Exceptions are marked by [SAS6], [MANX], etc.) -# -# Other things that have to be reconfigured are in config.h, -# (amiconf.h, pcconf.h), and possibly system.h, tradstdc.h. - -# Object files for makedefs: - -MAKEOBJS = \ - $(OO)makedefs.o $(O)monst.o $(O)objects.o - -# Object files for special levels compiler: - -SPLEVOBJS = \ - $(OO)lev_yacc.o $(OO)lev_lex.o $(OO)lev_main.o \ - $(O)decl.o $(O)drawing.o $(O)monst.o \ - $(O)objects.o $(OO)panic.o - -# Object files for dungeon compiler - -DGNCOMPOBJS = \ - $(OO)dgn_yacc.o $(OO)dgn_lex.o $(OO)dgn_main.o $(O)alloc.o $(OO)panic.o - -# Object files for NetHack: - -COMMOBJ = \ - $(O)allmain.o $(O)alloc.o $(O)apply.o $(O)artifact.o \ - $(O)attrib.o $(O)ball.o $(O)bones.o $(O)botl.o \ - $(O)cmd.o $(O)dbridge.o $(O)decl.o $(O)detect.o \ - $(O)dig.o $(O)display.o $(O)dlb.o $(O)do.o \ - $(O)do_name.o $(O)do_wear.o $(O)dog.o $(O)dogmove.o \ - $(O)dokick.o $(O)dothrow.o $(O)drawing.o $(O)dungeon.o \ - $(O)eat.o $(O)end.o $(O)engrave.o $(O)exper.o \ - $(O)explode.o $(O)extralev.o $(O)files.o $(O)fountain.o \ - $(O)hack.o $(O)hacklib.o $(O)invent.o $(O)light.o \ - $(O)lock.o $(O)mail.o $(O)makemon.o $(O)mapglyph.o \ - $(O)mcastu.o $(O)mhitm.o $(O)mhitu.o $(O)minion.o \ - $(O)mklev.o $(O)mkmap.o $(O)mkmaze.o $(O)mkobj.o \ - $(O)mkroom.o $(O)mon.o $(O)mondata.o $(O)monmove.o \ - $(O)monst.o $(O)mplayer.o $(O)mthrowu.o $(O)muse.o \ - $(O)music.o $(O)o_init.o $(O)objects.o $(O)objnam.o \ - $(O)options.o $(O)pager.o $(O)pickup.o $(O)pline.o \ - $(O)polyself.o $(O)potion.o $(O)pray.o $(O)priest.o \ - $(O)quest.o $(O)questpgr.o $(O)read.o $(O)rect.o \ - $(O)region.o $(O)restore.o $(O)rnd.o $(O)role.o \ - $(O)rumors.o $(O)save.o $(O)shk.o $(O)shknam.o \ - $(O)sit.o $(O)sounds.o $(O)sp_lev.o $(O)spell.o \ - $(O)steal.o $(O)steed.o $(O)sys.o $(O)teleport.o \ - $(O)timeout.o $(O)topten.o $(O)track.o $(O)trap.o \ - $(O)u_init.o $(O)uhitm.o $(O)vault.o $(O)version.o \ - (O)vision.o $(O)weapon.o $(O)were.o $(O)wield.o \ - $(O)windows.o $(O)wizard.o $(O)worm.o $(O)worn.o \ - $(O)write.o $(O)zap.o - -MAKEDEFOBJ = \ - $(O)monstr.o - -AMIGAOBJ = \ - $(O)amidos.o $(O)amirip.o $(O)amistack.o \ - $(O)amiwind.o $(O)winami.o $(O)winchar.o $(O)winfuncs.o \ - $(O)winkey.o $(O)winamenu.o $(O)winreq.o $(O)winstr.o - -# Objects from assembly sources (because DMake can't handle default rules) -AMIGAOBJ2 = \ -# $(O)dispmap.o - -SHAREOBJ = \ - $(O)pcmain.o $(RANDOBJ) - -TTYOBJ = \ - $(O)getline.o $(O)termcap.o $(O)topl.o $(O)wintty.o $(O)amitty.o \ - $(O)rip.o - -# Yuck yuck yuck. Have to tell DMake where these are, since they're not -# all in the same place. -TTYSRC = \ - $(TTY)getline.c $(TTY)termcap.c $(TTY)topl.c $(TTY)wintty.c \ - $(AMI)amitty.c $(NHS)rip.c - -# All the object files for NetHack: - -HOBJ = $(COMMOBJ) $(AMIGAOBJ) $(AMIGAOBJ2) $(SHAREOBJ) $(MAKEDEFOBJ) $(TTYOBJ) - -### -### DATA FILES -### - -# quest files -ADFILES1= $(SLIB)Arc-fila.lev $(SLIB)Arc-filb.lev $(SLIB)Arc-loca.lev \ - $(SLIB)Arc-strt.lev -ADFILES= $(SLIB)Arc-goal.lev $(ADFILES1) - -BDFILES1= $(SLIB)Bar-fila.lev $(SLIB)Bar-filb.lev $(SLIB)Bar-loca.lev \ - $(SLIB)Bar-strt.lev -BDFILES= $(SLIB)Bar-goal.lev $(BDFILES1) - -CDFILES1= $(SLIB)Cav-fila.lev $(SLIB)Cav-filb.lev $(SLIB)Cav-loca.lev \ - $(SLIB)Cav-strt.lev -CDFILES= $(SLIB)Cav-goal.lev $(CDFILES1) - -HDFILES1= $(SLIB)Hea-fila.lev $(SLIB)Hea-filb.lev $(SLIB)Hea-loca.lev \ - $(SLIB)Hea-strt.lev -HDFILES= $(SLIB)Hea-goal.lev $(HDFILES1) - -KDFILES1= $(SLIB)Kni-fila.lev $(SLIB)Kni-filb.lev $(SLIB)Kni-loca.lev \ - $(SLIB)Kni-strt.lev -KDFILES= $(SLIB)Kni-goal.lev $(KDFILES1) - -MDFILES1= $(SLIB)Mon-fila.lev $(SLIB)Mon-filb.lev $(SLIB)Mon-loca.lev \ - $(SLIB)Mon-strt.lev -MDFILES= $(SLIB)Mon-goal.lev $(MDFILES1) - -PDFILES1= $(SLIB)Pri-fila.lev $(SLIB)Pri-filb.lev $(SLIB)Pri-loca.lev \ - $(SLIB)Pri-strt.lev -PDFILES= $(SLIB)Pri-goal.lev $(PDFILES1) - -RDFILES1= $(SLIB)Rog-fila.lev $(SLIB)Rog-filb.lev $(SLIB)Rog-loca.lev \ - $(SLIB)Rog-strt.lev -RDFILES= $(SLIB)Rog-goal.lev $(RDFILES1) - -RANFILES1= $(SLIB)Ran-fila.lev $(SLIB)Ran-filb.lev $(SLIB)Ran-loca.lev \ - $(SLIB)Ran-strt.lev -RANFILES= $(SLIB)Ran-goal.lev $(RANFILES1) - -SDFILES1= $(SLIB)Sam-fila.lev $(SLIB)Sam-filb.lev $(SLIB)Sam-loca.lev \ - $(SLIB)Sam-strt.lev -SDFILES= $(SLIB)Sam-goal.lev $(SDFILES1) - -TDFILES1= $(SLIB)Tou-fila.lev $(SLIB)Tou-filb.lev $(SLIB)Tou-loca.lev \ - $(SLIB)Tou-strt.lev -TDFILES= $(SLIB)Tou-goal.lev $(TDFILES1) - -VDFILES1= $(SLIB)Val-fila.lev $(SLIB)Val-filb.lev $(SLIB)Val-loca.lev \ - $(SLIB)Val-strt.lev -VDFILES= $(SLIB)Val-goal.lev $(VDFILES1) - -WDFILES1= $(SLIB)Wiz-fila.lev $(SLIB)Wiz-filb.lev $(SLIB)Wiz-loca.lev \ - $(SLIB)Wiz-strt.lev -WDFILES= $(SLIB)Wiz-goal.lev $(WDFILES1) - -XDFILES= $(ADFILES) $(BDFILES) $(CDFILES) $(HDFILES) $(KDFILES) \ - $(MDFILES) $(PDFILES) $(RDFILES) $(RANFILES) $(SDFILES) $(TDFILES) \ - $(VDFILES) $(WDFILES) - -TILEFILES= \ - $(SBIN)txt2iff \ - $(NETHACK)tiles \ - $(NETHACK)tiles/objects.iff \ - $(NETHACK)tiles/monsters.iff \ - $(NETHACK)tiles/other.iff - -INSTDUNGEONFILES1= \ - $(SLIB)air.lev $(SLIB)asmodeus.lev $(SLIB)astral.lev \ - $(SLIB)baalz.lev $(SLIB)bigrm-1.lev $(SLIB)bigrm-2.lev \ - $(SLIB)bigrm-3.lev $(SLIB)bigrm-4.lev $(SLIB)bigrm-5.lev \ - $(SLIB)castle.lev $(SLIB)dungeon $(SLIB)earth.lev \ - $(SLIB)fakewiz1.lev $(SLIB)fakewiz2.lev $(SLIB)fire.lev \ - $(SLIB)juiblex.lev $(SLIB)knox.lev $(SLIB)medusa-1.lev \ - $(SLIB)medusa-2.lev $(SLIB)minend-1.lev $(SLIB)minend-2.lev \ - $(SLIB)minetn-1.lev $(SLIB)minetn-2.lev $(SLIB)minefill.lev \ - $(SLIB)options $(SLIB)oracle.lev $(SLIB)orcus.lev \ - $(SLIB)sanctum.lev $(SLIB)soko1-1.lev $(SLIB)soko1-2.lev \ - $(SLIB)soko2-1.lev $(SLIB)soko2-2.lev $(SLIB)soko3-1.lev \ - $(SLIB)soko3-2.lev $(SLIB)soko4-1.lev $(SLIB)soko4-2.lev \ - $(SLIB)tower1.lev $(SLIB)tower2.lev $(SLIB)tower3.lev \ - $(SLIB)valley.lev $(SLIB)water.lev $(SLIB)wizard1.lev \ - $(SLIB)wizard2.lev $(SLIB)wizard3.lev \ - $(XDFILES) - -INSTDUNGEONFILES= $(NETHACK)NetHack.cnf $(INSTDUNGEONFILES1) - - -INSTDATAFILES= \ - $(NETHACK)license $(NETHACK)logfile $(NETHACK)record \ - $(NETHACK)tomb.iff $(NETHACK)amii.hlp $(NETHACK)Recover.txt \ - $(NETHACK)GuideBook.txt $(NETHACK)NetHack.txt $(NETHACK)Install.ami - -LIBFILES= \ - $(INSTDUNGEONFILES1) \ - $(SLIB)cmdhelp $(SLIB)data $(SLIB)dungeon \ - $(SLIB)help $(SLIB)hh $(SLIB)history \ - $(SLIB)opthelp $(SLIB)oracles $(SLIB)rumors \ - $(SLIB)quest.dat $(SLIB)wizhelp - -### -### Getting down to business: -### - -#SFD_INSTEAD all: $(SBIN)lev_comp $(SBIN)dgn_comp $(SBIN)NetHack \ -all: $(COMPACT_HEADERS) $(SBIN)lev_comp $(SBIN)dgn_comp $(SBIN)NetHack \ - $(SBIN)dlb $(NETHACK)recover - -install: all inst-data inst-dungeon inst-fonts inst-tiles \ - $(NETHACK)nhdat $(NETHACK)NetHack - -$(SBIN)NetHack: $(HOBJ) $(AMI)ami.lnk - $(LINK) $(LNSPEC) $(SBIN)NetHack $(LIN) $(LLINK) $(LLIB) - -$(NETHACK)NetHack: $(SBIN)NetHack - copy $(SBIN)NetHack $(NETHACK)NetHack - -link: - $(LINK) $(LNSPEC) $(SBIN)NetHack $(LIN) $(LLINK) $(LLIB) - -$(AMI)ami.lnk: $(AMI)Makefile.ami - list to $(AMI)ami.lnk lformat="$(O)%s" $(O)\#?.o QUICK NOHEAD - -## dlb support -$(OO)dlb_main.o: $(UTIL)dlb_main.c $(HDEP) $(I)dlb.h $(I)date.h - $(CC) $(CFLAGS) $(OBJSPEC)$(OO)dlb_main.o $(UTIL)dlb_main.c - -$(SBIN)dlb: $(OO)dlb_main.o $(O)dlb.o $(O)alloc.o $(OO)panic.o - $(LINK) $(PNSPEC) $(SBIN)dlb $(LIN) $(OO)dlb_main.o $(O)dlb.o \ - $(O)alloc.o $(OO)panic.o $(LLIB) - -obj: $(HOBJ) - -obja: $(AMIGAOBJ) - -objs: $(SHAREOBJ) - - -#SFD_BEGIN -#SFD_ELSE -SUFFIXES = .lev .des -.des.lev: - $(SBIN)lev_comp $< -#SFD_END - - -# The default method for creating object files: - -#SFD_BEGIN -## -###[DICE] -## -##$(COMMOBJ): $(COMMOBJ:"$(O)*.o":"$(NHS)%1.c") -## $(CC) $(CFLAGS) $(CSYM) $(OBJSPEC)%(left) %(right) -## -##$(AMIGAOBJ): $(AMIGAOBJ:"$(O)*.o":"$(AMI)%1.c") -## $(CC) $(CFLAGS) $(CSYM) $(OBJSPEC)%(left) %(right) -## -##$(SHAREOBJ): $(SHAREOBJ:"$(O)*.o":"$(SHARE)%1.c") -## $(CC) $(CFLAGS) $(CSYM) $(OBJSPEC)%(left) %(right) -## -##$(TTYOBJ): $(TTYSRC) -## $(CC) $(CFLAGS) $(CSYM) $(OBJSPEC)%(left) %(right) -## -#SFD_ELSE - -#[SAS6] - -.c.o: - $(CC) $(CFLAGS) $(CSYM) $(OBJSPEC)$@ $< - -#SFD_END - - -clean: - -delete $(O)\#?.o $(OO)\#?.o - -spotless: clean - -delete $(SBIN)NetHack $(SBIN)lev_comp $(SBIN)makedefs $(SBIN)dgn_comp - -delete $(SBIN)dlb $(SBIN)txt2iff $(SBIN)splitter - -delete $(SBIN)tilemap - -delete $(SLIB)data $(SLIB)rumors - -delete $(SLIB)\#?.lev - -delete $(SLIB)dungeon - -delete $(SLIB)cmdhelp $(SLIB)help $(SLIB)hh $(SLIB)history - -delete $(SLIB)opthelp $(SLIB)options $(SLIB)oracles - -delete $(SLIB)quest.dat $(SLIB)wizhelp -# -delete $(SLIB)earth.lev $(SLIB)air.lev $(SLIB)fire.lev -# -delete $(SLIB)water.lev $(SLIB)astral.lev -# -delete $(SLIB)tower1.lev $(SLIB)tower2.lev $(SLIB)tower3.lev -# -delete $(SLIB)fakewiz1.lev $(SLIB)fakewiz2.lev -# -delete $(SLIB)medusa-1.lev $(SLIB)medusa-2.lev -# -delete $(SLIB)oracle.lev $(SLIB)wizard1.lev $(SLIB)wizard2.lev -# -delete $(SLIB)wizard3.lev $(DAT)dungeon.pdf $(SLIB)valley.lev -# -delete $(SLIB)minefill.lev -# -delete $(SLIB)minetn-1 $(SLIB)minetn-2 $(SLIB)minend-1 $(SLIB)minend-2 -# -delete $(SLIB)soko1-1.lev $(SLIB)soko1-2.lev $(SLIB)soko2-1.lev -# -delete $(SLIB)soko2-2.lev $(SLIB)soko3-1.lev $(SLIB)soko3-2.lev -# -delete $(SLIB)soko4-1.lev $(SLIB)soko4-2.lev -# -delete $(ADFILES) -# -delete $(BDFILES) -# -delete $(CDFILES) -# -delete $(HDFILES) -# -delete $(KDFILES) -# -delete $(MDFILES) -# -delete $(PDFILES) -# -delete $(RDFILES) -# -delete $(RANFILES) -# -delete $(SDFILES) -# -delete $(TDFILES) -# -delete $(VDFILES) -# -delete $(WDFILES) - -delete $(I)onames.h $(I)pm.h $(I)date.h - -delete $(NHS)tile.c $(NHS)monstr.c - -delete $(I)tile.h -# -echo to $(I)onames.h "" noline -# -wait 2 -# -echo to $(I)pm.h "" noline -# -wait 2 -# -setdate $(UTIL)makedefs.c -# -wait 2 - -# Creating precompiled version of $(I)hack.h to save disk I/O. - -#SFD_BEGIN -## -###[DICE] -### If we were compiling with DICE and wanted to use the symbol table -### pre-loading feature, we would technically not need a rule to make the -### precompiled header file, because DCC handles this automatically; -### however, we must delete the precompiled header file if any of the -### includes change, and we need to create it manually because the -### sys/amiga sources, compiled first, define things differently than the -### main sources want them. -## -##$(HDEP): $(I)hack.h $(I)pm.h $(I)onames.h -## -delete $(I)hack.sym -## echo to Ram:hackincl.c "#include " -## $(CC) $(CFLAGS) $(CSYM) $(OBJSPEC)Ram:hackincl.o Ram:hackincl.c -## -delete Ram:hackincl.c Ram:hackincl.o -## -#SFD_ELSE - -#X#[SAS5] -#X# If we were to use the precompiled header file feature of SAS/C, we -#X# would uncomment the following lines. (Also see defines for HDEP and -#X# CSYM near the beginning of this file, as these should be appropriately -#X# defined.) - -#X#$(HDEP): $(I)hack.h $(SBIN)makedefs -#X# echo to Ram:hackincl.c "#include <$(I)hack.h>" -#X# $(CC) $(CFLAGS) -ph $(OBJSPEC)$@ Ram:hackincl.c -#X# -delete Ram:hackincl.c - -#[MANX] -# If we were compiling with Aztec, and wanted to use the symbol table -# pre-loading feature, we would uncomment these following two lines. - -#$(HDEP): $(I)hack.h $(SBIN)makedefs -# $(CC) $(CFLAGS) -a $(OBJSPEC)Ram:hack.asm +h$@ $(I)hack.h -# -delete Ram:hack.asm - -#SFD_END - -# -# Please note: The dependency lines for the modules here are -# deliberately incorrect. Including "hack.h" in -# the dependency list would cause a dependency -# loop. -# - -$(SBIN)makedefs: $(MAKEOBJS) - $(LINK) $(LNSPEC) $(SBIN)makedefs $(LIN) $(MAKEOBJS) $(LLIB) - -$(OO)makedefs.o: $(UTIL)makedefs.c $(I)config.h $(I)permonst.h $(I)monsym.h \ - $(I)objclass.h $(I)patchlevel.h $(I)artilist.h - $(CC) $(DEFSPEC)MAKEDEFS_C $(CFLAGS) $(OBJSPEC)$@ $(UTIL)makedefs.c - -$(SBIN)lev_comp: $(SPLEVOBJS) - $(LINK) $(LNSPEC) $(SBIN)lev_comp $(LIN) $(SPLEVOBJS) $(FBFIL) $(FLLIB) - -$(SBIN)dgn_comp: $(DGNCOMPOBJS) - $(LINK) $(LNSPEC) $(SBIN)dgn_comp $(LIN) $(DGNCOMPOBJS) $(FBFIL) $(FLLIB) - -$(OO)lev_yacc.o: $(UTIL)lev_yacc.c $(HDEP) $(I)sp_lev.h $(I)pm.h $(I)onames.h -# setdate $(UTIL)lev_yacc.c - $(CC) $(DEFSPEC)LEV_LEX_C $(DEFSPEC)PREFIX="NH:slib/" $(CFLAGS) \ - $(DEFSPEC)alloca=malloc $(OBJSPEC)$@ $(UTIL)lev_yacc.c - -$(OO)lev_lex.o: $(UTIL)lev_lex.c $(HDEP) $(I)lev_comp.h $(I)sp_lev.h - $(CC) $(DEFSPEC)LEV_LEX_C $(CFLAGS) $(OBJSPEC)$@ $(UTIL)lev_lex.c - -$(OO)lev_main.o: $(UTIL)lev_main.c $(HDEP) $(I)pm.h $(I)onames.h $(I)date.h - $(CC) $(DEFSPEC)LEV_LEX_C $(DEFSPEC)AMIGA $(CFLAGS) $(OBJSPEC)$@ \ - $(UTIL)lev_main.c - -$(OO)dgn_yacc.o: $(UTIL)dgn_yacc.c $(HDEP) $(I)dgn_file.h $(I)patchlevel.h - $(CC) $(DEFSPEC)LEV_LEX_C $(CFLAGS) $(DEFSPEC)alloca=malloc \ - $(OBJSPEC)$@ $(UTIL)dgn_yacc.c - -$(OO)dgn_lex.o: $(UTIL)dgn_lex.c $(I)config.h $(I)dgn_comp.h $(I)dgn_file.h - $(CC) $(DEFSPEC)LEV_LEX_C $(CFLAGS) $(OBJSPEC)$@ $(UTIL)dgn_lex.c - -$(OO)dgn_main.o: $(UTIL)dgn_main.c $(I)config.h $(I)date.h - $(CC) $(DEFSPEC)LEV_LEX_C $(DEFSPEC)AMIGA $(CFLAGS) $(OBJSPEC)$@ \ - $(UTIL)dgn_main.c - -$(OO)panic.o: $(UTIL)panic.c $(HDEP) -#SFD_INSTEAD $(CC) $(CFLAGS) $(OBJSPEC)%(left) $(UTIL)panic.c -#none - -$(OO)recover.o: $(UTIL)recover.c $(I)config.h $(I)date.h - $(CC) $(DEFSPEC)LEV_LEX_C $(DEFSPEC)AMIGA $(CFLAGS) $(OBJSPEC)$@ \ - $(UTIL)recover.c - -$(NETHACK)recover: $(OO)recover.o - $(LINK) $(LNSPEC) $(NETHACK)recover $(LIN) $(OO)recover.o $(LLIB) - -# [OPTION] -- If you have flex/bison, leave these uncommented. Otherwise, -# comment them out and be careful! (You're not guaranteed to have the most -# up to date *_comp.c, *_comp.h and *_lex.c) - -$(I)lev_comp.h: $(UTIL)lev_yacc.c $(I)patchlevel.h - -$(UTIL)lev_yacc.c: $(UTIL)lev_comp.y $(I)patchlevel.h - $(BISON) -d $(UTIL)lev_comp.y -# copy y.tab.c $(UTIL)lev_yacc.c -# copy y.tab.h $(I)lev_comp.h - copy $(UTIL)lev_comp.tab.c $(UTIL)lev_yacc.c - copy $(UTIL)lev_comp.tab.h $(I)lev_comp.h -# delete y.tab.c -# delete y.tab.h - delete $(UTIL)lev_comp.tab.c - delete $(UTIL)lev_comp.tab.h - -$(UTIL)lev_lex.c: $(UTIL)lev_comp.l $(I)patchlevel.h - $(FLEX) $(UTIL)lev_comp.l - copy lex.yy.c $(UTIL)lev_lex.c - delete lex.yy.c - -$(I)dgn_comp.h: $(UTIL)dgn_yacc.c $(I)patchlevel.h - -$(UTIL)dgn_yacc.c: $(UTIL)dgn_comp.y $(I)patchlevel.h - $(BISON) -d $(UTIL)dgn_comp.y -# copy y.tab.c $(UTIL)dgn_yacc.c -# copy y.tab.h $(I)dgn_comp.h - copy $(UTIL)dgn_comp.tab.c $(UTIL)dgn_yacc.c - copy $(UTIL)dgn_comp.tab.h $(I)dgn_comp.h -# delete y.tab.c -# delete y.tab.h - delete $(UTIL)dgn_comp.tab.c - delete $(UTIL)dgn_comp.tab.h - -$(UTIL)dgn_lex.c: $(UTIL)dgn_comp.l $(I)patchlevel.h - $(FLEX) $(UTIL)dgn_comp.l - copy lex.yy.c $(UTIL)dgn_lex.c - delete lex.yy.c - -# -# The following include files depend on makedefs to be created. -# As a result, they are not defined in HACKINCL, instead, their -# dependencies are explicitly outlined here. -# - -# -# date.h should be remade any time any of the source or include code -# is modified. Unfortunately, this would make the contents of this -# file far more complex. Since "hack.h" depends on most of the include -# files, we kludge around this by making date.h dependent on hack.h, -# even though it doesn't include this file. -# - -#SFD_INSTEAD $(I)date.h $(DAT)options:: $(HDEP) $(SBIN)makedefs $(AMIGAOBJ) -$(I)date.h $(DAT)options: $(HDEP) $(SBIN)makedefs $(AMIGAOBJ) $(I)patchlevel.h - $(SBIN)makedefs -v - $(EXECUTE) $(AMI)ifchange MOVE $(I)t.date.h $(I)date.h - -wait 2 - -$(I)onames.h: $(SBIN)makedefs - $(SBIN)makedefs -o - $(EXECUTE) $(AMI)ifchange TOUCH $(I)t.onames.h $(I)onames.h $(I)decl.h - $(EXECUTE) $(AMI)ifchange MOVE $(I)t.onames.h $(I)onames.h - -wait 2 - -$(I)pm.h: $(SBIN)makedefs - $(SBIN)makedefs -p - $(EXECUTE) $(AMI)ifchange TOUCH $(I)t.pm.h $(I)pm.h $(I)decl.h $(I)youprop.h - $(EXECUTE) $(AMI)ifchange MOVE $(I)t.pm.h $(I)pm.h - -wait 2 - -$(SLIB)quest.dat: $(DAT)quest.txt $(SBIN)makedefs - $(SBIN)makedefs -q - -$(NHS)monstr.c: $(HDEP) $(SBIN)makedefs - $(SBIN)makedefs -m - -wait 2 - -$(SLIB)oracles: $(DAT)oracles.txt $(SBIN)makedefs - $(SBIN)makedefs -h - -wait 2 - -# -# The following programs vary depending on what OS you are using. -# As a result, they are not defined in HACKSRC and their dependencies -# are explicitly outlined here. -# - -$(O)amidos.o: $(AMI)amidos.c $(HDEP) - -$(O)amirip.o: $(AMI)amirip.c $(HDEP) - -$(O)aglue.o: $(AMI)aglue.a - $(ASM) $(AFLAGS) $(AOBJSPEC)$(O)aglue.o $(AMI)aglue.a - -$(O)winchar.o: $(AMI)winchar.c $(NHS)tile.c $(HDEP) - -$(NHS)tile.c: $(WSHARE)tilemap.c -#SFD_INSTEAD $(CCLINK) $(CLFLAGS) $(PNSPEC) $(SBIN)tilemap $(WSHARE)tilemap.c - $(CCLINK) $(CFLAGS) $(PNSPEC) $(SBIN)tilemap $(WSHARE)tilemap.c - $(SBIN)tilemap - -$(O)winstr.o: $(AMI)winstr.c $(HDEP) $(AMDEP) - -$(O)winreq.o: $(AMI)winreq.c $(HDEP) $(AMDEP) $(AMI)colorwin.c $(AMI)clipwin.c - -$(O)winfuncs.o: $(AMI)winfuncs.c $(HDEP) $(AMDEP) $(I)patchlevel.h - -$(O)winkey.o: $(AMI)winkey.c $(HDEP) $(AMDEP) - -$(O)winamenu.o: $(AMI)winamenu.c $(HDEP) $(AMDEP) - -$(O)winami.o: $(AMI)winami.c $(HDEP) $(AMDEP) #$(AMI)char.c $(AMI)randwin.c - -#$(O)amilib.o: $(AMI)amilib.c $(HDEP) $(AMDEP) - -$(O)amiwind.o: $(AMI)amiwind.c $(AMI)amimenu.c $(HDEP) $(AMDEP) - -$(O)amiwbench.o: $(AMI)amiwbench.c $(HDEP) - -$(O)random.o: $(SHARE)random.c - -$(O)pcmain.o: $(SHARE)pcmain.c $(HDEP) $(I)dlb.h - -$(O)dispmap.o: $(AMI)dispmap.s - $(ASM) $(AFLAGS) $(AOBJSPEC)$@ $< - -# Stuff to build the front ends -$(NETHACK)HackWB: $(OO)wb.o $(OO)wbx.o $(OO)loader.o $(OO)multi.o - $(LINK) $(LNSPEC) $(NETHACK)HackWB $(LIN) $(OO)wb.o $(OO)wbx.o \ - $(OO)loader.o $(OO)multi.o $(LLIB) - -$(NETHACK)HackCli: $(OO)cli.o $(OO)loader.o $(OO)multi.o - $(LINK) $(LNSPEC) $(NETHACK)HackCli $(LIN) $(OO)cli.o $(OO)loader.o \ - $(OO)multi.o $(LLIB) - -# This needs to exist to eliminate the HackWB startup message -#SFD_INSTEAD $(NETHACK)WBDefaults.def: $(NETHACK)WBDefaults.def -$(NETHACK)WBDefaults.def: - echo to $(NETHACK)WBDefaults.def - -WBH = $(AMI)wbdefs.h $(AMI)wbstruct.h $(AMI)wbprotos.h -ASP = $(AMI)splitter -$(OO)wb.o: $(WBH) $(AMI)wb.c $(AMI)wbwin.c $(AMI)wbdata.c $(AMI)wbgads.c \ - $(I)patchlevel.h - $(CC) $(WBCFLAGS) $(SPLFLAGS) $(OBJSPEC)$(OO)wb.o $(AMI)wb.c - -$(OO)wbx.o: $(WBH) $(AMI)wbcli.c $(AMI)wbwin.c $(AMI)wbdata.c \ - $(I)patchlevel.h $(I)date.h - $(CC) $(WBCFLAGS) $(SPLFLAGS) $(OBJSPEC)$(OO)wbx.o $(AMI)wbcli.c - -$(OO)loader.o: $(ASP)/loader.c $(ASP)/split.h $(ASP)/amiout.h $(ASP)/multi.h - $(CC) $(WBCFLAGS) $(SPLFLAGS) $(OBJSPEC)$(OO)loader.o $(ASP)/loader.c - -$(OO)multi.o: $(ASP)/multi.c $(ASP)/multi.h - $(CC) $(WBCFLAGS) $(SPLFLAGS) $(OBJSPEC)$(OO)multi.o $(ASP)/multi.c - -$(OO)cli.o: $(WBH) $(AMI)wbcli.c $(I)patchlevel.h $(I)date.h - $(CC) $(WBCFLAGS) $(WBC2FLAGS) $(SPLFLAGS) $(OBJSPEC)$(OO)cli.o \ - $(AMI)wbcli.c - -#### -# splitter support -$(SBIN)splitter: $(OO)splitter.o $(OO)arg.o - $(LINK) $(LNSPEC) $(SBIN)splitter $(LIN) $(OO)splitter.o $(OO)arg.o \ - $(LLIB) - -$(NETHACK)NetHack.dir: $(SBIN)splitter $(SBIN)NetHack - $(SBIN)splitter $(SBIN)NetHack - -$(OO)splitter.o: $(ASP)/splitter.c $(ASP)/split.h $(ASP)/amiout.h $(ASP)/arg.h - $(CC) $(WBCFLAGS) $(SPLFLAGS) $(OBJSPEC)$(OO)splitter.o \ - $(ASP)/splitter.c - -$(OO)arg.o: $(ASP)/arg.c $(ASP)/arg.h - $(CC) $(WBCFLAGS) $(SPLFLAGS) $(OBJSPEC)$(OO)arg.o $(ASP)/arg.c - -# Create/copy other stuff into NetHack: directory: - -$(NETHACK)tomb.iff: $(SBIN)xpm2iff $(AMI)grave16.xpm - $(SBIN)xpm2iff $(AMI)grave16.xpm $(NETHACK)tomb.iff - -$(OO)xpm2iff.o: $(AMI)xpm2iff.c - $(CC) $(CFLAGS) $(INCLSPEC)$(WSHARE) $(OBJSPEC)$@ $(AMI)xpm2iff.c - -$(SBIN)xpm2iff: $(OO)xpm2iff.o - $(LINK) $(LNSPEC) $@ $(LIN) $(OO)xpm2iff.o $(FLLIB) - -# Tile installation for the tile version of the game -inst-tiles: $(TILEFILES) - -#SFD_INSTEAD $(NETHACK)tiles: $(NETHACK)tiles -$(NETHACK)tiles: - -makedir $(NETHACK)tiles - -$(OO)txt2iff.o: $(AMI)txt2iff.c - $(CC) $(CFLAGS) $(CSYM) $(INCLSPEC)$(WSHARE) $(OBJSPEC)$@ \ - $(AMI)txt2iff.c - -$(OO)ppmwrite.o: $(WSHARE)ppmwrite.c - $(CC) $(CFLAGS) $(CSYM) $(INCLSPEC)$(WSHARE) $(OBJSPEC)$@ $(WSHARE)ppmwrite.c - -$(OO)tiletext.o: $(WSHARE)tiletext.c $(I)config.h $(WSHARE)tile.h - $(CC) $(CFLAGS) $(CSYM) $(INCLSPEC)$(WSHARE) $(OBJSPEC)$@ $(WSHARE)tiletext.c - -$(OO)tiletxt.o: $(WSHARE)tilemap.c $(I)hack.h - $(CC) $(CFLAGS) $(CSYM) $(DEFSPEC)TILETEXT $(INCLSPEC)$(WSHARE) $(OBJSPEC)$@ $(WSHARE)tilemap.c - -NAMEOBJS = $(O)drawing.o $(O)decl.o $(O)monst.o $(O)objects.o - -$(SBIN)txt2ppm: $(OO)ppmwrite.o $(NAMEOBJS) $(O)alloc.o $(OO)panic.o $(OO)tiletext.o $(OO)tiletxt.o - $(LINK) $(LNSPEC) $@ $(LIN) $(OO)ppmwrite.o $(NAMEOBJS) $(OO)tiletext.o $(OO)tiletxt.o $(O)alloc.o $(OO)panic.o $(FLLIB) - -$(SBIN)txt2iff: $(OO)txt2iff.o $(NAMEOBJS) $(OO)tiletext.o $(OO)tiletxt.o - $(LINK) $(LNSPEC) $@ $(LIN) $(OO)txt2iff.o $(NAMEOBJS) $(OO)tiletext.o \ - $(OO)tiletxt.o $(FLLIB) - -$(NETHACK)tiles/objects.iff: $(WSHARE)objects.txt $(SBIN)txt2iff - $(SBIN)txt2iff $(WSHARE)objects.txt $(NETHACK)tiles/objects.iff - -$(NETHACK)tiles/monsters.iff: $(WSHARE)monsters.txt $(SBIN)txt2iff - $(SBIN)txt2iff $(WSHARE)monsters.txt $(NETHACK)tiles/monsters.iff - -$(NETHACK)tiles/other.iff: $(WSHARE)other.txt $(SBIN)txt2iff - $(SBIN)txt2iff $(WSHARE)other.txt $(NETHACK)tiles/other.iff - -inst-dungeon: $(INSTDUNGEONFILES) - -$(NETHACK)options : $(DAT)options - copy $(DAT)options $@ - -# Create compiled dungeon files -BGM= $(SLIB)bigrm-2.lev $(SLIB)bigrm-3.lev $(SLIB)bigrm-4.lev $(SLIB)bigrm-5.lev -$(BGM): $(SLIB)bigrm-1.lev - -$(SLIB)bigrm-1.lev: $(DAT)bigroom.des $(SBIN)lev_comp -#SFD_INSTEAD $(SBIN)lev_comp $(DAT)bigroom.des -#none - -$(SLIB)castle.lev: $(DAT)castle.des $(SBIN)lev_comp - -ENDGAME1= $(SLIB)air.lev $(SLIB)earth.lev $(SLIB)fire.lev $(SLIB)water.lev -$(ENDGAME1): $(SLIB)astral.lev - -$(SLIB)astral.lev: $(DAT)endgame.des $(SBIN)lev_comp -#SFD_INSTEAD $(SBIN)lev_comp $(DAT)endgame.des -#none - -GEHENNOM1= $(SLIB)asmodeus.lev $(SLIB)baalz.lev $(SLIB)juiblex.lev \ - $(SLIB)orcus.lev $(SLIB)sanctum.lev -$(GEHENNOM1): $(SLIB)valley.lev - -$(SLIB)valley.lev: $(DAT)gehennom.des $(SBIN)lev_comp -#SFD_INSTEAD $(SBIN)lev_comp $(DAT)gehennom.des -#none - -$(SLIB)knox.lev: $(DAT)knox.des $(SBIN)lev_comp -#SFD_INSTEAD $(SBIN)lev_comp $(DAT)knox.des -#none - -MINES1= $(SLIB)minend-1.lev $(SLIB)minend-2.lev $(SLIB)minetn-1.lev $(SLIB)minetn-2.lev -$(MINES1): $(SLIB)minefill.lev - -$(SLIB)minefill.lev: $(DAT)mines.des $(SBIN)lev_comp -#SFD_INSTEAD $(SBIN)lev_comp $(DAT)mines.des -#none - -$(SLIB)oracle.lev: $(DAT)oracle.des $(SBIN)lev_comp -#SFD_INSTEAD $(SBIN)lev_comp $(DAT)oracle.des -#none - -TOWER1= $(SLIB)tower1.lev $(SLIB)tower2.lev -$(TOWER1): $(SLIB)tower3.lev - -$(SLIB)tower3.lev: $(DAT)tower.des $(SBIN)lev_comp -#SFD_INSTEAD $(SBIN)lev_comp $(DAT)tower.des -#none - -WIZARD1= $(SLIB)wizard1.lev $(SLIB)wizard2.lev $(SLIB)wizard3.lev \ - $(SLIB)fakewiz1.lev -$(WIZARD1): $(SLIB)fakewiz2.lev - -$(SLIB)fakewiz2.lev: $(DAT)yendor.des $(SBIN)lev_comp -#SFD_INSTEAD $(SBIN)lev_comp $(DAT)yendor.des -#none - -MEDUSA1= $(SLIB)medusa-1.lev -$(MEDUSA1): $(SLIB)medusa-2.lev - -$(SLIB)medusa-2.lev: $(DAT)medusa.des $(SBIN)lev_comp -#SFD_INSTEAD $(SBIN)lev_comp $(DAT)medusa.des -#none - -SOKOBAN1= $(SLIB)soko1-1.lev $(SLIB)soko1-2.lev $(SLIB)soko2-1.lev \ - $(SLIB)soko2-2.lev $(SLIB)soko3-1.lev $(SLIB)soko3-2.lev \ - $(SLIB)soko4-1.lev -$(SOKOBAN1): $(SLIB)soko4-2.lev - -$(SLIB)soko4-2.lev: $(DAT)sokoban.des $(SBIN)lev_comp -#SFD_INSTEAD $(SBIN)lev_comp $(DAT)sokoban.des -#none - -$(ADFILES1): $(SLIB)Arc-goal.lev - -$(SLIB)Arc-goal.lev: $(DAT)Arch.des $(SBIN)lev_comp -#SFD_INSTEAD $(SBIN)lev_comp $(DAT)Arch.des -#none - -$(BDFILES1): $(SLIB)Bar-goal.lev - -$(SLIB)Bar-goal.lev: $(DAT)Barb.des $(SBIN)lev_comp -#SFD_INSTEAD $(SBIN)lev_comp $(DAT)Barb.des -#none - -$(CDFILES1): $(SLIB)Cav-goal.lev - -$(SLIB)Cav-goal.lev: $(DAT)Caveman.des $(SBIN)lev_comp -#SFD_INSTEAD $(SBIN)lev_comp $(DAT)Caveman.des -#none - -$(HDFILES1): $(SLIB)Hea-goal.lev - -$(SLIB)Hea-goal.lev: $(DAT)Healer.des $(SBIN)lev_comp -#SFD_INSTEAD $(SBIN)lev_comp $(DAT)Healer.des -#none - -$(KDFILES1): $(SLIB)Kni-goal.lev - -$(SLIB)Kni-goal.lev: $(DAT)Knight.des $(SBIN)lev_comp -#SFD_INSTEAD $(SBIN)lev_comp $(DAT)Knight.des -#none - -$(MDFILES1): $(SLIB)Mon-goal.lev - -$(SLIB)Mon-goal.lev: $(DAT)Monk.des $(SBIN)lev_comp -#SFD_INSTEAD $(SBIN)lev_comp $(DAT)Monk.des -#none - -$(PDFILES1): $(SLIB)Pri-goal.lev - -$(SLIB)Pri-goal.lev: $(DAT)Priest.des $(SBIN)lev_comp -#SFD_INSTEAD $(SBIN)lev_comp $(DAT)Priest.des -#none - -$(RDFILES1): $(SLIB)Rog-goal.lev - -$(SLIB)Rog-goal.lev: $(DAT)Rogue.des $(SBIN)lev_comp -#SFD_INSTEAD $(SBIN)lev_comp $(DAT)Rogue.des -#none - -$(RANFILES1): $(SLIB)Ran-goal.lev - -$(SLIB)Ran-goal.lev: $(DAT)Ranger.des $(SBIN)lev_comp -#SFD_INSTEAD $(SBIN)lev_comp $(DAT)Ranger.des -#none - -$(SDFILES1): $(SLIB)Sam-goal.lev - -$(SLIB)Sam-goal.lev: $(DAT)Samurai.des $(SBIN)lev_comp -#SFD_INSTEAD $(SBIN)lev_comp $(DAT)Samurai.des -#none - -$(TDFILES1): $(SLIB)Tou-goal.lev - -$(SLIB)Tou-goal.lev: $(DAT)Tourist.des $(SBIN)lev_comp -#SFD_INSTEAD $(SBIN)lev_comp $(DAT)Tourist.des -#none - -$(VDFILES1): $(SLIB)Val-goal.lev - -$(SLIB)Val-goal.lev: $(DAT)Valkyrie.des $(SBIN)lev_comp -#SFD_INSTEAD $(SBIN)lev_comp $(DAT)Valkyrie.des -#none - -$(WDFILES1): $(SLIB)Wiz-goal.lev - -$(SLIB)Wiz-goal.lev: $(DAT)Wizard.des $(SBIN)lev_comp -#SFD_INSTEAD $(SBIN)lev_comp $(DAT)Wizard.des -#none - -$(SLIB)dungeon: $(DAT)dungeon.def $(SBIN)makedefs $(SBIN)dgn_comp - $(SBIN)makedefs -e - $(SBIN)dgn_comp $(DAT)dungeon.pdf - copy $(DAT)dungeon $(SLIB)dungeon - delete $(DAT)dungeon - -inst-data: $(INSTDATAFILES) - -$(NETHACK)amii.hlp: $(AMI)amii.hlp - copy $(AMI)amii.hlp $@ - -#$(NETHACK)data: $(DAT)data -# copy $(DAT)data $@ - -$(SLIB)data: $(DAT)data.base $(I)config.h $(SBIN)makedefs - $(SBIN)makedefs -d - -#$(NETHACK)rumors: $(DAT)rumors -# copy $(DAT)rumors $@ - -$(SLIB)rumors: $(DAT)rumors.tru $(DAT)rumors.fal $(SBIN)makedefs - $(SBIN)makedefs -r - -$(SLIB)cmdhelp: $(DAT)cmdhelp - copy $(DAT)cmdhelp $@ - -$(SLIB)help: $(DAT)help - copy $(DAT)help $@ - -$(SLIB)hh: $(DAT)hh - copy $(DAT)hh $@ - -$(NETHACK)HackWB.hlp: $(AMI)HackWB.hlp - copy $(AMI)HackWB.hlp $@ - -$(SLIB)history: $(DAT)history - copy $(DAT)history $@ - -$(NETHACK)license: $(DAT)license - copy $(DAT)license $@ - -$(SLIB)opthelp: $(DAT)opthelp - copy $(DAT)opthelp $@ - -$(NETHACK)Recover.txt: $(DOC)Recover.txt - copy $(DOC)Recover.txt $@ - -$(NETHACK)GuideBook.txt: $(DOC)GuideBook.txt - copy $(DOC)GuideBook.txt $@ - -$(NETHACK)NetHack.txt: $(DOC)NetHack.txt - copy $(DOC)NetHack.txt $@ - -$(NETHACK)Install.ami: $(AMI)Install.ami - copy $(AMI)Install.ami $@ - -#SFD_INSTEAD $(NETHACK)logfile: $(NETHACK)logfile -$(NETHACK)logfile: - echo to $@ - -#SFD_INSTEAD $(NETHACK)record: $(NETHACK)record -$(NETHACK)record: - echo to $@ - -$(SLIB)wizhelp: $(DAT)wizhelp - copy $(DAT)wizhelp $@ - -# Create the directories here because NetHack.cnf puts them there by default -$(NETHACK)NetHack.cnf: $(AMI)NetHack.cnf - copy $(AMI)NetHack.cnf $@ - -makedir $(NETHACK)save - -makedir $(NETHACK)levels - -#SFD_BEGIN -#SFD_ELSE -$(O)NetHack.gst: $(GSTSRC) $(I)hack.h - sc makegst=$(GSTFILE) $(CFLAGS) $(GSTSRC) -#SFD_END - -# Unpack and install fonts - -INSTFONTFILES= $(NETHACK)hack.font $(NETHACK)hack $(NETHACK)hack/8 - -inst-fonts: $(INSTFONTFILES) - -$(NETHACK)hack/8: $(AMI)amifont8.uu $(NETHACK)hack - $(UUDEC) $(AMI)amifont8.uu - copy 8 $(NETHACK)hack/8 - delete 8 - -$(NETHACK)hack.font: $(AMI)amifont.uu - $(UUDEC) $(AMI)amifont.uu - copy hack.font $(NETHACK)hack.font - delete hack.font - -#SFD_INSTEAD $(NETHACK)hack: $(NETHACK)hack -$(NETHACK)hack: - -makedir $@ - -INSTICONFILES= \ - $(NETHACK)default.icon $(NETHACK)NetHack.info $(NETHACK)NewGame.info \ - $(NETHACK)HackWB.info - -inst-icons: $(INSTICONFILES) - -# Unpack the icons into place - -$(NETHACK)default.icon: $(AMI)dflticon.uu - $(UUDEC) $(AMI)dflticon.uu -# copy default.icon $(NETHACK)default.icon -# delete default.icon - -$(NETHACK)NetHack.info: $(AMI)NHinfo.uu - $(UUDEC) $(AMI)NHinfo.uu -# copy NetHack.info $(NETHACK)NetHack.info -# delete NetHack.info - -$(NETHACK)NewGame.info: $(AMI)NewGame.uu - $(UUDEC) $(AMI)NewGame.uu -# copy NewGame.info $(NETHACK)NewGame.info -# delete NewGame.info - -$(NETHACK)HackWB.info: $(AMI)HackWB.uu - $(UUDEC) $(AMI)HackWB.uu -# copy HackWB.info $(NETHACK)HackWB.info -# delete HackWB.info - -# If DLB is defined, create the nhdat library file in the playground -# directory. If not, move all the data files there. -$(NETHACK)nhdat: $(LIBFILES) $(SBIN)dlb - list to T:nhdat.lst $(SLIB) QUICK NOHEAD FILES - echo >T:make-nhdat $(SBIN)dlb cCfI $(SLIB) $(NETHACK)nhdat T:nhdat.lst - echo >>T:make-nhdat if not exists $(NETHACK)nhdat - echo >>T:make-nhdat copy $(SLIB)\#? $(NETHACK) - echo >>T:make-nhdat endif - execute T:make-nhdat - -delete T:make-nhdat - -# DO NOT DELETE THIS LINE - -$(O)allmain.o: $(NHS)allmain.c $(HDEP) - -$(O)alloc.o: $(NHS)alloc.c $(I)config.h - -$(O)apply.o: $(NHS)apply.c $(HDEP) -#SFD_INSTEAD #none - $(CC) $(CFLAGS) $(CFLAGS2) $(OBJSPEC)$@ $(NHS)apply.c - -$(O)artifact.o: $(NHS)artifact.c $(HDEP) $(I)artifact.h $(I)artilist.h - -$(O)attrib.o: $(NHS)attrib.c $(HDEP) $(I)artifact.h - -$(O)ball.o: $(NHS)ball.c $(HDEP) - -$(O)bones.o: $(NHS)bones.c $(HDEP) - -$(O)botl.o: $(NHS)botl.c $(HDEP) - -$(O)cmd.o: $(NHS)cmd.c $(HDEP) $(I)func_tab.h - -$(O)dbridge.o: $(NHS)dbridge.c $(HDEP) - -$(O)decl.o: $(NHS)decl.c $(HDEP) $(I)quest.h - -$(O)detect.o: $(NHS)detect.c $(HDEP) $(I)artifact.h - -$(O)dig.o: $(NHS)dig.c $(HDEP) - -$(O)display.o: $(NHS)display.c $(HDEP) - -$(O)dlb.o: $(NHS)dlb.c $(HDEP) $(I)dlb.h - -$(O)do.o: $(NHS)do.c $(HDEP) - -$(O)do_name.o: $(NHS)do_name.c $(HDEP) - -$(O)do_wear.o: $(NHS)do_wear.c $(HDEP) - -$(O)dog.o: $(NHS)dog.c $(HDEP) - -$(O)dogmove.o: $(NHS)dogmove.c $(HDEP) $(I)mfndpos.h - -$(O)dokick.o: $(NHS)dokick.c $(HDEP) - -$(O)dothrow.o: $(NHS)dothrow.c $(HDEP) - -$(O)drawing.o: $(NHS)drawing.c $(HDEP) $(I)tcap.h - $(CC) $(CFLAGS) $(CFLAGS2) $(OBJSPEC)$@ $(NHS)drawing.c - -$(O)dungeon.o: $(NHS)dungeon.c $(HDEP) $(I)dgn_file.h $(I)dlb.h - -$(O)eat.o: $(NHS)eat.c $(HDEP) - -$(O)end.o: $(NHS)end.c $(HDEP) $(I)dlb.h - -$(O)engrave.o: $(NHS)engrave.c $(HDEP) - -$(O)exper.o: $(NHS)exper.c $(HDEP) - -$(O)explode.o: $(NHS)explode.c $(HDEP) - -$(O)extralev.o: $(NHS)extralev.c $(HDEP) - -$(O)files.o: $(NHS)files.c $(HDEP) $(I)dlb.h $(I)date.h - -$(O)fountain.o: $(NHS)fountain.c $(HDEP) - -$(O)hack.o: $(NHS)hack.c $(HDEP) - -$(O)hacklib.o: $(NHS)hacklib.c $(HDEP) - -$(O)invent.o: $(NHS)invent.c $(HDEP) $(I)artifact.h - -$(O)light.o: $(NHS)light.c $(HDEP) - -$(O)lock.o: $(NHS)lock.c $(HDEP) - -$(O)mail.o: $(NHS)mail.c $(HDEP) $(I)mail.h - -$(O)makemon.o: $(NHS)makemon.c $(HDEP) - -$(O)mapglyph.o: $(NHS)mapglyph.c $(HDEP) - -$(O)mcastu.o: $(NHS)mcastu.c $(HDEP) - -$(O)mhitm.o: $(NHS)mhitm.c $(HDEP) $(I)artifact.h - -$(O)mhitu.o: $(NHS)mhitu.c $(HDEP) $(I)artifact.h - $(CC) $(CFLAGS) $(CFLAGS2) $(OBJSPEC)$@ $(NHS)mhitu.c - -$(O)minion.o: $(NHS)minion.c $(HDEP) - -$(O)mklev.o: $(NHS)mklev.c $(HDEP) - -$(O)mkmap.o: $(NHS)mkmap.c $(HDEP) $(I)sp_lev.h - -$(O)mkmaze.o: $(NHS)mkmaze.c $(HDEP) $(I)sp_lev.h - -$(O)mkobj.o: $(NHS)mkobj.c $(HDEP) $(I)artifact.h $(I)prop.h - -$(O)mkroom.o: $(NHS)mkroom.c $(HDEP) - -$(O)mon.o: $(NHS)mon.c $(HDEP) $(I)mfndpos.h - -$(O)mondata.o: $(NHS)mondata.c $(HDEP) - -$(O)monmove.o: $(NHS)monmove.c $(HDEP) $(I)mfndpos.h $(I)artifact.h - -$(O)monst.o: $(NHS)monst.c $(I)config.h $(I)permonst.h $(I)monsym.h $(I)color.h - -$(O)monstr.o: $(NHS)monstr.c $(HDEP) -#SFD_INSTEAD $(CC) $(CFLAGS) $(OBJSPEC)%(left) $(NHS)monstr.c -#none - -$(O)mplayer.o: $(NHS)mplayer.c $(HDEP) - -$(O)mthrowu.o: $(NHS)mthrowu.c $(HDEP) - -$(O)muse.o: $(NHS)muse.c $(HDEP) - $(CC) $(CFLAGS) $(CFLAGS2) $(OBJSPEC)$@ $(NHS)muse.c - -$(O)music.o: $(NHS)music.c $(HDEP) #interp.c - -$(O)o_init.o: $(NHS)o_init.c $(HDEP) - -$(O)objects.o: $(NHS)objects.c $(I)config.h $(I)obj.h $(I)objclass.h \ - $(I)prop.h $(I)skills.h $(I)color.h -#SFD_INSTEAD #none - $(CC) $(CFLAGS) $(INCLSPEC)$(NHS) $(OBJSPEC)$@ $(NHS)objects.c - -$(O)objnam.o: $(NHS)objnam.c $(HDEP) - -$(O)options.o: $(NHS)options.c $(HDEP) $(I)tcap.h $(I)config.h \ - $(I)objclass.h $(I)flag.h - -$(O)pager.o: $(NHS)pager.c $(HDEP) $(I)dlb.h - -$(O)pickup.o: $(NHS)pickup.c $(HDEP) - -$(O)pline.o: $(NHS)pline.c $(HDEP) - -$(O)polyself.o: $(NHS)polyself.c $(HDEP) - -$(O)potion.o: $(NHS)potion.c $(HDEP) - -$(O)pray.o: $(NHS)pray.c $(HDEP) - -$(O)priest.o: $(NHS)priest.c $(HDEP) $(I)mfndpos.h - -$(O)quest.o: $(NHS)quest.c $(HDEP) $(I)quest.h - -$(O)questpgr.o: $(NHS)questpgr.c $(HDEP) $(I)dlb.h - -$(O)read.o: $(NHS)read.c $(HDEP) - -$(O)rect.o: $(NHS)rect.c $(HDEP) - -$(O)region.o: $(NHS)region.c $(HDEP) - -$(O)restore.o: $(NHS)restore.c $(HDEP) $(I)tcap.h $(I)quest.h - -$(O)rnd.o: $(NHS)rnd.c $(HDEP) - -$(O)role.o: $(NHS)role.c $(HDEP) - -$(O)rumors.o: $(NHS)rumors.c $(HDEP) $(I)dlb.h - -$(O)save.o: $(NHS)save.c $(HDEP) $(I)quest.h - -$(O)shk.o: $(NHS)shk.c $(HDEP) -#SFD_INSTEAD #none - $(CC) $(CFLAGS) $(CFLAGS2) $(OBJSPEC)$@ $(NHS)shk.c - -$(O)shknam.o: $(NHS)shknam.c $(HDEP) - -$(O)sit.o: $(NHS)sit.c $(HDEP) $(I)artifact.h - -$(O)sounds.o: $(NHS)sounds.c $(HDEP) - -$(O)sp_lev.o: $(NHS)sp_lev.c $(HDEP) $(I)sp_lev.h $(I)rect.h $(I)dlb.h - -$(O)spell.o: $(NHS)spell.c $(HDEP) - -$(O)steal.o: $(NHS)steal.c $(HDEP) - -$(O)steed.o: $(NHS)steed.c $(HDEP) - -$(O)sys.o: $(NHS)sys.c $(HDEP) - -$(O)teleport.o: $(NHS)teleport.c $(HDEP) - -$(O)timeout.o: $(NHS)timeout.c $(HDEP) - -$(O)topten.o: $(NHS)topten.c $(HDEP) $(I)dlb.h - -$(O)track.o: $(NHS)track.c $(HDEP) - -$(O)trap.o: $(NHS)trap.c $(HDEP) -#SFD_INSTEAD #none - $(CC) $(CFLAGS) $(CFLAGS2) $(OBJSPEC)$@ $(NHS)trap.c - -$(O)u_init.o: $(NHS)u_init.c $(HDEP) - -$(O)uhitm.o: $(NHS)uhitm.c $(HDEP) - $(CC) $(CFLAGS) $(CFLAGS2) $(OBJSPEC)$@ $(NHS)uhitm.c - -$(O)vault.o: $(NHS)vault.c $(HDEP) - -$(O)version.o: $(NHS)version.c $(HDEP) $(I)date.h $(I)patchlevel.h - -# DMake doesn't grok mid-line comments -#SFD_INSTEAD $(O)vision.o: $(NHS)vision.c $(HDEP) -$(O)vision.o: $(NHS)vision.c $(HDEP) #$(I)vis_tab.h - -$(O)weapon.o: $(NHS)weapon.c $(HDEP) - -$(O)were.o: $(NHS)were.c $(HDEP) - -$(O)wield.o: $(NHS)wield.c $(HDEP) - -$(O)windows.o: $(NHS)windows.c $(HDEP) $(I)wintty.h - -$(O)wizard.o: $(NHS)wizard.c $(HDEP) - -$(O)worm.o: $(NHS)worm.c $(HDEP) - -$(O)worn.o: $(NHS)worn.c $(HDEP) - -$(O)write.o: $(NHS)write.c $(HDEP) - -$(O)zap.o: $(NHS)zap.c $(HDEP) - $(CC) $(CFLAGS) $(CFLAGS2) $(OBJSPEC)$@ $(NHS)zap.c - -$(O)getline.o: $(TTY)getline.c $(HDEP) $(I)wintty.h - -$(O)termcap.o: $(TTY)termcap.c $(HDEP) $(I)wintty.h $(I)tcap.h - -$(O)topl.o: $(TTY)topl.c $(HDEP) $(I)wintty.h $(I)tcap.h - -$(O)wintty.o: $(TTY)wintty.c $(HDEP) $(I)wintty.h $(I)tcap.h \ - $(I)date.h $(I)patchlevel.h - -$(O)amitty.o: $(AMI)amitty.c $(HDEP) - -$(O)amistack.o: $(AMI)amistack.c - $(CC) $(CFLAGS3) $(CSYM) $(OBJSPEC)$@ $(AMI)amistack.c - -$(O)rip.o: $(NHS)rip.c $(HDEP) - - -$(I)config.h: $(I)config1.h $(I)tradstdc.h $(I)global.h - -setdate $(I)config.h - -wait 2 - -# onames.h handled at onames.h target, pm.h - -$(I)decl.h: $(I)quest.h $(I)spell.h $(I)color.h $(I)obj.h $(I)you.h - -setdate $(I)decl.h - -wait 2 - -$(I)global.h: $(I)coord.h $(I)pcconf.h $(I)amiconf.h - -setdate $(I)global.h - -wait 2 - -$(I)hack.h: $(I)config.h $(I)context.h $(I)trap.h $(I)decl.h $(I)dungeon.h \ - $(I)monsym.h $(I)mkroom.h $(I)objclass.h $(I)flag.h $(I)rm.h \ - $(I)vision.h $(I)display.h $(I)wintype.h $(I)engrave.h \ - $(I)rect.h $(I)region.h $(I)sys.h - -setdate $(I)hack.h - -wait 2 - -$(I)permonst.h: $(I)monattk.h $(I)monflag.h $(I)align.h - -setdate $(I)permonst.h - -wait 2 - -$(I)you.h: $(I)align.h $(I)attrib.h $(I)monst.h $(I)mextra.h $(I)youprop.h $(I)skills.h - -setdate $(I)you.h - -wait 2 - -# pm.h handled at target - -$(I)youprop.h: $(I)prop.h $(I)permonst.h $(I)mondata.h - -setdate $(I)youprop.h - -wait 2 - -$(I)display.h: $(I)vision.h $(I)mondata.h - -setdate $(I)display.h - -wait 2 - -$(I)dungeon.h: $(I)align.h - -setdate $(I)dungeon.h - -wait 2 - -$(I)engrave.h: $(I)rect.h - -setdate $(I)engrave.h - -wait 2 - -$(I)mextra.h: $(I)align.h - -setdate $(I)mextra.h - -wait 2 - -$(I)mondata.h: $(I)align.h - -setdate $(I)mondata.h - -wait 2 - -$(I)monst.h: $(I)align.h $(I)mextra.h - -setdate $(I)monst.h - -wait 2 - -$(I)pcconf.h: $(I)micro.h $(I)system.h - -setdate $(I)pcconf.h - -wait 2 - -$(I)rm.h: $(I)align.h - -setdate $(I)rm.h - -wait 2 - - -#notes -# install keeps doing re-install because it keeps rebuilding lev_comp??? -# fixed(?) - deleted setdate -# make nhdat rebuils sys/amiga objects diff --git a/outdated/sys/amiga/NetHack.cnf b/outdated/sys/amiga/NetHack.cnf deleted file mode 100644 index 89794c094..000000000 --- a/outdated/sys/amiga/NetHack.cnf +++ /dev/null @@ -1,213 +0,0 @@ -# A '#' at the beginning of a line means the rest of the line is a comment. - -# This is an example configuration file. -# If several people are to use it, don't specify "name" or personal -# prefences like "dogname" or "packorder" in OPTIONS. - -# To change configuration, comment out the unwanted configurations, and -# remove the comment from the configuration you want. - -# Some options to set personal preferences. If several people are to -# use it, options like these should not be set here - use the command line -#OPTIONS=name:Janet-V,female,dogname:Fido,fruit:apricot -#OPTIONS=packorder:")[%?+/=!(*0_`,scores:10t/2a,noverbose -#OPTIONS=gender:male -#OPTIONS=role:random -#OPTIONS=race:random -#OPTIONS=align:chaotic -# Other general options -#OPTIONS=time,rest_on_space,noautopickup - -# The search path for files like record, help, opthelp, etc. -PATH=NetHack: - -# My own setup -#OPTIONS=nolegacy,fruit:lemon,time,autopickup,checkpoint,showexp,showscore,standout,nonews -#OPTIONS=nomail,flush,eight_bit_tty,scores:10t/2a,pickup_types:$,suppress_alert:3.3.0,autoquiver - -# The windowtype option must be set before any options regarding colors and palette -# are set otherwise previously set values will be overridden by the defaults -# -# The font version of the game -OPTIONS=windowtype:amii -# -# New tile version of the game -#OPTIONS=windowtype:amitile -# -# A hard disk configuration. -# -HACKDIR=NetHack: -LEVELS=Nethack:Levels -SAVE=Nethack:Save -BONESDIR=Nethack:Levels -SCOREDIR=Nethack: -LOCKDIR=Nethack: -CONFIGDIR=Nethack: -DATADIR=Nethack: -TROUBLEDIR=Nethack: - -# *** CHARACTER GRAPHICS *** -# -# See the on-line help or the Guidebook for which symbols are in which -# positions. -# -# Note that the hack.font has special graphics characters from 192 on. - -# An example using the hack.font graphics character set: -DUNGEON = 032 192 193 194 195 196 197 198 216 214 \ - 215 213 217 145 146 147 148 035 035 217 \ - 218 229 060 062 060 062 095 124 092 035 \ - 123 125 042 125 042 042 035 035 046 035 \ - 125 - -TRAPS = 094 094 094 094 094 094 094 094 094 094 \ - 094 094 094 094 094 094 094 034 094 094 \ - 094 094 - -EFFECTS = 241 240 242 243 042 033 123 125 \ - 064 038 042 035 \ - 244 245 246 247 239 248 249 250 \ - 230 234 231 236 212 237 232 235 233 - -WARNINGS = 048 049 050 051 052 053 - -# Monitors vary greatly in their color response. If the default colors -# are not good on your monitor, here are some other alternatives for the -# font version of the game: -# -# Last color of the palette is always used for the cursor. -# -#CBM 1960, set color/contrast for good pure red, green, and blue. True colors. -#PENS=000,fff,a61,7bb,0f0,e0c,00f,f00 -#CBM 1960, set color/contrast as above, better colors for NetHack. -#PENS=667,fff,da1,7bb,2f0,e0d,0af,f42 -#and other suggestions: -#PENS=888,ffc,840,0b8,4e4,e8b,7be,a04 -#PENS=000,fff,830,7ae,181,c06,23e,c00 -# -# For an "interlaced"+ line screen, the default font is courier:13. If you want -# a different font, set it here. The format is "fontname.font:size"; i.e. the -# .font extension is required. -#FONT=courier.font:13 -#FONT=topaz.font:8 -# -# Proportional fonts such as CGTimes are probably not a good idea because they -# result in many things not being spaced out correctly. -#FONT=CGTimes.font:15 -# -# This sized proportional font is readable, but still has spacing problems -#FONT=CGTimes.font:21 -# -# FOR AGA OR OTHER DISPLAYS CAPABLE OF 5 OR MORE PLANES... -# -# For a screen of depth 5 the following dripens provide a brown border -# using pens 16-31. -# -# Pens 16-31 can be redefined with PENS= if you want different colors, -# using the PENS= values below for a 4 plane screen as the first 16 colors. -# -#DEPTH=5 -#DRIPENS=0,0,0,17,27,23,1,23,15,0,23,27 -# -# The APEN and BPEN values in the various types of windows can be set in -# the manner shown below. These values are for the 16 color version of -# the tile game. -# -# These values are specified as APEN,BPEN (foreground,background) -# -#MSGPENS=1,12 -#STATUSPENS=1,12 -#MENUPENS=1,23 -#TEXTPENS=1,23 -#OTHERPENS=1,23 -# -# FOR ECS OR OTHERS ONLY CAPABLE OF 4 PLANES... -# -# These values work good for the TILE version of the game on ECS machines -# These are the default values for reference purposes. -# -#DEPTH=4 -#defaults for tilemode: -#PENS=000,fff,0bf,f60,00f,090,69b,f00,6f0,ff0,f0f,940,466,c40,ddb,fb9 -#DRIPENS=0,1,0,2,4,12,14,12,7,1,12,4 -#defaults for fontmode: -#PENS=000,fff,830,7ac,181,c06,23e,c00 -#DRIPENS=0,6,2,1,6,3,1,3,7,1,3,6 -# -# The APEN and BPEN values in the various types of windows can be set in -# the manner shown below. These values are for a 32 color version of -# the tile game. -# -# These values are specified as APEN,BPEN (foreground,background) -# -#MSGPENS=1,12 -#STATUSPENS=1,12 -#MENUPENS=0,14 -#TEXTPENS=0,14 -#OTHERPENS=1,12 -# -# New alternative color scheme for 16 color font mode. -# This changes the colors of monsters, objects etc. -# -# FGPENS and BGPENS define APEN and BPEN for objects and monsters on the map. -# The colors are in the following order: -# black, red, green, brown, blue, magenta, cyan, gray, no color, orange, -# bright green, yellow, bright blue, bright magenta, bright cyan, white -# -DEPTH=4 -PENS=000,fff,830,7ac,181,c06,23e,c00,888,f60,4f4,ff0,4af,f8f,8ff,f00 -FGPENS= 0, 7, 4, 2, 6, 5, 3, 8, 1, 9,10,11,12,13,14, 1 -BGPENS= 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -# -# Screen mode selections below should all work for either the font or tile -# version of the game. Other modes can be tried and as long as they are at -# least 640x200, the game should adapt to them... -# -# Select screenmode with a requester -#SCREENMODE=Req -# NTSC_MONITOR_ID -#SCREENMODE=0x00019000 -# PAL_MONITOR_ID -#SCREENMODE=0x00029000 -# NTSC_MONITOR_ID+LACE -#SCREENMODE=0x00019004 -# PAL_MONITOR_ID+LACE -#SCREENMODE=0x00029004 -# NTSC_MONITOR_ID+HIRES+LACE -#SCREENMODE=0x00019024 -# PAL_MONITOR_ID+HIRES+LACE -#SCREENMODE=0x00029024 -# VGA_MONITOR_ID -#SCREENMODE=0x00031000 -# VGAPRODUCT_KEY -#SCREENMODE=0x00039024 -# A2024TENHERTZ_KEY -#SCREENMODE=0x00041000 -# A2024FIFTEENHERTZ_KEY -#SCREENMODE=0x00049000 -# EURO72_MONITOR_ID -#SCREENMODE=0x00061000 -# EURO72PRODUCT_KEY -#SCREENMODE=0x00069024 -# EURO72PRODUCTLACE_KEY -#SCREENMODE=0x00069025 -# EURO72PRODUCTDBL_KEY -#SCREENMODE=0x00069020 -# EURO36_MONITOR_ID -#SCREENMODE=0x00071000 -# SUPER72HIRESDBL_KEY -#SCREENMODE=0x00089008 -# SUPER72SUPERDBL_KEY -#SCREENMODE=0x00089028 -# DBLNTSCHIRES_KEY -#SCREENMODE=0x00099000 -# DBLNTSCHIRESFF_KEY -#SCREENMODE=0x00099004 -# DBLNTSCHIRESLACE_KEY -#SCREENMODE=0x00099005 -# DBLPALHIRES_KEY -#SCREENMODE=0x000a9000 -# DBLPALHIRESFF_KEY -#SCREENMODE=0x000a9004 -# DBLPALHIRESLACE_KEY -#SCREENMODE=0x000a9005 diff --git a/outdated/sys/amiga/ifchange b/outdated/sys/amiga/ifchange deleted file mode 100644 index d06450c08..000000000 --- a/outdated/sys/amiga/ifchange +++ /dev/null @@ -1,55 +0,0 @@ -.KEY oper/a,tmp/a,real/a,f1,f2,f3,f4,f5 - -. ; miscellaneous script functions for the Amiga -. ; Copyright (c) Kenneth Lorber, Bethesda, Maryland, 1992, 1993, 1996. -. ; NetHack may be freely redistributed. See license for details. - -FAILAT 6 -IF EQ "MOVE" - IF EXISTS - diff >T:mic -c - search from T:mic SEARCH "---" QUIET - IF WARN - echo "MOVE: no change" - delete - ELSE - echo "MOVE: copy" - copy clone - delete - ENDIF - ELSE - echo "MOVE: copy2" - copy clone - delete - ENDIF - QUIT -ENDIF - -IF EQ "TOUCH" - IF EXISTS - diff >T:mic -c - search from T:mic SEARCH "---" QUIET - IF NOT WARN - echo "TOUCH: touch" - IF NOT EQ "@" - setdate - ENDIF - IF NOT EQ "@" - setdate - ENDIF - IF NOT EQ "@" - setdate - ENDIF - IF NOT EQ "@" - setdate - ENDIF - IF NOT EQ "@" - setdate - ENDIF - ENDIF - ENDIF - QUIT -ENDIF - -echo "ifchange: '' not recognized" -quit 10 diff --git a/outdated/sys/amiga/mkdmake b/outdated/sys/amiga/mkdmake deleted file mode 100644 index fc002ef10..000000000 --- a/outdated/sys/amiga/mkdmake +++ /dev/null @@ -1,13 +0,0 @@ -GE/$@/%(left)/ -GE/$ - -#include "config.h" -#include "tile.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef _DCC -#include -#include -#include -#endif - -void panic(const char *); -void map_colors(void); -int BestMatch(int, int, int); - -extern pixval ColorMap[3][MAXCOLORMAPSIZE]; -extern int colorsinmap; - -/* - * WARNING: - * This program carries forth the assumption that the colormaps in all - * of the .txt files are the same. This is a bug. - */ - -struct { - int Height; - int Width; -} IFFScreen; - -/* - * We are using a hybrid form of our own design which we call a BMAP (for - * bitmap) form. It is an ILBM with the bitmaps already deinterleaved, - * completely uncompressed. - * This speeds the loading of the images from the games point of view because - * it - * does not have to deinterleave and uncompress them. - */ -#define ID_BMAP MAKE_ID('B', 'M', 'A', 'P') /* instead of ILBM */ -#define ID_BMHD MAKE_ID('B', 'M', 'H', 'D') /* Same as ILBM */ -#define ID_CAMG MAKE_ID('C', 'A', 'M', 'G') /* Same as ILBM */ -#define ID_CMAP MAKE_ID('C', 'M', 'A', 'P') /* Same as ILBM */ -#define ID_PDAT \ - MAKE_ID('P', 'D', 'A', 'T') /* Extra data describing plane \ - * size due to graphics.library \ - * rounding requirements. \ - */ -#define ID_PLNE MAKE_ID('P', 'L', 'N', 'E') /* The planes of the image */ - -#ifndef _DCC -extern -#endif - struct Library *IFFParseBase; - -int nplanes; - -/* BMHD from IFF documentation */ -typedef struct { - UWORD w, h; - WORD x, y; - UBYTE nPlanes; - UBYTE masking; - UBYTE compression; - UBYTE reserved1; - UWORD transparentColor; - UBYTE xAspect, yAspect; - WORD pageWidth, pageHeight; -} BitMapHeader; - -typedef struct { - UBYTE r, g, b; -} AmiColorMap; - -pixel pixels[TILE_Y][TILE_X]; -AmiColorMap *cmap; - -int findcolor(register pixel *pix); -void packwritebody(pixel (*tile)[TILE_X], char **planes, int tileno); - -void -error(char *str) -{ - fprintf(stderr, "ERROR: %s\n", str); -} - -/* - * This array maps the image colors to the amiga's first 16 colors. The - * colors - * are reordered to help with maintaining dripen settings. - */ -int colrmap[] = { 0, 6, 9, 15, 4, 10, 2, 3, 5, 11, 7, 13, 8, 1, 14, 12 }; - -/* How many tiles fit across and down. */ - -#define COLS 20 -#define ROWS ((tiles + COLS - 1) / COLS) - -main(int argc, char **argv) -{ - int colors; - struct { - long nplanes; - long pbytes; - long across; - long down; - long npics; - long xsize; - long ysize; - } pdat; - long pbytes; /* Bytes of data in a plane */ - int i, cnt; - BitMapHeader bmhd; - struct IFFHandle *iff; - long camg = HIRES | LACE; - int tiles = 0; - char **planes; - - if (argc != 3) { - fprintf(stderr, "Usage: %s source destination\n", argv[0]); - exit(1); - } - -#if defined(_DCC) || defined(__GNUC__) - IFFParseBase = OpenLibrary("iffparse.library", 0); - if (!IFFParseBase) { - error("unable to open iffparse.library"); - exit(1); - } -#endif - - /* First, count the files in the file */ - if (fopen_text_file(argv[1], "r") != TRUE) { - perror(argv[1]); - return (1); - } - - nplanes = 0; - i = colorsinmap - 1; /*IFFScreen.Colors - 1; */ - while (i != 0) { - nplanes++; - i >>= 1; - } - - planes = malloc(nplanes * sizeof(char *)); - if (planes == 0) { - error("can not allocate planes pointer"); - exit(1); - } - - while (read_text_tile(pixels) == TRUE) - ++tiles; - fclose_text_file(); - - IFFScreen.Width = COLS * TILE_X; - IFFScreen.Height = ROWS * TILE_Y; - - pbytes = (COLS * ROWS * TILE_X + 15) / 16 * 2 * TILE_Y; - - for (i = 0; i < nplanes; ++i) { - planes[i] = calloc(1, pbytes); - if (planes[i] == 0) { - error("can not allocate planes pointer"); - exit(1); - } - } - - /* Now, process it */ - if (fopen_text_file(argv[1], "r") != TRUE) { - perror(argv[1]); - return (1); - } - - iff = AllocIFF(); - if (!iff) { - error("Can not allocate IFFHandle"); - return (1); - } - - iff->iff_Stream = Open(argv[2], MODE_NEWFILE); - if (!iff->iff_Stream) { - error("Can not open output file"); - return (1); - } - - InitIFFasDOS(iff); - OpenIFF(iff, IFFF_WRITE); - - PushChunk(iff, ID_BMAP, ID_FORM, IFFSIZE_UNKNOWN); - - bmhd.w = IFFScreen.Width; - bmhd.h = IFFScreen.Height; - bmhd.x = 0; - bmhd.y = 0; - bmhd.nPlanes = nplanes; - bmhd.masking = 0; - bmhd.compression = 0; - bmhd.reserved1 = 0; - bmhd.transparentColor = 0; - bmhd.xAspect = 100; - bmhd.yAspect = 100; - bmhd.pageWidth = TILE_X; - bmhd.pageHeight = TILE_Y; - - PushChunk(iff, ID_BMAP, ID_BMHD, sizeof(bmhd)); - WriteChunkBytes(iff, &bmhd, sizeof(bmhd)); - PopChunk(iff); - - PushChunk(iff, ID_BMAP, ID_CAMG, sizeof(camg)); - WriteChunkBytes(iff, &camg, sizeof(camg)); - PopChunk(iff); - - /* We need to reorder the colors to get reasonable default pens but - * we also need to know where some of the colors are - so go find out. - */ - map_colors(); - - cmap = malloc((colors = (1L << nplanes)) * sizeof(AmiColorMap)); - for (i = 0; i < colors; ++i) { - cmap[colrmap[i]].r = ColorMap[CM_RED][i]; - cmap[colrmap[i]].g = ColorMap[CM_GREEN][i]; - cmap[colrmap[i]].b = ColorMap[CM_BLUE][i]; - } - - PushChunk(iff, ID_BMAP, ID_CMAP, IFFSIZE_UNKNOWN); - for (i = 0; i < colors; ++i) - WriteChunkBytes(iff, &cmap[i], 3); - PopChunk(iff); - - cnt = 0; - while (read_text_tile(pixels) == TRUE) { - packwritebody(pixels, planes, cnt); - if (cnt % 20 == 0) - printf("%d..", cnt); - ++cnt; - fflush(stdout); - } - - pdat.nplanes = nplanes; - pdat.pbytes = pbytes; - pdat.xsize = TILE_X; - pdat.ysize = TILE_Y; - pdat.across = COLS; - pdat.down = ROWS; - pdat.npics = cnt; - - PushChunk(iff, ID_BMAP, ID_PDAT, IFFSIZE_UNKNOWN); - WriteChunkBytes(iff, &pdat, sizeof(pdat)); - PopChunk(iff); - - PushChunk(iff, ID_BMAP, ID_PLNE, IFFSIZE_UNKNOWN); - for (i = 0; i < nplanes; ++i) - WriteChunkBytes(iff, planes[i], pbytes); - PopChunk(iff); - - CloseIFF(iff); - Close(iff->iff_Stream); - FreeIFF(iff); - - printf("\n%d tiles converted\n", cnt); - -#if defined(_DCC) || defined(__GNUC__) - CloseLibrary(IFFParseBase); -#endif - exit(0); -} - -findcolor(register pixel *pix) -{ - register int i; - - for (i = 0; i < MAXCOLORMAPSIZE; ++i) { - if ((pix->r == ColorMap[CM_RED][i]) - && (pix->g == ColorMap[CM_GREEN][i]) - && (pix->b == ColorMap[CM_BLUE][i])) { - return (i); - } - } - return (-1); -} - -void -packwritebody(pixel (*tile)[TILE_X], char **planes, int tileno) -{ - register int i, j, k, col; - register char *buf; - register int across, rowbytes, xoff, yoff; - - /* how many tiles fit across? */ - across = COLS; - - /* How many bytes per pixel row */ - rowbytes = ((IFFScreen.Width + 15) / 16) * 2; - - /* How many bytes to account for y distance in planes */ - yoff = ((tileno / across) * TILE_Y) * rowbytes; - - /* How many bytes to account for x distance in planes */ - xoff = (tileno % across) * (TILE_X / 8); - - /* For each row... */ - for (i = 0; i < TILE_Y; ++i) { - /* For each bitplane... */ - for (k = 0; k < nplanes; ++k) { - const int mask = 1l << k; - - /* Go across the row */ - for (j = 0; j < TILE_X; j++) { - col = findcolor(&tile[i][j]); - if (col == -1) { - error("can not convert pixel color to colormap index"); - return; - } - /* Shift the colors around to have good complements and to - * know the dripen values. - */ - col = colrmap[col]; - - /* To top left corner of tile */ - buf = planes[k] + yoff + xoff; - - /*To i'th row of tile and the correct byte for the j'th - * pixel*/ - buf += (i * rowbytes) + (j / 8); - - /* Or in the bit for this color */ - *buf |= (((col & mask) != 0) << (7 - (j % 8))); - } - } - } -} - -/* #define DBG */ - -/* map_colors - * The incoming colormap is in arbitrary order and has arbitrary colors in - * it, but we need (some) specific colors in specific places. Find the - * colors we need and fix the mapping table to match. - */ -/* What we are aiming for: */ -/* XXX was 0-7 */ -#define CX_BLACK 0 -#define CX_WHITE 1 -#define CX_BROWN 11 -#define CX_CYAN 2 -#define CX_GREEN 5 -#define CX_MAGENTA 10 -#define CX_BLUE 4 -#define CX_RED 7 -/* we don't care about the rest, at least now */ -/* should get: black white blue red grey greyblue ltgrey */ -void -map_colors() -{ - int x; -#if 1 - int tmpmap[] = { 0, 2, 3, 7, 4, 5, 8, 9, 10, 11, 13, 15, 12, 1, 14, 6 }; -/* still not right: gray green yellow lost somewhere? */ -#else - int tmpmap[16]; - int x, y; - for (x = 0; x < 16; x++) - tmpmap[x] = -1; /* set not assigned yet */ - - tmpmap[BestMatch(0, 0, 0)] = CX_BLACK; - tmpmap[BestMatch(255, 255, 255)] = CX_WHITE; - tmpmap[BestMatch(255, 0, 0)] = CX_RED; - tmpmap[BestMatch(0, 255, 0)] = CX_GREEN; - tmpmap[BestMatch(0, 0, 255)] = CX_BLUE; - - /* clean up the rest */ - for (x = 0; x < 16; x++) { - for (y = 0; y < 16; y++) - if (tmpmap[y] == x) - goto outer_cont; - for (y = 0; y < 16; y++) - if (tmpmap[y] == -1) { - tmpmap[y] = x; - break; - } - if (y == 16) - panic("too many colors?"); - outer_cont: - ; - } - for (x = 0; x < 16; x++) - if (tmpmap[y] == -1) - panic("lost color?"); -#endif - for (x = 0; x < 16; x++) { -#ifdef DBG - printf("final: c[%d]=%d (target: %d)\n", x, tmpmap[x], colrmap[x]); -#endif - colrmap[x] = tmpmap[x]; - } -} -BestMatch(r, g, b) int r, g, b; -{ - int x; - int bestslot; - int bestrate = 99999999L; - for (x = 0; x < 16; x++) { - int rr = r - ColorMap[CM_RED][x]; - int gg = g - ColorMap[CM_GREEN][x]; - int bb = b - ColorMap[CM_BLUE][x]; - int rate = rr * rr + gg * gg + bb * bb; - if (bestrate > rate) { - bestrate = rate; - bestslot = x; - } - } -#ifdef DBG - printf("map (%d,%d,%d) -> %d (error=%d)\n", r, g, b, bestslot, bestrate); -#endif - return bestslot; -} - -long * -alloc(unsigned int n) -{ - long *ret = malloc(n); - if (!ret) { - error("Can't allocate memory"); - exit(1); - } - return (ret); -} - -void -panic(const char *msg) -{ - fprintf(stderr, "PANIC: %s\n", msg); - exit(1); -} diff --git a/outdated/sys/amiga/xpm2iff.c b/outdated/sys/amiga/xpm2iff.c deleted file mode 100644 index 0ffbc8c47..000000000 --- a/outdated/sys/amiga/xpm2iff.c +++ /dev/null @@ -1,363 +0,0 @@ -/* NetHack 3.6 xpm2iff.c $NHDT-Date: 1432512795 2015/05/25 00:13:15 $ $NHDT-Branch: master $:$NHDT-Revision: 1.7 $ */ -/* Copyright (c) 1995 by Gregg Wonderly, Naperville, Illinois */ -/* NetHack may be freely redistributed. See license for details. */ - -#include - -#include "config.h" -#include "tile.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef _DCC -#include -#include -#include -#endif - -struct xpmscreen { - int Width; - int Height; - int Colors; - int ColorResolution; - int Background; - int AspectRatio; - int Interlace; - int BytesPerRow; -} XpmScreen; - -/* translation table from xpm characters to RGB and colormap slots */ -struct Ttable { - char flag; - char r, g, b; - int slot; /* output colortable index */ -} ttable[256]; - -pixval ColorMap[3][MAXCOLORMAPSIZE]; -int colorsinmap; - -/* - * We are using a hybrid form of our own design which we call a BMAP (for - * bitmap) form. It is an ILBM with the bitmaps already deinterleaved, - * completely uncompressed. - * This speeds the loading of the images from the games point of view because - * it - * does not have to deinterleave and uncompress them. - */ -#define ID_BMAP MAKE_ID('B', 'M', 'A', 'P') /* instead of ILBM */ -#define ID_BMHD MAKE_ID('B', 'M', 'H', 'D') /* Same as ILBM */ -#define ID_CAMG MAKE_ID('C', 'A', 'M', 'G') /* Same as ILBM */ -#define ID_CMAP MAKE_ID('C', 'M', 'A', 'P') /* Same as ILBM */ -#define ID_PDAT \ - MAKE_ID('P', 'D', 'A', 'T') /* Extra data describing plane \ - * size due to graphics.library \ - * rounding requirements. \ - */ -#define ID_PLNE MAKE_ID('P', 'L', 'N', 'E') /* The planes of the image */ - -int nplanes; - -/* BMHD from IFF documentation */ -typedef struct { - UWORD w, h; - WORD x, y; - UBYTE nPlanes; - UBYTE masking; - UBYTE compression; - UBYTE reserved1; - UWORD transparentColor; - UBYTE xAspect, yAspect; - WORD pageWidth, pageHeight; -} BitMapHeader; - -typedef struct { - UBYTE r, g, b; -} AmiColorMap; - -pixel pixels[TILE_Y][TILE_X]; -AmiColorMap *cmap; - -void -error(char *str) -{ - fprintf(stderr, "ERROR: %s\n", str); -} - -char **planes; - -main(int argc, char **argv) -{ - int colors; - struct { - long nplanes; - long pbytes; - long across; - long down; - long npics; - long xsize; - long ysize; - } pdat; - long pbytes; /* Bytes of data in a plane */ - int i, cnt; - BitMapHeader bmhd; - struct IFFHandle *iff; - long camg = HIRES | LACE; - int tiles = 0; - int index; - -#if defined(_DCC) || defined(__GNUC__) - IFFParseBase = OpenLibrary("iffparse.library", 0); - if (!IFFParseBase) { - error("unable to open iffparse.library"); - exit(1); - } -#endif - - if (fopen_xpm_file(argv[1], "r") != TRUE) { - perror(argv[1]); - return (1); - } - - nplanes = 0; - i = XpmScreen.Colors - 1; - while (i != 0) { - nplanes++; - i >>= 1; - } - - planes = malloc(nplanes * sizeof(char *)); - if (planes == 0) { - error("can not allocate planes pointer"); - exit(1); - } - - XpmScreen.BytesPerRow = ((XpmScreen.Width + 15) / 16) * 2; - pbytes = XpmScreen.BytesPerRow * XpmScreen.Height; - for (i = 0; i < nplanes; ++i) { - planes[i] = malloc(pbytes); - if (planes[i] == 0) { - error("can not allocate planes pointer"); - exit(1); - } - memset(planes[i], 0, pbytes); - } - - iff = AllocIFF(); - if (!iff) { - error("Can not allocate IFFHandle"); - return (1); - } - - iff->iff_Stream = Open(argv[2], MODE_NEWFILE); - if (!iff->iff_Stream) { - error("Can not open output file"); - return (1); - } - - InitIFFasDOS(iff); - OpenIFF(iff, IFFF_WRITE); - - PushChunk(iff, ID_BMAP, ID_FORM, IFFSIZE_UNKNOWN); - - bmhd.w = XpmScreen.Width; - bmhd.h = XpmScreen.Height; - bmhd.x = 0; - bmhd.y = 0; - bmhd.nPlanes = nplanes; - bmhd.masking = 0; - bmhd.compression = 0; - bmhd.reserved1 = 0; - bmhd.transparentColor = 0; - bmhd.xAspect = 100; - bmhd.yAspect = 100; - bmhd.pageWidth = 0; /* not needed for this program */ - bmhd.pageHeight = 0; /* not needed for this program */ - - PushChunk(iff, ID_BMAP, ID_BMHD, sizeof(bmhd)); - WriteChunkBytes(iff, &bmhd, sizeof(bmhd)); - PopChunk(iff); - - PushChunk(iff, ID_BMAP, ID_CAMG, sizeof(camg)); - WriteChunkBytes(iff, &camg, sizeof(camg)); - PopChunk(iff); - -#define SCALE(x) (x) - cmap = malloc((colors = (1L << nplanes)) * sizeof(AmiColorMap)); - if (cmap == 0) { - error("Can't allocate color map"); - exit(1); - } - for (index = 0; index < 256; index++) { - if (ttable[index].flag) { - cmap[ttable[index].slot].r = SCALE(ttable[index].r); - cmap[ttable[index].slot].g = SCALE(ttable[index].g); - cmap[ttable[index].slot].b = SCALE(ttable[index].b); - } - } -#undef SCALE - - PushChunk(iff, ID_BMAP, ID_CMAP, IFFSIZE_UNKNOWN); - WriteChunkBytes(iff, cmap, colors * sizeof(*cmap)); - PopChunk(iff); - - conv_image(); - - pdat.nplanes = nplanes; - pdat.pbytes = pbytes; - pdat.xsize = XpmScreen.Width; - pdat.ysize = XpmScreen.Height; - pdat.across = 0; - pdat.down = 0; - pdat.npics = 1; - - PushChunk(iff, ID_BMAP, ID_PDAT, IFFSIZE_UNKNOWN); - WriteChunkBytes(iff, &pdat, sizeof(pdat)); - PopChunk(iff); - - PushChunk(iff, ID_BMAP, ID_PLNE, IFFSIZE_UNKNOWN); - for (i = 0; i < nplanes; ++i) - WriteChunkBytes(iff, planes[i], pbytes); - PopChunk(iff); - - CloseIFF(iff); - Close(iff->iff_Stream); - FreeIFF(iff); - -#if defined(_DCC) || defined(__GNUC__) - CloseLibrary(IFFParseBase); -#endif - exit(0); -} - -#define SETBIT(Plane, Plane_offset, Col, Value) \ - if (Value) { \ - planes[Plane][Plane_offset + (Col / 8)] |= 1 << (7 - (Col & 7)); \ - } - -conv_image() -{ - int row, col, planeno; - - for (row = 0; row < XpmScreen.Height; row++) { - char *xb = xpmgetline(); - int plane_offset; - if (xb == 0) - return; - plane_offset = row * XpmScreen.BytesPerRow; - for (col = 0; col < XpmScreen.Width; col++) { - int slot; - int color = xb[col]; - if (!ttable[color].flag) { - fprintf(stderr, "Bad image data\n"); - } - slot = ttable[color].slot; - for (planeno = 0; planeno < nplanes; planeno++) { - SETBIT(planeno, plane_offset, col, slot & (1 << planeno)); - } - } - } -} - -long * -alloc(unsigned int n) -{ - long *ret = malloc(n); - if (!ret) { - error("Can't allocate memory"); - exit(1); - } - return (ret); -} - -FILE *xpmfh = 0; -char initbuf[200]; -char *xpmbuf = initbuf; - -/* version 1. Reads the raw xpm file, NOT the compiled version. This is - * not a particularly good idea but I don't have time to do the right thing - * at this point, even if I was absolutely sure what that was. */ -fopen_xpm_file(const char *fn, const char *mode) -{ - int temp; - char *xb; - if (strcmp(mode, "r")) - return FALSE; /* no choice now */ - if (xpmfh) - return FALSE; /* one file at a time */ - xpmfh = fopen(fn, mode); - if (!xpmfh) - return FALSE; /* I'm hard to please */ - - /* read the header */ - xb = xpmgetline(); - if (xb == 0) - return FALSE; - if (4 != sscanf(xb, "%d %d %d %d", &XpmScreen.Width, &XpmScreen.Height, - &XpmScreen.Colors, &temp)) - return FALSE; /* bad header */ - /* replace the original buffer with one big enough for - * the real data - */ - /* XXX */ - xpmbuf = malloc(XpmScreen.Width * 2); - if (!xpmbuf) { - error("Can't allocate line buffer"); - exit(1); - } - if (temp != 1) - return FALSE; /* limitation of this code */ - - { - /* read the colormap and translation table */ - int ccount = -1; - while (ccount++ < (XpmScreen.Colors - 1)) { - char index; - int r, g, b; - xb = xpmgetline(); - if (xb == 0) - return FALSE; - if (4 != sscanf(xb, "%c c #%2x%2x%2x", &index, &r, &g, &b)) { - fprintf(stderr, "Bad color entry: %s\n", xb); - return FALSE; - } - ttable[index].flag = 1; /* this color is valid */ - ttable[index].r = r; - ttable[index].g = g; - ttable[index].b = b; - ttable[index].slot = ccount; - } - } - return TRUE; -} - -/* This deserves better. Don't read it too closely - you'll get ill. */ -#define bufsz 2048 -char buf[bufsz]; -xpmgetline() -{ - char *bp; - do { - if (fgets(buf, bufsz, xpmfh) == 0) - return 0; - } while (buf[0] != '"'); - /* strip off the trailing <",> if any */ - for (bp = buf; *bp; bp++) - ; - bp--; - while (isspace(*bp)) - bp--; - if (*bp == ',') - bp--; - if (*bp == '"') - bp--; - bp++; - *bp = '\0'; - - return &buf[1]; -} From 1cfff0f002837cd5fa4bd760906271137ad829ae Mon Sep 17 00:00:00 2001 From: Ingo Paschke Date: Mon, 11 May 2026 20:27:16 +0200 Subject: [PATCH 20/20] Amiga: correct command-line flag doc in amii.hlp Wizard mode is gated on player name == WIZARD_NAME, not on -D or -debug. Document -uwizard as the working entry point. --- sys/amiga/amii.hlp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/amiga/amii.hlp b/sys/amiga/amii.hlp index 13d59ffc6..6139b29ff 100644 --- a/sys/amiga/amii.hlp +++ b/sys/amiga/amii.hlp @@ -12,8 +12,12 @@ Command-line flags ------------------ -L Force interlaced (tall) screen. -l Force non-interlaced screen. + -uNAME Play as NAME (e.g. -uwizard for wizard mode). + -pCLASS Pick a profession (e.g. -pvalkyrie). + -rRACE Pick a race. -The usual core flags (-D, -X, -u, -p, -r, -@) apply too. +Wizard/debug mode is gated on the player name matching WIZARD_NAME +("wizard" by default), so the simplest way in is -uwizard. Configuration (nethack.cnf in the NetHack: drawer)