Merge branch 'amiga-5.0.0-fixes' of https://github.com/ingpaschke/NetHack into NetHack-5.0

This commit is contained in:
nhmall
2026-05-03 12:27:14 -04:00
5 changed files with 57 additions and 3 deletions
+3
View File
@@ -212,4 +212,7 @@ struct ami_sysflags {
}; };
extern struct ami_sysflags sysflags; extern struct ami_sysflags sysflags;
#undef SYSCF
#undef SYSCF_FILE
#endif /* AMICONF_H */ #endif /* AMICONF_H */
+5 -1
View File
@@ -22,6 +22,10 @@
#ifdef __SASC_60 #ifdef __SASC_60
long __stack = 256 * 1024; long __stack = 256 * 1024;
#else #else
/* For GCC with -noixemul (libnix), __stack is also recognized */ /* libnix needs __stkinit referenced to pull swapstack.o from libnix.a */
unsigned long __stack = 256 * 1024; unsigned long __stack = 256 * 1024;
#ifdef CROSS_TO_AMIGA
extern void __stkinit(void);
void *__nh_force_stkinit = __stkinit;
#endif
#endif #endif
+4 -1
View File
@@ -5,7 +5,10 @@
# *** DISPLAY MODE *** # *** DISPLAY MODE ***
# #
# Tile mode (graphical tiles, recommended): # Tile mode (graphical tiles, recommended). Needs >=384 KB free chip
# RAM and a display mode that can open at 4 bitplanes (16 colours); on
# machines that can't, NetHack will automatically fall back to text
# mode at startup.
OPTIONS=windowtype:amiv OPTIONS=windowtype:amiv
# #
# Text mode (uses hack.font line-drawing characters): # Text mode (uses hack.font line-drawing characters):
+45
View File
@@ -886,6 +886,49 @@ int
return 0; return 0;
} }
/* Fall back from AMIV (tile) to AMII (text) if this machine can't
* run tile mode. Probes in order of reliability. */
static void
amii_fall_back(const char *why1, const char *why2)
{
extern struct window_procs amii_procs;
raw_print(why1);
raw_print(why2);
raw_print("Falling back to text mode. Set windowtype:amiv in");
raw_print("nethack.cnf to override.");
windowprocs = amii_procs;
ami_wininit_data(WININIT);
}
static void
amii_maybe_fall_back_to_text(void)
{
if (!WINVERS_AMIV)
return;
if (IntuitionBase->LibNode.lib_Version >= 37) {
struct Screen *wbscr;
int wb_depth = -1;
if ((wbscr = LockPubScreen("Workbench")) != NULL) {
wb_depth = wbscr->BitMap.Depth;
UnlockPubScreen(NULL, wbscr);
}
if (wb_depth >= 0 && wb_depth < 4) {
amii_fall_back("Workbench screen is shallower than 16 colours",
"(tile mode requires depth >= 4).");
return;
}
}
if (AvailMem(MEMF_CHIP) < 384L * 1024L) {
amii_fall_back("Not enough chip RAM available for tile mode",
"(< 384 KB free).");
return;
}
}
/* Initialize the windowing environment */ /* Initialize the windowing environment */
void void
@@ -951,6 +994,8 @@ amii_init_nhwindows(int *argcp, char **argv)
Abort(AG_OpenLib); Abort(AG_OpenLib);
} }
amii_maybe_fall_back_to_text();
amiIDisplay = amiIDisplay =
(struct amii_DisplayDesc *) alloc(sizeof(struct amii_DisplayDesc)); (struct amii_DisplayDesc *) alloc(sizeof(struct amii_DisplayDesc));
memset(amiIDisplay, 0, sizeof(struct amii_DisplayDesc)); memset(amiIDisplay, 0, sizeof(struct amii_DisplayDesc));
-1
View File
@@ -318,7 +318,6 @@ amigapkg: $(AMITILES) ../util/uudecode
cp $(TARGETPFX)tiles16.iff $(TARGETPFX)pkg/tiles/tiles16.iff cp $(TARGETPFX)tiles16.iff $(TARGETPFX)pkg/tiles/tiles16.iff
cp $(TARGETPFX)tiles32.iff $(TARGETPFX)pkg/tiles/tiles32.iff cp $(TARGETPFX)tiles32.iff $(TARGETPFX)pkg/tiles/tiles32.iff
cp $(TARGETPFX)tomb.iff $(TARGETPFX)pkg/tomb.iff cp $(TARGETPFX)tomb.iff $(TARGETPFX)pkg/tomb.iff
cp ../sys/msdos/sysconf $(TARGETPFX)pkg/sysconf
cp ../doc/nethack.txt $(TARGETPFX)pkg/nethack.txt cp ../doc/nethack.txt $(TARGETPFX)pkg/nethack.txt
( cd $(TARGETPFX)pkg && ../../../util/uudecode ../../../sys/amiga/amifont8.uu && mv 8 hack/8 ) ( cd $(TARGETPFX)pkg && ../../../util/uudecode ../../../sys/amiga/amifont8.uu && mv 8 hack/8 )
( cd $(TARGETPFX)pkg && ../../../util/uudecode ../../../sys/amiga/amifont.uu ) ( cd $(TARGETPFX)pkg && ../../../util/uudecode ../../../sys/amiga/amifont.uu )