[Scummvm-cvs-logs] SF.net SVN: scummvm:[50374] scummvm/trunk/engines/sci/engine/vm.cpp
m_kiewitz at users.sourceforge.net
m_kiewitz at users.sourceforge.net
Sun Jun 27 13:51:44 CEST 2010
Revision: 50374
http://scummvm.svn.sourceforge.net/scummvm/?rev=50374&view=rev
Author: m_kiewitz
Date: 2010-06-27 11:51:44 +0000 (Sun, 27 Jun 2010)
Log Message:
-----------
SCI: better solution for the lsl6 uninit issue, we now go through all the parents till we find a working workaround - we can use Narrator::startText that way inside the workaround table
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/vm.cpp
Modified: scummvm/trunk/engines/sci/engine/vm.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/vm.cpp 2010-06-27 11:19:23 UTC (rev 50373)
+++ scummvm/trunk/engines/sci/engine/vm.cpp 2010-06-27 11:51:44 UTC (rev 50374)
@@ -199,7 +199,7 @@
{ GID_FREDDYPHARKAS, 24, "gcWin", "open", -1, 5, 0xf }, // is used as priority for game menu
{ GID_FREDDYPHARKAS, 31, "quitWin", "open", -1, 5, 0xf }, // is used as priority for game menu
{ GID_LSL1, 720, "rm720", "init", -1, 0, 0 }, // age check room
- { GID_LSL6, 928, "*", "startText", -1, 0, 0 }, // used by various objects that are even translated in foreign versions (actually Narrator::startText)
+ { GID_LSL6, 928, "Narrator", "startText", -1, 0, 0 }, // used by various objects that are even translated in foreign versions, that's why we use the base-class
{ GID_ISLANDBRAIN, 140, "piece", "init", -1, 3, 1 }, // first puzzle right at the start, some initialization variable. bnt is done on it, and it should be non-0
{ GID_ISLANDBRAIN, 268, "anElement", "select", -1, 0, 0 }, // elements puzzle, gets used before super TextIcon
{ GID_KQ5, 0, "", "export 29", -1, 3, 0 }, // called when playing harp for the harpies, is used for kDoAudio
@@ -248,16 +248,25 @@
}
// Search if this is a known uninitialized read
- const UninitializedReadWorkaround *workaround = uninitializedReadWorkarounds;
- while (workaround->objectName) {
- if (workaround->gameId == gameId && workaround->scriptNr == curScriptNr && ((workaround->objectName == curObjectName) || (*workaround->objectName == '*'))
- && workaround->methodName == curMethodName && workaround->localCallOffset == lastCall->localCallOffset && workaround->index == index) {
- // Workaround found
- r[index] = make_reg(0, workaround->newValue);
- return r[index];
+ const UninitializedReadWorkaround *workaround;
+ Common::String searchObjectName = curObjectName;
+ reg_t searchObject = lastCall->sendp;
+ do {
+ workaround = uninitializedReadWorkarounds;
+ while (workaround->objectName) {
+ if (workaround->gameId == gameId && workaround->scriptNr == curScriptNr && (workaround->objectName == searchObjectName)
+ && workaround->methodName == curMethodName && workaround->localCallOffset == lastCall->localCallOffset && workaround->index == index) {
+ // Workaround found
+ r[index] = make_reg(0, workaround->newValue);
+ return r[index];
+ }
+ workaround++;
}
- workaround++;
- }
+ // Go back to the parent
+ searchObject = state->_segMan->getObject(searchObject)->getSuperClassSelector();
+ if (!searchObject.isNull())
+ searchObjectName = state->_segMan->getObjectName(searchObject);
+ } while (!searchObject.isNull()); // no parent left?
error("Uninitialized read for temp %d from method %s::%s (script %d, localCall %x)", index, curObjectName.c_str(), curMethodName.c_str(), curScriptNr, lastCall->localCallOffset);
}
return r[index];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list