diff options
author | sylvaintv | 2012-05-13 03:21:09 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2018-03-28 17:36:57 +0200 |
commit | 91651f4090509e8263663127054af471127abaa2 (patch) | |
tree | 8ccd41aad206dfe3481e3ac89775114422a07c4e /engines/lilliput | |
parent | 95fa16564501014a47dee48d89d796d94f2904df (diff) | |
download | scummvm-rg350-91651f4090509e8263663127054af471127abaa2.tar.gz scummvm-rg350-91651f4090509e8263663127054af471127abaa2.tar.bz2 scummvm-rg350-91651f4090509e8263663127054af471127abaa2.zip |
LILLIPUT: Intro is finally starting correctly
The game was not setting good character states because
the save flag was not set.
Diffstat (limited to 'engines/lilliput')
-rw-r--r-- | engines/lilliput/lilliput.cpp | 29 | ||||
-rw-r--r-- | engines/lilliput/lilliput.h | 2 | ||||
-rw-r--r-- | engines/lilliput/script.cpp | 4 |
3 files changed, 19 insertions, 16 deletions
diff --git a/engines/lilliput/lilliput.cpp b/engines/lilliput/lilliput.cpp index 2aaece16ee..6cccd5cead 100644 --- a/engines/lilliput/lilliput.cpp +++ b/engines/lilliput/lilliput.cpp @@ -164,7 +164,7 @@ LilliputEngine::LilliputEngine(OSystem *syst, const LilliputGameDescription *gd) _word1289D = 0; _numCharacters = 0; - _saveFlag = false; + _saveFlag = true; _byte16F07_menuId = 0; _array16C54[0] = _array16C58[3] = 1; @@ -528,7 +528,7 @@ void LilliputEngine::displayFunction10() { displayMousePointer(); } -void LilliputEngine::sub15A4C(int &vgaIndex, byte *srcBuf, int &bufIndex) { +void LilliputEngine::sub15A4C(int vgaIndex, byte *srcBuf, int &bufIndex) { debugC(2, kDebugEngineTBC, "sub15A4C()"); int var3 = 0; @@ -544,7 +544,7 @@ void LilliputEngine::sub15A4C(int &vgaIndex, byte *srcBuf, int &bufIndex) { ++var3; } - var1 = (0x3D - var3) < 1; + var1 = (0x3D - var3) << 1; vgaIndex += var1; bufIndex = bckIndex; @@ -554,7 +554,7 @@ void LilliputEngine::sub15A4C(int &vgaIndex, byte *srcBuf, int &bufIndex) { if ((var1 == 0) || (var1 == '|')) break; - displayChar(vgaIndex, srcBuf[bufIndex]); + displayChar(vgaIndex, var1); vgaIndex += 4; } @@ -680,7 +680,7 @@ void LilliputEngine::displayCharactersOnMap() { int y = (3 * _scriptHandler->_array1614BPosY[index]) + 1; int x = (_scriptHandler->_array16123PosX[index] * 4) + 1; - _word15E5D[index] = y * 320 + x; + _word15E5D[index] = y * 320 + x; _byte15E35[index] = buf[y * 320 + x]; buf[y * 320 + x] = _scriptHandler->_array128EF[index]; } @@ -2004,7 +2004,7 @@ byte LilliputEngine::sub16675(int idx, Common::Point var1) { debugC(2, kDebugEngineTBC, "sub16675(%d, %d - %d)", idx, var1.x, var1.y); sub16685(idx, var1); - int index = var1.y; + int index = idx; switch (var1.x) { case 0: break; @@ -2674,15 +2674,17 @@ void LilliputEngine::handleGameScripts() { int tmpVal = _rulesBuffer2_12[index]; if (tmpVal == 0xFF) return; - /* _scriptHandler->listAllTexts(); + + debugC(1, kDebugEngineTBC, "================= Menu Script =================="); ScriptStream script = ScriptStream(_menuScript, _menuScriptSize); _scriptHandler->disasmScript(script); debugC(1, kDebugEngineTBC, "============= End Menu Script =================="); + for (int i = 0; i < _gameScriptIndexSize; i++) { assert(tmpVal < _gameScriptIndexSize); debugC(1, kDebugEngineTBC, "================= Game Script %d ==================", i); @@ -2692,11 +2694,8 @@ void LilliputEngine::handleGameScripts() { } while(1); - - if(tmpVal == 6) { - warning("e"); - } - */ +*/ + i = index; //debugC(1, kDebugEngineTBC, "before char %d, pos %d %d, var0 %d, var1 %d, var2 %d var16 %d, script enabled %d", i, _characterPositionX[i], _characterPositionY[i], *getCharacterVariablesPtr(i * 32 + 0), *getCharacterVariablesPtr(i * 32 + 1), *getCharacterVariablesPtr(i * 32 + 2), *getCharacterVariablesPtr(i * 32 + 22), _scriptHandler->_characterScriptEnabled[i]); @@ -2705,7 +2704,6 @@ void LilliputEngine::handleGameScripts() { _scriptHandler->runScript(ScriptStream(&_arrayGameScripts[_arrayGameScriptIndex[tmpVal]], _arrayGameScriptIndex[tmpVal + 1] - _arrayGameScriptIndex[tmpVal])); debugC(1, kDebugEngineTBC, "============= End Game Script %d for character %d ==================", tmpVal, index); - //warning("dump char stat"); //debugC(1, kDebugEngineTBC, "after char %d, pos %d %d, var0 %d, var1 %d, var2 %d var16 %d, script enabled %d", i, _characterPositionX[i], _characterPositionY[i], *getCharacterVariablesPtr(i * 32 + 0), *getCharacterVariablesPtr(i * 32 + 1), *getCharacterVariablesPtr(i * 32 + 2), *getCharacterVariablesPtr(i * 32 + 22), _scriptHandler->_characterScriptEnabled[i]); } @@ -2772,6 +2770,11 @@ void LilliputEngine::initialize() { byte *LilliputEngine::getCharacterVariablesPtr(int16 index) { debugC(1, kDebugEngineTBC, "getCharacterVariablesPtr(%d)", index); + if(index == 96 + 22) { + int a = 0; + } + + assert((index > -3120) && (index < 1400)); if (index >= 0) return &_characterVariables_[index]; diff --git a/engines/lilliput/lilliput.h b/engines/lilliput/lilliput.h index 35d6915162..03b2365938 100644 --- a/engines/lilliput/lilliput.h +++ b/engines/lilliput/lilliput.h @@ -289,7 +289,7 @@ public: void sub131FC(Common::Point pos); void sub1546F(Common::Point displayPos); void sub15498(Common::Point pos, int var2); - void sub15A4C(int &vgaIndex, byte *srcBuf, int &bufIndex); + void sub15A4C(int vgaIndex, byte *srcBuf, int &bufIndex); void checkMapClosing(bool &forceReturnFl); void sub16B63(int index); void sub16B76(int index); diff --git a/engines/lilliput/script.cpp b/engines/lilliput/script.cpp index 5866081759..1679298708 100644 --- a/engines/lilliput/script.cpp +++ b/engines/lilliput/script.cpp @@ -887,7 +887,7 @@ void LilliputScript::disasmScript( ScriptStream script) { if (p != opCode->_numArgs - 1) str += ", "; - if ( p < 5 ) + if ( p < 4 ) opArgType++; } str += ");"; @@ -1105,7 +1105,7 @@ void LilliputScript::sub189F5() { int var1; for (;;) { - var1 = _vm->_displayStringBuf[index]; + var1 = _vm->_displayStringBuf[index++]; if (var1 == 0) break; |