LILLIPUT: Implement another opcode and associated function

This commit is contained in:
Strangerke 2012-04-27 17:45:46 +02:00 committed by Eugene Sandulenko
parent 1f7cf60ddb
commit 32ed5e62af
2 changed files with 25 additions and 2 deletions

View File

@ -1200,9 +1200,31 @@ byte LilliputScript::OC_sub17782() {
warning("OC_sub17782");
return 0;
}
byte *LilliputScript::getMapPtr(int var1) {
debugC(1, kDebugScript, "getMapPtr(%d)", var1);
int index = (((var1 & 0xFF) << 6) + (var1 >> 8)) << 2;
return &_vm->_bufferIsoMap[index];
}
byte LilliputScript::OC_sub1779E() {
warning("OC_sub1779E");
return 0;
debugC(1, kDebugScript, "OC_sub1779E()");
int tmpVal = getValue2();
if (tmpVal == 0xFFFF) {
_currScript->seek(_currScript->pos() + 6);
return 0;
}
int var2 = _currScript->readUint16LE();
byte *buf = getMapPtr(tmpVal);
byte var1 = buf[var2];
var2 = _currScript->readUint16LE();
int oper = _currScript->readUint16LE();
return compareValues(var1, oper, var2);
}
byte LilliputScript::OC_sub177C6() {

View File

@ -103,6 +103,7 @@ private:
void sub18A56(byte *buf);
void sub18B3C(int var);
void sub18BE6(byte var1, int var2, int var4);
byte *getMapPtr(int var1);
int getValue1();
int getValue2();