Commit Graph

2335 Commits

Author SHA1 Message Date
nhmall
e6012ab658 Only embed wav resources if soundlib defined 2023-01-31 02:22:25 -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
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
Pasi Kallinen
777f53c212 Add hellfill.lua to VMS install 2023-01-27 19:48:13 +02: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
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
8bbf9a5b8f add missing entries to visual studio files.props 2023-01-25 09:41:20 -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
SHIRAKATA Kentaro
06615b6e9e substitute non-ASCII chararacters in Makefile.nmake 2023-01-25 04:09:02 +09:00
nhmall
5171fcdc1d some macsound instrument play refinements
Also some better core placement of some of the Hero_playnotes calls.
2023-01-24 13:02:29 -05:00
nhmall
3f87ce3539 issue with an added comment 2023-01-24 00:25:09 -05:00
nhmall
3d908c49ef take initial stab at macsound interface
Use macOS AppKit framework routines for a first cut at a
macsound soundlib interface.

Requires WANT_MACSOUND=1 on build.

Nothing has been done to move the stock sounds into the resources
of a bundle, so after building, if you want to try the stock sounds
out:
	cp sound/wav/*.wav ~/Library/Sounds

Because the NSSound macOS routines always do the search, supposedly
the following locations are searched in this order:
   1. the application’s main bundle
   2. ~/Library/Sounds
   3. /Library/Sounds
   4. /Network/Library/Sounds
   5. /System/Library/Sounds

Although not specifically implemented as of yet, it may be pretty
close to being able to put soundeffects wav files (by se_ name)
into ~/Library/Sounds working for the SND_SOUNDEFFECTS_AUTOMAP feature.

Feedback is welcome. Contributions for improving it are even more
welcome.

The new soundlib supporting file is named
sound/macsound/macsound.m since it's got objective C in it.

Known bugs and glitches:

The Hero_playnotes on a set of 5 notes goes too fast, so there
needs to be a slight delay added between the note of a multi-note
play.
2023-01-23 23:50:43 -05:00
nhmall
ae6bb2420b comment out sample.c inclusion in Makefile.nmake
Makefile.nmake

A sample file that was tested for compilability was left in
the Makefile. Harmless if you have the sample.c in the right
place on your machine. Fatal to the build if you do not.

Resolves #961
2023-01-23 07:42:06 -05:00
nhmall
2da828324f update NetHackW.vcxproj
Still trying to resolve CI build failure.
2023-01-22 18:39:55 -05:00
nhmall
114e627868 Makefile.mingw32 had not been tested
Try to resolve CI build failure
2023-01-22 17:26:03 -05:00
nhmall
83f3b3a587 update vs project 2023-01-22 17:20:19 -05:00
nhmall
e9e62d7ad2 follow-up for today's sound interface changes 2023-01-22 16:44:48 -05:00
nhmall
cb0de5cd8d fix hardcoded relative paths in rc file
Having a hardcoded relative path worked okay with the nmake Makefile
build but cause problems on a visual studio build. The CI caught that
right away.

Remove the relative paths, and add additional include directories for
the resouce compiler to search in the Makefile and in visual studio.
2023-01-22 14:15:11 -05:00
nhmall
5e0fea186c further utilize sound interface - part 2
Expand windsound to support SNDCAP_USERSOUNDS (existing),
SNDCAP_SOUNDEFFECTS, SNDCAP_HEROMUSIC.

Place a small number of wav files into sound/wav that are considered
more specific to some game stuff in the core, namely: playing
instruments by the hero, squeaky board traps. The intention is that
those ones can be integrated into the game without requiring user
file deposits or mappings. Building soundlib support for sound/windsound
searches for them as resources, so they should "just work."

No actual instrument playback is available in the base sound/windsound
soundlib implementation (yet, at least), so it works around that in
a cheap way by using the note-variant wav sounds to concoct the
notes. There are better ways of doing music generation than that,
of course, but this will do in the early going. Any other soundlib
port (such as Qt) can probably easily do the exact same thing. If it
can play USER_SOUNDS, it can almost certainly use the
sound/wav/se_squeak*.wav and sound/wav/sound_*.wav files for
SND_HEROMUSIC and squeaky board sounds soundeffects.

A few of the se_ sounds in sound/wav are free yet licensed, and
there is a file called attributions.txt to meticulously attempt
to comply with the two license variations involved.

SND_SOUNDEFFECTS_AUTOMAP

If SND_SOUNDEFFECTS_AUTOMAP is defined, and a SND_LIB_ interface
that supports SNDPROC_SOUNDEFFECTS is also defined to integrate
soundlib support, the following gets added:

  o If sounddir is defined (existing longstanding feature that's
    been used with USER_SOUNDS for many, many years) any wav file
    present in SOUNDDIR with a name that matches one of the defined
    sound effects in include/sndproc.h will get played each time
    that soundeffect comes up. So, just drop appropriate wav files
    into sounddir and rename it to match.

    No tedious config file entries are required to get soundeffects.

    [ The only config file change required is to
      set SOUNDDIR to point to your directory with the wav files.
      Note: SOUNDDIR only works in your config file if NetHack
      was built with USER_SOUNDS defined. ]

    This is new so there may certainly be some bugs in here.
    Please kindly report them if you encounter any.

    For those that don't read C very well, these are the file names
    that should trigger the SOUNDEFFECTS_AUTOMAP, assuming it is working.

        se_faint_splashing.wav
        se_crackling_of_hellfire.wav
        se_heart_beat.wav
        se_typing_noise.wav
        se_hollow_sound.wav
        se_rustling_paper.wav
        se_crushing_sound.wav
        se_splash.wav
        se_chains_rattling_gears_turning.wav
        se_smashing_and_crushing.wav
        se_gears_turning_chains_rattling.wav
        se_loud_splash.wav
        se_lound_crash.wav
        se_crashing_rock.wav
        se_sizzling.wav
        se_crashing_boulder.wav
        se_boulder_drop.wav
        se_item_tumble_downwards.wav
        se_drain_noises.wav
        se_ring_in_drain.wav
        se_groans_and_moans.wav
        se_scratching.wav
        se_glass_shattering.wav
        se_egg_cracking.wav
        se_gushing_sound.wav
        se_glass_crashing.wav
        se_egg_splatting.wav
        se_sinister_laughter.wav
        se_blast.wav
        se_stone_breaking.wav
        se_stone_crumbling.wav
        se_snakes_hissing.wav
        se_loud_pop.wav
        se_clanking_pipe.wav
        se_sewer_song.wav
        se_monster_behind_boulder.wav
        se_wailing_of_the_banshee.wav
        se_swoosh.wav
        se_explosion.wav
        se_crashing_sound.wav
        se_someone_summoning.wav
        se_rushing_wind_noise.wav
        se_splat_from_engulf.wav
        se_faint_sloshing.wav
        se_crunching_sound.wav
        se_slurping_sound.wav
        se_masticating_sound.wav
        se_distant_thunder.wav
        se_applause.wav
        se_shrill_whistle.wav
        se_someone_yells.wav
        se_door_unlock_and_open.wav
        se_door_open.wav
        se_door_crash_open.wav
        se_dry_throat_rattle.wav
        se_cough.wav
        se_angry_snakes.wav
        se_zap_then_explosion.wav
        se_zap.wav
        se_horn_being_played.wav
        se_mon_chugging_potion.wav
        se_bugle_playing_reveille.wav
        se_crash_through_floor.wav
        se_thump.wav
        se_scream.wav
        se_tumbler_click.wav
        se_gear_turn.wav
        se_divine_music.wav
        se_thunderclap.wav
        se_sad_wailing.wav
        se_maniacal_laughter.wav
        se_rumbling_of_earth.wav
        se_clanging_sound.wav
        se_mutter_imprecations.wav
        se_mutter_incantation.wav
        se_angry_voice.wav
        se_sceptor_pounding.wav
        se_courtly_conversation.wav
        se_low_buzzing.wav
        se_angry_drone.wav
        se_bees.wav
        se_someone_searching.wav
        se_guards_footsteps.wav
        se_faint_chime.wav
        se_loud_click.wav
        se_soft_click.wav
        se_squeak.wav
        se_squeak_C.wav
        se_squeak_D_flat.wav
        se_squeak_D.wav
        se_squeak_E_flat.wav
        se_squeak_E.wav
        se_squeak_F.wav
        se_squeak_F_sharp.wav
        se_squeak_G.wav
        se_squeak_G_sharp.wav
        se_squeak_A.wav
        se_squeak_B_flat.wav
        se_squeak_B.wav
        se_someone_bowling.wav
        se_rumbling.wav
        se_loud_crash.wav
        se_deafening_roar_atmospheric.wav
        se_low_hum.wav
        se_laughter.wav
        se_cockatrice_hiss.wav
        se_chant.wav
        se_cracking_sound.wav
        se_ripping_sound.wav
        se_thud.wav
        se_clank.wav
        se_crumbling_sound.wav
        se_soft_crackling.wav
        se_crackling.wav
        se_sharp_crack.wav
        se_wall_of_force.wav
        se_alarm.wav
        se_kick_door_it_shatters.wav
        se_kick_door_it_crashes_open.wav
        se_bubble_rising.wav
        se_bolt_of_lightning.wav
        se_board_squeak.wav
        se_board_squeaks_loudly.wav
        se_boing.wav
        se_crashed_ceiling.wav
        se_clash.wav
        se_crash_door.wav
        se_crash.wav
        se_crash_throne_destroyed.wav
        se_crash_something_broke.wav
        se_kadoom_boulder_falls_in.wav
        se_klunk_pipe.wav
        se_kerplunk_boulder_gone.wav
        se_klunk.wav
        se_klick.wav
        se_kaboom_door_explodes.wav
        se_kaboom_boom_boom.wav
        se_kaablamm_of_mine.wav
        se_kaboom.wav
        se_splat_egg.wav
        se_destroy_web.wav
        se_iron_ball_dragging_you.wav
        se_iron_ball_hits_you.wav
        se_lid_slams_open_falls_shut.wav
        se_chain_shatters.wav
        se_furious_bubbling.wav
        se_air_crackles.wav
        se_potion_crash_and_break.wav
        se_hiss.wav
        se_growl.wav
        se_canine_bark.wav
        se_canine_growl.wav
        se_canine_whine.wav
        se_canine_yip.wav
        se_canine_howl.wav
        se_feline_yowl.wav
        se_feline_meow.wav
        se_feline_purr.wav
        se_feline_yip.wav
        se_feline_mew.wav
        se_roar.wav
        se_snarl.wav
        se_buzz.wav
        se_squeek.wav
        se_squawk.wav
        se_squeal.wav
        se_screech.wav
        se_equine_neigh.wav
        se_equine_whinny.wav
        se_equine_whicker.wav
        se_bovine_moo.wav
        se_bovine_bellow.wav
        se_wail.wav
        se_groan.wav
        se_grunt.wav
        se_gurgle.wav
        se_elephant_trumpet.wav
        se_snake_rattle.wav
        se_hallu_growl.wav

This needs further testing. At the moment only windsound has
this.

If nobody else looks into it for Qt, I'll take a look in a
few days.
2023-01-22 13:29:44 -05:00
nhmall
76b569cae0 update visual studio dirs.props with new directory 2023-01-19 20:09:39 -05:00
nhmall
54a9b72e35 another update to visual studio project files 2023-01-19 19:48:55 -05:00
nhmall
897d58655d update visual studio project files 2023-01-19 19:44:25 -05:00
nhmall
3c7aad898f follow-up for windows build based on CI results 2023-01-19 19:26:23 -05:00
nhmall
3294d760a2 remove obsolete file sys/windows/ntsound.c 2023-01-19 19:13:55 -05:00
nhmall
ea4a81901d add an interface for sound libraries
Groundwork for a more versatile interface for using
sound libraries. A lot of sound libraries work across
multiple platforms.

The current NetHack sound stuff is quite limited.

Binaries can have a variety of window ports linked into
them, and it makes sense to have something similar for
sound.

This tries to set things up in a more soundlib-centric way,
rather than inserting things in a platform-centric way.

It establishes a new top-level directory sound (akin to win
for the window interface routines, or "window-port") where
sound-related additions and sndprocs and support files can be
added and used across platforms.

The default interface is nosound and the 'nosound' interface
is in src/sounds.c

The interface for 'windsound', which contains the same minimal
USER_SOUNDS support using built-in routines that has been in the
windows port for a long time is added to
sound/windsound/windsound.c.

For now, the sound interface support for 'qtsound' has been added
to the existing Qt files win/Qt/qt_bind.h and win/Qt/qt_bind.cpp,
and a note has been placed in sound/qtsound/README.md to avoid
confusion.

New header file added: include/sndprocs.h.
2023-01-19 18:51:42 -05:00
nhmall
5c4ae701b3 visual studio package settings 2023-01-17 21:07:45 -05:00
nhmall
ba5356603a yn()
A number of C compiler suites have a math.h library that includes a yn()
function name that conflicts with NetHack's yn() macro:
"The y0(), y1(), and yn() functions are Bessel functions of the second kind,
for orders 0, 1, and n, respectively. The argument x must be positive. The
argument n should be greater than or equal to zero. If n is less than zero,
there will be a negative exponent in the result."

At one point, isaac64.h included math.h, although that has since been removed.

Some libraries used in NetHack (Qt for one) do include math.h and that required
build work-arounds to avoid the conflict.

Rename the NetHack macro from yn() to y_n() and avoid the math.h conflict
altogether, eliminating the need for that particular work-around.
2023-01-12 16:04:40 -05:00
nhmall
6e136c6f7d more ATTNORETURN
A recent commit to alloc.c by Keni drew attention to the fact that
there are extern prototypes scattered around in various .c files.
Those can make use of ATTRNORETURN (non-gcc compilers and C23) the
same way the prototypes in extern.h can, and they were overlooked
when ATTRNORETURN was first added.
2023-01-12 15:38:15 -05:00
Pasi Kallinen
4af086be73 More interesting Gehennom levels
Instead of just plain old boring mazes, spice up Gehennom by
occasionally adding lava, iron bars, or even mines-style levels
(with lava, of course).

Of the fixed Gehennom levels, only Asmodeus' lair has been changed
to add some random lava pools.

Also some lua fixes and changes:
- Fixed a selection negation bounding box being wrong.
- Fixed a selection negated and ORed returning wrong results.
- des.map now returns a selection of the map grids it touched.
- When using des.map contents-function the commands following the
  map are not relative to it.
2023-01-10 12:20:21 +02:00
Pasi Kallinen
030fc0036a Remove NO_VSNPRINTF
Affects only ancient VMS where vsnprintf wasn't available.
2023-01-06 15:53:06 +02: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
995fae39b5 spurious warning with visual studio 2017
Don't force on a particular warning in the nmake Makefile if
compiling using the older visual studio 2017.

Resolves #950
2022-12-15 08:39:30 -05:00
nhmall
9dbb21cfcb update tested versions of Visual Studio 2022-12-14 2022-12-14 14:33:36 -05:00
Ray Chason
51ec42886e Fix -dumpglyphids on Unix
The order of the statements needs to be changed, so the -d is not
interpreted as requesting a directory.
2022-12-10 12:25:55 -05:00
nhmall
873d08b7bc fix Makefile rule when building pdcurses library
Also, use Bill Gray's pdcursesmod for now.
2022-12-07 21:23:14 -05:00
nhmall
f61a862a47 paste error in Makefile.mingw32 2022-12-06 11:00:29 -05:00
nhmall
215808abd1 clear up a few gcc warnings 2022-12-05 23:19:38 -05:00
nhmall
afef4bc781 issue with mingw resolved; resume mingw build in CI 2022-12-05 19:03:11 -05:00
nhmall
693e708228 yet another follow-up after CI report 2022-12-05 14:12:36 -05:00
nhmall
6d19d8ff1c another mingw follow-up after CI report 2022-12-05 14:07:33 -05:00
nhmall
883e4cbadd another mingw Makefile follow-up 2022-12-05 14:00:22 -05:00
nhmall
64f060bfa9 mingw Makefile updates 2022-12-05 13:54:09 -05:00
nhmall
485797ee8c rework windows nmake file
Keep object files separate between gui and tty builds as they
are not the same binary on windows.

The stubs.c file will no longer be necessary.
2022-12-05 13:21:19 -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