Commit graph

45 commits

Author SHA1 Message Date
Matthew Duggan
62e02ca0da DGDS: Unload music file before loading game
This makes sure no matter which scene is loaded the music will be loaded fresh
and restarted.

Skip in Willy Beamish where there is only one music file that stays loaded.

This fixes #15795.
2025-03-15 15:18:48 +11:00
Filippos Karapetis
d8eb52a2cb DGDS: Clean up includes 2025-03-10 18:53:20 +02:00
Matthew Duggan
b4fcc999b1 DGDS: Don't change music if id is the same 2025-03-02 19:52:27 +11:00
Matthew Duggan
5299435d7d DGDS: Set higher priority on music than sfx
It was possible for music to stop when multiple sound effects were played at
once (eg, Willy Beamish FDD intro sequence when SFX 43 and 44 are played in
quick succession).  This is a workaround for that issue.
2025-03-02 08:02:31 +11:00
Matthew Duggan
e26387ce5f DGDS: Improve Willy Beamish CD head animation 2025-03-02 08:02:31 +11:00
Matthew Duggan
4798df4598 DGDS: Small willy beamish sound fixes 2025-03-02 08:02:31 +11:00
Matthew Duggan
fa6e3caa96 DGDS: Sync volume state from menu properly with music player
Pause the music if it's turned off.

Also update midi driver loops to C++11 style for cleaner code.
2025-01-26 17:22:30 +11:00
Matthew Duggan
93829050df DGDS: Partially fix Willy Beamish inventory and main menu 2024-11-19 21:01:41 +11:00
Filippos Karapetis
94403bd3a9 DGDS: Raise debuglevel of all debug statements to at least 1
This reduces the chatty debug output, which isn't of any use to
regular users
2024-11-16 18:44:46 +02:00
Filippos Karapetis
aa679e4a87 DGDS: Fix another shadowed variable warning 2024-11-08 12:16:18 +02:00
Matthew Duggan
b7bea1c927 DGDS: Fix variable shadowing 2024-11-08 20:59:54 +11:00
Matthew Duggan
6024205bce DGDS: Fix Willy Beamish sound and music a bit
Willy beamish tries to load various music files, but actually all the music is
inside the single file.  Both sound and music are SX files so we needed a
slight refactor to support them.
2024-11-08 20:03:48 +11:00
Filippos Karapetis
f179fe662b DGDS: Delete the music driver on shutdown 2024-11-07 22:42:27 +02:00
Matthew Duggan
ef4b64f0ac DGDS: Reduce logging verbosity a bit 2024-11-07 09:35:01 +11:00
Matthew Duggan
e4b4b67bc6 DGDS: Initialize _channels and assume new will succeed or throw. PVS-Studio V730, V668 2024-10-29 17:51:59 +11:00
Matthew Duggan
36b18fff17 DGDS: Fix some coverity warnings 2024-10-27 20:50:06 +11:00
Matthew Duggan
8291d75dca DGDS: Small midi fixes for looping
Thanks again to @NMIError for finding the cause of looping issues in dragon.

With these fixes the sounds are now really close to the original.
2024-10-21 15:27:16 +11:00
Matthew Duggan
9a35861c13 DGDS: Don't stop music if new one is the same 2024-10-21 15:27:15 +11:00
Matthew Duggan
aaa48d45d4 DGDS: Read and use sfx/music loop flag 2024-10-21 15:27:15 +11:00
Matthew Duggan
40f7744f37 DGDS: Fix SFX mapping in RoTD and HoC
Rise of the Dragon uses a fixed offset on SFX ids.  HoC seems to do the same
although I haven't fully reverse-engineered that bit.

Thanks to @NMIError for the help debugging this issue.
2024-10-21 15:27:15 +11:00
Matthew Duggan
d51aa872b6 DGDS: Integrate SCI midi player code
DGDS basically uses the same midi and patch code as SCI.  This change copies
the midi driver out of SCI.  It now mostly works, but there is still an
instrument mismatch to fix out with SFX.
2024-10-21 15:27:15 +11:00
Matthew Duggan
87418c61f2 DGDS: Fix sound and scrolling partly in Willy Beamish intro 2024-10-04 15:54:32 +10:00
Matthew Duggan
342d8ab1c8 DGDS: Fix int overflow warning 2024-08-04 09:17:05 +10:00
Hubert Maier
ef3b6c5fbb
JANITORIAL: DGDS: Fix typos in comments/warnings 2024-08-01 20:16:37 +03:00
Matthew Duggan
f4d1345cc3 DGDS: Add RAW sound file support
This is a really simple sound format, only seems to be used in the Willy
Beamish CD version intro.
2024-07-29 09:14:53 +10:00
Filippos Karapetis
494ec37f20 DGDS: Disable multiple MIDI player instances for music + SFX
Simultaneous MIDI players aren't supported by the backend.
MIDI sound effects are deactivated for now, till this
functionality is implemented properly with a single instance
2024-07-05 10:22:22 +03:00
Matthew Duggan
b2fa3fea3b DGDS: Update to GPL3 to match the rest of ScummVM 2024-07-02 09:59:59 +10:00
Matthew Duggan
5f63c5b1af DGDS: Fix parsing for Willy Beamish
The game now starts to play the intro.  Still a few new unknown values in the
various structures.
2024-06-30 22:49:18 +03:00
Matthew Duggan
57e272d9b6 DGDS: Clean up sound and music a bit
Allow midi sounds and music to play at the same time.

Still some bug with sfx not finishing correctly, but better than before.
2024-06-30 22:49:18 +03:00
Matthew Duggan
dddb5097cf DGDS: Add sq5 demo detection 2024-06-30 22:49:18 +03:00
Matthew Duggan
3c091686ed DGDS: Fix more rendering and execution issues 2024-06-30 22:49:18 +03:00
Matthew Duggan
be29343c7c DGDS: Add sfx as a separate thing from music 2024-06-30 22:49:18 +03:00
Matthew Duggan
7bd0be7a71 DGDS: More work on ADS and TTM 2024-06-30 22:49:18 +03:00
Matthew Duggan
c72cca34e3 DGDS: ADS and TTM implementation
* Rename TTM objects to match original ideas of environment and sequence
* Implement more ADS stuff in line with original - states etc
* Implement sceneop 4 which changes ADS states

Currently this breaks everything (no scenes execute) but the implementation is
far closer to the original, so it's a necessary step to get to a correct
reimplementation.
2024-06-30 22:49:18 +03:00
Filippos Karapetis
925290ff9e DGDS: Silence some noisy debug console output
This helps to read the running script output a bit better
2024-06-30 22:49:18 +03:00
Filippos Karapetis
fea0a4ac92 DGDS: Remove superfluous variables and fix Mac music resource ID 2024-06-30 22:49:18 +03:00
Matthew Duggan
6f1df860d9 DGDS: Fix decompressor usage 2024-06-30 22:49:18 +03:00
Matthew Duggan
b13a34d7a0 DGDS: Add REQ file parsing and refactor parsing a bit overall 2024-06-30 22:49:18 +03:00
Filippos Karapetis
596de66e98 DGDS: Move Mac music handling inside the Sound class
Also, remove the now obsolete loadAmigaAiff() function
2024-06-30 22:49:18 +03:00
Filippos Karapetis
53386d6d54 DGDS: Moved Amiga SFX handling into Sound::playAmigaSfx() 2024-06-30 22:49:18 +03:00
Filippos Karapetis
2556312d63 DGDS: Move sound resource loading inside the Sound class 2024-06-30 22:49:18 +03:00
Filippos Karapetis
bff77cfe47 DGDS: Move music player out of DgdsEngine 2024-06-30 22:49:18 +03:00
Filippos Karapetis
0e863e7640 DGDS: Start splitting the sound code into a separate class 2024-06-30 22:49:18 +03:00
Matthew Duggan
b813fbd719 DGDS: Refactors and cleanups to remove globals. 2024-06-30 22:49:18 +03:00
Filippos Karapetis
3845931407 DGDS: Initial import
This is the initial import of the sources from vcosta's implementation.
Work has progressed on that base, so that it forms into an actual engine.
There has been heavy refactoring into classes, but there's still loads of
work to be done.

The status is almost the same the original vcosta's engine: it's possible
to play the intro Rise of the Dragon, and parts of the intro of Heart of
China and Willy Beamish. The DOS VQT images are still not decoded, so only
the Mac versions work for now - or the DOS versions with the Mac images
as patches
2024-06-30 22:49:18 +03:00