diff options
author | Max Horn | 2003-05-16 02:16:59 +0000 |
---|---|---|
committer | Max Horn | 2003-05-16 02:16:59 +0000 |
commit | 7d08aea4cc1f39462e5195da641fe876f4c9c8ad (patch) | |
tree | 461db2b916093a02c95165d2a4d04c33d5fb53d3 /scumm | |
parent | bfb68f513a2133760b922ded3f5cf4c4f1bcc424 (diff) | |
download | scummvm-rg350-7d08aea4cc1f39462e5195da641fe876f4c9c8ad.tar.gz scummvm-rg350-7d08aea4cc1f39462e5195da641fe876f4c9c8ad.tar.bz2 scummvm-rg350-7d08aea4cc1f39462e5195da641fe876f4c9c8ad.zip |
SentenceTab unk4/unk3 are the sentence objects (think of: 'Use objectA with objectB' or 'Give objectA to objectB' etc.); added a little more V2 sentence hackery; added a FIXME regarding some strange sentence code (accessing objectB before it is set) in script.cpp
svn-id: r7562
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/saveload.cpp | 4 | ||||
-rw-r--r-- | scumm/script.cpp | 15 | ||||
-rw-r--r-- | scumm/script_v2.cpp | 21 | ||||
-rw-r--r-- | scumm/script_v5.cpp | 4 | ||||
-rw-r--r-- | scumm/scumm.h | 4 |
5 files changed, 27 insertions, 21 deletions
diff --git a/scumm/saveload.cpp b/scumm/saveload.cpp index 852fe2e5a9..65d04baeb9 100644 --- a/scumm/saveload.cpp +++ b/scumm/saveload.cpp @@ -532,8 +532,8 @@ void Scumm::saveOrLoad(Serializer *s, uint32 savegameVersion) { const SaveLoadEntry sentenceTabEntries[] = { MKLINE(SentenceTab, verb, sleUint8, VER_V8), MKLINE(SentenceTab, unk2, sleUint8, VER_V8), - MKLINE(SentenceTab, unk4, sleUint16, VER_V8), - MKLINE(SentenceTab, unk3, sleUint16, VER_V8), + MKLINE(SentenceTab, objectA, sleUint16, VER_V8), + MKLINE(SentenceTab, objectB, sleUint16, VER_V8), MKLINE(SentenceTab, freezeCount, sleUint8, VER_V8), MKEND() }; diff --git a/scumm/script.cpp b/scumm/script.cpp index 1efb420125..8ea97bb26e 100644 --- a/scumm/script.cpp +++ b/scumm/script.cpp @@ -709,7 +709,7 @@ void Scumm::doSentence(int c, int b, int a) { // Check if this doSentence request is identical to the previous one; // if yes, ignore this invocation. - if (_sentenceNum && st->verb == c && st->unk4 == b && st->unk3 == a) + if (_sentenceNum && st->verb == c && st->objectA == b && st->objectB == a) return; _sentenceNum++; @@ -719,7 +719,8 @@ void Scumm::doSentence(int c, int b, int a) { st = &_sentence[_sentenceNum++]; - if (!(st->unk3 & 0xFF00)) + // FIXME: this seems wrong, it accesses objectB before we ever set it! + if (!(st->objectB & 0xFF00)) st->unk2 = 0; else st->unk2 = 1; @@ -727,8 +728,8 @@ void Scumm::doSentence(int c, int b, int a) { } st->verb = c; - st->unk4 = b; - st->unk3 = a; + st->objectA = b; + st->objectB = a; st->freezeCount = 0; } @@ -755,12 +756,12 @@ void Scumm::checkAndRunSentenceScript() { _sentenceNum--; if (!(_features & GF_AFTER_V7)) - if (_sentence[_sentenceNum].unk2 && _sentence[_sentenceNum].unk3 == _sentence[_sentenceNum].unk4) + if (_sentence[_sentenceNum].unk2 && _sentence[_sentenceNum].objectB == _sentence[_sentenceNum].objectA) return; _localParamList[0] = _sentence[_sentenceNum].verb; - _localParamList[1] = _sentence[_sentenceNum].unk4; - _localParamList[2] = _sentence[_sentenceNum].unk3; + _localParamList[1] = _sentence[_sentenceNum].objectA; + _localParamList[2] = _sentence[_sentenceNum].objectB; _currentScript = 0xFF; if (sentenceScript) runScript(sentenceScript, 0, 0, _localParamList); diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp index 2013b5b3e9..03ea8b79f9 100644 --- a/scumm/script_v2.cpp +++ b/scumm/script_v2.cpp @@ -843,8 +843,8 @@ void Scumm_v2::o2_doSentence() { st = &_sentence[_sentenceNum++]; st->verb = a; - st->unk4 = getVarOrDirectWord(0x40); - st->unk3 = getVarOrDirectWord(0x20); + st->objectA = getVarOrDirectWord(0x40); + st->objectB = getVarOrDirectWord(0x20); st->freezeCount = 0; // TODO @@ -852,19 +852,24 @@ void Scumm_v2::o2_doSentence() { case 1: // Execute the sentence _sentenceNum--; - warning("TODO o2_doSentence(%d, %d, %d): execute", st->verb, st->unk4, st->unk3); + warning("TODO o2_doSentence(%d, %d, %d): execute", st->verb, st->objectA, st->objectB); // FIXME / TODO: The following is hackish, and probably incomplete, but it works somewhat. _scummVars[8] = st->verb; - _scummVars[9] = st->unk4; - _scummVars[10] = st->unk3; - runVerbCode(st->unk4, st->verb, 0, 0, NULL); + _scummVars[9] = st->objectA; + _scummVars[10] = st->objectB; + runVerbCode(st->objectA, st->verb, 0, 0, NULL); break; case 2: - // TODO - print the sentence + // Print the sentence _sentenceNum--; - warning("TODO o2_doSentence(%d, %d, %d): print", st->verb, st->unk4, st->unk3); + warning("TODO o2_doSentence(%d, %d, %d): print", st->verb, st->objectA, st->objectB); + + _scummVars[26] = st->verb; + _scummVars[27] = st->objectA; + _scummVars[28] = st->objectB; + o2_drawSentence(); break; } } diff --git a/scumm/script_v5.cpp b/scumm/script_v5.cpp index 82fea76781..727280e7ae 100644 --- a/scumm/script_v5.cpp +++ b/scumm/script_v5.cpp @@ -748,8 +748,8 @@ void Scumm_v5::o5_doSentence() { st = &_sentence[_sentenceNum++]; st->verb = a; - st->unk4 = getVarOrDirectWord(0x40); - b = st->unk3 = getVarOrDirectWord(0x20); + st->objectA = getVarOrDirectWord(0x40); + b = st->objectB = getVarOrDirectWord(0x20); if (b == 0) { st->unk2 = 0; } else { diff --git a/scumm/scumm.h b/scumm/scumm.h index 275fe871d3..3569d6d80d 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -207,8 +207,8 @@ struct ArrayHeader { struct SentenceTab { byte verb; byte unk2; - uint16 unk4; - uint16 unk3; + uint16 objectA; + uint16 objectB; uint8 freezeCount; }; |