[Scummvm-git-logs] scummvm master -> fc1c686909ad6e57483c612e6418845af7904186
eriktorbjorn
noreply at scummvm.org
Tue Feb 8 12:31:51 UTC 2022
This automated email contains information about 18 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
8ad80a83c1 SCUMM: Initial work on replacement audio tracks for Loom
48bebe680d SCUMM: Emulate the music timer for replacement audio tracks
5d32eccf72 SCUMM: Fix Loom Overture stalling if replacement track ends
5d9282ad7d SCUMM: Slightly more robust getReplacementAudioTrack()
7f6463f5c0 SCUMM: Ensure that the full Loom Overture plays
2c5e771b85 SCUMM: Add replacement track for Loom's "opening the sky" scene
f0c07b299b SCUMM: Add replacement track for unmaking the Loom
0bd13126b5 SCUMM: Don't loop the Loom replacement audio tracks
0f61ae7f7a SCUMM: Map Loom demo music to the appropriate replacement tracks.
ea0e2f6c39 SCUMM: Remove leftover variable
13faad39a3 SCUMM: Enable Loom replacement tracks for more versions
c63786022d SCUMM: Another attempt at fixing the Loom Overture timing
c80adc3e8b SCUMM: Add setting for the Loom Overture tempo on the Engine tab
871ddc819c SCUMM: Clarify the Loom Overture slider tooltip a bit
3899a50503 SCUMM: Fix bugs when initializing default Loom Overture tempo
b3ca4b2151 SCUMM: Don't show the Overture setting for VGA Loom
7df600d656 SCUMM: Add detection entry for Loom demos
fc1c686909 SCUMM: Don't require the Roland update for the Loom demos
Commit: 8ad80a83c1c46fb2472cdb4f6fa9588c6cffbd16
https://github.com/scummvm/scummvm/commit/8ad80a83c1c46fb2472cdb4f6fa9588c6cffbd16
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2022-02-08T13:31:39+01:00
Commit Message:
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.
Changed paths:
engines/scumm/he/sound_he.cpp
engines/scumm/scumm.cpp
engines/scumm/sound.cpp
engines/scumm/sound.h
diff --git a/engines/scumm/he/sound_he.cpp b/engines/scumm/he/sound_he.cpp
index 81550ec94b1..3c1360b2c2a 100644
--- a/engines/scumm/he/sound_he.cpp
+++ b/engines/scumm/he/sound_he.cpp
@@ -46,7 +46,7 @@ namespace Scumm {
SoundHE::SoundHE(ScummEngine *parent, Audio::Mixer *mixer)
:
- Sound(parent, mixer),
+ Sound(parent, mixer, false),
_vm((ScummEngine_v60he *)parent),
_overrideFreq(0),
_heMusic(nullptr),
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 43dc42f4531..fce0e14ecf2 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -1538,11 +1538,21 @@ void ScummEngine::setupScumm(const Common::String &macResourceFile) {
_system->getAudioCDManager()->open();
}
+ bool useReplacementAudioTracks = false;
+
+ if (_game.id == GID_LOOM) {
+ useReplacementAudioTracks = (_game.platform == Common::kPlatformDOS && _game.version == 3) || _game.platform == Common::kPlatformMacintosh;
+ }
+
+ if (useReplacementAudioTracks) {
+ _system->getAudioCDManager()->open();
+ }
+
// Create the sound manager
if (_game.heversion > 0)
_sound = new SoundHE(this, _mixer);
else
- _sound = new Sound(this, _mixer);
+ _sound = new Sound(this, _mixer, useReplacementAudioTracks);
// Setup the music engine
setupMusic(_game.midi, macInstrumentFile);
diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp
index ead848da607..17b42189a45 100644
--- a/engines/scumm/sound.cpp
+++ b/engines/scumm/sound.cpp
@@ -54,10 +54,11 @@ struct MP3OffsetTable { /* Compressed Sound (.SO3) */
};
-Sound::Sound(ScummEngine *parent, Audio::Mixer *mixer)
+Sound::Sound(ScummEngine *parent, Audio::Mixer *mixer, bool useReplacementAudioTracks)
:
_vm(parent),
_mixer(mixer),
+ _useReplacementAudioTracks(useReplacementAudioTracks),
_soundQuePos(0),
_soundQue2Pos(0),
_sfxFilename(),
@@ -180,6 +181,32 @@ void Sound::processSoundQueues() {
_soundQuePos = 0;
}
+bool Sound::getReplacementAudioTrack(int soundID, int &trackNr, int &numLoops) {
+ trackNr = -1;
+ numLoops = -1;
+
+ if (_vm->_game.id == GID_LOOM) {
+ if (soundID >= 25 && soundID <= 32) {
+ // Normal track. There is no Ouverture, so the first
+ // track maps to audio track 2.
+ trackNr = soundID - 23;
+ } else if (soundID >= 56 && soundID <= 64) {
+ // Rolad track. 56 is the Ouverture, which maps to audio
+ // track 1.
+ trackNr = soundID - 55;
+ }
+
+ // The Ouverture and the dragon abduction don't loop
+ if (trackNr == 1 || trackNr == 6)
+ numLoops = 1;
+ }
+
+ if (trackNr != -1 && !_vm->existExtractedCDAudioFiles(trackNr))
+ trackNr = -1;
+
+ return trackNr != -1;
+}
+
void Sound::playSound(int soundID) {
byte *ptr;
byte *sound;
@@ -187,6 +214,15 @@ void Sound::playSound(int soundID) {
int size = -1;
int rate;
+ if (_useReplacementAudioTracks) {
+ int trackNr, numLoops;
+ if (getReplacementAudioTrack(soundID, trackNr, numLoops)) {
+ _currentCDSound = soundID;
+ g_system->getAudioCDManager()->play(trackNr, numLoops, 0, 0, true);
+ return;
+ }
+ }
+
if (_vm->_game.id == GID_LOOM && _vm->_game.platform == Common::kPlatformPCEngine) {
if (soundID >= 13 && soundID <= 32) {
static const char tracks[20] = {3, 4, 5, 7, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 21, 19, 20, 21};
@@ -1137,6 +1173,9 @@ static void cd_timer_handler(void *refCon) {
}
void Sound::startCDTimer() {
+ if (_useReplacementAudioTracks)
+ return;
+
// This timer interval is based on two scenes: The Monkey Island 1
// intro, and the scene in Loom CD where Chaos appears. In both cases
// the game plays the scene as two separate sounds, even though both
@@ -1152,6 +1191,9 @@ void Sound::startCDTimer() {
}
void Sound::stopCDTimer() {
+ if (_useReplacementAudioTracks)
+ return;
+
_vm->getTimerManager()->removeTimerProc(&cd_timer_handler);
}
diff --git a/engines/scumm/sound.h b/engines/scumm/sound.h
index d4eb84682c6..7ddb82affa2 100644
--- a/engines/scumm/sound.h
+++ b/engines/scumm/sound.h
@@ -91,6 +91,7 @@ protected:
Audio::SoundHandle *_loomSteamCDAudioHandle;
bool _isLoomSteam;
AudioCDManager::Status _loomSteamCD;
+ bool _useReplacementAudioTracks;
public:
Audio::SoundHandle *_talkChannelHandle; // Handle of mixer channel actor is talking on
@@ -102,7 +103,7 @@ public:
MidiDriverFlags _musicType;
public:
- Sound(ScummEngine *parent, Audio::Mixer *mixer);
+ Sound(ScummEngine *parent, Audio::Mixer *mixer, bool useReplacementAudioTracks);
~Sound() override;
virtual void addSoundToQueue(int sound, int heOffset = 0, int heChannel = 0, int heFlags = 0, int heFreq = 0, int hePan = 0, int heVol = 0);
virtual void addSoundToQueue2(int sound, int heOffset = 0, int heChannel = 0, int heFlags = 0, int heFreq = 0, int hePan = 0, int heVol = 0);
@@ -145,6 +146,8 @@ protected:
bool isSoundInQueue(int sound) const;
virtual void processSoundQueues();
+
+ bool getReplacementAudioTrack(int soundID, int &trackNumber, int &numLoops);
};
Commit: 48bebe680d0633bbf68b69b31310af2fe43ccefc
https://github.com/scummvm/scummvm/commit/48bebe680d0633bbf68b69b31310af2fe43ccefc
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2022-02-08T13:31:39+01:00
Commit Message:
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.
Changed paths:
engines/scumm/scumm.cpp
engines/scumm/sound.cpp
engines/scumm/sound.h
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index fce0e14ecf2..ea5f1ae3dd6 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -2557,7 +2557,10 @@ void ScummEngine::scummLoop(int delta) {
if (_game.features & GF_AUDIOTRACKS) {
// Covered automatically by the Sound class
} else if (VAR_MUSIC_TIMER != 0xFF) {
- if (_musicEngine) {
+ if (_sound->useReplacementAudioTracks() && _sound->pollCD()) {
+ _sound->updateMusicTimer(delta);
+ VAR(VAR_MUSIC_TIMER) = _sound->getMusicTimer();
+ } else if (_musicEngine) {
// The music engine generates the timer data for us.
VAR(VAR_MUSIC_TIMER) = _musicEngine->getMusicTimer();
}
diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp
index 17b42189a45..813a14b23c2 100644
--- a/engines/scumm/sound.cpp
+++ b/engines/scumm/sound.cpp
@@ -59,6 +59,8 @@ Sound::Sound(ScummEngine *parent, Audio::Mixer *mixer, bool useReplacementAudioT
_vm(parent),
_mixer(mixer),
_useReplacementAudioTracks(useReplacementAudioTracks),
+ _scummTicks(0),
+ _musicTimer(0),
_soundQuePos(0),
_soundQue2Pos(0),
_sfxFilename(),
@@ -109,6 +111,21 @@ Sound::~Sound() {
delete _talkChannelHandle;
}
+void Sound::updateMusicTimer(int ticks) {
+ _scummTicks += ticks;
+
+ // TODO: For now, this is hard-coded for Loom's Overture. When playing
+ // the original song, the timer is apparently based on the MIDI tempo
+ // of it. Therefore, it may be necessary to adjust this in the future.
+
+ // We approximate the length of the Overture to 2.5 minutes, or 9000
+ // SCUMM ticks. (One tick is 1/60th of a second.)
+
+ // At the end of the song, the timer should be about 280.
+
+ _musicTimer = (280 * _scummTicks) / 9000;
+}
+
void Sound::addSoundToQueue(int sound, int heOffset, int heChannel, int heFlags, int heFreq, int hePan, int heVol) {
if (_vm->VAR_LAST_SOUND != 0xFF)
_vm->VAR(_vm->VAR_LAST_SOUND) = sound;
@@ -187,16 +204,16 @@ bool Sound::getReplacementAudioTrack(int soundID, int &trackNr, int &numLoops) {
if (_vm->_game.id == GID_LOOM) {
if (soundID >= 25 && soundID <= 32) {
- // Normal track. There is no Ouverture, so the first
+ // Normal track. There is no Overture, so the first
// track maps to audio track 2.
trackNr = soundID - 23;
} else if (soundID >= 56 && soundID <= 64) {
- // Rolad track. 56 is the Ouverture, which maps to audio
+ // Rolad track. 56 is the Overture, which maps to audio
// track 1.
trackNr = soundID - 55;
}
- // The Ouverture and the dragon abduction don't loop
+ // The Overture and the dragon abduction don't loop
if (trackNr == 1 || trackNr == 6)
numLoops = 1;
}
@@ -218,6 +235,8 @@ void Sound::playSound(int soundID) {
int trackNr, numLoops;
if (getReplacementAudioTrack(soundID, trackNr, numLoops)) {
_currentCDSound = soundID;
+ _scummTicks = 0;
+ _musicTimer = 0;
g_system->getAudioCDManager()->play(trackNr, numLoops, 0, 0, true);
return;
}
@@ -917,6 +936,8 @@ void Sound::stopSound(int sound) {
if (sound != 0 && sound == _currentCDSound) {
_currentCDSound = 0;
+ _scummTicks = 0;
+ _musicTimer = 0;
stopCD();
stopCDTimer();
}
diff --git a/engines/scumm/sound.h b/engines/scumm/sound.h
index 7ddb82affa2..d4f2121ae5e 100644
--- a/engines/scumm/sound.h
+++ b/engines/scumm/sound.h
@@ -92,6 +92,8 @@ protected:
bool _isLoomSteam;
AudioCDManager::Status _loomSteamCD;
bool _useReplacementAudioTracks;
+ int _musicTimer;
+ uint32 _scummTicks;
public:
Audio::SoundHandle *_talkChannelHandle; // Handle of mixer channel actor is talking on
@@ -136,6 +138,10 @@ public:
AudioCDManager::Status getCDStatus();
int getCurrentCDSound() const { return _currentCDSound; }
+ bool useReplacementAudioTracks() const { return _useReplacementAudioTracks; }
+ void updateMusicTimer(int ticks);
+ int getMusicTimer() const { return _musicTimer; }
+
void saveLoadWithSerializer(Common::Serializer &ser) override;
protected:
Commit: 5d32eccf72a16dd23bea4bfe3f257fadc4abb34b
https://github.com/scummvm/scummvm/commit/5d32eccf72a16dd23bea4bfe3f257fadc4abb34b
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2022-02-08T13:31:39+01:00
Commit Message:
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.
Changed paths:
engines/scumm/scumm.cpp
engines/scumm/sound.cpp
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index ea5f1ae3dd6..ff77ce509cb 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -2557,7 +2557,7 @@ void ScummEngine::scummLoop(int delta) {
if (_game.features & GF_AUDIOTRACKS) {
// Covered automatically by the Sound class
} else if (VAR_MUSIC_TIMER != 0xFF) {
- if (_sound->useReplacementAudioTracks() && _sound->pollCD()) {
+ if (_sound->useReplacementAudioTracks() && _sound->getCurrentCDSound()) {
_sound->updateMusicTimer(delta);
VAR(VAR_MUSIC_TIMER) = _sound->getMusicTimer();
} else if (_musicEngine) {
diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp
index 813a14b23c2..a24c7aadbee 100644
--- a/engines/scumm/sound.cpp
+++ b/engines/scumm/sound.cpp
@@ -121,7 +121,14 @@ void Sound::updateMusicTimer(int ticks) {
// We approximate the length of the Overture to 2.5 minutes, or 9000
// SCUMM ticks. (One tick is 1/60th of a second.)
- // At the end of the song, the timer should be about 280.
+ // If the track has already ended, it's still important that the timer
+ // eventually reaches at least 278. If necessary, skip make sure the
+ // timer skips to 198, which is where the next scene begins.
+
+ if (!pollCD()) {
+ if (_scummTicks < 6365)
+ _scummTicks = 6365;
+ }
_musicTimer = (280 * _scummTicks) / 9000;
}
Commit: 5d9282ad7dee6cba7d474f16276210ad4ec8f784
https://github.com/scummvm/scummvm/commit/5d9282ad7dee6cba7d474f16276210ad4ec8f784
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2022-02-08T13:31:39+01:00
Commit Message:
SCUMM: Slightly more robust getReplacementAudioTrack()
Check that VAR_SOUNDCARD really is 4 before concluding that something is
a Roland track.
Changed paths:
engines/scumm/sound.cpp
diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp
index a24c7aadbee..9d487a0e904 100644
--- a/engines/scumm/sound.cpp
+++ b/engines/scumm/sound.cpp
@@ -210,14 +210,14 @@ bool Sound::getReplacementAudioTrack(int soundID, int &trackNr, int &numLoops) {
numLoops = -1;
if (_vm->_game.id == GID_LOOM) {
- if (soundID >= 25 && soundID <= 32) {
- // Normal track. There is no Overture, so the first
- // track maps to audio track 2.
- trackNr = soundID - 23;
- } else if (soundID >= 56 && soundID <= 64) {
+ if (_vm->VAR(_vm->VAR_SOUNDCARD) == 4 && soundID >= 56 && soundID <= 64) {
// Rolad track. 56 is the Overture, which maps to audio
// track 1.
trackNr = soundID - 55;
+ } else if (soundID >= 25 && soundID <= 32) {
+ // Normal track. There is no Overture, so the first
+ // track maps to audio track 2.
+ trackNr = soundID - 23;
}
// The Overture and the dragon abduction don't loop
Commit: 7f6463f5c0d413161b34811cdc84918fa7087eca
https://github.com/scummvm/scummvm/commit/7f6463f5c0d413161b34811cdc84918fa7087eca
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2022-02-08T13:31:39+01:00
Commit Message:
SCUMM: Ensure that the full Loom Overture plays
Changed paths:
engines/scumm/sound.cpp
diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp
index 9d487a0e904..8fc852626be 100644
--- a/engines/scumm/sound.cpp
+++ b/engines/scumm/sound.cpp
@@ -112,25 +112,38 @@ Sound::~Sound() {
}
void Sound::updateMusicTimer(int ticks) {
+ bool isLoomOverture = (_vm->_game.id == GID_LOOM && _vm->VAR(_vm->VAR_SOUNDCARD) == 4 && _currentCDSound == 56);
+
_scummTicks += ticks;
- // TODO: For now, this is hard-coded for Loom's Overture. When playing
- // the original song, the timer is apparently based on the MIDI tempo
- // of it. Therefore, it may be necessary to adjust this in the future.
+ // For now, this is hard-coded for Loom's Overture. When playing the
+ // original song, the timer is apparently based on the MIDI tempo of
+ // it. Therefore, it may be necessary to adjust this in the future.
+ // But at the time of writing, it seems likely that the Overture is
+ // the only track that depends on timing, so that may be ok.
// We approximate the length of the Overture to 2.5 minutes, or 9000
- // SCUMM ticks. (One tick is 1/60th of a second.)
+ // SCUMM ticks. (One tick is 1/60th of a second.) It would be nice if
+ // we could get the exact length from the audio CD manager, but at the
+ // time of writing it doesn't provide that information.
// If the track has already ended, it's still important that the timer
// eventually reaches at least 278. If necessary, skip make sure the
// timer skips to 198, which is where the next scene begins.
- if (!pollCD()) {
- if (_scummTicks < 6365)
- _scummTicks = 6365;
+ if (isLoomOverture && !pollCD()) {
+ uint32 scummTick = (9000 * _musicTimer) / 198;
+ if (_scummTicks < scummTick)
+ _scummTicks = scummTick;
}
- _musicTimer = (280 * _scummTicks) / 9000;
+ _musicTimer = (278 * _scummTicks) / 9000;
+
+ // But don't let the timer exceed 278 until the Overture has ended, or
+ // the music will be cut off.
+
+ if (isLoomOverture && pollCD() && _musicTimer >= 278)
+ _musicTimer = 277;
}
void Sound::addSoundToQueue(int sound, int heOffset, int heChannel, int heFlags, int heFreq, int hePan, int heVol) {
Commit: 2c5e771b85f0610ab7ef41ac8cdfa2bbb459aa03
https://github.com/scummvm/scummvm/commit/2c5e771b85f0610ab7ef41ac8cdfa2bbb459aa03
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2022-02-08T13:31:39+01:00
Commit Message:
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.
Changed paths:
engines/scumm/sound.cpp
engines/scumm/sound.h
diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp
index 8fc852626be..7b689887f08 100644
--- a/engines/scumm/sound.cpp
+++ b/engines/scumm/sound.cpp
@@ -111,8 +111,16 @@ Sound::~Sound() {
delete _talkChannelHandle;
}
+bool Sound::isRolandLoom() const {
+ return
+ (_vm->_game.id == GID_LOOM) &&
+ (_vm->_game.version == 3) &&
+ (_vm->_game.platform == Common::kPlatformDOS) &&
+ (_vm->VAR(_vm->VAR_SOUNDCARD) == 4);
+}
+
void Sound::updateMusicTimer(int ticks) {
- bool isLoomOverture = (_vm->_game.id == GID_LOOM && _vm->VAR(_vm->VAR_SOUNDCARD) == 4 && _currentCDSound == 56);
+ bool isLoomOverture = (isRolandLoom() && _currentCDSound == 56);
_scummTicks += ticks;
@@ -223,18 +231,23 @@ bool Sound::getReplacementAudioTrack(int soundID, int &trackNr, int &numLoops) {
numLoops = -1;
if (_vm->_game.id == GID_LOOM) {
- if (_vm->VAR(_vm->VAR_SOUNDCARD) == 4 && soundID >= 56 && soundID <= 64) {
- // Rolad track. 56 is the Overture, which maps to audio
- // track 1.
- trackNr = soundID - 55;
- } else if (soundID >= 25 && soundID <= 32) {
- // Normal track. There is no Overture, so the first
- // track maps to audio track 2.
+ if (isRolandLoom())
+ soundID -= 32;
+
+ // The first track, the Overture, only exists as a Roland track.
+ if (soundID >= 24 && soundID <= 32) {
trackNr = soundID - 23;
+ } else if (soundID == 19) {
+ trackNr = 10;
}
- // The Overture and the dragon abduction don't loop
- if (trackNr == 1 || trackNr == 6)
+ // The following tracks should not loop:
+ //
+ // 1. Overture
+ // 6. Dragon abduction
+ // 10. Opening the sky
+
+ if (trackNr == 1 || trackNr == 6 || trackNr == 10)
numLoops = 1;
}
@@ -2074,7 +2087,7 @@ int ScummEngine::readSoundResourceSmallHeader(ResId idx) {
debug(4, "readSoundResourceSmallHeader(%d)", idx);
- if ((_game.id == GID_LOOM) && (_game.version == 3) && (_game.platform == Common::kPlatformDOS) && VAR(VAR_SOUNDCARD) == 4) {
+ if (_sound->isRolandLoom()) {
// Roland resources in Loom are tagless
// So we add an RO tag to allow imuse to detect format
byte *ptr, *src_ptr;
diff --git a/engines/scumm/sound.h b/engines/scumm/sound.h
index d4f2121ae5e..e6ac104964b 100644
--- a/engines/scumm/sound.h
+++ b/engines/scumm/sound.h
@@ -59,6 +59,8 @@ protected:
ScummEngine *_vm;
Audio::Mixer *_mixer;
+ bool _isRolandLoom;
+
int16 _soundQuePos, _soundQue[0x100];
int16 _soundQue2Pos;
@@ -138,6 +140,7 @@ public:
AudioCDManager::Status getCDStatus();
int getCurrentCDSound() const { return _currentCDSound; }
+ bool isRolandLoom() const;
bool useReplacementAudioTracks() const { return _useReplacementAudioTracks; }
void updateMusicTimer(int ticks);
int getMusicTimer() const { return _musicTimer; }
Commit: f0c07b299b4aec31717a5f418b05e5f3f491933a
https://github.com/scummvm/scummvm/commit/f0c07b299b4aec31717a5f418b05e5f3f491933a
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2022-02-08T13:31:39+01:00
Commit Message:
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.
Changed paths:
engines/scumm/sound.cpp
diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp
index 7b689887f08..88552b5e022 100644
--- a/engines/scumm/sound.cpp
+++ b/engines/scumm/sound.cpp
@@ -130,22 +130,26 @@ void Sound::updateMusicTimer(int ticks) {
// But at the time of writing, it seems likely that the Overture is
// the only track that depends on timing, so that may be ok.
- // We approximate the length of the Overture to 2.5 minutes, or 9000
- // SCUMM ticks. (One tick is 1/60th of a second.) It would be nice if
- // we could get the exact length from the audio CD manager, but at the
- // time of writing it doesn't provide that information.
+ // The length of the Overture is approximated to 8800 ticks. This
+ // makes it sync up nicely with Act II: No. 10 Scène (Moderato) from
+ // the Seiji Ozawa recording that was apparently used as a tempo
+ // reference for the Loom soundtrack.
+
+ // This isn't necessarily the correct length of the track - not even
+ // for the Ozawa version - and we currently have no way of querying
+ // the actual length of the track.
// If the track has already ended, it's still important that the timer
// eventually reaches at least 278. If necessary, skip make sure the
// timer skips to 198, which is where the next scene begins.
if (isLoomOverture && !pollCD()) {
- uint32 scummTick = (9000 * _musicTimer) / 198;
+ uint32 scummTick = (8800 * _musicTimer) / 198;
if (_scummTicks < scummTick)
_scummTicks = scummTick;
}
- _musicTimer = (278 * _scummTicks) / 9000;
+ _musicTimer = (278 * _scummTicks) / 8800;
// But don't let the timer exceed 278 until the Overture has ended, or
// the music will be cut off.
@@ -239,6 +243,8 @@ bool Sound::getReplacementAudioTrack(int soundID, int &trackNr, int &numLoops) {
trackNr = soundID - 23;
} else if (soundID == 19) {
trackNr = 10;
+ } else if (soundID == 21) {
+ trackNr = 11;
}
// The following tracks should not loop:
@@ -246,8 +252,9 @@ bool Sound::getReplacementAudioTrack(int soundID, int &trackNr, int &numLoops) {
// 1. Overture
// 6. Dragon abduction
// 10. Opening the sky
+ // 11. Unmaking the Loom
- if (trackNr == 1 || trackNr == 6 || trackNr == 10)
+ if (trackNr == 1 || trackNr == 6 || trackNr == 10 || trackNr == 11)
numLoops = 1;
}
Commit: 0bd13126b5e11a2300bb3dee03ab6d27d22acb51
https://github.com/scummvm/scummvm/commit/0bd13126b5e11a2300bb3dee03ab6d27d22acb51
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2022-02-08T13:31:39+01:00
Commit Message:
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.
Changed paths:
engines/scumm/sound.cpp
engines/scumm/sound.h
diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp
index 88552b5e022..fce20d8c912 100644
--- a/engines/scumm/sound.cpp
+++ b/engines/scumm/sound.cpp
@@ -230,9 +230,8 @@ void Sound::processSoundQueues() {
_soundQuePos = 0;
}
-bool Sound::getReplacementAudioTrack(int soundID, int &trackNr, int &numLoops) {
- trackNr = -1;
- numLoops = -1;
+int Sound::getReplacementAudioTrack(int soundID) {
+ int trackNr = -1;
if (_vm->_game.id == GID_LOOM) {
if (isRolandLoom())
@@ -246,22 +245,12 @@ bool Sound::getReplacementAudioTrack(int soundID, int &trackNr, int &numLoops) {
} else if (soundID == 21) {
trackNr = 11;
}
-
- // The following tracks should not loop:
- //
- // 1. Overture
- // 6. Dragon abduction
- // 10. Opening the sky
- // 11. Unmaking the Loom
-
- if (trackNr == 1 || trackNr == 6 || trackNr == 10 || trackNr == 11)
- numLoops = 1;
}
if (trackNr != -1 && !_vm->existExtractedCDAudioFiles(trackNr))
trackNr = -1;
- return trackNr != -1;
+ return trackNr;
}
void Sound::playSound(int soundID) {
@@ -272,12 +261,21 @@ void Sound::playSound(int soundID) {
int rate;
if (_useReplacementAudioTracks) {
- int trackNr, numLoops;
- if (getReplacementAudioTrack(soundID, trackNr, numLoops)) {
+ // Note that music does not loop. Probably because it's likely
+ // to be interrupted by sound effects before it's over anyway.
+ //
+ // In the FM Towns version, music does play continuously (each
+ // track has two versions), probably because CD audio and sound
+ // effects are played independent of each other. Personally I
+ // find the game harder when the music is allowed to drown out
+ // the sound effects.
+
+ int trackNr = getReplacementAudioTrack(soundID);
+ if (trackNr != -1) {
_currentCDSound = soundID;
_scummTicks = 0;
_musicTimer = 0;
- g_system->getAudioCDManager()->play(trackNr, numLoops, 0, 0, true);
+ g_system->getAudioCDManager()->play(trackNr, 1, 0, 0, true);
return;
}
}
diff --git a/engines/scumm/sound.h b/engines/scumm/sound.h
index e6ac104964b..7ecfd087072 100644
--- a/engines/scumm/sound.h
+++ b/engines/scumm/sound.h
@@ -156,7 +156,7 @@ protected:
virtual void processSoundQueues();
- bool getReplacementAudioTrack(int soundID, int &trackNumber, int &numLoops);
+ int getReplacementAudioTrack(int soundID);
};
Commit: 0f61ae7f7ac9115388b00f27ef47d04a3dbb3ccc
https://github.com/scummvm/scummvm/commit/0f61ae7f7ac9115388b00f27ef47d04a3dbb3ccc
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2022-02-08T13:31:39+01:00
Commit Message:
SCUMM: Map Loom demo music to the appropriate replacement tracks.
Changed paths:
engines/scumm/sound.cpp
diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp
index fce20d8c912..b41658b2075 100644
--- a/engines/scumm/sound.cpp
+++ b/engines/scumm/sound.cpp
@@ -120,7 +120,7 @@ bool Sound::isRolandLoom() const {
}
void Sound::updateMusicTimer(int ticks) {
- bool isLoomOverture = (isRolandLoom() && _currentCDSound == 56);
+ bool isLoomOverture = (isRolandLoom() && _currentCDSound == 56 && !(_vm->_game.features & GF_DEMO));
_scummTicks += ticks;
@@ -234,16 +234,45 @@ int Sound::getReplacementAudioTrack(int soundID) {
int trackNr = -1;
if (_vm->_game.id == GID_LOOM) {
- if (isRolandLoom())
- soundID -= 32;
-
- // The first track, the Overture, only exists as a Roland track.
- if (soundID >= 24 && soundID <= 32) {
- trackNr = soundID - 23;
- } else if (soundID == 19) {
- trackNr = 10;
- } else if (soundID == 21) {
- trackNr = 11;
+ if (_vm->_game.features & GF_DEMO) {
+ // If I understand correctly, the shorter demo only
+ // has the Loom intro music. The longer demo has a
+ // couple of tracks that it will cycle through if
+ // you leave the demo running.
+
+ if (isRolandLoom())
+ soundID -= 10;
+
+ switch (soundID) {
+ case 19:
+ trackNr = 2;
+ break;
+ case 20:
+ trackNr = 4;
+ break;
+ case 21:
+ trackNr = 7;
+ break;
+ case 23:
+ trackNr = 8;
+ break;
+ case 26:
+ trackNr = 3;
+ break;
+ }
+ } else {
+ if (isRolandLoom())
+ soundID -= 32;
+
+ // The first track, the Overture, only exists as a
+ // Roland track.
+ if (soundID >= 24 && soundID <= 32) {
+ trackNr = soundID - 23;
+ } else if (soundID == 19) {
+ trackNr = 10;
+ } else if (soundID == 21) {
+ trackNr = 11;
+ }
}
}
Commit: ea0e2f6c39c0aeba4ca1830c5dc893355dd11c90
https://github.com/scummvm/scummvm/commit/ea0e2f6c39c0aeba4ca1830c5dc893355dd11c90
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2022-02-08T13:31:39+01:00
Commit Message:
SCUMM: Remove leftover variable
I had originally thought I could set _isRolandLoom when the Sound class
was created, but at that point the soundcard variable has not yet been
set. It was replaced with an isRolandLoom() function, but I left the
variable behind by mistake.
Changed paths:
engines/scumm/sound.h
diff --git a/engines/scumm/sound.h b/engines/scumm/sound.h
index 7ecfd087072..50e2d463f3b 100644
--- a/engines/scumm/sound.h
+++ b/engines/scumm/sound.h
@@ -59,8 +59,6 @@ protected:
ScummEngine *_vm;
Audio::Mixer *_mixer;
- bool _isRolandLoom;
-
int16 _soundQuePos, _soundQue[0x100];
int16 _soundQue2Pos;
Commit: 13faad39a38e968fc5f94cc5deff29302b5819ac
https://github.com/scummvm/scummvm/commit/13faad39a38e968fc5f94cc5deff29302b5819ac
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2022-02-08T13:31:39+01:00
Commit Message:
SCUMM: Enable Loom replacement tracks for more versions
Thanks to eientei and GandalfTheWhite for confirming that the Atari ST
and Amiga versions use the same track numbering as the EGA (AdLib) and
Macintosh versions. That should mean that only the versions that already
use CD audio track need to be excluded.
Changed paths:
engines/scumm/scumm.cpp
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index ff77ce509cb..9a49562a96d 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -1538,11 +1538,7 @@ void ScummEngine::setupScumm(const Common::String &macResourceFile) {
_system->getAudioCDManager()->open();
}
- bool useReplacementAudioTracks = false;
-
- if (_game.id == GID_LOOM) {
- useReplacementAudioTracks = (_game.platform == Common::kPlatformDOS && _game.version == 3) || _game.platform == Common::kPlatformMacintosh;
- }
+ bool useReplacementAudioTracks = (_game.id == GID_LOOM && !(_game.features & GF_AUDIOTRACKS));
if (useReplacementAudioTracks) {
_system->getAudioCDManager()->open();
Commit: c63786022d99c9a0186e38d61ead67b213616359
https://github.com/scummvm/scummvm/commit/c63786022d99c9a0186e38d61ead67b213616359
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2022-02-08T13:31:39+01:00
Commit Message:
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?
Changed paths:
engines/scumm/sound.cpp
diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp
index b41658b2075..d206632752d 100644
--- a/engines/scumm/sound.cpp
+++ b/engines/scumm/sound.cpp
@@ -119,6 +119,17 @@ bool Sound::isRolandLoom() const {
(_vm->VAR(_vm->VAR_SOUNDCARD) == 4);
}
+// When timing the MT-32 version, it took on average 149.6 seconds for the
+// timer to reach 278. At 60 SCUMM ticks per second, this would be 8976 ticks
+// except... apparently you can't really use SCUMM ticks to this level of
+// accuracy, so the final timing is still off. I've adjusted it so that the
+// transition happens at almost the same point in the music when I use the
+// Ozawa version of No. 10 Scène (Moderato). Good enough for now, but maybe it
+// needs to be configurable to accommodate for different recordings?
+
+#define TICKS_TO_TIMER(x) ((((x) * 278) / 8940) + 1)
+#define TIMER_TO_TICKS(x) ((((x) - 1) * 8940) / 278)
+
void Sound::updateMusicTimer(int ticks) {
bool isLoomOverture = (isRolandLoom() && _currentCDSound == 56 && !(_vm->_game.features & GF_DEMO));
@@ -126,30 +137,30 @@ void Sound::updateMusicTimer(int ticks) {
// For now, this is hard-coded for Loom's Overture. When playing the
// original song, the timer is apparently based on the MIDI tempo of
- // it. Therefore, it may be necessary to adjust this in the future.
- // But at the time of writing, it seems likely that the Overture is
- // the only track that depends on timing, so that may be ok.
+ // it. But at least for Loom, the Overture seems to be the only piece
+ // of music where timing matters.
- // The length of the Overture is approximated to 8800 ticks. This
- // makes it sync up nicely with Act II: No. 10 Scène (Moderato) from
- // the Seiji Ozawa recording that was apparently used as a tempo
- // reference for the Loom soundtrack.
+ // These are the values the timer will have to reach or exceed for the
+ // Overture to work correctly:
- // This isn't necessarily the correct length of the track - not even
- // for the Ozawa version - and we currently have no way of querying
- // the actual length of the track.
+ // 4 - Fade in the "OVERTURE" text
+ // 198 - Fade down the "OVERTURE" text
+ // 204 - Show the LucasFilm logo
+ // 278 - End the Overture
- // If the track has already ended, it's still important that the timer
- // eventually reaches at least 278. If necessary, skip make sure the
- // timer skips to 198, which is where the next scene begins.
+ // At the time of writing, we don't have any way to query the CD audio
+ // manager for the exact length of the track, so we just assume the
+ // timer should run at the same rate. If the track ends before the
+ // timer reaches 198, skip ahead. (If the timer didn't even reach 4,
+ // you weren't even trying!)
if (isLoomOverture && !pollCD()) {
- uint32 scummTick = (8800 * _musicTimer) / 198;
- if (_scummTicks < scummTick)
- _scummTicks = scummTick;
+ uint32 fadeDownTick = TIMER_TO_TICKS(198);
+ if (_scummTicks < fadeDownTick)
+ _scummTicks = fadeDownTick;
}
- _musicTimer = (278 * _scummTicks) / 8800;
+ _musicTimer = TICKS_TO_TIMER(_scummTicks);
// But don't let the timer exceed 278 until the Overture has ended, or
// the music will be cut off.
@@ -158,6 +169,9 @@ void Sound::updateMusicTimer(int ticks) {
_musicTimer = 277;
}
+#undef TIMER_TO_TICKS
+#undef TICKS_TO_TIMER
+
void Sound::addSoundToQueue(int sound, int heOffset, int heChannel, int heFlags, int heFreq, int hePan, int heVol) {
if (_vm->VAR_LAST_SOUND != 0xFF)
_vm->VAR(_vm->VAR_LAST_SOUND) = sound;
Commit: c80adc3e8be4facf9459ab9bf0464375d00c56e2
https://github.com/scummvm/scummvm/commit/c80adc3e8be4facf9459ab9bf0464375d00c56e2
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2022-02-08T13:31:39+01:00
Commit Message:
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.
Changed paths:
engines/scumm/dialogs.cpp
engines/scumm/dialogs.h
engines/scumm/metaengine.cpp
engines/scumm/metaengine.h
engines/scumm/scumm.cpp
engines/scumm/sound.cpp
engines/scumm/sound.h
gui/themes/common/highres_layout.stx
gui/themes/common/lowres_layout.stx
gui/themes/residualvm.zip
gui/themes/residualvm/THEMERC
gui/themes/scummclassic.zip
gui/themes/scummclassic/THEMERC
gui/themes/scummclassic/classic_layout.stx
gui/themes/scummclassic/classic_layout_lowres.stx
gui/themes/scummmodern.zip
gui/themes/scummmodern/THEMERC
gui/themes/scummremastered.zip
gui/themes/scummremastered/THEMERC
diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp
index cba0a20d27a..92eea10c3dc 100644
--- a/engines/scumm/dialogs.cpp
+++ b/engines/scumm/dialogs.cpp
@@ -699,4 +699,69 @@ void LoomTownsDifficultyDialog::handleCommand(GUI::CommandSender *sender, uint32
}
}
+EgaLoomOptionsWidget::EgaLoomOptionsWidget(GuiObject *boss, const Common::String &name, const Common::String &domain) :
+ OptionsContainerWidget(boss, name, "EgaLoomOptionsDialog", false, domain) {
+ new GUI::StaticTextWidget(widgetsBoss(), "EgaLoomOptionsDialog.OvertureTicksHeader", _("Overture Timing:"));
+
+ _overtureTicksSlider = new GUI::SliderWidget(widgetsBoss(), "EgaLoomOptionsDialog.OvertureTicks", _("Adjusts how quickly the Overture transition happens when using replacement audio tracks."), kOvertureTicksChanged);
+
+ // Each step of the slider changes the assumed length of the Loom
+ // Overture by ten SCUMM ticks. When I timed it, I was able to set the
+ // transition to happen anywhere between approximately 1:30 and 2:20,
+ // which should be more than enough. I think it's nice if the interval
+ // is small enough that you can set the slider back to 0 at reasonable
+ // screen resolutions.
+
+ _overtureTicksSlider->setMinValue(-200);
+ _overtureTicksSlider->setMaxValue(200);
+
+ _overtureTicksLabel = new GUI::StaticTextWidget(widgetsBoss(), "EgaLoomOptionsDialog.OvertureTicksLabel", Common::U32String());
+
+ _overtureTicksLabel->setFlags(GUI::WIDGET_CLEARBG);
+}
+
+void EgaLoomOptionsWidget::load() {
+ int loomOvertureTicks = DEFAULT_LOOM_OVERTURE_TICKS;
+
+ if (ConfMan.hasKey("loom_overture_ticks", _domain))
+ loomOvertureTicks = ConfMan.getInt("loom_overture_ticks", _domain);
+
+ _overtureTicksSlider->setValue(loomOvertureTicks);
+ updateOvertureTicksLabel();
+}
+
+bool EgaLoomOptionsWidget::save() {
+ ConfMan.setInt("loom_overture_ticks", _overtureTicksSlider->getValue(), _domain);
+ return true;
+}
+
+void EgaLoomOptionsWidget::defineLayout(GUI::ThemeEval &layouts, const Common::String &layoutName, const Common::String &overlayedLayout) const {
+ layouts.addDialog(layoutName, overlayedLayout)
+ .addLayout(GUI::ThemeLayout::kLayoutHorizontal)
+ .addPadding(16, 16, 16, 16)
+ .addWidget("OvertureTicksHeader", "OptionsLabel")
+ .addWidget("OvertureTicks", "WideSlider")
+ .addSpace(8)
+ .addWidget("OvertureTicksLabel", "SmallLabel")
+ .closeLayout()
+ .closeDialog();
+}
+
+void EgaLoomOptionsWidget::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) {
+
+ switch (cmd) {
+ case kOvertureTicksChanged:
+ updateOvertureTicksLabel();
+ break;
+ default:
+ GUI::OptionsContainerWidget::handleCommand(sender, cmd, data);
+ break;
+ }
+}
+
+void EgaLoomOptionsWidget::updateOvertureTicksLabel() {
+ _overtureTicksLabel->setValue(_overtureTicksSlider->getValue());
+ _overtureTicksLabel->markAsDirty();
+}
+
} // End of namespace Scumm
diff --git a/engines/scumm/dialogs.h b/engines/scumm/dialogs.h
index 555cf822b1d..69b51cb3dac 100644
--- a/engines/scumm/dialogs.h
+++ b/engines/scumm/dialogs.h
@@ -209,6 +209,31 @@ private:
int _difficulty;
};
+/**
+ * Options widget for EGA Loom
+ */
+class EgaLoomOptionsWidget : public GUI::OptionsContainerWidget {
+public:
+ EgaLoomOptionsWidget(GuiObject *boss, const Common::String &name, const Common::String &domain);
+ ~EgaLoomOptionsWidget() override {};
+
+ void load() override;
+ bool save() override;
+
+private:
+ enum {
+ kOvertureTicksChanged = 'OTCH'
+ };
+
+ void defineLayout(GUI::ThemeEval &layouts, const Common::String &layoutName, const Common::String &overlayedLayout) const override;
+ void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) override;
+
+ GUI::SliderWidget *_overtureTicksSlider;
+ GUI::StaticTextWidget *_overtureTicksLabel;
+
+ void updateOvertureTicksLabel();
+};
+
} // End of namespace Scumm
#endif
diff --git a/engines/scumm/metaengine.cpp b/engines/scumm/metaengine.cpp
index ac86b1e0229..6a8b838e214 100644
--- a/engines/scumm/metaengine.cpp
+++ b/engines/scumm/metaengine.cpp
@@ -32,6 +32,7 @@
#include "scumm/he/intern_he.h"
#include "scumm/scumm_v0.h"
#include "scumm/scumm_v8.h"
+#include "scumm/dialogs.h"
#include "scumm/resource.h"
// Files related for detection.
@@ -522,6 +523,26 @@ SaveStateDescriptor ScummMetaEngine::querySaveMetaInfos(const char *target, int
return desc;
}
+GUI::OptionsContainerWidget *ScummMetaEngine::buildEngineOptionsWidgetDynamic(GUI::GuiObject *boss, const Common::String &name, const Common::String &target) const {
+ if (ConfMan.get("gameid", target) != "loom")
+ return nullptr;
+
+ // These Loom settings are only relevant for the EGA version, so
+ // exclude non-DOS versions. If the game was added a long time ago,
+ // the platform may still be listed as unknown.
+
+ Common::Platform platform = Common::parsePlatform(ConfMan.get("platform", target));
+ if (platform != Common::kPlatformUnknown && platform != Common::kPlatformDOS)
+ return nullptr;
+
+ if (ConfMan.get("extra", target) == "Steam")
+ return nullptr;
+
+ // And yet, after all this, we still can't be sure that it's not the
+ // VGA version or a demo...
+ return new Scumm::EgaLoomOptionsWidget(boss, name, target);
+}
+
#if PLUGIN_ENABLED_DYNAMIC(SCUMM)
REGISTER_PLUGIN_DYNAMIC(SCUMM, PLUGIN_TYPE_ENGINE, ScummMetaEngine);
#else
diff --git a/engines/scumm/metaengine.h b/engines/scumm/metaengine.h
index a1e75330f9c..051e8f4d4ff 100644
--- a/engines/scumm/metaengine.h
+++ b/engines/scumm/metaengine.h
@@ -35,6 +35,8 @@ class ScummMetaEngine : public MetaEngine {
int getMaximumSaveSlot() const override;
void removeSaveState(const char *target, int slot) const override;
SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const override;
+
+ GUI::OptionsContainerWidget *buildEngineOptionsWidgetDynamic(GUI::GuiObject *boss, const Common::String &name, const Common::String &target) const override;
};
#endif // SCUMM_METAENGINE_H
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 9a49562a96d..496094926e9 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -1541,6 +1541,7 @@ void ScummEngine::setupScumm(const Common::String &macResourceFile) {
bool useReplacementAudioTracks = (_game.id == GID_LOOM && !(_game.features & GF_AUDIOTRACKS));
if (useReplacementAudioTracks) {
+ ConfMan.registerDefault("loom_overture_ticks", DEFAULT_LOOM_OVERTURE_TICKS);
_system->getAudioCDManager()->open();
}
diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp
index d206632752d..b1e106dbf20 100644
--- a/engines/scumm/sound.cpp
+++ b/engines/scumm/sound.cpp
@@ -98,6 +98,7 @@ Sound::Sound(ScummEngine *parent, Audio::Mixer *mixer, bool useReplacementAudioT
_loomSteamCD.balance = 0;
_isLoomSteam = _vm->_game.id == GID_LOOM && Common::File::exists("CDDA.SOU");
+ _loomOvertureTicks = DEFAULT_LOOM_OVERTURE_TICKS + 10 * ConfMan.getInt("loom_overture_ticks");
_loomSteamCDAudioHandle = new Audio::SoundHandle();
_talkChannelHandle = new Audio::SoundHandle();
@@ -127,8 +128,8 @@ bool Sound::isRolandLoom() const {
// Ozawa version of No. 10 Scène (Moderato). Good enough for now, but maybe it
// needs to be configurable to accommodate for different recordings?
-#define TICKS_TO_TIMER(x) ((((x) * 278) / 8940) + 1)
-#define TIMER_TO_TICKS(x) ((((x) - 1) * 8940) / 278)
+#define TICKS_TO_TIMER(x) ((((x) * 278) / _loomOvertureTicks) + 1)
+#define TIMER_TO_TICKS(x) ((((x) - 1) * _loomOvertureTicks) / 278)
void Sound::updateMusicTimer(int ticks) {
bool isLoomOverture = (isRolandLoom() && _currentCDSound == 56 && !(_vm->_game.features & GF_DEMO));
diff --git a/engines/scumm/sound.h b/engines/scumm/sound.h
index 50e2d463f3b..acb13135e2b 100644
--- a/engines/scumm/sound.h
+++ b/engines/scumm/sound.h
@@ -29,6 +29,8 @@
#include "backends/audiocd/audiocd.h"
#include "scumm/file.h"
+#define DEFAULT_LOOM_OVERTURE_TICKS 8940
+
namespace Audio {
class Mixer;
class SoundHandle;
@@ -94,6 +96,7 @@ protected:
bool _useReplacementAudioTracks;
int _musicTimer;
uint32 _scummTicks;
+ uint32 _loomOvertureTicks;
public:
Audio::SoundHandle *_talkChannelHandle; // Handle of mixer channel actor is talking on
diff --git a/gui/themes/common/highres_layout.stx b/gui/themes/common/highres_layout.stx
index 8da7c36f9d3..f2a12c0d885 100644
--- a/gui/themes/common/highres_layout.stx
+++ b/gui/themes/common/highres_layout.stx
@@ -103,6 +103,9 @@
<widget name = 'Slider'
size = '128, 18'
/>
+ <widget name = 'WideSlider'
+ size = '-1, 18'
+ />
<widget name = 'PopUp'
size = '-1, 19'
/>
diff --git a/gui/themes/common/lowres_layout.stx b/gui/themes/common/lowres_layout.stx
index d79c5594b6b..cd9a2466464 100644
--- a/gui/themes/common/lowres_layout.stx
+++ b/gui/themes/common/lowres_layout.stx
@@ -96,6 +96,9 @@
<widget name = 'Slider'
size = '85, 12'
/>
+ <widget name = 'WideSlider'
+ size = '-1, 12'
+ />
<widget name = 'PopUp'
size = '-1, 15'
/>
diff --git a/gui/themes/residualvm.zip b/gui/themes/residualvm.zip
index 04f1aca3284..e4ea070aab4 100644
Binary files a/gui/themes/residualvm.zip and b/gui/themes/residualvm.zip differ
diff --git a/gui/themes/residualvm/THEMERC b/gui/themes/residualvm/THEMERC
index 0a96b70c755..1f30724c367 100644
--- a/gui/themes/residualvm/THEMERC
+++ b/gui/themes/residualvm/THEMERC
@@ -1,3 +1,3 @@
-[SCUMMVM_STX0.9.1:ResidualVM Modern Theme Remastered:No Author]
+[SCUMMVM_STX0.9.2:ResidualVM Modern Theme Remastered:No Author]
%using ../common
%using ../common-svg
diff --git a/gui/themes/scummclassic.zip b/gui/themes/scummclassic.zip
index 09289b8cc3b..798214670cb 100644
Binary files a/gui/themes/scummclassic.zip and b/gui/themes/scummclassic.zip differ
diff --git a/gui/themes/scummclassic/THEMERC b/gui/themes/scummclassic/THEMERC
index 1bd6884510c..02be869634e 100644
--- a/gui/themes/scummclassic/THEMERC
+++ b/gui/themes/scummclassic/THEMERC
@@ -1 +1 @@
-[SCUMMVM_STX0.9.1:ScummVM Classic Theme:No Author]
+[SCUMMVM_STX0.9.2:ScummVM Classic Theme:No Author]
diff --git a/gui/themes/scummclassic/classic_layout.stx b/gui/themes/scummclassic/classic_layout.stx
index ce551747cb6..4f4740d961f 100644
--- a/gui/themes/scummclassic/classic_layout.stx
+++ b/gui/themes/scummclassic/classic_layout.stx
@@ -87,6 +87,9 @@
<widget name = 'Slider'
size = '128, 18'
/>
+ <widget name = 'WideSlider'
+ size = '-1, 18'
+ />
<widget name = 'PopUp'
size = '-1, 19'
/>
diff --git a/gui/themes/scummclassic/classic_layout_lowres.stx b/gui/themes/scummclassic/classic_layout_lowres.stx
index 64612c6c0b8..cbed3bd2f40 100644
--- a/gui/themes/scummclassic/classic_layout_lowres.stx
+++ b/gui/themes/scummclassic/classic_layout_lowres.stx
@@ -84,6 +84,9 @@
<widget name = 'Slider'
size = '85, 12'
/>
+ <widget name = 'WideSlider'
+ size = '-1, 12'
+ />
<widget name = 'PopUp'
size = '-1, 15'
/>
diff --git a/gui/themes/scummmodern.zip b/gui/themes/scummmodern.zip
index 7fc9c6a3952..cc3ee55323b 100644
Binary files a/gui/themes/scummmodern.zip and b/gui/themes/scummmodern.zip differ
diff --git a/gui/themes/scummmodern/THEMERC b/gui/themes/scummmodern/THEMERC
index cf23ba05de2..1e3edcb3f05 100644
--- a/gui/themes/scummmodern/THEMERC
+++ b/gui/themes/scummmodern/THEMERC
@@ -1,2 +1,2 @@
-[SCUMMVM_STX0.9.1:ScummVM Modern Theme:No Author]
+[SCUMMVM_STX0.9.2:ScummVM Modern Theme:No Author]
%using ../common
diff --git a/gui/themes/scummremastered.zip b/gui/themes/scummremastered.zip
index d8683cd27c3..3b00ebddde8 100644
Binary files a/gui/themes/scummremastered.zip and b/gui/themes/scummremastered.zip differ
diff --git a/gui/themes/scummremastered/THEMERC b/gui/themes/scummremastered/THEMERC
index 3122cbf07bf..cc0ce935f39 100644
--- a/gui/themes/scummremastered/THEMERC
+++ b/gui/themes/scummremastered/THEMERC
@@ -1,3 +1,3 @@
-[SCUMMVM_STX0.9.1:ScummVM Modern Theme Remastered:No Author]
+[SCUMMVM_STX0.9.2:ScummVM Modern Theme Remastered:No Author]
%using ../common
%using ../common-svg
Commit: 871ddc819c0313cc4af1fd1391a0a038943a5d4c
https://github.com/scummvm/scummvm/commit/871ddc819c0313cc4af1fd1391a0a038943a5d4c
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2022-02-08T13:31:39+01:00
Commit Message:
SCUMM: Clarify the Loom Overture slider tooltip a bit
Changed paths:
engines/scumm/dialogs.cpp
diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp
index 92eea10c3dc..0fe581e6afe 100644
--- a/engines/scumm/dialogs.cpp
+++ b/engines/scumm/dialogs.cpp
@@ -703,7 +703,7 @@ EgaLoomOptionsWidget::EgaLoomOptionsWidget(GuiObject *boss, const Common::String
OptionsContainerWidget(boss, name, "EgaLoomOptionsDialog", false, domain) {
new GUI::StaticTextWidget(widgetsBoss(), "EgaLoomOptionsDialog.OvertureTicksHeader", _("Overture Timing:"));
- _overtureTicksSlider = new GUI::SliderWidget(widgetsBoss(), "EgaLoomOptionsDialog.OvertureTicks", _("Adjusts how quickly the Overture transition happens when using replacement audio tracks."), kOvertureTicksChanged);
+ _overtureTicksSlider = new GUI::SliderWidget(widgetsBoss(), "EgaLoomOptionsDialog.OvertureTicks", _("Adjusts the timing of the EGA Loom Overture when using enhanced music. The lower the value, the earlier the Lucasfilm logo appears."), kOvertureTicksChanged);
// Each step of the slider changes the assumed length of the Loom
// Overture by ten SCUMM ticks. When I timed it, I was able to set the
Commit: 3899a5050311ae98aca5ad657a26765777399e8b
https://github.com/scummvm/scummvm/commit/3899a5050311ae98aca5ad657a26765777399e8b
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2022-02-08T13:31:39+01:00
Commit Message:
SCUMM: Fix bugs when initializing default Loom Overture tempo
We now store the difference compared to the default value, rather than
the actual SCUMM ticks. Therefore, the default value for the setting is
0, not DEFAULT_LOOM_OVERTURE_TICKS.
Changed paths:
engines/scumm/dialogs.cpp
engines/scumm/scumm.cpp
diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp
index 0fe581e6afe..7eaa9905db0 100644
--- a/engines/scumm/dialogs.cpp
+++ b/engines/scumm/dialogs.cpp
@@ -721,7 +721,7 @@ EgaLoomOptionsWidget::EgaLoomOptionsWidget(GuiObject *boss, const Common::String
}
void EgaLoomOptionsWidget::load() {
- int loomOvertureTicks = DEFAULT_LOOM_OVERTURE_TICKS;
+ int loomOvertureTicks = 0;
if (ConfMan.hasKey("loom_overture_ticks", _domain))
loomOvertureTicks = ConfMan.getInt("loom_overture_ticks", _domain);
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 496094926e9..9a49562a96d 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -1541,7 +1541,6 @@ void ScummEngine::setupScumm(const Common::String &macResourceFile) {
bool useReplacementAudioTracks = (_game.id == GID_LOOM && !(_game.features & GF_AUDIOTRACKS));
if (useReplacementAudioTracks) {
- ConfMan.registerDefault("loom_overture_ticks", DEFAULT_LOOM_OVERTURE_TICKS);
_system->getAudioCDManager()->open();
}
Commit: b3ca4b2151ea62a86c485005537fb401e074395f
https://github.com/scummvm/scummvm/commit/b3ca4b2151ea62a86c485005537fb401e074395f
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2022-02-08T13:31:39+01:00
Commit Message:
SCUMM: Don't show the Overture setting for VGA Loom
Though this only works if the game was added recently enough. My old
entry for VGA Loom doesn't have an "extra" field, nor does my old EGA
Loom entry specify the platform. I really should regenerate that
scummvm.ini file one of these days...
Changed paths:
engines/scumm/metaengine.cpp
diff --git a/engines/scumm/metaengine.cpp b/engines/scumm/metaengine.cpp
index 6a8b838e214..47e1dd516e3 100644
--- a/engines/scumm/metaengine.cpp
+++ b/engines/scumm/metaengine.cpp
@@ -529,17 +529,19 @@ GUI::OptionsContainerWidget *ScummMetaEngine::buildEngineOptionsWidgetDynamic(GU
// These Loom settings are only relevant for the EGA version, so
// exclude non-DOS versions. If the game was added a long time ago,
- // the platform may still be listed as unknown.
+ // the platform may still be listed as unknown, and there may be no
+ // "extra" field to query.
Common::Platform platform = Common::parsePlatform(ConfMan.get("platform", target));
if (platform != Common::kPlatformUnknown && platform != Common::kPlatformDOS)
return nullptr;
- if (ConfMan.get("extra", target) == "Steam")
+ Common::String extra = ConfMan.get("extra", target);
+
+ if (extra == "Steam" || extra == "VGA")
return nullptr;
- // And yet, after all this, we still can't be sure that it's not the
- // VGA version or a demo...
+ // So we still can't be quite sure it's the EGA version. Oh well...
return new Scumm::EgaLoomOptionsWidget(boss, name, target);
}
Commit: 7df600d6565f7358efd07551d2a25705ae0ac773
https://github.com/scummvm/scummvm/commit/7df600d6565f7358efd07551d2a25705ae0ac773
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2022-02-08T13:31:39+01:00
Commit Message:
SCUMM: Add detection entry for Loom demos
This is so that the demos can be properly distinguished from the full
game by looking at the GF_DEMO flag.
Changed paths:
devtools/scumm-md5.txt
engines/scumm/detection_tables.h
engines/scumm/scumm-md5.h
diff --git a/devtools/scumm-md5.txt b/devtools/scumm-md5.txt
index aae94587d6a..e89a9fae415 100644
--- a/devtools/scumm-md5.txt
+++ b/devtools/scumm-md5.txt
@@ -188,8 +188,8 @@ loom Loom
0aa050f4ad79402fbe9c4f78fb8ac494 6532 en PC-Engine PC-Engine - - Kirben
79b05f628586837e7166e82b2279bb50 -1 jp PC-Engine PC-Engine - - clone2727
- 5a35e36fd777e9c37a49c5b2faca52f9 6108 en DOS EGA EGA Demo non-interactive Fingolfin
- a00554c31d623fdb9fcb0f924b89b42b -1 en DOS EGA EGA Demo non-interactive Adrian C. Fruehwirth
+ 5a35e36fd777e9c37a49c5b2faca52f9 6108 en DOS Demo EGA Demo non-interactive Fingolfin
+ a00554c31d623fdb9fcb0f924b89b42b -1 en DOS Demo EGA Demo non-interactive Adrian C. Fruehwirth
monkey The Secret of Monkey Island
c666a998af90d81db447eccba9f72c8d -1 en Atari No AdLib EGA -
diff --git a/engines/scumm/detection_tables.h b/engines/scumm/detection_tables.h
index e805b1bc2b9..dc9deff7dd4 100644
--- a/engines/scumm/detection_tables.h
+++ b/engines/scumm/detection_tables.h
@@ -181,6 +181,7 @@ static const GameSettings gameVariantsTable[] = {
{"loom", "FM-TOWNS", 0, GID_LOOM, 3, 0, MDT_TOWNS, GF_AUDIOTRACKS | GF_OLD256, Common::kPlatformFMTowns, GUIO4(GUIO_NOSPEECH, GUIO_NOMIDI, GUIO_MIDITOWNS, GUIO_NOASPECT)},
{"loom", "VGA", "vga", GID_LOOM, 4, 0, MDT_NONE, GF_AUDIOTRACKS, Common::kPlatformDOS, GUIO2(GUIO_NOSPEECH, GUIO_NOMIDI)},
{"loom", "Steam", "steam", GID_LOOM, 4, 0, MDT_NONE, GF_AUDIOTRACKS, UNK, GUIO2(GUIO_NOSPEECH, GUIO_NOMIDI)},
+ {"loom", "Demo", "ega", GID_LOOM, 3, 0, MDT_PCSPK | MDT_PCJR | MDT_CMS | MDT_ADLIB | MDT_MIDI | MDT_PREFER_MT32, GF_DEMO, UNK, GUIO1(GUIO_NOSPEECH)},
{"pass", 0, 0, GID_PASS, 4, 0, MDT_PCSPK | MDT_PCJR | MDT_CMS | MDT_ADLIB, GF_16COLOR, Common::kPlatformDOS, GUIO2(GUIO_NOSPEECH, GUIO_NOMIDI)},
diff --git a/engines/scumm/scumm-md5.h b/engines/scumm/scumm-md5.h
index 136f0213f1d..be92c577062 100644
--- a/engines/scumm/scumm-md5.h
+++ b/engines/scumm/scumm-md5.h
@@ -1,5 +1,5 @@
/*
- This file was generated by the md5table tool on Wed Dec 15 06:09:32 2021
+ This file was generated by the md5table tool on Mon Feb 7 12:42:06 2022
DO NOT EDIT MANUALLY!
*/
@@ -286,7 +286,7 @@ static const MD5Table md5table[] = {
{ "590e6546aacd0d374b7f3a4f53013ab1", "freddicove", "", "", 41165, Common::EN_USA, Common::kPlatformUnknown },
{ "591bb98948d277f6c91e65db3f26c829", "atlantis", "", "Demo", 11210, Common::EN_ANY, Common::kPlatformMacintosh },
{ "59d5cfcc5e672a6e07baae01328b918b", "PuttTime", "HE 90", "Demo", -1, Common::FR_FRA, Common::kPlatformUnknown },
- { "5a35e36fd777e9c37a49c5b2faca52f9", "loom", "EGA", "EGA Demo", 6108, Common::EN_ANY, Common::kPlatformDOS },
+ { "5a35e36fd777e9c37a49c5b2faca52f9", "loom", "Demo", "EGA Demo", 6108, Common::EN_ANY, Common::kPlatformDOS },
{ "5b08000a9c47b2887df6506ac767ca68", "fbear", "HE 62", "", -1, Common::EN_ANY, Common::kPlatform3DO },
{ "5bd335265a61caa3d78956ad9f88ba23", "football", "", "Demo", 23135, Common::EN_ANY, Common::kPlatformUnknown },
{ "5c21fc49aee8f46e58fef21579e614a1", "thinker1", "", "", -1, Common::EN_USA, Common::kPlatformUnknown },
@@ -485,7 +485,7 @@ static const MD5Table md5table[] = {
{ "9dc02577bf50d4cfaf3de3fbac06fbe2", "puttmoon", "", "", -1, Common::EN_ANY, Common::kPlatformMacintosh },
{ "9e5e0fb43bd22f4628719b7501adb717", "monkey", "No AdLib", "EGA", -1, Common::FR_FRA, Common::kPlatformAtariST },
{ "9fd66fb3b04703bd50da4356e4202558", "spyfox2", "", "", 51295, Common::EN_GRB, Common::kPlatformUnknown },
- { "a00554c31d623fdb9fcb0f924b89b42b", "loom", "EGA", "EGA Demo", -1, Common::EN_ANY, Common::kPlatformDOS },
+ { "a00554c31d623fdb9fcb0f924b89b42b", "loom", "Demo", "EGA Demo", -1, Common::EN_ANY, Common::kPlatformDOS },
{ "a01fab4a64d47b96e2e58e6b0f825cc7", "monkey", "VGA", "VGA", 8347, Common::FR_FRA, Common::kPlatformDOS },
{ "a095616d2d23ccf43b8e257711202cba", "football2002", "", "", -1, Common::EN_ANY, Common::kPlatformUnknown },
{ "a095e33061606d231ff37dca4c64c8ac", "pajama", "HE 99", "", 66505, Common::DE_DEU, Common::kPlatformUnknown },
Commit: fc1c686909ad6e57483c612e6418845af7904186
https://github.com/scummvm/scummvm/commit/fc1c686909ad6e57483c612e6418845af7904186
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2022-02-08T13:31:39+01:00
Commit Message:
SCUMM: Don't require the Roland update for the Loom demos
The Roland update is only required to get MT-32 music from the full EGA
version of Loom. The demos include the Roland music already.
Changed paths:
engines/scumm/scumm.cpp
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 9a49562a96d..c0a8a7167d1 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -2120,11 +2120,9 @@ void ScummEngine::setupMusic(int midi, const Common::String &macInstrumentFile)
&& (_game.platform == Common::kPlatformDOS) && _sound->_musicType == MDT_MIDI) {
Common::String fileName;
bool missingFile = false;
- if (_game.id == GID_LOOM) {
+ if (_game.id == GID_LOOM && !(_game.features & GF_DEMO)) {
Common::File f;
- // The Roland Update does have an 85.LFL, but we don't
- // test for it since the demo doesn't have it.
- for (char c = '2'; c <= '4'; c++) {
+ for (char c = '2'; c <= '5'; c++) {
fileName = "8";
fileName += c;
fileName += ".LFL";
More information about the Scummvm-git-logs
mailing list