diff options
-rw-r--r-- | engines/agos/agos.h | 22 | ||||
-rw-r--r-- | engines/agos/icons.cpp | 4 | ||||
-rw-r--r-- | engines/agos/res_snd.cpp | 6 | ||||
-rw-r--r-- | engines/agos/script.cpp | 145 | ||||
-rw-r--r-- | engines/agos/script_e1.cpp | 2 | ||||
-rw-r--r-- | engines/agos/script_e2.cpp | 100 | ||||
-rw-r--r-- | engines/agos/script_ff.cpp | 2 | ||||
-rw-r--r-- | engines/agos/script_s2.cpp | 21 | ||||
-rw-r--r-- | engines/agos/string.cpp | 4 |
9 files changed, 153 insertions, 153 deletions
diff --git a/engines/agos/agos.h b/engines/agos/agos.h index 9845b912cf..d693c96c8b 100644 --- a/engines/agos/agos.h +++ b/engines/agos/agos.h @@ -649,7 +649,7 @@ protected: void setItemParent(Item *item, Item *parent); void setItemState(Item *item, int value); - void stopAnimateSimon1(uint a); + void stopAnimate(uint a); void stopAnimateSimon2(uint a, uint b); void enableBox(uint hitarea); @@ -1072,16 +1072,6 @@ public: void o_clearTimers(); void o_setDollar(); void o_isBox(); - void o_doTable(); - void o_storeItem(); - void o_getItem(); - void o_bSet(); - void o_bClear(); - void o_bZero(); - void o_bNotZero(); - void o_getOValue(); - void o_setOValue(); - void o_ink(); // Opcodes, Elvira 1 void oe1_present(); @@ -1142,12 +1132,22 @@ public: void oe2_doClass(); void oe2_pObj(); void oe2_drawItem(); + void oe2_doTable(); void oe2_setDoorOpen(); void oe2_setDoorClosed(); void oe2_setDoorLocked(); void oe2_ifDoorOpen(); void oe2_ifDoorClosed(); void oe2_ifDoorLocked(); + void oe2_storeItem(); + void oe2_getItem(); + void oe2_bSet(); + void oe2_bClear(); + void oe2_bZero(); + void oe2_bNotZero(); + void oe2_getOValue(); + void oe2_setOValue(); + void oe2_ink(); void oe2_printStats(); void oe2_unk162(); void oe2_setSuperRoom(); diff --git a/engines/agos/icons.cpp b/engines/agos/icons.cpp index d04076aa8a..3bb7153065 100644 --- a/engines/agos/icons.cpp +++ b/engines/agos/icons.cpp @@ -632,7 +632,7 @@ void AGOSEngine::addArrows(WindowBlock *window) { ha->window = window; ha->verb = 1; - stopAnimateSimon1(128); + stopAnimate(128); animate(0, 1, 128, 0, 0, 14); } else if (getGameType() == GType_WW) { ha->x = 255; @@ -671,7 +671,7 @@ void AGOSEngine::addArrows(WindowBlock *window) { void AGOSEngine::removeArrows(WindowBlock *window, uint num) { if (getGameType() == GType_SIMON1) { - stopAnimateSimon1(128); + stopAnimate(128); } else if (getGameType() == GType_WW) { setBitFlag(22, false); setWindowImageEx(6, 103); diff --git a/engines/agos/res_snd.cpp b/engines/agos/res_snd.cpp index f7b917b62c..7f01f04068 100644 --- a/engines/agos/res_snd.cpp +++ b/engines/agos/res_snd.cpp @@ -54,9 +54,9 @@ void AGOSEngine::playSpeech(uint speech_id, uint vgaSpriteId) { if (_subtitles && _scriptVar2) { animate(4, 2, 204, 0, 0, 0); waitForSync(204); - stopAnimateSimon1(204); + stopAnimate(204); } - stopAnimateSimon1(vgaSpriteId + 201); + stopAnimate(vgaSpriteId + 201); loadVoice(speech_id); animate(4, 2, vgaSpriteId + 201, 0, 0, 0); } @@ -108,7 +108,7 @@ void AGOSEngine::skipSpeech() { _variableArray[100] = 15; animate(4, 1, 130, 0, 0, 0); waitForSync(130); - stopAnimateSimon1(1); + stopAnimate(1); } } } diff --git a/engines/agos/script.cpp b/engines/agos/script.cpp index 64dc551848..3cb6be087e 100644 --- a/engines/agos/script.cpp +++ b/engines/agos/script.cpp @@ -130,16 +130,16 @@ void AGOSEngine::setupCommonOpcodes(OpcodeProc *op) { op[140] = &AGOSEngine::o_clearTimers; op[141] = &AGOSEngine::o_setDollar; op[142] = &AGOSEngine::o_isBox; - op[143] = &AGOSEngine::o_doTable; - op[151] = &AGOSEngine::o_storeItem; - op[152] = &AGOSEngine::o_getItem; - op[153] = &AGOSEngine::o_bSet; - op[154] = &AGOSEngine::o_bClear; - op[155] = &AGOSEngine::o_bZero; - op[156] = &AGOSEngine::o_bNotZero; - op[157] = &AGOSEngine::o_getOValue; - op[158] = &AGOSEngine::o_setOValue; - op[160] = &AGOSEngine::o_ink; + op[143] = &AGOSEngine::oe2_doTable; + op[151] = &AGOSEngine::oe2_storeItem; + op[152] = &AGOSEngine::oe2_getItem; + op[153] = &AGOSEngine::oe2_bSet; + op[154] = &AGOSEngine::oe2_bClear; + op[155] = &AGOSEngine::oe2_bZero; + op[156] = &AGOSEngine::oe2_bNotZero; + op[157] = &AGOSEngine::oe2_getOValue; + op[158] = &AGOSEngine::oe2_setOValue; + op[160] = &AGOSEngine::oe2_ink; } void AGOSEngine::setupOpcodes() { @@ -713,7 +713,7 @@ void AGOSEngine::o_addBox() { if (params & 8) flags |= kBFTextBox; if (params & 16) - flags |= 0x10; + flags |= kBFDragBox; x = getVarOrWord(); y = getVarOrWord(); @@ -946,106 +946,6 @@ void AGOSEngine::o_isBox() { setScriptCondition(isBoxDead(getVarOrWord())); } -void AGOSEngine::o_doTable() { - // 143: start item sub - SubRoom *r = (SubRoom *)findChildOfType(getNextItemPtr(), 1); - if (r != NULL) { - Subroutine *sub = getSubroutineByID(r->subroutine_id); - if (sub) { - startSubroutine(sub); - return; - } - } - - if (getGameType() == GType_ELVIRA2) { - SubSuperRoom *sr = (SubSuperRoom *)findChildOfType(getNextItemPtr(), 4); - if (sr != NULL) { - Subroutine *sub = getSubroutineByID(sr->subroutine_id); - if (sub) { - startSubroutine(sub); - return; - } - } - } -} - -void AGOSEngine::o_storeItem() { - // 151: set array6 to item - uint var = getVarOrByte(); - Item *item = getNextItemPtr(); - _itemStore[var] = item; -} - -void AGOSEngine::o_getItem() { - // 152: set m1 to m3 to array 6 - Item *item = _itemStore[getVarOrByte()]; - uint var = getVarOrByte(); - if (var == 1) { - _subjectItem = item; - } else { - _objectItem = item; - } -} - -void AGOSEngine::o_bSet() { - // 153: set bit - setBitFlag(getVarWrapper(), true); -} - -void AGOSEngine::o_bClear() { - // 154: clear bit - setBitFlag(getVarWrapper(), false); -} - -void AGOSEngine::o_bZero() { - // 155: is bit clear - setScriptCondition(!getBitFlag(getVarWrapper())); -} - -void AGOSEngine::o_bNotZero() { - // 156: is bit set - uint bit = getVarWrapper(); - - // WORKAROUND: Fix for glitch in some versions - if (getGameType() == GType_SIMON1 && _subroutine == 2962 && bit == 63) { - bit = 50; - } - - setScriptCondition(getBitFlag(bit)); -} - -void AGOSEngine::o_getOValue() { - // 157: get item int prop - Item *item = getNextItemPtr(); - SubObject *subObject = (SubObject *)findChildOfType(item, 2); - uint prop = getVarOrByte(); - - if (subObject != NULL && subObject->objectFlags & (1 << prop) && prop < 16) { - uint offs = getOffsetOfChild2Param(subObject, 1 << prop); - writeNextVarContents(subObject->objectFlagValue[offs]); - } else { - writeNextVarContents(0); - } -} - -void AGOSEngine::o_setOValue() { - // 158: set item prop - Item *item = getNextItemPtr(); - SubObject *subObject = (SubObject *)findChildOfType(item, 2); - uint prop = getVarOrByte(); - int value = getVarOrWord(); - - if (subObject != NULL && subObject->objectFlags & (1 << prop) && prop < 16) { - uint offs = getOffsetOfChild2Param(subObject, 1 << prop); - subObject->objectFlagValue[offs] = value; - } -} - -void AGOSEngine::o_ink() { - // 160 - setTextColor(getVarOrByte()); -} - // ----------------------------------------------------------------------- byte AGOSEngine::getByte() { @@ -1200,27 +1100,6 @@ void AGOSEngine::scriptMouseOff() { _lockWord &= ~0x8000; } -void AGOSEngine::waitForMark(uint i) { - _exitCutscene = false; - while (!(_marks & (1 << i))) { - if (_exitCutscene) { - if (getGameType() == GType_PP) { - if (_picture8600) - break; - } else { - if (getBitFlag(9)) { - endCutscene(); - break; - } - } - } else { - processSpecialKeys(); - } - - delay(10); - } -} - void AGOSEngine::sendSync(uint a) { uint16 id = to16Wrapper(a); _lockWord |= 0x8000; @@ -1236,7 +1115,7 @@ void AGOSEngine::setTextColor(uint color) { window->text_color = color; } -void AGOSEngine::stopAnimateSimon1(uint a) { +void AGOSEngine::stopAnimate(uint a) { uint16 b = to16Wrapper(a); _lockWord |= 0x8000; _vcPtr = (byte *)&b; diff --git a/engines/agos/script_e1.cpp b/engines/agos/script_e1.cpp index f64dd32972..b2deaa1d87 100644 --- a/engines/agos/script_e1.cpp +++ b/engines/agos/script_e1.cpp @@ -560,7 +560,7 @@ void AGOSEngine::oe1_animate() { void AGOSEngine::oe1_stopAnimate() { // 227: stop animate - stopAnimateSimon1(getVarOrWord()); + stopAnimate(getVarOrWord()); } void AGOSEngine::oe1_menu() { diff --git a/engines/agos/script_e2.cpp b/engines/agos/script_e2.cpp index 3e5fe1d430..d6cd21b984 100644 --- a/engines/agos/script_e2.cpp +++ b/engines/agos/script_e2.cpp @@ -136,6 +136,29 @@ void AGOSEngine::oe2_drawItem() { mouseOn(); } +void AGOSEngine::oe2_doTable() { + // 143: start item sub + SubRoom *r = (SubRoom *)findChildOfType(getNextItemPtr(), 1); + if (r != NULL) { + Subroutine *sub = getSubroutineByID(r->subroutine_id); + if (sub) { + startSubroutine(sub); + return; + } + } + + if (getGameType() == GType_ELVIRA2) { + SubSuperRoom *sr = (SubSuperRoom *)findChildOfType(getNextItemPtr(), 4); + if (sr != NULL) { + Subroutine *sub = getSubroutineByID(sr->subroutine_id); + if (sub) { + startSubroutine(sub); + return; + } + } + } +} + void AGOSEngine::oe2_setDoorOpen() { // 144: set door open Item *i = getNextItemPtr(); @@ -175,6 +198,83 @@ void AGOSEngine::oe2_ifDoorLocked() { setScriptCondition(getDoorState(i, d) == 3); } +void AGOSEngine::oe2_storeItem() { + // 151: set array6 to item + uint var = getVarOrByte(); + Item *item = getNextItemPtr(); + _itemStore[var] = item; +} + +void AGOSEngine::oe2_getItem() { + // 152: set m1 to m3 to array 6 + Item *item = _itemStore[getVarOrByte()]; + uint var = getVarOrByte(); + if (var == 1) { + _subjectItem = item; + } else { + _objectItem = item; + } +} + +void AGOSEngine::oe2_bSet() { + // 153: set bit + setBitFlag(getVarWrapper(), true); +} + +void AGOSEngine::oe2_bClear() { + // 154: clear bit + setBitFlag(getVarWrapper(), false); +} + +void AGOSEngine::oe2_bZero() { + // 155: is bit clear + setScriptCondition(!getBitFlag(getVarWrapper())); +} + +void AGOSEngine::oe2_bNotZero() { + // 156: is bit set + uint bit = getVarWrapper(); + + // WORKAROUND: Fix for glitch in some versions + if (getGameType() == GType_SIMON1 && _subroutine == 2962 && bit == 63) { + bit = 50; + } + + setScriptCondition(getBitFlag(bit)); +} + +void AGOSEngine::oe2_getOValue() { + // 157: get item int prop + Item *item = getNextItemPtr(); + SubObject *subObject = (SubObject *)findChildOfType(item, 2); + uint prop = getVarOrByte(); + + if (subObject != NULL && subObject->objectFlags & (1 << prop) && prop < 16) { + uint offs = getOffsetOfChild2Param(subObject, 1 << prop); + writeNextVarContents(subObject->objectFlagValue[offs]); + } else { + writeNextVarContents(0); + } +} + +void AGOSEngine::oe2_setOValue() { + // 158: set item prop + Item *item = getNextItemPtr(); + SubObject *subObject = (SubObject *)findChildOfType(item, 2); + uint prop = getVarOrByte(); + int value = getVarOrWord(); + + if (subObject != NULL && subObject->objectFlags & (1 << prop) && prop < 16) { + uint offs = getOffsetOfChild2Param(subObject, 1 << prop); + subObject->objectFlagValue[offs] = value; + } +} + +void AGOSEngine::oe2_ink() { + // 160 + setTextColor(getVarOrByte()); +} + void AGOSEngine::oe2_printStats() { // 161: print stats WindowBlock *window = _dummyWindow; diff --git a/engines/agos/script_ff.cpp b/engines/agos/script_ff.cpp index 1b07f48fcb..bcfc25852f 100644 --- a/engines/agos/script_ff.cpp +++ b/engines/agos/script_ff.cpp @@ -165,7 +165,7 @@ void AGOSEngine::off_addBox() { if (params & 8) flags |= kBFTextBox; if (params & 16) - flags |= 0x10; + flags |= kBFHyperBox; x = getVarOrWord(); y = getVarOrWord(); diff --git a/engines/agos/script_s2.cpp b/engines/agos/script_s2.cpp index b185616e6b..f5bde3f506 100644 --- a/engines/agos/script_s2.cpp +++ b/engines/agos/script_s2.cpp @@ -241,4 +241,25 @@ void AGOSEngine::os2_waitMark() { waitForMark(i); } +void AGOSEngine::waitForMark(uint i) { + _exitCutscene = false; + while (!(_marks & (1 << i))) { + if (_exitCutscene) { + if (getGameType() == GType_PP) { + if (_picture8600) + break; + } else { + if (getBitFlag(9)) { + endCutscene(); + break; + } + } + } else { + processSpecialKeys(); + } + + delay(10); + } +} + } // End of namespace AGOS diff --git a/engines/agos/string.cpp b/engines/agos/string.cpp index c75948e216..2bd7f76db8 100644 --- a/engines/agos/string.cpp +++ b/engines/agos/string.cpp @@ -453,7 +453,7 @@ void AGOSEngine::printScreenText(uint vgaSpriteId, uint color, const char *strin } if (getGameType() == GType_SIMON1) - stopAnimateSimon1(vgaSpriteId + 199); + stopAnimate(vgaSpriteId + 199); else stopAnimateSimon2(2, vgaSpriteId); @@ -678,7 +678,7 @@ void AGOSEngine::printBox() { _linePtrs[0] = _boxBuffer; if (_boxCR == 0) _boxLineCount++; - stopAnimateSimon1(105); + stopAnimate(105); BoxSize = getBoxSize(); _variableArray[53] = BoxSize; animate(3, 1, 100, 0, 0, 0); |