Commit graph

276 commits

Author SHA1 Message Date
Torbjörn Andersson
e96f022cfd SCUMM: Fix audio pops at the end of Sega CD MI1 (bug #15369)
A error in how the size of the audio data was calculated meant that the
last eight bytes were never decrypted. As far as I can tell, this bug
was there for more than twenty years! Other than the encryption, the
sound resources appear to be identical to the VGA CD ones.
2025-02-20 19:40:26 +01:00
Filippos Karapetis
111e7efd9e SCUMM: Initial skeleton code for MI1SE/MI2SE ambience tracks 2025-01-30 11:13:12 +02:00
Filippos Karapetis
fe16ca9bd9 SCUMM: Simplify audio CD handling code 2025-01-30 11:13:11 +02:00
Orgad Shaneh
b6ef265b20 SCUMM: Simplify condition a bit 2025-01-21 23:00:47 +02:00
Filippos Karapetis
b390f9fc14 SCUMM: Fix whitespace 2025-01-11 00:40:28 +02:00
Filippos Karapetis
71361f28ef SCUMM: Fix injected SE SFX in MI2 2025-01-11 00:36:27 +02:00
Filippos Karapetis
647c853e1f SCUMM: Hook SE effects for MI1SE and MI2SE 2025-01-10 20:59:29 +02:00
Filippos Karapetis
4078d29fb7 SCUMM: Don't initialize the SE sound engine for MM
There aren't any associated SE sounds in the PAK file
2025-01-09 11:54:29 +02:00
Filippos Karapetis
2fbf32bfd3 SCUMM: Merge duplicate SE audio code. Some cleanup 2025-01-08 11:56:23 +02:00
Filippos Karapetis
05cae5caf4 SCUMM: More cleanup and fixes for the MI1SE audio code 2025-01-07 03:38:03 +02:00
BLooperZ
962dbe546a SCUMM: Fix DOTT Remastered offsets 2024-12-31 00:16:44 +02:00
AndywinXp
bc8e3b5280 SCUMM: MI1SE: Implement speech playback
What is now missing is the delay time between phrases.
Some of the code will be refactored, since this was
hacked in for mantaining compatibility with stuff outside
of MI1:SE.
2024-12-29 22:05:02 +01:00
AndywinXp
92d487bfd8 SCUMM: MI1SE: Implement speech entry matching code from disasm 2024-12-29 14:28:34 +01:00
Filippos Karapetis
e859f4118c SCUMM: More work on the MI1 and MI2 remastered speech
- Injected the audio code in the correct place (displayDialog), from
  disasm provided by @AndyWinXP (thanks!)
- Added support for multiple speech files for the same message
- Added game flag to MI1SE, for using remastered audio
2024-12-25 13:45:44 +02:00
Filippos Karapetis
510b973749 SCUMM: Initial work for injecting SE speech in classic MI1 and 2
TODOs:
- Correctly calculate the local script offset for all scripts
e.g. object scripts, such as Elaine's poster in the second screen)
- Handle multiple speech files for the same message
- Add handling for speech delay
2024-12-24 11:36:12 +02:00
Filippos Karapetis
1c50d0abd6 SCUMM: Split the CD audio functionality into a separate sound class
This helps to cleanly separate the CD audio logic from the main digital
audio functionality
2024-12-23 02:36:06 +02:00
Filippos Karapetis
277487dc7e SCUMM: Add support for the remastered speech and SFX of DOTT Remastered 2024-12-22 10:15:43 +02:00
Filippos Karapetis
75a89a0e51 SCUMM: Handle the FMOD FSB audio files used in DOTT SE and FT SE 2024-12-21 18:55:19 +02:00
Filippos Karapetis
13a3eca146 SCUMM: Encapsulate the new Doublefine SE sound code in a separate class
Also, change the Loom CDDA class so that it instantiates the CD audio
stream internally, to streamline and simplify the code in the Sound
class
2024-12-20 13:20:51 +02:00
Filippos Karapetis
f8a532cfd7 SCUMM: Fix DoubleFine XWB PCM and ADPCM streams. Some cleanup
Now, speech and SFX in MI1SE and MI2SE, which use PCM and ADPCM, are
handled correctly. WMA audio is still not handled.
2024-12-20 13:20:51 +02:00
Filippos Karapetis
90091e3afb SCUMM: Initial support for XWB audio containers for DoubleFine MI1+MI2
All the functionality is hooked in the same manner as the Loom Steam
CD audio code. It's still disabled though, since WMA decoding isn't
implemented yet.

There are three known audio formats in MI1 SE and MI2 SE:
- PCM (tested and working)
- WMA (missing implementation)
- MP3 (currently crashes)
2024-12-20 13:20:51 +02:00
Filippos Karapetis
0cbba7c029 SCUMM: Some renaming for the Loom CD related code
No functional changes. This will be reused for the DoubleFine MI1 CD
audio functionality
2024-12-20 13:20:51 +02:00
Filippos Karapetis
a318189cf6 SCUMM: Simplify instantiation of the Doublefine file handler
Add a game flag for Doublefine packed games, and simplify
the instantiation of the PAK file handler. This avoids
clashes with other packed games (e.g. the Mac version of DOTT)
2024-12-20 13:20:51 +02:00
Filippos Karapetis
e9400af000 SCUMM: Hook up the new PAK file handler in the sound code
We need to cache the location of monster.sou, otherwise we'll end up
reindexing the PAK file on every speech sound.

With this, the classic version of DOTT found in the remaster works
2024-12-20 13:20:51 +02:00
athrxx
673e338135 SCUMM: (IMS/Mac) - prevent playback of ADL resources
This sometimes happens in MI2 and causes weird sounds. The original
would be unable to play that, since the sound tags are strictly tied to
the drivers and no driver will ever eat anything but its own data type.
But our resource maangement works differently, so it could happen...
2024-11-23 23:07:33 +01:00
athrxx
ae86ea42e8 SCUMM: (IMS/Mac) - replace sound driver with more accurate version
The quality improvement seems to be rather subtle. But at least we now
have the quality slider and some fixed sound effects.
2024-11-23 23:07:25 +01:00
Torbjörn Andersson
4266bea787 SCUMM: Remove _numSounds check from isSoundInUse()
Keeping the check, while consistent with the default implementation of
isSoundRunning(), would in fact break HE games. They have their own
implementation of isSoundRunning(), while isSoundInUse() is used by all.
2024-11-08 19:33:42 +01:00
Torbjörn Andersson
58c2667c1e SCUMM: Prevent expiration of music while it's playing
This brings isSoundInUse() and isSoundRunning() closer to each other,
while still maintaining the documented differences. It seems to fix a
problem I had where the "follow the shopkeeper" music in the Mac version
of Monkey Island 1 expired when reaching the island overhead map,
causing the music to be be replaced with the regular overhead map theme.
2024-11-08 19:33:42 +01:00
Hubert Maier
370064f93f JANITORIAL: SCUMM: Fix typos 2024-09-16 01:55:26 +03:00
Donovan Watteau
7cb47c31f8 SCUMM: Add/update some enhancementEnabled() calls for some workarounds
I reviewed what I was comfortable with; this change is not complete
(and I didn't review the HE workarounds at all), but it's still an
improvement.

I may need to update the Enhancement page on the wiki with these
changes...
2024-08-29 22:12:10 +02:00
AndywinXp
5bbd7aaaac SCUMM: IMUSE: Implement music volume reduction during speech
Algorithm taken from SAMNMAX disassembly.

INDY4 and DOTT share another earlier algorithm, but I couldn't
understand the code enough to know if the resulting effect
is different or not.
2024-08-27 11:49:41 +02:00
athrxx
41f11b8da9 SCUMM: fix/silence various coverity warnings 2024-03-11 20:44:18 +01:00
AndywinXp
5df5d1089a SCUMM: HE: Disable speech timer code
It's not in any HE executable, and it caused bad memory accesses...
2024-03-10 09:29:05 +01:00
athrxx
78433d5085 SCUMM: (MI1/Mac) - extend new sound player to support MI1 2024-03-07 22:30:18 +01:00
athrxx
bb75c87df4 SCUMM: (INDY3/MAC) - add dedicated sound player
(no support for low quality music yet)
2024-01-28 16:59:26 +01:00
Le Philousophe
17f09bb48c SCUMM: Migrate engine to Path 2023-12-24 13:19:25 +01:00
AndywinXp
8461f25218 SCUMM: Rename enhancementClassActive to enhancementEnabled 2023-11-08 11:46:06 +01:00
AndywinXp
d5fa7aeb90 SCUMM: Mark all enhancements with their respective classes 2023-11-08 11:46:06 +01:00
Torbjörn Andersson
1f1a013549 SCUMM: Change heuristic for identifying Indy 3 Mac sound (bug #14663)
Instead of trying to identify it by looking for a value expected to be
the same for all sound effects (which turns out to not be as reliable as
hoped), look for a value that appears to be the same in all music.

This fixes a missing sound effect when pouring liquids, e.g. when
filling the beer stein in the castle Brunwald kitchen, or pouring liquid
on the Venice catacomb torch to loosen it.
2023-11-05 22:10:52 +01:00
AndywinXp
815e280da4 SCUMM: HE (Sound): Implement software mixer for all the other games
Sound now appears to play correctly for all HE games.
2023-08-18 22:20:45 +02:00
AndywinXp
a18e86d077 SCUMM: HE (Sound): Fix clicking sound at the end of wav files 2023-08-18 22:20:45 +02:00
AndywinXp
44ae88f230 SCUMM: HE (Sound): Implement most audio engine functions
Also, added some mixer stub functions
2023-08-18 22:20:45 +02:00
AndywinXp
736a2a2621 SCUMM: HE (Sound): Implement RIFF format handling 2023-08-18 22:20:45 +02:00
AndywinXp
f2d409c3a8 SCUMM: HE (Sound): Implement some resource loading routines 2023-08-18 22:20:45 +02:00
AndywinXp
f4455e773e SCUMM: Relabel part of the general sound code
Albeit not 100% necessary for rewriting the HE sound engine,
I decided to make this change in order to:
- Give proper meaning to magic numbers and variables
  which were given temporary names 20 years ago;
- Avoid going insane when making comparison with HE code
  and ours, when rewriting the sound code.
2023-08-18 22:20:45 +02:00
Vladimir Serbinenko
b06893a692 SCUMM: Support extracting resources from macbinary 2023-05-10 22:44:04 +02:00
AndywinXp
8dd19ae10f SCUMM: DIG (demo): Fix voice mode behavior 2023-01-08 23:26:47 +01:00
AndywinXp
c93d460ee2 SCUMM: FT: Fix mouth sync fetching and improve readability 2023-01-01 10:50:46 +01:00
Donovan Watteau
30a1b4867e SCUMM: Fix a couple of sound issues in Indy3 Macintosh (Trac#13887)
If you ring the boxing bell right at the start of the game, you'll see
Indy hit it 3 times, but the actual bell sound will only be heard twice.
This doesn't happen in the original interpreter or in the other releases
where it can be heard 3 times as expected.  Another example is the sound
effect for thunder when Indy is outside the windows of Castle Brunwald;
although it sounds a bit weird this way, the sound is really meant to
have some quick "false starts".

The byte at offset 26 might be responsible for this, in that if it's
unset, the current (identical?) sound is maybe meant to be interrupted.
This is just based on the Indy3 Amiga fixes brought by PR#3598, and
from some naive guesswork. But this change is only applied to Indy3 Mac
and appears to cause no regression (I've done a full gameplay).

Thus, until someone checks this against the original Indy3 Macintosh
interpreter (we have no disasm for it yet), doing this change probably
makes sense for now...

And Andy says I should be more confident about this change :p
2022-12-25 21:17:36 +01:00
athrxx
5704af70a0 SCUMM: fix bug no. 13901
(Monkey 1 EGA / CMS music and sound effects dissapear after loading saved game)

This is at least one obvious bug which I found. For CMS sound the sound resources get invalidated after one use which is only supposed to happen if the resource cannot be loaded.

MI1 also has other issues with CMS sound if the user changes the sound setting between savegames. The savegames are not compatible. But that is a more complex thing to fix and might not be related to the bug ticket.

Also, we might need to restore sounds that were currently playing at the time of saving (but I have to check if the original actually does that for CMS).
2022-10-24 01:17:49 +02:00