aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorTravis Howell2006-10-29 07:01:55 +0000
committerTravis Howell2006-10-29 07:01:55 +0000
commitde7f2504760c31ff5212bd0763146a5774e2d906 (patch)
tree805c09271841f8b0dd9cdd26308befd3524ef844 /engines
parent8ad806535a4a57ba9e920f9b79c9a7a16289cb8c (diff)
downloadscummvm-rg350-de7f2504760c31ff5212bd0763146a5774e2d906.tar.gz
scummvm-rg350-de7f2504760c31ff5212bd0763146a5774e2d906.tar.bz2
scummvm-rg350-de7f2504760c31ff5212bd0763146a5774e2d906.zip
Add opcode and opcode stub for Elvira 2. Remove unused opcode code
svn-id: r24562
Diffstat (limited to 'engines')
-rw-r--r--engines/agos/agos.h5
-rw-r--r--engines/agos/debug.h36
-rw-r--r--engines/agos/rooms.cpp17
-rw-r--r--engines/agos/script_e2.cpp25
-rw-r--r--engines/agos/script_ww.cpp7
5 files changed, 55 insertions, 35 deletions
diff --git a/engines/agos/agos.h b/engines/agos/agos.h
index c268ea1319..b16169c57a 100644
--- a/engines/agos/agos.h
+++ b/engines/agos/agos.h
@@ -694,6 +694,7 @@ protected:
int changeExitStates(SubSuperRoom *sr, int n, int d, uint16 s);
uint16 getExitState(Item *item, uint16 x, uint16 d);
void setExitState(Item *i, uint16 n, uint16 d, uint16 s);
+ void setSRExit(Item *i, int n, int d, uint16 s);
void moveDirn_e2(Item *i, uint x);
// Waxworks specific
@@ -1154,7 +1155,6 @@ public:
void oe2_setOValue();
void oe2_ink();
void oe2_printStats();
- void oe2_unk162();
void oe2_setSuperRoom();
void oe2_getSuperRoom();
void oe2_setExitOpen();
@@ -1163,7 +1163,9 @@ public:
void oe2_ifExitOpen();
void oe2_ifExitClosed();
void oe2_ifExitLocked();
+ void oe2_unk174();
void oe2_getDollar2();
+ void oe2_setSRExit();
void oe2_unk177();
void oe2_unk178();
void oe2_isAdjNoun();
@@ -1181,7 +1183,6 @@ public:
void oww_whereTo();
void oww_menu();
void oww_textMenu();
- void oww_screenTextMsg();
void oww_boxMessage();
void oww_boxMsg();
void oww_boxLongText();
diff --git a/engines/agos/debug.h b/engines/agos/debug.h
index f5a37ad1ec..d8784db703 100644
--- a/engines/agos/debug.h
+++ b/engines/agos/debug.h
@@ -467,9 +467,9 @@ static const char *const elvira2_opcodeNameTable[256] = {
"T|SHOW_STRING_NL",
/* 64 */
"T|SHOW_STRING",
- "I|UNK_65",
- "I|UNK_66",
- "|UNK_67",
+ NULL,
+ NULL,
+ NULL,
/* 68 */
"x|END",
"x|DONE",
@@ -517,8 +517,8 @@ static const char *const elvira2_opcodeNameTable[256] = {
"|CLS",
/* 104 */
"B|CLOSE_WINDOW",
- "B|UNK_105",
- "W|UNK_106",
+ "B|SET_AGOS_MENU",
+ NULL,
"WWWWWIW|ADD_BOX",
/* 108 */
"W|DEL_BOX",
@@ -587,8 +587,8 @@ static const char *const elvira2_opcodeNameTable[256] = {
NULL,
/* 160 */
"B|SET_INK",
- "|UNK_161",
- "TB|UNK_162",
+ "|PRINT_STATS",
+ NULL,
NULL,
/* 164 */
NULL,
@@ -606,7 +606,7 @@ static const char *const elvira2_opcodeNameTable[256] = {
"W|UNK_174",
"|getDollar2",
/* 176 */
- "IWBB|UNK_176",
+ "IWBB|SET_SUPER_ROOM_EXIT",
"B|UNK_177",
"B|UNK_178",
"IWWJ|IS_ADJ_NOUN",
@@ -750,8 +750,8 @@ static const char *const waxworks_opcodeNameTable[256] = {
"|CLS",
/* 104 */
"B|CLOSE_WINDOW",
- "B|MENU",
- "BB|TEXT_MENU",
+ "B|SET_AGOS_MENU",
+ "BB|SET_TEXT_MENU",
"WWWWWIW|ADD_BOX",
/* 108 */
"W|DEL_BOX",
@@ -820,13 +820,13 @@ static const char *const waxworks_opcodeNameTable[256] = {
NULL,
/* 160 */
"B|SET_INK",
- "|UNK_161",
- "TB|PRINT_STR",
+ NULL,
+ NULL,
NULL,
/* 164 */
NULL,
- "W|SET_SUPER_ROOM",
- "BV|GET_SUPER_ROOM",
+ NULL,
+ NULL,
NULL,
/* 168 */
NULL,
@@ -836,12 +836,12 @@ static const char *const waxworks_opcodeNameTable[256] = {
/* 172 */
NULL,
NULL,
- "W|UNK_174",
+ NULL,
"|getDollar2",
/* 176 */
- "IWBB|UNK_176",
- "B|UNK_177",
- "B|UNK_178",
+ NULL,
+ NULL,
+ NULL,
"IWWJ|IS_ADJ_NOUN",
/* 180 */
"B|SET_BIT2",
diff --git a/engines/agos/rooms.cpp b/engines/agos/rooms.cpp
index 8154596562..e287d22b28 100644
--- a/engines/agos/rooms.cpp
+++ b/engines/agos/rooms.cpp
@@ -282,6 +282,23 @@ void AGOSEngine::setExitState(Item *i, uint16 n, uint16 d, uint16 s) {
changeExitStates(sr, n, d, s);
}
+void AGOSEngine::setSRExit(Item *i, int n, int d, uint16 s) {
+ uint16 *c;
+ uint16 mask = 3;
+
+ SubSuperRoom *sr = (SubSuperRoom *)findChildOfType(i, 4);
+ if (sr) {
+ n--;
+ c = sr->roomExitStates;
+ c += n;
+ d <<= 1;
+ mask <<= d;
+ s <<= d;
+ *c &= ~mask;
+ *c |= s;
+ }
+}
+
void AGOSEngine::moveDirn_e2(Item *i, uint x) {
SubSuperRoom *sr;
Item *d, *p;
diff --git a/engines/agos/script_e2.cpp b/engines/agos/script_e2.cpp
index bce478b0c6..597960a67b 100644
--- a/engines/agos/script_e2.cpp
+++ b/engines/agos/script_e2.cpp
@@ -65,7 +65,6 @@ void AGOSEngine::setupElvira2Opcodes(OpcodeProc *op) {
op[149] = &AGOSEngine::oe2_ifDoorClosed;
op[150] = &AGOSEngine::oe2_ifDoorLocked;
op[161] = &AGOSEngine::oe2_printStats;
- op[162] = &AGOSEngine::oe2_unk162;
op[165] = &AGOSEngine::oe2_setSuperRoom;
op[166] = &AGOSEngine::oe2_getSuperRoom;
op[167] = &AGOSEngine::oe2_setExitOpen;
@@ -75,7 +74,9 @@ void AGOSEngine::setupElvira2Opcodes(OpcodeProc *op) {
op[171] = &AGOSEngine::oe2_ifExitOpen;
op[172] = &AGOSEngine::oe2_ifExitClosed;
op[173] = &AGOSEngine::oe2_ifExitLocked;
+ op[174] = &AGOSEngine::oe2_unk174;
op[175] = &AGOSEngine::oe2_getDollar2;
+ op[176] = &AGOSEngine::oe2_setSRExit;
op[177] = &AGOSEngine::oe2_unk177;
op[178] = &AGOSEngine::oe2_unk178;
op[179] = &AGOSEngine::oe2_isAdjNoun;
@@ -321,13 +322,6 @@ void AGOSEngine::oe2_printStats() {
mouseOn();
}
-void AGOSEngine::oe2_unk162() {
- // 162: print string?
- showMessageFormat("%s\n", getStringPtrByID(getNextStringID()));
- uint a = getVarOrByte();
- debug(0, "oe2_unk162: stub (%d)", a);
-}
-
void AGOSEngine::oe2_setSuperRoom() {
// 165: set super room
_superRoomNumber = getVarOrWord();
@@ -386,6 +380,12 @@ void AGOSEngine::oe2_ifExitLocked() {
setScriptCondition(getExitState(i, n, d) == 3);
}
+void AGOSEngine::oe2_unk174() {
+ // 174:
+ uint a = getVarOrWord();
+ debug(0, "oe2_unk174: stub (%d)", a);
+}
+
void AGOSEngine::oe2_getDollar2() {
// 175
_showPreposition = true;
@@ -411,6 +411,15 @@ void AGOSEngine::oe2_getDollar2() {
_showPreposition = false;
}
+void AGOSEngine::oe2_setSRExit() {
+ // 176: set super room exit
+ Item *i = getNextItemPtr();
+ uint n = getVarOrWord();
+ uint d = getVarOrByte();
+ uint s = getVarOrByte();
+ setSRExit(i, n, d, s);
+}
+
void AGOSEngine::oe2_unk177() {
// 177: set unknown vga event
uint a = getVarOrByte();
diff --git a/engines/agos/script_ww.cpp b/engines/agos/script_ww.cpp
index 8946f4b2fa..5907163ac5 100644
--- a/engines/agos/script_ww.cpp
+++ b/engines/agos/script_ww.cpp
@@ -66,7 +66,6 @@ void AGOSEngine::setupWaxworksOpcodes(OpcodeProc *op) {
op[148] = &AGOSEngine::oe2_ifDoorOpen;
op[149] = &AGOSEngine::oe2_ifDoorClosed;
op[150] = &AGOSEngine::oe2_ifDoorLocked;
- op[162] = &AGOSEngine::oww_screenTextMsg;
op[175] = &AGOSEngine::oe2_getDollar2;
op[179] = &AGOSEngine::oe2_isAdjNoun;
op[180] = &AGOSEngine::oe2_b2Set;
@@ -169,12 +168,6 @@ void AGOSEngine::oww_textMenu() {
_textMenu[slot] = getVarOrByte();
}
-void AGOSEngine::oww_screenTextMsg() {
- // 162: print string
- showMessageFormat("%s\n", getStringPtrByID(getNextStringID()));
- getVarOrByte();
-}
-
void AGOSEngine::oww_boxMessage() {
// 184: print message to box
boxTextMessage((const char *)getStringPtrByID(getNextStringID()));