aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorTravis Howell2006-03-02 12:14:06 +0000
committerTravis Howell2006-03-02 12:14:06 +0000
commit82a6f289de971fe051c2e944007dbb4d53aa492f (patch)
tree8431981c74b6703d61746263812d68526f5cf0f7 /engines/scumm
parentf00809788b7c261598a1d1a2a0952256217fe456 (diff)
downloadscummvm-rg350-82a6f289de971fe051c2e944007dbb4d53aa492f.tar.gz
scummvm-rg350-82a6f289de971fe051c2e944007dbb4d53aa492f.tar.bz2
scummvm-rg350-82a6f289de971fe051c2e944007dbb4d53aa492f.zip
Fix using items in C64 maniac and cleanup
svn-id: r21011
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/intern.h4
-rw-r--r--engines/scumm/room.cpp1
-rw-r--r--engines/scumm/script_c64.cpp33
-rw-r--r--engines/scumm/script_v2.cpp12
-rw-r--r--engines/scumm/scumm.cpp1
-rw-r--r--engines/scumm/scumm.h1
-rw-r--r--engines/scumm/verbs.cpp8
7 files changed, 27 insertions, 33 deletions
diff --git a/engines/scumm/intern.h b/engines/scumm/intern.h
index 77687c0d7e..47ba1123ae 100644
--- a/engines/scumm/intern.h
+++ b/engines/scumm/intern.h
@@ -293,7 +293,7 @@ protected:
virtual void setStateCommon(byte type);
virtual void clearStateCommon(byte type);
- void resetSentence();
+ virtual void resetSentence();
void setUserState(byte state);
virtual void handleMouseOver(bool updateInventory);
@@ -428,6 +428,8 @@ protected:
virtual void setStateCommon(byte type);
virtual void clearStateCommon(byte type);
+ virtual void resetSentence();
+
int getObjectFlag();
/* Version C64 script opcodes */
diff --git a/engines/scumm/room.cpp b/engines/scumm/room.cpp
index c3f97a3546..3d678696c3 100644
--- a/engines/scumm/room.cpp
+++ b/engines/scumm/room.cpp
@@ -120,7 +120,6 @@ void ScummEngine::startScene(int room, Actor *a, int objectNr) {
res.increaseResourceCounter();
- _activeObject = 0;
_currentRoom = room;
VAR(VAR_ROOM) = room;
diff --git a/engines/scumm/script_c64.cpp b/engines/scumm/script_c64.cpp
index 7687a8c2f9..21c2073e65 100644
--- a/engines/scumm/script_c64.cpp
+++ b/engines/scumm/script_c64.cpp
@@ -491,8 +491,6 @@ void ScummEngine_c64::drawSentence() {
}
if (sentencePrep > 0 && sentencePrep <= 4) {
- printf("sentencePrep is %d\n", sentencePrep);
-
// The prepositions, like the fonts, were hard code in the engine. Thus
// we have to do that, too, and provde localized versions for all the
// languages MM/Zak are available in.
@@ -513,13 +511,13 @@ void ScummEngine_c64::drawSentence() {
strcat(sentence, prepositions[lang][sentencePrep]);
}
- /* if (_activeObject2 > 0) {
- temp = getObjOrActorName(_activeObject2);
+ if (_activeInventory > 0) {
+ temp = getObjOrActorName(_activeInventory);
if (temp) {
strcat(sentence, " ");
strcat(sentence, (const char*)temp);
}
- } */
+ }
_string[2].charset = 1;
_string[2].ypos = virtscr[kVerbVirtScreen].topline;
@@ -586,13 +584,11 @@ void ScummEngine_c64::o_loadSound() {
void ScummEngine_c64::o_lockSound() {
int resid = fetchScriptByte();
res.lock(rtSound, resid);
- debug(0, "o_lockSound (%d)", resid);
}
void ScummEngine_c64::o_unlockSound() {
int resid = fetchScriptByte();
res.unlock(rtSound, resid);
- debug(0, "o_unlockSound (%d)", resid);
}
void ScummEngine_c64::o_loadActor() {
@@ -615,13 +611,11 @@ void ScummEngine_c64::o_loadScript() {
void ScummEngine_c64::o_lockScript() {
int resid = fetchScriptByte();
res.lock(rtScript, resid);
- debug(0, "o_lockScript (%d)", resid);
}
void ScummEngine_c64::o_unlockScript() {
int resid = fetchScriptByte();
res.unlock(rtScript, resid);
- debug(0, "o_unlockScript (%d)", resid);
}
void ScummEngine_c64::o_loadRoom() {
@@ -663,13 +657,11 @@ void ScummEngine_c64::o_loadRoomWithEgo() {
void ScummEngine_c64::o_lockRoom() {
int resid = fetchScriptByte();
res.lock(rtRoom, resid);
- debug(0, "o_lockRoom (%d)", resid);
}
void ScummEngine_c64::o_unlockRoom() {
int resid = fetchScriptByte();
res.unlock(rtRoom, resid);
- debug(0, "o_unlockRoom (%d)", resid);
}
void ScummEngine_c64::o_cursorCommand() {
@@ -843,21 +835,22 @@ void ScummEngine_c64::o_printEgo_c64() {
}
void ScummEngine_c64::o_doSentence() {
- byte var1 = fetchScriptByte();
- byte var2 = fetchScriptByte();
- byte var3 = fetchScriptByte();
- warning("STUB: o_doSentence(%d, %d, %d)", var1, var2, var3);
+ byte entry = fetchScriptByte();
+ byte obj = fetchScriptByte();
+ fetchScriptByte();
+
+ runObjectScript(obj, entry, false, false, NULL);
}
void ScummEngine_c64::o_unknown2() {
byte var1 = fetchScriptByte();
- warning("STUB: o_unknown2(%d)", var1);
+ error("STUB: o_unknown2(%d)", var1);
}
void ScummEngine_c64::o_ifActiveObject() {
byte obj = fetchScriptByte();
- if (obj == _activeObject)
+ if (obj == _activeInventory)
ScummEngine::fetchScriptWord();
else
o_jumpRelative();
@@ -989,7 +982,11 @@ void ScummEngine_c64::o_jumpRelative() {
_scriptPointer += offset;
}
-
+void ScummEngine_c64::resetSentence() {
+ _activeVerb = 0;
+ _activeInventory = 0;
+ _activeObject = 0;
+}
#undef PARAM_1
#undef PARAM_2
diff --git a/engines/scumm/script_v2.cpp b/engines/scumm/script_v2.cpp
index 3b82677138..d13b045ed8 100644
--- a/engines/scumm/script_v2.cpp
+++ b/engines/scumm/script_v2.cpp
@@ -1612,14 +1612,10 @@ void ScummEngine_v2::o2_switchCostumeSet() {
}
void ScummEngine_v2::resetSentence() {
- if (_game.id == GID_MANIAC && _game.platform == Common::kPlatformC64) {
- // TODO
- } else {
- VAR(VAR_SENTENCE_VERB) = VAR(VAR_BACKUP_VERB);
- VAR(VAR_SENTENCE_OBJECT1) = 0;
- VAR(VAR_SENTENCE_OBJECT2) = 0;
- VAR(VAR_SENTENCE_PREPOSITION) = 0;
- }
+ VAR(VAR_SENTENCE_VERB) = VAR(VAR_BACKUP_VERB);
+ VAR(VAR_SENTENCE_OBJECT1) = 0;
+ VAR(VAR_SENTENCE_OBJECT2) = 0;
+ VAR(VAR_SENTENCE_PREPOSITION) = 0;
}
void ScummEngine_v2::runInventoryScript(int i) {
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 0e7778a6bb..8ede576db3 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -545,6 +545,7 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst, const ScummGameS
_numObjectsInRoom = 0;
_userPut = 0;
_userState = 0;
+ _activeInventory = 0;
_activeObject = 0;
_resourceHeaderSize = 8;
_saveLoadFlag = 0;
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index 5a90957092..1905ac523f 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -881,6 +881,7 @@ protected:
int8 _userPut;
uint16 _userState;
+ int _activeInventory;
int _activeObject;
virtual void handleMouseOver(bool updateInventory);
diff --git a/engines/scumm/verbs.cpp b/engines/scumm/verbs.cpp
index 6334075fe0..cdd47364e1 100644
--- a/engines/scumm/verbs.cpp
+++ b/engines/scumm/verbs.cpp
@@ -309,11 +309,8 @@ void ScummEngine_v2::checkV2Inventory(int x, int y) {
object = findInventory(_scummVars[VAR_EGO], object + 1 + _inventoryOffset);
if (_game.platform == Common::kPlatformC64 && _game.id == GID_MANIAC) {
- // TODO
- return;
- }
-
- if (object > 0) {
+ _activeInventory = object;
+ } else if (object > 0) {
runInputScript(3, object, 0);
}
}
@@ -547,6 +544,7 @@ void ScummEngine_c64::checkExecVerbs() {
runScript(3, 0, 0, 0);
}
} else {
+ _activeInventory = 0;
_activeObject = 0;
_activeVerb = 13;
if (zone->number == kMainVirtScreen) {