[Scummvm-git-logs] scummvm branch-2-6 -> 085aab72a65c053b79e9fbfbbd5d90b850cb4cf6
sluicebox
noreply at scummvm.org
Tue Sep 27 20:58:35 UTC 2022
This automated email contains information about 32 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
0b939ca64f SCI: (SCI1+) - improve channel sound flag handling
a91aaf636f SCI: Fix kDoSound redundant fade detection
7a33be2c2b SCI: Include all music fade flags in save files
133d3fc6d4 SCI: SciEngine was accessing itself through globals
b21af7531f SCI: Restrict kGetEvent throttling to fast cast mode
f2cc736626 SCI: Improve King's Quest 4 detection entries
d813ccf6ce SCI: Fix LB2 CD interrupted introduction music
90d2473c03 SCI: Fix "You wins" message in PQ1 poker
58006e8986 SCI: Document kGameIsRestarting speed throttler
61b3926dd1 SCI: Add speed_throttle debug command
6cf2ac17f9 SCI: Added detection for SCI fanmade games and removed unused gameid
822c0ed644 SCI: Add entry for LB2 French fan translation
ed8ba1d3cc SCI: Add detection for QFG2 v1.105 (5x5.25")
1f67f23e13 SCI: Add name filtering to functions debug command
b5f7445062 SCI: Set correct SCI1.1 fade-complete signal value
4785b06e33 SCI: Fix kDoSoundFade SCI1+ behavior when sound not playing
c75b4665d9 SCI: Fix LB2 museum music script bugs
c9c151c35c SCI: Fix LB2 error when clicking dagger case
24ad186b95 SCI: Fix LB2 CD Wolf and O'Riley actor loops
1629fc5ee2 SCI: Fix previous LB2 CD script patch
5b72be7de4 SCI: Update KQ4 1.003.006 entry with original files
680929f807 SCI: Disable volume reset on fan games
71967f6d30 SCI32: Fix kDoSoundPause sample behavior in LSL6HIRES
71a269afa1 SCI32: Fix modulo opcode in SCI2.1Late and SCI3
a17915cbef SCI32: Implement accurate kMulDiv calculations
8276bad5e4 SCI: Fix QFG3 Laibon Teller options
be4343b51e SCI: fix bug no. 11683 ("QFG2 - Heavy reverb from city street sounds ...")
f5059a7f84 SCI32: Make RTL BiDi conversion direction hard coded
19ca44e07f SCI: Remove unused code from soundcmd.h
e3a7d4fe6e SCI32: Fix QFG4 scripts that consume extra projectiles
745ca57311 SCI: (FPFP/Demo) - fix bug no. 12610
085aab72a6 SCI: Add detection entry for SQ1VGA 2.1 fan patch
Commit: 0b939ca64f65f9b568fa87599f7eb067d9f4d644
https://github.com/scummvm/scummvm/commit/0b939ca64f65f9b568fa87599f7eb067d9f4d644
Author: athrxx (athrxx at scummvm.org)
Date: 2022-09-27T16:55:44-04:00
Commit Message:
SCI: (SCI1+) - improve channel sound flag handling
This cleans up some things I noticed when I implemented the mute flag handling. It removes the hack that manually forces flag 2 on all channels with number 9, regardless of the device.
I presume the hack was done for the earliest SCI 1 games, due to improper handling of flag 1.
Changed paths:
engines/sci/resource/resource_audio.cpp
engines/sci/sound/midiparser_sci.cpp
engines/sci/sound/music.cpp
engines/sci/sound/music.h
diff --git a/engines/sci/resource/resource_audio.cpp b/engines/sci/resource/resource_audio.cpp
index 7cfb9d917ea..6b10af29201 100644
--- a/engines/sci/resource/resource_audio.cpp
+++ b/engines/sci/resource/resource_audio.cpp
@@ -927,18 +927,33 @@ SoundResource::SoundResource(uint32 resourceNr, ResourceManager *resMan, SciVers
} else {
channel->flags = channel->number >> 4;
channel->number = channel->number & 0x0F;
-
- // 0x20 is set on rhythm channels to prevent remapping
- // CHECKME: Which SCI versions need that set manually?
- if (channel->number == 9)
- channel->flags |= 2;
- // Note: flag 1: channel start offset is 0 instead of 10
- // (currently: everything 0)
- // also: don't map the channel to device
- // flag 2: don't remap
- // flag 4: start muted
- // QfG2 lacks flags 2 and 4, and uses (flags >= 1) as
- // the condition for starting offset 0, without the "don't map"
+ // Flag 1: Channel start offset is 0 instead of 10 (currently: everything 0)
+ // Also: Don't map the channel to the device at all, but still play it.
+ // It doesn't stop other sounds playing sounds on that channel, it even
+ // allows other sounds to map to this channel (in that case the dontmap
+ // channel has limited access, it can't send control change, program
+ // change and pitch wheel messages.
+ // This is basically a marker for the channel as a "real" channel
+ // (used mostly for rhythm channels on devices that have one). These
+ // channels will also consequently start the parsing at offset 0 instead
+ // of 10: Normal channels would read the parameters of the first couple of
+ // events into the channel structs, but the "real" channels have to
+ // send these to the device right away, since they don't use the stored
+ // data.
+ // Very early games like KQ5 (but including the DOS CD version) and SQ2
+ // have support for this flag, only. It isn't even a flag there, since
+ // all these games do is check for a channel number below 0x10.
+ //
+ // Flag 2: Don't remap the channel. It is placed in the map, but only in the
+ // exact matching slot of the channel number. All the other games except
+ // the very early ones use this flag to mark the rhythm channels. I
+ // haven't seen any usage of flag 1 in any of these games. They all use
+ // flag 2 instead, but still have full support of flag 1 in the code.
+ // Using this flag is really preferable, since there can't be conflicts
+ // with different sounds playing on the channel.
+ //
+ // Flag 4: Start up muted. The channel won't be mapped (and thus, not have any
+ // output), until the mute gets removed.
}
_tracks[trackNr].channelCount++;
channelNr++;
diff --git a/engines/sci/sound/midiparser_sci.cpp b/engines/sci/sound/midiparser_sci.cpp
index a1f900b97a6..7e29c4a5949 100644
--- a/engines/sci/sound/midiparser_sci.cpp
+++ b/engines/sci/sound/midiparser_sci.cpp
@@ -492,8 +492,11 @@ void MidiParser_SCI::sendFromScriptToDriver(uint32 midi) {
}
void MidiParser_SCI::sendToDriver(uint32 midi) {
+ byte midiChannel = midi & 0xf;
+
// State tracking
- trackState(midi);
+ if (!_pSnd->_chan[midiChannel]._dontMap)
+ trackState(midi);
if ((midi & 0xFFF0) == 0x4EB0 && _soundVersion >= SCI_VERSION_1_EARLY) {
// Mute. Handled in trackState()/sendFromScriptToDriver().
@@ -508,10 +511,16 @@ void MidiParser_SCI::sendToDriver(uint32 midi) {
midi = (midi & 0xFFFF) | ((channelVolume & 0xFF) << 16);
}
-
// Channel remapping
- byte midiChannel = midi & 0xf;
+ uint8 msg = (midi & 0xF0);
int16 realChannel = _channelRemap[midiChannel];
+ if (_pSnd->_chan[midiChannel]._dontMap) {
+ // The dontMap channel is supposed to have limited access, if the device channel is already in use.
+ // It probably won't happen, but the original does these checks...
+ if (!_music->isDeviceChannelMapped(midiChannel) || (msg != 0xB0 && msg != 0xC0 && msg != 0xE0))
+ realChannel = midiChannel;
+ }
+
if (realChannel == -1)
return;
diff --git a/engines/sci/sound/music.cpp b/engines/sci/sound/music.cpp
index 5dfbb3b79c4..1ec68ae49fc 100644
--- a/engines/sci/sound/music.cpp
+++ b/engines/sci/sound/music.cpp
@@ -501,20 +501,26 @@ void SciMusic::soundInitSnd(MusicEntry *pSnd) {
assert(chan.number < ARRAYSIZE(pSnd->_chan));
pSnd->_usedChannels[i] = chan.number;
+ // Flag 1 is exclusive towards the other flags. When it is
+ // set the others won't even get evaluated. And it wouldn't
+ // matter, since channels flagged with 1 operate completely
+ // independent of the channel mapping.
+ // For more info on the flags see the comment in
+ // SoundResource::SoundResource().
+ pSnd->_chan[chan.number]._dontMap = (chan.flags & 1);
pSnd->_chan[chan.number]._dontRemap = (chan.flags & 2);
pSnd->_chan[chan.number]._prio = chan.prio;
pSnd->_chan[chan.number]._voices = chan.poly;
pSnd->_chan[chan.number]._mute = (chan.flags & 4) ? 1 : 0;
-
- // CHECKME: Some SCI versions use chan.flags & 1 for this:
- pSnd->_chan[chan.number]._dontMap = false;
-
// FIXME: Most MIDI tracks use the first 10 bytes for
// fixed MIDI commands. SSCI skips those the first iteration,
// but _does_ update channel state (including volume) with
// them. Specifically, prio/voices, patch, volume, pan.
- // This should probably be implemented in
- // MidiParser_SCI::loadMusic.
+ // This should probably be implemented in MidiParser_SCI::loadMusic.
+ //
+ // UPDATE: While we could change how we handle it, we DO
+ // read the commands into the channel data arrays when we call
+ // trackState(). So, I think what we do has the same result...
}
pSnd->pMidiParser->mainThreadBegin();
@@ -1533,6 +1539,10 @@ ChannelRemapping *SciMusic::determineChannelMap() {
return map;
}
+bool SciMusic::isDeviceChannelMapped(int devChannel) const {
+ return _channelMap[devChannel]._song;
+}
+
void SciMusic::resetDeviceChannel(int devChannel, bool mainThread) {
assert(devChannel >= 0 && devChannel <= 0x0F);
diff --git a/engines/sci/sound/music.h b/engines/sci/sound/music.h
index 3e32bc7bad8..8abc6321184 100644
--- a/engines/sci/sound/music.h
+++ b/engines/sci/sound/music.h
@@ -280,6 +280,10 @@ protected:
ChannelRemapping *determineChannelMap();
void resetDeviceChannel(int devChannel, bool mainThread);
+public:
+ // The parsers need to know this for the dontMap channels...
+ bool isDeviceChannelMapped(int devChannel) const;
+
private:
MusicList _playList;
bool _soundOn;
Commit: a91aaf636f02a0d3efde0d068f3c5e7fb1a21f1d
https://github.com/scummvm/scummvm/commit/a91aaf636f02a0d3efde0d068f3c5e7fb1a21f1d
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2022-09-27T16:55:44-04:00
Commit Message:
SCI: Fix kDoSound redundant fade detection
Fixes two discrepancies in redundant fade detection that were discovered
while investigating LONGBOW bug #13674:
- MusicEntry::fadeTo was altered even when the fade was ignored
- Redundant fades are allowed in SSCI when the stopOnFade flag is passed
Changed paths:
engines/sci/sound/soundcmd.cpp
diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp
index 4a8edb63c5b..e1edbac3f37 100644
--- a/engines/sci/sound/soundcmd.cpp
+++ b/engines/sci/sound/soundcmd.cpp
@@ -480,27 +480,31 @@ reg_t SoundCommandParser::kDoSoundFade(EngineState *s, int argc, reg_t *argv) {
musicSlot->fadeTicker = 0;
break;
- case 4: // SCI01+
- case 5: // SCI1+ (SCI1 late sound scheme), with fade and continue
- musicSlot->fadeTo = CLIP<uint16>(argv[1].toUint16(), 0, MUSIC_VOLUME_MAX);
- // Check if the song is already at the requested volume. If it is, don't
- // perform any fading. Happens for example during the intro of Longbow.
- if (musicSlot->fadeTo == musicSlot->volume)
+ case 4: // SCI01+
+ case 5: { // SCI1+ (SCI1 late sound scheme), with fade and continue
+ byte fadeTo = CLIP<uint16>(argv[1].toUint16(), 0, MUSIC_VOLUME_MAX);
+
+ // argv[4] is a boolean. Scripts sometimes pass strange values,
+ // but SSCI only checks for zero/non-zero. (Verified in KQ6).
+ // KQ6 room 460 even passes an object, but treating this as 'true'
+ // seems fine in that case. Bug #6120
+ bool stopAfterFading = (argc == 5) && !argv[4].isNull();
+
+ // Ignore the fade request if the song is already at the requested volume and
+ // the stopAfterFading flag isn't being set. SSCI stored this flag in the upper
+ // bit of the target volume before comparing it to the current volume.
+ // Longbow relies on this in its introduction. Bug #5239
+ if (musicSlot->volume == fadeTo && !stopAfterFading) {
return s->r_acc;
+ }
+ musicSlot->fadeTo = fadeTo;
musicSlot->fadeStep = volume > musicSlot->fadeTo ? -argv[3].toUint16() : argv[3].toUint16();
musicSlot->fadeTickerStep = argv[2].toUint16() * 16667 / _music->soundGetTempo();
musicSlot->fadeTicker = 0;
-
- // argv[4] is a boolean. Scripts sometimes pass strange values,
- // but SSCI only checks for zero/non-zero. (Verified in KQ6).
- // KQ6 room 460 even passes an object, but treating this as 'true'
- // seems fine in that case.
- if (argc == 5)
- musicSlot->stopAfterFading = !argv[4].isNull();
- else
- musicSlot->stopAfterFading = false;
+ musicSlot->stopAfterFading = stopAfterFading;
break;
+ }
default:
error("kDoSound(fade): unsupported argc %d", argc);
Commit: 7a33be2c2ba42275b5be378d747ec06aeaee337a
https://github.com/scummvm/scummvm/commit/7a33be2c2ba42275b5be378d747ec06aeaee337a
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2022-09-27T16:55:44-04:00
Commit Message:
SCI: Include all music fade flags in save files
fadeSetVolume and fadeCompleted are used by the fade timer to signal
SoundCommand::processUpdateCues() that there is work to be done.
By not syncing them, if a save occurs after a fade completes but before
it's processed then the game won't see the completed fade when loading.
This can happen when the game is paused because the user has brought up
the game's menu bar or control panel in order to save a game. The fade
completes while the UI is displayed, then a save occurs, and then the
fade is processed after the UI is dismissed.
Now completed fades are processed when loading.
Fixes bug #7073 in KQ6 where saving in the Land of the Dead while
Alexander dismounts Night Mare results in a softlocked save.
Fixes bug #13546 in LSL6HIRES where saving while music fades from
a previous room results in a save that doesn't play the new music.
Changed paths:
engines/sci/engine/savegame.cpp
engines/sci/engine/savegame.h
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp
index 895397a4de5..a27b699dd1a 100644
--- a/engines/sci/engine/savegame.cpp
+++ b/engines/sci/engine/savegame.cpp
@@ -688,6 +688,8 @@ void MusicEntry::saveLoadWithSerializer(Common::Serializer &s) {
s.syncAsSint16LE(fadeStep);
s.syncAsSint32LE(fadeTicker);
s.syncAsSint32LE(fadeTickerStep);
+ s.syncAsByte(fadeSetVolume, VER(46));
+ s.syncAsByte(fadeCompleted, VER(46));
s.syncAsByte(stopAfterFading, VER(45));
s.syncAsByte(status);
if (s.getVersion() >= 32)
diff --git a/engines/sci/engine/savegame.h b/engines/sci/engine/savegame.h
index ae5b9eed793..ec62fbc93ba 100644
--- a/engines/sci/engine/savegame.h
+++ b/engines/sci/engine/savegame.h
@@ -36,7 +36,8 @@ struct EngineState;
*
* Version - new/changed feature
* =============================
- * 45 - Sync stopAfterFading
+ * 46 - Sync MusicEntry::fadeSetVolume and MusicEntry::fadeCompleted
+ * 45 - Sync MusicEntry::stopAfterFading
* 44 - GK2+SCI3 audio resource locks
* 43 - stop saving SCI3 mustSetViewVisible array
* 42 - SCI3 robots and VM objects
@@ -69,7 +70,7 @@ struct EngineState;
*/
enum {
- CURRENT_SAVEGAME_VERSION = 45,
+ CURRENT_SAVEGAME_VERSION = 46,
MINIMUM_SAVEGAME_VERSION = 14
#ifdef ENABLE_SCI32
,
Commit: 133d3fc6d439e05c3053f9878c82d2d1bcf0a94a
https://github.com/scummvm/scummvm/commit/133d3fc6d439e05c3053f9878c82d2d1bcf0a94a
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2022-09-27T16:55:44-04:00
Commit Message:
SCI: SciEngine was accessing itself through globals
Changed paths:
engines/sci/sci.cpp
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index 82d222622a7..11e73f13d12 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -377,7 +377,7 @@ Common::Error SciEngine::run() {
// Jones only initializes its menus when restarting/restoring, thus set
// the gameIsRestarting flag here before initializing. Fixes bug #6536.
- if (g_sci->getGameId() == GID_JONES)
+ if (getGameId() == GID_JONES)
_gamestate->gameIsRestarting = GAMEISRESTARTING_RESTORE;
}
@@ -603,7 +603,7 @@ void SciEngine::initGraphics() {
#ifdef ENABLE_SCI32
if (getSciVersion() >= SCI_VERSION_2) {
// SCI32 graphic objects creation
- if (g_sci->getPlatform() == Common::kPlatformMacintosh && _resMan->hasResourceType(kResourceTypeCursor)) {
+ if (getPlatform() == Common::kPlatformMacintosh && _resMan->hasResourceType(kResourceTypeCursor)) {
_gfxCursor32 = new GfxMacCursor32();
} else {
_gfxCursor32 = new GfxCursor32();
@@ -866,7 +866,7 @@ void SciEngine::sleep(uint32 msecs) {
_eventMan->getSciEvent(kSciEventPeek);
// There is no point in waiting any more if we are just waiting to quit
- if (g_engine->shouldQuit()) {
+ if (shouldQuit()) {
return;
}
@@ -875,7 +875,7 @@ void SciEngine::sleep(uint32 msecs) {
// movement is still occurring and the screen needs to be updated to
// reflect it
if (getSciVersion() >= SCI_VERSION_2) {
- g_sci->_gfxFrameout->updateScreen();
+ _gfxFrameout->updateScreen();
}
#endif
time = g_system->getMillis();
@@ -903,7 +903,7 @@ void SciEngine::setLauncherLanguage() {
case Common::JA_JPN: {
// Set Japanese for FM-Towns games
// KQ5 on FM-Towns has no initial language set
- if (g_sci->getPlatform() == Common::kPlatformFMTowns) {
+ if (getPlatform() == Common::kPlatformFMTowns) {
languageToSet = K_LANG_JAPANESE;
}
}
@@ -975,9 +975,9 @@ void SciEngine::loadMacExecutable() {
}
uint32 SciEngine::getTickCount() {
- return g_engine->getTotalPlayTime() * 60 / 1000;
+ return getTotalPlayTime() * 60 / 1000;
}
void SciEngine::setTickCount(const uint32 ticks) {
- return g_engine->setTotalPlayTime(ticks * 1000 / 60);
+ return setTotalPlayTime(ticks * 1000 / 60);
}
} // End of namespace Sci
Commit: b21af7531fb7ec75b9dfc5d3d76a50125c871a4f
https://github.com/scummvm/scummvm/commit/b21af7531fb7ec75b9dfc5d3d76a50125c871a4f
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2022-09-27T16:55:44-04:00
Commit Message:
SCI: Restrict kGetEvent throttling to fast cast mode
In 2010 a 10 ms delay was added to every kGetEvent call to prevent
maxing out the CPU when some games display message boxes:
b0b4ddcc5232485100fd42dcd14d164a8d2eaeac
This rapid kGetEvent polling is called fast cast and it only exists in
SCI1.1 games and some SCI1 games. It occurs in an inner loop when the
fast cast global is set.
Now the workaround is only applied to fast cast games and only when the
kGetEvent polling occurs.
Removing this 10 ms delay from every SCI16 game cycle doesn't change
game speed by itself because the larger dynamic throttling in
kGameIsRestarting has been absorbing the 10 ms. But this does make the
other throttles easier to understand and work with, and solves minor
edge cases where delays from multiple kGetEvent calls add up.
Changed paths:
engines/sci/engine/kevent.cpp
engines/sci/engine/state.cpp
engines/sci/engine/state.h
engines/sci/graphics/animate.cpp
diff --git a/engines/sci/engine/kevent.cpp b/engines/sci/engine/kevent.cpp
index 247a9733164..afe8082f0a0 100644
--- a/engines/sci/engine/kevent.cpp
+++ b/engines/sci/engine/kevent.cpp
@@ -31,6 +31,7 @@
#include "sci/console.h"
#include "sci/debug.h" // for g_debug_simulated_key
#include "sci/event.h"
+#include "sci/graphics/animate.h"
#include "sci/graphics/coordadjuster.h"
#include "sci/graphics/cursor.h"
#include "sci/graphics/maciconbar.h"
@@ -264,14 +265,13 @@ reg_t kGetEvent(EngineState *s, int argc, reg_t *argv) {
g_sci->_soundCmd->updateSci0Cues();
}
- // Wait a bit here, so that the CPU isn't maxed out when the game
- // is waiting for user input (e.g. when showing text boxes) - bug
- // #5091. Make sure that we're not delaying while the game is
- // benchmarking, as that will affect the final benchmarked result -
- // check bugs #5326 and #5543
- if (s->_gameIsBenchmarking) {
- // Game is benchmarking, don't add a delay
- } else if (getSciVersion() < SCI_VERSION_2) {
+ // Wait a bit if a "fast cast" game is polling kGetEvent while a message is
+ // being said or displayed. This prevents fast cast mode from maxing out
+ // CPU by polling from an inner loop when the fast cast global is set.
+ // Fixes bugs #5091, #5326
+ if (getSciVersion() <= SCI_VERSION_1_1 &&
+ g_sci->_gfxAnimate->isFastCastEnabled() &&
+ !s->variables[VAR_GLOBAL][kGlobalVarFastCast].isNull()) {
g_system->delayMillis(10);
}
diff --git a/engines/sci/engine/state.cpp b/engines/sci/engine/state.cpp
index e94337f2da7..ea0c1d54373 100644
--- a/engines/sci/engine/state.cpp
+++ b/engines/sci/engine/state.cpp
@@ -110,7 +110,6 @@ void EngineState::reset(bool isRestoring) {
_paletteSetIntensityCounter = 0;
_throttleLastTime = 0;
_throttleTrigger = false;
- _gameIsBenchmarking = false;
_lastSaveVirtualId = SAVEGAMEID_OFFICIALRANGE_START;
_lastSaveNewId = 0;
diff --git a/engines/sci/engine/state.h b/engines/sci/engine/state.h
index 08b4446c3fb..733a1fbd0e0 100644
--- a/engines/sci/engine/state.h
+++ b/engines/sci/engine/state.h
@@ -122,7 +122,6 @@ public:
uint32 _paletteSetIntensityCounter; /**< total times kPaletteSetIntensity was invoked since the last call to kGameIsRestarting or kWait */
uint32 _throttleLastTime; /**< last time kAnimate was invoked */
bool _throttleTrigger;
- bool _gameIsBenchmarking;
/* Kernel File IO stuff */
diff --git a/engines/sci/graphics/animate.cpp b/engines/sci/graphics/animate.cpp
index 0a13f126e59..63ce5761ef4 100644
--- a/engines/sci/graphics/animate.cpp
+++ b/engines/sci/graphics/animate.cpp
@@ -739,18 +739,15 @@ void GfxAnimate::throttleSpeed() {
// check further that there is only one cel in that view
GfxView *onlyView = _cache->getView(onlyCast->viewId);
if ((onlyView->getLoopCount() == 1) && (onlyView->getCelCount(0))) {
- _s->_gameIsBenchmarking = true;
return;
}
}
}
- _s->_gameIsBenchmarking = false;
_s->_throttleTrigger = true;
break;
}
default:
// More than 1 entry drawn -> time for speed throttling
- _s->_gameIsBenchmarking = false;
_s->_throttleTrigger = true;
break;
}
Commit: f2cc73662689576e401ac542af6ab2cb357fa21e
https://github.com/scummvm/scummvm/commit/f2cc73662689576e401ac542af6ab2cb357fa21e
Author: Omer Mor (omer.mor at gmail.com)
Date: 2022-09-27T16:55:44-04:00
Commit Message:
SCI: Improve King's Quest 4 detection entries
Changed paths:
engines/sci/detection_tables.h
diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h
index 56d91d55a66..891db8a6680 100644
--- a/engines/sci/detection_tables.h
+++ b/engines/sci/detection_tables.h
@@ -1589,19 +1589,6 @@ static const struct ADGameDescription SciGameDescriptions[] = {
AD_LISTEND},
Common::EN_ANY, Common::kPlatformDOS, 0, GUIO_STD16 },
- // King's Quest 4 - English Amiga (from www.back2roots.org)
- // Executable scanning reports "1.002.032"
- // SCI interpreter version 0.000.685
- {"kq4sci", "SCI", {
- {"resource.map", 0, "f88dd267fb9504d40a04d599c048d42b", 6354},
- {"resource.000", 0, "77615c595388acf3d1df8e107bfb6b52", 138523},
- {"resource.001", 0, "52c2231765eced34faa7f7bcff69df83", 44751},
- {"resource.002", 0, "fb351106ec865fad9af5d78bd6b8e3cb", 663629},
- {"resource.003", 0, "fd16c9c223f7dc5b65f06447615224ff", 683016},
- {"resource.004", 0, "3fac034c7d130e055d05bc43a1f8d5f8", 549993},
- AD_LISTEND},
- Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_STD16_UNDITHER },
-
// King's Quest 4 - English DOS Non-Interactive Demo
// Executable scanning reports "0.000.494"
{"kq4sci", "SCI/Demo", {
@@ -1620,7 +1607,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.004", 0, "851a62d00972dc4002f472cc0d84e71d", 649441},
AD_LISTEND},
Common::EN_ANY, Common::kPlatformDOS, 0, GUIO_STD16_UNDITHER },
-
+
// King's Quest 4 - English DOS (original boxed release, 3 1/2" disks)
// Executable scanning reports "0.000.253"
// K4091988.QA file reports "SCI Version 0.000.247 (2nd rev)"
@@ -1634,20 +1621,49 @@ static const struct ADGameDescription SciGameDescriptions[] = {
AD_LISTEND},
Common::EN_ANY, Common::kPlatformDOS, 0, GUIO_STD16_UNDITHER },
- // King's Quest 4 - English DOS (from the King's Quest Collection)
- // Executable scanning reports "0.000.502"
- // SCI interpreter version 0.000.502
+ // King's Quest 4 - English DOS
+ // SCI interpreter version 0.000.253
{"kq4sci", "SCI", {
- {"resource.map", 0, "3164a39790b599c954ecf716d0b32be8", 7476},
- {"resource.001", 0, "77615c595388acf3d1df8e107bfb6b52", 452523},
- {"resource.002", 0, "77615c595388acf3d1df8e107bfb6b52", 536573},
- {"resource.003", 0, "77615c595388acf3d1df8e107bfb6b52", 707591},
- {"resource.004", 0, "77615c595388acf3d1df8e107bfb6b52", 479562},
+ {"resource.map", 0, "381d9dcb69c626f0a60631dbfec1d13a", 9474},
+ {"resource.001", 0, "0c8566848a76eea19a6d6220914030a7", 191559},
+ {"resource.002", 0, "0c8566848a76eea19a6d6220914030a7", 333345},
+ {"resource.003", 0, "0c8566848a76eea19a6d6220914030a7", 358513},
+ {"resource.004", 0, "0c8566848a76eea19a6d6220914030a7", 326297},
+ {"resource.005", 0, "0c8566848a76eea19a6d6220914030a7", 325102},
+ {"resource.006", 0, "0c8566848a76eea19a6d6220914030a7", 337288},
+ {"resource.007", 0, "0c8566848a76eea19a6d6220914030a7", 343882},
+ AD_LISTEND},
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO_STD16_UNDITHER },
+
+ // King's Quest 4 - English DOS
+ // SCI interpreter version 0.000.274
+ // Game version 1.000.111
+ // Released: September 24th, 1988 (Information from K4092488.QA file)
+ {"kq4sci", "SCI", {
+ {"resource.map", 0, "adbe267662a5915d3c89c9075ec8cf3e", 9474},
+ {"resource.001", 0, "851a62d00972dc4002f472cc0d84e71d", 188239},
+ {"resource.002", 0, "851a62d00972dc4002f472cc0d84e71d", 329895},
+ {"resource.003", 0, "851a62d00972dc4002f472cc0d84e71d", 355385},
+ {"resource.004", 0, "851a62d00972dc4002f472cc0d84e71d", 322951},
+ {"resource.005", 0, "851a62d00972dc4002f472cc0d84e71d", 321593},
+ {"resource.006", 0, "851a62d00972dc4002f472cc0d84e71d", 333777},
+ {"resource.007", 0, "851a62d00972dc4002f472cc0d84e71d", 341038},
+ AD_LISTEND},
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO_STD16_UNDITHER },
+
+ // King's Quest 4 - English DOS
+ // SCI interpreter version 0.000.409
+ // Game version 1.003.006
+ // Released: January 24, 1989 (Information from QAFILE file)
+ {"kq4sci", "SCI", {
+ {"resource.map", 0, "7c86c3c2bb93d581c2f587bfcbcc1617", 5766},
+ {"resource.001", 0, "a3cdb4848fb859fdd302976fff56490f", 1920200},
AD_LISTEND},
Common::EN_ANY, Common::kPlatformDOS, 0, GUIO_STD16_UNDITHER },
// King's Quest 4 - English DOS (supplied by ssburnout in bug report #5270)
- // 1.006.003 8x5.25" (label: Int.#0.000.502)
+ // SCI interpreter version 0.000.502
+ // Game version 1.006.003 8x5.25" (label: Int.#0.000.502)
{"kq4sci", "SCI", {
{"resource.map", 0, "a22b66e6fa0d82460b985e9f7e562950", 9384},
{"resource.001", 0, "6db7de6f93c6ea62dca78abee677f8c0", 174852},
@@ -1660,33 +1676,31 @@ static const struct ADGameDescription SciGameDescriptions[] = {
AD_LISTEND},
Common::EN_ANY, Common::kPlatformDOS, 0, GUIO_STD16_UNDITHER },
- // King's Quest 4 - English DOS
- // SCI interpreter version 0.000.274
+ // King's Quest 4 - English DOS (from the King's Quest Collection)
+ // Executable scanning reports "0.000.502"
+ // SCI interpreter version 0.000.502
+ // Game version 1.006.004
{"kq4sci", "SCI", {
- {"resource.map", 0, "adbe267662a5915d3c89c9075ec8cf3e", 9474},
- {"resource.001", 0, "851a62d00972dc4002f472cc0d84e71d", 188239},
- {"resource.002", 0, "851a62d00972dc4002f472cc0d84e71d", 329895},
- {"resource.003", 0, "851a62d00972dc4002f472cc0d84e71d", 355385},
- {"resource.004", 0, "851a62d00972dc4002f472cc0d84e71d", 322951},
- {"resource.005", 0, "851a62d00972dc4002f472cc0d84e71d", 321593},
- {"resource.006", 0, "851a62d00972dc4002f472cc0d84e71d", 333777},
- {"resource.007", 0, "851a62d00972dc4002f472cc0d84e71d", 341038},
+ {"resource.map", 0, "3164a39790b599c954ecf716d0b32be8", 7476},
+ {"resource.001", 0, "77615c595388acf3d1df8e107bfb6b52", 452523},
+ {"resource.002", 0, "77615c595388acf3d1df8e107bfb6b52", 536573},
+ {"resource.003", 0, "77615c595388acf3d1df8e107bfb6b52", 707591},
+ {"resource.004", 0, "77615c595388acf3d1df8e107bfb6b52", 479562},
AD_LISTEND},
Common::EN_ANY, Common::kPlatformDOS, 0, GUIO_STD16_UNDITHER },
- // King's Quest 4 - English DOS
- // SCI interpreter version 0.000.253
+ // King's Quest 4 - English Amiga (from www.back2roots.org)
+ // Executable scanning reports "1.002.032"
+ // SCI interpreter version 0.000.685
{"kq4sci", "SCI", {
- {"resource.map", 0, "381d9dcb69c626f0a60631dbfec1d13a", 9474},
- {"resource.001", 0, "0c8566848a76eea19a6d6220914030a7", 191559},
- {"resource.002", 0, "0c8566848a76eea19a6d6220914030a7", 333345},
- {"resource.003", 0, "0c8566848a76eea19a6d6220914030a7", 358513},
- {"resource.004", 0, "0c8566848a76eea19a6d6220914030a7", 326297},
- {"resource.005", 0, "0c8566848a76eea19a6d6220914030a7", 325102},
- {"resource.006", 0, "0c8566848a76eea19a6d6220914030a7", 337288},
- {"resource.007", 0, "0c8566848a76eea19a6d6220914030a7", 343882},
+ {"resource.map", 0, "f88dd267fb9504d40a04d599c048d42b", 6354},
+ {"resource.000", 0, "77615c595388acf3d1df8e107bfb6b52", 138523},
+ {"resource.001", 0, "52c2231765eced34faa7f7bcff69df83", 44751},
+ {"resource.002", 0, "fb351106ec865fad9af5d78bd6b8e3cb", 663629},
+ {"resource.003", 0, "fd16c9c223f7dc5b65f06447615224ff", 683016},
+ {"resource.004", 0, "3fac034c7d130e055d05bc43a1f8d5f8", 549993},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO_STD16_UNDITHER },
+ Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_STD16_UNDITHER },
// King's Quest 4 - English Atari ST (double-sided diskettes)
// Game version 1.003.006 (January 12, 1989)
Commit: d813ccf6ce9ae58538cd714c1b276524d9188224
https://github.com/scummvm/scummvm/commit/d813ccf6ce9ae58538cd714c1b276524d9188224
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2022-09-27T16:55:44-04:00
Commit Message:
SCI: Fix LB2 CD interrupted introduction music
Changed paths:
engines/sci/engine/script_patches.cpp
diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp
index 996ce45850c..fe746e44747 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -10004,6 +10004,32 @@ static const uint16 laurabow2CDPatchFixAct5FinaleMusic[] = {
PATCH_END
};
+// During the introduction in room 110 the music is cut off in the CD version
+// instead of waiting for it to complete. This is the same bug as above where
+// changes to the newer Sound class broke a script that worked in floppy.
+//
+// We fix this in the same was as the Act 5 music by testing Sound:handle.
+//
+// Applies to: All CD versions
+// Responsible method: sCartoon:changeState(26)
+static const uint16 laurabow2CDSignatureFixIntroMusic[] = {
+ SIG_MAGICDWORD,
+ 0x38, SIG_UINT16(0x00ab), // pushi 00ab [ prevSignal ]
+ 0x76, // push0
+ 0x81, 0x66, // lag 66
+ 0x4a, 0x04, // send 04 [ gameMusic1 prevSignal? ]
+ 0x36, // push
+ 0x35, 0xff, // ldi ff
+ SIG_END
+};
+
+static const uint16 laurabow2CDPatchFixIntroMusic[] = {
+ 0x38, PATCH_SELECTOR16(handle), // pushi handle
+ PATCH_ADDTOOFFSET(+6),
+ 0x35, 0x00, // ldi 00
+ PATCH_END
+};
+
// LB2CD reduces the music volume significantly during the introduction when
// characters talk while disembarking the ship in room 120. This is done so
// that their speech can be heard but it also occurs in text-only mode.
@@ -10149,6 +10175,7 @@ static const SciScriptPatcherEntry laurabow2Signatures[] = {
{ true, 560, "CD: painting closing immediately", 1, laurabow2CDSignaturePaintingClosing, laurabow2CDPatchPaintingClosing },
{ true, 0, "CD: fix problematic icon bar", 1, laurabow2CDSignatureFixProblematicIconBar, laurabow2CDPatchFixProblematicIconBar },
{ true, 90, "CD: fix yvette's tut response", 1, laurabow2CDSignatureFixYvetteTutResponse, laurabow2CDPatchFixYvetteTutResponse },
+ { true, 110, "CD: fix intro music", 1, laurabow2CDSignatureFixIntroMusic, laurabow2CDPatchFixIntroMusic },
{ true, 350, "CD/Floppy: museum party fix entering south 1/2", 1, laurabow2SignatureMuseumPartyFixEnteringSouth1, laurabow2PatchMuseumPartyFixEnteringSouth1 },
{ true, 350, "CD/Floppy: museum party fix entering south 2/2", 1, laurabow2SignatureMuseumPartyFixEnteringSouth2, laurabow2PatchMuseumPartyFixEnteringSouth2 },
{ true, 430, "CD/Floppy: make wired east door persistent", 1, laurabow2SignatureRememberWiredEastDoor, laurabow2PatchRememberWiredEastDoor },
Commit: 90d2473c0395cbd56af693b40e1e518720755c3d
https://github.com/scummvm/scummvm/commit/90d2473c0395cbd56af693b40e1e518720755c3d
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2022-09-27T16:55:45-04:00
Commit Message:
SCI: Fix "You wins" message in PQ1 poker
Changed paths:
engines/sci/engine/script_patches.cpp
diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp
index fe746e44747..401cbcc3bd6 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -11730,6 +11730,35 @@ static const uint16 pq1vgaPatchFloatOutsideCarols2[] = {
PATCH_END
};
+// When all the poker players fold, the game displays the message "You wins."
+// instead of "You win.". The script that builds the string compares the wrong
+// objects to see who the winner is, and so it always adds the final "s".
+//
+// We fix this by comparing the correct objects.
+//
+// Applies to: English Floppy
+// Responsible method: HandList:winner
+static const uint16 pq1vgaSignaturePokerWinnerMessage[] = {
+ 0x35, 0x00, // ldi 00
+ 0xa3, 0x4a, // sal 4a [ local74 = 0 ]
+ 0x7c, // pushSelf [ hand1First or allHands ]
+ 0x72, SIG_UINT16(0x033c), // lofsa hand1
+ 0x1c, // ne? [ always true ]
+ SIG_ADDTOOFFSET(+51),
+ SIG_MAGICDWORD,
+ 0x8d, 0x06, // lst 06 [ winning hand ]
+ 0x72, SIG_UINT16(0x033c), // lofsa hand1
+ 0x1a, // eq?
+ SIG_END
+};
+
+static const uint16 pq1vgaPatchPokerWinnerMessage[] = {
+ 0x76, // push0
+ 0xab, 0x4a, // ssl 4a [ local74 = 0 ]
+ 0x8d, 0x06, // lst 06 [ winning hand ]
+ PATCH_END
+};
+
// The GOG release includes New Rising Sun's script patches which throttle speed
// in core classes. Since we do our own speed throttling, we patch the scripts
// back to the original code for compatibility.
@@ -11774,6 +11803,7 @@ static const SciScriptPatcherEntry pq1vgaSignatures[] = {
{ true, 30, "float outside carol's (1/2)", 7, pq1vgaSignatureFloatOutsideCarols1, pq1vgaPatchFloatOutsideCarols1 },
{ true, 30, "float outside carol's (2/2)", 1, pq1vgaSignatureFloatOutsideCarols2, pq1vgaPatchFloatOutsideCarols2 },
{ true, 152, "getting stuck while briefing is about to start", 1, pq1vgaSignatureBriefingGettingStuck, pq1vgaPatchBriefingGettingStuck },
+ { true, 156, "poker winner message", 1, pq1vgaSignaturePokerWinnerMessage, pq1vgaPatchPokerWinnerMessage },
{ true, 341, "put gun in locker bug", 1, pq1vgaSignaturePutGunInLockerBug, pq1vgaPatchPutGunInLockerBug },
{ true, 500, "map save/restore bug", 2, pq1vgaSignatureMapSaveRestoreBug, pq1vgaPatchMapSaveRestoreBug },
{ true, 928, "Narrator lockup fix", 1, sciNarratorLockupSignature, sciNarratorLockupPatch },
Commit: 58006e8986eb61eb1e7b4b2783095b1c8079cbcf
https://github.com/scummvm/scummvm/commit/58006e8986eb61eb1e7b4b2783095b1c8079cbcf
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2022-09-27T16:55:45-04:00
Commit Message:
SCI: Document kGameIsRestarting speed throttler
Changed paths:
engines/sci/engine/kmisc.cpp
diff --git a/engines/sci/engine/kmisc.cpp b/engines/sci/engine/kmisc.cpp
index 841300cbc4f..6cf5251777e 100644
--- a/engines/sci/engine/kmisc.cpp
+++ b/engines/sci/engine/kmisc.cpp
@@ -55,9 +55,46 @@ reg_t kRestartGame16(EngineState *s, int argc, reg_t *argv) {
return NULL_REG;
}
-/* kGameIsRestarting():
-** Returns the restarting_flag in acc
-*/
+/**
+ * kGameIsRestarting returns the EngineState::gameIsRestarting flag.
+ * If zero is passed then the flag is cleared before returning its previous value.
+ *
+ * kGameIsRestarting(0) is unique because it is called by (almost) every game from
+ * the game loop (Game:doit, etc) and nowhere else. For that reason, we use this
+ * normally simple function as our main speed throttler. It prevents unthrottled
+ * games from running as fast as the CPU will allow. This creates a consistent
+ * playable experience and avoids the many script bugs that occur when thousands
+ * of game cycles run per second on a modern CPU.
+ *
+ * Early games throttle their own speed by calling kWait on every game cycle.
+ * The delay passed to kWait is the game speed selected by the user. At every speed
+ * except the fastest (kWait(1), or 17 ms) the kWait delay is greater than our
+ * speed throttle delay (30 ms). This means that our kGameIsRestarting throttle
+ * has no effect on these games other than to make the user-selected fastest speed
+ * run barely faster than the next-fastest selection (33 ms). It's unclear if that
+ * is intentional or a side-effect of throttling meant for unthrottled games.
+ * The speed throttling code is over a decade old and its details were uncommented.
+ * There have also been significant fixes to ScummVM's SCI timing code since then.
+ * It may be better to remove kGameIsRestarting throttling from kWait games to
+ * simplify things instead of having two overlapping throttlers run. That would
+ * allow those to run at their original speed when the user selects Fastest.
+ * kWait games are not the ones that run too fast at fast CPU speeds.
+ *
+ * If a scene in a game needs to be throttled further for compatibility then we
+ * add a workaround here. We also use script patches to make unthrottled inner loops
+ * call this function so that the program remains responsive and delays are
+ * consistent instead of CPU-bound.
+ *
+ * kGameIsRestarting was removed from SCI2 but Sierra left it in the PC interpreter
+ * as a no-op. Game scripts kept calling it even though it didn't do anything.
+ * That allows us to keep throttling those games this way; this is why this function
+ * is included in the kernel table for all SCI versions. SCI2 Mac scripts removed
+ * the call so they are unthrottled by this mechanism. They currently run faster
+ * than their PC versions. kGameIsRestarting was completely removed from SCI3.
+ *
+ * SCI2+ games (or versions) that don't call kGameIsRestarting are still limited
+ * to 60fps by GfxFrameout::throttle().
+ */
reg_t kGameIsRestarting(EngineState *s, int argc, reg_t *argv) {
// Always return the previous flag value
const int16 previousRestartingFlag = s->gameIsRestarting;
Commit: 61b3926dd1aa8a177a0fe3a7424f183c5e68483e
https://github.com/scummvm/scummvm/commit/61b3926dd1aa8a177a0fe3a7424f183c5e68483e
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2022-09-27T16:55:45-04:00
Commit Message:
SCI: Add speed_throttle debug command
Allows testing the speed throttler for possible improvements
and to demonstrate what it affects and what it doesn't.
`speed_throttle 0` disables kGameIsRestarting throttling.
(Except for game-specific workarounds.)
This command is possible due to several recent cleanups of other
throttling mechanisms that overlapped and were absorbed by this one.
Changed paths:
engines/sci/console.cpp
engines/sci/console.h
engines/sci/engine/features.h
engines/sci/engine/kmisc.cpp
engines/sci/sci.cpp
engines/sci/sci.h
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp
index aa95cf313c5..0b1c05a3940 100644
--- a/engines/sci/console.cpp
+++ b/engines/sci/console.cpp
@@ -90,6 +90,7 @@ Console::Console(SciEngine *engine) : GUI::Debugger(),
// precaution is taken to assure that all assigned values are in the range
// of the enum type. We should handle this more carefully...
registerVar("script_abort_flag", (int *)&_engine->_gamestate->abortScriptProcessing);
+ registerCmd("speed_throttle", WRAP_METHOD(Console, cmdSpeedThrottle));
// General
registerCmd("help", WRAP_METHOD(Console, cmdHelp));
@@ -320,6 +321,7 @@ bool Console::cmdHelp(int argc, const char **argv) {
debugPrintf("simulated_key: Add a key with the specified scan code to the event list\n");
debugPrintf("track_mouse_clicks: Toggles mouse click tracking to the console\n");
debugPrintf("script_abort_flag: Set to 1 to abort script execution. Set to 2 to force a replay afterwards\n");
+ debugPrintf("speed_throttle: Displays or changes kGameIsRestarting maximum delay\n");
debugPrintf("\n");
debugPrintf("Debug flags\n");
debugPrintf("-----------\n");
@@ -4714,6 +4716,27 @@ bool Console::cmdAddresses(int argc, const char **argv) {
return true;
}
+bool Console::cmdSpeedThrottle(int argc, const char **argv) {
+ if (argc > 2) {
+ debugPrintf("Displays or changes kGameIsRestarting maximum delay in milliseconds\n");
+ debugPrintf("usage: %s [<delay>]\n", argv[0]);
+ return true;
+ }
+ if (argc == 2) {
+ int newDelay;
+ if (!parseInteger(argv[1], newDelay)) {
+ return true;
+ }
+ if (newDelay < 0) {
+ debugPrintf("invalid delay\n");
+ return true;
+ }
+ _engine->_speedThrottleDelay = newDelay;
+ }
+ debugPrintf("kGameIsRestarting maximum delay: %d ms\n", _engine->_speedThrottleDelay);
+ return true;
+}
+
// Returns 0 on success
static int parse_reg_t(EngineState *s, const char *str, reg_t *dest) {
// Pointer to the part of str which contains a numeric offset (if any)
diff --git a/engines/sci/console.h b/engines/sci/console.h
index 6772768b485..918be2799a5 100644
--- a/engines/sci/console.h
+++ b/engines/sci/console.h
@@ -175,6 +175,8 @@ private:
bool cmdViewObject(int argc, const char **argv);
bool cmdViewActiveObject(int argc, const char **argv);
bool cmdViewAccumulatorObject(int argc, const char **argv);
+ // Variables
+ bool cmdSpeedThrottle(int argc, const char **argv);
bool parseInteger(const char *argument, int &result);
bool parseResourceNumber36(const char *userParameter, uint16 &resourceNumber, uint32 &resourceTuple);
diff --git a/engines/sci/engine/features.h b/engines/sci/engine/features.h
index 0702b007414..f07d58d6e3f 100644
--- a/engines/sci/engine/features.h
+++ b/engines/sci/engine/features.h
@@ -49,6 +49,10 @@ enum MessageTypeSyncStrategy {
#endif
};
+enum {
+ kSpeedThrottleDefaultDelay = 30 // kGameIsRestarting default max delay in ms
+};
+
class GameFeatures {
public:
GameFeatures(SegManager *segMan, Kernel *kernel);
diff --git a/engines/sci/engine/kmisc.cpp b/engines/sci/engine/kmisc.cpp
index 6cf5251777e..63a4b8b5248 100644
--- a/engines/sci/engine/kmisc.cpp
+++ b/engines/sci/engine/kmisc.cpp
@@ -108,7 +108,7 @@ reg_t kGameIsRestarting(EngineState *s, int argc, reg_t *argv) {
return make_reg(0, previousRestartingFlag);
}
- uint32 neededSleep = 30;
+ uint32 neededSleep = g_sci->_speedThrottleDelay; // 30 ms (kSpeedThrottleDefaultDelay)
// WORKAROUNDS for scripts that are polling too quickly in scenes that
// are not animating much
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index 11e73f13d12..2b413e95907 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -119,6 +119,7 @@ SciEngine::SciEngine(OSystem *syst, const ADGameDescription *desc, SciGameId gam
_guestAdditions(nullptr),
_opcode_formats(nullptr),
_debugState(),
+ _speedThrottleDelay(kSpeedThrottleDefaultDelay),
_gameDescription(desc),
_gameId(gameId),
_resMan(nullptr),
diff --git a/engines/sci/sci.h b/engines/sci/sci.h
index fe89fed3d0f..e198e5ddebc 100644
--- a/engines/sci/sci.h
+++ b/engines/sci/sci.h
@@ -308,6 +308,7 @@ public:
opcode_format (*_opcode_formats)[4];
DebugState _debugState;
+ uint32 _speedThrottleDelay; // kGameIsRestarting maximum delay
Common::MacResManager *getMacExecutable() { return &_macExecutable; }
Commit: 6cf2ac17f9a8133cc32d5bd00a6d170fb92362c8
https://github.com/scummvm/scummvm/commit/6cf2ac17f9a8133cc32d5bd00a6d170fb92362c8
Author: treloret (eotws at hotmail.com)
Date: 2022-09-27T16:55:45-04:00
Commit Message:
SCI: Added detection for SCI fanmade games and removed unused gameid
Changed paths:
engines/sci/detection.cpp
engines/sci/detection_tables.h
diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp
index f2e03ffba42..3e0a39330f3 100644
--- a/engines/sci/detection.cpp
+++ b/engines/sci/detection.cpp
@@ -130,8 +130,6 @@ static const PlainGameDescriptor s_sciGameTitles[] = {
{"gk1demo", "Gabriel Knight: Sins of the Fathers"},
{"qfg4demo", "Quest for Glory IV: Shadows of Darkness"},
{"pq4demo", "Police Quest IV: Open Season"},
- // === SCI1.1+ games ======================================================
- {"catdate", "The Dating Pool"},
// === SCI2 games =========================================================
{"gk1", "Gabriel Knight: Sins of the Fathers"},
{"pq4", "Police Quest IV: Open Season"}, // floppy is SCI2, CD SCI2.1
diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h
index 891db8a6680..d4e507c43cb 100644
--- a/engines/sci/detection_tables.h
+++ b/engines/sci/detection_tables.h
@@ -6092,11 +6092,13 @@ static const struct ADGameDescription SciGameDescriptions[] = {
FANMADE("Curt's Quest 1.1", "54084c29346683296e45ef32d7ae74f3", 1128, "c851182cdf6fc6a81b840f4d4875f1a0", 302000),
FANMADE("Demo Quest", "c89a0c9e0a4e4af0ecedb300a3b31dbf", 384, "a32f3495ba24764cba091119cc3f1e13", 160098),
FANMADE("Dr. Jummybummy's Space Adventure 2", "6ae6cb7de423f51736d9487b4ca0c6da", 810, "26e5b563f578e104d79689f36568b7cf", 394670),
+ FANMADE("Dr. Jummybummy's Space Adventure 2 v1.0", "d689721ebf598b5ed84993057c7bd8d9", 4782, "9f748aac2f78a70a89d417f31989daea", 2247273),
FANMADE("Edy Oliver into the Cave of Whistling Skulls Demo", "eba0a0e86768ee3f14e78fecbc5af011", 2388, "4f6eab79a0f7980960eed101ab8122ad", 2601551),
FANMADE("Footsteps Sound Demo", "d9dabee6e1550b1fdb793f442f227738", 372, "06561df40dea49c6e84184e0ba6f19cb", 114212),
FANMADE_L("Grostesteing: Plus Mechant que Jamais", "ec9a97ccb134f69249f6ea8b16c13d8e", 1500, "b869f5f11bfe2ab5f67f4f0c618f2ce1", 464657, "resource.001", Common::FR_FRA), // FIXME: Accent
FANMADE("Humanoid Demo", "97d8331293a6d57e8bad58c1efc89a63", 624, "fb354b9abe64011b12159e45d724633f", 452320),
FANMADE("Island of Secrets Demo 0.3", "61279176c3e4530fec9b578877aecda7", 504, "7f4ed7a81b86bea22c62bc98e6d9ec39", 197790),
+ FANMADE("Island of Secrets Demo 0.4", "a8ec7759c8014cf1383a3fe0f0897d0e", 786, "89c61a9d00c63fd94621879a927aad17", 303359),
FANMADE("Jim's Quest 1: The Phantom Thesis", "0af50be1d3f0cb77a09137709a76ef4f", 960, "9c042c136548b20d9183495668e03526", 496446),
FANMADE("King's Quest II SCI Pre-Alpha Version", "cdea1c081022e7697a1afffb1d2f9f6a", 2646, "fb2ce39002c3e05f3d83533638dea105", 2310356),
FANMADE("Knight's Quest Demo 1.0", "5e816edf993956752ed06fccfeeae6d9", 1260, "959321f88a22905fa1f8c6d897874744", 703836),
@@ -6107,7 +6109,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
FANMADE("New Year's Mystery", "e4dcab1b1d3cb4a2c070a07a9c9589e0", 708, "e00ca5e44fd4e98d8174b467b31b0f21", 295425),
FANMADE("New Year's Mystery (Updated)", "efd1beb5120293725065c95959144f81", 714, "b3bd3c2372ed6efa28adb12403c4c31a", 305027),
FANMADE("Ocean Battle", "c2304a0568e0eb84f8e9a0915f01170a", 408, "46c520c1ac9b63528854d0f58c7e1b74", 142234),
- FANMADE("Osama", "db8f1710453cfbecf4214b2946970043", 390, "7afd75d4620dedf97a84ae8f0a7523cf", 123827),
+ FANMADE("Osama Been Skatin'", "db8f1710453cfbecf4214b2946970043", 390, "7afd75d4620dedf97a84ae8f0a7523cf", 123827),
FANMADE("Quest for the Cheat", "a359d4cf27f98264b42b55c017671214", 882, "8a943029f73c4bc85d454b7f473455ba", 455209),
FANMADE("Robust Parse Demo 1.2", "c956d40b6eb42292ec328c510acb11d8", 540, "26f092bab5ec4490737d8463fd3ebbd5", 229044),
FANMADE("SCI Capture the Flag", "4cd679a51d93b8b27c6b38d81be24b8b", 432, "98ae1f6ed7b4c21f88addbf643dd1d2f", 147878),
@@ -6120,7 +6122,13 @@ static const struct ADGameDescription SciGameDescriptions[] = {
FANMADE("SCI Programming April 2010 Competition Template", "36e5c4011dd7c92e1ae4c6fede7d698d", 456, "20c87fbb7f73e2a3eb2c5dfab4d76b5a", 142221),
FANMADE("SCI Studio Template 3.0", "ca0dc8d586e0a8670b7621cde090b532", 354, "58a48ee692a86c0575e6bd0b00a92b9a", 113097),
FANMADE("SCI Quest", "9067e1f1e54436d2dbfce855524bc84a", 552, "ffa7d355cd9223f245289108a696bcd2", 149634),
+#if 0
+ // Disabled, this crashes into: [VM] kFGets[2b]: signature mismatch in method TitleScreen::init (room 3052, script 800, localCall ffffffff)!
+ FANMADE("SCI Tetris", "a268f84a293e6f8bbb55f6a41541c6cb", 384, "4da38a05d9752e787770e560a8f54fe6", 138974),
+#endif
+ FANMADE11("SCI VGA Demo Update-Remake", "8913c0855eac223de6a86b3fc1af67c1", 439, "31d4283d8a9d52833df0d1e91dd702ec", 299311),
FANMADE("SCI-Man", "3ab85bd39a86c11f85781764f9db09bb", 468, "bb8f9992f504a242bf0860e3588e150b", 131810),
+ FANMADE("Scene Builder", "981de9fc7ecfc26631a5aec5c4e09bfe", 1842, "8faf71a4f7d89618d1346c1d60cd3074", 820847),
FANMADE("Soulshade Asylum", "965a07e7fb6fd9563b94c969b72cfe2a", 546, "57401d18559985e569085a69edda691e", 244786),
FANMADE("Text Views Demo", "ad0485a96470566517f184ff5dd049f8", 372, "727b946b37588ed334737732c55007c4", 115788),
FANMADE("The Black Cauldron Demo", "5e1ff2833c7f33ebcfa456ba836e2067", 2592, "2f8e6264d2db91bb54982ab8aa18b3b4", 1881839),
@@ -6138,12 +6146,16 @@ static const struct ADGameDescription SciGameDescriptions[] = {
// Itch.IO 2019 release: more bug fixes and polish
FANMADE11("The Dating Pool Demo (Itch.IO 2019)", "1f7b68ed422eadbf373cc8611bc56f94", 1393, "094b9d3c841fe60076f06cdef3fb1383", 1555073),
// Reported in #11071
- FANMADE11("The Dating Pool Demo (2019 One Day)", "736656f6debeaf8c8f53ef4f4825511a", 1303, "4d6f521253ec67d0f1bd38c29c91c806", 915171),
+ FANMADE11("The Dating Pool Demo (2016 One Day)", "736656f6debeaf8c8f53ef4f4825511a", 1303, "4d6f521253ec67d0f1bd38c29c91c806", 915171),
FANMADE("The Farm Nightmare", "fb6cbfddaa7c055e2c3d8cf4c683a7db", 906, "50655e8b8925f717e698e08f006f40be", 338303),
FANMADE("The Gem Scenario", "ef5f61f4d2c6d31122d3e2baf89ad976", 642, "2f16be390dd90c3d7ca1c8a594ac0bfa", 244794),
FANMADE("The Legend of the Lost Jewel", "ba1bca315e3818c5626eda51bcfbcccf", 636, "9b0736d69924af0cff32a0f78db96855", 300398),
FANMADE("The Sect of Achturan", "130ee6a9137005cdd4a26c38fa21576a", 1626, "1faf42afbfdb782f61ceaa1ee6243b76", 961705),
FANMADE("Winter Wonderland", "c1ffaf8327462effd4ad21eeed9eea59", 504, "5d48666dc62f90d852a1d0de6e69195f", 305076),
+#if 0
+ // Disabled, this crashes into: ERROR: Uninitialized read for temp 2 from method ::export 1 (room 516, script 505, localCall ffffffff)!
+ FANMADE("Zork Demo", "1e449214ed0738cb868e09249a24dbb6", 3480, "0f24d70ab8a51155a3a62f4495847afd", 335957),
+#endif
FANMADE11("Zork: The Great Underground Empire", "65f0731485faca4ee568b74e2f59d850", 3518, "e5d4790b6e8fa1b9a9691b22d541012b", 2460903),
// FIXME: The vga demo does not have a resource.000/001 file.
Commit: 822c0ed64480bbbfa48a912402ddf04bc3995446
https://github.com/scummvm/scummvm/commit/822c0ed64480bbbfa48a912402ddf04bc3995446
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2022-09-27T16:55:45-04:00
Commit Message:
SCI: Add entry for LB2 French fan translation
Changed paths:
engines/sci/detection_tables.h
diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h
index d4e507c43cb..1dc515cff47 100644
--- a/engines/sci/detection_tables.h
+++ b/engines/sci/detection_tables.h
@@ -2562,18 +2562,16 @@ static const struct ADGameDescription SciGameDescriptions[] = {
AD_LISTEND},
Common::EN_ANY, Common::kPlatformDOS, 0, GUIO_STD16 },
- // Laura Bow 2 - English DOS CD (from "The Roberta Williams Antology"/1996)
+ // Laura Bow 2 - English DOS CD
// Executable scanning reports "1.001.072", VERSION file reports "1.1" (from jvprat)
- // SCI interpreter version 1.001.069 (just a guess)
{"laurabow2", "CD", {
{"resource.map", 0, "a70945e61ba7ac7bfea6b7bd72c6aec5", 7274},
{"resource.000", 0, "82578b8d5a7e09c4c58891ca49fae35b", 5598672},
AD_LISTEND},
Common::EN_ANY, Common::kPlatformDOS, ADGF_CD, GUIO_STD16_SPEECH },
- // Laura Bow 2 - Korean fan translation, based on English DOS CD (from "The Roberta Williams Antology"/1996)
- // Executable scanning reports "1.001.072", VERSION file reports "1.1" (from jvprat)
- // SCI interpreter version 1.001.069 (just a guess)
+ // Laura Bow 2 - Korean fan translation, based on English DOS CD
+ // Executable scanning reports "1.001.072", VERSION file reports "1.1"
{"laurabow2", "CD", {
{"resource.map", 0, "a70945e61ba7ac7bfea6b7bd72c6aec5", 7274},
{"resource.000", 0, "82578b8d5a7e09c4c58891ca49fae35b", 5598672},
@@ -2581,6 +2579,15 @@ static const struct ADGameDescription SciGameDescriptions[] = {
AD_LISTEND},
Common::KO_KOR, Common::kPlatformDOS, ADGF_CD, GUIO_STD16_SPEECH },
+ // Laura Bow 2 - French fan translation, based on English DOS CD
+ // Executable scanning reports "1.001.072", VERSION file reports "1.1"
+ {"laurabow2", "CD", {
+ {"resource.map", 0, "a70945e61ba7ac7bfea6b7bd72c6aec5", 7274},
+ {"resource.000", 0, "82578b8d5a7e09c4c58891ca49fae35b", 5598672},
+ {"patch/0.fon", 0, "539b7c355c8b7915de2c0396790c46aa", 2767},
+ AD_LISTEND},
+ Common::FR_FRA, Common::kPlatformDOS, ADGF_CD, GUIO_STD16_SPEECH },
+
// Laura Bow 2 v1.1 - French DOS Floppy (from Hkz)
{"laurabow2", "", {
{"resource.map", 0, "3b6dfbcda210bbc3f23fd1927113bf98", 6483},
Commit: ed8ba1d3ccf6298da95dacadee44a754f1b8e900
https://github.com/scummvm/scummvm/commit/ed8ba1d3ccf6298da95dacadee44a754f1b8e900
Author: eientei (einstein95 at users.noreply.github.com)
Date: 2022-09-27T16:55:45-04:00
Commit Message:
SCI: Add detection for QFG2 v1.105 (5x5.25")
Changed paths:
engines/sci/detection_tables.h
diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h
index 1dc515cff47..bc4a314bb8d 100644
--- a/engines/sci/detection_tables.h
+++ b/engines/sci/detection_tables.h
@@ -3055,6 +3055,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
Common::EN_ANY, Common::kPlatformDOS, 0, GUIO_STD16_UNDITHER },
// Larry 3 - English DOS
+ // Game version 1.003, 1989-10-27
// SCI interpreter version 0.000.572
{"lsl3", "", {
{"resource.map", 0, "0f429f5186f96d6c501838a1cb44bd43", 7452},
@@ -3210,6 +3211,8 @@ static const struct ADGameDescription SciGameDescriptions[] = {
Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO_STD16 },
// Larry 5 - English DOS (from spookypeanut)
+ // Game version 1.000, 1991-09-11
+ // Executable scanning reports "T.A00.169"
// SCI interpreter version 1.000.510
{"lsl5", "", {
{"resource.map", 0, "be00ef895197754ae4eab021ca44cbcd", 6417},
@@ -4633,6 +4636,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
Common::EN_ANY, Common::kPlatformDOS, 0, GUIO_STD16_UNDITHER },
// Quest for Glory 1 VGA Remake - English DOS
+ // VERSION file reports "2.000"
// Executable scanning reports "2.000.411"
{"qfg1vga", "VGA", {
{"resource.map", 0, "a731fb6c9c0b282443f7027bc8694d4c", 8469},
@@ -4715,10 +4719,13 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.005", 0, "5f08242f962293be8fb852f183342350", 478071},
{"resource.006", 0, "5e9deacbdb17198ad844988e04833520", 498593},
{"resource.007", 0, "2ac1e6fea9aa1f5b91a06693a67b9766", 490151},
+ {"resource.008", 0, "5e85f6cf401eaad1bbd5dd978da81f47", 482914},
+ {"resource.009", 0, "9fa9a4326a5026e13a3afdbabc1e2abd", 480904},
AD_LISTEND},
Common::EN_ANY, Common::kPlatformDOS, 0, GUIO_STD16_UNDITHER },
// Quest for Glory 2 - English (from FRG)
+ // 1.102 5x5.25" (label: INT#11.20.90)
// Executable scanning reports "1.000.072"
{"qfg2", "", {
{"resource.map", 0, "bc79c5685c00edab3ad6df18691703bc", 6906},
@@ -4730,21 +4737,6 @@ static const struct ADGameDescription SciGameDescriptions[] = {
AD_LISTEND},
Common::EN_ANY, Common::kPlatformDOS, 0, GUIO_STD16_UNDITHER },
- // Quest for Glory 2 - English DOS
- // Executable scanning reports "1.000.072"
- {"qfg2", "", {
- {"resource.map", 0, "be23af27e9557bf232efe213ac7f277c", 8166},
- {"resource.000", 0, "a17e374c4d33b81208c862bc0ffc1a38", 212120},
- {"resource.001", 0, "e08d7887e30b12008c40f9570447711a", 331973},
- {"resource.002", 0, "df137dc7869cab07e1149ba2333c815c", 467505},
- {"resource.003", 0, "df137dc7869cab07e1149ba2333c815c", 502560},
- {"resource.004", 0, "df137dc7869cab07e1149ba2333c815c", 488541},
- {"resource.005", 0, "df137dc7869cab07e1149ba2333c815c", 478688},
- {"resource.006", 0, "b1944bd664ddbd2859cdaa0c4a0d6281", 507489},
- {"resource.007", 0, "cd2de58e27665d5853530de93fae7cd6", 490794},
- AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO_STD16_UNDITHER },
-
// Quest for Glory 2 - English DOS (supplied by digitoxin1 in bug report #6116)
// v1.102 9x3.5" (label: Int#11.20.90)
{"qfg2", "", {
@@ -4757,6 +4749,39 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.005", 0, "df137dc7869cab07e1149ba2333c815c", 478574},
{"resource.006", 0, "b1944bd664ddbd2859cdaa0c4a0d6281", 507489},
{"resource.007", 0, "cd2de58e27665d5853530de93fae7cd6", 490794},
+ {"resource.008", 0, "977a3706f90dd1b4770b6628a4af4530", 483289},
+ {"resource.009", 0, "9fa9a4326a5026e13a3afdbabc1e2abd", 485301},
+ AD_LISTEND},
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO_STD16_UNDITHER },
+
+ // Quest for Glory 2 - English DOS
+ // v1.105, 5x5.25"
+ // Executable scanning reports "1.000.087"
+ {"qfg2", "", {
+ {"resource.map", 0, "275abaeab8bcc20776c43e543c405832", 6906},
+ {"resource.000", 0, "a17e374c4d33b81208c862bc0ffc1a38", 212120},
+ {"resource.001", 0, "e08d7887e30b12008c40f9570447711a", 867967},
+ {"resource.002", 0, "df137dc7869cab07e1149ba2333c815c", 790794},
+ {"resource.003", 0, "b192607c42f6960ecdf2ad2e4f90e9bc", 972806},
+ {"resource.004", 0, "cd2de58e27665d5853530de93fae7cd6", 983617},
+ AD_LISTEND},
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO_STD16_UNDITHER },
+
+ // Quest for Glory 2 - English DOS
+ // v1.105, 9x3.5" (label: INT#12.7.90)
+ // Executable scanning reports "1.000.087"
+ {"qfg2", "", {
+ {"resource.map", 0, "be23af27e9557bf232efe213ac7f277c", 8166},
+ {"resource.000", 0, "a17e374c4d33b81208c862bc0ffc1a38", 212120},
+ {"resource.001", 0, "e08d7887e30b12008c40f9570447711a", 331973},
+ {"resource.002", 0, "df137dc7869cab07e1149ba2333c815c", 467505},
+ {"resource.003", 0, "df137dc7869cab07e1149ba2333c815c", 502560},
+ {"resource.004", 0, "df137dc7869cab07e1149ba2333c815c", 488541},
+ {"resource.005", 0, "df137dc7869cab07e1149ba2333c815c", 478688},
+ {"resource.006", 0, "b1944bd664ddbd2859cdaa0c4a0d6281", 507489},
+ {"resource.007", 0, "cd2de58e27665d5853530de93fae7cd6", 490794},
+ {"resource.008", 0, "977a3706f90dd1b4770b6628a4af4530", 483289},
+ {"resource.009", 0, "9fa9a4326a5026e13a3afdbabc1e2abd", 485303},
AD_LISTEND},
Common::EN_ANY, Common::kPlatformDOS, 0, GUIO_STD16_UNDITHER },
@@ -4805,6 +4830,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"qfg3", "", {
{"resource.map", 0, "19e2bf9b693932b5e2bb59b9f9ab86c9", 5958},
{"resource.000", 0, "6178ad2e83e58e4671ca03315f7a6498", 5868042},
+ {"resource.msg", 0, "b15bc88d223082ee676551569512e937", 279694},
AD_LISTEND},
Common::DE_DEU, Common::kPlatformDOS, 0, GUIO_STD16 },
@@ -4861,7 +4887,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
GAMEOPTION_HQ_VIDEO)
// Quest for Glory 4 1.1 Floppy - English DOS (supplied by markcool in bug report #4280)
- // SCI interpreter version 2.000.000 (a guess?)
+ // SCI interpreter version 2.000.000
{"qfg4", "", {
{"resource.map", 0, "685bdb1ed47bbbb0e5e25db392da83ce", 9301},
{"resource.000", 0, "f64fd6aa3977939a86ff30783dd677e1", 11004993},
Commit: 1f67f23e1307cf5873759ff72cb8dc4131bd5d99
https://github.com/scummvm/scummvm/commit/1f67f23e1307cf5873759ff72cb8dc4131bd5d99
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2022-09-27T16:55:45-04:00
Commit Message:
SCI: Add name filtering to functions debug command
Changed paths:
engines/sci/console.cpp
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp
index 0b1c05a3940..dee07f95154 100644
--- a/engines/sci/console.cpp
+++ b/engines/sci/console.cpp
@@ -621,9 +621,18 @@ bool Console::cmdKernelFunctions(int argc, const char **argv) {
const Common::String &kernelName = _engine->getKernel()->getKernelName(seeker);
if (kernelName == "Dummy")
continue;
- debugPrintf("%03x: %20s | ", seeker, kernelName.c_str());
- if ((column++ % 3) == 2)
- debugPrintf("\n");
+
+ if (argc == 1) {
+ debugPrintf("%03x: %20s | ", seeker, kernelName.c_str());
+ if ((column++ % 3) == 2)
+ debugPrintf("\n");
+ } else {
+ for (int i = 1; i < argc; ++i) {
+ if (kernelName.equalsIgnoreCase(argv[i])) {
+ debugPrintf("%03x: %s\n", seeker, kernelName.c_str());
+ }
+ }
+ }
}
debugPrintf("\n");
Commit: b5f7445062dea1695b1a9fbecd440cfef2d04715
https://github.com/scummvm/scummvm/commit/b5f7445062dea1695b1a9fbecd440cfef2d04715
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2022-09-27T16:55:45-04:00
Commit Message:
SCI: Set correct SCI1.1 fade-complete signal value
As the comment says, the signal value is 0x00fe.
Verified in LB2 CD interpreter.
Changed paths:
engines/sci/sound/soundcmd.cpp
diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp
index e1edbac3f37..ea30ed0b37a 100644
--- a/engines/sci/sound/soundcmd.cpp
+++ b/engines/sci/sound/soundcmd.cpp
@@ -632,7 +632,7 @@ void SoundCommandParser::processUpdateCues(reg_t obj) {
// fireworks).
// It is also needed in other games, e.g. LSL6 when talking to the
// receptionist (bug #5601).
- // TODO: More thorougly check the different SCI version:
+ // TODO: More thoroughly check the different SCI version:
// * SCI1late sets signal to 0xFE here. (With signal 0xFF
// duplicate music plays in LauraBow2CD - bug #6462)
// SCI1middle LSL1 1.000.510 does not have the 0xFE;
@@ -641,7 +641,7 @@ void SoundCommandParser::processUpdateCues(reg_t obj) {
// * Need to check SCI0 behaviour.
uint16 sig;
if (getSciVersion() >= SCI_VERSION_1_LATE)
- sig = 0xFFFE;
+ sig = 0x00fe;
else
sig = SIGNAL_OFFSET;
writeSelectorValue(_segMan, obj, SELECTOR(signal), sig);
Commit: 4785b06e33a34707090c608c626f8ae6fdbcee93
https://github.com/scummvm/scummvm/commit/4785b06e33a34707090c608c626f8ae6fdbcee93
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2022-09-27T16:55:45-04:00
Commit Message:
SCI: Fix kDoSoundFade SCI1+ behavior when sound not playing
In SCI1 and later, kDoSoundFade does not test a sound's status.
Incoming fade properties are applied regardless of whether the
sound is playing and kDoSoundFade does not set the signal.
The code that's been doing this was added and updated in 2010
for ICEMAN and LSL3. Now it's only applied to SCI0 calls.
e41874c91d4e658289664e7ea5eddc2c89a03c34
f743468ec7174088dffde0fd1a61d3afcf78280b
Verified in QFG2 1.000, JONES CD, and LB2 CD.
Fixes scenes in LB2 where multiple songs occasionally play at the
same time due to broken fade-outs. Hiding behind the tapestry
during a meeting is the one that occurred the most consistently.
Related to bug #6462
Changed paths:
engines/sci/sound/soundcmd.cpp
diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp
index ea30ed0b37a..4640b334ce2 100644
--- a/engines/sci/sound/soundcmd.cpp
+++ b/engines/sci/sound/soundcmd.cpp
@@ -463,15 +463,15 @@ reg_t SoundCommandParser::kDoSoundFade(EngineState *s, int argc, reg_t *argv) {
}
#endif
- // If sound is not playing currently, set signal directly
- if (musicSlot->status != kSoundPlaying) {
- debugC(kDebugLevelSound, "kDoSound(fade): %04x:%04x fading requested, but sound is currently not playing", PRINT_REG(obj));
- writeSelectorValue(_segMan, obj, SELECTOR(signal), SIGNAL_OFFSET);
- return s->r_acc;
- }
-
switch (argc) {
case 1: // SCI0
+ // If sound is not playing currently, set signal directly
+ if (musicSlot->status != kSoundPlaying) {
+ debugC(kDebugLevelSound, "kDoSound(fade): %04x:%04x fading requested, but sound is currently not playing", PRINT_REG(obj));
+ writeSelectorValue(_segMan, obj, SELECTOR(signal), SIGNAL_OFFSET);
+ return s->r_acc;
+ }
+
// SCI0 fades out all the time and when fadeout is done it will also
// stop the music from playing
musicSlot->fadeTo = 0;
Commit: c75b4665d9718f64cc9288b5e2ddfceafe780517
https://github.com/scummvm/scummvm/commit/c75b4665d9718f64cc9288b5e2ddfceafe780517
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2022-09-27T16:55:45-04:00
Commit Message:
SCI: Fix LB2 museum music script bugs
Changed paths:
engines/sci/engine/script_patches.cpp
diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp
index 401cbcc3bd6..ae5f8b53c20 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -10030,6 +10030,92 @@ static const uint16 laurabow2CDPatchFixIntroMusic[] = {
PATCH_END
};
+// At the start of act 4, if actBreak (room 26) finishes before its music fades
+// out then the CD version gets stuck playing the happy act break music instead
+// of the suspenseful museum music. This happens when quickly closing the
+// message at the end of the break or even if the message is just one of the
+// shorter ones. This is another CD regression due to Sound class changes.
+//
+// actBreak plays sound 30 using gameMusic1. After the act 4 break, rm510:init
+// re-initializes music with WrapMusic:init. WrapMusic also uses gameMusic1,
+// and it only plays a new sound if gameMusic1:prevSignal equals 0 or -1.
+// In floppy versions this was always true because Sound:play resets prevSignal
+// to 0, but CD doesn't. gameMusic1:prevSignal is 254 at the end of act 3 so if
+// the actBreak fade completes in the CD version then the interpreter sets the
+// signal to -1 and the music correctly changes. But if rm510:init runs before
+// the fade completes then WrapMusic keeps playing sound 30 throughout act 4.
+//
+// We fix this by setting gameMusic1:prevSignal to 0 at the end of actBreak.
+// We make room by overwriting a script's dispose call. The call is unnecessary
+// because the room is already changing and that also disposes the script.
+//
+// Applies to: English CD
+// Responsible method: sBreakIt:changeState(9)
+static const uint16 laurabow2CDSignatureFixAct4WrongMusic[] = {
+ 0x81, 0x66, // lag 66
+ 0x4a, 0x0c, // send 0c [ gameMusic1 fade: ... ]
+ 0xc1, 0x7b, // +ag 7b
+ 0x35, 0x00, // ldi 00
+ 0xa1, SIG_MAGICDWORD, 0x7c, // sag 7c
+ 0x38, SIG_UINT16(0x0183), // pushi 0183 [ newRoom, CD selector ]
+ SIG_ADDTOOFFSET(+7),
+ 0x39, 0x6f, // pushi dispose
+ 0x76, // push0
+ 0x54, 0x04, // self 04 [ self dispose: (unnecessary )]
+ SIG_END
+};
+
+static const uint16 laurabow2CDPatchFixAct4WrongMusic[] = {
+ 0x38, PATCH_UINT16(0x00ab), // pushi 00ab [ prevSignal ]
+ 0x78, // push1
+ 0x76, // push0
+ 0xc1, 0x7b, // +ag 7b
+ 0x76, // push0
+ 0xa9, 0x7c, // ssg 7c
+ PATCH_ADDTOOFFSET(+10),
+ 0x80, PATCH_UINT16(0x0066), // lag 0066
+ 0x4a, 0x12, // send 12 [ gameMusic1 fade: ... prevSignal: 0 ]
+ PATCH_END
+};
+
+// The music volume in acts 3 and 4 can be permanently lowered by clock chimes.
+//
+// In acts 3 and 4, WrapMusic plays sounds 90 through 93 in a loop in most
+// museum rooms. WrapMusic:vol contains the volume that the music should start
+// at and fade to when unpausing. It's initialized to 127 (max) and no other
+// scripts change this. WrapMusic:vol is effectively the maximum volume for the
+// gameMusic1 Sound object. Once lowered, it can never be raised.
+//
+// WrapMusic:cue records gameMusic1:vol in WrapMusic:vol when both objects are
+// in certain states. When a body is discovered, multiple fades occur at once,
+// and if the clock is shown then it applies its own fades and tries to save
+// and restore all other Sound volumes. Depending on timings such as the game
+// speed setting and the system clock's sub-second value, WrapMusic:cue can run
+// when gameMusic1:vol is less than 127. This permanently lowers the volume and
+// can occur multiple times. It's most likely to occur when discovering the
+// body in the dinosaur room (430).
+//
+// We fix this by always updating WrapMusic:vol to 127 since the game doesn't
+// expect it to change. This also fixes save games created before this patch.
+//
+// Applies to: All versions
+// Responsible method: WrapMusic:cue
+static const uint16 laurabow2SignatureMuseumMusicVolume[] = {
+ 0x39, 0x5e, // pushi vol [ same selector in all versions ]
+ 0x76, // push0
+ 0x63, 0x16, // pToa wrapSound
+ SIG_MAGICDWORD,
+ 0x4a, 0x04, // send 04 [ wrapSound vol? ]
+ 0x65, 0x1c, // aTop vol
+ SIG_END
+};
+
+static const uint16 laurabow2PatchMuseumMusicVolume[] = {
+ 0x35, 0x7f, // ldi 7f
+ 0x32, PATCH_UINT16(0x0002), // jmp 0002 [ vol = 127 ]
+ PATCH_END
+};
+
// LB2CD reduces the music volume significantly during the introduction when
// characters talk while disembarking the ship in room 120. This is done so
// that their speech can be heard but it also occurs in text-only mode.
@@ -10173,7 +10259,9 @@ static const uint16 laurabow2CDPatchAudioTextMenuSupport2[] = {
// script, description, signature patch
static const SciScriptPatcherEntry laurabow2Signatures[] = {
{ true, 560, "CD: painting closing immediately", 1, laurabow2CDSignaturePaintingClosing, laurabow2CDPatchPaintingClosing },
+ { true, 0, "CD/Floppy: museum music volume", 1, laurabow2SignatureMuseumMusicVolume, laurabow2PatchMuseumMusicVolume },
{ true, 0, "CD: fix problematic icon bar", 1, laurabow2CDSignatureFixProblematicIconBar, laurabow2CDPatchFixProblematicIconBar },
+ { true, 26, "CD: fix act 4 wrong music", 1, laurabow2CDSignatureFixAct4WrongMusic, laurabow2CDPatchFixAct4WrongMusic },
{ true, 90, "CD: fix yvette's tut response", 1, laurabow2CDSignatureFixYvetteTutResponse, laurabow2CDPatchFixYvetteTutResponse },
{ true, 110, "CD: fix intro music", 1, laurabow2CDSignatureFixIntroMusic, laurabow2CDPatchFixIntroMusic },
{ true, 350, "CD/Floppy: museum party fix entering south 1/2", 1, laurabow2SignatureMuseumPartyFixEnteringSouth1, laurabow2PatchMuseumPartyFixEnteringSouth1 },
Commit: c9c151c35cd3de99647f1bc5a2551b95d530a794
https://github.com/scummvm/scummvm/commit/c9c151c35cd3de99647f1bc5a2551b95d530a794
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2022-09-27T16:55:45-04:00
Commit Message:
SCI: Fix LB2 error when clicking dagger case
Changed paths:
engines/sci/engine/script_patches.cpp
diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp
index ae5f8b53c20..a6f3816fb74 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -9640,6 +9640,31 @@ static const uint16 laurabow2PatchFixArmorHallDoorPathfinding[] = {
PATCH_END
};
+// Clicking most inventory items on the Dagger of Amon Ra case in the Egyptian
+// exhibit errors the floppy versions. The doVerb methods contain nonsensical
+// instructions that attempt to access a non-existent class and property.
+// This would silently fail in the original. It was fixed in the CD version.
+//
+// We patch out the illegal class instructions to avoid the error.
+//
+// Applies to: All floppy versions
+// Responsible methods: glass:doVerb, daggerCase:doVerb
+static const uint16 laurabow2SignatureFixDaggerCaseError[] = {
+ 0x81, SIG_MAGICDWORD, 0x5b, // lag 5b
+ 0x4a, 0x0a, // send 4a
+ 0x33, SIG_ADDTOOFFSET(+1), // jmp [ end of method ]
+ 0x50, SIG_ADDTOOFFSET(+2), // class ????
+ SIG_END
+};
+
+static const uint16 laurabow2PatchFixDaggerCaseError[] = {
+ PATCH_ADDTOOFFSET(+6),
+ 0x18, // not [ acc = 1 ]
+ 0x3a, // toss
+ 0x48, // ret
+ PATCH_END
+};
+
// The crate room (room 460) in act 5 locks up the game if you enter from the
// elevator (room 660), swing the hanging crate, and then attempt to leave
// back through the elevator door.
@@ -10269,6 +10294,7 @@ static const SciScriptPatcherEntry laurabow2Signatures[] = {
{ true, 430, "CD/Floppy: make wired east door persistent", 1, laurabow2SignatureRememberWiredEastDoor, laurabow2PatchRememberWiredEastDoor },
{ true, 430, "CD/Floppy: fix wired east door", 1, laurabow2SignatureFixWiredEastDoor, laurabow2PatchFixWiredEastDoor },
{ true, 448, "CD/Floppy: fix armor hall door pathfinding", 1, laurabow2SignatureFixArmorHallDoorPathfinding, laurabow2PatchFixArmorHallDoorPathfinding },
+ { true, 450, "Floppy: fix dagger case error", 2, laurabow2SignatureFixDaggerCaseError, laurabow2PatchFixDaggerCaseError },
{ true, 460, "CD/Floppy: fix crate room east door lockup", 1, laurabow2SignatureFixCrateRoomEastDoorLockup, laurabow2PatchFixCrateRoomEastDoorLockup },
{ true, 2660, "CD/Floppy: fix elevator lockup", 1, laurabow2SignatureFixElevatorLockup, laurabow2PatchFixElevatorLockup },
{ true, 550, "CD/Floppy: fix back rub east entrance lockup", 1, laurabow2SignatureFixBackRubEastEntranceLockup, laurabow2PatchFixBackRubEastEntranceLockup },
Commit: 24ad186b95370d2ed94a9e47f312e4f0d12fcee1
https://github.com/scummvm/scummvm/commit/24ad186b95370d2ed94a9e47f312e4f0d12fcee1
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2022-09-27T16:55:45-04:00
Commit Message:
SCI: Fix LB2 CD Wolf and O'Riley actor loops
Changed paths:
engines/sci/engine/script_patches.cpp
diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp
index a6f3816fb74..1f8729586bd 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -9446,6 +9446,43 @@ static const uint16 laurabow2CDPatchFixYvetteTutResponse[] = {
PATCH_END
};
+// In the CD version, Wolf stands facing the wrong direction in most scenes.
+// O'Riley also does this in the Old Masters Gallery. Their views were reduced
+// from nine loops to five in the CD version, but the scripts weren't updated.
+// They still set the actors' loops to eight instead of four. kAnimate adjusts
+// invalid cels and the result is usually the last cel in the last loop, which
+// is the actor standing facing north west.
+//
+// We fix this by setting the correct loop in the CD version so that Wolf and
+// O'Riley face the direction the scripts request like in the floppy versions.
+// This patch is only enabled in the CD version since the scripts don't change.
+//
+// Applies to: English CD
+// Responsible methods: sPartysOver:changeState, rm400:init, sHeimlichShoos:changeState
+// sEnterNorth:changeState, rm500:init, rm650:init
+static const uint16 laurabow2CDSignatureFixMuseumActorLoops1[] = {
+ 0x38, SIG_SELECTOR16(setLoop), // pushi setLoop
+ 0x78, // push1
+ 0x39, SIG_MAGICDWORD, 0x08, // pushi 08 [ standing loop in floppy ]
+ 0x38, SIG_SELECTOR16(setCel), // pushi setCel
+ SIG_END
+};
+
+static const uint16 laurabow2CDSignatureFixMuseumActorLoops2[] = {
+ 0x39, SIG_SELECTOR8(loop), // pushi loop
+ 0x78, // push1
+ SIG_MAGICDWORD,
+ 0x39, 0x08, // pushi 08 [ standing loop in floppy ]
+ 0x39, SIG_SELECTOR8(cel), // pushi cel
+ SIG_END
+};
+
+static const uint16 laurabow2CDPatchFixMuseumActorLoops[] = {
+ PATCH_ADDTOOFFSET(+4),
+ 0x39, 0x04, // pushi 04 [ standing loop in CD ]
+ PATCH_END
+};
+
// When entering the main musem party room (w/ the golden Egyptian head), Laura
// is walking a bit into the room automatically. If you press a mouse button
// while this is happening, you will get stuck inside that room and won't be
@@ -10291,11 +10328,15 @@ static const SciScriptPatcherEntry laurabow2Signatures[] = {
{ true, 110, "CD: fix intro music", 1, laurabow2CDSignatureFixIntroMusic, laurabow2CDPatchFixIntroMusic },
{ true, 350, "CD/Floppy: museum party fix entering south 1/2", 1, laurabow2SignatureMuseumPartyFixEnteringSouth1, laurabow2PatchMuseumPartyFixEnteringSouth1 },
{ true, 350, "CD/Floppy: museum party fix entering south 2/2", 1, laurabow2SignatureMuseumPartyFixEnteringSouth2, laurabow2PatchMuseumPartyFixEnteringSouth2 },
+ { false, 355, "CD: fix museum actor loops", 2, laurabow2CDSignatureFixMuseumActorLoops1, laurabow2CDPatchFixMuseumActorLoops },
{ true, 430, "CD/Floppy: make wired east door persistent", 1, laurabow2SignatureRememberWiredEastDoor, laurabow2PatchRememberWiredEastDoor },
{ true, 430, "CD/Floppy: fix wired east door", 1, laurabow2SignatureFixWiredEastDoor, laurabow2PatchFixWiredEastDoor },
{ true, 448, "CD/Floppy: fix armor hall door pathfinding", 1, laurabow2SignatureFixArmorHallDoorPathfinding, laurabow2PatchFixArmorHallDoorPathfinding },
+ { false, 400, "CD: fix museum actor loops", 4, laurabow2CDSignatureFixMuseumActorLoops1, laurabow2CDPatchFixMuseumActorLoops },
+ { false, 420, "CD: fix museum actor loops", 1, laurabow2CDSignatureFixMuseumActorLoops1, laurabow2CDPatchFixMuseumActorLoops },
{ true, 450, "Floppy: fix dagger case error", 2, laurabow2SignatureFixDaggerCaseError, laurabow2PatchFixDaggerCaseError },
{ true, 460, "CD/Floppy: fix crate room east door lockup", 1, laurabow2SignatureFixCrateRoomEastDoorLockup, laurabow2PatchFixCrateRoomEastDoorLockup },
+ { false, 500, "CD: fix museum actor loops", 3, laurabow2CDSignatureFixMuseumActorLoops1, laurabow2CDPatchFixMuseumActorLoops },
{ true, 2660, "CD/Floppy: fix elevator lockup", 1, laurabow2SignatureFixElevatorLockup, laurabow2PatchFixElevatorLockup },
{ true, 550, "CD/Floppy: fix back rub east entrance lockup", 1, laurabow2SignatureFixBackRubEastEntranceLockup, laurabow2PatchFixBackRubEastEntranceLockup },
{ true, 550, "CD/Floppy: fix disappearing desk items", 1, laurabow2SignatureFixDisappearingDeskItems, laurabow2PatchFixDisappearingDeskItems },
@@ -10304,6 +10345,7 @@ static const SciScriptPatcherEntry laurabow2Signatures[] = {
{ true, 448, "CD/Floppy: handle armor hall room events", 1, laurabow2SignatureHandleArmorRoomEvents, laurabow2PatchHandleArmorRoomEvents },
{ true, 600, "Floppy: fix bugs with meat", 1, laurabow2FloppySignatureFixBugsWithMeat, laurabow2FloppyPatchFixBugsWithMeat },
{ true, 600, "CD: fix bugs with meat", 1, laurabow2CDSignatureFixBugsWithMeat, laurabow2CDPatchFixBugsWithMeat },
+ { false, 650, "CD: fix museum actor loops", 1, laurabow2CDSignatureFixMuseumActorLoops2, laurabow2CDPatchFixMuseumActorLoops },
{ true, 480, "CD: fix act 5 finale music", 1, laurabow2CDSignatureFixAct5FinaleMusic, laurabow2CDPatchFixAct5FinaleMusic },
{ true, 28, "disable speed test", 1, sci11SpeedTestSignature, sci11SpeedTestPatch },
{ true, 120, "CD: disable intro volume change in text mode", 1, laurabow2CDSignatureIntroVolumeChange, laurabow2CDPatchIntroVolumeChange },
@@ -24054,6 +24096,9 @@ void ScriptPatcher::processScript(uint16 scriptNr, SciSpan<byte> scriptData) {
break;
case GID_LAURABOW2:
if (g_sci->isCD()) {
+ // Enable patches due views having fewer loops in the CD version
+ enablePatch(signatureTable, "CD: fix museum actor loops");
+
// Enables Dual mode patches (audio + subtitles at the same time) for Laura Bow 2
enablePatch(signatureTable, "CD: audio + text support");
}
Commit: 1629fc5ee251f5b8a1a6af1ca45f7d0e6c3f3ab7
https://github.com/scummvm/scummvm/commit/1629fc5ee251f5b8a1a6af1ca45f7d0e6c3f3ab7
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2022-09-27T16:55:46-04:00
Commit Message:
SCI: Fix previous LB2 CD script patch
Changed paths:
engines/sci/engine/script_patches.cpp
diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp
index 1f8729586bd..3aad157d320 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -9468,6 +9468,12 @@ static const uint16 laurabow2CDSignatureFixMuseumActorLoops1[] = {
SIG_END
};
+static const uint16 laurabow2CDPatchFixMuseumActorLoops1[] = {
+ PATCH_ADDTOOFFSET(+4),
+ 0x39, 0x04, // pushi 04 [ standing loop in CD ]
+ PATCH_END
+};
+
static const uint16 laurabow2CDSignatureFixMuseumActorLoops2[] = {
0x39, SIG_SELECTOR8(loop), // pushi loop
0x78, // push1
@@ -9477,8 +9483,8 @@ static const uint16 laurabow2CDSignatureFixMuseumActorLoops2[] = {
SIG_END
};
-static const uint16 laurabow2CDPatchFixMuseumActorLoops[] = {
- PATCH_ADDTOOFFSET(+4),
+static const uint16 laurabow2CDPatchFixMuseumActorLoops2[] = {
+ PATCH_ADDTOOFFSET(+3),
0x39, 0x04, // pushi 04 [ standing loop in CD ]
PATCH_END
};
@@ -10328,15 +10334,15 @@ static const SciScriptPatcherEntry laurabow2Signatures[] = {
{ true, 110, "CD: fix intro music", 1, laurabow2CDSignatureFixIntroMusic, laurabow2CDPatchFixIntroMusic },
{ true, 350, "CD/Floppy: museum party fix entering south 1/2", 1, laurabow2SignatureMuseumPartyFixEnteringSouth1, laurabow2PatchMuseumPartyFixEnteringSouth1 },
{ true, 350, "CD/Floppy: museum party fix entering south 2/2", 1, laurabow2SignatureMuseumPartyFixEnteringSouth2, laurabow2PatchMuseumPartyFixEnteringSouth2 },
- { false, 355, "CD: fix museum actor loops", 2, laurabow2CDSignatureFixMuseumActorLoops1, laurabow2CDPatchFixMuseumActorLoops },
+ { false, 355, "CD: fix museum actor loops", 2, laurabow2CDSignatureFixMuseumActorLoops1, laurabow2CDPatchFixMuseumActorLoops1 },
{ true, 430, "CD/Floppy: make wired east door persistent", 1, laurabow2SignatureRememberWiredEastDoor, laurabow2PatchRememberWiredEastDoor },
{ true, 430, "CD/Floppy: fix wired east door", 1, laurabow2SignatureFixWiredEastDoor, laurabow2PatchFixWiredEastDoor },
{ true, 448, "CD/Floppy: fix armor hall door pathfinding", 1, laurabow2SignatureFixArmorHallDoorPathfinding, laurabow2PatchFixArmorHallDoorPathfinding },
- { false, 400, "CD: fix museum actor loops", 4, laurabow2CDSignatureFixMuseumActorLoops1, laurabow2CDPatchFixMuseumActorLoops },
- { false, 420, "CD: fix museum actor loops", 1, laurabow2CDSignatureFixMuseumActorLoops1, laurabow2CDPatchFixMuseumActorLoops },
+ { false, 400, "CD: fix museum actor loops", 4, laurabow2CDSignatureFixMuseumActorLoops1, laurabow2CDPatchFixMuseumActorLoops1 },
+ { false, 420, "CD: fix museum actor loops", 1, laurabow2CDSignatureFixMuseumActorLoops1, laurabow2CDPatchFixMuseumActorLoops1 },
{ true, 450, "Floppy: fix dagger case error", 2, laurabow2SignatureFixDaggerCaseError, laurabow2PatchFixDaggerCaseError },
{ true, 460, "CD/Floppy: fix crate room east door lockup", 1, laurabow2SignatureFixCrateRoomEastDoorLockup, laurabow2PatchFixCrateRoomEastDoorLockup },
- { false, 500, "CD: fix museum actor loops", 3, laurabow2CDSignatureFixMuseumActorLoops1, laurabow2CDPatchFixMuseumActorLoops },
+ { false, 500, "CD: fix museum actor loops", 3, laurabow2CDSignatureFixMuseumActorLoops1, laurabow2CDPatchFixMuseumActorLoops1 },
{ true, 2660, "CD/Floppy: fix elevator lockup", 1, laurabow2SignatureFixElevatorLockup, laurabow2PatchFixElevatorLockup },
{ true, 550, "CD/Floppy: fix back rub east entrance lockup", 1, laurabow2SignatureFixBackRubEastEntranceLockup, laurabow2PatchFixBackRubEastEntranceLockup },
{ true, 550, "CD/Floppy: fix disappearing desk items", 1, laurabow2SignatureFixDisappearingDeskItems, laurabow2PatchFixDisappearingDeskItems },
@@ -10345,7 +10351,7 @@ static const SciScriptPatcherEntry laurabow2Signatures[] = {
{ true, 448, "CD/Floppy: handle armor hall room events", 1, laurabow2SignatureHandleArmorRoomEvents, laurabow2PatchHandleArmorRoomEvents },
{ true, 600, "Floppy: fix bugs with meat", 1, laurabow2FloppySignatureFixBugsWithMeat, laurabow2FloppyPatchFixBugsWithMeat },
{ true, 600, "CD: fix bugs with meat", 1, laurabow2CDSignatureFixBugsWithMeat, laurabow2CDPatchFixBugsWithMeat },
- { false, 650, "CD: fix museum actor loops", 1, laurabow2CDSignatureFixMuseumActorLoops2, laurabow2CDPatchFixMuseumActorLoops },
+ { false, 650, "CD: fix museum actor loops", 1, laurabow2CDSignatureFixMuseumActorLoops2, laurabow2CDPatchFixMuseumActorLoops2 },
{ true, 480, "CD: fix act 5 finale music", 1, laurabow2CDSignatureFixAct5FinaleMusic, laurabow2CDPatchFixAct5FinaleMusic },
{ true, 28, "disable speed test", 1, sci11SpeedTestSignature, sci11SpeedTestPatch },
{ true, 120, "CD: disable intro volume change in text mode", 1, laurabow2CDSignatureIntroVolumeChange, laurabow2CDPatchIntroVolumeChange },
Commit: 5b72be7de401ee91bd614042ec9bd66ec7a2fd87
https://github.com/scummvm/scummvm/commit/5b72be7de401ee91bd614042ec9bd66ec7a2fd87
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2022-09-27T16:55:46-04:00
Commit Message:
SCI: Update KQ4 1.003.006 entry with original files
Changed paths:
engines/sci/detection_tables.h
diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h
index bc4a314bb8d..de829468f48 100644
--- a/engines/sci/detection_tables.h
+++ b/engines/sci/detection_tables.h
@@ -1655,9 +1655,13 @@ static const struct ADGameDescription SciGameDescriptions[] = {
// SCI interpreter version 0.000.409
// Game version 1.003.006
// Released: January 24, 1989 (Information from QAFILE file)
+ // Resource files are identical to Atari ST 1.003.006
{"kq4sci", "SCI", {
- {"resource.map", 0, "7c86c3c2bb93d581c2f587bfcbcc1617", 5766},
- {"resource.001", 0, "a3cdb4848fb859fdd302976fff56490f", 1920200},
+ {"resource.map", 0, "8800cd62b1eee93752099986dc704a16", 7416},
+ {"resource.001", 0, "a3cdb4848fb859fdd302976fff56490f", 450790},
+ {"resource.002", 0, "a3cdb4848fb859fdd302976fff56490f", 535276},
+ {"resource.003", 0, "a3cdb4848fb859fdd302976fff56490f", 705074},
+ {"resource.004", 0, "a3cdb4848fb859fdd302976fff56490f", 478366},
AD_LISTEND},
Common::EN_ANY, Common::kPlatformDOS, 0, GUIO_STD16_UNDITHER },
@@ -1706,6 +1710,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
// Game version 1.003.006 (January 12, 1989)
// SCI interpreter version 1.001.008
// Provided by fischersfritz in bug report #5518
+ // Resource files are identical to DOS 1.003.006
{"kq4sci", "SCI", {
{"resource.map", 0, "8800cd62b1eee93752099986dc704a16", 7416},
{"resource.001", 0, "a3cdb4848fb859fdd302976fff56490f", 450790},
Commit: 680929f807fbdfe702da33afadd868a3df577da3
https://github.com/scummvm/scummvm/commit/680929f807fbdfe702da33afadd868a3df577da3
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2022-09-27T16:55:46-04:00
Commit Message:
SCI: Disable volume reset on fan games
Also, add a patch for another variant of the volume slider bug in fan games.
Fixes bug #13795
Changed paths:
engines/sci/engine/script_patches.cpp
diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp
index 3aad157d320..b31138d0b04 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -1839,7 +1839,7 @@ static const uint16 fanmadePatchDemoQuestInfiniteLoop[] = {
//
// Applies to: Fan games built with the SCI Studio / SCI Companion SCI0 template
// Responsible method: TheMenuBar:handleEvent
-static const uint16 fangameSignatureVolumeSlider[] = {
+static const uint16 fangameSignatureVolumeSlider1[] = {
0x39, SIG_SELECTOR8(doit), // pushi doit
SIG_ADDTOOFFSET(+1), // push1 [ opcode 79 instead of 78 in some games ]
SIG_ADDTOOFFSET(+1), // push2 [ opcode 7b instead of 7a in some games ]
@@ -1850,7 +1850,7 @@ static const uint16 fangameSignatureVolumeSlider[] = {
SIG_END
};
-static const uint16 fangamePatchVolumeSlider[] = {
+static const uint16 fangamePatchVolumeSlider1[] = {
PATCH_ADDTOOFFSET(+3),
0x39, 0x01, // pushi 01
0x38, PATCH_UINT16(0x0008), // pushi 0008 [ volume ]
@@ -1858,10 +1858,71 @@ static const uint16 fangamePatchVolumeSlider[] = {
PATCH_END
};
+static const uint16 fangameSignatureVolumeSlider2[] = {
+ 0x38, SIG_SELECTOR16(doit), // pushi doit
+ 0x39, 0x01, // pushi 01
+ 0x39, 0x02, // pushi 02
+ SIG_MAGICDWORD,
+ 0x38, SIG_UINT16(0x0008), // pushi 0808 [ volume ]
+ 0x8d, 0x03, // lst 03 [ uninitialized variable ]
+ 0x43, 0x31, 0x04, // callk DoSound 04 [ set volume and return previous ]
+ SIG_END
+};
+
+static const uint16 fangamePatchVolumeSlider2[] = {
+ PATCH_ADDTOOFFSET(+5),
+ 0x39, 0x01, // pushi 01
+ PATCH_ADDTOOFFSET(+3),
+ 0x33, 0x00, // jmp 00
+ 0x43, 0x31, 0x02, // callk DoSound 02 [ return volume ]
+ PATCH_END
+};
+
+// Fan games based on the SCI Studio template reset their volume to 15 (max) in
+// the init method of their game object in script 0. As with most SCI32 games,
+// we patch this out so that the volume stored in ScummVM is used.
+//
+// Applies to: Fan games built with the SCI Studio / SCI Companion SCI0 template
+// Responsible method: Template:init (the Game object in script 0)
+// Fixes bug: #13795
+static const uint16 fangameSignatureVolumeReset1[] = {
+ 0x35, 0x0f, // ldi 0f
+ SIG_ADDTOOFFSET(+1), 0x1d, // sag 1d [ sag or sal depending on compiler ]
+ SIG_ADDTOOFFSET(+1), // push2 [ opcode 7b instead of 7a in some games ]
+ 0x39, 0x08, // pushi 08 [ volume ]
+ SIG_ADDTOOFFSET(+1), // lsg 1d [ lsg or lsl depending on compiler ]
+ SIG_MAGICDWORD, 0x1d,
+ 0x43, 0x31, 0x04, // callk DoSound 04
+ SIG_END
+};
+
+static const uint16 fangamePatchVolumeReset1[] = {
+ 0x33, 0x0a, // jmp 0a
+ PATCH_END
+};
+
+static const uint16 fangameSignatureVolumeReset2[] = {
+ 0x34, SIG_UINT16(0x000f), // ldi 0f
+ 0xa1, 0x1d, // sag 1d
+ 0x39, 0x02, // pushi 02
+ 0x38, SIG_UINT16(0x0008), // pushi 0008 [ volume ]
+ 0x89, SIG_MAGICDWORD, 0x1d, // lsg 1d
+ 0x43, 0x31, 0x04, // callk DoSound 04
+ SIG_END
+};
+
+static const uint16 fangamePatchVolumeReset2[] = {
+ 0x33, 0x0d, // jmp 0d
+ PATCH_END
+};
+
// script, description, signature patch
static const SciScriptPatcherEntry fanmadeSignatures[] = {
+ { true, 0, "SCI Template: disable volume reset", 1, fangameSignatureVolumeReset1, fangamePatchVolumeReset1 },
+ { true, 0, "SCI Template: disable volume reset", 1, fangameSignatureVolumeReset2, fangamePatchVolumeReset2 },
{ true, 994, "Cascade Quest: fix auto-saving", 1, fanmadeSignatureCascadeQuestFixAutoSaving, fanmadePatchCascadeQuestFixAutoSaving },
- { true, 997, "SCI Template: fix volume slider", 1, fangameSignatureVolumeSlider, fangamePatchVolumeSlider },
+ { true, 997, "SCI Template: fix volume slider", 1, fangameSignatureVolumeSlider1, fangamePatchVolumeSlider1 },
+ { true, 997, "SCI Template: fix volume slider", 1, fangameSignatureVolumeSlider2, fangamePatchVolumeSlider2 },
{ true, 999, "Demo Quest: infinite loop on typo", 1, fanmadeSignatureDemoQuestInfiniteLoop, fanmadePatchDemoQuestInfiniteLoop },
SCI_SIGNATUREENTRY_TERMINATOR
};
Commit: 71967f6d3044e790f750f641dff5e07899ffcb1c
https://github.com/scummvm/scummvm/commit/71967f6d3044e790f750f641dff5e07899ffcb1c
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2022-09-27T16:55:46-04:00
Commit Message:
SCI32: Fix kDoSoundPause sample behavior in LSL6HIRES
Fixes bug #13555
Changed paths:
engines/sci/sound/soundcmd.cpp
diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp
index 4640b334ce2..2e7f4f23807 100644
--- a/engines/sci/sound/soundcmd.cpp
+++ b/engines/sci/sound/soundcmd.cpp
@@ -396,10 +396,17 @@ reg_t SoundCommandParser::kDoSoundPause(EngineState *s, int argc, reg_t *argv) {
// perform this action, but the architecture of the ScummVM
// implementation is so different that it doesn't matter here
if (_soundVersion >= SCI_VERSION_2_1_EARLY && musicSlot->isSample) {
- if (shouldPause) {
- g_sci->_audio32->pause(ResourceId(kResourceTypeAudio, musicSlot->resourceId), musicSlot->soundObj);
- } else {
- g_sci->_audio32->resume(ResourceId(kResourceTypeAudio, musicSlot->resourceId), musicSlot->soundObj);
+ // LSL6HIRES didn't support pausing samples with kDoSoundFade. Its interpreter's
+ // pause code didn't call kDoAudio. This feature appeared in PQ4 CD's interpreter
+ // a month later, according to the date strings, even though they have the same
+ // version string. LSL6HIRES door sounds depend on these pause calls not having
+ // any effect. Bug #13555
+ if (g_sci->getGameId() != GID_LSL6HIRES) {
+ if (shouldPause) {
+ g_sci->_audio32->pause(ResourceId(kResourceTypeAudio, musicSlot->resourceId), musicSlot->soundObj);
+ } else {
+ g_sci->_audio32->resume(ResourceId(kResourceTypeAudio, musicSlot->resourceId), musicSlot->soundObj);
+ }
}
} else
#endif
Commit: 71a269afa1ba9047fa38d59ce658c09b35876b06
https://github.com/scummvm/scummvm/commit/71a269afa1ba9047fa38d59ce658c09b35876b06
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2022-09-27T16:55:46-04:00
Commit Message:
SCI32: Fix modulo opcode in SCI2.1Late and SCI3
Fixes LSL7 ocean motion, bug #10270
Changed paths:
engines/sci/engine/vm_types.cpp
diff --git a/engines/sci/engine/vm_types.cpp b/engines/sci/engine/vm_types.cpp
index 17de3b1fca8..517778b781b 100644
--- a/engines/sci/engine/vm_types.cpp
+++ b/engines/sci/engine/vm_types.cpp
@@ -137,9 +137,16 @@ reg_t reg_t::operator%(const reg_t right) const {
warning("Modulo of a negative number has been requested for SCI0. This *could* lead to issues");
int16 value = toSint16();
int16 modulo = ABS(right.toSint16());
- int16 result = value % modulo;
- if (result < 0)
- result += modulo;
+ int16 result;
+ if (getSciVersion() <= SCI_VERSION_2_1_MIDDLE) {
+ result = value % modulo;
+ if (result < 0)
+ result += modulo;
+ } else {
+ // SCI2.1 Late and SCI3 treat the dividend as unsigned.
+ // LSL7 ocean motion depends on this. Bug #10270
+ result = (uint16)value % modulo;
+ }
return make_reg(0, result);
} else
return lookForWorkaround(right, "modulo");
Commit: a17915cbef96fa78ffb7a8fe0a04d35a15bcfdf5
https://github.com/scummvm/scummvm/commit/a17915cbef96fa78ffb7a8fe0a04d35a15bcfdf5
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2022-09-27T16:55:46-04:00
Commit Message:
SCI32: Implement accurate kMulDiv calculations
kMulDiv's behavior now matches SSCI and produces the same results.
Fixes LSL7 motion ocean, bug #10270
Changed paths:
engines/sci/engine/kmath.cpp
diff --git a/engines/sci/engine/kmath.cpp b/engines/sci/engine/kmath.cpp
index 07dd0a308df..daf94ae76f5 100644
--- a/engines/sci/engine/kmath.cpp
+++ b/engines/sci/engine/kmath.cpp
@@ -274,9 +274,9 @@ reg_t kTimesCot(EngineState *s, int argc, reg_t *argv) {
#ifdef ENABLE_SCI32
reg_t kMulDiv(EngineState *s, int argc, reg_t *argv) {
- int16 multiplicant = argv[0].toSint16();
- int16 multiplier = argv[1].toSint16();
- int16 denominator = argv[2].toSint16();
+ int multiplicant = argv[0].toSint16();
+ int multiplier = argv[1].toSint16();
+ int denominator = argv[2].toSint16();
// Sanity check...
if (!denominator) {
@@ -284,7 +284,11 @@ reg_t kMulDiv(EngineState *s, int argc, reg_t *argv) {
return NULL_REG;
}
- return make_reg(0, multiplicant * multiplier / denominator);
+ int result = (abs(multiplicant * multiplier) + abs(denominator) / 2) / abs(denominator);
+ if (multiplicant && ((multiplicant / abs(multiplicant)) * multiplier * denominator < 0))
+ result = -result;
+
+ return make_reg(0, (int16)result);
}
#endif
Commit: 8276bad5e49a517b31dcb7418d5e13cb7b6a6b79
https://github.com/scummvm/scummvm/commit/8276bad5e49a517b31dcb7418d5e13cb7b6a6b79
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2022-09-27T16:55:46-04:00
Commit Message:
SCI: Fix QFG3 Laibon Teller options
This is a follow-up to the script patches for the dead-end event
bugs in the Laibon's hut: 6e743a97efe438b638b3f27e39b853a5b011ff61
Those patches had the unintended side effect of allowing two dialogue
options during an event where they shouldn't be available. Now their
logic is updated to match the other patches so that they only appear
during their intended event.
Fixes bug #13748
Changed paths:
engines/sci/engine/script_patches.cpp
diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp
index b31138d0b04..86fb2d6d6f1 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -14792,6 +14792,49 @@ static const uint16 qfg3PatchLaibonHutEntrance2[] = {
PATCH_END // ne? [ Haven't paid Laibon the bride price ]
};
+// The Laibon's Teller needs updating to be compatible with the above script
+// patches for the events in his hut. There are two options that should only
+// appear in Event 6 before paying the bride's price: a "Leopardman" option and
+// "Marriage". The script enforces this by simply testing that Johari's state
+// is 2, which is the value for having entered the hut with all of the items.
+// This assumes that this can only happen in Event 6, but that was one of the
+// logic problems that we fixed, so this global can now also be 2 in Event 5.
+//
+// We fix this by only showing these Teller options when Johari's state is 2 and
+// the room is Event 6.
+//
+// Applies to: All versions
+// Responsible method: laibonTell:showDialog
+// Fixes bug: #13748
+static const uint16 qfg3SignatureLaibonTeller[] = {
+ 0x88, SIG_UINT16(0x0188), // lsg 0188 [ johari state ]
+ SIG_MAGICDWORD,
+ 0x35, 0x02, // ldi 02
+ 0x1a, // eq? [ entered with bride price? ]
+ 0x36, // push
+ 0x39, 0xcf, // pushi cf [ Marriage cond 49 ]
+ 0x88, SIG_UINT16(0x0188), // lsg 0188 [ johari state ]
+ 0x35, 0x02, // ldi 02
+ 0x1a, // eq? [ entered with bride price? ]
+ 0x36, // push
+ SIG_END
+};
+
+static const uint16 qfg3PatchLaibonTeller[] = {
+ 0x80, PATCH_UINT16(0x0188), // lag 0188 [ johari state ]
+ 0x7a, // push2
+ 0x1a, // eq? [ entered with bride price? ]
+ 0x36, // push
+ 0x83, 0x0b, // lal 0b [ room event ]
+ 0x39, 0x06, // pushi 06
+ 0x1a, // eq? [ is room event 6? ]
+ 0x12, // and
+ 0x36, // push
+ 0x39, 0xcf, // pushi cf [ Marriage cond 49 ]
+ 0x36, // push
+ PATCH_END
+};
+
// script, description, signature patch
static const SciScriptPatcherEntry qfg3Signatures[] = {
{ true, 944, "import dialog continuous calls", 1, qfg3SignatureImportDialog, qfg3PatchImportDialog },
@@ -14810,6 +14853,7 @@ static const SciScriptPatcherEntry qfg3Signatures[] = {
{ true, 450, "laibon hut events (2/3)", 1, qfg3SignatureLaibonHutEvents2, qfg3PatchLaibonHutEvents2 },
{ true, 450, "laibon hut events (3/3)", 1, qfg3SignatureLaibonHutEvents3, qfg3PatchLaibonHutEvents3 },
{ true, 450, "NRS: laibon hut events (3/3)", 1, qfg3SignatureNrsLaibonHutEvents3, qfg3PatchNrsLaibonHutEvents3 },
+ { true, 450, "laibon teller", 1, qfg3SignatureLaibonTeller, qfg3PatchLaibonTeller },
{ true, 460, "NRS: floating spears", 1, qfg3SignatureNrsFloatingSpears, qfg3PatchNrsFloatingSpears },
{ true, 510, "ring rope prize", 1, qfg3SignatureRingRopePrize, qfg3PatchRingRopePrize },
{ true, 550, "combat speed throttling script", 1, qfg3SignatureCombatSpeedThrottling1, qfg3PatchCombatSpeedThrottling1 },
Commit: be4343b51e2740e3d395d220b2c1ca22f873a0a1
https://github.com/scummvm/scummvm/commit/be4343b51e2740e3d395d220b2c1ca22f873a0a1
Author: athrxx (athrxx at scummvm.org)
Date: 2022-09-27T16:55:46-04:00
Commit Message:
SCI: fix bug no. 11683 ("QFG2 - Heavy reverb from city street sounds ...")
Changed paths:
engines/sci/sound/music.cpp
diff --git a/engines/sci/sound/music.cpp b/engines/sci/sound/music.cpp
index 1ec68ae49fc..92ede40fd22 100644
--- a/engines/sci/sound/music.cpp
+++ b/engines/sci/sound/music.cpp
@@ -1323,7 +1323,10 @@ ChannelRemapping *SciMusic::determineChannelMap() {
if (_playList.empty())
return map;
- // TODO: set reverb, either from first song, or from global???
+ // Set reverb, either from first song, or from global (verified with KQ5 floppy
+ // and LSL6 interpreters, fixes bug # 11683 ("QFG2 - Heavy reverb from city street sounds...").
+ int8 reverb = _playList.front()->reverb;
+ _pMidiDrv->setReverb(reverb == 127 ? _globalReverb : reverb);
MusicList::iterator songIter;
int songIndex = -1;
Commit: f5059a7f844652909bde62097b763c6363e55321
https://github.com/scummvm/scummvm/commit/f5059a7f844652909bde62097b763c6363e55321
Author: Zvika Haramaty (haramaty.zvika at gmail.com)
Date: 2022-09-27T16:55:46-04:00
Commit Message:
SCI32: Make RTL BiDi conversion direction hard coded
The default behaviour for `Common::convertBiDiString` is to use
BIDI_PAR_ON for direction, which means that it tries to guess to
paragraph language, and choose the direction according to it.
However, in SQ6 many (all?) texts begin with control characters,
which make that function to think that these are English texts,
and therefore it chooses LTR direction, and punctuations are wrongly
placed.
Since the call to the function is under `if` clause for RTL,
it's safe to hard code that direction.
Changed paths:
engines/sci/graphics/text32.cpp
diff --git a/engines/sci/graphics/text32.cpp b/engines/sci/graphics/text32.cpp
index ca7177f1da0..fdc0cc8cf2e 100644
--- a/engines/sci/graphics/text32.cpp
+++ b/engines/sci/graphics/text32.cpp
@@ -392,7 +392,7 @@ void GfxText32::drawText(const uint index, uint length) {
} else {
const char *textOrig = _text.c_str() + index;
Common::String textLogical = Common::String(textOrig, (uint32)length);
- textString = Common::convertBiDiString(textLogical, g_sci->getLanguage());
+ textString = Common::convertBiDiString(textLogical, g_sci->getLanguage(), Common::BiDiParagraph::BIDI_PAR_RTL);
text = textString.c_str();
}
Commit: 19ca44e07fb726049550d3be40ae49e82141ee79
https://github.com/scummvm/scummvm/commit/19ca44e07fb726049550d3be40ae49e82141ee79
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2022-09-27T16:55:46-04:00
Commit Message:
SCI: Remove unused code from soundcmd.h
Changed paths:
engines/sci/sound/soundcmd.h
diff --git a/engines/sci/sound/soundcmd.h b/engines/sci/sound/soundcmd.h
index 66f574b9d3f..1c0b6771cc9 100644
--- a/engines/sci/sound/soundcmd.h
+++ b/engines/sci/sound/soundcmd.h
@@ -32,21 +32,12 @@ class Console;
class SciMusic;
class SoundCommandParser;
class MusicEntry;
-//typedef void (SoundCommandParser::*SoundCommand)(reg_t obj, int16 value);
-
-//struct MusicEntryCommand {
-// MusicEntryCommand(const char *d, SoundCommand c) : sndCmd(c), desc(d) {}
-// SoundCommand sndCmd;
-// const char *desc;
-//};
class SoundCommandParser {
public:
SoundCommandParser(ResourceManager *resMan, SegManager *segMan, Kernel *kernel, AudioPlayer *audio, SciVersion soundVersion);
~SoundCommandParser();
- //reg_t parseCommand(EngineState *s, int argc, reg_t *argv);
-
// Functions used for game state loading
void clearPlayList();
void syncPlayList(Common::Serializer &s);
@@ -91,7 +82,6 @@ public:
reg_t kDoSoundInit(EngineState *s, int argc, reg_t *argv);
reg_t kDoSoundPlay(EngineState *s, int argc, reg_t *argv);
- reg_t kDoSoundRestore(EngineState *s, int argc, reg_t *argv);
reg_t kDoSoundMute(EngineState *s, int argc, reg_t *argv);
reg_t kDoSoundPause(EngineState *s, int argc, reg_t *argv);
reg_t kDoSoundResumeAfterRestore(EngineState *s, int argc, reg_t *argv);
@@ -106,7 +96,6 @@ public:
reg_t kDoSoundSendMidi(EngineState *s, int argc, reg_t *argv);
reg_t kDoSoundGlobalReverb(EngineState *s, int argc, reg_t *argv);
reg_t kDoSoundSetHold(EngineState *s, int argc, reg_t *argv);
- reg_t kDoSoundDummy(EngineState *s, int argc, reg_t *argv);
reg_t kDoSoundGetAudioCapability(EngineState *s, int argc, reg_t *argv);
reg_t kDoSoundSetVolume(EngineState *s, int argc, reg_t *argv);
reg_t kDoSoundSetPriority(EngineState *s, int argc, reg_t *argv);
@@ -114,8 +103,6 @@ public:
reg_t kDoSoundSuspend(EngineState *s, int argc, reg_t *argv);
private:
- //typedef Common::Array<MusicEntryCommand *> SoundCommandContainer;
- //SoundCommandContainer _soundCommands;
ResourceManager *_resMan;
SegManager *_segMan;
Kernel *_kernel;
Commit: e3a7d4fe6e06cd42ef7a8dbf12415f870b4e18ca
https://github.com/scummvm/scummvm/commit/e3a7d4fe6e06cd42ef7a8dbf12415f870b4e18ca
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2022-09-27T16:55:46-04:00
Commit Message:
SCI32: Fix QFG4 scripts that consume extra projectiles
Fixes bug #13823
Changed paths:
engines/sci/engine/script_patches.cpp
diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp
index 86fb2d6d6f1..3df8e8cfca6 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -207,6 +207,7 @@ static const char *const selectorNameTable[] = {
"retreat", // QFG4
"sayMessage", // QFG4
"setLooper", // QFG4
+ "use", // QFG4
"useStamina", // QFG4
"value", // QFG4
"setupExit", // SQ6
@@ -344,6 +345,7 @@ enum ScriptPatcherSelectors {
SELECTOR_retreat,
SELECTOR_sayMessage,
SELECTOR_setLooper,
+ SELECTOR_use,
SELECTOR_useStamina,
SELECTOR_value,
SELECTOR_setupExit,
@@ -19254,6 +19256,64 @@ static const uint16 qfg4DeathScreenKeyboardPatch[] = {
PATCH_END
};
+// There are several rooms in which throwing a projectile (dagger or rock) uses
+// two or three items instead of just one. In addition, throwing a dagger in
+// these rooms when the player has exactly two locks up the game. For example,
+// this occurs in room 600 at night when throwing at the castle gate.
+//
+// These problems are due to an incorrect coding pattern with several mistakes
+// that was repeated in rooms 600, 625, 730, and 740. These scripts manually
+// remove the thrown projectile from inventory with hero:use, but that is
+// incorrect because the global script `project` does this for all throws.
+// These scripts also prevent the player from throwing their last dagger with a
+// message, but they repeat the check after removing the item from inventory
+// and make a broken call to gloryMessgaer:say within a handsOff script. This
+// redunant check wouldn't have any effect if it weren't for the first bug.
+//
+// We fix this by patching out all of the hero:use calls that consume daggers or
+// rocks in the rooms with this bug. There are several forms of these scripts,
+// so we patch the "use" selector to "has" so that the calls have no effect.
+//
+// Applies to: All versions
+// Responsible methods: aGate:doVerb, rm625:doVerb, theGhost:doVerb, avis:doVerb,
+// altarHead:doVerb, sThrowIt:changeState in script 740
+// Fixes bug: #13824
+static const uint16 qfg4UseExtraProjectileSignature1[] = {
+ SIG_MAGICDWORD,
+ 0x38, SIG_SELECTOR16(use), // pushi use
+ 0x7a, // push2
+ 0x39, SIG_ADDTOOFFSET(+1), // pushi 05 [ dagger ] or 06 [ rock ]
+ 0x78, // push1
+ 0x81, 0x00, // lag 00
+ 0x4a, SIG_UINT16(0x0008), // send 08 [ hero use: (5 or 6) 1 ]
+ 0x35, SIG_ADDTOOFFSET(+1), // ldi 01 or 02
+ 0xa3, // sal
+ SIG_END
+};
+
+static const uint16 qfg4UseExtraProjectileSignature2[] = {
+ 0x38, SIG_SELECTOR16(use), // pushi use
+ 0x78, // push1
+ 0x39, SIG_MAGICDWORD, 0x05, // pushi 05 [ dagger ]
+ 0x81, 0x00, // lag 00
+ 0x4a, SIG_UINT16(0x0006), // send 06 [ hero use: 5 ]
+ SIG_END
+};
+
+static const uint16 qfg4UseExtraProjectileSignature3[] = {
+ 0x38, SIG_SELECTOR16(use), // pushi use
+ 0x78, // push1
+ 0x39, SIG_MAGICDWORD, 0x06, // pushi 06 [ rock ]
+ 0x81, 0x00, // lag 00
+ 0x4a, SIG_UINT16(0x0006), // send 06 [ hero use: 6 ]
+ SIG_END
+};
+
+static const uint16 qfg4UseExtraProjectilePatch[] = {
+ 0x38, PATCH_SELECTOR16(has), // pushi has
+ PATCH_END
+};
+
// script, description, signature patch
static const SciScriptPatcherEntry qfg4Signatures[] = {
{ true, 0, "prevent autosave from deleting save games", 1, qfg4AutosaveSignature, qfg4AutosavePatch },
@@ -19316,6 +19376,8 @@ static const SciScriptPatcherEntry qfg4Signatures[] = {
{ true, 600, "fix passable closed gate after geas", 1, qfg4DungeonGateSignature, qfg4DungeonGatePatch },
{ true, 600, "fix gate options after geas", 1, qfg4GateOptionsSignature, qfg4GateOptionsPatch },
{ true, 600, "fix paladin's necrotaur message", 1, qfg4NecrotaurMessageSignature, qfg4NecrotaurMessagePatch },
+ { true, 600, "fix using extra projectile", 2, qfg4UseExtraProjectileSignature1, qfg4UseExtraProjectilePatch },
+ { true, 625, "fix using extra projectile", 4, qfg4UseExtraProjectileSignature1, qfg4UseExtraProjectilePatch },
{ true, 630, "fix great hall entry from barrel room", 1, qfg4GreatHallEntrySignature, qfg4GreatHallEntryPatch },
{ true, 633, "fix stairway pathfinding", 1, qfg4StairwayPathfindingSignature, qfg4StairwayPathfindingPatch },
{ true, 633, "Floppy: fix argument message", 1, qfg4ArgumentMessageFloppySignature, qfg4ArgumentMessageFloppyPatch },
@@ -19357,6 +19419,10 @@ static const SciScriptPatcherEntry qfg4Signatures[] = {
{ true, 730, "fix ad avis projectile message", 1, qfg4AdAvisMessageSignature, qfg4AdAvisMessagePatch },
{ true, 730, "fix throwing weapons at ad avis", 1, qfg4AdAvisThrowWeaponSignature,qfg4AdAvisThrowWeaponPatch },
{ true, 730, "fix fighter's spear animation", 1, qfg4FighterSpearSignature, qfg4FighterSpearPatch },
+ { true, 730, "fix using extra projectile", 1, qfg4UseExtraProjectileSignature2, qfg4UseExtraProjectilePatch },
+ { true, 730, "fix using extra projectile", 1, qfg4UseExtraProjectileSignature3, qfg4UseExtraProjectilePatch },
+ { true, 740, "fix using extra projectile", 2, qfg4UseExtraProjectileSignature2, qfg4UseExtraProjectilePatch },
+ { true, 740, "fix using extra projectile", 1, qfg4UseExtraProjectileSignature3, qfg4UseExtraProjectilePatch },
{ true, 770, "fix bone cage teller", 1, qfg4BoneCageTellerSignature, qfg4BoneCageTellerPatch },
{ true, 800, "fix setScaler calls", 1, qfg4SetScalerSignature, qfg4SetScalerPatch },
{ true, 800, "fix grapnel removing hero's scaler", 1, qfg4RopeScalerSignature, qfg4RopeScalerPatch },
Commit: 745ca57311e2127d0ebc5727ff9f965a7b8c0c1a
https://github.com/scummvm/scummvm/commit/745ca57311e2127d0ebc5727ff9f965a7b8c0c1a
Author: athrxx (athrxx at scummvm.org)
Date: 2022-09-27T16:55:46-04:00
Commit Message:
SCI: (FPFP/Demo) - fix bug no. 12610
("hanging MIDI notes")
The original interpreter resets the channels more often than we do
in the remap function. The assumption apparently was that the
loop at the very end of the function would catch everything. But
it does not catch the dontRemap channels if they are not within
the _driverFirstChannel/_driverLastChannel range.
If more bugs like this come up it might be necessary to add even
more resets, but I am very reluctant about unnecessary changes
to the remap function. And this code has been around for a long
time without any other bug reports of this sort. So I think we have
reason to be optimistic about it.
Changed paths:
engines/sci/sound/music.cpp
diff --git a/engines/sci/sound/music.cpp b/engines/sci/sound/music.cpp
index 92ede40fd22..9caeb4888d2 100644
--- a/engines/sci/sound/music.cpp
+++ b/engines/sci/sound/music.cpp
@@ -1236,6 +1236,7 @@ void SciMusic::remapChannels(bool mainThread) {
#ifdef DEBUG_REMAP
debug(" Mapping (dontRemap) song %d, channel %d to device channel %d", songIndex, _channelMap[i]._channel, i);
#endif
+ resetDeviceChannel(i, mainThread);
if (mainThread) _channelMap[i]._song->pMidiParser->mainThreadBegin();
_channelMap[i]._song->pMidiParser->remapChannel(_channelMap[i]._channel, i);
if (mainThread) _channelMap[i]._song->pMidiParser->mainThreadEnd();
Commit: 085aab72a65c053b79e9fbfbbd5d90b850cb4cf6
https://github.com/scummvm/scummvm/commit/085aab72a65c053b79e9fbfbbd5d90b850cb4cf6
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2022-09-27T16:55:46-04:00
Commit Message:
SCI: Add detection entry for SQ1VGA 2.1 fan patch
Ticket #13634
Changed paths:
engines/sci/detection_tables.h
diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h
index de829468f48..8b28f3630cc 100644
--- a/engines/sci/detection_tables.h
+++ b/engines/sci/detection_tables.h
@@ -5249,6 +5249,18 @@ static const struct ADGameDescription SciGameDescriptions[] = {
AD_LISTEND},
Common::RU_RUS, Common::kPlatformDOS, 0, GUIO_STD16 },
+ // Space Quest 1 VGA Remake - "Version 2.1" fan patch
+ // VERSION file reports "2.1"
+ {"sq1sci", "SCI", {
+ {"resource.map", 0, "67a6792a8384fca77150e3b6c42a6f1e", 5991},
+ {"resource.000", 0, "a5eaa1c8cb48dced9bee23dfafaae19e", 1059308},
+ {"resource.001", 0, "15798bab768651db66819779af4185f0", 1039102},
+ {"resource.002", 0, "6827e20dc7a4a98c3c0f0e0be5f78cfe", 1169366},
+ {"resource.003", 0, "eae18632e2b70bbb688d679fb3022052", 1215951},
+ {"resource.004", 0, "252b9bda620fb47ef65b6e2cca3e73be", 1206005},
+ AD_LISTEND},
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO_SQ1_ENGLISH_PC },
+
// Space Quest 1 VGA Remake - English Mac (from Fingolfin)
{"sq1sci", "SCI", {
{"resource.map", 0, "5c6ad20407261b544238e8dce87afead", 5895},
More information about the Scummvm-git-logs
mailing list