aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Hesse2006-01-14 09:57:20 +0000
committerSven Hesse2006-01-14 09:57:20 +0000
commitf7a2981dfad9fa50a275af0eb678ade7dbbd73b6 (patch)
tree23807ebd80ff77d17c953c7889f5cdc0ff7fd344
parent319cd187c8dfecc870cd6a511d7e982a8e90e341 (diff)
downloadscummvm-rg350-f7a2981dfad9fa50a275af0eb678ade7dbbd73b6.tar.gz
scummvm-rg350-f7a2981dfad9fa50a275af0eb678ade7dbbd73b6.tar.bz2
scummvm-rg350-f7a2981dfad9fa50a275af0eb678ade7dbbd73b6.zip
Added copy protection skipping; Fixed Inter::getOpcodeGoblinDesc()
svn-id: r20019
-rw-r--r--gob/gob.cpp1
-rw-r--r--gob/gob.h2
-rw-r--r--gob/inter.h6
-rw-r--r--gob/inter_v1.cpp21
-rw-r--r--gob/inter_v2.cpp5
5 files changed, 25 insertions, 10 deletions
diff --git a/gob/gob.cpp b/gob/gob.cpp
index a5d7f0f06d..18db730eee 100644
--- a/gob/gob.cpp
+++ b/gob/gob.cpp
@@ -233,6 +233,7 @@ GobEngine::GobEngine(GameDetector *detector, OSystem * syst, uint32 features)
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume"));
_features = features;
+ _copyProtection = ConfMan.getBool("copy_protection");
}
GobEngine::~GobEngine() {
diff --git a/gob/gob.h b/gob/gob.h
index 0a14f2c9d6..b7af9196bb 100644
--- a/gob/gob.h
+++ b/gob/gob.h
@@ -100,6 +100,8 @@ public:
Common::RandomSource _rnd;
int32 _features;
+ bool _copyProtection;
+
Game *_game;
Snd *_snd;
Video *_video;
diff --git a/gob/inter.h b/gob/inter.h
index 7c03698bc6..6a41835e97 100644
--- a/gob/inter.h
+++ b/gob/inter.h
@@ -73,7 +73,7 @@ protected:
virtual void executeGoblinOpcode(int i, int16 &extraData, int32 *retVarPtr, Goblin::Gob_Object *objDesc) = 0;
virtual const char *getOpcodeDrawDesc(byte i) = 0;
virtual const char *getOpcodeFuncDesc(byte i, byte j) = 0;
- virtual const char *getOpcodeGoblinDesc(byte i) = 0;
+ virtual const char *getOpcodeGoblinDesc(int i) = 0;
};
class Inter_v1 : public Inter {
@@ -108,7 +108,7 @@ protected:
virtual void executeGoblinOpcode(int i, int16 &extraData, int32 *retVarPtr, Goblin::Gob_Object *objDesc);
virtual const char *getOpcodeDrawDesc(byte i);
virtual const char *getOpcodeFuncDesc(byte i, byte j);
- virtual const char *getOpcodeGoblinDesc(byte i);
+ virtual const char *getOpcodeGoblinDesc(int i);
void o1_loadMult(void);
void o1_playMult(void);
@@ -296,7 +296,7 @@ protected:
virtual void executeGoblinOpcode(int i, int16 &extraData, int32 *retVarPtr, Goblin::Gob_Object *objDesc);
virtual const char *getOpcodeDrawDesc(byte i);
virtual const char *getOpcodeFuncDesc(byte i, byte j);
- virtual const char *getOpcodeGoblinDesc(byte i);
+ virtual const char *getOpcodeGoblinDesc(int i);
void o2_drawStub(void) { warning("Gob2 stub"); }
};
diff --git a/gob/inter_v1.cpp b/gob/inter_v1.cpp
index 09a8eb7ebf..fc854006ff 100644
--- a/gob/inter_v1.cpp
+++ b/gob/inter_v1.cpp
@@ -1616,15 +1616,14 @@ const char *Inter_v1::getOpcodeDrawDesc(byte i) {
return _opcodesDrawV1[i].desc;
}
-const char *Inter_v1::getOpcodeFuncDesc(byte i, byte j)
-{
+const char *Inter_v1::getOpcodeFuncDesc(byte i, byte j) {
if ((i > 4) || (j > 15))
return "";
return _opcodesFuncV1[i*16 + j].desc;
}
-const char *Inter_v1::getOpcodeGoblinDesc(byte i) {
+const char *Inter_v1::getOpcodeGoblinDesc(int i) {
for (int j = 0; j < ARRAYSIZE(_goblinFuncLookUp); j++)
if (_goblinFuncLookUp[j][0] == i)
return _opcodesGoblinV1[_goblinFuncLookUp[j][1]].desc;
@@ -1633,7 +1632,21 @@ const char *Inter_v1::getOpcodeGoblinDesc(byte i) {
bool Inter_v1::o1_callSub(char &cmdCount, int16 &counter, int16 &retFlag) {
char *storedIP = _vm->_global->_inter_execPtr;
- _vm->_global->_inter_execPtr = (char *)_vm->_game->_totFileData + READ_LE_UINT16(_vm->_global->_inter_execPtr);
+
+// _vm->_global->_inter_execPtr = (char *)_vm->_game->_totFileData + READ_LE_UINT16(_vm->_global->_inter_execPtr);
+
+ uint16 offset = READ_LE_UINT16(_vm->_global->_inter_execPtr);
+ debug(5, "tot = \"%s\", offset = %d", _vm->_game->_curTotFile, offset);
+
+ // Skipping the copy protection screen in Gobliiins
+ if (!_vm->_copyProtection && (_vm->_features & GF_GOB1) && (offset == 3905)
+ && !scumm_stricmp(_vm->_game->_curTotFile, "intro.tot")) {
+ debug(2, "Skipping copy protection screen");
+ _vm->_global->_inter_execPtr += 2;
+ return false;
+ }
+
+ _vm->_global->_inter_execPtr = (char *)_vm->_game->_totFileData + offset;
if (counter == cmdCount && retFlag == 2)
return true;
diff --git a/gob/inter_v2.cpp b/gob/inter_v2.cpp
index 1d93da2ca3..8c5b376d0c 100644
--- a/gob/inter_v2.cpp
+++ b/gob/inter_v2.cpp
@@ -689,15 +689,14 @@ const char *Inter_v2::getOpcodeDrawDesc(byte i) {
return _opcodesDrawV2[i].desc;
}
-const char *Inter_v2::getOpcodeFuncDesc(byte i, byte j)
-{
+const char *Inter_v2::getOpcodeFuncDesc(byte i, byte j) {
if ((i > 4) || (j > 15))
return "";
return _opcodesFuncV2[i*16 + j].desc;
}
-const char *Inter_v2::getOpcodeGoblinDesc(byte i) {
+const char *Inter_v2::getOpcodeGoblinDesc(int i) {
for (int j = 0; j < ARRAYSIZE(_goblinFuncLookUp); j++)
if (_goblinFuncLookUp[j][0] == i)
return _opcodesGoblinV2[_goblinFuncLookUp[j][1]].desc;