diff options
-rw-r--r-- | engines/kyra/gui_v2.cpp | 15 | ||||
-rw-r--r-- | engines/kyra/kyra.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/kyra.h | 4 | ||||
-rw-r--r-- | engines/kyra/kyra_v1.cpp | 9 | ||||
-rw-r--r-- | engines/kyra/kyra_v1.h | 12 | ||||
-rw-r--r-- | engines/kyra/kyra_v2.cpp | 81 | ||||
-rw-r--r-- | engines/kyra/kyra_v2.h | 98 | ||||
-rw-r--r-- | engines/kyra/resource.cpp | 33 | ||||
-rw-r--r-- | engines/kyra/resource.h | 27 | ||||
-rw-r--r-- | engines/kyra/saveload_v1.cpp | 8 | ||||
-rw-r--r-- | engines/kyra/sequences_v1.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/sequences_v2.cpp | 145 | ||||
-rw-r--r-- | engines/kyra/sound.h | 6 | ||||
-rw-r--r-- | engines/kyra/sound_towns.cpp | 38 | ||||
-rw-r--r-- | engines/kyra/staticres.cpp | 676 |
15 files changed, 395 insertions, 761 deletions
diff --git a/engines/kyra/gui_v2.cpp b/engines/kyra/gui_v2.cpp index 1b4bd1d204..2e795dfb08 100644 --- a/engines/kyra/gui_v2.cpp +++ b/engines/kyra/gui_v2.cpp @@ -58,16 +58,25 @@ int KyraEngine_v2::gui_handleMainMenu() { memset(colorMap, 0, sizeof(colorMap)); _screen->setTextColorMap(colorMap); - const char * const *strings = &_mainMenuStrings[_lang << 2]; + const char * const *strings; + Screen::FontId oldFont = _screen->setFont(Screen::FID_8_FNT); int charWidthBackUp = _screen->_charWidth; _screen->_charWidth = -2; - if (_flags.gameID == GI_KYRA2) + if (_flags.gameID == GI_KYRA2) { _screen->setScreenDim(11); - else + const char * k2strings[4]; + k2strings[0] = _sequenceStrings[97]; + k2strings[1] = _sequenceStrings[96]; + k2strings[2] = _sequenceStrings[95]; + k2strings[3] = _sequenceStrings[98]; + strings = k2strings; + } else { _screen->setScreenDim(3); + strings = &_mainMenuStrings[_lang << 2]; + } int backUpX = _screen->_curDim->sx; int backUpY = _screen->_curDim->sy; diff --git a/engines/kyra/kyra.cpp b/engines/kyra/kyra.cpp index f296eade70..2d84a781e5 100644 --- a/engines/kyra/kyra.cpp +++ b/engines/kyra/kyra.cpp @@ -23,8 +23,6 @@ * */ - - #include "common/config-manager.h" #include "sound/mididrv.h" diff --git a/engines/kyra/kyra.h b/engines/kyra/kyra.h index e502a886e7..0e28539c13 100644 --- a/engines/kyra/kyra.h +++ b/engines/kyra/kyra.h @@ -58,9 +58,9 @@ enum { struct AudioDataStruct { const char * const *_fileList; - const uint _fileListLen; + const int _fileListLen; const void * const _cdaTracks; - const uint _cdaNumTracks; + const int _cdaNumTracks; }; // TODO: this is just the start of makeing the debug output of the kyra engine a bit more useable diff --git a/engines/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp index ec3ed0b440..40feaed920 100644 --- a/engines/kyra/kyra_v1.cpp +++ b/engines/kyra/kyra_v1.cpp @@ -180,9 +180,7 @@ int KyraEngine_v1::init() { initStaticResource(); - const AudioDataStruct *const sndList = (_flags.platform == Common::kPlatformFMTowns || - _flags.platform == Common::kPlatformPC98) ? _soundData_TOWNS : _soundData_PC; - _sound->setSoundList(sndList); + _sound->setSoundList(&_soundData[kMusicIntro]); _trackMap = _dosTrackMap; _trackMapSize = _dosTrackMapSize; @@ -191,8 +189,7 @@ int KyraEngine_v1::init() { error("Couldn't init sound"); _sound->setVolume(255); - _sound->loadSoundFile((_flags.platform == Common::kPlatformFMTowns - || _flags.platform == Common::kPlatformPC98) ? 0 : 9); + _sound->loadSoundFile(0); setupTimers(); setupButtonData(); @@ -342,6 +339,8 @@ void KyraEngine_v1::startup() { debugC(9, kDebugLevelMain, "KyraEngine_v1::startup()"); static const uint8 colorMap[] = { 0, 0, 0, 0, 12, 12, 12, 0, 0, 0, 0, 0 }; _screen->setTextColorMap(colorMap); + _sound->setSoundList(&_soundData[kMusicIngame]); + _sound->loadSoundFile(0); // _screen->setFont(Screen::FID_6_FNT); _screen->setAnimBlockPtr(3750); memset(_sceneAnimTable, 0, sizeof(_sceneAnimTable)); diff --git a/engines/kyra/kyra_v1.h b/engines/kyra/kyra_v1.h index 57a1492924..1cfb42ccf9 100644 --- a/engines/kyra/kyra_v1.h +++ b/engines/kyra/kyra_v1.h @@ -763,11 +763,13 @@ protected: const uint8 * const*_specialPalettes; - static const char *_soundFiles[]; - static const char *_soundFilesTowns[]; - static const int32 _cdaTrackTable[]; - static const AudioDataStruct _soundData_PC[]; - static const AudioDataStruct _soundData_TOWNS[]; + const char *const *_soundFiles; + int _soundFilesSize; + const char *const *_soundFilesIntro; + int _soundFilesIntroSize; + const int32 *_cdaTrackTable; + int _cdaTrackTableSize; + const AudioDataStruct * _soundData; static const int8 _charXPosTable[]; static const int8 _charYPosTable[]; diff --git a/engines/kyra/kyra_v2.cpp b/engines/kyra/kyra_v2.cpp index b009e4d53e..aef4967f63 100644 --- a/engines/kyra/kyra_v2.cpp +++ b/engines/kyra/kyra_v2.cpp @@ -49,6 +49,9 @@ KyraEngine_v2::KyraEngine_v2(OSystem *system, const GameFlags &flags) : KyraEngi _activeWSA = 0; _activeText = 0; _seqWsa = 0; + _sequences = 0; + _nSequences = 0; + _gamePlayBuffer = 0; _cCodeBuffer = _optionsBuffer = _chapterBuffer = 0; @@ -93,6 +96,11 @@ KyraEngine_v2::KyraEngine_v2(OSystem *system, const GameFlags &flags) : KyraEngi KyraEngine_v2::~KyraEngine_v2() { seq_uninit(); + if (_sequences) + delete [] _sequences; + if (_nSequences) + delete [] _nSequences; + delete [] _mouseSHPBuf; delete _screen; delete _text; @@ -112,6 +120,7 @@ int KyraEngine_v2::init() { error("_screen->init() failed"); KyraEngine::init(); + initStaticResource(); _debugger = new Debugger_v2(this); assert(_debugger); @@ -132,30 +141,6 @@ int KyraEngine_v2::init() { _abortIntroFlag = false; - // temporary solution until staticres manager support (kyra.dat) is added for kyra 2 - if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) { - _sequenceSoundList = (const char * const *) _sequenceSoundList_TOWNS; - _sequenceSoundListSize = _sequenceSoundListSize_TOWNS; - _sequenceStrings = (const char * const *) _sequenceStrings_TOWNS_EN; - _sequenceStringsSize = _sequenceStringsSize_TOWNS_EN; - _sequences = (const Sequence*) _sequences_TOWNS; - _soundData = (const AudioDataStruct *) _soundData_TOWNS; - } else if (_flags.isTalkie) { - _sequenceSoundList = (const char * const *) _sequenceSoundList_PC; - _sequenceSoundListSize = _sequenceSoundListSize_PC; - _sequenceStrings = (const char * const *) _sequenceStrings_PC_EN; - _sequenceStringsSize = _sequenceStringsSize_PC_EN; - _sequences = (const Sequence*) _sequences_PC; - _soundData = (const AudioDataStruct *) _soundData_PC; - } else { - _sequenceSoundList = (const char * const *) _sequenceSoundList_PCFLOPPY; - _sequenceSoundListSize = _sequenceSoundListSize_PCFLOPPY; - _sequenceStrings = (const char * const *) _sequenceStrings_PC_EN; - _sequenceStringsSize = _sequenceStringsSize_PC_EN; - _sequences = (const Sequence*) _sequences_PC; - _soundData = (const AudioDataStruct *) _soundData_PC; - } - for (int i = 0; i < 33; i++) _sequenceStringsDuration[i] = (int) strlen(_sequenceStrings[i]) * 8; @@ -179,39 +164,18 @@ int KyraEngine_v2::go() { if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) seq_showStarcraftLogo(); - if (_flags.platform == Common::kPlatformPC && _flags.isDemo) { - _res->loadPakFile("VOC.PAK"); - _menuChoice = 2; - } else { - seq_playSequences(kSequenceVirgin, kSequenceZanfaun); - //seq_playSequences(kSequenceFunters, kSequenceFrash); - - _res->unloadAllPakFiles(); - - if (_menuChoice != 4) { - // load just the pak files needed for ingame - if (_flags.platform == Common::kPlatformPC && _flags.isTalkie) { - _res->loadFileList("FILEDATA.FDT"); - _res->loadPakFile("KYRA.DAT"); - } else if (_flags.platform == Common::kPlatformPC) { - // TODO - - } else if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) { - char tmpfilename[13]; - static const char * pakfiles [] = { "KYRA.DAT", "AUDIO.PAK", "CAULDRON.PAK", - "MISC_CPS.PAK", "MISC_EMC.PAK", "OTHER.PAK", "VOC.PAK", "WSCORE.PAK" }; - for (int i = 0; i < 8; i++) - _res->loadPakFile(pakfiles[i]); - for (int i = 1; i < 10; i++) { - sprintf(tmpfilename, "COST%d_SH.PAK", i); - _res->loadPakFile(tmpfilename); - } - for (int i = 1; i < 6; i++) { - sprintf(tmpfilename, "HOFCH_%d.PAK", i); - _res->loadPakFile(tmpfilename); - } - } - } + seq_playSequences(kSequenceVirgin, kSequenceZanfaun); + //seq_playSequences(kSequenceFunters, kSequenceFrash); + + _res->unloadAllPakFiles(); + + if (_menuChoice != 4) { + // load just the pak files needed for ingame + _res->loadPakFile(StaticResource::staticDataFilename()); + if (_flags.platform == Common::kPlatformPC && _flags.isTalkie) + _res->loadFileList("FILEDATA.FDT"); + else + _res->loadFileList(_ingamePakList, _ingamePakListSize); } if (_menuChoice == 1) { @@ -221,9 +185,6 @@ int KyraEngine_v2::go() { } else if (_menuChoice == 3) { // TODO: Load Game - } else if (_menuChoice == 2) { - // TODO: Run Demo - } return 0; diff --git a/engines/kyra/kyra_v2.h b/engines/kyra/kyra_v2.h index 67fa2de6ea..7b7f61b3d5 100644 --- a/engines/kyra/kyra_v2.h +++ b/engines/kyra/kyra_v2.h @@ -74,16 +74,32 @@ enum kNestedSequences { kSequenceHand4 }; +enum kSequencesDemo { + kSequenceDemoVirgin = 0, + kSequenceDemoWestwood, + kSequenceDemoTitle, + kSequenceDemoTitle2, + kSequenceDemoHill, + kSequenceDemoOuthome, + kSequenceDemoWharf, + kSequenceDemoDinob, + kSequenceDemoFisher +}; + +enum kNestedSequencesDemo { + kSequenceDemoWharf2 = 0, + kSequenceDemoDinob2, + kSequenceDemoWater, + kSequenceDemoBail, + kSequenceDemoDig +}; class WSAMovieV2; class KyraEngine_v2; class TextDisplayer_v2; class Debugger_v2; -struct SequenceControl { - int8 frameIndex; - int8 frameDelay; -}; +typedef int (KyraEngine_v2::*Seqproc)(WSAMovieV2*, int, int, int); struct ActiveWSA { int16 flags; @@ -91,13 +107,13 @@ struct ActiveWSA { uint16 startFrame; uint16 endFrame; uint16 frameDelay; - int (KyraEngine_v2::*callback)(WSAMovieV2*, int, int, int); + Seqproc callback; uint32 nextFrame; uint16 currentFrame; uint16 lastFrame; uint16 x; uint16 y; - const SequenceControl *control; + const uint16 *control; uint16 startupCommand; uint16 finalCommand; }; @@ -125,7 +141,7 @@ struct Sequence { uint16 frameDelay; uint16 xPos; uint16 yPos; - int (KyraEngine_v2::*callback)(WSAMovieV2*, int, int, int); + Seqproc callback; uint16 duration; }; @@ -135,13 +151,12 @@ struct NestedSequence { uint16 startframe; uint16 endFrame; uint16 frameDelay; - int (KyraEngine_v2::*callback)(WSAMovieV2*, int, int, int); + Seqproc callback; uint16 x; uint16 y; - const SequenceControl * wsaControl; + const uint16 * wsaControl; uint16 startupCommand; uint16 finalCommand; - uint16 unk1; }; enum kMusicDataID { @@ -246,20 +261,9 @@ protected: uint8 *_mouseSHPBuf; - - static const char *_dosSoundFileListIntro[]; - static const char *_dosSoundFileListFinale[]; - static const char *_dosSoundFileList[]; - static const char *_fmtSoundFileListIntro[]; - static const char *_fmtSoundFileListFinale[]; - static const char *_fmtSoundFileList[]; - static const uint8 _cdaTrackTableIntro[]; - static const uint8 _cdaTrackTableIngame[]; - static const uint8 _cdaTrackTableFinale[]; - static const AudioDataStruct _soundData_PC[]; - static const AudioDataStruct _soundData_TOWNS[]; static const int8 _dosTrackMap[]; static const int _dosTrackMapSize; + const AudioDataStruct * _soundData; protected: @@ -268,6 +272,10 @@ protected: void runLoop(); void cleanup(); + // TODO: get rid of all variables having pointers to the static resources if possible + // i.e. let them directly use the _staticres functions + void initStaticResource(); + void setupTimers(); void setupOpcodeTable(); @@ -842,24 +850,27 @@ protected: ActiveWSA *_activeWSA; ActiveText *_activeText; + const char *const *_sequencePakList; + int _sequencePakListSize; + const char *const *_ingamePakList; + int _ingamePakListSize; + + const char *const *_musicFileListIntro; + int _musicFileListIntroSize; + const char *const *_musicFileListFinale; + int _musicFileListFinaleSize; + const char *const *_musicFileListIngame; + int _musicFileListIngameSize; + const uint8 *_cdaTrackTableIntro; + int _cdaTrackTableIntroSize; + const uint8 *_cdaTrackTableIngame; + int _cdaTrackTableIngameSize; + const uint8 *_cdaTrackTableFinale; + int _cdaTrackTableFinaleSize; const char *const *_sequenceSoundList; int _sequenceSoundListSize; const char *const *_sequenceStrings; int _sequenceStringsSize; - - static const char *_sequenceSoundList_PC[]; - static const int _sequenceSoundListSize_PC; - static const char *_sequenceSoundList_PCFLOPPY[]; - static const int _sequenceSoundListSize_PCFLOPPY; - static const char *_sequenceSoundList_TOWNS[]; - static const int _sequenceSoundListSize_TOWNS; - static const char *_sequenceStrings_TOWNS_EN[]; - static const int _sequenceStringsSize_TOWNS_EN; - static const char *_sequenceStrings_PC_EN[]; - static const int _sequenceStringsSize_PC_EN; - static const char _actorScreenStrings_PC_EN[]; - static const int _actorScreenStringsSize_PC_EN; - int _sequenceStringsDuration[33]; static const uint8 _seqTextColorPresets[]; @@ -878,22 +889,11 @@ protected: uint8 _seqTextColor[2]; uint8 _seqTextColorMap[16]; - const Sequence *_sequences; - - static const Sequence _sequences_PC[]; - static const Sequence _sequences_TOWNS[]; - static const NestedSequence _nSequences[]; - static const SequenceControl _wsaControlLibrary[]; - static const SequenceControl _wsaControlHand1b[]; - static const SequenceControl _wsaControlHand1c[]; - static const SequenceControl _wsaControlHand2[]; - static const SequenceControl _wsaControlHand3[]; - static const SequenceControl _wsaControlHand4[]; + Sequence * _sequences; + NestedSequence * _nSequences; }; } // end of namespace Kyra #endif - - diff --git a/engines/kyra/resource.cpp b/engines/kyra/resource.cpp index 45e3416616..57094d8e68 100644 --- a/engines/kyra/resource.cpp +++ b/engines/kyra/resource.cpp @@ -67,15 +67,16 @@ bool Resource::reset() { if (!dir.exists() || !dir.isDirectory()) error("invalid game path '%s'", dir.getPath().c_str()); - if (_vm->game() == GI_KYRA1) { - // we're loading KYRA.DAT here too (but just for Kyrandia 1) + if (_vm->game() != GI_KYRA3) { 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"; GUI::MessageDialog errorMsg(errorMessage); errorMsg.runModal(); error(errorMessage.c_str()); } + } + if (_vm->game() == GI_KYRA1) { // We only need kyra.dat for the demo. if (_vm->gameFlags().isDemo) return true; @@ -83,6 +84,16 @@ bool Resource::reset() { // only VRM file we need in the *whole* game for kyra1 if (_vm->gameFlags().isTalkie) loadPakFile("CHAPTER1.VRM"); + } else if (_vm->game() == GI_KYRA2) { + // mouse pointer, fonts, etc. required for initializing + if (_vm->gameFlags().isDemo) { + loadPakFile("GENERAL.PAK"); + } else { + loadPakFile("INTROGEN.PAK"); + loadPakFile("OTHER.PAK"); + } + + return true; } else if (_vm->game() == GI_KYRA3) { // load the installation package file for kyra3 INSFile *insFile = new INSFile("WESTWOOD.001"); @@ -106,10 +117,6 @@ bool Resource::reset() { Common::for_each(list, list + ARRAYSIZE(list), Common::bind1st(Common::mem_fun(&Resource::loadPakFile), this)); Common::for_each(_pakfiles.begin(), _pakfiles.end(), Common::bind2nd(Common::mem_fun(&ResourceFile::protect), true)); } else { - // TODO: Kyra 2 InGame uses a special pak file list shipped with the game "FILEDATA.FDT", so we just have to load - // the files needed for Kyra 2 intro here. What has to be done is, checking what files are required in the intro - // and make a list similar to that for Kyra 1 and just load the files from the list and not all pak files we find. - for (FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) { Common::String filename = file->getName(); filename.toUppercase(); @@ -199,6 +206,20 @@ bool Resource::loadFileList(const Common::String &filedata) { return true; } +bool Resource::loadFileList(const char * const *filelist, uint32 numFiles) { + if (!filelist) + return false; + + while (numFiles--) { + if (!loadPakFile(filelist[numFiles])) { + error("couldn't load file '%s'", filelist[numFiles]); + return false; + } + } + + return true; +} + void Resource::unloadPakFile(const Common::String &filename) { ResIterator pak = Common::find_if(_pakfiles.begin(), _pakfiles.end(), ResFilenameEqual(Common::hashit_lower(filename))); if (pak != _pakfiles.end()) diff --git a/engines/kyra/resource.h b/engines/kyra/resource.h index 45a3bcde0c..f6a81d3d35 100644 --- a/engines/kyra/resource.h +++ b/engines/kyra/resource.h @@ -123,6 +123,7 @@ public: bool isInPakList(const Common::String &filename) const; bool loadFileList(const Common::String &filedata); + bool loadFileList(const char * const *filelist, uint32 numFiles); // This unloads *all* pakfiles, even kyra.dat and protected ones void unloadAllPakFiles(); @@ -215,9 +216,29 @@ enum kKyraResources { kGUIStrings, kConfigStrings, - kKyra1TownsSFXTable, + kAudioTracks, + kAudioTracksIntro, + + kKyra1TownsSFXwdTable, + kKyra1TownsSFXbtTable, + kKyra1TownsCDATable, kCreditsStrings, + k2SeqplayPakFiles, + k2SeqplayCredits, + k2SeqplayStrings, + k2SeqplaySfxFiles, + k2SeqplayTlkFiles, + k2SeqplaySeqData, + k2SeqplayIntroTracks, + k2SeqplayFinaleTracks, + k2SeqplayIntroCDA, + k2SeqplayFinaleCDA, + + k2IngamePakFiles, + k2IngameTracks, + k2IngameCDA, + kMaxResIDs }; @@ -282,7 +303,9 @@ private: kRoomList, kShapeList, kRawData, - kPaletteTable + kPaletteTable, + + k2SeqData }; struct BuiltinRes { diff --git a/engines/kyra/saveload_v1.cpp b/engines/kyra/saveload_v1.cpp index 549afc46e0..3061632094 100644 --- a/engines/kyra/saveload_v1.cpp +++ b/engines/kyra/saveload_v1.cpp @@ -202,11 +202,11 @@ void KyraEngine_v1::loadGame(const char *fileName) { // In the first version when this entry was introduced, // it wasn't made sure that _curSfxFile was initialized // so if it's out of bounds we just set it to 0. - if (_curSfxFile >= (int)_soundData_TOWNS->_fileListLen || _curSfxFile < 0) - _curSfxFile = 0; - - if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) + if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) { + if (_curSfxFile >= _soundData->_fileListLen || _curSfxFile < 0) + _curSfxFile = 0; _sound->loadSoundFile(_curSfxFile); + } } _screen->_disableScreen = true; diff --git a/engines/kyra/sequences_v1.cpp b/engines/kyra/sequences_v1.cpp index 1abb2b2e89..6b4516bbd8 100644 --- a/engines/kyra/sequences_v1.cpp +++ b/engines/kyra/sequences_v1.cpp @@ -114,7 +114,7 @@ void KyraEngine_v1::seq_intro() { _seq->setCopyViewOffs(true); _screen->setFont(Screen::FID_8_FNT); if (_flags.platform != Common::kPlatformFMTowns && _flags.platform != Common::kPlatformPC98) - snd_playTheme(9, 2); + snd_playTheme(0, 2); _text->setTalkCoords(144); for (int i = 0; i < ARRAYSIZE(introProcTable) && !seq_skipSequence(); ++i) diff --git a/engines/kyra/sequences_v2.cpp b/engines/kyra/sequences_v2.cpp index 12c1d58521..2ea4cce59b 100644 --- a/engines/kyra/sequences_v2.cpp +++ b/engines/kyra/sequences_v2.cpp @@ -106,11 +106,14 @@ void KyraEngine_v2::seq_playSequences(int startSeq, int endSeq) { if (_sequences[seqNum].flags & 4) { int cp = _screen->setCurPage(2); Screen::FontId cf = _screen->setFont(Screen::FID_GOLDFONT_FNT); - int sX = (320 - _screen->getTextWidth(_sequenceStrings[_sequences[seqNum].stringIndex1])) / 2; - _screen->printText(_sequenceStrings[_sequences[seqNum].stringIndex1], sX, 100 - _screen->getFontHeight(), 1, 0); - sX = (320 - _screen->getTextWidth(_sequenceStrings[_sequences[seqNum].stringIndex2])) / 2; - _screen->printText(_sequenceStrings[_sequences[seqNum].stringIndex2], sX, 100, 1, 0); - + if (_sequences[seqNum].stringIndex1 != -1) { + int sX = (320 - _screen->getTextWidth(_sequenceStrings[_sequences[seqNum].stringIndex1])) / 2; + _screen->printText(_sequenceStrings[_sequences[seqNum].stringIndex1], sX, 100 - _screen->getFontHeight(), 1, 0); + } + if (_sequences[seqNum].stringIndex2 != -1) { + int sX = (320 - _screen->getTextWidth(_sequenceStrings[_sequences[seqNum].stringIndex2])) / 2; + _screen->printText(_sequenceStrings[_sequences[seqNum].stringIndex2], sX, 100, 1, 0); + } _screen->setFont(cf); _screen->setCurPage(cp); } @@ -205,7 +208,6 @@ void KyraEngine_v2::seq_playSequences(int startSeq, int endSeq) { uint32 tdiff = _seqEndTime - now; uint32 dly = tdiff < _tickLength ? tdiff : _tickLength; delay(dly); - //_seqEndTime -= dly; } } else { loop = loop2 = false; @@ -1494,6 +1496,9 @@ void KyraEngine_v2::seq_finaleActorScreen() { _screen->loadBitmap("finale.cps", 3, 3, _screen->_currentPalette); _screen->setFont(Screen::FID_GOLDFONT_FNT); + //int talkieCreditsSize; + //const uint8 *talkieCredits = _staticres->loadRawData(k2SeqplayCredits, talkieCreditsSize); + _sound->setSoundList(&_soundData[kMusicIngame]); _sound->loadSoundFile(3); _sound->playTrack(3); @@ -1957,8 +1962,8 @@ bool KyraEngine_v2::seq_processNextSubFrame(int wsaNum) { _activeWSA[wsaNum].movie->setY(_activeWSA[wsaNum].y); if (_activeWSA[wsaNum].flags & 0x20) { - _activeWSA[wsaNum].movie->displayFrame(_activeWSA[wsaNum].control[currentFrame].frameIndex, 0x4000); - _activeWSA[wsaNum].frameDelay = _activeWSA[wsaNum].control[currentFrame].frameDelay; + _activeWSA[wsaNum].movie->displayFrame(READ_LE_UINT16(&_activeWSA[wsaNum].control[currentFrame * 2]), 0x4000); + _activeWSA[wsaNum].frameDelay = READ_LE_UINT16(&_activeWSA[wsaNum].control[currentFrame * 2 + 1]); } else { _activeWSA[wsaNum].movie->displayFrame(currentFrame % _activeWSA[wsaNum].movie->frames(), 0x4000); } @@ -2119,18 +2124,20 @@ void KyraEngine_v2::seq_showStarcraftLogo() { _screen->copyPage(2, 0); _screen->fadeFromBlack(); for (int i = 1; i < endframe; i++) { + uint32 endTime = _system->getMillis() + 50; if (_skipFlag) break; ci->displayFrame(i, 0); _screen->copyPage(2, 0); _screen->updateScreen(); - delay(50); + delay(endTime - _system->getMillis()); } if(!_skipFlag) { + uint32 endTime = _system->getMillis() + 50; ci->displayFrame(0, 0); _screen->copyPage(2, 0); _screen->updateScreen(); - delay(50); + delay(endTime - _system->getMillis()); } _screen->fadeToBlack(); _screen->showMouse(); @@ -2146,21 +2153,8 @@ void KyraEngine_v2::seq_init() { _activeText = new ActiveText[10]; _res->unloadAllPakFiles(); - _res->loadPakFile("KYRA.DAT"); - _res->loadPakFile("AUDIO.PAK"); - _res->loadPakFile("INTROGEN.PAK"); - _res->loadPakFile("OTHER.PAK"); - _res->loadPakFile("VOC.PAK"); - if (_flags.isTalkie) { - _res->loadPakFile("TALKENG.PAK"); - _res->loadPakFile("TALKGER.PAK"); - _res->loadPakFile("TALKFRE.PAK"); - _res->loadPakFile("INTROTLK.PAK"); - } else { - _res->loadPakFile("INTROVOC.PAK"); - if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) - _res->loadPakFile("WSCORE.PAK"); - } + _res->loadPakFile(StaticResource::staticDataFilename()); + _res->loadFileList(_sequencePakList, _sequencePakListSize); } void KyraEngine_v2::seq_uninit() { @@ -2284,106 +2278,5 @@ void KyraEngine_v2::seq_makeBookAppear() { _screen->showMouse(); } -// static res -// TODO: move to staticres.cpp - -const Sequence KyraEngine_v2::_sequences_PC[] = { - // flags, wsaFile, cpsFile, startupCommand, finalCommand, stringIndex1, stringIndex2, - // startFrame, numFrames, frameDelay, xPos, yPos, callback, duration - { 2, 0, "virgin.cps", 4, 0, -1, -1, 0, 1, 100, 0, 0, 0, 30 }, - { 1, "westwood.wsa", 0, 4, 0, -1, -1, 0, 18, 6, 0, 0, &KyraEngine_v2::seq_introWestwood, 160 }, - { 1, "title.wsa", 0, 4, 0, -1, -1, 0, 26, 6, 0, 0, &KyraEngine_v2::seq_introTitle, 10 }, - { 2, 0, "over.cps", 4, 0, -1, -1, 0, 1, 3600, 0, 0, &KyraEngine_v2::seq_introOverview, 30 }, - { 2, 0, "library.cps", 4, 0, -1, -1, 0, 1, 3600, 0, 0, &KyraEngine_v2::seq_introLibrary, 30 }, - { 2, 0, "hand.cps", 4, 0, -1, -1, 0, 1, 3600, 0, 0, &KyraEngine_v2::seq_introHand, 90 }, - { 1, "point.wsa", 0, 4, 8, -1, -1, 0, 38, 7, 0, 0, &KyraEngine_v2::seq_introPoint, 200 }, - { 1, "zanfaun.wsa", 0, 4, 0, -1, -1, 0, 51, 16, 0, 0, &KyraEngine_v2::seq_introZanfaun, 240 }, - - { 1, "funters.wsa", 0, 4, 0, -1, -1, 0, 27, 12, 0, 0, &KyraEngine_v2::seq_finaleFunters, 30 }, - { 1, "ferb.wsa", 0, 4, 0, -1, -1, 0, 27, 16, 0, 0, &KyraEngine_v2::seq_finaleFerb, 30 }, - { 1, "fish.wsa", 0, 4, 0, -1, -1, 0, 56, 12, 0, 0, &KyraEngine_v2::seq_finaleFish, 30 }, - { 1, "fheep.wsa", 0, 4, 0, -1, -1, 0, 11, 12, 0, 0, &KyraEngine_v2::seq_finaleFheep, 30 }, - { 1, "farmer.wsa", 0, 4, 0, -1, -1, 0, 22, 12, 0, 0, &KyraEngine_v2::seq_finaleFarmer, 100 }, - { 1, "fuards.wsa", 0, 4, 0, -1, -1, 0, 24, 14, 0, 0, &KyraEngine_v2::seq_finaleFuards, 30 }, - { 1, "firates.wsa", 0, 4, 0, -1, -1, 0, 37, 12, 0, 0, &KyraEngine_v2::seq_finaleFirates, 30 }, - { 1, "frash.wsa", 0, 4, 0, -1, -1, 0, 12, 10, 0, 0, &KyraEngine_v2::seq_finaleFrash, 340 } -}; - -const Sequence KyraEngine_v2::_sequences_TOWNS[] = { - // flags, wsaFile, cpsFile, startupCommand, finalCommand, stringIndex1, stringIndex2, - // startFrame, numFrames, frameDelay, xPos, yPos, callback, duration - { 2, 0, "virgin.cps", 4, 0, -1, -1, 0, 1, 100, 0, 0, 0, 30 }, - { 1, "westwood.wsa", 0, 4, 0, -1, -1, 0, 18, 12, 0, 0, &KyraEngine_v2::seq_introWestwood, 160 }, - { 1, "title.wsa", 0, 4, 0, -1, -1, 0, 26, 12, 0, 0, &KyraEngine_v2::seq_introTitle, 10 }, - { 2, 0, "over.cps", 4, 0, -1, -1, 0, 1, 3600, 0, 0, &KyraEngine_v2::seq_introOverview, 30 }, - { 2, 0, "library.cps", 4, 0, -1, -1, 0, 1, 3600, 0, 0, &KyraEngine_v2::seq_introLibrary, 30 }, - { 2, 0, "hand.cps", 4, 0, -1, -1, 0, 1, 3600, 0, 0, &KyraEngine_v2::seq_introHand, 90 }, - { 1, "point.wsa", 0, 4, 8, -1, -1, 0, 38, 7, 0, 0, &KyraEngine_v2::seq_introPoint, 200 }, - { 1, "zanfaun.wsa", 0, 4, 0, -1, -1, 0, 51, 16, 0, 0, &KyraEngine_v2::seq_introZanfaun, 240 }, - - { 1, "funters.wsa", 0, 4, 0, -1, -1, 0, 27, 12, 0, 0, &KyraEngine_v2::seq_finaleFunters, 30 }, - { 1, "ferb.wsa", 0, 4, 0, -1, -1, 0, 27, 16, 0, 0, &KyraEngine_v2::seq_finaleFerb, 30 }, - { 1, "fish.wsa", 0, 4, 0, -1, -1, 0, 56, 12, 0, 0, &KyraEngine_v2::seq_finaleFish, 30 }, - { 1, "fheep.wsa", 0, 4, 0, -1, -1, 0, 11, 12, 0, 0, &KyraEngine_v2::seq_finaleFheep, 30 }, - { 1, "farmer.wsa", 0, 4, 0, -1, -1, 0, 22, 12, 0, 0, &KyraEngine_v2::seq_finaleFarmer, 100 }, - { 1, "fuards.wsa", 0, 4, 0, -1, -1, 0, 24, 14, 0, 0, &KyraEngine_v2::seq_finaleFuards, 30 }, - { 1, "firates.wsa", 0, 4, 0, -1, -1, 0, 37, 12, 0, 0, &KyraEngine_v2::seq_finaleFirates, 30 }, - { 1, "frash.wsa", 0, 4, 0, -1, -1, 0, 12, 10, 0, 0, &KyraEngine_v2::seq_finaleFrash, 340 } -}; - -const NestedSequence KyraEngine_v2::_nSequences[] = { - // flags, wsaFile, startframe, endFrame, frameDelay, callback, x, y, wsaControl, startupCommand, finalCommand, unk1; - { 0x0C, "figgle.wsa", 0, 3, 60, &KyraEngine_v2::seq_finaleFiggle, 0, 0, 0, 0, 0, 0 }, - - { 8, "over1.wsa", 0, 10, 10, &KyraEngine_v2::seq_introOver1, 0, 0, 0, 0, 0, 0 }, - { 8, "over2.wsa", 0, 11, 9, &KyraEngine_v2::seq_introOver2, 0, 0, 0, 0, 0, 0 }, - { 8, "forest.wsa", 0, 22, 6, &KyraEngine_v2::seq_introForest, 0, 0, 0, 1, 3, 0 }, - { 8, "dragon.wsa", 0, 11, 6, &KyraEngine_v2::seq_introDragon, 0, 0, 0, 2, 0, 0 }, - { 2, "darm.wsa", 0, 19, 9, &KyraEngine_v2::seq_introDarm, 0, 0, 0, 4, 0, 0 }, - { 2, "library.wsa", 0, 33, 9, &KyraEngine_v2::seq_introLibrary2, 0, 0, 0, 4, 0, 0 }, - { 0x2A, "library.wsa", 0, 19, 9, &KyraEngine_v2::seq_introLibrary2, 0, 0, _wsaControlLibrary, 0, 0, 0 }, - { 0x0A, "marco.wsa", 0, 37, 9, &KyraEngine_v2::seq_introMarco, 0, 0, 0, 4, 0, 0 }, - { 2, "hand1a.wsa", 0, 34, 9, &KyraEngine_v2::seq_introHand1a, 0, 0, 0, 0, 0, 0 }, - { 0x2A, "hand1b.wsa", 0, 16, 9, &KyraEngine_v2::seq_introHand1b, 0, 0, _wsaControlHand1b, 0, 0, 0 }, - { 0x2A, "hand1c.wsa", 0, 9, 9, &KyraEngine_v2::seq_introHand1c, 0, 0, _wsaControlHand1c, 0, 0, 0 }, - { 0x2C, "hand2.wsa", 0, 2, 9, &KyraEngine_v2::seq_introHand2, 0, 0, _wsaControlHand2, 5, 0, 0 }, - { 0x2C, "hand3.wsa", 0, 4, 9, &KyraEngine_v2::seq_introHand3, 0, 0, _wsaControlHand3, 5, 0, 0 }, - { 0x2C, "hand4.wsa", 0, 8, 9, 0, 0, 0, _wsaControlHand4, 5, 0, 0 } -}; - - -const SequenceControl KyraEngine_v2::_wsaControlLibrary[] = { - {0x00, 0x0A}, {0x01, 0x0A}, {0x02, 0x0A}, {0x03, 0x0A}, {0x04, 0x0A}, {0x05, 0x0A}, - {0x06, 0x0A}, {0x07, 0x0A}, {0x08, 0x0A}, {0x09, 0x0A}, {0x08, 0x0A}, {0x07, 0x0A}, - {0x06, 0x0A}, {0x05, 0x28}, {0x04, 0x0A}, {0x03, 0x0A}, {0x02, 0x0A}, {0x01, 0x0A} -}; - -const SequenceControl KyraEngine_v2::_wsaControlHand1b[] = { - {0x00, 0x06}, {0x01, 0x06}, {0x02, 0x06}, {0x03, 0x06}, {0x04, 0x06}, {0x05, 0x06}, - {0x06, 0x06}, {0x07, 0x06}, {0x08, 0x06}, {0x09, 0x06}, {0x0A, 0x06}, {0x0B, 0x06}, - {0x0B, 0x0C}, {0x0C, 0x0C}, {0x0D, 0x0C}, {0x0C, 0x0C}, {0x0B, 0x0C} -}; - -const SequenceControl KyraEngine_v2::_wsaControlHand1c[] = { - {0x00, 0x06}, {0x01, 0x06}, {0x02, 0x06}, {0x03, 0x06}, {0x04, 0x06}, {0x03, 0x06}, - {0x04, 0x06}, {0x05, 0x40}, {0x05, 0x06} -}; - -const SequenceControl KyraEngine_v2::_wsaControlHand2[] = { - {0x00, 0x06}, {0x01, 0x06}, {0x00, 0x06}, {0x01, 0x06}, {0x00, 0x06}, {0x01, 0x06}, - {0x00, 0x06}, {0x01, 0x06}, {0x00, 0x06}, {0x01, 0x06}, {0x00, 0x06}, {0x01, 0x06}, - {0x00, 0x06}, {0x01, 0x06}, {0x00, 0x06}, {0x01, 0x06} -}; - -const SequenceControl KyraEngine_v2::_wsaControlHand3[] = { - {0x00, 0x06}, {0x01, 0x06}, {0x02, 0x06}, {0x01, 0x06}, {0x00, 0x01} -}; - -const SequenceControl KyraEngine_v2::_wsaControlHand4[] = { - {0x00, 0x06}, {0x01, 0x06}, {0x02, 0x06}, {0x03, 0x06}, {0x04, 0x06}, - {0x03, 0x06}, {0x02, 0x06}, {0x01, 0x06} -}; - } // end of namespace Kyra - diff --git a/engines/kyra/sound.h b/engines/kyra/sound.h index aef3afea3a..573c0b3109 100644 --- a/engines/kyra/sound.h +++ b/engines/kyra/sound.h @@ -176,9 +176,9 @@ public: void voiceStop(); protected: - const char *fileListEntry(uint file) const { return (file < _soundDataList->_fileListLen) ? _soundDataList->_fileList[file] : ""; } + const char *fileListEntry(int file) const { return (file < _soundDataList->_fileListLen) ? _soundDataList->_fileList[file] : ""; } const void *cdaData() const { return _soundDataList->_cdaTracks; } - const uint32 cdaTrackNum() const { return _soundDataList->_cdaNumTracks; } + const int cdaTrackNum() const { return _soundDataList->_cdaNumTracks; } int _musicEnabled; bool _sfxEnabled; @@ -397,7 +397,7 @@ private: Common::Mutex _mutex; - static const uint8 _sfxBTTable[256]; + const uint8 *_sfxBTTable; const uint8 *_sfxWDTable; }; diff --git a/engines/kyra/sound_towns.cpp b/engines/kyra/sound_towns.cpp index 7315672130..ae9f3a7915 100644 --- a/engines/kyra/sound_towns.cpp +++ b/engines/kyra/sound_towns.cpp @@ -1086,7 +1086,7 @@ void SoundTowns_EuphonyTrackQueue::initDriver() { SoundTowns::SoundTowns(KyraEngine *vm, Audio::Mixer *mixer) : Sound(vm, mixer), _lastTrack(-1), _currentSFX(0), _sfxFileData(0), - _sfxFileIndex((uint)-1), _sfxWDTable(0), _parser(0) { + _sfxFileIndex((uint)-1), _sfxWDTable(0), _sfxBTTable(0), _parser(0) { _driver = new SoundTowns_EuphonyDriver(_mixer); int ret = open(); @@ -1109,7 +1109,8 @@ SoundTowns::~SoundTowns() { bool SoundTowns::init() { _vm->checkCD(); int unused = 0; - _sfxWDTable = _vm->staticres()->loadRawData(kKyra1TownsSFXTable, unused); + _sfxWDTable = _vm->staticres()->loadRawData(kKyra1TownsSFXwdTable, unused); + _sfxBTTable = _vm->staticres()->loadRawData(kKyra1TownsSFXbtTable, unused); return loadInstruments(); } @@ -1126,8 +1127,8 @@ void SoundTowns::playTrack(uint8 track) { const int32 * const tTable = (const int32 * const) cdaData(); int tTableIndex = 3 * track; - int trackNum = tTable[tTableIndex + 2]; - int32 loop = tTable[tTableIndex + 1]; + int trackNum = (int) READ_LE_UINT32(&tTable[tTableIndex + 2]); + int32 loop = (int32) READ_LE_UINT32(&tTable[tTableIndex + 1]); if (track == _lastTrack && _musicEnabled) return; @@ -1138,7 +1139,7 @@ void SoundTowns::playTrack(uint8 track) { AudioCD.play(trackNum+1, loop ? -1 : 1, 0, 0); AudioCD.updateCD(); } else if (_musicEnabled) { - playEuphonyTrack((uint32) tTable[tTableIndex], loop); + playEuphonyTrack(READ_LE_UINT32(&tTable[tTableIndex]), loop); } _lastTrack = track; @@ -1355,25 +1356,6 @@ float SoundTowns::semitoneAndSampleRate_to_sampleStep(int8 semiTone, int8 semiTo return (float) sampleRate * 10.0f * rateshift / outputRate; } -const uint8 SoundTowns::_sfxBTTable[256] = { - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F, - 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, - 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF, - 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, - 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF, - 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, - 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFE, - 0x7F, 0x7F, 0x7E, 0x7D, 0x7C, 0x7B, 0x7A, 0x79, 0x78, 0x77, 0x76, 0x75, 0x74, 0x73, 0x72, 0x71, - 0x70, 0x6F, 0x6E, 0x6D, 0x6C, 0x6B, 0x6A, 0x69, 0x68, 0x67, 0x66, 0x65, 0x64, 0x63, 0x62, 0x61, - 0x60, 0x5F, 0x5E, 0x5D, 0x5C, 0x5B, 0x5A, 0x59, 0x58, 0x57, 0x56, 0x55, 0x54, 0x53, 0x52, 0x51, - 0x50, 0x4F, 0x4E, 0x4D, 0x4C, 0x4B, 0x4A, 0x49, 0x48, 0x47, 0x46, 0x45, 0x44, 0x43, 0x42, 0x41, - 0x40, 0x3F, 0x3E, 0x3D, 0x3C, 0x3B, 0x3A, 0x39, 0x38, 0x37, 0x36, 0x35, 0x34, 0x33, 0x32, 0x31, - 0x30, 0x2F, 0x2E, 0x2D, 0x2C, 0x2B, 0x2A, 0x29, 0x28, 0x27, 0x26, 0x25, 0x24, 0x23, 0x22, 0x21, - 0x20, 0x1F, 0x1E, 0x1D, 0x1C, 0x1B, 0x1A, 0x19, 0x18, 0x17, 0x16, 0x15, 0x14, 0x13, 0x12, 0x11, - 0x10, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01 -}; - // KYRA 2 SoundTowns_v2::SoundTowns_v2(KyraEngine *vm, Audio::Mixer *mixer) @@ -1413,12 +1395,12 @@ void SoundTowns_v2::playTrack(uint8 track) { if (track == _lastTrack && _musicEnabled) return; - const uint8 * const cdaTracks = (const uint8 * const) cdaData(); + const uint16 * const cdaTracks = (const uint16 * const) cdaData(); int trackNum = -1; - for (uint32 i = 0; i < cdaTrackNum(); i++) { - if (track == cdaTracks[i * 2]) { - trackNum = cdaTracks[i * 2 + 1] - 1; + for (int i = 0; i < cdaTrackNum(); i++) { + if (track == (uint8) READ_LE_UINT16(&cdaTracks[i * 2])) { + trackNum = (int) READ_LE_UINT16(&cdaTracks[i * 2 + 1]) - 1; break; } } diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp index 0c06bd4035..d28fc573f7 100644 --- a/engines/kyra/staticres.cpp +++ b/engines/kyra/staticres.cpp @@ -35,7 +35,7 @@ namespace Kyra { -#define RESFILE_VERSION 17 +#define RESFILE_VERSION 18 bool StaticResource::checkKyraDat() { Common::File kyraDat; @@ -211,17 +211,47 @@ bool StaticResource::init() { // PALETTE table { kPaletteList, kPaletteTable, "1 33 PALTABLE" }, + // AUDIO files + { kAudioTracks, kStringList, "TRACKS.TXT" }, + { kAudioTracksIntro, kStringList, "TRACKSINT.TXT" }, + // FM-TOWNS specific - { kKyra1TownsSFXTable, kRawData, "SFXTABLE" }, + { kKyra1TownsSFXwdTable, kRawData, "SFXWDTABLE" }, + { kKyra1TownsSFXbtTable, kRawData, "SFXBTTABLE" }, + { kKyra1TownsCDATable, kRawData, "CDATABLE" }, { kCreditsStrings, kRawData, "CREDITS" }, { 0, 0, 0 } }; + static const FilenameTable kyra2StaticRes[] = { + // Sequence Player + { k2SeqplayPakFiles, kStringList, "S_PAKFILES.TXT" }, + { k2SeqplayCredits, kRawData, "S_CREDITS.TXT" }, + { k2SeqplayStrings, kLanguageList, "S_STRINGS." }, + { k2SeqplaySfxFiles, kStringList, "S_SFXFILES.TXT" }, + { k2SeqplayTlkFiles, kLanguageList, "S_TLKFILES." }, + { k2SeqplaySeqData, kRawData, "S_DATA.SEQ" }, + { k2SeqplayIntroTracks, kStringList, "S_INTRO.TRA" }, + { k2SeqplayFinaleTracks, kStringList, "S_FINALE.TRA" }, + { k2SeqplayIntroCDA, kRawData, "S_INTRO.CDA" }, + { k2SeqplayFinaleCDA, kRawData, "S_FINALE.CDA" }, + + // Ingame + { k2IngamePakFiles, kStringList, "I_PAKFILES.TXT" }, + { k2IngameTracks, kStringList, "I_TRACKS.TRA" }, + { k2IngameCDA, kRawData, "I_TRACKS.CDA" }, + + { 0, 0, 0 } + }; + if (_vm->game() == GI_KYRA1) { _builtIn = 0; _filenameTable = kyra1StaticRes; - } else if (_vm->game() == GI_KYRA2 || _vm->game() == GI_KYRA3) { + } else if (_vm->game() == GI_KYRA2) { + _builtIn = 0; + _filenameTable = kyra2StaticRes; + } else if (_vm->game() == GI_KYRA3) { return true; } else { error("unknown game ID"); @@ -601,6 +631,11 @@ void StaticResource::freePaletteTable(void *&ptr, int &size) { uint8 *StaticResource::getFile(const char *name, int &size) { char buffer[64]; const char *ext = ""; + if (_vm->gameFlags().gameID == GI_KYRA2) + ext = ".K2"; + snprintf(buffer, 64, "%s%s", name, ext); + ext = ""; + if (_vm->gameFlags().isTalkie) ext = ".CD"; else if (_vm->gameFlags().isDemo) @@ -609,7 +644,7 @@ uint8 *StaticResource::getFile(const char *name, int &size) { ext = ".TNS"; else if (_vm->gameFlags().platform == Common::kPlatformAmiga) ext = ".AMG"; - snprintf(buffer, 64, "%s%s", name, ext); + strcat(buffer, ext); uint32 tempSize = 0; uint8 *data = _vm->resource()->fileData(buffer, &tempSize); size = tempSize; @@ -680,6 +715,10 @@ void KyraEngine_v1::initStaticResource() { _guiStrings = _staticres->loadStrings(kGUIStrings, _guiStringsSize); _configStrings = _staticres->loadStrings(kConfigStrings, _configStringsSize); + _soundFiles = _staticres->loadStrings(kAudioTracks, _soundFilesSize); + _soundFilesIntro = _staticres->loadStrings(kAudioTracksIntro, _soundFilesIntroSize); + _cdaTrackTable = (const int32*) _staticres->loadRawData(kKyra1TownsCDATable, _cdaTrackTableSize); + // copied static res // room list @@ -707,6 +746,20 @@ void KyraEngine_v1::initStaticResource() { _staticres->unloadId(kDefaultShapes); } + + // audio data tables + static const AudioDataStruct soundData_PC[] = { + { _soundFilesIntro, _soundFilesIntroSize, 0, 0 }, + { _soundFiles, _soundFilesSize, 0, 0 }, + { 0, 0, 0, 0} + }; + + static const AudioDataStruct soundData_TOWNS[] = { + { _soundFiles, _soundFilesSize, _cdaTrackTable, _cdaTrackTableSize }, + { _soundFiles, _soundFilesSize, _cdaTrackTable, _cdaTrackTableSize }, + { 0, 0, 0, 0} + }; + _soundData = (_flags.platform == Common::kPlatformPC) ? soundData_PC : soundData_TOWNS; } void KyraEngine_v1::loadMouseShapes() { @@ -854,6 +907,160 @@ void KyraEngine_v1::loadMainScreen(int page) { _screen->copyRegion(0, 0, 0, 0, 320, 200, page, 0); } +void KyraEngine_v2::initStaticResource() { + int tmp = 0; + + _sequencePakList = _staticres->loadStrings(k2SeqplayPakFiles, _sequencePakListSize); + _ingamePakList = _staticres->loadStrings(k2IngamePakFiles, _ingamePakListSize); + _sequenceStrings = _staticres->loadStrings(k2SeqplayStrings, _sequenceStringsSize); + _sequenceSoundList = _staticres->loadStrings(k2SeqplaySfxFiles, _sequenceSoundListSize); + _musicFileListIntro = _staticres->loadStrings(k2SeqplayIntroTracks, _musicFileListIntroSize); + _musicFileListIngame = _staticres->loadStrings(k2IngameTracks, _musicFileListIngameSize); + _musicFileListFinale = _staticres->loadStrings(k2SeqplayFinaleTracks, _musicFileListFinaleSize); + _cdaTrackTableIntro = _staticres->loadRawData(k2SeqplayIntroCDA, _cdaTrackTableIntroSize); + _cdaTrackTableIngame = _staticres->loadRawData(k2IngameCDA, _cdaTrackTableIngameSize); + _cdaTrackTableFinale = _staticres->loadRawData(k2SeqplayFinaleCDA, _cdaTrackTableFinaleSize); + + // replace sequence talkie files with localized versions and cut off .voc + // suffix from voc files so as to allow compression specific file extensions + // + // FIXME/HACK: this alltogether looks like quite a hack, we should think of making a copy + // of _sequenceSoundList instead of casting away const. + const char* const* tlkfiles = _staticres->loadStrings(k2SeqplayTlkFiles, tmp); + for (int i = 0; i < _sequenceSoundListSize; i++) { + uint32 len = strlen(_sequenceSoundList[i]); + if (_flags.platform == Common::kPlatformPC) + len -= 4; + + if (tlkfiles) { + for (int ii = 0; ii < tmp; ii++) { + if (!scumm_stricmp(&_sequenceSoundList[i][1], &tlkfiles[ii][1])) + strcpy(const_cast<char*>(_sequenceSoundList[i]), tlkfiles[ii]); + } + } + + const_cast<char*>(_sequenceSoundList[i])[len] = 0; + } + tlkfiles = 0; + _staticres->unloadId(k2SeqplayTlkFiles); + + // assign music data + static const char *fmtMusicFileListIntro[] = { "intro" }; + static const char *fmtMusicFileListFinale[] = { "finale" }; + static const char *fmtMusicFileListIngame[] = { "k2" }; + + static const AudioDataStruct soundData_PC[] = { + { _musicFileListIntro, _musicFileListIntroSize, 0, 0 }, + { _musicFileListIngame, _musicFileListIngameSize, 0, 0}, + { _musicFileListFinale, _musicFileListIntroSize, 0, 0 } + }; + + static const AudioDataStruct soundData_TOWNS[] = { + { fmtMusicFileListIntro, 1, _cdaTrackTableIntro, _cdaTrackTableIntroSize >> 1 }, + { fmtMusicFileListIngame, 1, _cdaTrackTableIngame, _cdaTrackTableIngameSize >> 1 }, + { fmtMusicFileListFinale, 1, _cdaTrackTableFinale, _cdaTrackTableFinaleSize >> 1 } + }; + _soundData = (_flags.platform == Common::kPlatformPC) ? soundData_PC : soundData_TOWNS; + + // setup sequence data + const uint8 *seqData = _staticres->loadRawData(k2SeqplaySeqData, tmp); + + static const Seqproc hofSequenceCallbacks[] = { 0, + &KyraEngine_v2::seq_introWestwood, + &KyraEngine_v2::seq_introTitle, &KyraEngine_v2::seq_introOverview, + &KyraEngine_v2::seq_introLibrary, &KyraEngine_v2::seq_introHand, + &KyraEngine_v2::seq_introPoint, &KyraEngine_v2::seq_introZanfaun, + &KyraEngine_v2::seq_finaleFunters, &KyraEngine_v2::seq_finaleFerb, + &KyraEngine_v2::seq_finaleFish, &KyraEngine_v2::seq_finaleFheep, + &KyraEngine_v2::seq_finaleFarmer, &KyraEngine_v2::seq_finaleFuards, + &KyraEngine_v2::seq_finaleFirates, &KyraEngine_v2::seq_finaleFrash + }; + + static const Seqproc hofNestedSequenceCallbacks[] = { + &KyraEngine_v2::seq_finaleFiggle, &KyraEngine_v2::seq_introOver1, + &KyraEngine_v2::seq_introOver2, &KyraEngine_v2::seq_introForest, + &KyraEngine_v2::seq_introDragon, &KyraEngine_v2::seq_introDarm, + &KyraEngine_v2::seq_introLibrary2, &KyraEngine_v2::seq_introLibrary2, + &KyraEngine_v2::seq_introMarco, &KyraEngine_v2::seq_introHand1a, + &KyraEngine_v2::seq_introHand1b, &KyraEngine_v2::seq_introHand1c, + &KyraEngine_v2::seq_introHand2, &KyraEngine_v2::seq_introHand3, 0 + }; + + /*static const Seqproc hofDemoSequenceCallbacks[] = { + 0 // XXX + }; + + static const Seqproc hofDemoNestedSequenceCallbacks[] = { + 0 // XXX + };*/ + + uint16 *hdr = (uint16*) seqData; + uint16 numSeq = READ_LE_UINT16(hdr++); + uint16 hdrSize = READ_LE_UINT16(hdr) - 1; + + const Seqproc *cb = hofSequenceCallbacks; + const Seqproc *ncb = hofNestedSequenceCallbacks; + + _sequences = new Sequence[numSeq]; + for (int i = 0; i < numSeq; i++) { + const uint8 *offset = (const uint8 *)(seqData + READ_LE_UINT16(hdr++)); + _sequences[i].flags = READ_LE_UINT16(offset); + offset += 2; + _sequences[i].wsaFile = (const char *)offset; + offset += 14; + _sequences[i].cpsFile = (const char *)offset; + offset += 14; + _sequences[i].startupCommand = *offset++; + _sequences[i].finalCommand = *offset++; + _sequences[i].stringIndex1 = READ_LE_UINT16(offset); + offset += 2; + _sequences[i].stringIndex2 = READ_LE_UINT16(offset); + offset += 2; + _sequences[i].startFrame = READ_LE_UINT16(offset); + offset += 2; + _sequences[i].numFrames = READ_LE_UINT16(offset); + offset += 2; + _sequences[i].frameDelay = READ_LE_UINT16(offset); + offset += 2; + _sequences[i].xPos = READ_LE_UINT16(offset); + offset += 2; + _sequences[i].yPos = READ_LE_UINT16(offset); + offset += 2; + _sequences[i].duration = READ_LE_UINT16(offset); + _sequences[i].callback = cb[i]; + } + + if (hdr > ((uint16*)(seqData + hdrSize))) + return; + + numSeq = READ_LE_UINT16(hdr++); + _nSequences = new NestedSequence[numSeq]; + for (int i = 0; i < numSeq; i++) { + const uint8 *offset = (const uint8 *)(seqData + READ_LE_UINT16(hdr++)); + _nSequences[i].flags = READ_LE_UINT16(offset); + offset += 2; + _nSequences[i].wsaFile = (const char *)offset; + offset += 14; + _nSequences[i].startframe = READ_LE_UINT16(offset); + offset += 2; + _nSequences[i].endFrame = READ_LE_UINT16(offset); + offset += 2; + _nSequences[i].frameDelay = READ_LE_UINT16(offset); + offset += 2; + _nSequences[i].x = READ_LE_UINT16(offset); + offset += 2; + _nSequences[i].y = READ_LE_UINT16(offset); + offset += 2; + uint16 ctrlOffs = READ_LE_UINT16(offset); + offset += 2; + _nSequences[i].startupCommand = READ_LE_UINT16(offset); + offset += 2; + _nSequences[i].finalCommand = READ_LE_UINT16(offset); + _nSequences[i].callback = ncb[i]; + _nSequences[i].wsaControl = ctrlOffs ? (uint16*) (seqData + ctrlOffs) : 0; + } +} + const ScreenDim Screen::_screenDimTable[] = { { 0x00, 0x00, 0x28, 0xC8, 0x0F, 0x0C, 0x00, 0x00 }, { 0x08, 0x48, 0x18, 0x38, 0x0F, 0x0C, 0x00, 0x00 }, @@ -904,60 +1111,6 @@ const int8 KyraEngine::_addYPosTable[] = { 0, -2, -2, -2, 0, 2, 2, 2 }; -const char *KyraEngine_v1::_soundFiles[] = { - "KYRA1A", - "KYRA1B", - "KYRA2A", - "KYRA3A", - "KYRA4A", - "KYRA4B", - "KYRA5A", - "KYRA5B", - "KYRAMISC", - "INTRO" -}; - -const char *KyraEngine_v1::_soundFilesTowns[] = { - "TW_INTRO.SFX", - "TW_SCEN1.SFX", - "TW_SCEN2.SFX", - "TW_SCEN3.SFX", - "TW_SCEN4.SFX", - "TW_SCEN5.SFX" -}; - -const int32 KyraEngine_v1::_cdaTrackTable[] = { - 0x04000, 1, 0, 0x05480, 1, 6, 0x05E70, 0, 1, - 0x06D90, 1, 3, 0x072C0, 0, -1, 0x075F0, 1, -1, - 0x07880, 1, -1, 0x089C0, 0, -1, 0x09080, 0, -1, - 0x091D0, 1, 4, 0x0A880, 1, 5, 0x0AF50, 0, -1, - 0x0B1A0, 1, -1, 0x0B870, 0, -1, 0x0BCF0, 1, -1, - 0x0C5D0, 1, 7, 0x0D3E0, 1, 8, 0x0e7b0, 1, 2, - 0x0edc0, 0, -1, 0x0eef0, 1, 9, 0x10540, 1, 10, - 0x10d80, 0, -1, 0x10E30, 0, -1, 0x10FC0, 0, -1, - 0x11310, 1, -1, 0x11A20, 1, -1, 0x12380, 0, -1, - 0x12540, 1, -1, 0x12730, 1, -1, 0x12A90, 1, 11, - 0x134D0, 0, -1, 0x00000, 0, -1, 0x13770, 0, -1, - 0x00000, 0, -1, 0x00000, 0, -1, 0x00000, 0, -1, - 0x00000, 0, -1, 0x14710, 1, 12, 0x15DF0, 1, 13, - 0x16030, 1, 14, 0x17030, 0, -1, 0x17650, 0, -1, - 0x134D0, 0, -1, 0x178E0, 1, -1, 0x18200, 0, -1, - 0x18320, 0, -1, 0x184A0, 0, -1, 0x18BB0, 0, -1, - 0x19040, 0, 19, 0x19B50, 0, 20, 0x17650, 0, -1, - 0x1A730, 1, 21, 0x00000, 0, -1, 0x12380, 0, -1, - 0x1B810, 0, -1, 0x1BA50, 0, 15, 0x1C190, 0, 16, - 0x1CA50, 0, 17, 0x1D100, 0, 18 -}; - -const AudioDataStruct KyraEngine_v1::_soundData_PC[] = { - { _soundFiles, ARRAYSIZE(_soundFiles), 0, 0 }, - { 0, 0, 0, 0} -}; - -const AudioDataStruct KyraEngine_v1::_soundData_TOWNS[] = { - { _soundFilesTowns, ARRAYSIZE(_soundFilesTowns), _cdaTrackTable, ARRAYSIZE(_cdaTrackTable) }, - { 0, 0, 0, 0} -}; const int8 KyraEngine_v1::_charXPosTable[] = { 0, 4, 4, 4, 0, -4, -4, -4 }; @@ -1182,355 +1335,6 @@ const char *KyraEngine_v2::_mainMenuStrings[] = { // kyra 2 static res -const char *KyraEngine_v2::_sequenceStrings_PC_EN[] = { - "Kyrandia is disappearing!", - "Rock by rock...", - "...and tree by tree.", - "Kyrandia ceases to exist!", - "The Royal Mystics are baffled.", - "Every reference has been consulted.", - "Even Marko and his new valet have been allowed into the conference.", - "Luckily, the Hand was experienced in these matters.", - "And finally a plan was approved...", - "...that required a magic Anchor Stone...", - "...to be retrieved from the center of the world.", - "Zanthia, youngest of the Kyrandian Mystics, has been selected to retrieve the Stone.", - "Thank you for playing The Hand of Fate.", - "This should be enough blueberries to open a portal to the center of the world.", - " DUMMY STRING... ", - " DUMMY STRING... ", - "Hey! All my equipment has been stolen!", - " DUMMY STRING... ", - "If they think I'm going to walk all the way down there, they're nuts!", - " DUMMY STRING... ", - " DUMMY STRING... ", - "Hurry up Faun!", - - "Boy, that was a close call!", - "You said it pal. I, for one, am never going hunting again!", - "Ribbit.", - "How many times do I have to tell you? You're a toad.", - "Oh no! We're out of cheese!", - "Let's try this earwax. It's orange.", - "Mommy, when do I get the ivy?", - "Get out of here, shoo!", - "You cut, and I'll choose.", - "No. You cut and I'll choose.", - "I still say it was derivative drivel.", - "Aw, you still wouldn't recognize iambic pentameter if it bit you on the butt!", - - "Executive Producer", - "Brett W. Sperry", - "Direction & Design", - "Rick Gush", - "Lead Programmer", - "Michael Legg", - "Art Management", - "Louis Castle", - "Joseph B. Hewitt IV", - "Lead Artist", - "Rick Parks", - "Additional Coding by", - "Philip W. Gorrow", - "Mike Grayford", - "Mark McCubbin", - "Artists", - "Cameron Chun", - "Cary Averett", - "Cindy Chinn", - "Elie Arabian", - "Fei Cheng", - "Ferby Miguel", - "Frank Mendeola", - "Jack Martin", - "Jerry Moore", - "DUMMY STRING... ", - "Judith Peterson", - "Larry Miller", - "Lenny Lee", - "Louise Sandoval", - "Ren Olsen", - "Music & Sounds by", - "Paul Mudra", - "Frank Klepacki", - "Dwight Okahara", - "Pat Collins", - "Quality Assurance by", - "Glenn Sperry", - "Michael Lightner", - "William Foster", - "Jesse Clemit", - "Jeff Fillhaber", - "Manual, Package Design", - "& Fulfillment", - "Eydie Laramore", - "Lisa Marcinko", - "Lauren Rifkin", - "Congratulations!", - "Thank you for playing The Hand of Fate!", - "Guest Coding", - "Producer Liaison", - "Scott Duckett", - "Irvine Testers", - "Chris McFarland", - "Paul Moore", - "Chad Soares", - "Jared Brinkley", - "Jon Willliams", - "Chris Toft", - "Joe Kucan's Hair by", - "Theodore A. Morris", - "Load a game", - "Introduction", - "Start a new game", - "Exit the game", - "Special Thanks, to", - "Sake Joe Bostic-san", - "Tim Fritz", - "Kenny Dunne", - "Thank you for playing \"The Hand of Fate\"." -}; - -const char *KyraEngine_v2::_sequenceStrings_TOWNS_EN[] = { - "Kyrandia is disappearing!", - "Rock by rock...", - "...and tree by tree.", - "Kyrandia ceases to exist!", - "The Royal Mystics are baffled.", - "Every reference has been consulted.", - "Even Marko and his new valet have been allowed into the conference.", - "Luckily, the Hand was experienced in these matters.", - "And finally a plan was approved...", - "...that required a magic Anchor Stone...", - "...to be retrieved from the center of the world.", - "Zanthia, youngest of the Kyrandian Mystics, has been selected to retrieve the Stone.", - "Thank you for playing The Hand of Fate.", - "This should be enough blueberries to open a portal to the center of the world.", - " DUMMY STRING... ", - " DUMMY STRING... ", - "Hey! All my equipment has been stolen!", - " DUMMY STRING... ", - "If they think I'm going to walk all the way down there, they're nuts!", - " DUMMY STRING... ", - " DUMMY STRING... ", - "Hurry up Faun!", - - "Boy, that was a close call!", - "You said it pal. I, for one, am never going hunting again!", - "Ribbit.", - "How many times do I have to tell you? You're a toad.", - "Oh no! We're out of cheese!", - "Let's try this earwax. It's orange.", - "Mommy, when do I get the ivy?", - "Get out of here, shoo!", - "You cut, and I'll choose.", - "No. You cut and I'll choose.", - "I still say it was derivative drivel.", - "Aw, you still wouldn't recognize iambic pentameter if it bit you on the butt!", - - "Executive Producer", - "Brett W. Sperry", - "Designed & Directed by", - "Rick Gush", - "Lead Programmer", - "Michael Legg", - "Art Management", - "Louis Castle", - "Joseph B. Hewitt IV", - "Lead Artist", - "Rick Parks", - "Additional Coding by", - "Philip W. Gorrow", - "Matt Collins", - "Mark McCubbin", - "Artists", - "Cameron Chun", - "Cary Averett", - "Cindy Chinn", - "Elie Arabian", - "Fei Cheng", - "Ferby Miguel", - "Frank Mendeola", - "Jack Martin", - "Jerry Moore", - "", - "Judith Peterson", - "Larry Miller", - "Lenny Lee", - "Louise Sandoval", - "Ren Olsen", - "Music & Sounds by", - "Paul Mudra", - "Frank Klepacki", - "Dwight Okahara", - "Pat Collins", - "Qualilty Assurance by", - "Glenn Sperry", - "Michael Lightner", - "William Foster", - "Jesse Clemit", - "Jeff Fillhaber", - "Manual, Package Design", - "& Fulfillment", - "Eydie Laramore", - "Lisa Marcinko", - "Lauren Rifkin", - "Congratulations!", - "Thank you for playing The Hand of Fate!", - "Guest Coding", - "Producer Liaison", - "Scott Duckett", - "Irvine Testers", - "Chris McFarland", - "Paul Moore", - "Chad Soares", - "Jared Brinkley", - "Jon Willliams", - "Chris Toft", - "Chris's Hair by", - "Cumulo Nimbus", - "Load a game", - "Introduction", - "Start a new game", - "Exit the game", - "Special Thanks to", - "Sake Joe Bostic-san", - "Tim Fritz", - "Kenny Dunne", - "Yukio Sekiguchi (Japan)", - "Takeshi Abo (Japan)" -}; - -const int KyraEngine_v2::_sequenceStringsSize_PC_EN = ARRAYSIZE(KyraEngine_v2::_sequenceStrings_PC_EN); -const int KyraEngine_v2::_sequenceStringsSize_TOWNS_EN = ARRAYSIZE(KyraEngine_v2::_sequenceStrings_TOWNS_EN); - -const char *KyraEngine_v2::_sequenceSoundList_PC[] = { - "eintro1", - "eintro2", - "eintro3", - "eintro4", - "eintro5", - "eintro6", - "eintro7", - "eintro8", - "eintro9", - "eintro10", - "eintro11", - "eintro12", - "eglow", - "0000210", - "0000130", - "0000180", - "0000160", - - "asong", - "crowcaw", - "eyerub2", - "pluck3", - "rodnreel", - "frog1", - "scavmov2", - "lambmom3", - "lambkid1", - "thunder2", - "thunder3", - "wind6", - "h2odrop2", - "gasleak", - "polgulp1", - "hndslap1", - "burp1", - "0000220", - "0000230", - "0000250", - "0000260", - "0000270", - "0000280", - "0000290", - "0000300", - "0000310", - "0000320", - "0000330", - "scream1", - "theend" -}; - -const char *KyraEngine_v2::_sequenceSoundList_PCFLOPPY[] = { - "intro1", - "intro2", - "intro3", - "intro4", - "intro5", - "intro6", - "intro7", - "intro8", - "intro9", - "intro10", - "intro11", - "intro12", - "glow", - - "asong", - "crowcaw", - "eyerub2", - "pluck3", - "rodnreel", - "frog1", - "scavmov2", - "lambmom3", - "lambkid1", - "thunder2", - "thunder3", - "wind6", - "h2odrop2", - "gasleak", - "polgulp1", - "hndslap1", - "burp1", - "scream1", - "theend" -}; - -const char *KyraEngine_v2::_sequenceSoundList_TOWNS[] = { - "intro1.pcm", - "intro2.pcm", - "intro3.pcm", - "intro4.pcm", - "intro5.pcm", - "intro6.pcm", - "intro7.pcm", - "intro8.pcm", - "intro9.pcm", - "intro10.pcm", - "intro11.pcm", - "intro12.pcm", - "glow.pcm", - - "asong.pcm", - "crowcaw.pcm", - "eyerub2.pcm", - "pluck3.pcm", - "rodnreel.pcm", - "frog1.pcm", - "scavmov2.pcm", - "lambmom3.pcm", - "lambkid1.pcm", - "thunder2.pcm", - "thunder3.pcm", - "wind6.pcm", - "h2odrop2.pcm", - "gasleak.pcm", - "polgulp1.pcm", - "hndslap1.pcm", - "burp1.pcm", - "scream1.pcm", - "theend.pcm" -}; - -const int KyraEngine_v2::_sequenceSoundListSize_PC = ARRAYSIZE(KyraEngine_v2::_sequenceSoundList_PC); -const int KyraEngine_v2::_sequenceSoundListSize_PCFLOPPY = ARRAYSIZE(KyraEngine_v2::_sequenceSoundList_PCFLOPPY); -const int KyraEngine_v2::_sequenceSoundListSize_TOWNS = ARRAYSIZE(KyraEngine_v2::_sequenceSoundList_TOWNS); - const uint8 KyraEngine_v2::_seqTextColorPresets[] = { 0x01, 0x01, 0x00, 0x3f, 0x3f, 0x3f }; const char *KyraEngine_v2::_languageExtension[] = { @@ -1586,64 +1390,6 @@ const byte KyraEngine_v2::_itemStringMap[] = { 0, 2, 0, 0, 0, 0, 0, 0 }; -const char *KyraEngine_v2::_dosSoundFileListIntro[] = { "K2INTRO" }; -const char *KyraEngine_v2::_dosSoundFileListFinale[] = { "K2FINALE" }; - -const char *KyraEngine_v2::_dosSoundFileList[] = { - "K2TEST1", - "K2TEST2", - "K2TEST3", - "K2TEST4", - "K2TEST5", - "K2TEST6", - "K2TEST7", - "K2TEST8", - "K2TEST9", - "K2TEST10", - "K2TEST11", - "K2TEST12", - "K2TEST13", - "K2TEST14", - "K2TEST15" -}; - -const char *KyraEngine_v2::_fmtSoundFileListIntro[] = { "intro" }; -const char *KyraEngine_v2::_fmtSoundFileListFinale[] = { "finale" }; -const char *KyraEngine_v2::_fmtSoundFileList[] = { "k2" }; - -const uint8 KyraEngine_v2::_cdaTrackTableIntro[] = { - 0x03, 0x01, 0x04, 0x02, 0x05, 0x03, 0x06, 0x04, 0x07, 0x05, 0x08, 0x06 -}; - -const uint8 KyraEngine_v2::_cdaTrackTableIngame[] = { - 0x02, 0x07, 0x03, 0x08, 0x04, 0x09, 0x07, 0x0A, 0x0C, 0x0B, 0x0D, 0x0C, 0x0E, 0x0D, 0x0F, 0x0E, - 0x10, 0x0F, 0x12, 0x10, 0x13, 0x11, 0x15, 0x12, 0x17, 0x13, 0x18, 0x14, 0x19, 0x15, 0x1A, 0x16, - 0x1B, 0x17, 0x1C, 0x18, 0x1D, 0x19, 0x1E, 0x1A, 0x1F, 0x1B, 0x21, 0x1C, 0x22, 0x1D, 0x23, 0x1E, - 0x24, 0x1F, 0x25, 0x20, 0x26, 0x21, 0x27, 0x22, 0x28, 0x23, 0x29, 0x24, 0x2A, 0x25, 0x2B, 0x26, - 0x2C, 0x27, 0x2D, 0x28, 0x2E, 0x29, 0x2F, 0x2A, 0x30, 0x2B, 0x31, 0x2C, 0x32, 0x2D, 0x33, 0x2E, - 0x34, 0x2F, 0x35, 0x30, 0x36, 0x31, 0x37, 0x32, 0x38, 0x33, 0x39, 0x34, 0x3A, 0x35, 0x3B, 0x36, - 0x3C, 0x37, 0x3D, 0x38, 0x3E, 0x39, 0x3F, 0x3A, 0x40, 0x3B, 0x41, 0x3C, 0x42, 0x3D, 0x43, 0x3E, - 0x44, 0x3F, 0x45, 0x40, 0x46, 0x41, 0x47, 0x42, 0x48, 0x43, 0x49, 0x44, 0x4A, 0x45, 0x4B, 0x46, - 0x4C, 0x47, 0x4D, 0x48, 0x4E, 0x49, 0x4F, 0x4A, 0x50, 0x4B, 0x51, 0x4C, 0x52, 0x4D, 0x53, 0x4E, - 0x54, 0x4F, 0x55, 0x50, 0x56, 0x51, 0x57, 0x52 -}; - -const uint8 KyraEngine_v2::_cdaTrackTableFinale[] = { - 0x03, 0x53, 0x04, 0x54 -}; - -const AudioDataStruct KyraEngine_v2::_soundData_PC[] = { - { _dosSoundFileListIntro, ARRAYSIZE(_dosSoundFileListIntro), 0, 0 }, - { _dosSoundFileList, ARRAYSIZE(_dosSoundFileList), 0, 0}, - { _dosSoundFileListFinale, ARRAYSIZE(_dosSoundFileListFinale), 0, 0 } -}; - -const AudioDataStruct KyraEngine_v2::_soundData_TOWNS[] = { - { _fmtSoundFileListIntro, ARRAYSIZE(_fmtSoundFileListIntro), _cdaTrackTableIntro, ARRAYSIZE(_cdaTrackTableIntro) >> 1 }, - { _fmtSoundFileList, ARRAYSIZE(_fmtSoundFileList),_cdaTrackTableIngame, ARRAYSIZE(_cdaTrackTableIngame) >> 1 }, - { _fmtSoundFileListFinale, ARRAYSIZE(_fmtSoundFileListFinale),_cdaTrackTableFinale, ARRAYSIZE(_cdaTrackTableFinale) >> 1 } -}; - const int KyraEngine_v2::_itemStringMapSize = ARRAYSIZE(KyraEngine_v2::_itemStringMap); const int8 KyraEngine_v2::_dosTrackMap[] = { |