aboutsummaryrefslogtreecommitdiff
path: root/engines/gob
diff options
context:
space:
mode:
authorSven Hesse2006-05-01 19:11:57 +0000
committerSven Hesse2006-05-01 19:11:57 +0000
commit8a855b42518ca63916b18ee8a88fd01d41662386 (patch)
treefc9449ba807ca054f1079fbc19177c2390383f7c /engines/gob
parent61a0266a926208bd45e1c378f6062921b03f8724 (diff)
downloadscummvm-rg350-8a855b42518ca63916b18ee8a88fd01d41662386.tar.gz
scummvm-rg350-8a855b42518ca63916b18ee8a88fd01d41662386.tar.bz2
scummvm-rg350-8a855b42518ca63916b18ee8a88fd01d41662386.zip
- Stubbed goblinFunc(), it's completeley different; now it at least
doesn't crash anymore - Reduced valgrind's complains about unitialized memory svn-id: r22263
Diffstat (limited to 'engines/gob')
-rw-r--r--engines/gob/inter.h1
-rw-r--r--engines/gob/inter_v2.cpp31
-rw-r--r--engines/gob/parse.cpp2
-rw-r--r--engines/gob/video_v2.cpp2
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;
}
}