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.
This commit is contained in:
Ingo Paschke
2026-05-11 20:51:06 +02:00
parent c5d8ab1985
commit 688f9344cd
7 changed files with 88 additions and 38 deletions
+1 -1
View File
@@ -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
+57 -25
View File
@@ -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.
+6 -4
View File
@@ -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
+14
View File
@@ -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:
-1
View File
@@ -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
+9 -7
View File
@@ -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
+1
View File
@@ -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 )