aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorsylvaintv2012-04-25 23:51:45 +0200
committerEugene Sandulenko2018-03-28 17:36:57 +0200
commit0be54f0b1b7ade28763ca93f59d30a22801cf946 (patch)
treebdbd2fb8626f23019a18d243aae2e1ba80ecbd4d /engines
parent5ede42cd6a9987faf2583bfe91fb11e1c563f4de (diff)
downloadscummvm-rg350-0be54f0b1b7ade28763ca93f59d30a22801cf946.tar.gz
scummvm-rg350-0be54f0b1b7ade28763ca93f59d30a22801cf946.tar.bz2
scummvm-rg350-0be54f0b1b7ade28763ca93f59d30a22801cf946.zip
LILLIPUT: Maybe fix a problem in sub12F37
Unlocked new opcodes !
Diffstat (limited to 'engines')
-rw-r--r--engines/lilliput/lilliput.cpp31
-rw-r--r--engines/lilliput/script.cpp22
-rw-r--r--engines/lilliput/script.h7
3 files changed, 36 insertions, 24 deletions
diff --git a/engines/lilliput/lilliput.cpp b/engines/lilliput/lilliput.cpp
index 6953ea3e46..7c7f9a84f4 100644
--- a/engines/lilliput/lilliput.cpp
+++ b/engines/lilliput/lilliput.cpp
@@ -1346,12 +1346,15 @@ void LilliputEngine::sub12F37() {
int index2 = 0;
for (int i = 0; i < _word10807_ERULES; i++) {
- if (_rulesBuffer2_15[index1] == 1 ) {
- --_rulesBuffer2_15[index1];
- if (_rulesBuffer2_15[index1] == 1)
- _scriptHandler->_array10B29[index2] = 1;
- } else
- _rulesBuffer2_15[index1] = 0;
+ if (_rulesBuffer2_15[index1] != 0 ) {
+ if (_rulesBuffer2_15[index1] == 1) {
+ _rulesBuffer2_15[index1] = 0;
+ } else {
+ --_rulesBuffer2_15[index1];
+ if (_rulesBuffer2_15[index1] == 1)
+ _scriptHandler->_array10B29[index2] = 1;
+ }
+ }
index1 += 32;
++index2;
@@ -1610,23 +1613,23 @@ void LilliputEngine::displayHeroismIndicator() {
int var1 = (_scriptHandler->_savedBuffer215Ptr[0] * 25) >> 8;
- if (var1 == _scriptHandler->_byte15FFA)
+ if (var1 == _scriptHandler->_heroismLevel)
return;
displayFunction5();
int var2 = 1;
- if (var1 > _scriptHandler->_byte15FFA)
+ if (var1 > _scriptHandler->_heroismLevel)
var1 = 150;
else {
var2 = -1;
var1 = 40;
}
- _scriptHandler->_byte15FFA += var2;
-
- int index = _scriptHandler->_word15FFB + _scriptHandler->_word15FFD * 320 ;
+ _scriptHandler->_heroismLevel += var2;
+
+ int index = _scriptHandler->_heroismBarX + _scriptHandler->_heroismBarBottomY * 320 ;
- var2 = _scriptHandler->_byte15FFA & 0xFF;
+ var2 = _scriptHandler->_heroismLevel & 0xFF;
if (var2 != 0) {
// sub16064(var1, _scriptHandler->_byte15FFA);
for (int i = 0; i < (var2 << 2); i++) {
@@ -1637,9 +1640,9 @@ void LilliputEngine::displayHeroismIndicator() {
}
}
- if (25 - _scriptHandler->_byte15FFA != 0) {
+ if (25 - _scriptHandler->_heroismLevel != 0) {
// sub16064(23, 25 - _scriptHandler->_byte15FFA);
- var2 = (25 - _scriptHandler->_byte15FFA) << 2;
+ var2 = (25 - _scriptHandler->_heroismLevel) << 2;
for (int i = 0; i < var2; i++) {
((byte *)_mainSurface->getPixels())[index] = 23;
((byte *)_mainSurface->getPixels())[index + 1] = 23;
diff --git a/engines/lilliput/script.cpp b/engines/lilliput/script.cpp
index f34ec121cc..7400241ef7 100644
--- a/engines/lilliput/script.cpp
+++ b/engines/lilliput/script.cpp
@@ -41,8 +41,8 @@ LilliputScript::LilliputScript(LilliputEngine *vm) : _vm(vm), _currScript(NULL)
_word16F00 = -1;
_viewportCharacterTarget = -1;
_word10804 = 0;
- _word15FFB = 0;
- _word15FFD = 0;
+ _heroismBarX = 0;
+ _heroismBarBottomY = 0;
_viewportX = 0;
_viewportY = 0;
_word18776 = 0;
@@ -63,6 +63,7 @@ LilliputScript::LilliputScript(LilliputEngine *vm) : _vm(vm), _currScript(NULL)
_array16123[i] = 0;
_array1614B[i] = 0;
_array16173[i] = 0xFF;
+ _array122C1[i] = 0;
}
for (int i = 0; i < 640; i++) {
@@ -1571,7 +1572,11 @@ void LilliputScript::OC_resetWord16EFE() {
warning("OC_resetWord16EFE");
}
void LilliputScript::OC_sub17CEF() {
- warning("OC_sub17CEF");
+ debugC(1, kDebugScript, "OC_sub17CEF()");
+
+ int var1 = _currScript->readUint16LE();
+ sub1823E(_vm->_rulesBuffer2PrevIndx , var1, _vm->_ptr_rulesBuffer2_15);
+ sub17B6C(0);
}
void LilliputScript::OC_sub17D1B() {
@@ -1751,7 +1756,10 @@ void LilliputScript::OC_sub1834C() {
}
void LilliputScript::OC_sub18359() {
- warning("OC_sub18359");
+ debugC(1, kDebugScript, "OC_sub18359()");
+
+ int var1 = _currScript->readUint16LE();
+ _array122C1[_vm->_rulesBuffer2PrevIndx] = var1;
}
void LilliputScript::OC_sub18367() {
warning("OC_sub18367");
@@ -1876,7 +1884,7 @@ void LilliputScript::OC_sub1853B() {
OC_PaletteFadeOut();
displayMap = 0;
- _byte15FFA = 0;
+ _heroismLevel = 0;
sub130B6();
_vm->displayFunction12();
@@ -1907,8 +1915,8 @@ void LilliputScript::OC_initArr18560() {
void LilliputScript::OC_sub18678() {
debugC(1, kDebugScript, "OC_initArr18578()");
_savedBuffer215Ptr = getBuffer215Ptr();
- _word15FFB = _currScript->readUint16LE();
- _word15FFD = _currScript->readUint16LE();
+ _heroismBarX = _currScript->readUint16LE();
+ _heroismBarBottomY = _currScript->readUint16LE();
}
void LilliputScript::OC_sub18690() {
diff --git a/engines/lilliput/script.h b/engines/lilliput/script.h
index 2a23063ed2..3d5e78111e 100644
--- a/engines/lilliput/script.h
+++ b/engines/lilliput/script.h
@@ -34,7 +34,7 @@ class LilliputScript {
public:
byte displayMap;
byte _byte12A04;
- byte _byte15FFA;
+ byte _heroismLevel;
byte _array10B29[40];
byte _array122E9[20];
@@ -44,6 +44,7 @@ public:
byte _array12811[40];
byte _array10AB1[40];
byte _array122FD[20];
+ byte _array122C1[40];
short _array10B51[40 * 40];
byte *_savedBuffer215Ptr;
@@ -52,8 +53,8 @@ public:
int _viewportY;
int _viewportCharacterTarget;
int _word1881B;
- int _word15FFB;
- int _word15FFD;
+ int _heroismBarX;
+ int _heroismBarBottomY;
short _array12311[640];
byte _array128EF[40];