From c4186ba41bfcaa20876fed950d45cb502b7efb9a Mon Sep 17 00:00:00 2001 From: sylvaintv Date: Sat, 28 Apr 2012 01:03:11 +0200 Subject: LILLIPUT: Implements one more opcode --- engines/lilliput/script.cpp | 34 ++++++++++++++++++++++++++++++---- engines/lilliput/script.h | 1 + 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/engines/lilliput/script.cpp b/engines/lilliput/script.cpp index df21358f86..1b75bd4a18 100644 --- a/engines/lilliput/script.cpp +++ b/engines/lilliput/script.cpp @@ -926,9 +926,32 @@ byte LilliputScript::OC_sub173F0() { return 0; } +byte* LilliputScript::sub17399(int val) { + int x = (val >> 8); + int y = (val & 0xFF); + return &_vm->_bufferIsoMap[(y * 320 + x) << 2]; +} + byte LilliputScript::OC_sub1740A() { - warning("OC_sub1740A"); - return 0; + debugC(1, kDebugScript, "OC_sub1740A()"); + + int var = _vm->_word16EFA; + if (var == 0xFFFF) { + _currScript->readUint16LE(); + return 0; + } + + byte *isoMapBuf = sub17399(var); + int var2 = isoMapBuf[3]; + + int var3 = _currScript->readUint16LE(); + int var4 = 8 >> var3; + + if( var2 & var4 ) { + return 1; + } else { + return 0; + } } byte LilliputScript::OC_sub17434() { @@ -943,8 +966,11 @@ byte LilliputScript::OC_sub17434() { } byte LilliputScript::OC_sub17468() { - warning("OC_sub17468"); - return 0; + debugC(1, kDebugScript, "OC_sub17468()"); + + int operation = _currScript->readUint16LE(); + int val2 = _currScript->readUint16LE(); + return compareValues(_byte16F02, operation, val2); } byte LilliputScript::OC_getRandom() { diff --git a/engines/lilliput/script.h b/engines/lilliput/script.h index 24a74d7c24..4d7f5e9843 100644 --- a/engines/lilliput/script.h +++ b/engines/lilliput/script.h @@ -106,6 +106,7 @@ private: void sub18A56(byte *buf); void sub18B3C(int var); void sub18BE6(byte var1, int var2, int var4); + byte* sub17399(int val); byte *getMapPtr(int var1); int getValue1(); -- cgit v1.2.3