aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorOystein Eftevaag2006-05-01 00:25:41 +0000
committerOystein Eftevaag2006-05-01 00:25:41 +0000
commitff7955f4d3124a1c736a7a883e5bcc66f533e193 (patch)
tree77f2bd64d73ab93f038d3433a17bb84018ff6171 /engines
parent13e4fc74e0bcaaa2df75ca60f284a57cbf7ccca8 (diff)
downloadscummvm-rg350-ff7955f4d3124a1c736a7a883e5bcc66f533e193.tar.gz
scummvm-rg350-ff7955f4d3124a1c736a7a883e5bcc66f533e193.tar.bz2
scummvm-rg350-ff7955f4d3124a1c736a7a883e5bcc66f533e193.zip
Adds archive file list, MD5 for my CD version, and a few function stubs for Hand of Fate, to use as a basis for further work
svn-id: r22252
Diffstat (limited to 'engines')
-rw-r--r--engines/kyra/kyra.cpp45
-rw-r--r--engines/kyra/kyra.h17
-rw-r--r--engines/kyra/resource.cpp38
-rw-r--r--engines/kyra/staticres.cpp2
4 files changed, 93 insertions, 9 deletions
diff --git a/engines/kyra/kyra.cpp b/engines/kyra/kyra.cpp
index 81a73db6f7..a0487e831c 100644
--- a/engines/kyra/kyra.cpp
+++ b/engines/kyra/kyra.cpp
@@ -51,6 +51,8 @@
namespace Kyra {
+#undef ENABLE_KYRA2
+
enum {
// We only compute MD5 of the first megabyte of our data files.
kMD5FileSizeLimit = 1024 * 1024
@@ -93,12 +95,18 @@ static const GameSettings kyra_games[] = {
"b037c41768b652a040360ffa3556fd2a", "GEMCUT.PAK" },
{ "kyra1", "The Legend of Kyrandia Demo", GI_KYRA1, GF_DEMO | GF_ENGLISH,
"fb722947d94897512b13b50cc84fd648", "DEMO1.WSA" },
+#ifdef ENABLE_KYRA2
+ { "kyra2", "The Hand of Fate", GI_KYRA2, GF_ENGLISH,
+ "28cbad1c5bf06b2d3825ae57d760d032", "FATE.PAK" },
+#endif
+
{ 0, 0, 0, 0, 0, 0 }
};
// Keep list of different supported games
static const PlainGameDescriptor kyra_list[] = {
{ "kyra1", "The Legend of Kyrandia" },
+ { "kyra2", "The Hand of Fate" },
{ 0, 0 }
};
@@ -206,7 +214,15 @@ DetectedGameList Engine_KYRA_detectGames(const FSList &fslist) {
PluginError Engine_KYRA_create(OSystem *syst, Engine **engine) {
assert(engine);
- *engine = new KyraEngine(syst);
+ const char *gameid = ConfMan.get("gameid").c_str();
+
+ if (!scumm_stricmp("kyra1", gameid)) {
+ *engine = new KyraEngine_v1(syst);
+ } else if (!scumm_stricmp("kyra2", gameid)) {
+ *engine = new KyraEngine_v2(syst);
+ } else
+ error("Kyra engine created with invalid gameid.");
+
return kNoError;
}
@@ -265,6 +281,14 @@ KyraEngine::KyraEngine(OSystem *system)
memset(_sceneAnimTable, 0, sizeof(_sceneAnimTable));
}
+KyraEngine_v1::KyraEngine_v1(OSystem *system)
+ :KyraEngine(system) {
+}
+
+KyraEngine_v2::KyraEngine_v2(OSystem *system)
+ :KyraEngine(system) {
+}
+
int KyraEngine::init() {
// Detect game features based on MD5. Again brutally ripped from Gobliins.
uint8 md5sum[16];
@@ -590,6 +614,14 @@ KyraEngine::~KyraEngine() {
}
}
+KyraEngine_v1::~KyraEngine_v1() {
+
+}
+
+KyraEngine_v2::~KyraEngine_v2() {
+
+}
+
void KyraEngine::errorString(const char *buf1, char *buf2) {
strcpy(buf2, buf1);
}
@@ -623,6 +655,17 @@ int KyraEngine::go() {
return 0;
}
+int KyraEngine_v2::go() {
+ // Kyra2 goes here :)
+ loadPalette("palette.col", _screen->_currentPalette);
+ _screen->setScreenPalette(_screen->_currentPalette);
+ loadBitmap("_playfld.cps", 0, 0, 0);
+ _screen->updateScreen();
+ waitForEvent();
+ _system->quit();
+ return 0;
+}
+
void KyraEngine::startup() {
debugC(9, kDebugLevelMain, "KyraEngine::startup()");
static const uint8 colorMap[] = { 0, 0, 0, 0, 12, 12, 12, 0, 0, 0, 0, 0 };
diff --git a/engines/kyra/kyra.h b/engines/kyra/kyra.h
index 5859c92f18..00edec8860 100644
--- a/engines/kyra/kyra.h
+++ b/engines/kyra/kyra.h
@@ -60,7 +60,8 @@ enum {
};
enum {
- GI_KYRA1 = 0
+ GI_KYRA1 = 0,
+ GI_KYRA2 = 1
};
// TODO: this is just the start of makeing the debug output of the kyra engine a bit more useable
@@ -985,6 +986,20 @@ protected:
static const uint16 _amuletY2[];
};
+class KyraEngine_v1 : public KyraEngine {
+ public:
+ KyraEngine_v1(OSystem *system);
+ ~KyraEngine_v1();
+};
+
+class KyraEngine_v2 : public KyraEngine {
+ public:
+ KyraEngine_v2(OSystem *system);
+ ~KyraEngine_v2();
+
+ int go();
+};
+
} // End of namespace Kyra
#endif
diff --git a/engines/kyra/resource.cpp b/engines/kyra/resource.cpp
index 27388aaa06..2be62a5beb 100644
--- a/engines/kyra/resource.cpp
+++ b/engines/kyra/resource.cpp
@@ -92,15 +92,39 @@ Resource::Resource(KyraEngine *engine) {
"CHAPTER1.VRM", 0
};
+ static const char *kyra2CDFilelist[] = {
+ "ALLEY.PAK", "COST3_SH.PAK", "DINOD.PAK", "GARDEN.PAK", "INJAIL2.PAK", "MISC_EMC.PAK", "PHONE_B.PAK",
+ "STATION.PAK", "VOLCANO.PAK", "VOLC_L.PAK", "ALTAR.PAK", "COST4_SH.PAK", "DOCK.PAK", "GEARS.PAK",
+ "INSHOP.PAK", "MYSTRM.PAK," "PHONE_C.PAK", "STREET.PAK", "VOLC_A.PAK", "VOLC_M.PAK", "ANCHOR.PAK",
+ "COST5_SH.PAK", "DOOR.PAK", "GEARS2.PAK", "INSTORE.PAK", "NEST.PAK", "PHONE_D.PAK", "SULFUR.PAK",
+ "VOLC_B.PAK", "VOLC_N.PAK", "AUDIO.PAK", "COST6_SH.PAK", "DRIVERS.PAK", "GEARS3.PAK", "INTRODRV.PAK",
+ "ONBOAT.PAK", "QUICK.PAK", "TALKENG.PAK", "VOLC_C.PAK", "VOLC_O.PAK", "BRIDGE.PAK", "COST7_SH.PAK",
+ "FALL.PAK", "GNARL.PAK", "INTROGEN.PAK", "OTHER.PAK", "RAINA.PAK", "TALKFRE.PAK", "VOLC_D.PAK",
+ "VOLC_P.PAK", "CAULDRON.PAK", "COST8_SH.PAK", "FATE.PAK", "HANOI.PAK", "INTROTLK.PAK", "OUTCAVE.PAK",
+ "RAINB.PAK", "TALKGER.PAK", "VOLC_E.PAK", "WHARF.PAK", "CELLAR.PAK", "COST9_SH.PAK", "FERRY.PAK",
+ "HOLE.PAK", "INTROVOC.PAK", "OUTCAVE2.PAK", "RAT.PAK", "TAVERN.PAK", "VOLC_F.PAK", "WHEEL.PAK",
+ "CLEARNG.PAK", "CRICKET.PAK", "FIGHT.PAK", "INCAVE.PAK", "ISLE.PAK", "OUTFARM.PAK", "ROAD.PAK",
+ "TIMBER.PAK", "VOLC_G.PAK", "CLIFF.PAK", "CROC.PAK", "FISHER.PAK", "INGATE.PAK", "JUNGLE.PAK",
+ "OUTGATE.PAK", "ROPE.PAK", "TRAM.PAK", "VOLC_H.PAK", "CLOSE.PAK", "DINOA.PAK", "FLOAT.PAK", "INHERB.PAK",
+ "MARKHME.PAK", "OUTHERB.PAK", "SCORCH.PAK", "TREE.PAK", "VOLC_I.PAK", "COST1_SH.PAK", "DINOB.PAK",
+ "FLYTRAP.PAK", "INHOME.PAK", "MEADOW.PAK", "OUTHOME.PAK", "SKULL.PAK", "TREE2.PAK", "VOLC_J.PAK",
+ "COST2_SH.PAK", "DINOC.PAK", "FOOT.PAK", "INJAIL.PAK", "MISC_CPS.PAK", "PHONE_A.PAK", "SKY.PAK", "VOC.PAK",
+ "VOLC_K.PAK", 0
+ };
const char **usedFilelist = 0;
- /*if (_engine->features() & GF_AMIGA)
- usedFilelist = kyra1AmigaFilelist;
- else*/ if (_engine->features() & GF_FLOPPY)
- usedFilelist = kyra1Filelist;
- else if (_engine->features() & GF_TALKIE)
- usedFilelist = kyra1CDFilelist;
- else
+ if (_engine->game() == GI_KYRA1) {
+ /*if (_engine->features() & GF_AMIGA)
+ usedFilelist = kyra1AmigaFilelist;
+ else*/ if (_engine->features() & GF_FLOPPY)
+ usedFilelist = kyra1Filelist;
+ else if (_engine->features() & GF_TALKIE)
+ usedFilelist = kyra1CDFilelist;
+ } else {
+ usedFilelist = kyra2CDFilelist;
+ }
+
+ if (!usedFilelist)
error("no filelist found for this game");
for (uint32 tmp = 0; usedFilelist[tmp]; ++tmp) {
diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp
index 6a3e3cb523..8d5b058ba9 100644
--- a/engines/kyra/staticres.cpp
+++ b/engines/kyra/staticres.cpp
@@ -139,6 +139,8 @@ bool StaticResource::init() {
if (_engine->game() == GI_KYRA1) {
_builtIn = 0;
_filenameTable = kyra1StaticRes;
+ } else if (_engine->game() == GI_KYRA2) {
+ return true;
} else {
error("unknown game ID");
}