[Scummvm-git-logs] scummvm master -> e695100708b404e2977d75dbd64bbf18a61fb1a0
csnover
csnover at users.noreply.github.com
Mon Jan 16 19:19:33 CET 2017
This automated email contains information about 10 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
0744dc4109 SCI32: Fix spinloop in Hoyle5
0e77471467 SCI: Remove unused SciEngine::speechAndSubtitlesEnabled method
d495267829 SCI32: Fix loading save games in KQ7 1.51
efa6b74cce SCI32: Clarify comment about empty code path in cursor code
c476341508 SCI32: Add workarounds for KQ7 2.00b
8859c3ccae SCI32: Disable compression on Hoyle5 options files
f66c033d52 SCI32: Add workaround for Hoyle5
d9de55b2a9 SCI32: Fix handling of negative z-indexes
600a9127de SCI32: Add pic cel to CelInfo32 debugging output
e695100708 SCI32: Add workarounds for MGDX
Commit: 0744dc4109acd6ca433d3da492b9a1f02bd38a81
https://github.com/scummvm/scummvm/commit/0744dc4109acd6ca433d3da492b9a1f02bd38a81
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-01-16T12:16:12-06:00
Commit Message:
SCI32: Fix spinloop in Hoyle5
Hoyle5 will spin on kGetTime between 15 and 300 ticks in multiple
game scripts in order to delay execution (for example, after
choosing opponents and clicking "okay"). This causes ScummVM to
be unresponsive and wastes CPU time.
This commit patches the spin subroutines to instead call a kernel
function (kWait) that waits without a spin loop. This kernel
function was removed in SCI2, and has been added back in ScummVM
specifically for Hoyle5, so this patch will not work with the
original interpreter.
Changed paths:
engines/sci/engine/kernel.cpp
engines/sci/engine/kernel_tables.h
engines/sci/engine/script_patches.cpp
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp
index 1845eca..c7732c6 100644
--- a/engines/sci/engine/kernel.cpp
+++ b/engines/sci/engine/kernel.cpp
@@ -905,6 +905,11 @@ void Kernel::loadKernelNames(GameFeatures *features) {
} else {
// Normal SCI2.1 kernel table
_kernelNames = Common::StringArray(sci21_default_knames, kKernelEntriesSci21);
+
+ // Used by script patcher to remove CPU spinning on kGetTime
+ if (g_sci->getGameId() == GID_HOYLE5) {
+ _kernelNames[0x4f] = "Wait";
+ }
}
break;
diff --git a/engines/sci/engine/kernel_tables.h b/engines/sci/engine/kernel_tables.h
index ac4987e..741f46e 100644
--- a/engines/sci/engine/kernel_tables.h
+++ b/engines/sci/engine/kernel_tables.h
@@ -1408,7 +1408,7 @@ static const char *const sci21_default_knames[] = {
/*0x4c*/ "ScrollWindow", // Dummy in SCI3
/*0x4d*/ "Dummy",
/*0x4e*/ "Dummy",
- /*0x4f*/ "Dummy",
+ /*0x4f*/ "Dummy", // Replaced with kWait for Hoyle5 in ScummVM
/*0x50*/ "GetEvent",
/*0x51*/ "GlobalToLocal",
/*0x52*/ "LocalToGlobal",
diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp
index b2d66d0..968d727 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -699,6 +699,43 @@ static const SciScriptPatcherEntry freddypharkasSignatures[] = {
#ifdef ENABLE_SCI32
#pragma mark -
+#pragma mark Hoyle 5
+
+// Several scripts in Hoyle5 contain a subroutine which spins on kGetTime until
+// a certain number of ticks elapse. Since this wastes CPU and makes ScummVM
+// unresponsive, the kWait kernel function (which was removed in SCI2) is
+// reintroduced at 0x4f in kernel.cpp only for Hoyle5, and the spin subroutines
+// are patched here to call that function instead.
+// Applies to at least: English Demo
+static const uint16 hoyle5SignatureSpinLoop[] = {
+ SIG_MAGICDWORD,
+ 0x76, // push0
+ 0x43, 0x79, SIG_UINT16(0x00), // callk GetTime, $0
+ 0x36, // push
+ 0x87, 0x01, // lap param[1]
+ 0x02, // add
+ 0xa5, 0x00, // sat temp[0]
+ SIG_END
+};
+
+static const uint16 hoyle5PatchSpinLoop[] = {
+ 0x78, // push1
+ 0x8f, 0x01, // lsp param[1]
+ 0x43, 0x4f, PATCH_UINT16(0x02), // callk Wait, $2
+ 0x48, // ret
+ PATCH_END
+};
+
+// script, description, signature patch
+static const SciScriptPatcherEntry hoyle5Signatures[] = {
+ { true, 3, "remove kGetTime spin", 1, hoyle5SignatureSpinLoop, hoyle5PatchSpinLoop },
+ { true, 23, "remove kGetTime spin", 1, hoyle5SignatureSpinLoop, hoyle5PatchSpinLoop },
+ { true, 500, "remove kGetTime spin", 1, hoyle5SignatureSpinLoop, hoyle5PatchSpinLoop },
+ { true, 64937, "remove kGetTime spin", 1, hoyle5SignatureSpinLoop, hoyle5PatchSpinLoop },
+ SCI_SIGNATUREENTRY_TERMINATOR
+};
+
+#pragma mark -
#pragma mark Gabriel Knight 1
// ===========================================================================
@@ -5170,6 +5207,9 @@ void ScriptPatcher::processScript(uint16 scriptNr, byte *scriptData, const uint3
signatureTable = freddypharkasSignatures;
break;
#ifdef ENABLE_SCI32
+ case GID_HOYLE5:
+ signatureTable = hoyle5Signatures;
+ break;
case GID_GK1:
signatureTable = gk1Signatures;
break;
Commit: 0e77471467c35f1c1522e16d169a4f927aaa307b
https://github.com/scummvm/scummvm/commit/0e77471467c35f1c1522e16d169a4f927aaa307b
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-01-16T12:16:12-06:00
Commit Message:
SCI: Remove unused SciEngine::speechAndSubtitlesEnabled method
Changed paths:
engines/sci/sci.cpp
engines/sci/sci.h
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index d725e36..20547f3 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -1068,16 +1068,6 @@ void SciEngine::syncSoundSettings() {
}
}
-// used by Script Patcher. Used to find out, if Laura Bow 2/King's Quest 6 need patching for Speech+Subtitles - or not
-bool SciEngine::speechAndSubtitlesEnabled() {
- bool subtitlesOn = ConfMan.getBool("subtitles");
- bool speechOn = !ConfMan.getBool("speech_mute");
-
- if (isCD() && subtitlesOn && speechOn)
- return true;
- return false;
-}
-
void SciEngine::syncIngameAudioOptions() {
bool useGlobal90 = false;
diff --git a/engines/sci/sci.h b/engines/sci/sci.h
index b3ec325..f5ccc19 100644
--- a/engines/sci/sci.h
+++ b/engines/sci/sci.h
@@ -282,7 +282,6 @@ public:
* script patches are needed:
* - King's Quest 6 CD
*/
- bool speechAndSubtitlesEnabled();
void syncIngameAudioOptions();
void updateScummVMAudioOptions();
Commit: d49526782928a39bea63c5871700190ea13a6170
https://github.com/scummvm/scummvm/commit/d49526782928a39bea63c5871700190ea13a6170
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-01-16T12:16:12-06:00
Commit Message:
SCI32: Fix loading save games in KQ7 1.51
Changed paths:
engines/sci/engine/kernel_tables.h
engines/sci/engine/kfile.cpp
diff --git a/engines/sci/engine/kernel_tables.h b/engines/sci/engine/kernel_tables.h
index 741f46e..589a1f6 100644
--- a/engines/sci/engine/kernel_tables.h
+++ b/engines/sci/engine/kernel_tables.h
@@ -930,6 +930,8 @@ static SciKernelMapEntry s_kernelMap[] = {
{ MAP_DUMMY(PointSize), SIG_EVERYWHERE, "(.*)", NULL, NULL },
// SCI2.1 Kernel Functions
+ { "CheckCDisc", kCheckCD, SIG_SCI21EARLY, SIGFOR_ALL, "(i)", NULL, NULL },
+ { "GetSaveCDisc", kGetSavedCD, SIG_SCI21EARLY, SIGFOR_ALL, "", NULL, NULL },
{ MAP_CALL(CD), SIG_SINCE_SCI21MID, SIGFOR_ALL, "(.*)", kCD_subops, NULL },
{ MAP_CALL(IsOnMe), SIG_EVERYWHERE, "iioi", NULL, NULL },
{ MAP_CALL(List), SIG_SINCE_SCI21, SIGFOR_ALL, "(.*)", kList_subops, NULL },
@@ -993,8 +995,6 @@ static SciKernelMapEntry s_kernelMap[] = {
// Unused / debug functions in the in-between SCI2.1 interpreters
{ MAP_DUMMY(PreloadResource), SIG_EVERYWHERE, "(.*)", NULL, NULL },
- { MAP_DUMMY(CheckCDisc), SIG_EVERYWHERE, "(.*)", NULL, NULL },
- { MAP_DUMMY(GetSaveCDisc), SIG_EVERYWHERE, "(.*)", NULL, NULL },
{ MAP_DUMMY(TestPoly), SIG_EVERYWHERE, "(.*)", NULL, NULL },
// Used by Phantasmagoria 1, script 64981 (used in the chase scene)
diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp
index 7bc3c2d..49ad4ca 100644
--- a/engines/sci/engine/kfile.cpp
+++ b/engines/sci/engine/kfile.cpp
@@ -220,8 +220,9 @@ reg_t kCheckCD(EngineState *s, int argc, reg_t *argv) {
}
reg_t kGetSavedCD(EngineState *s, int argc, reg_t *argv) {
- // TODO: This is wrong, CD number needs to be available prior to
- // the save game being loaded
+ // Normally this code would read the CD number from the currently loaded
+ // save game file, but since we don't have one of those, just return the
+ // disc number from the resource manager
return make_reg(0, g_sci->getResMan()->getCurrentDiscNo());
}
Commit: efa6b74cced1c5c0d8c64daf71dbcb0278bb7bf6
https://github.com/scummvm/scummvm/commit/efa6b74cced1c5c0d8c64daf71dbcb0278bb7bf6
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-01-16T12:16:13-06:00
Commit Message:
SCI32: Clarify comment about empty code path in cursor code
Changed paths:
engines/sci/graphics/cursor32.cpp
diff --git a/engines/sci/graphics/cursor32.cpp b/engines/sci/graphics/cursor32.cpp
index 6bb1323..34a6d54 100644
--- a/engines/sci/graphics/cursor32.cpp
+++ b/engines/sci/graphics/cursor32.cpp
@@ -291,8 +291,9 @@ void GfxCursor32::readVideo(DrawRegion &target) {
copy(target, _vmapRegion);
} else {
// NOTE: SSCI would read the background for the cursor directly out of
- // video memory here, but as far as can be determined, this does not
- // seem to actually be necessary for proper cursor rendering
+ // video memory here, but this is not necessary in ScummVM because mouse
+ // events in ScummVM are polled so can never interrupt the renderer
+ // between frames
}
}
Commit: c47634150896f65d0af1432692b69486725d8ce6
https://github.com/scummvm/scummvm/commit/c47634150896f65d0af1432692b69486725d8ce6
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-01-16T12:16:13-06:00
Commit Message:
SCI32: Add workarounds for KQ7 2.00b
Changed paths:
engines/sci/engine/workarounds.cpp
diff --git a/engines/sci/engine/workarounds.cpp b/engines/sci/engine/workarounds.cpp
index 560a383..659fa68 100644
--- a/engines/sci/engine/workarounds.cpp
+++ b/engines/sci/engine/workarounds.cpp
@@ -321,6 +321,8 @@ const SciWorkaroundEntry uninitializedReadWorkarounds[] = {
{ GID_KQ6, -1, 928, 0, NULL, "startText", NULL, 0, { WORKAROUND_FAKE, 0 } }, // gets caused by Text+Audio support (see script patcher)
{ GID_KQ7, -1, 64996, 0, "User", "handleEvent", NULL, 1, { WORKAROUND_FAKE, 0 } }, // called when pushing a keyboard key
{ GID_KQ7, 2450, 2450, 0, "exBridge", "handleEvent", NULL, 0, { WORKAROUND_FAKE, 0 } }, // called when walking up to the throne in the cave in chapter 2
+ { GID_KQ7, 2450, 2450, 0, "maliciaComes", "handleEvent", NULL, 0, { WORKAROUND_FAKE, 0 } }, // when malicia appears at the southeast exit of the main chamber near the end of chapter 2
+ { GID_KQ7, 6060, 64964, 0, "DPath", "init", NULL, 1, { WORKAROUND_FAKE, 0 } }, // after entering the harp crystal in chapter 5
{ GID_LAURABOW, 37, 0, 0, "CB1", "doit", NULL, 1, { WORKAROUND_FAKE, 0 } }, // when going up the stairs - bug #5084
{ GID_LAURABOW, -1, 967, 0, "myIcon", "cycle", NULL, 1, { WORKAROUND_FAKE, 0 } }, // having any portrait conversation coming up - initial bug #4971
{ GID_LAURABOW2, -1, 24, 0, "gcWin", "open", NULL, 5, { WORKAROUND_FAKE, 0xf } }, // is used as priority for game menu
Commit: 8859c3ccaea83c747b911203bf2529843c2b0238
https://github.com/scummvm/scummvm/commit/8859c3ccaea83c747b911203bf2529843c2b0238
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-01-16T12:16:13-06:00
Commit Message:
SCI32: Disable compression on Hoyle5 options files
Compression overhead takes up more space than uncompressed files,
plus the uncompressed files it creates are marginally quicker and
easier to debug with external tools.
Changed paths:
engines/sci/engine/file.cpp
diff --git a/engines/sci/engine/file.cpp b/engines/sci/engine/file.cpp
index 75aa4fa..f4bd437d 100644
--- a/engines/sci/engine/file.cpp
+++ b/engines/sci/engine/file.cpp
@@ -201,6 +201,9 @@ reg_t file_open(EngineState *s, const Common::String &filename, kFileOpenMode mo
isCompressed = false;
break;
#ifdef ENABLE_SCI32
+ // Hoyle5 has no save games, but creates very simple text-based game options
+ // files that do not need to be compressed
+ case GID_HOYLE5:
// Phantasmagoria game scripts create their own save files, so they are
// interoperable with the original interpreter just by renaming them as long
// as they are not compressed. They are also never larger than a couple
Commit: f66c033d526e39547e2ceb3d28ccaf24efaf060e
https://github.com/scummvm/scummvm/commit/f66c033d526e39547e2ceb3d28ccaf24efaf060e
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-01-16T12:16:13-06:00
Commit Message:
SCI32: Add workaround for Hoyle5
Changed paths:
engines/sci/engine/kernel_tables.h
engines/sci/engine/workarounds.cpp
engines/sci/engine/workarounds.h
diff --git a/engines/sci/engine/kernel_tables.h b/engines/sci/engine/kernel_tables.h
index 589a1f6..af8e2d8 100644
--- a/engines/sci/engine/kernel_tables.h
+++ b/engines/sci/engine/kernel_tables.h
@@ -225,7 +225,7 @@ static const SciKernelMapSubEntry kDoAudio_subops[] = {
{ SIG_SCI32, 2, MAP_CALL(DoAudioPlay), "(i)(i)(i)(i)(i)(i)(i)", NULL },
{ SIG_SCI32, 3, MAP_CALL(DoAudioStop), "(i)(i)(i)(i)(i)", NULL },
{ SIG_SCI32, 4, MAP_CALL(DoAudioPause), "(i)(i)(i)(i)(i)", NULL },
- { SIG_SCI32, 5, MAP_CALL(DoAudioResume), "(i)(i)(i)(i)(i)", NULL },
+ { SIG_SCI32, 5, MAP_CALL(DoAudioResume), "(i)(i)(i)(i)(i)", kDoAudioResume_workarounds },
{ SIG_SCI32, 6, MAP_CALL(DoAudioPosition), "(i)(i)(i)(i)(i)", NULL },
{ SIG_SCI32, 7, MAP_CALL(DoAudioRate), "(i)", NULL },
{ SIG_SCI32, 8, MAP_CALL(DoAudioVolume), "(i)(i)(i)(i)(i)(i)", NULL },
diff --git a/engines/sci/engine/workarounds.cpp b/engines/sci/engine/workarounds.cpp
index 659fa68..a627033 100644
--- a/engines/sci/engine/workarounds.cpp
+++ b/engines/sci/engine/workarounds.cpp
@@ -560,6 +560,12 @@ const SciWorkaroundEntry kDisposeScript_workarounds[] = {
};
// gameID, room,script,lvl, object-name, method-name, local-call-signature, index, workaround
+const SciWorkaroundEntry kDoAudioResume_workarounds[] = {
+ { GID_HOYLE5, -1, 17, 0, NULL, "startAudio", NULL, 0, { WORKAROUND_STILLCALL, 0 } }, // when a character talks during a game
+ SCI_WORKAROUNDENTRY_TERMINATOR
+};
+
+// gameID, room,script,lvl, object-name, method-name, local-call-signature, index, workaround
const SciWorkaroundEntry kDoSoundPlay_workarounds[] = {
{ GID_LSL6HIRES, -1, 64989, 0, NULL, "play", NULL, 0, { WORKAROUND_STILLCALL, 0 } }, // always passes an extra null argument
{ GID_QFG4, -1, 64989, 0, NULL, "play", NULL, 0, { WORKAROUND_STILLCALL, 0 } }, // always passes an extra null argument
diff --git a/engines/sci/engine/workarounds.h b/engines/sci/engine/workarounds.h
index cb928fa..960c01e 100644
--- a/engines/sci/engine/workarounds.h
+++ b/engines/sci/engine/workarounds.h
@@ -68,6 +68,7 @@ extern const SciWorkaroundEntry kDeviceInfo_workarounds[];
extern const SciWorkaroundEntry kDisplay_workarounds[];
extern const SciWorkaroundEntry kDirLoop_workarounds[];
extern const SciWorkaroundEntry kDisposeScript_workarounds[];
+extern const SciWorkaroundEntry kDoAudioResume_workarounds[];
extern const SciWorkaroundEntry kDoSoundPlay_workarounds[];
extern const SciWorkaroundEntry kDoSoundFade_workarounds[];
extern const SciWorkaroundEntry kFileIOOpen_workarounds[];
Commit: d9de55b2a98fb86eeb419d860b617240da02b72f
https://github.com/scummvm/scummvm/commit/d9de55b2a98fb86eeb419d860b617240da02b72f
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-01-16T12:16:14-06:00
Commit Message:
SCI32: Fix handling of negative z-indexes
Fixes the ego disappearing behind the castle doors in MGDX.
Changed paths:
engines/sci/graphics/screen_item32.cpp
diff --git a/engines/sci/graphics/screen_item32.cpp b/engines/sci/graphics/screen_item32.cpp
index 4757770..c07e075 100644
--- a/engines/sci/graphics/screen_item32.cpp
+++ b/engines/sci/graphics/screen_item32.cpp
@@ -236,7 +236,7 @@ void ScreenItem::setFromObject(SegManager *segMan, const reg_t object, const boo
writeSelectorValue(segMan, object, SELECTOR(priority), _position.y);
}
- _z = readSelectorValue(segMan, object, SELECTOR(z));
+ _z = (int16)readSelectorValue(segMan, object, SELECTOR(z));
_position.y -= _z;
if (g_sci->_features->usesAlternateSelectors()) {
Commit: 600a9127ded74203b4aa3169e4c8dcefaca3475c
https://github.com/scummvm/scummvm/commit/600a9127ded74203b4aa3169e4c8dcefaca3475c
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-01-16T12:16:14-06:00
Commit Message:
SCI32: Add pic cel to CelInfo32 debugging output
Changed paths:
engines/sci/graphics/celobj32.h
diff --git a/engines/sci/graphics/celobj32.h b/engines/sci/graphics/celobj32.h
index 70cbd09..3e3f81a 100644
--- a/engines/sci/graphics/celobj32.h
+++ b/engines/sci/graphics/celobj32.h
@@ -127,7 +127,7 @@ struct CelInfo32 {
if (type == kCelTypeView) {
return Common::String::format("view %u, loop %d, cel %d", resourceId, loopNo, celNo);
} else if (type == kCelTypePic) {
- return Common::String::format("pic %u", resourceId);
+ return Common::String::format("pic %u, cel %d", resourceId, celNo);
} else if (kCelTypeColor) {
return Common::String::format("color %d", color);
} else if (type == kCelTypeMem) {
Commit: e695100708b404e2977d75dbd64bbf18a61fb1a0
https://github.com/scummvm/scummvm/commit/e695100708b404e2977d75dbd64bbf18a61fb1a0
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-01-16T12:16:14-06:00
Commit Message:
SCI32: Add workarounds for MGDX
Changed paths:
engines/sci/engine/workarounds.cpp
diff --git a/engines/sci/engine/workarounds.cpp b/engines/sci/engine/workarounds.cpp
index a627033..7c41b1f 100644
--- a/engines/sci/engine/workarounds.cpp
+++ b/engines/sci/engine/workarounds.cpp
@@ -552,6 +552,7 @@ const SciWorkaroundEntry kDirLoop_workarounds[] = {
const SciWorkaroundEntry kDisposeScript_workarounds[] = {
{ GID_LAURABOW, 777, 777, 0, "myStab", "changeState", NULL, 0, { WORKAROUND_IGNORE, 0 } }, // DEMO: after the will is signed, parameter 0 is an object - bug #4967
{ GID_LSL2, -1, 54, 0, "rm54", "dispose", NULL, 0, { WORKAROUND_IGNORE, 0 } }, // Amiga: room 55, script tries to kDisposeScript an object (does not happen for DOS) - bug #6818
+ { GID_MOTHERGOOSEHIRES,37, 337, 0, "rhymeScript", "changeState", NULL, 0, { WORKAROUND_IGNORE, 0 } }, // after the rhyme with the king
{ GID_QFG1, -1, 64, 0, "rm64", "dispose", NULL, 0, { WORKAROUND_IGNORE, 0 } }, // when leaving graveyard, parameter 0 is an object
{ GID_SQ4, 150, 151, 0, "fightScript", "dispose", NULL, 0, { WORKAROUND_IGNORE, 0 } }, // during fight with Vohaul, parameter 0 is an object
{ GID_SQ4, 150, 152, 0, "driveCloseUp", "dispose", NULL, 0, { WORKAROUND_IGNORE, 0 } }, // when choosing "beam download", parameter 0 is an object
More information about the Scummvm-git-logs
mailing list