aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2012-09-08 10:08:12 +1000
committerPaul Gilbert2012-09-08 10:08:12 +1000
commit578b1601fe624c23a68c39d115a6a58bf1ca58e8 (patch)
tree48b2fcccea3d3027d865cfe1a1fea6d8811e8c89
parentc10f87f9c88b7ffd0a0652727fa91fd76929786f (diff)
downloadscummvm-rg350-578b1601fe624c23a68c39d115a6a58bf1ca58e8.tar.gz
scummvm-rg350-578b1601fe624c23a68c39d115a6a58bf1ca58e8.tar.bz2
scummvm-rg350-578b1601fe624c23a68c39d115a6a58bf1ca58e8.zip
HOPKINS: Added further configuration setup
-rw-r--r--engines/hopkins/files.h46
-rw-r--r--engines/hopkins/globals.cpp37
-rw-r--r--engines/hopkins/globals.h29
-rw-r--r--engines/hopkins/hopkins.cpp27
-rw-r--r--engines/hopkins/hopkins.h3
5 files changed, 129 insertions, 13 deletions
diff --git a/engines/hopkins/files.h b/engines/hopkins/files.h
new file mode 100644
index 0000000000..992ea8786f
--- /dev/null
+++ b/engines/hopkins/files.h
@@ -0,0 +1,46 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef HOPKINS_FILES_H
+#define HOPKINS_FILES_H
+
+#include "common/scummsys.h"
+#include "common/hash-str.h"
+#include "common/str.h"
+#include "common/stream.h"
+
+namespace Hopkins {
+
+class FileManager {
+public:
+ static void initSaves();
+ static bool SAUVE_FICHIER(const Common::String &file, const void *buf, size_t n);
+ static bool bsave(const Common::String &file, const void *buf, size_t n);
+ static void Chage_Inifile(Common::StringMap &iniParams);
+ static void *CHARGE_FICHIER(const Common::String &file);
+ static void DMESS1();
+ static int bload_it(Common::ReadStream &stream, void *buf, size_t nbytes);
+};
+
+} // End of namespace Hopkins
+
+#endif /* HOPKINS_GLOBALS_H */
diff --git a/engines/hopkins/globals.cpp b/engines/hopkins/globals.cpp
index 555e8b6919..2a98764c45 100644
--- a/engines/hopkins/globals.cpp
+++ b/engines/hopkins/globals.cpp
@@ -27,11 +27,46 @@ namespace Hopkins {
Globals::Globals() {
FR = 0;
SVGA = 2;
- MANU_SCROLL = 0;
+ MANU_SCROLL = 1;
SPEED_SCROLL = 16;
internet = 1;
PUBEXIT = 0;
FADESPD = 15;
+ vitesse = 1;
+ INSTALL_TYPE = 1;
+ MUSICVOL = 6;
+ SOUNDVOL = 6;
+ VOICEVOL = 6;
+ MUSICOFF = false;
+ SOUNDOFF = false;
+ VOICEOFF = false;
+}
+
+void Globals::setConfig() {
+ HOPIMAGE = "BUFFER";
+ HOPANIM = "ANIM";
+ HOPLINK = "LINK";
+ HOPSAVE = "SAVE";
+ HOPSOUND = "SOUND";
+ HOPMUSIC = "MUSIC";
+ HOPVOICE = "VOICE";
+ HOPANM = "ANM";
+ HOPSEQ = "SEQ";
+
+ switch (FR) {
+ case 0:
+ FICH_ZONE = "ZONEAN.TXT";
+ FICH_TEXTE = "TEXTEAN.TXT";
+ break;
+ case 1:
+ FICH_ZONE = "ZONE01.TXT";
+ FICH_TEXTE = "TEXTE01.TXT";
+ break;
+ case 2:
+ FICH_ZONE = "ZONEES.TXT";
+ FICH_TEXTE = "TEXTEES.TXT";
+ break;
+ }
}
} // End of namespace Hopkins
diff --git a/engines/hopkins/globals.h b/engines/hopkins/globals.h
index ec980a975d..9867376415 100644
--- a/engines/hopkins/globals.h
+++ b/engines/hopkins/globals.h
@@ -24,6 +24,7 @@
#define HOPKINS_GLOBALS_H
#include "common/scummsys.h"
+#include "common/str.h"
namespace Hopkins {
@@ -39,8 +40,34 @@ public:
int SPEED_SCROLL;
int internet;
int PUBEXIT;
+ bool XFULLSCREEN;
+ int XSETMODE;
+ int XZOOM;
+ bool XFORCE16;
+ bool XFORCE8;
+ bool CARD_SB;
+ int vitesse;
+ int INSTALL_TYPE;
+ Common::String HOPIMAGE;
+ Common::String HOPANIM;
+ Common::String HOPLINK;
+ Common::String HOPSAVE;
+ Common::String HOPSOUND;
+ Common::String HOPMUSIC;
+ Common::String HOPVOICE;
+ Common::String HOPANM;
+ Common::String HOPSEQ;
+ Common::String FICH_ZONE;
+ Common::String FICH_TEXTE;
+ int SOUNDVOL;
+ int MUSICVOL;
+ int VOICEVOL;
+ bool SOUNDOFF;
+ bool MUSICOFF;
+ bool VOICEOFF;
- Globals();
+ Globals();
+ void setConfig();
};
} // End of namespace Hopkins
diff --git a/engines/hopkins/hopkins.cpp b/engines/hopkins/hopkins.cpp
index 16e75784d5..ebf97c308d 100644
--- a/engines/hopkins/hopkins.cpp
+++ b/engines/hopkins/hopkins.cpp
@@ -51,17 +51,6 @@ Common::Error HopkinsEngine::run() {
processIniParams(iniParams);
/*
- Chage_Inifile();
- LOAD_CONFIG();
- *(_DWORD *)HOPIMAGE = dword_807B6D0;
- *(_WORD *)&HOPIMAGE[4] = word_807B6D4;
- HOPIMAGE[6] = byte_807B6D6;
- *(_DWORD *)HOPANIM = dword_807B6D7;
- HOPANIM[4] = byte_807B6DB;
- *(_DWORD *)HOPLINK = dword_807B6DC;
- HOPLINK[4] = byte_807B6E0;
- *(_DWORD *)HOPSAVE = dword_807B6E1;
- HOPSAVE[4] = byte_807B6E5;
if ( FR == 1 )
{
*(_DWORD *)FICH_ZONE = dword_807B6E6;
@@ -530,7 +519,23 @@ int HopkinsEngine::getRandomNumber(int maxNumber) {
}
void HopkinsEngine::processIniParams(Common::StringMap &iniParams) {
+ GLOBALS.XFULLSCREEN = iniParams["FULLSCREEN"] == "YES";
+ GLOBALS.XSETMODE = 1;
+ if (iniParams.contains("SETMODE")) {
+ int setMode = atoi(iniParams["SETMODE"].c_str());
+ GLOBALS.XSETMODE = CLIP(setMode, 1, 5);
+ }
+
+ GLOBALS.XZOOM = 0;
+ if (GLOBALS.XSETMODE == 5 && iniParams.contains("ZOOM")) {
+ int zoom = atoi(iniParams["ZOOM"].c_str());
+ GLOBALS.XZOOM = CLIP(zoom, 25, 100);
+ }
+
+ GLOBALS.XFORCE16 = iniParams["FORCE16BITS"] == "YES";
+ GLOBALS.XFORCE8 = iniParams["FORCE8BITS"] == "YES";
+ GLOBALS.CARD_SB = iniParams["SOUND"] == "YES";
}
} // End of namespace Hopkins
diff --git a/engines/hopkins/hopkins.h b/engines/hopkins/hopkins.h
index c4f8415543..57dc3ea7ad 100644
--- a/engines/hopkins/hopkins.h
+++ b/engines/hopkins/hopkins.h
@@ -61,6 +61,9 @@ private:
const HopkinsGameDescription *_gameDescription;
Common::RandomSource _randomSource;
+ /**
+ * Processes the loaded list of ini file parameters
+ */
void processIniParams(Common::StringMap &iniParams);
protected:
// Engine APIs