aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/gob/inter.cpp6
-rw-r--r--engines/gob/inter.h1
-rw-r--r--engines/gob/inter_v2.cpp4
-rw-r--r--engines/gob/inter_v5.cpp40
4 files changed, 10 insertions, 41 deletions
diff --git a/engines/gob/inter.cpp b/engines/gob/inter.cpp
index dacba86add..8988d0b825 100644
--- a/engines/gob/inter.cpp
+++ b/engines/gob/inter.cpp
@@ -114,11 +114,7 @@ void Inter::executeOpcodeGob(int i, OpGobParams &params) {
return;
}
- int16 val;
-
- _vm->_global->_inter_execPtr -= 2;
- val = load16();
- _vm->_global->_inter_execPtr += val << 1;
+ _vm->_global->_inter_execPtr += params.paramCount << 1;
warning("unimplemented opcodeGob: %d [0x%X]", i, i);
}
diff --git a/engines/gob/inter.h b/engines/gob/inter.h
index a1f22fa930..852a99f9db 100644
--- a/engines/gob/inter.h
+++ b/engines/gob/inter.h
@@ -61,6 +61,7 @@ struct OpFuncParams {
};
struct OpGobParams {
int16 extraData;
+ int16 paramCount;
VariableReference retVarPtr;
Goblin::Gob_Object *objDesc;
};
diff --git a/engines/gob/inter_v2.cpp b/engines/gob/inter_v2.cpp
index 078d644dd6..e7f3bd198d 100644
--- a/engines/gob/inter_v2.cpp
+++ b/engines/gob/inter_v2.cpp
@@ -1259,7 +1259,9 @@ bool Inter_v2::o2_goblinFunc(OpFuncParams &params) {
int16 cmd;
cmd = load16();
- _vm->_global->_inter_execPtr += 2;
+
+ gobParams.paramCount = load16();
+ gobParams.extraData = cmd;
if (cmd != 101)
executeOpcodeGob(cmd, gobParams);
diff --git a/engines/gob/inter_v5.cpp b/engines/gob/inter_v5.cpp
index 0d089af1ae..70ae183e1d 100644
--- a/engines/gob/inter_v5.cpp
+++ b/engines/gob/inter_v5.cpp
@@ -235,14 +235,12 @@ bool Inter_v5::o5_istrlen(OpFuncParams &params) {
}
void Inter_v5::o5_spaceShooter(OpGobParams &params) {
- int16 paramCount = load16();
-
warning("Dynasty Stub: Space shooter: %d, %d, %s",
- params.extraData, paramCount, _vm->_game->_curTotFile);
+ params.extraData, params.paramCount, _vm->_game->_curTotFile);
- if (paramCount < 4) {
+ if (params.paramCount < 4) {
warning("Space shooter variable counter < 4");
- _vm->_global->_inter_execPtr += paramCount * 2;
+ _vm->_global->_inter_execPtr += params.paramCount * 2;
return;
}
@@ -256,18 +254,16 @@ void Inter_v5::o5_spaceShooter(OpGobParams &params) {
WRITE_VARO_UINT32(var1, 2);
WRITE_VARO_UINT32(var2, 0);
} else {
- if (paramCount < 5) {
+ if (params.paramCount < 5) {
warning("Space shooter variable counter < 5");
return;
}
- _vm->_global->_inter_execPtr += (paramCount - 4) * 2;
+ _vm->_global->_inter_execPtr += (params.paramCount - 4) * 2;
}
}
void Inter_v5::o5_getSystemCDSpeed(OpGobParams &params) {
- _vm->_global->_inter_execPtr += 2;
-
WRITE_VAR_UINT32(load16(), 100); // Fudging 100%
Video::FontDesc *font;
@@ -280,8 +276,6 @@ void Inter_v5::o5_getSystemCDSpeed(OpGobParams &params) {
}
void Inter_v5::o5_getSystemRAM(OpGobParams &params) {
- _vm->_global->_inter_execPtr += 2;
-
WRITE_VAR_UINT32(load16(), 100); // Fudging 100%
Video::FontDesc *font;
@@ -294,8 +288,6 @@ void Inter_v5::o5_getSystemRAM(OpGobParams &params) {
}
void Inter_v5::o5_getSystemCPUSpeed(OpGobParams &params) {
- _vm->_global->_inter_execPtr += 2;
-
WRITE_VAR_UINT32(load16(), 100); // Fudging 100%
Video::FontDesc *font;
@@ -308,8 +300,6 @@ void Inter_v5::o5_getSystemCPUSpeed(OpGobParams &params) {
}
void Inter_v5::o5_getSystemDrawSpeed(OpGobParams &params) {
- _vm->_global->_inter_execPtr += 2;
-
WRITE_VAR_UINT32(load16(), 100); // Fudging 100%
Video::FontDesc *font;
@@ -322,8 +312,6 @@ void Inter_v5::o5_getSystemDrawSpeed(OpGobParams &params) {
}
void Inter_v5::o5_totalSystemSpecs(OpGobParams &params) {
- _vm->_global->_inter_execPtr += 2;
-
WRITE_VAR_UINT32(load16(), 100); // Fudging 100%
Video::FontDesc *font;
@@ -338,8 +326,6 @@ void Inter_v5::o5_totalSystemSpecs(OpGobParams &params) {
void Inter_v5::o5_saveSystemSpecs(OpGobParams &params) {
warning("Dynasty Stub: Saving system specifications");
- _vm->_global->_inter_execPtr += 2;
-
/*
FILE *f = fopen("SAVE\\SPEED.INF", w);
fwrite(&_cdSpeed, sizeof(_cdSpeed), 1, f);
@@ -354,8 +340,6 @@ void Inter_v5::o5_saveSystemSpecs(OpGobParams &params) {
void Inter_v5::o5_loadSystemSpecs(OpGobParams &params) {
warning("Dynasty Stub: Loading system specifications");
- _vm->_global->_inter_execPtr += 2;
-
/*
FILE *f = fopen("SAVE\\SPEED.INF", r);
fread(&_cdSpeed, sizeof(_cdSpeed), 1, f);
@@ -392,16 +376,12 @@ void Inter_v5::o5_loadSystemSpecs(OpGobParams &params) {
void Inter_v5::o5_gob92(OpGobParams &params) {
warning("Dynasty Stub: GobFunc 92");
- _vm->_global->_inter_execPtr += 2;
-
WRITE_VAR_UINT32(load16(), 0 /* (uint32) ((int32) ((int8) _gob92_1)) */);
}
void Inter_v5::o5_gob95(OpGobParams &params) {
warning("Dynasty Stub: GobFunc 95");
- _vm->_global->_inter_execPtr += 2;
-
WRITE_VAR_UINT32(load16(), 0 /* (uint32) ((int32) ((int16) speedThrottle4)) */);
WRITE_VAR_UINT32(load16(), 0 /* (uint32) ((int32) ((int8) speedThrottle3)) */);
WRITE_VAR_UINT32(load16(), 0 /* (uint32) ((int32) ((int8) speedThrottle2)) */);
@@ -412,8 +392,6 @@ void Inter_v5::o5_gob96(OpGobParams &params) {
int16 speedThrottle4, speedThrottle1;
byte speedThrottle3, speedThrottle2;
- _vm->_global->_inter_execPtr += 2;
-
speedThrottle4 = READ_VAR_UINT16(load16());
speedThrottle3 = READ_VAR_UINT8(load16());
speedThrottle2 = READ_VAR_UINT8(load16());
@@ -427,19 +405,13 @@ void Inter_v5::o5_gob96(OpGobParams &params) {
void Inter_v5::o5_gob97(OpGobParams &params) {
_gob_97_98_val = 1;
-
- _vm->_global->_inter_execPtr += 2;
}
void Inter_v5::o5_gob98(OpGobParams &params) {
_gob_97_98_val = 0;
-
- _vm->_global->_inter_execPtr += 2;
}
void Inter_v5::o5_gob100(OpGobParams &params) {
- _vm->_global->_inter_execPtr += 2;
-
uint16 var1 = READ_VAR_UINT16(load16());
uint16 var2 = READ_VAR_UINT16(load16());
uint16 var3 = READ_VAR_UINT16(load16());
@@ -452,8 +424,6 @@ void Inter_v5::o5_gob100(OpGobParams &params) {
}
void Inter_v5::o5_gob200(OpGobParams &params) {
- _vm->_global->_inter_execPtr += 2;
-
uint16 var1 = load16(); // index into the spritesArray
uint16 var2 = load16();
uint16 var3 = load16();