aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
Diffstat (limited to 'scumm')
-rw-r--r--scumm/saveload.cpp4
-rw-r--r--scumm/script.cpp15
-rw-r--r--scumm/script_v2.cpp21
-rw-r--r--scumm/script_v5.cpp4
-rw-r--r--scumm/scumm.h4
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;
};