aboutsummaryrefslogtreecommitdiff
path: root/engines/agos
diff options
context:
space:
mode:
authorTravis Howell2006-10-06 15:59:59 +0000
committerTravis Howell2006-10-06 15:59:59 +0000
commite75bea0c8f454bbeac842414a7ab8c4c77321801 (patch)
treed1a8347892e1c493517186a97aca4eac6d171b99 /engines/agos
parent4b900edfeb984518d910bd46d85db4adc2061921 (diff)
downloadscummvm-rg350-e75bea0c8f454bbeac842414a7ab8c4c77321801.tar.gz
scummvm-rg350-e75bea0c8f454bbeac842414a7ab8c4c77321801.tar.bz2
scummvm-rg350-e75bea0c8f454bbeac842414a7ab8c4c77321801.zip
Add more code for Elvira 2
svn-id: r24143
Diffstat (limited to 'engines/agos')
-rw-r--r--engines/agos/agos.h13
-rw-r--r--engines/agos/debug.h22
-rw-r--r--engines/agos/items.cpp91
3 files changed, 86 insertions, 40 deletions
diff --git a/engines/agos/agos.h b/engines/agos/agos.h
index 6aef46f76b..5d14ba9840 100644
--- a/engines/agos/agos.h
+++ b/engines/agos/agos.h
@@ -1043,10 +1043,16 @@ public:
void oe1_printStats();
// Opcodes, Elvira 2 only
- void oe2_setDoorState1();
- void oe2_setDoorState2();
- void oe2_setDoorState3();
+ void oe2_pobj();
+ void oe2_loadUserGame();
+ void oe2_setDoorOpen();
+ void oe2_setDoorClosed();
+ void oe2_setDoorLocked();
+ void oe2_ifDoorOpen();
+ void oe2_ifDoorClosed();
+ void oe2_ifDoorLocked();
void oe2_opcode161();
+ void oe2_screenTextMsg();
// Opcodes, Waxworks only
void oww_moveDirn();
@@ -1054,7 +1060,6 @@ public:
void oww_whereTo();
void oww_menu();
void oww_textMenu();
- void oww_ifDoorOpen();
void oww_opcode184();
void oww_opcode185();
void oww_opcode186();
diff --git a/engines/agos/debug.h b/engines/agos/debug.h
index 82bd8ac959..053d5c511d 100644
--- a/engines/agos/debug.h
+++ b/engines/agos/debug.h
@@ -477,7 +477,7 @@ static const char *const ww_opcode_name_table[256] = {
"W|START_SUB",
/* 72 */
NULL,
- NULL,
+ "I|PRINT_OBJ",
NULL,
NULL,
/* 76 */
@@ -497,7 +497,7 @@ static const char *const ww_opcode_name_table[256] = {
"W|COMMENT",
/* 88 */
"|STOP_ANIMATION",
- "|RESTART_ANIMATION",
+ "T|LOAD_USER_GAME",
"IB|GET_PARENT",
"IB|GET_NEXT",
/* 92 */
@@ -566,14 +566,14 @@ static const char *const ww_opcode_name_table[256] = {
"WJ|IS_BOX",
"I|START_ITEM_SUB",
/* 144 */
- "IB|SET_DOOR_STATE1",
- "IB|SET_DOOR_STATE2",
- "IB|SET_DOOR_STATE3",
- "IB|SET_DOOR_STATE2",
+ "IB|SET_DOOR_OPEN",
+ "IB|SET_DOOR_CLOSED",
+ "IB|SET_DOOR_LOCKED",
+ "IB|SET_DOOR_OPEN",
/* 148 */
- "IB|IF_DOOR_OPEN",
- NULL,
- NULL,
+ "IBJ|IF_DOOR_OPEN",
+ "IBJ|IF_DOOR_CLOSED",
+ "IBJ|IF_DOOR_LOCKED",
"BI|STORE_ITEM",
/* 152 */
"BB|GET_ITEM",
@@ -587,8 +587,8 @@ static const char *const ww_opcode_name_table[256] = {
NULL,
/* 160 */
"B|SET_INK",
- "BWBW|SETUP_TEXT",
- "BBT|PRINT_STR",
+ "|UNK_161",
+ "BT|PRINT_STR",
"W|PLAY_EFFECT",
/* 164 */
"|getDollar2",
diff --git a/engines/agos/items.cpp b/engines/agos/items.cpp
index 48e3fc2b66..7129cc2dc7 100644
--- a/engines/agos/items.cpp
+++ b/engines/agos/items.cpp
@@ -326,16 +326,21 @@ void AGOSEngine::setupElvira2Opcodes(OpcodeProc *op) {
op[34] = &AGOSEngine::o_copyof;
op[35] = &AGOSEngine::o_copyfo;
op[54] = &AGOSEngine::o_moveDirn;
+ op[73] = &AGOSEngine::oe2_pobj;
op[83] = &AGOSEngine::o1_rescan;
+ op[89] = &AGOSEngine::oe2_loadUserGame;
op[98] = &AGOSEngine::o1_animate;
op[99] = &AGOSEngine::o1_stopAnimate;
op[127] = &AGOSEngine::o1_playTune;
- op[144] = &AGOSEngine::oe2_setDoorState1;
- op[145] = &AGOSEngine::oe2_setDoorState2;
- op[146] = &AGOSEngine::oe2_setDoorState3;
- op[147] = &AGOSEngine::oe2_setDoorState2;
- op[148] = &AGOSEngine::oww_ifDoorOpen;
+ op[144] = &AGOSEngine::oe2_setDoorOpen;
+ op[145] = &AGOSEngine::oe2_setDoorClosed;
+ op[146] = &AGOSEngine::oe2_setDoorLocked;
+ op[147] = &AGOSEngine::oe2_setDoorClosed;
+ op[148] = &AGOSEngine::oe2_ifDoorOpen;
+ op[149] = &AGOSEngine::oe2_ifDoorClosed;
+ op[150] = &AGOSEngine::oe2_ifDoorLocked;
op[161] = &AGOSEngine::oe2_opcode161;
+ op[162] = &AGOSEngine::oe2_screenTextMsg;
op[175] = &AGOSEngine::o_getDollar2;
op[179] = &AGOSEngine::o_isAdjNoun;
op[180] = &AGOSEngine::o_b2Set;
@@ -344,7 +349,6 @@ void AGOSEngine::setupElvira2Opcodes(OpcodeProc *op) {
op[183] = &AGOSEngine::o_b2NotZero;
// Code difference, check if triggered
- op[162] = NULL;
op[163] = NULL;
op[164] = NULL;
op[165] = NULL;
@@ -371,18 +375,23 @@ void AGOSEngine::setupWaxworksOpcodes(OpcodeProc *op) {
op[54] = &AGOSEngine::o_moveDirn;
op[55] = &AGOSEngine::oww_goto;
op[70] = &AGOSEngine::o1_printLongText;
+ op[73] = &AGOSEngine::oe2_pobj;
op[83] = &AGOSEngine::o1_rescan;
op[98] = &AGOSEngine::o1_animate;
op[99] = &AGOSEngine::o1_stopAnimate;
op[85] = &AGOSEngine::oww_whereTo;
+ op[89] = &AGOSEngine::oe2_loadUserGame;
op[105] = &AGOSEngine::oww_menu;
op[106] = &AGOSEngine::oww_textMenu;
op[127] = &AGOSEngine::o1_playTune;
- op[144] = &AGOSEngine::oe2_setDoorState1;
- op[145] = &AGOSEngine::oe2_setDoorState2;
- op[146] = &AGOSEngine::oe2_setDoorState3;
- op[147] = &AGOSEngine::oe2_setDoorState2;
- op[148] = &AGOSEngine::oww_ifDoorOpen;
+ op[144] = &AGOSEngine::oe2_setDoorOpen;
+ op[145] = &AGOSEngine::oe2_setDoorClosed;
+ op[146] = &AGOSEngine::oe2_setDoorLocked;
+ op[147] = &AGOSEngine::oe2_setDoorClosed;
+ op[148] = &AGOSEngine::oe2_ifDoorOpen;
+ op[149] = &AGOSEngine::oe2_ifDoorClosed;
+ op[150] = &AGOSEngine::oe2_ifDoorLocked;
+ op[162] = &AGOSEngine::oe2_screenTextMsg;
op[175] = &AGOSEngine::o_getDollar2;
op[179] = &AGOSEngine::o_isAdjNoun;
op[180] = &AGOSEngine::o_b2Set;
@@ -396,7 +405,6 @@ void AGOSEngine::setupWaxworksOpcodes(OpcodeProc *op) {
// Code difference, check if triggered
op[161] = NULL;
- op[162] = NULL;
op[163] = NULL;
op[164] = NULL;
op[165] = NULL;
@@ -1907,28 +1915,68 @@ void AGOSEngine::oe1_printStats() {
// Elvira 2 Opcodes
// -----------------------------------------------------------------------
-void AGOSEngine::oe2_setDoorState1() {
- // 144:
+void AGOSEngine::oe2_pobj() {
+ // 73: print object
+ SubObject *subObject = (SubObject *)findChildOfType(getNextItemPtr(), 2);
+
+ if (subObject != NULL && subObject->objectFlags & kOFText)
+ showMessageFormat("%s", (const char *)getStringPtrByID(subObject->objectFlagValue[0]));
+}
+
+void AGOSEngine::oe2_loadUserGame() {
+ // 89: load user game
+ getStringPtrByID(getNextStringID());
+}
+
+void AGOSEngine::oe2_setDoorOpen() {
+ // 144: set door open
Item *i = getNextItemPtr();
setDoorState(i, getVarOrByte(), 1);
}
-void AGOSEngine::oe2_setDoorState2() {
- // 145:
+void AGOSEngine::oe2_setDoorClosed() {
+ // 145: set door closed
Item *i = getNextItemPtr();
setDoorState(i, getVarOrByte(), 2);
}
-void AGOSEngine::oe2_setDoorState3() {
- // 146:
+void AGOSEngine::oe2_setDoorLocked() {
+ // 146: set door locked
Item *i = getNextItemPtr();
setDoorState(i, getVarOrByte(), 3);
}
+void AGOSEngine::oe2_ifDoorOpen() {
+ // 148: if door open
+ Item *i = getNextItemPtr();
+ uint16 d = getVarOrByte();
+ setScriptCondition(getDoorState(i, d) == 1);
+}
+
+void AGOSEngine::oe2_ifDoorClosed() {
+ // 149: if door closed
+ Item *i = getNextItemPtr();
+ uint16 d = getVarOrByte();
+ setScriptCondition(getDoorState(i, d) == 2);
+}
+
+void AGOSEngine::oe2_ifDoorLocked() {
+ // 150: if door locked
+ Item *i=getNextItemPtr();
+ uint16 d = getVarOrByte();
+ setScriptCondition(getDoorState(i, d) == 3);
+}
+
void AGOSEngine::oe2_opcode161() {
// 161:
}
+void AGOSEngine::oe2_screenTextMsg() {
+ // 162: print string
+ showMessageFormat("%s\n", getStringPtrByID(getNextStringID()));
+ getVarOrByte();
+}
+
// -----------------------------------------------------------------------
// Waxworks Opcodes
// -----------------------------------------------------------------------
@@ -1970,13 +2018,6 @@ void AGOSEngine::oww_textMenu() {
getVarOrByte();
}
-void AGOSEngine::oww_ifDoorOpen() {
- // 148: if door open
- Item *item = getNextItemPtr();
- uint16 d = getVarOrByte();
- setScriptCondition(getDoorState(item, d) != 0);
-}
-
void AGOSEngine::oww_opcode184() {
printf("%s\n", getStringPtrByID(getNextStringID()));
}