aboutsummaryrefslogtreecommitdiff
path: root/engines/agos
diff options
context:
space:
mode:
authorTravis Howell2006-10-07 08:28:06 +0000
committerTravis Howell2006-10-07 08:28:06 +0000
commit1a785b85b3255ac1d5e2f6ba9461922020f8c108 (patch)
tree80ae7fc90db190c2f6686bcc89cad19283cf4c3f /engines/agos
parentd961722cb0a4af2d801027779928946ce5c34ea1 (diff)
downloadscummvm-rg350-1a785b85b3255ac1d5e2f6ba9461922020f8c108.tar.gz
scummvm-rg350-1a785b85b3255ac1d5e2f6ba9461922020f8c108.tar.bz2
scummvm-rg350-1a785b85b3255ac1d5e2f6ba9461922020f8c108.zip
Add more code differences in Elvira 1
svn-id: r24161
Diffstat (limited to 'engines/agos')
-rw-r--r--engines/agos/agos.cpp6
-rw-r--r--engines/agos/agos.h4
-rw-r--r--engines/agos/debug.h10
-rw-r--r--engines/agos/items.cpp56
-rw-r--r--engines/agos/verb.cpp11
5 files changed, 72 insertions, 15 deletions
diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp
index 68ed28354b..5cb721534f 100644
--- a/engines/agos/agos.cpp
+++ b/engines/agos/agos.cpp
@@ -1380,11 +1380,13 @@ startOver:
void AGOSEngine::hitarea_stuff_helper() {
time_t cur_time;
- if (getGameType() == GType_SIMON2 || getGameType() == GType_FF || getGameType() == GType_PP) {
+ if (getGameType() == GType_SIMON2 || getGameType() == GType_FF ||
+ getGameType() == GType_PP) {
if (_variableArray[254] || _variableArray[249]) {
hitarea_stuff_helper_2();
}
- } else {
+ } else if (getGameType() == GType_ELVIRA2 || getGameType() == GType_WW ||
+ getGameType() == GType_SIMON1) {
uint subr_id = (uint16)_variableArray[254];
if (subr_id != 0) {
Subroutine *sub = getSubroutineByID(subr_id);
diff --git a/engines/agos/agos.h b/engines/agos/agos.h
index 2b6e726c38..1a64adeea4 100644
--- a/engines/agos/agos.h
+++ b/engines/agos/agos.h
@@ -1054,6 +1054,7 @@ public:
void oe1_pobj();
void oe1_pName();
void oe1_pcName();
+ void oe1_cFlag();
void oe1_means();
void oe1_setUserItem();
void oe1_getUserItem();
@@ -1061,9 +1062,12 @@ public:
void oe1_findMaster();
void oe1_nextMaster();
void oe1_setTime();
+ void oe1_bitClear();
+ void oe1_bitSet();
void oe1_bitTest();
void oe1_zoneDisk();
void oe1_printStats();
+ void oe1_setStore();
// Opcodes, Elvira 2 only
void oe2_loadUserGame();
diff --git a/engines/agos/debug.h b/engines/agos/debug.h
index 6bedf95c72..7b076f813e 100644
--- a/engines/agos/debug.h
+++ b/engines/agos/debug.h
@@ -168,7 +168,7 @@ static const char *const elvira1_opcodeNameTable[300] = {
NULL,
NULL,
/* 112 */
- "I|PRINT_OBJ",
+ "IW|PRINT_OBJ",
NULL,
"I|PRINT_NAME",
"I|PRINT_CNAME",
@@ -230,7 +230,7 @@ static const char *const elvira1_opcodeNameTable[300] = {
/* 160 */
NULL,
NULL,
- NULL,
+ "IWJ|IS_CFLAG",
NULL,
/* 164 */
"|RESCAN",
@@ -341,9 +341,9 @@ static const char *const elvira1_opcodeNameTable[300] = {
NULL,
"IW|SET_CLASS",
"IW|UNSET_CLASS",
- NULL,
+ "WW|CLEAR_BIT",
/* 252 */
- NULL,
+ "WW|SET_BIT",
"WWJ|BIT_TEST",
NULL,
"W|WAIT_SYNC",
@@ -380,7 +380,7 @@ static const char *const elvira1_opcodeNameTable[300] = {
/* 280 */
"II|SET_PARENT_SPECIAL",
"|CLEAR_TIMERS",
- NULL,
+ "IW|SET_STORE",
"WJ|IS_BOX",
};
diff --git a/engines/agos/items.cpp b/engines/agos/items.cpp
index 9d170b4bc9..edf3e2a26c 100644
--- a/engines/agos/items.cpp
+++ b/engines/agos/items.cpp
@@ -260,6 +260,8 @@ void AGOSEngine::setupElvira1Opcodes(OpcodeProc *op) {
op[152] = &AGOSEngine::o_debug;
+ op[162] = &AGOSEngine::oe1_cFlag;
+
op[164] = &AGOSEngine::o1_rescan;
op[165] = &AGOSEngine::oe1_means;
@@ -300,6 +302,8 @@ void AGOSEngine::setupElvira1Opcodes(OpcodeProc *op) {
op[249] = &AGOSEngine::o_setClass;
op[250] = &AGOSEngine::o_unsetClass;
+ op[251] = &AGOSEngine::oe1_bitClear;
+ op[252] = &AGOSEngine::oe1_bitSet;
op[253] = &AGOSEngine::oe1_bitTest;
op[259] = &AGOSEngine::oe1_setTime;
@@ -1365,9 +1369,11 @@ void AGOSEngine::o_loadUserGame() {
}
void AGOSEngine::o_stopTune() {
- // 134: dummy opcode?
- midi.stop();
- _lastMusicPlayed = -1;
+ // 134: stop tune
+ if (getGameType() == GType_SIMON2) {
+ midi.stop();
+ _lastMusicPlayed = -1;
+ }
}
void AGOSEngine::o_pauseGame() {
@@ -1904,9 +1910,10 @@ void AGOSEngine::oe1_doClass() {
void AGOSEngine::oe1_pobj() {
// 112: print object
SubObject *subObject = (SubObject *)findChildOfType(getNextItemPtr(), 2);
+ getVarOrWord();
- if (subObject != NULL && subObject->objectFlags & kOFText)
- showMessageFormat("%s", (const char *)getStringPtrByID(subObject->objectFlagValue[0]));
+ if (subObject != NULL)
+ showMessageFormat("%s", (const char *)getStringPtrByID(subObject->objectName));
}
void AGOSEngine::oe1_pName() {
@@ -1923,8 +1930,19 @@ void AGOSEngine::oe1_pcName() {
showMessageFormat("%s", name.c_str());
}
+void AGOSEngine::oe1_cFlag() {
+ // 162: check container flag
+ SubContainer *c = (SubContainer *)findChildOfType(getNextItemPtr(), 7);
+ uint bit = getVarOrWord();
+
+ if (c == NULL)
+ setScriptCondition(false);
+ else
+ setScriptCondition((c->flags & (1 << bit)) != 0);
+}
+
void AGOSEngine::oe1_means() {
- // TODO
+ // 165: TODO
}
void AGOSEngine::oe1_setUserItem() {
@@ -1983,6 +2001,22 @@ void AGOSEngine::oe1_nextMaster() {
_objectItem = nextMaster(levelOf(me()), item, ad, no);
}
+void AGOSEngine::oe1_bitClear() {
+ // 251: set bit off
+ int var = getVarOrWord();
+ int bit = getVarOrWord();
+
+ writeVariable(var, _variableArray[var] & ~(1 << bit));
+}
+
+void AGOSEngine::oe1_bitSet() {
+ // 252: set bit on
+ int var = getVarOrWord();
+ int bit = getVarOrWord();
+
+ writeVariable(var, _variableArray[var] | (1 << bit));
+}
+
void AGOSEngine::oe1_bitTest() {
// 253: bit test
int var = getVarOrWord();
@@ -2006,6 +2040,16 @@ void AGOSEngine::oe1_printStats() {
// 270: print stats
}
+void AGOSEngine::oe1_setStore() {
+ // 282: set store
+ Item *item = getNextItemPtr();
+
+ if (getVarOrWord() == 1)
+ _subjectItem = item;
+ else
+ _objectItem = item;
+}
+
// -----------------------------------------------------------------------
// Elvira 2 Opcodes
// -----------------------------------------------------------------------
diff --git a/engines/agos/verb.cpp b/engines/agos/verb.cpp
index 7242cdb901..e3c06bc8a7 100644
--- a/engines/agos/verb.cpp
+++ b/engines/agos/verb.cpp
@@ -744,10 +744,17 @@ void AGOSEngine::boxController(uint x, uint y, uint mode) {
if (getGameType() == GType_PP) {
_variableArray[400] = x;
_variableArray[401] = y;
- } else {
+ } else if (getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2 ||
+ getGameType() == GType_FF) {
_variableArray[1] = x;
_variableArray[2] = y;
- }
+ } else if (getGameType() == GType_ELVIRA1) {
+ if (best_ha->verb & 0x4000) {
+ if (_variableArray[500] == 0) {
+ _variableArray[500] = best_ha->verb & 0xBFFF;
+ }
+ }
+ }
}
if (best_ha->flags & kBFNoTouchName) {