aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dists/engine-data/kyra.datbin236767 -> 237913 bytes
-rw-r--r--engines/kyra/detection.cpp122
-rw-r--r--engines/kyra/kyra_hof.cpp7
-rw-r--r--engines/kyra/kyra_hof.h24
-rw-r--r--engines/kyra/kyra_v1.cpp12
-rw-r--r--engines/kyra/resource.cpp10
-rw-r--r--engines/kyra/sequences_hof.cpp228
-rw-r--r--engines/kyra/staticres.cpp44
-rw-r--r--tools/create_kyradat/create_kyradat.cpp21
-rw-r--r--tools/create_kyradat/create_kyradat.h11
-rw-r--r--tools/create_kyradat/hof_demo.h5
-rw-r--r--tools/create_kyradat/lol_demo.h15
-rw-r--r--tools/create_kyradat/misc.h11
13 files changed, 438 insertions, 72 deletions
diff --git a/dists/engine-data/kyra.dat b/dists/engine-data/kyra.dat
index 7171707e8b..b5861e1e29 100644
--- a/dists/engine-data/kyra.dat
+++ b/dists/engine-data/kyra.dat
Binary files differ
diff --git a/engines/kyra/detection.cpp b/engines/kyra/detection.cpp
index c557bf7d4a..6ecd9931be 100644
--- a/engines/kyra/detection.cpp
+++ b/engines/kyra/detection.cpp
@@ -66,6 +66,9 @@ namespace {
#define KYRA3_CD_FAN_FLAGS(x, y) FLAGS_FAN(x, y, false, false, true, false, true, false, Kyra::GI_KYRA3)
#define LOL_CD_FLAGS FLAGS(false, false, true, false, false, false, Kyra::GI_LOL)
+#define LOL_PC98_FLAGS FLAGS(false, false, false, false, false, false, Kyra::GI_LOL)
+#define LOL_PC98_SJIS_FLAGS FLAGS(false, false, false, true, false, false, Kyra::GI_LOL)
+#define LOL_DEMO_FLAGS FLAGS(true, false, false, false, false, false, Kyra::GI_KYRA2)
const KYRAGameDescription adGameDescs[] = {
{
@@ -210,7 +213,7 @@ const KYRAGameDescription adGameDescs[] = {
{ // FM-Towns version
{
"kyra1",
- 0,
+ "CD",
{
{ "EMC.PAK", 0, "a046bb0b422061aab8e4c4689400343a", -1 },
{ "TWMUSIC.PAK", 0, "e53bca3a3e3fb49107d59463ec387a59", -1 },
@@ -218,14 +221,14 @@ const KYRAGameDescription adGameDescs[] = {
},
Common::EN_ANY,
Common::kPlatformFMTowns,
- Common::ADGF_NO_FLAGS
+ Common::ADGF_CD
},
KYRA1_TOWNS_FLAGS
},
{
{
"kyra1",
- 0,
+ "CD",
{
{ "JMC.PAK", 0, "9c5707a2a478e8167e44283246612d2c", -1 },
{ "TWMUSIC.PAK", 0, "e53bca3a3e3fb49107d59463ec387a59", -1 },
@@ -233,7 +236,7 @@ const KYRAGameDescription adGameDescs[] = {
},
Common::JA_JPN,
Common::kPlatformFMTowns,
- Common::ADGF_NO_FLAGS
+ Common::ADGF_CD
},
KYRA1_TOWNS_SJIS_FLAGS
},
@@ -472,44 +475,44 @@ const KYRAGameDescription adGameDescs[] = {
{ // FM-Towns
{
"kyra2",
- 0,
+ "CD",
AD_ENTRY1("WSCORE.PAK", "c44de1302b67f27d4707409987b7a685"),
Common::EN_ANY,
Common::kPlatformFMTowns,
- Common::ADGF_NO_FLAGS
+ Common::ADGF_CD
},
KYRA2_TOWNS_FLAGS
},
{
{
"kyra2",
- 0,
+ "CD",
AD_ENTRY1("WSCORE.PAK", "c44de1302b67f27d4707409987b7a685"),
Common::JA_JPN,
Common::kPlatformFMTowns,
- Common::ADGF_NO_FLAGS
+ Common::ADGF_CD
},
KYRA2_TOWNS_SJIS_FLAGS
},
{ // PC-9821
{
"kyra2",
- 0,
+ "CD",
AD_ENTRY1("WSCORE.PAK", "c44de1302b67f27d4707409987b7a685"),
Common::EN_ANY,
Common::kPlatformPC98,
- Common::ADGF_NO_FLAGS
+ Common::ADGF_CD
},
KYRA2_TOWNS_FLAGS
},
{
{
"kyra2",
- 0,
+ "CD",
AD_ENTRY1("WSCORE.PAK", "c44de1302b67f27d4707409987b7a685"),
Common::JA_JPN,
Common::kPlatformPC98,
- Common::ADGF_NO_FLAGS
+ Common::ADGF_CD
},
KYRA2_TOWNS_SJIS_FLAGS
},
@@ -752,7 +755,102 @@ const KYRAGameDescription adGameDescs[] = {
},
LOL_CD_FLAGS
},
+
+ {
+ {
+ "lol",
+ "CD",
+ {
+ { "GENERAL.PAK", 0, "9e4bab499b7ea9337b91ac29fcba6d13", -1 },
+ { "L01.PAK", 0, "759a0ac26808d77ea968bd392355ba1d", -1 },
+ { 0, 0, 0, 0 }
+ },
+ Common::EN_ANY,
+ Common::kPlatformPC,
+ Common::ADGF_DROPLANGUAGE | Common::ADGF_CD
+ },
+ LOL_CD_FLAGS
+ },
+
+ {
+ {
+ "lol",
+ "CD",
+ {
+ { "GENERAL.PAK", 0, "9e4bab499b7ea9337b91ac29fcba6d13", -1 },
+ { "L01.PAK", 0, "759a0ac26808d77ea968bd392355ba1d", -1 },
+ { 0, 0, 0, 0 }
+ },
+ Common::DE_DEU,
+ Common::kPlatformPC,
+ Common::ADGF_DROPLANGUAGE | Common::ADGF_CD
+ },
+ LOL_CD_FLAGS
+ },
+
+ {
+ {
+ "lol",
+ "CD",
+ {
+ { "GENERAL.PAK", 0, "9e4bab499b7ea9337b91ac29fcba6d13", -1 },
+ { "L01.PAK", 0, "759a0ac26808d77ea968bd392355ba1d", -1 },
+ { 0, 0, 0, 0 }
+ },
+ Common::FR_FRA,
+ Common::kPlatformPC,
+ Common::ADGF_DROPLANGUAGE | Common::ADGF_CD
+ },
+ LOL_CD_FLAGS
+ },
+ /*{
+ {
+ "lol",
+ 0,
+ {
+ { "GENERAL.PAK", 0, "3fe6539b9b09084c0984eaf7170464e9", -1 },
+ { "MUS.PAK", 0, "008dc69d8cbcdb6bae30e270fab26e76", -1 },
+ { 0, 0, 0, 0 }
+ },
+ Common::EN_ANY,
+ Common::kPlatformPC98,
+ Common::ADGF_NO_FLAGS
+ },
+ LOL_PC98_FLAGS
+ },
+
+ {
+ {
+ "lol",
+ 0,
+ {
+ { "GENERAL.PAK", 0, "3fe6539b9b09084c0984eaf7170464e9", -1 },
+ { "MUS.PAK", 0, "008dc69d8cbcdb6bae30e270fab26e76", -1 },
+ { 0, 0, 0, 0 }
+ },
+ Common::JA_JPN,
+ Common::kPlatformPC98,
+ Common::ADGF_NO_FLAGS
+ },
+ LOL_PC98_SJIS_FLAGS
+ },*/
+
+ {
+ {
+ "lol",
+ "Demo",
+ {
+ { "GENERAL.PAK", 0, "e94863d86c4597a2d581d05481c152ba", -1 },
+ { 0, 0, 0, 0 }
+ },
+ Common::EN_ANY,
+ Common::kPlatformPC,
+ Common::ADGF_NO_FLAGS
+ },
+ LOL_DEMO_FLAGS
+ },
+
{ AD_TABLE_END_MARKER, FLAGS(0, 0, 0, 0, 0, 0, 0) }
};
diff --git a/engines/kyra/kyra_hof.cpp b/engines/kyra/kyra_hof.cpp
index d3de621707..27d905435f 100644
--- a/engines/kyra/kyra_hof.cpp
+++ b/engines/kyra/kyra_hof.cpp
@@ -251,7 +251,7 @@ int KyraEngine_HoF::init() {
_abortIntroFlag = false;
if (_sequenceStrings) {
- for (int i = 0; i < 33; i++)
+ for (int i = 0; i < MIN(33, _sequenceStringsSize); i++)
_sequenceStringsDuration[i] = (int) strlen(_sequenceStrings[i]) * 8;
}
@@ -278,7 +278,10 @@ int KyraEngine_HoF::go() {
seq_showStarcraftLogo();
if (_flags.isDemo && !_flags.isTalkie) {
- seq_playSequences(kSequenceDemoVirgin, kSequenceDemoFisher);
+ if (_flags.gameID == GI_LOL)
+ seq_playSequences(kSequenceLolDemoScene1, kSequenceLolDemoScene6);
+ else
+ seq_playSequences(kSequenceDemoVirgin, kSequenceDemoFisher);
_menuChoice = 4;
} else {
seq_playSequences(kSequenceVirgin, kSequenceZanfaun);
diff --git a/engines/kyra/kyra_hof.h b/engines/kyra/kyra_hof.h
index 866dd55d16..279e9e35a6 100644
--- a/engines/kyra/kyra_hof.h
+++ b/engines/kyra/kyra_hof.h
@@ -97,6 +97,20 @@ enum kNestedSequencesDemo {
kSequenceDemoDig
};
+enum kSequencesLolDemo {
+ kSequenceLolDemoScene1 = 0,
+ kSequenceLolDemoText1,
+ kSequenceLolDemoScene2,
+ kSequenceLolDemoText2,
+ kSequenceLolDemoScene3,
+ kSequenceLolDemoText3,
+ kSequenceLolDemoScene4,
+ kSequenceLolDemoText4,
+ kSequenceLolDemoScene5,
+ kSequenceLolDemoText5,
+ kSequenceLolDemoScene6
+};
+
class WSAMovie_v2;
class KyraEngine_HoF;
class TextDisplayer_HoF;
@@ -242,6 +256,14 @@ protected:
int seq_demoBail(WSAMovie_v2 *wsaObj, int x, int y, int frm);
int seq_demoDig(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+ int seq_lolDemoScene1(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+ int seq_lolDemoScene2(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+ int seq_lolDemoScene3(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+ int seq_lolDemoScene4(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+ int seq_lolDemoScene5(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+ int seq_lolDemoText5(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+ int seq_lolDemoScene6(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+
void seq_sequenceCommand(int command);
void seq_loadNestedSequence(int wsaNum, int seqNum);
void seq_nestedSequenceFrame(int command, int wsaNum);
@@ -264,7 +286,7 @@ protected:
WSAMovie_v2 * wsa, int firstframe, int lastframe, int wsaXpos, int wsaYpos);
void seq_finaleActorScreen();
void seq_displayScrollText(uint8 *data, const ScreenDim *d, int tempPage1, int tempPage2, int speed, int step, Screen::FontId fid1, Screen::FontId fid2, const uint8 *shapeData = 0, const char *const *specialData = 0);
- void seq_scrollPage();
+ void seq_scrollPage(int bottom, int top);
void seq_showStarcraftLogo();
void seq_init();
diff --git a/engines/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp
index 85c03dc1bb..bc46d8e1f5 100644
--- a/engines/kyra/kyra_v1.cpp
+++ b/engines/kyra/kyra_v1.cpp
@@ -114,7 +114,7 @@ int KyraEngine_v1::init() {
_sound = new SoundTownsPC98_v2(this, _mixer);
} else if (_flags.platform == Common::kPlatformPC98) {
if (_flags.gameID == GI_KYRA1)
- _sound = new SoundTowns/*SoundPC98*/(this, _mixer);
+ _sound = new SoundPC98(this, _mixer);
else
_sound = new SoundTownsPC98_v2(this, _mixer);
} else if (midiDriver == MD_ADLIB) {
@@ -152,6 +152,16 @@ int KyraEngine_v1::init() {
_res = new Resource(this);
assert(_res);
_res->reset();
+
+ if (_flags.isDemo) {
+ // HACK: check whether this is the HOF demo or the LOL demo.
+ // The LOL demo needs to be detected and run as KyraEngine_HoF,
+ // but the static resource loader and the sequence player will
+ // need correct IDs.
+ if (_res->exists("scene1.cps"))
+ _flags.gameID = GI_LOL;
+ }
+
_staticres = new StaticResource(this);
assert(_staticres);
if (!_staticres->init())
diff --git a/engines/kyra/resource.cpp b/engines/kyra/resource.cpp
index 92818aafe1..5d3c5ff715 100644
--- a/engines/kyra/resource.cpp
+++ b/engines/kyra/resource.cpp
@@ -55,12 +55,10 @@ bool Resource::reset() {
if (!dir.exists() || !dir.isDirectory())
error("invalid game path '%s'", dir.getPath().c_str());
- if (_vm->game() != GI_LOL) {
- if (!loadPakFile(StaticResource::staticDataFilename()) || !StaticResource::checkKyraDat()) {
- Common::String errorMessage = "You're missing the '" + StaticResource::staticDataFilename() + "' file or it got corrupted, (re)get it from the ScummVM website";
- _vm->GUIErrorMessage(errorMessage);
- error(errorMessage.c_str());
- }
+ if (!loadPakFile(StaticResource::staticDataFilename()) || !StaticResource::checkKyraDat()) {
+ Common::String errorMessage = "You're missing the '" + StaticResource::staticDataFilename() + "' file or it got corrupted, (re)get it from the ScummVM website";
+ _vm->GUIErrorMessage(errorMessage);
+ error(errorMessage.c_str());
}
if (_vm->game() == GI_KYRA1) {
diff --git a/engines/kyra/sequences_hof.cpp b/engines/kyra/sequences_hof.cpp
index 169c319347..d7a2b17fdd 100644
--- a/engines/kyra/sequences_hof.cpp
+++ b/engines/kyra/sequences_hof.cpp
@@ -50,7 +50,7 @@ void KyraEngine_HoF::seq_playSequences(int startSeq, int endSeq) {
_sound->setSoundList(&_soundData[(startSeq > kSequenceZanfaun) ? kMusicFinale : kMusicIntro]);
_sound->loadSoundFile(0);
- _screen->_charWidth = -2;
+ _screen->_charWidth = (_flags.gameID == GI_LOL) ? 0 : -2;
memset(_activeWSA, 0, sizeof(ActiveWSA) * 8);
for (int i = 0; i < 8; ++i)
@@ -300,8 +300,8 @@ void KyraEngine_HoF::seq_playSequences(int startSeq, int endSeq) {
_eventList.clear();
seqNum = kSequenceFirates;
}
- } else if (seqNum == kSequenceDemoFisher && !(_abortIntroFlag || skipFlag())) {
- seqNum = kSequenceDemoVirgin;
+ } else if (seqNum == endSeq && !(_abortIntroFlag || skipFlag())) {
+ seqNum = 0;
}
if (_menuChoice) {
@@ -1722,7 +1722,7 @@ int KyraEngine_HoF::seq_demoFisher(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
_seqScrollTextCounter = 0;
}
- seq_scrollPage();
+ seq_scrollPage(24, 144);
_seqFrameCounter++;
if (_seqFrameCounter < 0x256 || _seqFrameCounter > 0x31c) {
if (_seqFrameCounter < 0x174 || _seqFrameCounter > 0x1d7) {
@@ -1740,7 +1740,7 @@ int KyraEngine_HoF::seq_demoFisher(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
}
} else {
- seq_scrollPage();
+ seq_scrollPage(24, 144);
}
return 0;
}
@@ -1796,6 +1796,182 @@ int KyraEngine_HoF::seq_demoDig(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
return frm;
}
+int KyraEngine_HoF::seq_lolDemoScene1(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
+ uint8 *tmpPal = _screen->getPalette(2);
+
+ if (!(_seqFrameCounter % 100)) {
+ if (_seqFrameCounter == 0) {
+ _sound->haltTrack();
+ _sound->playTrack(6);
+ }
+ memcpy(tmpPal, _screen->getPalette(0), 0x300);
+ for (int i = 3; i < 0x300; i++) {
+ tmpPal[i] = ((int)tmpPal[i] * 120) / 64;
+ if (tmpPal[i] > 0x3f)
+ tmpPal[i] = 0x3f;
+ }
+ seq_playTalkText(_rnd.getRandomBit());
+ _screen->setScreenPalette(tmpPal);
+ _screen->updateScreen();
+ delay(8);
+ } else {
+ _screen->setScreenPalette(_screen->getPalette(0));
+ _screen->updateScreen();
+ if (_seqFrameCounter == 40)
+ seq_playTalkText(3);
+ }
+
+ _seqFrameCounter++;
+ return frm;
+}
+
+int KyraEngine_HoF::seq_lolDemoScene2(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
+ switch (_seqFrameCounter - 17) {
+ case 0:
+ _seqFrameDelay = 8;
+ break;
+ case 3:
+ case 6:
+ case 9:
+ seq_playTalkText(8);
+ break;
+ case 15:
+ seq_playTalkText(9);
+ break;
+ case 18:
+ seq_playTalkText(2);
+ break;
+ default:
+ break;
+ }
+ _seqFrameCounter++;
+ return frm;
+}
+
+int KyraEngine_HoF::seq_lolDemoScene3(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
+ if (_seqFrameCounter == 1)
+ seq_playTalkText(6);
+ else if (frm == 26)
+ seq_playTalkText(7);
+
+ _seqFrameCounter++;
+ return frm;
+}
+
+int KyraEngine_HoF::seq_lolDemoScene4(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
+ switch (_seqFrameCounter) {
+ case 11:
+ case 14:
+ case 17:
+ case 20:
+ seq_playTalkText(8);
+ break;
+ case 22:
+ seq_playTalkText(11);
+ break;
+ case 24:
+ seq_playTalkText(8);
+ break;
+ case 30:
+ seq_playTalkText(15);
+ break;
+ case 34:
+ seq_playTalkText(14);
+ break;
+ case 38:
+ seq_playTalkText(13);
+ break;
+ case 42:
+ seq_playTalkText(12);
+ break;
+ default:
+ break;
+ }
+
+ _seqFrameCounter++;
+ return frm;
+}
+
+int KyraEngine_HoF::seq_lolDemoScene5(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
+ switch (_seqFrameCounter++) {
+ case 0:
+ case 4:
+ case 6:
+ case 8:
+ case 10:
+ case 14:
+ case 16:
+ case 18:
+ case 20:
+ case 22:
+ case 24:
+ case 26:
+ case 28:
+ case 30:
+ seq_playTalkText(15);
+ break;
+ case 32:
+ seq_playTalkText(16);
+ break;
+ case 42:
+ seq_playTalkText(6);
+ break;
+ default:
+ break;
+ }
+ return frm;
+}
+
+int KyraEngine_HoF::seq_lolDemoText5(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
+ if (_seqFrameCounter++ == 100)
+ seq_playTalkText(5);
+ return frm;
+}
+
+int KyraEngine_HoF::seq_lolDemoScene6(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
+ while (_seqScrollTextCounter < 0x122) {
+ _seqEndTime = _system->getMillis() + 6 * _tickLength;
+ if (!_seqFrameCounter) {
+ _screen->loadBitmap("adtext.cps", 4, 4, 0);
+ _screen->loadBitmap("adtext2.cps", 6, 6, 0);
+ _screen->copyPageMemory(6, 0, 4, 64000, 1024);
+ _screen->copyPageMemory(6, 1023, 6, 0, 64000);
+ _seqScrollTextCounter = 0;
+ }
+
+ if (_seqFrameCounter % 175) {
+ _screen->setScreenPalette(_screen->getPalette(0));
+ } else {
+ uint8 *tmpPal = _screen->getPalette(2);
+ memcpy(tmpPal, _screen->getPalette(0), 0x300);
+ for (int i = 3; i < 0x300; i++) {
+ tmpPal[i] = ((int)tmpPal[i] * 120) / 64;
+ if (tmpPal[i] > 0x3f)
+ tmpPal[i] = 0x3f;
+ }
+ seq_playTalkText(_rnd.getRandomBit());
+ _screen->setScreenPalette(tmpPal);
+ _screen->updateScreen();
+ delay(8);
+ }
+
+ if (_seqFrameCounter == 40 || _seqFrameCounter == 80 || _seqFrameCounter == 150 || _seqFrameCounter == 300)
+ seq_playTalkText(3);
+
+ _screen->copyPage(12, 2);
+ seq_scrollPage(70, 130);
+ _screen->copyPage(2, 0);
+ _screen->updateScreen();
+ _seqFrameCounter++;
+ if (_seqFrameCounter < 128 || _seqFrameCounter > 207)
+ _seqScrollTextCounter++;
+ delayUntil(_seqEndTime);
+ }
+ _screen->copyPage(2, 12);
+
+ return 0;
+}
+
uint32 KyraEngine_HoF::seq_activeTextsTimeLeft() {
uint32 res = 0;
@@ -1892,16 +2068,14 @@ void KyraEngine_HoF::seq_sequenceCommand(int command) {
switch (command) {
case 0:
memset(pal, 0, 0x300);
- _screen->fadePalette(pal, 16);
+ _screen->fadePalette(pal, 36);
memcpy (_screen->getPalette(0), pal, 0x300);
memcpy (_screen->getPalette(1), pal, 0x300);
break;
case 1:
memset(pal, 0x3F, 0x300);
- //////////XXX
- //////////Unused anyway (at least by fm-towns intro/outro)
-
+ seq_playTalkText(_rnd.getRandomBit());
_screen->fadePalette(pal, 16);
memcpy (_screen->getPalette(0), pal, 0x300);
memcpy (_screen->getPalette(1), pal, 0x300);
@@ -2575,32 +2749,34 @@ void KyraEngine_HoF::seq_displayScrollText(uint8 *data, const ScreenDim *d, int
delete[] textData;
}
-void KyraEngine_HoF::seq_scrollPage() {
- int dstY, dstH, srcH;
+void KyraEngine_HoF::seq_scrollPage(int bottom, int top) {
+ int dstY, dstH, srcH, mgY;
static const ScreenDim d = { 0x00, 0x00, 0x28, 0x320, 0xFF, 0xFE, 0x00, 0x00 };
- if (_seqScrollTextCounter - 143 < 0) {
- dstY = 144 - _seqScrollTextCounter;
+ if (_seqScrollTextCounter - (top - 1) < 0) {
+ dstY = top - _seqScrollTextCounter;
dstH = _seqScrollTextCounter;
srcH = 0;
} else {
dstY = 0;
- srcH = _seqScrollTextCounter - 144;
- dstH = (400 - srcH <= 144) ? 400 - srcH : 144;
+ srcH = _seqScrollTextCounter - top;
+ dstH = (400 - srcH <= top) ? 400 - srcH : top;
}
if (dstH > 0) {
- for (int i = 0; i < 4; i++) {
- const ItemAnimData_v1 *def = &_demoAnimData[i];
- ActiveItemAnim *a = &_activeItemAnim[i];
-
- _screen->fillRect(12, def->y - 8, 28, def->y + 8, 0, 4);
- _screen->drawShape(4, getShapePtr(def->itemIndex + def->frames[a->currentFrame]), 12, def->y - 8, 0, 0);
- if(_seqFrameCounter % 2 == 0)
- a->currentFrame = ++a->currentFrame % 20;
+ if (_demoAnimData) {
+ for (int i = 0; i < 4; i++) {
+ const ItemAnimData_v1 *def = &_demoAnimData[i];
+ ActiveItemAnim *a = &_activeItemAnim[i];
+
+ _screen->fillRect(12, def->y - 8, 28, def->y + 8, 0, 4);
+ _screen->drawShape(4, getShapePtr(def->itemIndex + def->frames[a->currentFrame]), 12, def->y - 8, 0, 0);
+ if(_seqFrameCounter % 2 == 0)
+ a->currentFrame = ++a->currentFrame % 20;
+ }
}
- _screen->copyRegionEx(4, 0, srcH, 2, 2, dstY + 24, 320, dstH, &d);
+ _screen->copyRegionEx(4, 0, srcH, 2, 2, dstY + bottom, 320, dstH, &d);
}
}
@@ -2656,6 +2832,10 @@ void KyraEngine_HoF::seq_init() {
_res->loadFileList(_sequencePakList, _sequencePakListSize);
int numShp = -1;
+
+ if (_flags.gameID == GI_LOL)
+ return;
+
if (_flags.isDemo && !_flags.isTalkie) {
_demoAnimData = _staticres->loadShapeAnimData_v1(k2SeqplayShapeAnimData, _itemAnimDataSize);
uint8 *shp = _res->fileData("icons.shp", 0);
diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp
index 38d8d4d284..f9238ff044 100644
--- a/engines/kyra/staticres.cpp
+++ b/engines/kyra/staticres.cpp
@@ -43,7 +43,7 @@
namespace Kyra {
-#define RESFILE_VERSION 28
+#define RESFILE_VERSION 29
bool StaticResource::checkKyraDat() {
Common::File kyraDat;
@@ -279,6 +279,16 @@ bool StaticResource::init() {
{ 0, 0, 0 }
};
+ static const FilenameTable lolStaticRes[] = {
+ // Demo Sequence Player
+ { k2SeqplayPakFiles, kStringList, "S_PAKFILES.TXT" },
+ { k2SeqplayStrings, kLanguageList, "S_STRINGS." },
+ { k2SeqplaySfxFiles, kStringList, "S_SFXFILES.TXT" },
+ { k2SeqplaySeqData, k2SeqData, "S_DATA.SEQ" },
+ { k2SeqplayIntroTracks, kStringList, "S_INTRO.TRA" },
+ { 0, 0, 0 }
+ };
+
if (_vm->game() == GI_KYRA1) {
_builtIn = 0;
_filenameTable = kyra1StaticRes;
@@ -289,7 +299,10 @@ bool StaticResource::init() {
_builtIn = 0;
_filenameTable = kyra3StaticRes;
} else if (_vm->game() == GI_LOL) {
- return true;
+ if (!_vm->gameFlags().isDemo)
+ return true;
+ _builtIn = 0;
+ _filenameTable = lolStaticRes;
} else {
error("StaticResource: Unknown game ID");
}
@@ -920,6 +933,8 @@ const char *StaticResource::getFilename(const char *name) {
filename += ".K2";
else if (_vm->gameFlags().gameID == GI_KYRA3)
filename += ".K3";
+ else if (_vm->gameFlags().gameID == GI_LOL)
+ filename += ".LOL";
if (_vm->gameFlags().isTalkie && _vm->gameFlags().gameID != GI_KYRA3)
filename += ".CD";
@@ -1037,10 +1052,8 @@ void KyraEngine_LoK::initStaticResource() {
}
// audio data tables
-#if 0
static const char *tIntro98[] = { "intro%d.dat" };
static const char *tIngame98[] = { "kyram%d.dat" };
-#endif
static const AudioDataStruct soundData_PC[] = {
{ _soundFilesIntro, _soundFilesIntroSize, 0, 0 },
@@ -1054,20 +1067,18 @@ void KyraEngine_LoK::initStaticResource() {
{ 0, 0, 0, 0}
};
-#if 0
static const AudioDataStruct soundData_PC98[] = {
{ tIntro98, 1, 0, 0 },
{ tIngame98, 1, 0, 0 },
{ 0, 0, 0, 0}
};
-#endif
if (_flags.platform == Common::kPlatformPC)
_soundData = soundData_PC;
else if (_flags.platform == Common::kPlatformFMTowns)
_soundData = soundData_TOWNS;
else if (_flags.platform == Common::kPlatformPC98)
- _soundData = soundData_TOWNS/*soundData_PC98*/;
+ _soundData = soundData_PC98;
else
_soundData = 0;
}
@@ -1267,11 +1278,9 @@ void KyraEngine_HoF::initStaticResource() {
static const char *fmtMusicFileListFinale[] = { "finale%d.twn" };
static const char *fmtMusicFileListIngame[] = { "km%02d.twn" };
-#if 0
static const char *pc98MusicFileListIntro[] = { "intro%d.86" };
static const char *pc98MusicFileListFinale[] = { "finale%d.86" };
static const char *pc98MusicFileListIngame[] = { "km%02d.86" };
-#endif
static const AudioDataStruct soundData_PC[] = {
{ _musicFileListIntro, _musicFileListIntroSize, 0, 0 },
@@ -1285,20 +1294,18 @@ void KyraEngine_HoF::initStaticResource() {
{ fmtMusicFileListFinale, 1, _cdaTrackTableFinale, _cdaTrackTableFinaleSize >> 1 }
};
-#if 0
static const AudioDataStruct soundData_PC98[] = {
{ pc98MusicFileListIntro, 1, 0, 0 },
{ pc98MusicFileListIngame, 1, 0, 0 },
{ pc98MusicFileListFinale, 1, 0, 0 }
};
-#endif
if (_flags.platform == Common::kPlatformPC)
_soundData = soundData_PC;
else if (_flags.platform == Common::kPlatformFMTowns)
_soundData = soundData_TOWNS;
else if (_flags.platform == Common::kPlatformPC98)
- _soundData = soundData_TOWNS/*soundData_PC98*/;
+ _soundData = soundData_PC98;
// setup sequence data
_sequences = _staticres->loadHofSequenceData(k2SeqplaySeqData, tmpSize);
@@ -1337,8 +1344,17 @@ void KyraEngine_HoF::initStaticResource() {
&KyraEngine_HoF::seq_demoDig, 0
};
- _callbackS = (_flags.isDemo && !_flags.isTalkie) ? hofDemoSequenceCallbacks : hofSequenceCallbacks;
- _callbackN = (_flags.isDemo && !_flags.isTalkie) ? hofDemoNestedSequenceCallbacks : hofNestedSequenceCallbacks;
+ static const SeqProc lolDemoSequenceCallbacks[] = {
+ &KyraEngine_HoF::seq_lolDemoScene1, 0, &KyraEngine_HoF::seq_lolDemoScene2, 0,
+ &KyraEngine_HoF::seq_lolDemoScene3, 0, &KyraEngine_HoF::seq_lolDemoScene4, 0,
+ &KyraEngine_HoF::seq_lolDemoScene5, &KyraEngine_HoF::seq_lolDemoText5,
+ &KyraEngine_HoF::seq_lolDemoScene6, 0
+ };
+
+ static const SeqProc lolDemoNestedSequenceCallbacks[] = { 0 };
+
+ _callbackS = _flags.gameID == GI_LOL ? lolDemoSequenceCallbacks : ((_flags.isDemo && !_flags.isTalkie) ? hofDemoSequenceCallbacks : hofSequenceCallbacks);
+ _callbackN = _flags.gameID == GI_LOL ? lolDemoNestedSequenceCallbacks : ((_flags.isDemo && !_flags.isTalkie) ? hofDemoNestedSequenceCallbacks : hofNestedSequenceCallbacks);
}
void KyraEngine_MR::initStaticResource() {
diff --git a/tools/create_kyradat/create_kyradat.cpp b/tools/create_kyradat/create_kyradat.cpp
index 173ba0f993..e4127303e1 100644
--- a/tools/create_kyradat/create_kyradat.cpp
+++ b/tools/create_kyradat/create_kyradat.cpp
@@ -31,7 +31,7 @@
#include "md5.h"
enum {
- kKyraDatVersion = 28,
+ kKyraDatVersion = 29,
kIndexSize = 12
};
@@ -53,6 +53,8 @@ enum {
#include "malcolm.h"
+#include "lol_demo.h"
+
const Game kyra1FanTranslations[] = {
{ kKyra1, IT_ITA, kTalkieVersion, "d0f1752098236083d81b9497bd2b6989", kyra1FreCD },
GAME_DUMMY_ENTRY
@@ -251,6 +253,11 @@ const ExtractFilename extractFilenames[] = {
{ k3ItemMagicTable, k3TypeRaw16to8, "ITEMMAGIC.MAP" },
{ k3ItemStringMap, kTypeRawData, "ITEMSTRINGS.MAP" },
+ // LANDS OF LORE
+
+ // Demo Sequence Player
+ { lSeqplayIntroTracks, k2TypeSoundList, "S_INTRO.TRA" },
+
{ -1, 0, 0 }
};
@@ -288,7 +295,7 @@ bool getFilename(char *dstFilename, const Game *g, const int id) {
void createFilename(char *dstFilename, const int gid, const int lang, const int special, const char *filename) {
strcpy(dstFilename, filename);
- static const char *gidExtensions[] = { "", ".K2", ".K3" };
+ static const char *gidExtensions[] = { "", ".K2", ".K3", 0, ".LOL" };
strcat(dstFilename, gidExtensions[gid]);
for (const SpecialExtension *specialE = specialTable; specialE->special != -1; ++specialE) {
@@ -311,7 +318,7 @@ void createLangFilename(char *dstFilename, const int gid, const int lang, const
}
}
- static const char *gidExtensions[] = { "", ".K2", ".K3" };
+ static const char *gidExtensions[] = { "", ".K2", ".K3", 0, ".LOL" };
strcat(dstFilename, gidExtensions[gid]);
for (const SpecialExtension *specialE = specialTable; specialE->special != -1; ++specialE) {
@@ -723,11 +730,11 @@ bool extractHofSeqData(PAKFile &out, const Game *g, const byte *data, const uint
controlOffs = 0;
WRITE_BE_UINT16(output, controlOffs);
- if (g->special != k2DemoVersion)
+ if (g->special != k2DemoVersion && g->special != k2DemoLol)
ptr += 4;
output += 2;
- if (g->special != k2DemoVersion) {
+ if (g->special != k2DemoVersion && g->special != k2DemoLol) {
for (int w = 0; w < 2; w++) { //startupCommand, finalCommand
WRITE_BE_UINT16(output, READ_LE_UINT16(ptr));
ptr += 2;
@@ -1065,7 +1072,7 @@ uint32 getFeatures(const Game *g) {
if (g->special == kTalkieVersion || g->special == k2CDFile1E || g->special == k2CDFile1F || g->special == k2CDFile1G || g->special == k2CDFile2E || g->special == k2CDFile2F || g->special == k2CDFile2G || g->game == kKyra3)
features |= GF_TALKIE;
- else if (g->special == kDemoVersion || g->special == k2DemoVersion)
+ else if (g->special == kDemoVersion || g->special == k2DemoVersion || g->special == k2DemoLol)
features |= GF_DEMO;
else if (g->special == kFMTownsVersionE || g->special == kFMTownsVersionJ ||
g->special == k2TownsFile1E || g->special == k2TownsFile1J ||
@@ -1344,6 +1351,8 @@ const Game *gameDescs[] = {
kyra3Games,
+ lolDemos,
+
0
};
diff --git a/tools/create_kyradat/create_kyradat.h b/tools/create_kyradat/create_kyradat.h
index c8bcb7d583..62dac117b4 100644
--- a/tools/create_kyradat/create_kyradat.h
+++ b/tools/create_kyradat/create_kyradat.h
@@ -174,6 +174,8 @@ enum kExtractID {
k3ItemMagicTable,
k3ItemStringMap,
+ lSeqplayIntroTracks,
+
kMaxResIDs
};
@@ -212,10 +214,10 @@ enum kSpecial {
k2FloppyFile2 = 16,
k2DemoVersion = 17,
-
k2DemoVersionTlkE = 18,
k2DemoVersionTlkF = 19,
- k2DemoVersionTlkG = 20
+ k2DemoVersionTlkG = 20,
+ k2DemoLol = 21
};
struct SpecialExtension {
@@ -225,8 +227,9 @@ struct SpecialExtension {
enum kGame {
kKyra1 = 0,
- kKyra2,
- kKyra3
+ kKyra2 = 1,
+ kKyra3 = 2,
+ kLol = 4
};
struct Game {
diff --git a/tools/create_kyradat/hof_demo.h b/tools/create_kyradat/hof_demo.h
index f7b15ffa3d..2eaaa3c413 100644
--- a/tools/create_kyradat/hof_demo.h
+++ b/tools/create_kyradat/hof_demo.h
@@ -26,7 +26,8 @@ const Game kyra2Demos[] = {
{ kKyra2, EN_ANY, k2DemoVersion, "a620a37579dd44ab0403482285e3897f", kyra2Demo},
{ kKyra2, EN_ANY, k2CDFile2E, "fa54d8abfe05f9186c05f7de7eaf1480", kyra2DemoCDE},
{ kKyra2, FR_FRA, k2CDFile2F, "fa54d8abfe05f9186c05f7de7eaf1480", kyra2DemoCDF},
- { kKyra2, DE_DEU, k2CDFile2G, "fa54d8abfe05f9186c05f7de7eaf1480", kyra2DemoCDG},
-
+ { kKyra2, DE_DEU, k2CDFile2G, "fa54d8abfe05f9186c05f7de7eaf1480", kyra2DemoCDG},
GAME_DUMMY_ENTRY
};
+
+
diff --git a/tools/create_kyradat/lol_demo.h b/tools/create_kyradat/lol_demo.h
new file mode 100644
index 0000000000..ce114f4e73
--- /dev/null
+++ b/tools/create_kyradat/lol_demo.h
@@ -0,0 +1,15 @@
+const ExtractEntry lolDemo[] = {
+ { k2SeqplayPakFiles, 0x0001AC10, 0x0001AC1C },
+ { k2SeqplayStrings, 0x0001B5EE, 0x0001B6F0 },
+ { k2SeqplaySfxFiles, 0x0001B6F0, 0x0001B7B5 },
+ { k2SeqplaySeqData, 0x0001B320, 0x0001B56C },
+ { lSeqplayIntroTracks, 0x0001B7B5, 0x0001B7CF },
+ { -1, 0, 0 }
+};
+
+const Game lolDemos[] = {
+ { kLol, EN_ANY, k2DemoLol, "30bb5af87d38adb47d3e6ce06b1cb042", lolDemo},
+ GAME_DUMMY_ENTRY
+};
+
+
diff --git a/tools/create_kyradat/misc.h b/tools/create_kyradat/misc.h
index 1e1cd29cc9..836cc3954c 100644
--- a/tools/create_kyradat/misc.h
+++ b/tools/create_kyradat/misc.h
@@ -472,6 +472,15 @@ const int kyra3Need[] = {
-1
};
+const int lolDemoNeed[] = {
+ k2SeqplayPakFiles,
+ k2SeqplayStrings,
+ k2SeqplaySeqData,
+ k2SeqplaySfxFiles,
+ lSeqplayIntroTracks,
+ -1
+};
+
const GameNeed gameNeedTable[] = {
{ kKyra1, -1, kyra1FloppyNeed },
{ kKyra1, kTalkieVersion, kyra1CDNeed },
@@ -496,6 +505,7 @@ const GameNeed gameNeedTable[] = {
{ kKyra2, k2DemoVersionTlkE, kyra2TlkDemoNeed},
{ kKyra2, k2DemoVersionTlkF, kyra2TlkDemoNeed},
{ kKyra2, k2DemoVersionTlkG, kyra2TlkDemoNeed},
+ { kLol, k2DemoLol, lolDemoNeed},
{ kKyra3, -1, kyra3Need },
@@ -520,6 +530,7 @@ const SpecialExtension specialTable[] = {
{ k2TownsFile2E, "TNS" },
{ k2TownsFile2J, "TNS" },
{ k2DemoVersion, "DEM" },
+ { k2DemoLol, "DEM" },
{ -1, 0 }
};