Files
nethack/sys/amiga
Ingo Paschke 252ca5bef7 Amiga: defensive NULL/bounds guards in menus and window creation
Guard the gd lookup in DoMenuScroll's GADGETUP/MOUSEMOVE branches
so a window with no GadgetID==1 does not deref NULL; match the
existing guards in the keyboard-scroll branches.  In the keyboard
selector and MENU_UNSELECT_ALL paths, only mutate items with
canselect set so a non-selectable header cannot have its str
stomped.  Clamp MENU_LAST_PAGE topidx to >= 0.  Make find_menu_item
return NULL on negative idx instead of the head item.  Guard the
PROMPTFIRST data[] shuffle behind cury > 0.

In amii_destroy_nhwindow's NHW_OVER branch use cw->win with a NULL
guard instead of dereferencing amii_wins[WIN_OVER]->win blindly.
Range-check the type argument to amii_create_nhwindow.  Fix the
*argv_in[1] precedence bug so the -L/-l flag does not deref NULL
when it is the last argument.  Wrap AllocAslRequest result in a
NULL check before AslRequestTags/FreeAslRequest.

Defensively bounds-check the idx argument to DispCol.  Replace
the -25937 signed-int literal in clipwin's PropInfo with the
equivalent UWORD value 39599.  Simplify amii_start_menu's free
loop; switch DoMenuScroll's inventory title and Count display to
Snprintf, and stop passing countString to pline as a format.
2026-05-12 15:27:13 +02:00
..
2026-03-24 07:13:04 -04:00

                        NetHack 5.0 for Amiga
                        ====================

Requirements
------------
    - AmigaOS 3.0 or later (Kickstart 39+)
    - 6 MB free RAM minimum (8 MB recommended)
    - Hard drive with ~5 MB free space

Recommended: RTG graphics card (Picasso96/CyberGraphX) for best
tile rendering. Native AGA/OCS/ECS chipsets are supported.


Installation
------------
Extract NH500AMI.ZIP (or NH500AMIn.ZIP if there's a an updated
binary, where 'n' is a digit suffix) somewhere on your hard drive
(e.g. into Work:). You'll get a NetHack drawer with everything inside.

To play from Workbench, open the NetHack drawer and double-click the
nethack icon.

To play from a Shell:

    Work:NetHack/nethack

To redirect to a different install -- for example to test two versions
side by side -- set the NETHACKDIR (or HACKDIR) environment variable
before launching:

    setenv NETHACKDIR Work:games/nethack-dev/
    Work:games/nethack-dev/nethack


Display Modes
-------------
The shipped nethack.cnf selects tile mode (AMIV).  AMIV needs a screen
with at least 4 bitplanes (16 colours) and ~384 KB free chip RAM; on
machines that don't qualify, the binary automatically falls back to
text mode (AMII) at startup with a short note explaining why.

Tile mode auto-selects tiles32.iff (32 colors, 5 bitplanes) when the
screen supports 32+ colors, otherwise tiles16.iff (16 colors, 4 planes).

To force text mode unconditionally, edit nethack.cnf:

    #OPTIONS=windowtype:amiv
    OPTIONS=windowtype:amii
    OPTIONS=symset:AmigaFont


Configuration
-------------
Edit nethack.cnf for game options.  Defaults shipped:

    OPTIONS=windowtype:amiv     - tile graphics
    OPTIONS=number_pad:1        - numpad movement; '5' is run prefix
    OPTIONS=time,showexp        - turn count, experience visible
    OPTIONS=lit_corridor        - show lit corridors
    OPTIONS=menucolors          - colored inventory items

ALT+letter shortcuts to extended commands (ALT+L for #loot, ALT+F for
#force, etc.) are enabled by default.  On keymaps that need ALT for
typing characters (Scandinavian, German, French, ...) disable with:

    OPTIONS=!altmeta

Menu color examples (after OPTIONS=menucolors):

    MENUCOLOR=" blessed "=green
    MENUCOLOR=" cursed "=red
    MENUCOLOR=" uncursed "=cyan


Building from Source
--------------------
Cross-compilation from Linux using bebbo's m68k-amigaos-gcc toolchain
(https://franke.ms/git/bebbo/amiga-gcc):

    # Install toolchain to /opt/amiga
    # Clone NetHack 5.0 source
    cd NetHack
    sys/unix/setup.sh sys/unix/hints/linux.500
    make fetch-lua
    make CROSS_TO_AMIGA=1 fetch-regex
    make CROSS_TO_AMIGA=1 all
    make CROSS_TO_AMIGA=1 package

The distribution ZIP is created at targets/amiga/NH500AMI.ZIP.

Toolchain requirements:

    - m68k-amigaos-gcc (bebbo's amigaos-cross-toolchain in /opt/amiga)
    - -noixemul (libnix) for linking
    - -m68000 for maximum compatibility (or -m68020/040/060)


Known Issues
------------
    - Native Amiga compilation (SAS/C, DICE) is not supported;
      cross-compilation with GCC is required


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 Amiga port for 3.3 and
Teemu Suikki joined before 3.4.0.

Updated for NetHack 5.0, cross compile fixes and 32 color tile support by Ingo
Paschke in 2026.