Commit Graph

291 Commits

Author SHA1 Message Date
RainRat
a3658f85ac fix typos 2024-02-28 20:15:56 -08:00
nhmall
90fcce8903 follow-up to only attempt unzip if download was ok 2023-12-18 14:59:01 -05:00
nhmall
c197dfe29b include symify.exe in the NetHack msdos package
Before using this updated packaging you will need
to do the following (one time):
    sh sys/msdos/fetch-cross-compiler.sh

And you'll need to update your Makefiles as follows.

On Linux:
    sh sys/msdos/setup.sh sys/unix/hints/linux.370

or on macOS;
    sh sys/msdos/setup.sh sys/unix/hints/macOS.370

Create the msdos package with:
    make CROSS_TO_MSDOS=1 package
2023-12-18 14:48:10 -05:00
nhmall
fc4f0a603d Merge branch 'vesa-fixes' of https://github.com/chasonr/NetHack into NetHack-3.7 2023-12-07 10:07:24 -05:00
nhmall
e639c4bdaa A recent patch 634f4928 introduced new tty behavior,
where calling term_start_color(NO_COLOR) would have the same
effect as calling term_end_color().

That change only included a change for termcap, but not any of
the NO_TERMS configurations. (NO_TERMS is defined for an
implementation where termcap is not used).

This attempts to make sys/msdos/video.c and sys/windows/consoletty.c
honor the change.

The msdos change has not yet been tested.

No attempt was made to alter the term_start_color() implementations
within the outdated tree.
2023-12-07 09:34:05 -05:00
Ray Chason
1f52205ee2 Fix crashes and weirdness in VESA text mode 2023-12-06 09:05:23 -05:00
nhmall
04082a2033 Remove TEXTCOLOR build option 2023-11-22 16:01:58 -05:00
nhmall
c85900320c fetch dos extender from a different location
CI was having difficulty connecting
2023-11-15 12:33:07 -05:00
Pasi Kallinen
f74f7988ff MSDOS: implement valid location highlighting
... for VGA and VESA tiled map.
2023-11-13 12:40:10 +02:00
nhmall
47bca92e6c follow-up Install.dos: consistent sample dir path 2023-11-11 12:27:03 -05:00
nhmall
7b2bf56f40 update Install.dos 2023-11-11 12:01:28 -05:00
Pasi Kallinen
614e6c9d5e MSDOS: implement inverse text attribute 2023-10-24 18:34:15 +03:00
Pasi Kallinen
76471e890b MSDOS: Fix VESA mode text background color 2023-10-24 09:37:36 +03:00
nhmall
f625d2efcf more tabs to spaces 2023-08-16 10:22:10 -04:00
nhmall
e1bae750de update DOS cross-compiler version 2023-06-27 10:49:35 -04:00
nhmall
b35d8a34ed update Lua version supported 2023-05-28 22:58:47 -04:00
nhmall
2185d325c4 header file changes hack.h, decl.h/.c, system.h, wintty.h
- Move secondary preprocessor defines down further in config.h
so that they can be overridden via [platform]conf.h which is
included from global.h, specifically:
    LIVELOGFILE when LIVELOG is defined
    DUMPLOG_FILE when DUMPLOG is defined

- Minimize platform-specific, or compiler-specific code in hack.h and decl.h.

- reorganize src/decl.c to align with include/decl.h.

- a new header file cstd.h added, containing calls to C99
standard header files.

- hack.h, decl.h, and decl.c have been cleaned up and had code
moved so that things line up as follows:

     hack.h     defines values that are available to all
                NetHack source files, contains enums for use in all
                NetHack source files, and contains a number of
                struct definitions for use in all NetHack source files.
                It does not contain variable declarations or variable
                definitions.

     decl.h     contains the extern declarations for variables that
                are defined in decl.c. These variables are global and
                available to all NetHack source files. The location of
                the variables within decl.h was random, so give it some
                order for now.

     decl.c     contains the definition of the variables declared in
                decl.h, and initializes them where appropriate. The
                variable definitions are laid out in much the
                same order as their declarations in decl.h.

- wintty.h: There were some varying terminal-related prototypes in
system.h, and that was the only thing left that demanded that
system.h be included. Those have been replaced by an #include
<term.h> in include/wintty.h to get the more current (and hopefully
more correct) prototypes, rather than hardcoding them in NetHack
sources.

For edge-case platform compatiblity, there is no #include <term.h>
if the build defines NO_TERMCAP_HEADERS. In that case one set of
hardcoded prototypes is still used in include/wintty.h.

The added #include "term.h" is also bypassed for NO_TERMS builds (builds
that don't link to terminfo/termcap at all, but still present a tty
interface using platform or window-port specific functions to fulfill
the same role as that of terminfo/termcap).

- some scattered, unnecessary #include "integer.h" were removed from
various files, since that's always included in current NetHack-3.7
sources, either directly from config.h or indirectly from #include
"hack.h".

- system.h references removed.

- new cstd.h added; the #include "system.h" references in Makefiles
and project files (Xcode, visual studio), were replaced
with #include "cstd.h" references. A "make depends" is probably
warranted.

Also:

 - Use of <term.h>, which defines clear_screen() as a macro, conflicts
with an actual function with that name in win/tty/termcap.c. The most
straight-forward course of action was to rename the NetHack function,
and change the references to it, from clear_screen() to
term_clear_screen(), so that was done.
2023-04-05 11:49:09 -04:00
PatR
998b5af644 non-Unix sysconf updates
For non-Unix systems, disable the "description of NetHack's command
line" entry in the help command's menu.
2023-02-21 11:15:08 -08:00
nhmall
2fc0d25d45 introduce support for coloring the frame behind a map location
Also includes support by paxed for polearm targeting using the
frame color.

Also renames USE_TILES to TILES_IN_GLYPHMAP which is a more
accurate description.

Not all window interfaces have full support for the color framing
of the background square yet.

MS-DOS needs further work (to bring it to both VESA and VGA, with
and without tiles.

Windows GUI is missing support.

X11 and Qt have been started, but may require further refinement.
2023-01-01 19:55:02 -05:00
nhmall
225af4ed4b CI ms-dos build: 1 warning was logged as 2 due to set -x 2022-12-02 00:23:46 -05:00
nhmall
df0c65ce41 more fetch-cross-compiler.sh tweaks 2022-12-02 00:20:41 -05:00
nhmall
233e4a41af exit return code 2022-12-01 21:46:19 -05:00
nhmall
a1cd77e39c in fetch-cross-compiler.sh, stop if required piece failed to download 2022-12-01 20:36:10 -05:00
nhmall
6b99a50821 fix a couple of ms-dos shadow declaration warnings 2022-11-29 23:43:42 -05:00
nhmall
02a48aa8cf split g into multiple structures
The consolidation of global variables from scattered source
files into decl.c and declared in decl.h was begun in 3.7.0.
Their placement in common files was done for centralized
initialization and potential re-initialization during a
"play again" scenario.

It wasn't really necessary for all of them to be housed in a
single huge structure to meet the "play again" requirement,
and the single huge structure has been a little unwieldy when
it comes to maintenance.

Following this commit, instead of one single extremely large structure
named 'g' to house all of the relocated global variables, they
are distributed into several ga through gz.

To make things easy for the developer, each variable is placed
into the struct corresponding to the starting letter of the variable.
That way, no lookup is required in order to know which struct houses
a particular variable, it is a simple match to the starting letter
for all the centralized global variables.

A global variable named 'amulets', would be found in ga.
    ga.amulets
     ^ ^
A global varable named 'move', would be found in gm.
    gm.moves
     ^ ^
A global variable named 'val_for_n_or_more' would be found in gv.
    gv.val_for_n_or_more
     ^ ^
A global variable named 'youmonst' would be found in gy.
    gy.youmonst
     ^ ^
2022-11-29 21:53:21 -05:00
nhmall
9efa5d5b44 follow-up bit (in unused ms-dos code) 2022-11-23 18:57:14 -05:00
nhmall
937355038d some coordxy and other conversion warnings
When dist2() got changed to use coordxy parameters, a macro that uses
it in its definition was overlooked and it had (int) casts in it.
That caused a warning about possible data loss when the int
then got converted to coordxy for the dist2() call.

Give online2() coordxy parameters instead of int, like its bretheren.

Avoid a couple of implicit conversion warnings where ints were being assigned
to smaller uchar or ints being assigned to smaller short.

A couple of signed vs unsigned warnings on some rumor processing.

Avoid some signed vs unsigned warnings in mdlib/makedefs where a signed int
param eventually got used in an external call that took size_t.
Eliminate all of it by just having the outer NetHack routine also take
a size_t.

Lastly, insert some default C99 alternative time-related code
in mdlib/makedefs since asctime() and ctime() are being flagged as
deprecated in the upcoming C23 standard and will now start to trigger
warnings for anyone using a C23-compliant compiler.
2022-11-23 17:49:55 -05:00
nhmall
99a93fe50b some C99 changes
Instead of using index() macro defined to strchr, use C99 strchr.
Instead of using rindex() macro defined to strrchr, use C99 strrchr.

If you want to try building on a platform that doesn't offer those
two functions, these are available:
    define NOT_C99       /* to make some non-C99 code available */
    define NEED_INDEX    /* to define a macro for index()  */
    define NEED_RINDX    /* to define a macro for rindex() */
2022-10-29 10:54:25 -04:00
nhmall
88f6df2d8b some tabs to spaces
cd src
    grep -P -n '\t' *.c | grep -v "1:"
    cd ../include
    grep -P -n '\t' *.h | grep -v "1:"
    cd ..

side note: win/Qt/*.cpp are full of tabs
2022-10-26 14:21:23 -04:00
nhmall
d4bb4758aa transcribe dependencies from sys/unix/Makefile.src
Transcribe the dependencies from sys/unix/Makefile.src
to sys/msdos/Makefile.GCC and sys/windows/Makefile.nmake
to bring them up to date.
2022-10-15 12:28:53 -04:00
Ray Chason
333fc71b86 Provide characters missing from Terminus fonts 2022-10-15 09:05:58 -04:00
nhmall
4ab2860718 warning fix in msdos build
../sys/msdos/font.c:24:12: warning: declaration of 'flags' shadows a global declaration [-Wshadow]
   24 |     uint32 flags;
      |            ^~~~~
In file included from ../include/hack.h:285,
                 from ../sys/msdos/font.c:3:
../include/flag.h:422:29: note: shadowed declaration is here
  422 | extern NEARDATA struct flag flags;
      |                             ^~~~~
make[2]: Entering directory '/home/nhmall/git/NHsource/util'
2022-10-09 09:35:24 -04:00
nhmall
78ac9c767f Merge branch 'dos-tty-unicode' of https://github.com/chasonr/NetHack into pr899 2022-10-09 09:26:08 -04:00
Ray Chason
ea3d322a11 Fix compile when no ENHANCED_SYMBOLS 2022-10-09 09:04:23 -04:00
Ray Chason
613828f5dd Support 24 bit color for Unicode symbols 2022-10-09 08:59:20 -04:00
Ray Chason
e4f921f508 Update the native compile 2022-10-09 02:53:13 -04:00
Ray Chason
6400ce073a Support Unicode symbols in 16 color mode 2022-10-08 19:41:22 -04:00
Ray Chason
fb88488583 Support Unicode symbols in VESA modes 2022-10-08 18:50:38 -04:00
Ray Chason
5b5e217991 Avoid null dereference in VESA initialization
If the VESA mode chooses a mode with 8 bit pixels, but the tile set
has too many colors for that, a null dereference can result when
trying to set up the nonexistent palette. Catch this condition and
refuse to set VESA mode instead.
2022-10-08 15:42:07 -04:00
nhmall
cea9b75cb2 fetch-cross-compiler.sh directory check follow-up 2022-10-06 12:45:14 -04:00
Ray Chason
5683f88d36 A note on makefonts.lua 2022-10-05 20:25:34 -04:00
Ray Chason
31859f562e Make the Terminus fonts an external package
Credit to Michael Allison for the patch and for the previous one
to build the fonts in the cross-compile.
2022-10-05 20:03:11 -04:00
Ray Chason
03a82720ef Build fonts in the native build 2022-10-03 20:53:07 -04:00
Ray Chason
cb010b9859 Ignore the PSFs 2022-10-03 20:24:20 -04:00
Ray Chason
daf18eac91 Build the PSF fonts in the cross-compile 2022-10-03 20:22:11 -04:00
Ray Chason
d3cb84a313 Update the README for the fonts 2022-10-02 20:41:02 -04:00
Ray Chason
37f43c3b79 Rewrite the makefont program in Lua 2022-10-02 20:41:02 -04:00
Ray Chason
b4832b40fc Support the DOSVGA build 2022-10-02 20:41:02 -04:00
Ray Chason
db74f82101 More native compile fixes
* subst doesn't seem to work in variable assignments
* LUADLL isn't meaningful for MS-DOS
2022-10-02 20:41:02 -04:00
Ray Chason
76a88ef2b0 Updates to the native compile 2022-10-02 20:41:02 -04:00