Commit Graph

18400 Commits

Author SHA1 Message Date
nhmall
5d814053a1 some outdated cleanup outdated/sys/windows 2026-03-27 06:59:49 -04:00
PatR
f49ac037f9 release wish history memory
The memory leak only happened at end of game so wasn't a big deal.
2026-03-25 15:54:44 -07:00
nhw_cron
d939238ea6 This is cron-daily v1-Jan-12-2026. 005guidebook updated: doc/Guidebook.txt 2026-03-25 15:26:08 -04:00
PatR
11f27226cb 'pauper' documentation
The LaTeX Guidebook has been updated but not tested.  It's unlikely that
this small change has introduced any problems though.
2026-03-25 11:18:15 -07:00
nhw_cron
7c9b4b9595 This is cron-daily v1-Jan-12-2026. 005guidebook updated: doc/Guidebook.txt 2026-03-25 09:10:17 -04:00
nhmall
b58d2d4096 try to reduce some Amiga cross-compile warnings 2026-03-25 08:48:14 -04:00
nhmall
3c89dc2387 Guidebook date stamp to reflect most recent update 2026-03-25 08:06:12 -04:00
Pasi Kallinen
f8bd79354c Add a history menu for wizwish
Use the 'm' Prefix to make wizwish show the history menu.
Also entries wished via WIZKIT are added to the history.

While debugging, I often need to wish the same thing multiple
times, and typing or pasting it with mouse is annoying...
2026-03-25 13:46:07 +02:00
Pasi Kallinen
41b2087436 Hero has a small chance of catching items thrown at them 2026-03-25 09:35:39 +02:00
nhw_cron
0f461df338 This is cron-daily v1-Jan-12-2026. 000files updated: Files 2026-03-24 12:42:07 -04:00
nhmall
aac60db8d6 update Cross-compiling for Amiga steps 2026-03-24 11:46:07 -04:00
Pasi Kallinen
d78af5cec7 Add monster spell header file mcastu.h
Move the monster spell definitions there, and use hackery
(similar to objects.h) to generate enum and data from
the header file.

I have not tested Windows, VMS, or Amiga builds.
2026-03-24 17:26:24 +02:00
nhmall
d929adc85c warning fix in sp_lev.c
In function 'create_monster',
    inlined from 'lspo_monster' at sp_lev.c:3385:5:
sp_lev.c:2169:32: warning: 'tmpmons.m_lev_adj' may be used uninitialized [-Wmaybe-uninitialized]
 2169 |             if (mtmp->m_lev + m->m_lev_adj > 49)
      |                               ~^~~~~~~~~~~
sp_lev.c: In function 'lspo_monster':
sp_lev.c:3217:13: note: 'tmpmons.m_lev_adj' was declared here
 3217 |     monster tmpmons;
      |             ^~~~~~~
2026-03-24 10:05:48 -04:00
nhmall
39a4111104 Merge branch 'amiga-port' of https://github.com/ingpaschke/NetHack into NetHack-3.7 2026-03-24 07:53:39 -04:00
nhmall
4991339655 don't abort clean if target cross-compile directory isn't there 2026-03-24 07:49:38 -04:00
Ingo Paschke
ced24f6fc9 Remove dead -DLUA_32BITS=1 flag
luaconf.h hardcodes #define LUA_32BITS 0 which overrides the
command-line flag. m68k-amigaos-gcc supports long long so 32-bit
mode is not needed anyway.
2026-03-24 12:49:14 +01:00
Ingo Paschke
a398a9bdc7 Use NetHack's util/uudecode instead of system uudecode 2026-03-24 12:49:14 +01:00
nhw_cron
ab04f5455d This is cron-daily v1-Jan-12-2026. 000files updated: Files 2026-03-24 07:38:08 -04:00
nhmall
7f8f7c54dc Files identification update 2026-03-24 07:13:04 -04:00
nhw_cron
875efba210 This is cron-daily v1-Jan-12-2026. 000files updated: Files 2026-03-24 07:01:58 -04:00
nhmall
507f526b43 remove duplicate entry in .gitignore 2026-03-24 05:48:51 -04:00
nhmall
14c5f318e1 Add a fixes3-7-0.txt entry for Amiga build pr1494
Build instructions in sys/amiga/README.amiga

The Amiga cross-compile support makes the following file changes to
the repository:

 rename {outdated/include => include}/amiconf.h (96%)
 create mode 100644 sys/amiga/README.amiga
 rename {outdated/sys => sys}/amiga/amidos.c (91%)
 rename {outdated/sys => sys}/amiga/amidos.p (100%)
 rename {outdated/sys => sys}/amiga/amifont.uu (100%)
 rename {outdated/sys => sys}/amiga/amifont8.uu (100%)
 rename {outdated/sys => sys}/amiga/amigst.c (100%)
 rename {outdated/sys => sys}/amiga/amii.hlp (100%)
 rename {outdated/sys => sys}/amiga/amimenu.c (100%)
 rename {outdated/sys => sys}/amiga/amirip.c (93%)
 rename {outdated/sys => sys}/amiga/amistack.c (55%)
 rename {outdated/sys => sys}/amiga/amitty.c (97%)
 rename {outdated/sys => sys}/amiga/amiwind.c (90%)
 rename {outdated/sys => sys}/amiga/amiwind.p (100%)
 create mode 100644 sys/amiga/bmp2iff_host.c
 rename {outdated/sys => sys}/amiga/clipwin.c (100%)
 rename {outdated/sys => sys}/amiga/colorwin.c (100%)
 rename {outdated/sys => sys}/amiga/grave16.xpm (100%)
 create mode 100644 sys/amiga/nethack.cnf
 rename {outdated/sys => sys}/amiga/winamenu.c (94%)
 rename {outdated/sys => sys}/amiga/winami.c (94%)
 rename {outdated/sys => sys}/amiga/winami.p (87%)
 rename {outdated/sys => sys}/amiga/winchar.c (78%)
 rename {outdated/sys => sys}/amiga/windefs.h (98%)
 rename {outdated/sys => sys}/amiga/winext.h (100%)
 rename {outdated/sys => sys}/amiga/winfuncs.c (86%)
 rename {outdated/sys => sys}/amiga/winkey.c (89%)
 rename {outdated/sys => sys}/amiga/winproto.h (88%)
 rename {outdated/sys => sys}/amiga/winreq.c (95%)
 rename {outdated/sys => sys}/amiga/winstr.c (95%)
 create mode 100644 sys/amiga/xpm2iff_host.c
2026-03-24 05:43:46 -04:00
nhmall
aa90cd5cd8 Merge branch 'amiga-port' of https://github.com/ingpaschke/NetHack into NetHack-3.7 2026-03-24 05:37:17 -04:00
Ingo Paschke
2979030af1 Use NetHack's util/uudecode instead of system uudecode 2026-03-24 02:37:02 +01:00
Ingo Paschke
c5dfd1fc5c Fetch BSD regex from GitHub at build time
Replace bundled Spencer regex with a fetch-regex build step that
clones https://github.com/garyhouston/regex.git, generates the
required .ih and regex.h headers via mkh, and copies the result
into sys/amiga/regex/.

Usage: make CROSS_TO_AMIGA=1 fetch-regex

The fetched sources are not tracked in git.
2026-03-24 01:21:00 +01:00
Ingo Paschke
cb0b11be11 Add portable utilities for creating tiles, add AmigaFont to symbols
- bmp2iff_host: convert nhtiles.bmp to Amiga IFF tile files. Uses
  the AMIV UI palette in pens 0-15, remaining pens filled with tile
  colors sorted by frequency.
  Usage: bmp2iff_host -planes N input.bmp output.iff

- xpm2iff_host: convert XPM to IFF for tomb.iff (RIP screen).
  Adapted from xpm2iff.c, Copyright (c) 1995 Gregg Wonderly.

- Auto-select tiles32.iff (5 planes) or tiles16.iff (4 planes)
  based on screen color depth at runtime.

- Fix NO_GLYPH in amiv_lprint_glyph: return early to prevent
  blitting with uninitialised data (caused black spots).

- Add AmigaFont symbol set to dat/symbols for AMII text mode.
2026-03-23 21:11:56 +01:00
Ingo Paschke
cee390482c Add BSD POSIX regex for Amiga
Add Henry Spencer's BSD regex implementation (from ixemul) to provide
POSIX regular expressions for the Amiga port, enabling menu coloring
and config file pattern matching.

Copyright (c) 1992 Henry Spencer, The Regents of the University of
California. BSD license.
2026-03-23 20:48:28 +01:00
Ingo Paschke
2d597cb9fa Revive Amiga port for NetHack 3.7
Update the Amiga Intuition window port (AMII/AMIV) for the 3.7
window_procs API. Key changes:

- Update all window function signatures for 3.7
- Add assembly trampolines for AmigaOS register-based callbacks
- Convert all K&R function definitions to C99
- Add cross-compilation build system (cross-pre1/pre2/post.370)
  using bebbo's m68k-amigaos-gcc with -noixemul -std=gnu17 -m68000
- Clipping fixes: viewport centering, simplified ScrollRaster,
  duplicate Ctrl-R suppression, glyph buffer invalidation
- Add menucolor support in menu rendering
- Move native txt2iff.c and xpm2iff.c to outdated/
- Add nethack.cnf and README.amiga
2026-03-23 20:48:06 +01:00
Ingo Paschke
7b89255ea8 Move Amiga port files from outdated/ to sys/amiga/
Move the active Amiga source files back into their proper locations.
Legacy native build files (Makefile.ami, Build.ami, etc.) remain
in outdated/ as they are not used by the cross-compilation build.
2026-03-23 20:46:56 +01:00
Ingo Paschke
1ca15d99ff Fix clipping: move cliparound after vision_recalc
cliparound() was called before rhack(), triggering a map redraw with
stale vision data followed by a second correct redraw. Move it after
vision_recalc() so the map is redrawn once with correct data.
2026-03-23 20:46:31 +01:00
Ingo Paschke
e07eb1a550 Fix vision: remove NO_MACRO_CPATH
The non-macro q_path() function wrappers in vision.c pass the first
two arguments in the wrong order to the _q*_path() functions, swapping
rows and columns. This causes the Bresenham line-of-sight code to use
column values as row indices into viz_clear_rows[ROWNO], producing
out-of-bounds access and infinite loops.

NO_MACRO_CPATH selects these broken function wrappers. It was only
defined for Amiga (in config1.h), so the bug never triggered on other
platforms. Remove the define to use the correct macro versions.
2026-03-23 20:46:08 +01:00
Pasi Kallinen
d80e194735 Split mcast_spell into separate functions 2026-03-23 14:51:48 +02:00
Pasi Kallinen
c0f5d2dd92 Allow monster level adjustments in special levels
Add a new parameter to des.monster, m_lev_adj, which is a level
adjustment for the monster.  This only applies to the monster's
level, so basically only affects the spellcasting, it does not
change the monster's hit die or inventory.

Change one of the shamans in Orctown to be 3 levels higher.
2026-03-23 12:51:50 +02:00
nhmall
1ba9be09fa pre-C23 build fix
Prior to C23, a statement is required after a label.
2026-03-23 06:42:11 -04:00
Pasi Kallinen
d6cbaca654 Reorganize mcastu code
Merge the two different enums, so all monster spells are in one
list.  This should have no functional difference, but cleans up
the code a bit.
2026-03-23 11:42:54 +02:00
PatR
10eedbe2f0 fix #S15496 - #chronicle oversight
Add a livelog/#chronicle message for quest leader opening the quest.

A similar message for being expelled doesn't seem possible to be
triggered.

Log the initial visit to each level in the quest branch.  They record
when the hero actually visits the quest levels, beyond the new one
about permission to do the quest.
2026-03-22 22:01:40 -07:00
nhmall
e94a2f2bf2 doc/Guidebook.txt update Mar03-2026 2026-03-22 11:37:07 -04:00
nhmall
f9cebc5890 avoid a warning with Xcode build 2026-03-22 11:33:26 -04:00
nhmall
8ee179a594 Guidebook timestamp to reflect the most recent update 2026-03-22 09:30:16 -04:00
nhmall
33b24fbd13 update Xcode project to reflect recent file addition 2026-03-21 18:43:04 -04:00
nhw_cron
dffb40c0e7 This is cron-daily v1-Jan-12-2026. 005guidebook updated: doc/Guidebook.txt 2026-03-21 18:01:37 -04:00
Pasi Kallinen
8e4c7f9fb5 Change some command keys
Change 'v' from #versionshort to #chronicle.
Change 'V' from #history to #versionshort.
History can still be accessed either directly with the extended command,
or via the help menu.
Versionshort now accepts the m-prefix, and then shows the longer version.
2026-03-21 17:56:37 +02:00
nhmall
1eadfa962d don't include size_t * and time_t * in _Generic for now
There are behavior differences with macOS and other plaforms that
would need to be addressed if they were included.
2026-03-21 11:11:28 -04:00
Pasi Kallinen
9fc1514253 Amulet of magical breathing increases energy regen
Normally energy regen is 1d2 or 1d3, so wearing the amulet increases
that to 1d4 or 1d5.  The only way to get energy regeneration is via
The Eye of the Aethiopica, so you cannot have both at the same time.
2026-03-21 13:20:14 +02:00
Pasi Kallinen
63a78edcfa Add toggle extended command
Allows the user to configure a key binding to toggle any boolean
option, for example:

BIND=':toggle(price_quotes)
BIND=v:toggle(autodig)

The option must be settable in-game.
2026-03-21 12:17:37 +02:00
Alex Smith
62a50413d3 New debug command #wizobjprobs for listing item probabilities
As of the change to allow for item probabilities that don't add up
to 1000, it's become a little difficult to figure out the exact
probabilities from the source code, which makes it hard to balance
item generation. Adding a tool to list the probabilities helps.

Part of the problem is that changing an item's probability without
balancing it elsewhere is usually wrong: doing that would in effect
take the probability equally from (or add the probability equally
to) all other items in the class, which might break the balancing
of those items due to the probability change.

As such, it is usually better to make an intentional decision about
which items should be less and which items should be more likely to
generate, then change them in a balancing way (meaning that the
probabilities of objects that weren't intentionally changed remain
unchanged). Doing a complex such change makes arithmetic errors
fairly likely, though, so it's useful to have a command that verifies
that it's been done correctly.

This command is primarily intended as a development aid, so it's
included only in debug builds and pre-release builds (the same as
other similar commands like #wizmondiff).
2026-03-21 05:05:48 +00:00
Alex Smith
26fd5e7d73 Armor probability tweaks
Armor is now slightly more likely to generate outside Gehennom (at
the expense of gems that generate via random generation rather than
mineralisation or level rules).

Basic nonmagical armor (especially body armor) has had its generation
probabilities reduced *relative to other armor*, but outside
Gehennom, it is no less likely to generate (because armor in general
is now more likely to generate outside Gehennom). It is slightly less
likely to generate in Gehennom (but isn't typically needed in
quantity there).

Armor that has extrinsics is more likely to generate, both due to
having increased probability relative to other armor, and due to the
increased proportion of generated items being armor: this is the
primary goal of this change.

The intention behind this change is to increase the chance that
players naturally find useful armor (especially armor that they might
not have been planning to use, but that they can adapt their strategy
to make use of), rather than needing to wish for it: the chance of
finding useful armor is higher both in the Dungeons (due to the
increased probability) and in Gehennom (because it is more biased
towards armor that might be useful at that stage of the game).  In
practice, in 3.6.x (prior to this change and to wishing changes), it
was quite common for players to wish up an entire set of armor at the
Castle, ignoring almost everything they'd found so far that game; I'm
hoping this change encourages more wish variety rather than spending
the majority of wishes on armor.
2026-03-21 04:52:51 +00:00
Pasi Kallinen
f85b5b1c9d Fix segfaults from the key binds change
Should've checked rest_on_space behaviour ...
2026-03-20 22:49:29 +02:00
Pasi Kallinen
c595f241e6 Change key binds from array to linked list
Key bindings were stored as a fixed-size array, indexed by the input
character, pointing to the extended commands.  This changes that into
a linked list of an intermediary struct Cmd_bind, storing the input key
and the pointer to the command.

This is just code cleanup for future enhancements, and should have
no effect on gameplay.
2026-03-20 19:57:44 +02:00
nhmall
044a229467 whitespace cleanup: tabs to spaces in sys 2026-03-19 20:33:03 -04:00