Commit Graph
221 Commits
Author SHA1 Message Date
Donovan Watteau 4ec06a2bf6 SCUMM: Unify WORKAROUND usage and complete/tweak some of them 2022-08-07 17:24:27 +02:00
AndywinXp c9c4f8026b SCUMM: COMI: Improve handling of GUI during SMUSH videos
Also, remove prehistoric hack which is now apparently unneeded and
messed with the ability to pause audio during SMUSH cutscenes for the
demo.
2022-08-06 13:33:56 +02:00
AndywinXp 98b2f0a24b SCUMM: MI1 (CD DOS): Implement reloading CD Audio track when loading savegame 2022-07-02 12:39:26 +02:00
Torbjörn Andersson 6a040e3ea2 SCUMM: Add adjustment sliders for VGA Loom (CD) and MI1 (CD)
When ripping the audio tracks from CD, you may not get quite what the
game expects, e.g. my copy of Loom has less silence at the start of the
track than the CDDA.SOU file from the Steam version. And the MI1 intro
appears to be timed with the assumption that there is no silence at all
at the start of that track.

This makes it possible to compensate for that without having to edit the
audio file. It may also be of some help with fan soundtrack replacements
for MI1, though I have little experience with that.
2022-06-03 21:03:58 +02:00
Torbjörn Andersson fbb7459268 SCUMM: Clean up comment a tiny bit 2022-05-28 10:26:47 +02:00
Torbjörn Andersson 31f8db0b64 SCUMM: No longer rely on getMillis() when timing replacement tracks
Now that VAR_TIMER_TOTAL is reliable, use that for timing the Loom
replacement audio tracks instead. This saves us the bother of handling
pausing and things like that.

I think it should work even with older savegames, but at the moment
resuming the track from where it was saved isn't working for me. It
seems to be doing the right ting, but then the track gets restarted.
This may be because of recent changes to Loom save/restore?
2022-05-27 18:28:44 +02:00
AndywinXp 63e2c001bb SCUMM: LOOM: Add the Steam speech fix as an enhancement for the DOS version 2022-05-22 23:57:37 +02:00
AndywinXp 612f453f1b SCUMM: LOOM: Fix game and music timers for the Steam variant 2022-05-22 23:27:40 +02:00
Torbjörn Andersson 4a3e75ce27 SCUMM: Move replacement music timer macros into sound.cpp
They don't work outside of it anyway.
2022-05-22 12:07:21 +02:00
Andrea Boscarino 2d12acec5a SCUMM: Add v7 quirk to IsMouthSyncOff() 2022-05-21 22:44:01 +03:00
Andrea Boscarino f3eee39c9d SCUMM: Properly implement speech timer for v5-7 talkie games 2022-05-21 22:44:01 +03:00
Andrea Boscarino ecdbc25624 SCUMM: Properly reset CD Audio timers 2022-05-21 22:44:01 +03:00
Andrea Boscarino e42ad88690 SCUMM: Implement original CD Audio timing handling 2022-05-21 22:44:01 +03:00
Filippos Karapetis ffc80f1f14 SCUMM: Refactor the workaround for the broken sample in Indy4
This makes the workaround code more self-contained
2022-04-16 14:33:42 +03:00
Filippos Karapetis ec16ebbf96 Revert "SCUMM: Refactor the workaround for the broken sample in Indy4"
This reverts commit c59df76164.
2022-04-16 14:25:51 +03:00
Filippos Karapetis c59df76164 SCUMM: Refactor the workaround for the broken sample in Indy4
This makes the workaround code more self-contained
2022-04-16 14:23:02 +03:00
Donovan Watteau 99393f0bcc SCUMM: Don't restrict the Indy4 MONSTER.SOU workaround to English versions
LucasArts released (at least) an official Japanese version with Japanese
text and English voices; plus, there are some fan-made translations made
for the original English Talkie version.  They appear to use the same
MONSTER.SOU (or INDY4.SOU) file.

So, instead of only applying the Trac#10559 workaround to Common::EN_ANY
releases, accept any (talkie) version, as long as we can find the broken
VOC header at that offset.
2022-04-16 14:20:26 +03:00
Eugene Sandulenko 9a05b364d0 SCUMM: Fix warning when scumm-7-8 is not enabled 2022-04-07 11:12:06 +02:00
Andrea Boscarino fbc989d60f SCUMM: DIG/DiMUSE: Implement mouth sync times retrieval and handling 2022-04-06 21:31:05 +02:00
Torbjörn Andersson cb561f462e SCUMM: Read the "enable_enhancements" setting only once
I can't change during gameplay, it's shorter to type, and we won't
accidentally involve the config manater in some tight loop.
2022-03-23 15:23:10 +01:00
Torbjörn Andersson 4f8653e4f9 SCUMM: Make playing missing Mac MI2 music optional. 2022-03-23 15:23:10 +01:00
Torbjörn Andersson b5a93d9d67 SCUMM: Fix some more bugs with Loom replacement tracks
Don't try to update the _musicTimer in saveLoadWithSerializer(), because
we haven't yet loaded all of the savegame. Instead, do that in a new
restoreAfterLoad() method.

As an extra bonus, if an audio track was playing when the game was
saved, try to resume it from approximately that point.

Unfortunately, it turns out that _currentCDSound was not properly reset
when the song ended so loading a savegame made with an earlier version
of this feature may cause it to play music that it shouldn't. But that's
the kind of thing you should count on on the bleeding edge. Savegames
made after this change should be fine.
2022-03-08 11:19:39 +01:00
Torbjörn Andersson b36347c1e9 SCUMM: Improve Loom Overture timing with replacement music
Before, the music timer was based on the number of SCUMM ticks that had
passed since the track started. But this meant that the timing could
differ by several seconds depending on your hardware.

Now it's instead based on the amount of time that has passed since the
replacement track started playing. Time that passes while the game is
paused does not count. Of course, if the player suspends the process that
time still counts. But the player was clearly asking for it then!

Would it be better to tie it to the current position in the audio track?
Possibly, but the CD audio manager doesn't provide that information.
Even if it did, the timer has to run even if the track ends prematurely,
because we can't just assume that every available recording has the
expected length.

But at least, we now have a well defined unit of measurement: We
hard-code the point in time where the Overture transition should happen
with the Ozawa recording. Ten ticks on the settings slider moves this
point by one second, allowing the user to adjust it by 20 seconds in
each direction. Surely that should be enough?
2022-02-11 12:21:29 +01:00
Torbjörn Andersson c80adc3e8b SCUMM: Add setting for the Loom Overture tempo on the Engine tab
It's hard to make this appear only on EGA Loom, so the tooltip has to
document the fact that it's only useful there. The setting is made
relative to the default tempo, which I feel is a much more sensible way
of presenting it to the user than the raw ticks value.
2022-02-08 13:31:39 +01:00
Torbjörn Andersson c63786022d SCUMM: Another attempt at fixing the Loom Overture timing
I can only conclude that SCUMM ticks aren't accurate enough to match the
original timer, but at least the transition now happens almost at the
same point as with the MT-32 version, when using the Ozawa version of
the music. Maybe this should be configurable, to accommodate for
different recordings?
2022-02-08 13:31:39 +01:00
Torbjörn Andersson 0f61ae7f7a SCUMM: Map Loom demo music to the appropriate replacement tracks. 2022-02-08 13:31:39 +01:00
Torbjörn Andersson 0bd13126b5 SCUMM: Don't loop the Loom replacement audio tracks
I mistakenly thought they should be looped, but after testing (both with
ScummVM and DOSBox) I have come to the conclusion that they should not.
The music ends whenever there is a sound effect anyway, so having the
music play to the end of the track is the exception, not the rule.

In the FM Towns version, music does play continuously. Personally I find
this makes the game much harder, since the music can drown out the sound
effects.
2022-02-08 13:31:39 +01:00
Torbjörn Andersson f0c07b299b SCUMM: Add replacement track for unmaking the Loom
Also tweaked the expected length of the Overture so that it syncs up
nicely with Act II: No. 10 Scène (Moderato) from the Seiji Ozawa
recording. It was apparently used as tempo reference for the Loom
soundtrack, though I don't know if this was the actual track used for
the Overture since No. 14 is almost identical.

The way the code is written, it should still work fine even if the track
is longer or shorter than expected. And, let's face it, most players
will probably skip the Overture once they've heard it a few times.
2022-02-08 13:31:39 +01:00
Torbjörn Andersson 2c5e771b85 SCUMM: Add replacement track for Loom's "opening the sky" scene
This track is a bit harder to isolate from the ballet recording, since
it's in the middle of a piece of music. But since all enhanced tracks
are optional, that's not really a problem.
2022-02-08 13:31:39 +01:00
Torbjörn Andersson 7f6463f5c0 SCUMM: Ensure that the full Loom Overture plays 2022-02-08 13:31:39 +01:00
Torbjörn Andersson 5d9282ad7d SCUMM: Slightly more robust getReplacementAudioTrack()
Check that VAR_SOUNDCARD really is 4 before concluding that something is
a Roland track.
2022-02-08 13:31:39 +01:00
Torbjörn Andersson 5d32eccf72 SCUMM: Fix Loom Overture stalling if replacement track ends
For the Loom Overture to end, the music timer has to reach at least 278.
Keep the music timer updated for as long as there is a current CD sound,
even if the track itself has ended. If the track ends very early during
the Overture, skip ahead to the scene change. There will be several
seconds of silence, but this seems unlikely to ever happen to begin
with.
2022-02-08 13:31:39 +01:00
Torbjörn Andersson 48bebe680d SCUMM: Emulate the music timer for replacement audio tracks
This is currently hard-coded for the Loom Overture, and counts the
number of SCUMM ticks that have passed since the song started. Perhaps
it would make more sence to query the CD position, but our CD audio
manager doesn't support that at the time of writing.
2022-02-08 13:31:39 +01:00
Torbjörn Andersson 8ad80a83c1 SCUMM: Initial work on replacement audio tracks for Loom
This allows EGA Loom and Mac Loom to use replacement audio tracks, e.g.
from the FM Towns or TurboGrafx-16 versions or, with a bit work, any
recording of the original ballet.

Currently the Ouverture doesn't work, since it relies on the music
timer being updated.
2022-02-08 13:31:39 +01:00
Orgad Shaneh 6be5b08c78 SCUMM: Show subtitles on talkie versions without sound file
If the game is a talkie version, on which the verbs reference sounds, but
it is missing the sound file, and the user chose Voice Only, a warning
appears for every playback attempt.

Force subtitles on this case, to avoid these warnings.

Fixes trac 13151
2022-01-30 13:30:27 +02:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
athrxx 7ce98275a2 SCUMM: fix unused var warning 2021-11-17 20:07:01 +01:00
Andrea Boscarino f731cfd648 SCUMM: DiMUSE: New Digital iMUSE Engine (#3368)
SCUMM: DiMUSE: Add new implementation of the engine
2021-11-16 00:05:18 +01:00
Orgad Shaneh ed5489929c SCUMM: Use nullptr
Using clang-tidy modernize-use-nullptr
2021-11-14 15:51:59 +02:00
Paul Gilbert 005561d305 COMMON: Increase Stream pos, seek, size from int32 to int64 2021-07-08 18:24:28 -07:00
sluicebox 93eeffc84d JANITORIAL: Update old bug tracker numbers 2021-03-03 02:15:05 +02:00
athrxx 7bcf3ef3e3 SCUMM: fix bug 11946 (INDY4: Dialogue skip passes several lines at once)
I have checked the behavior of original INDY4 and also DOTT (since it is a later SCUMM version). Both games do actually suppress the whole dialogue line when pressing '.', even when it is a multi part line (containing one or more '3' command codes). So we don't have a bug here. But this applies to speech enabled setting only. In text only mode the original allows to step through the dialogue line by line (and also through the message parts separated by the '3' command). I have fixed this from disasm so that it matches the original behavior. I've also confirmed for SAMNMAX from disasm (not extensively, just checked whether it has the voicemode == 2 check at the beginning of startTalkSound()).
2021-02-11 20:01:23 +01:00
D G Turner 59b639ed4d SCUMM: Fix Missing Default Switch Cases
These are flagged by GCC if -Wswitch-default is enabled.
2019-12-23 11:56:16 +00:00
athrxx 19643175a8 SCUMM: limit 'Unrecognized base tag' warning to valid cases
This warning will not only show up if a tag is actually unrecognized but also in cases where the tag is recognized, but the resource size is 0. This happens quite a lot in the Amiga version of MI2 with 'SOU ' tags.
2019-07-14 21:45:52 +02:00
Adrian Frühwirth 48db9f04ea SCUMM: Fix recent commit to compile under all circumstances 2018-06-06 20:53:14 +02:00
Adrian Frühwirth 788d85d6b8 SCUMM: Work around distorted speech on submarine in Indy4
The speech sample at VCTL offset 0x76ccbca ("Hey you!") which is used
when Indy gets caught on the German submarine seems to not be a VOC
but raw PCM s16be at (this is a guess) 44.1 kHz with a bogus VOC header.
To work around this we skip the VOC header and decode the raw PCM data.

Fixes Trac#10559
2018-06-06 18:20:20 +00:00
Adrian Frühwirth d433aedf37 SCUMM: Improve 'imuse play' debugger command error handling
This commit introduces the following (seemingly non-invasive) changes
to make the 'imuse play' debugger command more useful (i.e. don't crash
when trying to load the wrong kind of (sound) resource.

* ScummEngine::readSoundResource()
  Instead of fatally error()'ing upon hitting a non-sound resource type,
  e.g. a room header (0x524d4844 aka RMHD), we now only issue a warning().
  This enables the already existing dead code which properly returns 0
  (aka no resource loaded).

* ResourceManager::validateResource()
  Instead of fatally error()'ing upon hitting an illegal glob type we now
  only issue a warning() and return false (also existing dead code).
  All methods calling validateResource() check its return value so this
  seems like the right thing to do anyway.

* ScummDebugger::Cmd_IMuse()
  Instead of directly calling ensureResourceLoaded() we now call
  getResourceAddress() instead (which in turn calls ensureResourceLoaded()
  and handles other edge cases) and only attempt to play a sound if the
  returned pointer actually is valid.

Fixes Trac#10527.
2018-06-03 19:38:52 +01:00
Colin Snover 9916b26383 SCUMM: Replace UB-triggering serialization code with Common::Serializer
Fixes Trac#10342.
2018-01-31 17:58:01 +01:00
Adrian Frühwirth 16eac57834 SCUMM: implement lipsync for v7 games 2018-01-31 16:38:07 +01:00
Giovanni Bajo 3a60637d77 SCUMM: really implement lipsync
It looks like the code was there, but it was never fully implemented
because _curSoundPos was never being incremented. Experimentally,
it looks like it works if it is a 60FPS counter.
2018-01-31 16:36:24 +01:00