[Scummvm-git-logs] scummvm master -> 9c455472eba54f0cce63f1ab00806cf14c2c05c6
eriktorbjorn
noreply at scummvm.org
Sun May 22 10:07:36 UTC 2022
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
4a3e75ce27 SCUMM: Move replacement music timer macros into sound.cpp
9c455472eb SCUMM: Fix regression in the replacement music timer
Commit: 4a3e75ce27eb3cf07467790b036bf03dece2f425
https://github.com/scummvm/scummvm/commit/4a3e75ce27eb3cf07467790b036bf03dece2f425
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2022-05-22T12:07:21+02:00
Commit Message:
SCUMM: Move replacement music timer macros into sound.cpp
They don't work outside of it anyway.
Changed paths:
engines/scumm/sound.cpp
engines/scumm/sound.h
diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp
index edd388bcfcb..f511d493308 100644
--- a/engines/scumm/sound.cpp
+++ b/engines/scumm/sound.cpp
@@ -134,6 +134,9 @@ bool Sound::isRolandLoom() const {
(_vm->VAR(_vm->VAR_SOUNDCARD) == 4);
}
+#define TICKS_TO_TIMER(x) ((((x) * 204) / _loomOvertureTransition) + 1)
+#define TIMER_TO_TICKS(x) ((((x) - 1) * _loomOvertureTransition) / 204)
+
void Sound::updateMusicTimer() {
bool isLoomOverture = (isRolandLoom() && _currentCDSound == 56 && !(_vm->_game.features & GF_DEMO));
diff --git a/engines/scumm/sound.h b/engines/scumm/sound.h
index 11474dd3d10..4ed9ded03f1 100644
--- a/engines/scumm/sound.h
+++ b/engines/scumm/sound.h
@@ -35,9 +35,6 @@
#define DEFAULT_LOOM_OVERTURE_TRANSITION 1160
-#define TICKS_TO_TIMER(x) ((((x) * 204) / _loomOvertureTransition) + 1)
-#define TIMER_TO_TICKS(x) ((((x) - 1) * _loomOvertureTransition) / 204)
-
namespace Audio {
class Mixer;
class SoundHandle;
Commit: 9c455472eba54f0cce63f1ab00806cf14c2c05c6
https://github.com/scummvm/scummvm/commit/9c455472eba54f0cce63f1ab00806cf14c2c05c6
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2022-05-22T12:07:21+02:00
Commit Message:
SCUMM: Fix regression in the replacement music timer
The replacement music timer operates on real time, and is adjusted for
the expected length of the Loom overture in order to accommodate for
different recordings of it. It's completely independent of the SCUMM
engine's timer frequency.
Changed paths:
engines/scumm/scumm.cpp
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 46d15a2792c..95eddcd771b 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -2322,8 +2322,12 @@ void ScummEngine::scummLoop(int delta) {
VAR(VAR_MUSIC_TIMER) = _sound->getCDMusicTimer();
} else if (VAR_MUSIC_TIMER != 0xFF) {
if (_sound->useReplacementAudioTracks() && _sound->getCurrentCDSound()) {
+ // The replacement music timer operates on real time, adjusted to
+ // the expected length of the Loom Overture (since there are so
+ // many different recordings of it). It's completely independent of
+ // the SCUMM engine's timer frequency.
_sound->updateMusicTimer();
- VAR(VAR_MUSIC_TIMER) = _sound->getMusicTimer() * _timerFrequency / 240.0;
+ VAR(VAR_MUSIC_TIMER) = _sound->getMusicTimer();
} else if (_musicEngine) {
// The music engine generates the timer data for us.
VAR(VAR_MUSIC_TIMER) = _musicEngine->getMusicTimer() * _timerFrequency / 240.0;
More information about the Scummvm-git-logs
mailing list