aboutsummaryrefslogtreecommitdiff
path: root/engines/lilliput
diff options
context:
space:
mode:
authorStrangerke2012-05-02 18:52:15 +0200
committerEugene Sandulenko2018-03-28 17:36:57 +0200
commit18029a5597bee268986a02a8d04df122ba7bfc3b (patch)
treeee346dbd97c6550783eb610b7172180386b73405 /engines/lilliput
parent2861a3f5ec0e57efc1190d82a2a5eed526897e56 (diff)
downloadscummvm-rg350-18029a5597bee268986a02a8d04df122ba7bfc3b.tar.gz
scummvm-rg350-18029a5597bee268986a02a8d04df122ba7bfc3b.tar.bz2
scummvm-rg350-18029a5597bee268986a02a8d04df122ba7bfc3b.zip
LILLIPUT: Implement case 14 in sub16626, little clean up in sub1823e
Diffstat (limited to 'engines/lilliput')
-rw-r--r--engines/lilliput/lilliput.cpp28
-rw-r--r--engines/lilliput/lilliput.h2
-rw-r--r--engines/lilliput/script.cpp10
-rw-r--r--engines/lilliput/script.h2
4 files changed, 31 insertions, 11 deletions
diff --git a/engines/lilliput/lilliput.cpp b/engines/lilliput/lilliput.cpp
index 6937a35075..cfb3d1e6c0 100644
--- a/engines/lilliput/lilliput.cpp
+++ b/engines/lilliput/lilliput.cpp
@@ -1234,7 +1234,7 @@ void LilliputEngine::renderCharacters(byte *buf, byte x, byte y) {
if ((_nextDisplayCharacterX != x) || (_nextDisplayCharacterY != y))
return;
- byte _byte16552 = 0;
+ _byte16552 = 0;
if (buf[1] != 0xFF) {
int tmpIndex = buf[1];
@@ -1463,7 +1463,7 @@ void LilliputEngine::sub16626() {
warning("result = sub_16722");
break;
case 14:
- warning("result = sub_166F7");
+ result = sub166F7(index, var1, tmpVal);
break;
case 15:
_scriptHandler->_array12811[index] = 0x10;
@@ -1485,8 +1485,28 @@ void LilliputEngine::sub16626() {
}
}
-int LilliputEngine::sub166DD(int index, int var1) {
+byte LilliputEngine::sub166F7(int index, int var1, int tmpVal) {
+ debugC(2, kDebugEngine, "sub166F7(%d, %d, %d)", index, var1, tmpVal);
+
+ byte a1 = (var1 >> 8);
+ byte a2 = (var1 & 0xFF);
+ if (a2 != 0) {
+ if ((a2 & 0xF0) == 0)
+ a2 |= (a2 << 4);
+
+ a2 -= 16;
+ _scriptHandler->_array12311[tmpVal] = (a1 << 8) + a2;
+
+ if ((a2 & 0xF0) == 0)
+ return 2;
+ }
+
+ _scriptHandler->_array12811[index] -= ((var1 >> 8) & 0x0F);
+ return 3;
+}
+int LilliputEngine::sub166DD(int index, int var1) {
+
_characterDirectionArray[index] = (var1 >> 8) & 3;
sub16685(index, var1 & 0xFF);
return 0;
@@ -2391,7 +2411,7 @@ while(1);*/
//warning("dump char stat");
i = index;
- warning("char %d, pos %d %d, state %d, script enabled %d", i, _characterPositionX[i], _characterPositionY[i], _characterVariables[i*32+0], _scriptHandler->_characterScriptEnabled[i]);
+ debugC(3, kDebugEngine, "char %d, pos %d %d, state %d, script enabled %d", i, _characterPositionX[i], _characterPositionY[i], _characterVariables[i*32+0], _scriptHandler->_characterScriptEnabled[i]);
}
Common::Error LilliputEngine::run() {
diff --git a/engines/lilliput/lilliput.h b/engines/lilliput/lilliput.h
index 99d0eb4724..1d0184172e 100644
--- a/engines/lilliput/lilliput.h
+++ b/engines/lilliput/lilliput.h
@@ -292,7 +292,7 @@ public:
void sub16B31(int index, int val);
void sub16B8F(int index, int x, int y, int flag);
int sub1675D(int index, int var1);
-
+ byte sub166F7(int index, int var1, int tmpVal);
void initGame(const LilliputGameDescription *gd);
byte *loadVGA(Common::String filename, bool loadPal);
diff --git a/engines/lilliput/script.cpp b/engines/lilliput/script.cpp
index 21238aafe3..624049f884 100644
--- a/engines/lilliput/script.cpp
+++ b/engines/lilliput/script.cpp
@@ -1045,12 +1045,12 @@ void LilliputScript::sub185B4_display() {
_word1855E = subIndex;
}
-void LilliputScript::sub1823E(byte var1, byte var2, byte *curBufPtr) {
- debugC(1, kDebugScript, "sub1823E(%d, %d, curBufPtr)", var1, var2);
+void LilliputScript::sub1823E(byte index, byte var1, byte *curBufPtr) {
+ debugC(1, kDebugScript, "sub1823E(%d, %d, curBufPtr)", index, var1);
- assert ((var1 >= 0) && (var1 < 40));
- _characterScriptEnabled[var1] = 1;
- curBufPtr[0] = var2;
+ assert (index < 40);
+ _characterScriptEnabled[index] = 1;
+ curBufPtr[0] = var1;
curBufPtr[1] = 0;
curBufPtr[2] = 0;
curBufPtr[3] = 0;
diff --git a/engines/lilliput/script.h b/engines/lilliput/script.h
index 3df23d7d8e..2a16b62349 100644
--- a/engines/lilliput/script.h
+++ b/engines/lilliput/script.h
@@ -123,7 +123,7 @@ private:
void sub185ED(byte index, byte subIndex);
void sub185B4_display();
- void sub1823E(byte var1, byte var2, byte *curBufPtr);
+ void sub1823E(byte index, byte var1, byte *curBufPtr);
void sub17B6C(int var1);
void sub16C86(int index, byte *buf);
void sub16C5C(int index, byte var3);