diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/gob/inter.h | 1 | ||||
-rw-r--r-- | engines/gob/inter_v2.cpp | 31 | ||||
-rw-r--r-- | engines/gob/parse.cpp | 2 | ||||
-rw-r--r-- | engines/gob/video_v2.cpp | 2 |
4 files changed, 34 insertions, 2 deletions
diff --git a/engines/gob/inter.h b/engines/gob/inter.h index a5e95ac5a0..5f99cc154a 100644 --- a/engines/gob/inter.h +++ b/engines/gob/inter.h @@ -316,6 +316,7 @@ protected: void o2_stub0x56(void); void o2_stub0x80(void); void o2_renderStatic(void); + bool o2_goblinFunc(char &cmdCount, int16 &counter, int16 &retFlag); bool o2_evaluateStore(char &cmdCount, int16 &counter, int16 &retFlag); bool o2_palLoad(char &cmdCount, int16 &counter, int16 &retFlag); bool o2_loadTot(char &cmdCount, int16 &counter, int16 &retFlag); diff --git a/engines/gob/inter_v2.cpp b/engines/gob/inter_v2.cpp index 4879b8006a..27448e80a9 100644 --- a/engines/gob/inter_v2.cpp +++ b/engines/gob/inter_v2.cpp @@ -492,7 +492,7 @@ void Inter_v2::setupOpcodes(void) { OPCODE(o1_speakerOff), /* 24 */ OPCODE(o1_putPixel), - OPCODE(o1_goblinFunc), + OPCODE(o2_goblinFunc), OPCODE(o1_createSprite), OPCODE(o2_freeSprite), /* 28 */ @@ -1008,6 +1008,35 @@ void Inter_v2::loadMult(void) { warning("GOB2 Stub! Inter_v2::loadMult()"); } +bool Inter_v2::o2_goblinFunc(char &cmdCount, int16 &counter, int16 &retFlag) { + int16 cmd; + int16 word_2F9C0; + int16 word_2F9BE; + int16 word_2F9BC; + int16 word_2F9BA; + char *dword_2F9B6; + char *dword_2F9B2; + + cmd = load16(); + _vm->_global->_inter_execPtr += 2; + + if (cmd == 100) { + word_2F9C0 = VAR(load16()); + word_2F9BE = VAR(load16()); + dword_2F9B6 = _vm->_global->_inter_variables + (load16() >> 2); + dword_2F9B2 = _vm->_global->_inter_variables + (load16() >> 2); + word_2F9BC = VAR(load16()); + word_2F9BA = VAR(load16()); + warning("GOB2 Stub! sub_19BD3()"); + } else if (cmd != 101) { + _vm->_global->_inter_execPtr -= 2; + cmd = load16(); + _vm->_global->_inter_execPtr += cmd << 1; + } + + return false; +} + bool Inter_v2::o2_evaluateStore(char &cmdCount, int16 &counter, int16 &retFlag) { char *savedPos; int16 varOff; diff --git a/engines/gob/parse.cpp b/engines/gob/parse.cpp index 01e8d007c1..be007bc7c8 100644 --- a/engines/gob/parse.cpp +++ b/engines/gob/parse.cpp @@ -37,7 +37,7 @@ Parse::Parse(GobEngine *vm) : _vm(vm) { } int32 Parse::encodePtr(char *ptr, int type) { - int32 offset; + int32 offset = 0; switch (type) { case kExecPtr: diff --git a/engines/gob/video_v2.cpp b/engines/gob/video_v2.cpp index d6f311ed62..8e55154dde 100644 --- a/engines/gob/video_v2.cpp +++ b/engines/gob/video_v2.cpp @@ -127,6 +127,7 @@ Video::SurfaceDesc *Video_v2::initSurfDesc(int16 vidMode, int16 width, int16 hei if (descPtr->vidPtr != 0) delete[] descPtr->vidPtr; vidMem = new byte[320 * 200]; + memset(vidMem, 0, 64000); } else { if (flags & DISABLE_SPR_ALLOC) { descPtr = new SurfaceDesc; @@ -135,6 +136,7 @@ Video::SurfaceDesc *Video_v2::initSurfDesc(int16 vidMode, int16 width, int16 hei } else { descPtr = new SurfaceDesc; descPtr->vidPtr = new byte[sprSize]; + memset(descPtr->vidPtr, 0, sprSize); vidMem = descPtr->vidPtr; } } |