diff options
author | sylvaintv | 2012-05-03 00:54:08 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2018-03-28 17:36:57 +0200 |
commit | 61e5d395464ad8924a0885ce710acf3b91ccd710 (patch) | |
tree | 1d5905ebe91363d541de045f96b99d2bed492ec7 /engines/lilliput | |
parent | f17868ebd9d5570881777d8e8d1aec0611bea738 (diff) | |
download | scummvm-rg350-61e5d395464ad8924a0885ce710acf3b91ccd710.tar.gz scummvm-rg350-61e5d395464ad8924a0885ce710acf3b91ccd710.tar.bz2 scummvm-rg350-61e5d395464ad8924a0885ce710acf3b91ccd710.zip |
LILLIPUT: 2 new subs
Diffstat (limited to 'engines/lilliput')
-rw-r--r-- | engines/lilliput/lilliput.cpp | 40 | ||||
-rw-r--r-- | engines/lilliput/lilliput.h | 5 |
2 files changed, 43 insertions, 2 deletions
diff --git a/engines/lilliput/lilliput.cpp b/engines/lilliput/lilliput.cpp index 7002b2e05f..f50a59551c 100644 --- a/engines/lilliput/lilliput.cpp +++ b/engines/lilliput/lilliput.cpp @@ -1354,6 +1354,25 @@ int LilliputEngine::sub16B0C(int param1, int param2) { return _array16B04[var2l]; } +int LilliputEngine::sub168DA(int x, int y) { + + int* buffer1 = _rulesBuffer12_1; + int* buffer2 = _rulesBuffer12_2; + + for (int i = 0; i < _rulesChunk12_size; i++) { + if(x >= (*buffer1 >> 8) && x <= (*buffer1 & 0xff) + && y >= (*buffer2 >> 8) && y <= (*buffer2 & 0xff)) + { + return buffer1 - _rulesBuffer12_1; + } + + buffer2++; + buffer1++; + } + + return -1; +} + int LilliputEngine::sub16799(int param1, int index) { debugC(2, kDebugEngine, "sub16799(%d, %d)", param1, index); @@ -1473,6 +1492,17 @@ uint16 LilliputEngine::sub168DA(byte var1h, byte var1l) { return 0xFFFF; } +uint16 LilliputEngine::sub_16901(byte var1h, byte var1l) { + debugC(2, kDebugEngine, "sub_16901(%d, %d)", var1h, var1l); + + for (int i = _rulesChunk12_size-1; i >= 0 ; i--) { + if ((var1h >= (_rulesBuffer12_1[i] >> 8)) && (var1h <= (_rulesBuffer12_1[i] & 0xFF)) && (var1h >= (_rulesBuffer12_2[i] >> 8)) && (var1h <= (_rulesBuffer12_2[i] & 0xFF))) + return i; + } + return 0xFFFF; +} + + void LilliputEngine::sub16A08(int index) { debugC(2, kDebugEngine, "sub16A08(%d)", index); @@ -1578,7 +1608,7 @@ void LilliputEngine::sub16626() { result = sub1675D(index, var1); break; case 11: - warning("result = sub_16729"); + result = sub16729(index); break; case 12: result = sub16799(var1, index); @@ -1636,6 +1666,14 @@ int LilliputEngine::sub166DD(int index, int var1) { return 0; } +int LilliputEngine::sub16729(int index) { + int arg1 = index | 0xFF00; + int pos1 = (_scriptHandler->_array16123[index] << 8) | (_scriptHandler->_array1614B[index] & 0xFF); + int pos2 = (_scriptHandler->_viewportX << 8) | (_scriptHandler->_viewportY & 0xFF); + _soundHandler->contentFct2(); // TODO: add arg pos1 and pos2 + return 2; +} + int LilliputEngine::sub1675D(int index, int var1) { debugC(2, kDebugEngine, "sub1675D(%d, %d)", index, var1); diff --git a/engines/lilliput/lilliput.h b/engines/lilliput/lilliput.h index 8394fd83f9..731cbfe7f9 100644 --- a/engines/lilliput/lilliput.h +++ b/engines/lilliput/lilliput.h @@ -255,9 +255,11 @@ public: void sub17224(int var1, int var4); void sub17264(int index, int var4); uint16 sub168DA(byte var1h, byte var1l); + uint16 sub_16901(byte var1h, byte var1l); void renderCharacters(byte *buf, byte x, byte y); + int sub168DA(int x, int y); int sub16799(int param1, int index); int sub16B0C(int param1, int param2); void addCharToBuf(byte character); @@ -297,6 +299,7 @@ public: void sub16B31(int index, int val); void sub16B8F(int index, int x, int y, int flag); int sub1675D(int index, int var1); + int sub16729(int index); byte sub166F7(int index, int var1, int tmpVal); void sub1693A(int index); @@ -333,7 +336,7 @@ public: byte _byte12FCE; byte _byte129A0; byte _numCharactersToDisplay; - byte _byte16C9F; + byte _byte16C9F; int _word10804; int _word16213; int _word16215; |