diff options
author | Strangerke | 2012-04-29 11:48:10 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2018-03-28 17:36:57 +0200 |
commit | 802305799994b6ef33287a24bafd8ffdba0f861e (patch) | |
tree | 3e447c01b48bebaa034027b2df1138e4887cfadf | |
parent | 6eccd8e6f35ed1b172d831e4b7457139163cde85 (diff) | |
download | scummvm-rg350-802305799994b6ef33287a24bafd8ffdba0f861e.tar.gz scummvm-rg350-802305799994b6ef33287a24bafd8ffdba0f861e.tar.bz2 scummvm-rg350-802305799994b6ef33287a24bafd8ffdba0f861e.zip |
LILLIPUT: Implement some more opcodes
-rw-r--r-- | engines/lilliput/lilliput.cpp | 2 | ||||
-rw-r--r-- | engines/lilliput/lilliput.h | 2 | ||||
-rw-r--r-- | engines/lilliput/script.cpp | 67 | ||||
-rw-r--r-- | engines/lilliput/script.h | 2 |
4 files changed, 61 insertions, 12 deletions
diff --git a/engines/lilliput/lilliput.cpp b/engines/lilliput/lilliput.cpp index 4b2e5c0c02..75c1faf00c 100644 --- a/engines/lilliput/lilliput.cpp +++ b/engines/lilliput/lilliput.cpp @@ -126,6 +126,8 @@ LilliputEngine::LilliputEngine(OSystem *syst, const LilliputGameDescription *gd) _skipDisplayFlag1 = 1; _skipDisplayFlag2 = 0; _displayMap = 0; + _debugFlag = 0; + _byte14837 = 0; _scriptHandler = new LilliputScript(this); _soundHandler = new LilliputSound(this); diff --git a/engines/lilliput/lilliput.h b/engines/lilliput/lilliput.h index e9b46953d0..97828f298a 100644 --- a/engines/lilliput/lilliput.h +++ b/engines/lilliput/lilliput.h @@ -106,6 +106,8 @@ public: byte _byte12FE3; byte _byte16F08; byte _byte15EAD; + byte _debugFlag; // Mostly useless, as the associated functions are empty + byte _byte14837; // Unused byte, set by an opcode byte _array147D1[3]; byte _buffer1[45056]; diff --git a/engines/lilliput/script.cpp b/engines/lilliput/script.cpp index 6b576930da..18aef226c4 100644 --- a/engines/lilliput/script.cpp +++ b/engines/lilliput/script.cpp @@ -467,7 +467,7 @@ void LilliputScript::handleOpcodeType2(int curWord) { OC_sub18387(); break; case 0x4B: - OC_setByte14835(); + OC_setDebugFlag(); break; case 0x4C: OC_setByte14837(); @@ -2342,11 +2342,20 @@ void LilliputScript::OC_sub1801D() { void LilliputScript::OC_sub1805D() { warning("OC_sub1805D"); } + void LilliputScript::OC_sub18074() { - warning("OC_sub18074"); + debugC(1, kDebugScript, "OC_sub18074()"); + + int var2 = _currScript->readUint16LE(); + byte var1 = (_currScript->readUint16LE() & 0xFF); + + _vm->_rulesBuffer2_16[(_vm->_rulesBuffer2PrevIndx * 32) + var2] = var1; } + void LilliputScript::OC_sub1808B() { - warning("OC_sub1808B"); + debugC(1, kDebugScript, "OC_sub1808B()"); + + _vm->_rulesBuffer2_9[_vm->_rulesBuffer2PrevIndx] = (_currScript->readUint16LE() & 0xFF); } void LilliputScript::OC_sub18099() { @@ -2451,13 +2460,30 @@ void LilliputScript::OC_sub18213() { } void LilliputScript::OC_sub18252() { - warning("OC_sub18252"); + debugC(1, kDebugScript, "OC_sub18252()"); + + int index = getValue1(); + assert(index < 40); + + _vm->_array12299[index] = 4; } + void LilliputScript::OC_sub18260() { warning("OC_sub18260"); } + void LilliputScript::OC_sub182EC() { - warning("OC_sub182EC"); + debugC(1, kDebugScript, "OC_sub182EC()"); + + byte *tmpArr = getBuffer215Ptr(); + + byte var1 = (_currScript->readUint16LE() & 0xFF); + byte var2 = (_currScript->readUint16LE() & 0xFF); + + if (var2 == 0) + tmpArr[0] = (0xFF ^ var1); + else + tmpArr[0] |= var1; } void LilliputScript::OC_PaletteFadeOut() { @@ -2487,7 +2513,6 @@ void LilliputScript::OC_loadAndDisplayCUBESx_GFX() { _vm->_bufferCubegfx = _vm->loadVGA(fileName, false); _vm->displayFunction9(); _vm->displayFunction15(); - } void LilliputScript::OC_sub1834C() { @@ -2505,8 +2530,15 @@ void LilliputScript::OC_sub18359() { int var1 = _currScript->readUint16LE(); _array122C1[_vm->_rulesBuffer2PrevIndx] = var1; } + void LilliputScript::OC_sub18367() { - warning("OC_sub18367"); + debugC(1, kDebugScript, "OC_sub18367()"); + + _characterScriptEnabled[_vm->_rulesBuffer2PrevIndx] = 1; + _vm->_ptr_rulesBuffer2_15[0] = _array122C1[_vm->_rulesBuffer2PrevIndx]; + _vm->_ptr_rulesBuffer2_15[1] = 0; + _vm->_ptr_rulesBuffer2_15[2] = 0; + _vm->_ptr_rulesBuffer2_15[3] = 0; } void LilliputScript::OC_sub17D04() { @@ -2519,14 +2551,27 @@ void LilliputScript::OC_sub17D04() { } void LilliputScript::OC_sub18387() { - warning("OC_sub18387"); + debugC(1, kDebugScript, "OC_sub18387()"); + + int index = getValue1(); + byte var1 = _currScript->readUint16LE() & 0xFF; + + assert(index < 40); + _vm->_rulesBuffer2_10[index] = var1; } -void LilliputScript::OC_setByte14835() { - warning("OC_setByte14835"); + +void LilliputScript::OC_setDebugFlag() { + debugC(1, kDebugScript, "OC_setDebugFlag()"); + + _vm->_debugFlag = 1; } + void LilliputScript::OC_setByte14837() { - warning("OC_setByte14837"); + debugC(1, kDebugScript, "OC_setByte14837()"); + + _vm->_byte14837 = 1; } + void LilliputScript::OC_sub183A2() { warning("OC_sub183A2"); } diff --git a/engines/lilliput/script.h b/engines/lilliput/script.h index 9cd0899be2..1348bd7bce 100644 --- a/engines/lilliput/script.h +++ b/engines/lilliput/script.h @@ -251,7 +251,7 @@ private: void OC_sub18367(); void OC_sub17D04(); void OC_sub18387(); - void OC_setByte14835(); + void OC_setDebugFlag(); void OC_setByte14837(); void OC_sub183A2(); void OC_sub183C6(); |