aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEugene Sandulenko2006-03-23 03:15:39 +0000
committerEugene Sandulenko2006-03-23 03:15:39 +0000
commit36302c09218855f637794ef4a589dc69946c0e44 (patch)
treef3e347f43feac2e2edf3e9a9a6f8d497b053fdc4 /engines
parentd0c73b346e68b4519f6852a484fd11f81dcd7642 (diff)
downloadscummvm-rg350-36302c09218855f637794ef4a589dc69946c0e44.tar.gz
scummvm-rg350-36302c09218855f637794ef4a589dc69946c0e44.tar.bz2
scummvm-rg350-36302c09218855f637794ef4a589dc69946c0e44.zip
Make copy protection in OS and FW turnable. Still buggy
svn-id: r21411
Diffstat (limited to 'engines')
-rw-r--r--engines/cine/cine.cpp2
-rw-r--r--engines/cine/part.cpp30
-rw-r--r--engines/cine/part.h1
-rw-r--r--engines/cine/prc.cpp10
4 files changed, 33 insertions, 10 deletions
diff --git a/engines/cine/cine.cpp b/engines/cine/cine.cpp
index 4cd29923a4..db7c41bb8f 100644
--- a/engines/cine/cine.cpp
+++ b/engines/cine/cine.cpp
@@ -215,7 +215,7 @@ static void initialize() {
}
// bypass protection
- if (gameType == GID_OS) {
+ if (gameType == GID_OS && !ConfMan.getBool("copy_protection")) {
globalVars[255] = 1;
}
diff --git a/engines/cine/part.cpp b/engines/cine/part.cpp
index 0643d011fa..b97893b74d 100644
--- a/engines/cine/part.cpp
+++ b/engines/cine/part.cpp
@@ -134,6 +134,7 @@ static const char *bundleNames[] = {
"RSC16",
"RSC17",
// english version
+#if 1
"SONS1",
"SONS2",
"SONS3",
@@ -143,12 +144,12 @@ static const char *bundleNames[] = {
"SONS7",
"SONS8",
"SONS9",
-/*
-"SONS31", // french version
-"SONS32",
-"SONS33",
-"SONS34"
-*/
+#else
+ "SONS31", // french version
+ "SONS32",
+ "SONS33",
+ "SONS34"
+#endif
};
int16 findFileInBundle(const char *fileName) {
@@ -209,4 +210,21 @@ uint8 *readBundleFile(int16 foundFileIdx) {
return dataPtr;
}
+uint8 *readFile(const char *filename) {
+ Common::File in;
+
+ in.open(filename);
+
+ if (!in.isOpen())
+ error("readFile(): Cannot open file %s", filename);
+
+ uint8 *dataPtr;
+ uint32 size = in.size();
+
+ dataPtr = (uint8 *)malloc(size);
+ in.read(dataPtr, size);
+
+ return dataPtr;
+}
+
} // End of namespace Cine
diff --git a/engines/cine/part.h b/engines/cine/part.h
index aff3ae5096..3dcb95ac23 100644
--- a/engines/cine/part.h
+++ b/engines/cine/part.h
@@ -69,6 +69,7 @@ int16 findFileInBundle(const char *fileName);
void readFromPart(int16 idx, uint8 *dataPtr);
uint8 *readBundleFile(int16 foundFileIdx);
+uint8 *readFile(const char *filename);
} // End of namespace Cine
diff --git a/engines/cine/prc.cpp b/engines/cine/prc.cpp
index ebe066320d..52c0fcf7b0 100644
--- a/engines/cine/prc.cpp
+++ b/engines/cine/prc.cpp
@@ -26,6 +26,8 @@
#include "cine/auto00.h"
#include "cine/various.h"
+#include "common/config-manager.h"
+
namespace Cine {
prcLinkedListStruct globalScriptsHead;
@@ -74,11 +76,13 @@ void loadPrc(const char *pPrcName) {
checkDataDisk(-1);
if ((gameType == Cine::GID_FW) && (!strcmp(pPrcName, "AUTO00.PRC"))) {
- // bypass protection
- scriptPtr = AUT000;
+ if (!ConfMan.getBool("copy_protection"))
+ scriptPtr = AUT000;
+ else
+ scriptPtr = readFile(pPrcName);
} else {
scriptPtr = readBundleFile(findFileInBundle(pPrcName));
- ASSERT_PTR(scriptPtr);
+ ASSERT_PTR(scriptPtr);
}
setMouseCursor(MOUSE_CURSOR_DISK);