Commit Graph
100 Commits
Author SHA1 Message Date
nhmall 536cc9aaf6 include the two new sounds to list of sought files 2023-02-25 14:26:15 -05:00
nhmall 52c2ce0caf Makefile.mingw32 placement 2023-02-24 17:45:02 -05:00
nhmall db60679665 Windows: add lua files dependency 2023-02-24 17:40:35 -05:00
nhmall 700ca5a7b2 update tested versions of Visual Studio 2023-02-21 2023-02-21 23:51:02 -05:00
nhmall 4ac7725fde Guidebook update 2023-02-21 23:03:19 -05:00
nhmall 049ab7a5df remove some macgraphics references; some Amiga
Also closes #183
2023-02-21 22:54:56 -05:00
nhmall da92b9b173 paste error in read.c 2023-02-21 11:52:36 -05:00
nhmall 99d784795b fix issue in Guidebook.tex 2023-02-19 21:40:52 -05:00
nhmall a92ed87c93 fix recover on Linux
Also, recover should be a target-side utility, not host. That
really only makes a difference if you are cross-compiling.
2023-02-19 15:06:55 -05:00
nhmall 68b795483d Guidebook update 2023-02-19 10:52:56 -05:00
nhmall 84390fa600 expand C99=1 with macOS.370 and linux.370 hints
In addition to C99=1 on the make command line, also allow
C89=1 or C11=1 or C23=1.

NOTE: Those won't all lead to a successful build of NetHack,
and the use of C23=1 (-std=c2x) will only be valid on recent
compiler versions (clang-15, for one, accepts it).
2023-02-18 11:35:40 -05:00
nhmall 20f2c5569b Cross-compiling update 2023-02-18 00:55:01 -05:00
nhmall d1fda1773a fix a warning on Linux for X11 if -std=c99 2023-02-17 16:56:27 -05:00
nhmall 24dab18167 allow setting the standard
CSTD can be manually set near the top of src/Makefile, util/Makefile
or by including c99=1 or C99=1 on the build make command line if
using the linux.370 or macOS.370 hints files.
2023-02-17 10:23:40 -05:00
nhmall 709125a915 update patchlevel.h with NetHack 3.6.7 release info 2023-02-16 21:06:06 -05:00
nhmall 7aab1c0b76 Guidebook update 2023-02-16 20:56:33 -05:00
nhmall 288cc01f3a Merge branch 'naming-overflow-fix2' into NetHack-3.7 2023-02-16 18:52:47 -05:00
nhmall 10cafddcb0 more bundle work for macOS
This iteration:

Places the resulting bundle folder off the top of the tree, rather than as a subdirectory of src.

Leaves the Applescript files out for now.

Builds the Info.plist (for now) via hard-coded values in the Makefile.

Builds the bundle launch script on the fly at make-time.

I think this revision may be working, at lease on my test machine.
There are more improvements to be done.
2023-02-12 01:19:05 -05:00
nhmall 3ada7caf61 missed one, there were two 2023-02-10 14:28:27 -05:00
nhmall 3cd1a09d41 prevent a static analyzer warning 2023-02-10 08:56:06 -05:00
nhmall 24461058e6 more work on bundle and starting from Finder 2023-02-10 01:55:49 -05:00
nhmall f93d17173f Merge branch 'pr977' into NetHack-3.7 2023-02-09 20:08:39 -05:00
nhmall 738bccc344 updated to Makefile bundling 2023-02-09 15:25:42 -05:00
nhmall a443747211 eliminate some Xcode warnings on macsound.m 2023-02-09 12:10:22 -05:00
nhmall 4ce722b8b2 more follow-up 2023-02-08 18:12:15 -05:00
nhmall c67d9e96a6 correct a typo 2023-02-08 17:48:26 -05:00
nhmall aad0586239 add new macOS target 'bundle'
This creates a new target 'bundle' for make on macOS, when using
sys/hints/macOS.370.

The 'bundle' recipe:
    - creates a subdirectory of src called 'bundle', and creates
      a bundle (nethack.app/ etc) below that.
    - the executable that is placed inside the bundle
      (bundle/nethack.app/Contents/MacOS/nethack) will find resources
      within the bundle, including the sounds, so a manual placement
      of the sounds into your '~/Library/Sounds' is no longer
      required when using the executable that's inside the bundle.
    - the sounds are included in the bundle if a soundlib option is
      chose at build time (for example 'make WANT_MACSOUND=1'), such
      that the bundled executable supports sounds.
    - the executable inside the bundle seems to find the resources
      it needs, even if invoked through a symlink elsewhere that points
      to the executable that's inside the bundle (only limited testing of that
      has been done).
    - at some point, its probably appropriate to add a
      'mv bundle/nethack.app <proper location>', possibly under
      a subsequent 'make install' step.
    - right now, the bundle step has a dependency on 'update'. I don't
      know if that's the right ordering or not, yet.

make WANT_MACSOUND=1 update
make WANT_MACSOUND=1 bundle

or, you can probably get away with:

make WANT_MACSOUND=1 bundle

if the nethack bundle is the goal anyway.

make clean
will clear the bundle subdirectory and everything below it.
2023-02-08 17:17:43 -05:00
nhmall 37b5eae64d suppress one more warning 2023-02-08 13:07:37 -05:00
nhmall da71e22fac suppress some warnings if SND_SPEECH is not defined
apply.c:1413:27: warning: unused variable 'shkp' [-Wunused-variable]
            struct monst *shkp = shop_keeper(*in_rooms(u.ux, u.uy, SHOPBASE));
                          ^
apply.c:1570:27: warning: unused variable 'shkp' [-Wunused-variable]
            struct monst *shkp = shop_keeper(*in_rooms(u.ux, u.uy, SHOPBASE));
                          ^
apply.c:1650:31: warning: unused variable 'shkp' [-Wunused-variable]
                struct monst *shkp = shop_keeper(*in_rooms(u.ux, u.uy, SHOPBASE));
                              ^
apply.c:1697:23: warning: unused variable 'shkp' [-Wunused-variable]
        struct monst *shkp = shop_keeper(*in_rooms(u.ux, u.uy, SHOPBASE));
                      ^
apply.c:2157:31: warning: unused variable 'shkp' [-Wunused-variable]
                struct monst *shkp = shop_keeper(*in_rooms(u.ux, u.uy, SHOPBASE));
                              ^
apply.c:2165:31: warning: unused variable 'shkp' [-Wunused-variable]
                struct monst *shkp = shop_keeper(*in_rooms(corpse->ox,
2023-02-08 12:44:14 -05:00
nhmall 6cc35abba3 follow-up - Change the terminology in mO menu 2023-02-08 00:06:56 -05:00
nhmall 08404ddac3 Options menu should indicate unavailability of voices
If SND_SPEECH is not defined (such as via Makefile WANT_SPEECH=1),
indicate so on the options menu.
2023-02-07 23:41:12 -05:00
nhmall dbc148342b try work-around for Guidebook.txt nroff ver diffs 2023-02-07 21:40:36 -05:00
nhmall ed83be4b26 update GB 2023-02-07 14:38:07 -05:00
nhmall 2c89196627 fix macsound build error with certain combo of preprocess defines 2023-02-07 01:09:08 -05:00
nhmall fbd9a7bae8 another update to the soundlib interface
sound_verbal(char *text, int32_t gender, int32_t tone, int32_t vol,
             int32_t moreinfo);
    -- NetHack will call this function when it wants to pass text of
       spoken language by a character or creature within the game.
    -- text is a transcript of what has been spoken.
    -- gender indicates MALE or FEMALE sounding voice.
    -- tone indicates the tone of the voice.
    -- vol is the volume (1% - 100%) for the sound.
    -- moreinfo is used to provide additional information to the soundlib.
    -- there may be some accessibility uses for this function.

It may be useful for accessibility purposes too.

A preliminary implementation has been attempted for macsound to test
the interface on macOS. No tinkering of the voices has been done.

Use of the test implementation requires the following at build time with make.
    WANT_SPEECH=1
That needs to be included on the make command line to enable the test code,
otherwise just the interface update is compiled in.

I don't know for certain when AVSpeechSynthesizer went into macOS, but older versions
likely don't support it, and would just leave off the WANT_SPEECH=1.

If built with WANT_SPEECH=1, the 'voices' NetHack option needs to be enabled.

It was a bit strange, when I first started up the test, to hear Asidonhopo,
the shopkeeper, talking to me as I entered his shop and interacted with him.
2023-02-07 00:44:36 -05:00
nhmall 20c6e1b6e6 macsound: 2 params are UNUSED always 2023-02-05 11:53:19 -05:00
nhmall f6b135f3e1 fixes3-7-0.txt update 2023-02-05 11:45:05 -05:00
nhmall 47c44e4907 typo fix in macsound.m 2023-02-05 11:41:59 -05:00
nhmall 43af05a6b8 Unchanging and improvisations
Adds a reveal.

Increments EDITLEVEL.
2023-02-05 11:32:58 -05:00
nhmall 5034f7f936 update macsound to support 'volume' interface parameter 2023-02-05 11:32:12 -05:00
nhmall d14ed8b9de enable achievement sounds in macsound
Requires rebuild of your Makefiles via hints file (for new stock wav additions).

If you've been testing by copying the wav files manually to
~/Library/Sounds, you'll need to copy them again to pick up
the additional wav files.
2023-02-04 15:37:17 -05:00
nhmall 36ca64acdb start to add some SOUND_TRIGGER_ACHIEVEMENTS code
Start to add supporting code to windsound and macsound. The latter
remains commented out because I haven't had a chance to try
it on macOS yet.

In order to test it out, I added two more stock sounds:
sa2_xplevelup and sa2_xpleveldown.
2023-02-04 14:28:59 -05:00
nhmall 17aeee27a5 Guidebook update 2023-02-04 08:52:47 -05:00
nhmall 72bae29bc0 Guidebook update 2023-02-03 16:50:38 -05:00
nhmall 0282e0b1fd doc error for .nethackrc location on Windows 2023-02-03 16:48:54 -05:00
nhmall f348deb2bc CI not catching macOS sound-related warning/error
Add WANT_MACSOUND=1 to the build so we get informed of warnings
and errors in any of the macsound-related files.
2023-02-03 15:33:47 -05:00
nhmall 9d3dda1e1d mac typo and some warnings 2023-02-03 15:12:42 -05:00
nhmall a5c7ca1a29 another follow-up: be consistent 2023-02-03 14:43:56 -05:00
nhmall 583848b04c minor wording change 2023-02-03 14:40:58 -05:00
nhmall eda74d1d0d updated fixes3-7-0 with sound entries 2023-02-03 14:39:07 -05:00
nhmall d9a6e581a1 paste error 2023-02-03 14:04:12 -05:00
nhmall 9931d05fc2 follow-up: a couple of documentation errors 2023-02-03 13:40:13 -05:00
nhmall 2acd8e7b29 update soundlib interface
Add SOUND_TRIGGER_AMBIENCE
2023-02-03 13:32:44 -05:00
nhmall b45895c01d correct a predefined preprocessor macro for clang 2023-02-01 14:15:34 -05:00
nhmall 3214335bb5 undefine X11_BUILD after hack.h or config.h
So as not to complicate any onefile efforts by leaving it defined.
2023-02-01 14:04:20 -05:00
nhmall d4a111083a avoid some issues with c++ and X11 2023-02-01 10:41:04 -05:00
nhmall 79d8f95f57 don't make the catch inline 2023-02-01 10:16:22 -05:00
nhmall d90fa596a3 refine detection by compiler version in tradstdc.h 2023-02-01 09:55:41 -05:00
nhmall a5ed0d0363 follow-up 2023-02-01 09:41:35 -05:00
nhmall 14962a5a33 catch use of pre-C99 non-standard functions 2023-02-01 09:22:16 -05:00
nhmall 56d4822f4e prototype was within #ifdef block, function wasn't
Move the prototype in extern.h
2023-01-31 23:05:15 -05:00
nhmall 8ee42f5644 further work on soundlib support code
move some inline code into functions
replace some magic numbers

The mingw code is not tested yet.
2023-01-31 22:19:29 -05:00
nhmall e6012ab658 Only embed wav resources if soundlib defined 2023-01-31 02:22:25 -05:00
nhmall f2dc7f308d missed a reference in a header file 2023-01-31 01:29:23 -05:00
nhmall 20c7a217ba mingw follow-up 2023-01-31 01:13:03 -05:00
nhmall 2c5bbdc0ed fix a naming conflict 2023-01-31 01:10:02 -05:00
nhmall ce0a4f60ca more windows Makefile tinkering
It looks like the Windows API call for PlaySound using SND_RESOURCE, from a
mingw32 built program, cannot find the resources that are
embeded into the .exe by the mingw32 resource compiler. That works fine
from visual studio.

For now, fall back to not using the SND_RESOURCE flag, use an ordinary
wav file name in the filesystem. Makefile.mingw32 has been modified
to copy the wav files to the binary directory along with the exe.

This probably won't be the final approach, but it will get things
working for now.
2023-01-31 00:45:27 -05:00
nhmall a7b8099ecb some Makefile.nmake fixups 2023-01-30 19:24:21 -05:00
nhmall 9bbb2e17cf add a master off/on switch for sounds
sounds can be set in the config file or on the fly with the Options menu.

This also adds a mechanism for specifying a terminology preference
for a boolean option in the options menu.

The choices are: Term_False, Term_Off, Term_Disabled

Term_False, the default, will use the terms "false" and "true" in the
Options menu.
Term_Off will use the terms "off" and "on" in the Options menu.
Term_Disabled will use the terms "disabled" and "enabled" in the Options
menu.

I didn't review any of the existing options to see if one of the new
alternative terms might be a better fit. They were all left at the default.
2023-01-30 12:07:03 -05:00
nhmall c7464e8aa5 purge some never-used fields from iflags 2023-01-30 09:03:47 -05:00
nhmall 8bb1feab61 remove a value used for a test run of nmake 2023-01-29 22:09:54 -05:00
nhmall 6ce2994646 Windows Makefiles easier soundlib opt-in or opt-out 2023-01-29 22:07:31 -05:00
nhmall 86368148bf soundlib in the Makefile hints updated
Move pieces of the Makefile hints sound-related changes that
are not macOS-specific from sys/unix/hints/macOS.370 to some new
include files. The WANT_MACSOUND block stays in
sys/unix/hints/macOS.370 because it is system-specific.

Before this change, the various Makefiles were assembled via
hints files macOS.370 or linux.370. Both were using included
portions from the following files in the sys/unix/hints/include
directory, in this sequence:

    -INCLUDE multiw-1.370
    -INCLUDE multiw-2.370
    -INCLUDE compiler.370
    -INCLUDE multiw-3.370
    -INCLUDE cross-pre.370
    -INCLUDE gbdates-pre.370
    -INCLUDE gbdates-post.370
    -INCLUDE cross-post.370

After this change, the various Makefiles will still be assembled
via hints files macOS.370 or linux.370. They will continue to use
included portions from the following files in the
sys/unix/hints/include directory, but with three additional
include files related to sound and soundlibs. This is the new
sequence:

    -INCLUDE multiw-1.370
    -INCLUDE multiw-2.370
    -INCLUDE compiler.370
    -INCLUDE multiw-3.370
+   -INCLUDE multisnd1-pre.370
    -INCLUDE cross-pre.370
    -INCLUDE gbdates-pre.370
+   -INCLUDE multisnd2-pre.370
    -INCLUDE gbdates-post.370
+   -INCLUDE multisnd-post.370
    -INCLUDE cross-post.370

The include mechanism continues to allow common portions that can
be shared between macOS and Linux to be maintained in a single
place only, with minimal duplication. Now, that has been extended
to include Makefile lines related to sounds and soundlib.
2023-01-28 22:43:48 -05:00
nhmall 4575d564c7 do warning suppression for soundlib vars another way
Instead of introducing a bunch of preprocessor #ifdef blocks,
this approach is less-intrusive.
2023-01-28 14:55:54 -05:00
nhmall 44677e82ab warning fix if no added soundlib compiled in 2023-01-28 09:09:39 -05:00
nhmall f91292b349 cut-and-paste error 2023-01-27 23:58:46 -05:00
nhmall 60f62bc4ef follow-up bit sndprocs.h 2023-01-27 23:56:25 -05:00
nhmall 5b3a8b5774 more Soundeffects tinkering 2023-01-27 23:41:54 -05:00
nhmall 90895330c5 soundlib terminology update - sound_triggers
Switch to using the term "sound triggers" for things that
result in a call to one of the soundlib routines.

SNDCAP_* renamed to SOUND_TRIGGER_*
sndcap field in the sound_procs struct changed to sound_triggers
2023-01-27 22:21:53 -05:00
nhmall 90425082ca counting to 10 2023-01-27 17:01:17 -05:00
nhmall afb4d90989 typo fix 2023-01-27 16:58:45 -05:00
nhmall f57f31335c document doc/sound.txt 2023-01-27 16:48:37 -05:00
nhmall a8ddb61c60 add comment above two sound delivery macros 2023-01-27 10:05:16 -05:00
nhmall 5401983d76 suppress "set but not used" warning if no soundlib 2023-01-27 09:57:54 -05:00
nhmall 42171ca070 paste error 2023-01-27 01:29:09 -05:00
nhmall aee2ff57e8 additional Soundeffect, additional SoundAchievement
Also adds a macro SoundeffectEvenIfDeaf for a couple of proposed
special cases where Deafness shouldn't factor in.
2023-01-27 01:25:05 -05:00
nhmall 219c1155f8 a missing break and an incorrect magic number 2023-01-26 22:39:14 -05:00
nhmall 049b90e25e fix the missing break mentioned in previous commit
... but inadvertently left out of that commit.
2023-01-26 17:38:18 -05:00
nhmall 446044e1d5 1st of a few sequencing changes
rename display_gamewindows() to init_sound_and_display_gamewindows()
(I know that's getting pretty long-named).

move activate_chosen_soundlib() into init_sound_and_display_gamewindows()
from moveloop_preamble().

Also included was a missing break in a switch related to sounds.
2023-01-26 17:15:59 -05:00
nhmall 7ecb1e0757 fix warning
In file included from makedefs.c:180:
./../src/mdlib.c:92:12: warning: unused function 'count_and_validate_soundlibopts' [-Wunused-function]
static int count_and_validate_soundlibopts(void);
           ^
1 warning generated.

Function definition is in the #ifndef MAKEDEFS_C section, so move the prototype there too.
2023-01-26 00:49:11 -05:00
nhmall 4ac30aa2ec list which soundlib support is compiled in 2023-01-26 00:45:32 -05:00
nhmall 021cda2bdd transcription error 2023-01-25 23:10:51 -05:00
nhmall 8e0ed1e69d smooth use of soundlib(s) in Makefile.nmake
Related: also add a preprocesor #if defined(SND_LIB_WINDSOUND) around the
assign_soundlib() call in sys/windows/windmain.c
2023-01-25 23:05:36 -05:00
nhmall b89d2e0ef1 Fix potential warning in music.c
I saw this included in PR966, but it has nothing to do with the
use-after-free that the pull request is meant to fix. It should
get applied independently of that pull request.
2023-01-25 15:21:30 -05:00
nhmall 24c99e005a add a sounds.c comment in two places 2023-01-25 15:14:27 -05:00
nhmall 1b8edf852f more Soundeffects fiddling 2023-01-25 14:23:22 -05:00
nhmall 8bbf9a5b8f add missing entries to visual studio files.props 2023-01-25 09:41:20 -05:00
nhmall e861adecbd cron Files update 2023-01-25 08:23:10 -05:00
nhmall a48e32a1f9 add missing Magic_Flute files 2023-01-25 01:16:08 -05:00
nhmall 8fe423d65d Merge branch 'fix-makefile' of https://github.com/argrath/NetHack into NetHack-3.7 2023-01-24 14:44:16 -05:00