Commit Graph
19282 Commits
Author SHA1 Message Date
nhmall d6da7e9819 fixes entry for pull request #1632 2026-07-23 09:46:03 -04:00
nhmall d428fb6708 Merge branch 'msdos-config' of https://github.com/chasonr/NetHack into NetHack-5.0 2026-07-23 09:36:48 -04:00
nhmall 1a4cdff17f update tested versions of Visual Studio 2026-07-23 2026-07-23 09:34:33 -04:00
Ingo Paschke 3b05012624 sfstruct: buffered stdio writes on amiga and atari st
Enable USE_BUFFERING for the structlevel savefile write path on AMIGA
and TOS via a new SFSTRUCT_BUFFERING config define, with a 16 KB
setvbuf on the fdopen'd write stream so many small bwrite()s coalesce
into few dos.library Write() packets.  Leaves mread() unbuffered.

Mainline UNIX/WIN32 are unchanged (setvbuf is gated on the new define);
MAC68K is not enabled, avoiding fdopen()/fclose() on its remapped
non-libc file handles.
2026-07-23 09:01:57 -04:00
nhmall c2a3321684 follow-up bit 2026-07-21 12:13:17 -04:00
nhmall eb13f4de6d LUA version checking in nhl_init()
Use LUA_VERSION_NUM, not LUA_VERSION_RELEASE_NUM, for the check.

Move the definitions of the versions supported by this release of
NetHack to the top of nhlua.c, rather than 2300 lines into the file.

Close #1633
2026-07-21 12:07:45 -04:00
nhmall 85e080bb5d windows calls genl_prag() during startup
genl_prag() will process  the prag@ command line options, if present

Close #1634
2026-07-20 16:11:01 -04:00
Francium-223 1821a6b2e3 a typo fix in data.base
Close #1618
2026-07-11 15:40:30 -04:00
Ray Chason e00b32263e Support the Curses-only configuration 2026-07-10 09:08:55 -04:00
Ray Chason 7889eedfa5 MS-DOS: Support no-tiles and no-graphics builds
In previous versions of NetHack, setting -DUSE_TILES enabled the tile
support, while setting -DSUPPRESS_GRAPHICS produced a NetHack that
would write its TTY output to standard output, and rely on ANSI.SYS or
similar to do screen control. (USE_TILES is now TILES_IN_GLYPHMAP.)

This change ensures that the current NetHack can be built the same
ways.

One twist is that previous NetHacks would drop all support for graphical
modes when tiles were not supported. Thus sys/msdos/vid{vga,vesa}.c have
very disordered use of TILES_IN_GLYPHMAP. There was no need to check
this. But now, the graphical modes also support Unicode. A non-tiled
build should have the graphical modes, with only the text functions
present, provided that ENHANCED_SYMBOLS is defined.

Some unused and locally used symbols were cleaned up along the way.
2026-07-09 23:48:14 -04:00
nhmall f41f1aa09a resolve a cross-compile link error 2026-07-09 16:42:56 -04:00
nhmall 05d1ed365f follow-up fixes5-0-1.txt 2026-07-08 07:38:37 -04:00
nhmall 00ad0e6f76 fixes5-0-1.txt entry for pull request #1620 2026-07-08 07:24:16 -04:00
nhmall ec0f2f0f48 Merge branch 'msdos-vga-colors' of https://github.com/chasonr/NetHack into NetHack-5.0 2026-07-08 07:22:52 -04:00
Ray Chason f3f39311e5 MS-DOS: Define a separate palette for VGA text
In 16 color mode, text colors are mapped onto the colors available in
the tileset. The mapping is a compromise, and is not one-to-one: cyan
and bright cyan are the same, and magenta and bright magenta are the
same.

This change defines a separate palette for use by the text map, and
switches palettes on any transition between text and tiled maps.
2026-07-07 16:24:35 -04:00
nhmall ac151181d2 more u.ustuck issues on save/restore
During a synchronous save operation initiated by the player (or
other trigger for dosave0()), the u.usteed_mid and u.ustuck_mid
values get set by savemonch(), and the monst pointers that
u.ustuck and u.usteed point to are no longer valid, but not
cleared.

The checkpoint operation, which also needs to ensure that
u.ustuck_mid and u.usteed_mid are set, must set them during
the checkpoint, which is okay because the u.usteed and
u.ustuck pointers _are_ valid during a checkpoint operation.

So, we need to distinguish between a save game sequence,
and a checkpoint sequence when writing out the u struct.
2026-07-06 14:16:15 -04:00
nhmall 81ac4deb1e follow-up: fixes5-0-1.txt update 2026-07-06 11:04:13 -04:00
nhmall 98bb86ab33 Windows: fix ascii map hilite_pet
hilite_pet was working with tiles, but not with ascii map.
2026-07-06 11:00:50 -04:00
nhmall bb0016db0a Windows:OPTIONS=windowtype:tty NetHackW.exe issue 2026-07-06 10:59:53 -04:00
nhmall 749646e8d3 follow-up: fix a paste error 2026-07-06 08:17:38 -04:00
nhmall a6308ad5db follow-up: eliminate a fall through warning 2026-07-06 08:03:58 -04:00
nhmall 2f76934ded Merge branch 'preserve-ghost-info' of https://github.com/copperwater/NetHack into NetHack-5.0 2026-07-06 08:01:56 -04:00
nhmall 3d0fe29ff7 Merge branch 'improve-herecmd' of https://github.com/JodiJodington/NetHack into NetHack-5.0 2026-07-06 07:59:37 -04:00
nhmall f5f498eb9e fixes5-0-1.txt entry for pull request #1617 2026-07-06 07:58:16 -04:00
nhmall a4dbd17d15 Merge branch 'msdos-tile-processing' of https://github.com/chasonr/NetHack into NetHack-5.0 2026-07-06 07:53:06 -04:00
Ray Chason 12560f9b13 Add return value where needed. 2026-07-05 22:26:42 -04:00
nhmall 4761d45deb Guidebook.txt update - July 4, 2026 2026-07-04 23:43:41 -04:00
PatR 9004f49b01 GENERICUSERS in Guidebook 2026-07-04 19:12:00 -07:00
nhmall 25be684830 trailing spaces removed from generated nhlua.h 2026-07-04 14:29:54 -04:00
nhmall adbab7f767 periodic style check: whitespace cleanup
leading tabs and trailing blanks
2026-07-04 14:17:43 -04:00
Ray Chason af79ad629c MS-DOS: some optimizations for tile handling
* In both the 16 color and the VESA mode, the tileset image is loaded
      and split into individual tiles; the tiles are then processed into a
      form that is compatible with the video mode in use. For 16 color mode,
      a tile is processed each time it is displayed, leading to slow
      redrawing. For VESA mode, each tile is processed at startup, leading
      to long startup times. Both modes are changed so that the tile is
      processed once, when it is first displayed, and the result is cached.

    * Use memcpy when splitting the image into tiles.

    * Only load the tileset once. In 16 color mode, for reasons I do not
      understand, the gr_init function is called twice, leading to delay
      in startup. This does not happen in VESA mode.
2026-07-04 13:43:23 -04:00
nhmall 2afd03e015 Guidebook update - July 4, 2026 2026-07-04 13:16:31 -04:00
nhmall 228576628c fix spot_monsters give-away
Resolves #1603
2026-07-04 12:53:33 -04:00
nhmall 7c418cff6a follow-up: a compiler warning fix 2026-07-03 09:39:02 -04:00
nhmall ece0c3ce3c fixes5-0-1.txt entries for three pull requests 2026-07-03 08:45:04 -04:00
nhmall d912ab5e6a Merge branch 'start-time' of https://github.com/chasonr/NetHack into NetHack-5.0 2026-07-03 08:36:12 -04:00
nhmall 454ab83a36 Merge branch 'msdos-font-null-ptr' of https://github.com/chasonr/NetHack into NetHack-5.0 2026-07-03 08:35:32 -04:00
nhmall 9abb13dfcf Merge branch 'msdos-fonts' of https://github.com/chasonr/NetHack into NetHack-5.0 2026-07-03 08:34:53 -04:00
nhmall edb99dcf8f fixes5-0-1.txt catch-up; also fix some whitespace 2026-07-03 08:30:40 -04:00
Ray Chason b3fd7330ef Fix operator precedence 2026-07-03 00:24:17 -04:00
Ray Chason 1de1b531b3 Some optimizations of the glyph lookup
* src/glyphs.c: Don't produce names for swallow glyphs that can never
  appear. This speeds up the building of the glyph index in
  populate_glyphname_hash_indices.

* src/symbols.c: Build a sorted index for loadsyms so that it can be
  searched with bsearch.

Benchmarking results, using the MS-DOS port on an emulated 386SX at
16 MHz; times are as measured with clock() from the entry to main()
to the appearance of the "Who are you?" prompt:

* Unmodified:  48.5 seconds
* With the loadsyms index: 40.4 seconds
* With impossible swallow glyphs left unnamed: 34.5 seconds

These changes should also be helpful for the Amiga and Atari ST ports.
2026-07-02 23:08:42 -04:00
Ray Chason ae8982fe3e MS-DOS: Check font pointer for null
The 16 color mode loads the font specified in font_map, and accepts it
only if its size is 8 by 16 pixels. This change avoids a null
dereference if the font is not found.
2026-07-02 21:34:35 -04:00
Ray Chason 3384619431 MS-DOS: Add Extended2 symbols to the bundled fonts
This change adds U+2299, U+2601 and U+2980 to the bundled fonts, so
that all symbols specified in the Extended2 symbol set are available.

Also, a few more directives are added to the files, so that FontForge
can load them and display their contents.
2026-07-02 21:22:30 -04:00
nhmall 5e80fd3b93 wand of stasis when off level
Account for the time spent on other levels for
wand of stasis

Resolves #1608
2026-07-02 17:48:29 -04:00
nhmall aaf601ffc8 follow-up bit 2026-06-28 17:49:00 -04:00
nhmall bfa924bb0e replace hardcoded number with correct enum value 2026-06-28 17:46:17 -04:00
nhmall c918878299 follow-up: field name typo 2026-06-27 11:45:36 -04:00
nhmall 90aaeb53cd follow-up: zero out puzzling_criteria 2026-06-27 11:41:54 -04:00
nhmall ac3d71a82a give player an inkling of why corpses didn't stack
When corpses haven't stacked, and there is no player-discernable
reason why, provide some additional information in some cases,
but only when it is required.

Gender variance is the supported case in this commit.

Related to GitHub issue #1607.

This commit doesn't change the underlying mechanics to allow
the corpses to stack, but it does help the player understand
why that's the case in this instance.
2026-06-27 11:18:44 -04:00
nhmall 6fee8a4e78 yet another warning bit
In file included from ../include/hack.h:34,
                 from sp_lev.c:14:
In function ‘create_monster’,
    inlined from ‘lspo_monster’ at sp_lev.c:3386:5:
../include/rm.h:528:32: warning: array subscript -1 is below array bounds of ‘struct monst *[80][21]’ [-Warray-bounds=]
  528 |         if (!svl.level.monsters[x][y])                     \
      |              ~~~~~~~~~~~~~~~~~~^~~
sp_lev.c:2045:25: note: in expansion of macro ‘remove_monster’
 2045 |                         remove_monster(x, y);
      |                         ^~~~~~~~~~~~~~
../include/rm.h: In function ‘lspo_monster’:
../include/rm.h:476:19: note: while referencing ‘monsters’
  476 |     struct monst *monsters[COLNO][ROWNO];
      |                   ^~~~~~~~
In function ‘create_monster’,
    inlined from ‘lspo_monster’ at sp_lev.c:3386:5:
../include/rm.h:530:27: warning: array subscript -1 is below array bounds of ‘struct monst *[80][21]’ [-Warray-bounds=]
  530 |         svl.level.monsters[x][y] = (struct monst *) 0;     \
      |         ~~~~~~~~~~~~~~~~~~^~~
sp_lev.c:2045:25: note: in expansion of macro ‘remove_monster’
 2045 |                         remove_monster(x, y);
      |                         ^~~~~~~~~~~~~~
../include/rm.h: In function ‘lspo_monster’:
../include/rm.h:476:19: note: while referencing ‘monsters’
  476 |     struct monst *monsters[COLNO][ROWNO];
      |                   ^~~~~~~~
2026-06-26 15:21:19 -04:00