aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2010-11-17 14:03:14 +0000
committerFilippos Karapetis2010-11-17 14:03:14 +0000
commitbb9b7c24f9e301d35c1dcfb1a498df4af2a154db (patch)
treef4592934cafae379a89133fe1effda0085423e03 /engines
parent3d7f7b49fe86e2ec8d637d9d5df5c8cb11969734 (diff)
downloadscummvm-rg350-bb9b7c24f9e301d35c1dcfb1a498df4af2a154db.tar.gz
scummvm-rg350-bb9b7c24f9e301d35c1dcfb1a498df4af2a154db.tar.bz2
scummvm-rg350-bb9b7c24f9e301d35c1dcfb1a498df4af2a154db.zip
SCI: Added some SCI3 selector related information
- Added a TODO for the usage of the -info- selector in kClone and kDisposeClone in SCI3 scripts, as it's no longer used in SCI3 - Added information about which of the selectors are missing in SCI3. There are some more which are missing, but aren't used in SCI2-SCI3 anyway - Some styling svn-id: r54291
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/engine/kscripts.cpp8
-rw-r--r--engines/sci/engine/selector.h13
-rw-r--r--engines/sci/engine/state.cpp3
-rw-r--r--engines/sci/engine/vm.cpp2
4 files changed, 16 insertions, 10 deletions
diff --git a/engines/sci/engine/kscripts.cpp b/engines/sci/engine/kscripts.cpp
index 0f1ee2c3f3..da67761b8a 100644
--- a/engines/sci/engine/kscripts.cpp
+++ b/engines/sci/engine/kscripts.cpp
@@ -155,6 +155,7 @@ reg_t kClone(EngineState *s, int argc, reg_t *argv) {
debugC(2, kDebugLevelMemory, "Attempting to clone from %04x:%04x", PRINT_REG(parentAddr));
+ // TODO: SCI3 equivalent, SCI3 objects don't have an -info- selector
uint16 infoSelector = readSelectorValue(s->_segMan, parentAddr, SELECTOR(_info_));
cloneObj = s->_segMan->allocateClone(&cloneAddr);
@@ -179,7 +180,11 @@ reg_t kClone(EngineState *s, int argc, reg_t *argv) {
// Mark as clone
infoSelector &= ~kInfoFlagClass; // remove class bit
- writeSelectorValue(s->_segMan, cloneAddr, SELECTOR(_info_), infoSelector | kInfoFlagClone);
+ if (getSciVersion() == SCI_VERSION_3)
+ // TODO: SCI3 equivalent, SCI3 objects don't have an -info- selector
+ warning("TODO: not modifying -info- selector in kClone for SCI3");
+ else
+ writeSelectorValue(s->_segMan, cloneAddr, SELECTOR(_info_), infoSelector | kInfoFlagClone);
cloneObj->setSpeciesSelector(cloneObj->getPos());
if (parentObj->isClass())
@@ -206,6 +211,7 @@ reg_t kDisposeClone(EngineState *s, int argc, reg_t *argv) {
// At least kq4early relies on this behaviour. The scripts clone "Sound", then set bit 1 manually
// and call kDisposeClone later. In that case we may not free it, otherwise we will run into issues
// later, because kIsObject would then return false and Sound object wouldn't get checked.
+ // TODO: SCI3 equivalent, SCI3 objects don't have an -info- selector
uint16 infoSelector = readSelectorValue(s->_segMan, obj, SELECTOR(_info_));
if ((infoSelector & 3) == kInfoFlagClone)
object->markAsFreed();
diff --git a/engines/sci/engine/selector.h b/engines/sci/engine/selector.h
index 98157c3eaf..6038ad0c36 100644
--- a/engines/sci/engine/selector.h
+++ b/engines/sci/engine/selector.h
@@ -40,7 +40,7 @@ struct SelectorCache {
}
// Statically defined selectors, (almost the) same in all SCI versions
- Selector _info_;
+ Selector _info_; ///< Removed in SCI3
Selector y;
Selector x;
Selector view, loop, cel; ///< Description of a specific image
@@ -58,8 +58,9 @@ struct SelectorCache {
// style
Selector state, font, type;///< Used by controls
// window
- Selector cursor, max; ///< Used by EditControl
- Selector mark; //< Used by list controls
+ Selector cursor; ///< Used by EditControl
+ Selector max; ///< Used by EditControl, removed in SCI3
+ Selector mark; //< Used by list controls (script internal, is needed by us for the QfG import rooms)
Selector sort; //< Used by list controls (script internal, is needed by us for QfG3 import room)
// who
Selector message; ///< Used by GetEvent
@@ -96,8 +97,8 @@ struct SelectorCache {
Selector subtitleLang;
Selector size;
Selector points; ///< Used by AvoidPath()
- Selector palette;
- Selector dataInc;
+ Selector palette; ///< Used by the SCI0-SCI1.1 animate code, unused in SCI2-SCI2.1, removed in SCI3
+ Selector dataInc; ///< Used to sync music with animations, removed in SCI3
// handle (in SCI1)
Selector min; ///< SMPTE time format
Selector sec;
@@ -109,7 +110,7 @@ struct SelectorCache {
// SCI1 selectors which have been moved a bit in SCI1.1, but otherwise static
Selector cantBeHere; ///< Checks for movement avoidance in SCI1+. Replaces canBeHere
- Selector topString; ///< SCI1 scroll lists use this instead of lsTop
+ Selector topString; ///< SCI1 scroll lists use this instead of lsTop. Removed in SCI3
Selector flags;
// SCI1+ audio sync related selectors, not static. They're used for lip syncing in
diff --git a/engines/sci/engine/state.cpp b/engines/sci/engine/state.cpp
index 732f075257..886b099a26 100644
--- a/engines/sci/engine/state.cpp
+++ b/engines/sci/engine/state.cpp
@@ -307,9 +307,8 @@ Common::String SciEngine::strSplit(const char *str, const char *sep) {
kLanguage lang = getSciLanguage();
kLanguage subLang = K_LANG_NONE;
- if (SELECTOR(subtitleLang) != -1) {
+ if (SELECTOR(subtitleLang) != -1)
subLang = (kLanguage)readSelectorValue(_gamestate->_segMan, _gameObjectAddress, SELECTOR(subtitleLang));
- }
kLanguage secondLang;
Common::String retval = getSciLanguageString(str, lang, &secondLang);
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp
index 71b0b9809c..79fe08792d 100644
--- a/engines/sci/engine/vm.cpp
+++ b/engines/sci/engine/vm.cpp
@@ -1735,7 +1735,7 @@ void run_vm(EngineState *s) {
if (s->r_acc.offset >= scr->getBufSize()) {
error("VM: lofsa operation overflowed: %04x:%04x beyond end"
- " of script (at %04x)\n", PRINT_REG(s->r_acc), scr->getBufSize());
+ " of script (at %04x)", PRINT_REG(s->r_acc), scr->getBufSize());
}
break;