aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2003-05-22 14:10:20 +0000
committerMax Horn2003-05-22 14:10:20 +0000
commita9788c771a58d0e1f3093d56a0fde7b9e7844164 (patch)
tree920c44efd767bf4304486fc5bbeccc55b4cf89ff
parent711c6989480d76c1d9ca3e2139e3afca68561ca8 (diff)
downloadscummvm-rg350-a9788c771a58d0e1f3093d56a0fde7b9e7844164.tar.gz
scummvm-rg350-a9788c771a58d0e1f3093d56a0fde7b9e7844164.tar.bz2
scummvm-rg350-a9788c771a58d0e1f3093d56a0fde7b9e7844164.zip
from the MM/Zak scripts, the code etc. it's clear that unk2 is the sentence preposition
svn-id: r7827
-rw-r--r--scumm/intern.h5
-rw-r--r--scumm/saveload.cpp2
-rw-r--r--scumm/script.cpp4
-rw-r--r--scumm/script_v2.cpp20
-rw-r--r--scumm/script_v5.cpp2
-rw-r--r--scumm/scumm.h2
-rw-r--r--scumm/vars.cpp1
7 files changed, 19 insertions, 17 deletions
diff --git a/scumm/intern.h b/scumm/intern.h
index f9218b663f..0008109788 100644
--- a/scumm/intern.h
+++ b/scumm/intern.h
@@ -240,7 +240,7 @@ protected:
void o2_getActorX();
void o2_getActorY();
void o2_getBitVar();
- void o2_getObjUnknown();
+ void o2_getObjPreposition();
void o2_ifClassOfIs();
void o2_ifNotState01();
void o2_ifNotState02();
@@ -264,7 +264,7 @@ protected:
void o2_setBitVar();
void o2_setCameraAt();
void o2_setObjectName();
- void o2_setObjUnknown();
+ void o2_setObjPreposition();
void o2_setOwnerOf();
void o2_setState01();
void o2_setState02();
@@ -282,6 +282,7 @@ protected:
byte VAR_SENTENCE_VERB;
byte VAR_SENTENCE_OBJECT1;
byte VAR_SENTENCE_OBJECT2;
+ byte VAR_SENTENCE_PREPOSITION;
byte VAR_BACKUP_VERB;
};
diff --git a/scumm/saveload.cpp b/scumm/saveload.cpp
index deaa01bbfe..ac4f6cc12a 100644
--- a/scumm/saveload.cpp
+++ b/scumm/saveload.cpp
@@ -532,7 +532,7 @@ void Scumm::saveOrLoad(Serializer *s, uint32 savegameVersion) {
const SaveLoadEntry sentenceTabEntries[] = {
MKLINE(SentenceTab, verb, sleUint8, VER_V8),
- MKLINE(SentenceTab, unk2, sleUint8, VER_V8),
+ MKLINE(SentenceTab, preposition, sleUint8, VER_V8),
MKLINE(SentenceTab, objectA, sleUint16, VER_V8),
MKLINE(SentenceTab, objectB, sleUint16, VER_V8),
MKLINE(SentenceTab, freezeCount, sleUint8, VER_V8),
diff --git a/scumm/script.cpp b/scumm/script.cpp
index e5e19f5857..0e96083cb4 100644
--- a/scumm/script.cpp
+++ b/scumm/script.cpp
@@ -818,7 +818,7 @@ void Scumm::doSentence(int verb, int objectA, int objectB) {
st->verb = verb;
st->objectA = objectA;
st->objectB = objectB;
- st->unk2 = (objectB & 0xFF00) != 0;
+ st->preposition = (objectB & 0xFF00) != 0;
st->freezeCount = 0;
}
@@ -845,7 +845,7 @@ void Scumm::checkAndRunSentenceScript() {
_sentenceNum--;
if (!(_features & GF_AFTER_V7))
- if (_sentence[_sentenceNum].unk2 && _sentence[_sentenceNum].objectB == _sentence[_sentenceNum].objectA)
+ if (_sentence[_sentenceNum].preposition && _sentence[_sentenceNum].objectB == _sentence[_sentenceNum].objectA)
return;
if (_features & GF_AFTER_V2) {
diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp
index abc12e2653..cfac1a86a1 100644
--- a/scumm/script_v2.cpp
+++ b/scumm/script_v2.cpp
@@ -46,7 +46,7 @@ void Scumm_v2::setupOpcodes() {
OPCODE(o5_isNotEqual),
OPCODE(o5_faceActor),
OPCODE(o2_assignVarWordIndirect),
- OPCODE(o2_setObjUnknown),
+ OPCODE(o2_setObjPreposition),
/* 0C */
OPCODE(o2_resourceRoutines),
OPCODE(o5_walkActorToActor),
@@ -126,7 +126,7 @@ void Scumm_v2::setupOpcodes() {
OPCODE(o5_isEqual),
OPCODE(o5_faceActor),
OPCODE(o2_chainScript),
- OPCODE(o2_setObjUnknown),
+ OPCODE(o2_setObjPreposition),
/* 4C */
OPCODE(o2_waitForSentence),
OPCODE(o5_walkActorToActor),
@@ -168,7 +168,7 @@ void Scumm_v2::setupOpcodes() {
OPCODE(o2_subIndirect),
OPCODE(o2_dummy),
/* 6C */
- OPCODE(o2_getObjUnknown),
+ OPCODE(o2_getObjPreposition),
OPCODE(o5_putActorInRoom),
OPCODE(o2_dummy),
OPCODE(o2_ifState04),
@@ -206,7 +206,7 @@ void Scumm_v2::setupOpcodes() {
OPCODE(o5_isNotEqual),
OPCODE(o5_faceActor),
OPCODE(o2_assignVarWordIndirect),
- OPCODE(o2_setObjUnknown),
+ OPCODE(o2_setObjPreposition),
/* 8C */
OPCODE(o2_resourceRoutines),
OPCODE(o5_walkActorToActor),
@@ -286,7 +286,7 @@ void Scumm_v2::setupOpcodes() {
OPCODE(o5_isEqual),
OPCODE(o5_faceActor),
OPCODE(o2_chainScript),
- OPCODE(o2_setObjUnknown),
+ OPCODE(o2_setObjPreposition),
/* CC */
OPCODE(o5_pseudoRoom),
OPCODE(o5_walkActorToActor),
@@ -328,7 +328,7 @@ void Scumm_v2::setupOpcodes() {
OPCODE(o2_subIndirect),
OPCODE(o2_dummy),
/* EC */
- OPCODE(o2_getObjUnknown),
+ OPCODE(o2_getObjPreposition),
OPCODE(o5_putActorInRoom),
OPCODE(o2_dummy),
OPCODE(o2_ifState04),
@@ -512,7 +512,7 @@ void Scumm_v2::o2_assignVarByte() {
setResult(fetchScriptByte());
}
-void Scumm_v2::o2_setObjUnknown() {
+void Scumm_v2::o2_setObjPreposition() {
int obj = getVarOrDirectWord(0x80);
int unk = fetchScriptByte();
@@ -522,7 +522,7 @@ void Scumm_v2::o2_setObjUnknown() {
}
}
-void Scumm_v2::o2_getObjUnknown() {
+void Scumm_v2::o2_getObjPreposition() {
getResultPos();
int obj = getVarOrDirectWord(0x80);
@@ -859,7 +859,7 @@ void Scumm_v2::o2_doSentence() {
st->verb = a;
st->objectA = getVarOrDirectWord(0x40);
st->objectB = getVarOrDirectWord(0x20);
- st->unk2 = (st->objectB != 0);
+ st->preposition = (st->objectB != 0);
st->freezeCount = 0;
// TODO
@@ -1363,5 +1363,5 @@ void Scumm_v2::resetSentence() {
VAR(VAR_SENTENCE_VERB) = VAR(VAR_BACKUP_VERB);
VAR(VAR_SENTENCE_OBJECT1) = 0;
VAR(VAR_SENTENCE_OBJECT2) = 0;
- _scummVars[29] = 0;
+ VAR(VAR_SENTENCE_PREPOSITION) = 0;
}
diff --git a/scumm/script_v5.cpp b/scumm/script_v5.cpp
index 7d0377d566..13510af5be 100644
--- a/scumm/script_v5.cpp
+++ b/scumm/script_v5.cpp
@@ -749,7 +749,7 @@ void Scumm_v5::o5_doSentence() {
st->verb = a;
st->objectA = getVarOrDirectWord(0x40);
st->objectB = getVarOrDirectWord(0x20);
- st->unk2 = (st->objectB != 0);
+ st->preposition = (st->objectB != 0);
st->freezeCount = 0;
}
diff --git a/scumm/scumm.h b/scumm/scumm.h
index 8a45c78fb9..c7d1eabbe4 100644
--- a/scumm/scumm.h
+++ b/scumm/scumm.h
@@ -218,7 +218,7 @@ struct ArrayHeader {
struct SentenceTab {
byte verb;
- byte unk2;
+ byte preposition;
uint16 objectA;
uint16 objectB;
uint8 freezeCount;
diff --git a/scumm/vars.cpp b/scumm/vars.cpp
index 07772bc970..5805d95da2 100644
--- a/scumm/vars.cpp
+++ b/scumm/vars.cpp
@@ -123,6 +123,7 @@ void Scumm_v2::setupScummVars() {
VAR_SENTENCE_VERB = 26;
VAR_SENTENCE_OBJECT1 = 27;
VAR_SENTENCE_OBJECT2 = 28;
+ VAR_SENTENCE_PREPOSITION = 29;
VAR_VIRT_MOUSE_X = 30;
VAR_VIRT_MOUSE_Y = 31;
VAR_CLICK_AREA = 32;