Ticket #8772: hofKyradatSupport.patch

File hofKyradatSupport.patch, 54.1 KB (added by athrxx, 16 years ago)

patch for kyra engine

  • gui_v2.cpp

     
    5858        memset(colorMap, 0, sizeof(colorMap));
    5959        _screen->setTextColorMap(colorMap);
    6060       
    61         const char * const *strings = &_mainMenuStrings[_lang << 2];
     61        const char * const *strings;
     62       
    6263        Screen::FontId oldFont = _screen->setFont(Screen::FID_8_FNT);
    6364        int charWidthBackUp = _screen->_charWidth;
    6465       
    6566        _screen->_charWidth = -2;
    6667
    67         if (_flags.gameID == GI_KYRA2)
     68        if (_flags.gameID == GI_KYRA2) {
    6869                _screen->setScreenDim(11);
    69         else
     70                const char * k2strings[4];
     71                k2strings[0] = _sequenceStrings[97];
     72                k2strings[1] = _sequenceStrings[96];
     73                k2strings[2] = _sequenceStrings[95];
     74                k2strings[3] = _sequenceStrings[98];
     75                strings = k2strings;
     76        } else {
    7077                _screen->setScreenDim(3);
     78                strings = &_mainMenuStrings[_lang << 2];
     79        }
    7180
    7281        int backUpX = _screen->_curDim->sx;
    7382        int backUpY = _screen->_curDim->sy;
  • kyra.h

     
    4242        bool useAltShapeHeader; // alternative shape header (uses 2 bytes more, those are unused though)
    4343        bool isTalkie;
    4444        bool useHiResOverlay;
     45        //bool useInstallerPackage;
    4546        byte gameID;
    4647};
    4748
     
    5354enum {
    5455        GI_KYRA1 = 0,
    5556        GI_KYRA2 = 1,
    56         GI_KYRA3 = 2
     57        GI_KYRA3 = 2,
     58        GI_LOL = 3
    5759};
    5860
    5961struct AudioDataStruct {
    6062        const char * const *_fileList;
    61         const uint _fileListLen;       
     63        const int _fileListLen;
    6264        const void * const _cdaTracks;
    63         const uint _cdaNumTracks;
     65        const int _cdaNumTracks;
    6466};
    6567
    6668// TODO: this is just the start of makeing the debug output of the kyra engine a bit more useable
  • kyra_v1.cpp

     
    180180
    181181        initStaticResource();
    182182       
    183         const AudioDataStruct *const sndList = (_flags.platform == Common::kPlatformFMTowns ||
    184                 _flags.platform == Common::kPlatformPC98) ? _soundData_TOWNS : _soundData_PC;
    185         _sound->setSoundList(sndList);
     183        _sound->setSoundList(&_soundData[kMusicIntro]);
    186184
    187185        _trackMap = _dosTrackMap;
    188186        _trackMapSize = _dosTrackMapSize;
     
    191189                error("Couldn't init sound");
    192190
    193191        _sound->setVolume(255);
    194         _sound->loadSoundFile((_flags.platform == Common::kPlatformFMTowns
    195                 || _flags.platform == Common::kPlatformPC98) ? 0 : 9);
     192        _sound->loadSoundFile(0);
    196193
    197194        setupTimers();
    198195        setupButtonData();
     
    342339        debugC(9, kDebugLevelMain, "KyraEngine_v1::startup()");
    343340        static const uint8 colorMap[] = { 0, 0, 0, 0, 12, 12, 12, 0, 0, 0, 0, 0 };
    344341        _screen->setTextColorMap(colorMap);
     342        _sound->setSoundList(&_soundData[kMusicIngame]);
     343        _sound->loadSoundFile(0);
    345344//      _screen->setFont(Screen::FID_6_FNT);
    346345        _screen->setAnimBlockPtr(3750);
    347346        memset(_sceneAnimTable, 0, sizeof(_sceneAnimTable));
  • kyra_v1.h

     
    763763       
    764764        const uint8 * const*_specialPalettes;
    765765
    766         static const char *_soundFiles[];
    767         static const char *_soundFilesTowns[];
    768         static const int32 _cdaTrackTable[];
    769         static const AudioDataStruct _soundData_PC[];
    770         static const AudioDataStruct _soundData_TOWNS[];
     766        const char *const *_soundFiles;
     767        int _soundFilesSize;
     768        const char *const *_soundFilesIntro;
     769        int _soundFilesIntroSize;
     770        const int32 *_cdaTrackTable;
     771        int _cdaTrackTableSize;
     772        const AudioDataStruct * _soundData;
    771773               
    772774        static const int8 _charXPosTable[];
    773775        static const int8 _charYPosTable[];
  • kyra_v2.cpp

     
    4949        _activeWSA = 0;
    5050        _activeText = 0;
    5151        _seqWsa = 0;
     52        _sequences = 0;
     53        _nSequences = 0;
    5254
     55
    5356        _gamePlayBuffer = 0;
    5457        _cCodeBuffer = _optionsBuffer = _chapterBuffer = 0;
    5558
     
    9396KyraEngine_v2::~KyraEngine_v2() {
    9497        seq_uninit();
    9598
     99        if (_sequences)
     100                delete [] _sequences;
     101        if (_nSequences)
     102                delete [] _nSequences;
     103
    96104        delete [] _mouseSHPBuf;
    97105        delete _screen;
    98106        delete _text;
     
    112120                error("_screen->init() failed");
    113121
    114122        KyraEngine::init();
     123        initStaticResource();
    115124
    116125        _debugger = new Debugger_v2(this);
    117126        assert(_debugger);
     
    132141
    133142        _abortIntroFlag = false;
    134143
    135         // temporary solution until staticres manager support (kyra.dat) is added for kyra 2
    136         if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) {
    137                 _sequenceSoundList = (const char * const *) _sequenceSoundList_TOWNS;
    138                 _sequenceSoundListSize = _sequenceSoundListSize_TOWNS;
    139                 _sequenceStrings = (const char * const *) _sequenceStrings_TOWNS_EN;
    140                 _sequenceStringsSize = _sequenceStringsSize_TOWNS_EN;
    141                 _sequences = (const Sequence*) _sequences_TOWNS;
    142                 _soundData = (const AudioDataStruct *) _soundData_TOWNS;
    143         } else if (_flags.isTalkie) {
    144                 _sequenceSoundList = (const char * const *) _sequenceSoundList_PC;
    145                 _sequenceSoundListSize = _sequenceSoundListSize_PC;
    146                 _sequenceStrings = (const char * const *) _sequenceStrings_PC_EN;
    147                 _sequenceStringsSize = _sequenceStringsSize_PC_EN;
    148                 _sequences = (const Sequence*) _sequences_PC;
    149                 _soundData = (const AudioDataStruct *) _soundData_PC;
    150         } else {
    151                 _sequenceSoundList = (const char * const *) _sequenceSoundList_PCFLOPPY;
    152                 _sequenceSoundListSize = _sequenceSoundListSize_PCFLOPPY;
    153                 _sequenceStrings = (const char * const *) _sequenceStrings_PC_EN;
    154                 _sequenceStringsSize = _sequenceStringsSize_PC_EN;
    155                 _sequences = (const Sequence*) _sequences_PC;
    156                 _soundData = (const AudioDataStruct *) _soundData_PC;
    157         }
    158 
    159144        for (int i = 0; i < 33; i++)
    160145                _sequenceStringsDuration[i] = (int) strlen(_sequenceStrings[i]) * 8;
    161146
     
    179164        if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98)
    180165                seq_showStarcraftLogo();
    181166
    182         if (_flags.platform == Common::kPlatformPC && _flags.isDemo) {
    183                 _res->loadPakFile("VOC.PAK");
    184                 _menuChoice = 2;
    185         } else {
    186                 seq_playSequences(kSequenceVirgin, kSequenceZanfaun);
    187                 //seq_playSequences(kSequenceFunters, kSequenceFrash);
     167        //seq_playSequences(kSequenceVirgin, kSequenceZanfaun);
     168        seq_playSequences(kSequenceFunters, kSequenceFrash);
    188169
    189                 _res->unloadAllPakFiles();
     170        _res->unloadAllPakFiles();
    190171
    191                 if (_menuChoice != 4) {
    192                         // load just the pak files needed for ingame
    193                         if (_flags.platform == Common::kPlatformPC && _flags.isTalkie) {
    194                                 _res->loadFileList("FILEDATA.FDT");
    195                                 _res->loadPakFile("KYRA.DAT");                 
    196                         } else if (_flags.platform == Common::kPlatformPC) {
    197                                 // TODO
    198 
    199                         } else if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) {
    200                                 char tmpfilename[13];
    201                                 static const char * pakfiles [] = { "KYRA.DAT", "AUDIO.PAK", "CAULDRON.PAK",
    202                                         "MISC_CPS.PAK", "MISC_EMC.PAK", "OTHER.PAK", "VOC.PAK", "WSCORE.PAK" };
    203                                 for (int i = 0; i < 8; i++)
    204                                         _res->loadPakFile(pakfiles[i]);
    205                                 for (int i = 1; i < 10; i++) {
    206                                         sprintf(tmpfilename, "COST%d_SH.PAK", i);
    207                                         _res->loadPakFile(tmpfilename);
    208                                 }
    209                                 for (int i = 1; i < 6; i++) {
    210                                         sprintf(tmpfilename, "HOFCH_%d.PAK", i);
    211                                         _res->loadPakFile(tmpfilename);
    212                                 }
    213                         }
    214                 }
     172        if (_menuChoice != 4) {
     173                // load just the pak files needed for ingame
     174                _res->loadPakFile(StaticResource::staticDataFilename());
     175                if (_flags.platform == Common::kPlatformPC && _flags.isTalkie)
     176                        _res->loadFileList("FILEDATA.FDT");     
     177                else
     178                        _res->loadFileList(_ingamePakList, _ingamePakListSize);
    215179        }
    216180
    217181        if (_menuChoice == 1) {
     
    221185        } else if (_menuChoice == 3) {
    222186                // TODO:        Load Game
    223187
    224         } else if (_menuChoice == 2) {
    225                 // TODO:        Run Demo
    226 
    227188        }
    228189
    229190        return 0;
  • kyra_v2.h

     
    7474        kSequenceHand4
    7575};
    7676
     77enum kSequencesDemo {
     78        kSequenceDemoVirgin = 0,
     79        kSequenceDemoWestwood,
     80        kSequenceDemoTitle,
     81        kSequenceDemoTitle2,
     82        kSequenceDemoHill,
     83        kSequenceDemoOuthome,
     84        kSequenceDemoWharf,
     85        kSequenceDemoDinob,
     86        kSequenceDemoFisher
     87};
    7788
     89enum kNestedSequencesDemo {
     90        kSequenceDemoWharf2 = 0,
     91        kSequenceDemoDinob2,
     92        kSequenceDemoWater,
     93        kSequenceDemoBail,
     94        kSequenceDemoDig,
     95};
     96
     97enum kSequencesLol {
     98        kSequenceDemoScene1 = 0,
     99        kSequenceDemoText1,
     100        kSequenceDemoScene2,
     101        kSequenceDemoText2,
     102        kSequenceDemoScene3,
     103        kSequenceDemoText3,
     104        kSequenceDemoScene4,
     105        kSequenceDemoText4,
     106        kSequenceDemoScene5,
     107        kSequenceDemoText5,
     108        kSequenceDemoScene1a
     109};
     110
    78111class WSAMovieV2;
    79112class KyraEngine_v2;
    80113class TextDisplayer_v2;
    81114class Debugger_v2;
    82115
    83 struct SequenceControl {
    84         int8 frameIndex;
    85         int8 frameDelay;
    86 };
     116typedef int (KyraEngine_v2::*Seqproc)(WSAMovieV2*, int, int, int);
    87117
    88118struct ActiveWSA {
    89119        int16 flags;
     
    91121        uint16 startFrame;
    92122        uint16 endFrame;
    93123        uint16 frameDelay;
    94         int (KyraEngine_v2::*callback)(WSAMovieV2*, int, int, int);
     124        Seqproc callback;
    95125        uint32 nextFrame;
    96126        uint16 currentFrame;
    97127        uint16 lastFrame;
    98128        uint16 x;
    99129        uint16 y;
    100         const SequenceControl *control;
     130        const uint16 *control;
    101131        uint16 startupCommand;
    102132        uint16 finalCommand;
    103133};
     
    125155        uint16 frameDelay;
    126156        uint16 xPos;
    127157        uint16 yPos;
    128         int (KyraEngine_v2::*callback)(WSAMovieV2*, int, int, int);
     158        Seqproc callback;
    129159        uint16 duration;
    130160};
    131161
     
    135165        uint16 startframe;
    136166        uint16 endFrame;
    137167        uint16 frameDelay;
    138         int (KyraEngine_v2::*callback)(WSAMovieV2*, int, int, int);
     168        Seqproc callback;
    139169        uint16 x;
    140170        uint16 y;
    141         const SequenceControl * wsaControl;
     171        const uint16 * wsaControl;
    142172        uint16 startupCommand;
    143173        uint16 finalCommand;
    144         uint16 unk1;
    145174};
    146175
    147176enum kMusicDataID {
     
    246275
    247276        uint8 *_mouseSHPBuf;
    248277
    249 
    250         static const char *_dosSoundFileListIntro[];
    251         static const char *_dosSoundFileListFinale[];
    252         static const char *_dosSoundFileList[];
    253         static const char *_fmtSoundFileListIntro[];
    254         static const char *_fmtSoundFileListFinale[];
    255         static const char *_fmtSoundFileList[];
    256         static const uint8 _cdaTrackTableIntro[];
    257         static const uint8 _cdaTrackTableIngame[];
    258         static const uint8 _cdaTrackTableFinale[];
    259         static const AudioDataStruct _soundData_PC[];
    260         static const AudioDataStruct _soundData_TOWNS[];
    261278        static const int8 _dosTrackMap[];
    262279        static const int _dosTrackMapSize;
     280
    263281        const AudioDataStruct * _soundData;
    264282
    265283protected:
     
    268286        void runLoop();
    269287        void cleanup();
    270288
     289        // TODO: get rid of all variables having pointers to the static resources if possible
     290        // i.e. let them directly use the _staticres functions
     291        void initStaticResource();
     292
    271293        void setupTimers();
    272294        void setupOpcodeTable();
    273295
     
    842864        ActiveWSA *_activeWSA;
    843865        ActiveText *_activeText;
    844866
    845         const char *const *_sequenceSoundList;
     867        const char *const *_sequencePakList;
     868        int _sequencePakListSize;
     869        const char *const *_ingamePakList;
     870        int _ingamePakListSize;
     871       
     872        const char *const *_musicFileListIntro;
     873        int _musicFileListIntroSize;
     874        const char *const *_musicFileListFinale;
     875        int _musicFileListFinaleSize;
     876        const char *const *_musicFileListIngame;
     877        int _musicFileListIngameSize;
     878        const uint8 *_cdaTrackTableIntro;
     879        int _cdaTrackTableIntroSize;
     880        const uint8 *_cdaTrackTableIngame;
     881        int _cdaTrackTableIngameSize;
     882        const uint8 *_cdaTrackTableFinale;
     883        int _cdaTrackTableFinaleSize;
     884        char * const *_sequenceSoundList;
    846885        int _sequenceSoundListSize;
    847886        const char *const *_sequenceStrings;
    848887        int _sequenceStringsSize;
    849 
    850         static const char *_sequenceSoundList_PC[];
    851         static const int _sequenceSoundListSize_PC;
    852         static const char *_sequenceSoundList_PCFLOPPY[];
    853         static const int _sequenceSoundListSize_PCFLOPPY;
    854         static const char *_sequenceSoundList_TOWNS[];
    855         static const int _sequenceSoundListSize_TOWNS;
    856         static const char *_sequenceStrings_TOWNS_EN[];
    857         static const int _sequenceStringsSize_TOWNS_EN;
    858         static const char *_sequenceStrings_PC_EN[];
    859         static const int _sequenceStringsSize_PC_EN;
    860         static const char _actorScreenStrings_PC_EN[];
    861         static const int _actorScreenStringsSize_PC_EN;
    862 
    863888        int _sequenceStringsDuration[33];
    864889
    865890        static const uint8 _seqTextColorPresets[];
     
    878903        uint8 _seqTextColor[2];
    879904        uint8 _seqTextColorMap[16];
    880905
    881         const Sequence *_sequences;
    882 
    883         static const Sequence _sequences_PC[];
    884         static const Sequence _sequences_TOWNS[];
    885         static const NestedSequence _nSequences[];
    886         static const SequenceControl _wsaControlLibrary[];
    887         static const SequenceControl _wsaControlHand1b[];
    888         static const SequenceControl _wsaControlHand1c[];
    889         static const SequenceControl _wsaControlHand2[];
    890         static const SequenceControl _wsaControlHand3[];
    891         static const SequenceControl _wsaControlHand4[];
     906        Sequence * _sequences;
     907        NestedSequence * _nSequences;
    892908};
    893909
    894910} // end of namespace Kyra
    895911
    896 #endif
    897 
    898 
    899 
     912#endif
     913 No newline at end of file
  • resource.cpp

     
    6767        if (!dir.exists() || !dir.isDirectory())
    6868                error("invalid game path '%s'", dir.getPath().c_str());
    6969
    70         if (_vm->game() == GI_KYRA1) {
    71                 // we're loading KYRA.DAT here too (but just for Kyrandia 1)
     70        if (_vm->game() < GI_KYRA3) {
    7271                if (!loadPakFile(StaticResource::staticDataFilename()) || !StaticResource::checkKyraDat()) {
    7372                        Common::String errorMessage = "You're missing the '" + StaticResource::staticDataFilename() + "' file or it got corrupted, (re)get it from the ScummVM website";
    7473                        GUI::MessageDialog errorMsg(errorMessage);
    7574                        errorMsg.runModal();
    7675                        error(errorMessage.c_str());
    7776                }
     77        }
    7878
     79        if (_vm->game() == GI_KYRA1) {
    7980                // We only need kyra.dat for the demo.
    8081                if (_vm->gameFlags().isDemo)
    8182                        return true;
     
    8384                // only VRM file we need in the *whole* game for kyra1
    8485                if (_vm->gameFlags().isTalkie)
    8586                        loadPakFile("CHAPTER1.VRM");
    86         } else if (_vm->game() == GI_KYRA3) {
     87
     88        } else if (_vm->game() == GI_KYRA2) {
     89                // mouse pointer, fonts, etc. required for initializing
     90                if (_vm->gameFlags().isDemo) {
     91                        loadPakFile("GENERAL.PAK");
     92                } else {
     93                        loadPakFile("INTROGEN.PAK");
     94                        loadPakFile("OTHER.PAK");
     95                }
     96
     97                return true;
     98
     99        } else if (_vm->game() == GI_KYRA3 /*&& _vm->gameFlags().useInstallerPackage*/) {
    87100                // load the installation package file for kyra3
    88101                INSFile *insFile = new INSFile("WESTWOOD.001");
    89102                assert(insFile);
     
    106119                Common::for_each(list, list + ARRAYSIZE(list), Common::bind1st(Common::mem_fun(&Resource::loadPakFile), this));
    107120                Common::for_each(_pakfiles.begin(), _pakfiles.end(), Common::bind2nd(Common::mem_fun(&ResourceFile::protect), true));
    108121        } else {
    109                 // TODO: Kyra 2 InGame uses a special pak file list shipped with the game "FILEDATA.FDT", so we just have to load
    110                 // the files needed for Kyra 2 intro here. What has to be done is, checking what files are required in the intro
    111                 // 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.
    112 
    113122                for (FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) {
    114123                        Common::String filename = file->getName();
    115124                        filename.toUppercase();
     
    199208        return true;
    200209}
    201210
     211bool Resource::loadFileList(const char * const *filelist, uint32 numFiles) {
     212        if (!filelist)
     213                return false;
     214
     215        while (numFiles--) {
     216                if (!loadPakFile(filelist[numFiles])) {
     217                        error("couldn't load file '%s'", filelist[numFiles]);
     218                        return false;
     219                }
     220        }
     221
     222        return true;
     223}
     224
    202225void Resource::unloadPakFile(const Common::String &filename) {
    203226        ResIterator pak = Common::find_if(_pakfiles.begin(), _pakfiles.end(), ResFilenameEqual(Common::hashit_lower(filename)));
    204227        if (pak != _pakfiles.end())
  • resource.h

     
    111111        Common::String _physfile;
    112112};
    113113
     114class INSFileComp : public ResourceFile {
     115protected:
     116        struct FileEntry {
     117                uint _name;
     118                char _archbase[10];
     119                uint32 _filenum;
     120                uint32 _start;
     121                uint32 _insize;
     122                uint32 _outsize;
     123                operator uint() const { return _name; }
     124        };
     125
     126public:
     127        INSFileComp(const char *firstFile);
     128        ~INSFileComp();
     129
     130        uint8 *getFile(uint hash) const;
     131        bool getFileHandle(uint hash, Common::File &filehandle) const;
     132        uint32 getFileSize(uint hash) const;
     133
     134        uint32 cache_allocate(uint32 minFileSize);
     135        void cache_release();
     136
     137protected:
     138        typedef Common::List<FileEntry>::iterator CompIterator;
     139        typedef Common::List<FileEntry>::const_iterator ConstCompIterator;
     140
     141        bool openFile(Common::File &filehandle, ConstCompIterator file) const;
     142        bool expand(uint8 * dst, uint8 * src, uint32 outsize, uint32 insize) const;
     143
     144        Common::List<FileEntry> _files;
     145
     146        uint8 * _fileData;
     147};
     148
    114149class Resource {
    115150public:
    116151        Resource(KyraEngine *vm);
     
    123158        bool isInPakList(const Common::String &filename) const;
    124159
    125160        bool loadFileList(const Common::String &filedata);
     161        bool loadFileList(const char * const *filelist, uint32 numFiles);
    126162        // This unloads *all* pakfiles, even kyra.dat and protected ones
    127163        void unloadAllPakFiles();
    128164
     
    215251        kGUIStrings,
    216252        kConfigStrings,
    217253
    218         kKyra1TownsSFXTable,
     254        kAudioTracks,
     255        kAudioTracksIntro,
     256
     257        kKyra1TownsSFXwdTable,
     258        kKyra1TownsSFXbtTable,
     259        kKyra1TownsCDATable,
    219260        kCreditsStrings,
    220261
     262        k2SeqplayPakFiles,
     263        k2SeqplayCredits,
     264        k2SeqplayStrings,
     265        k2SeqplaySfxFiles,
     266        k2SeqplayTlkFiles,
     267        k2SeqplaySeqData,
     268        k2SeqplayIntroTracks,
     269        k2SeqplayFinaleTracks,
     270        k2SeqplayIntroCDA,
     271        k2SeqplayFinaleCDA,
     272
     273        k2IngamePakFiles,
     274        k2IngameTracks,
     275        k2IngameCDA,
     276
    221277        kMaxResIDs
    222278};
    223279
     
    282338                kRoomList,
    283339                kShapeList,
    284340                kRawData,
    285                 kPaletteTable
     341                kPaletteTable,
     342
     343                k2SeqData
    286344        };
    287345
    288346        struct BuiltinRes {
  • saveload_v1.cpp

     
    202202                // In the first version when this entry was introduced,
    203203                // it wasn't made sure that _curSfxFile was initialized
    204204                // so if it's out of bounds we just set it to 0.
    205                 if (_curSfxFile >= (int)_soundData_TOWNS->_fileListLen || _curSfxFile < 0)
    206                         _curSfxFile = 0;
    207 
    208                 if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98)
     205                if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) {
     206                        if (_curSfxFile >= (int)_soundData->_fileListLen || _curSfxFile < 0)
     207                                _curSfxFile = 0;
    209208                        _sound->loadSoundFile(_curSfxFile);
     209                }
    210210        }
    211211
    212212        _screen->_disableScreen = true;
  • sequences_v2.cpp

     
    106106                if (_sequences[seqNum].flags & 4) {
    107107                        int cp = _screen->setCurPage(2);
    108108                        Screen::FontId cf =     _screen->setFont(Screen::FID_GOLDFONT_FNT);
    109                         int sX = (320 - _screen->getTextWidth(_sequenceStrings[_sequences[seqNum].stringIndex1])) / 2;
    110                         _screen->printText(_sequenceStrings[_sequences[seqNum].stringIndex1], sX, 100 - _screen->getFontHeight(), 1, 0);
    111                         sX = (320 - _screen->getTextWidth(_sequenceStrings[_sequences[seqNum].stringIndex2])) / 2;
    112                         _screen->printText(_sequenceStrings[_sequences[seqNum].stringIndex2], sX, 100, 1, 0);
    113 
     109                        if (_sequences[seqNum].stringIndex1 != -1) {
     110                                int sX = (320 - _screen->getTextWidth(_sequenceStrings[_sequences[seqNum].stringIndex1])) / 2;
     111                                _screen->printText(_sequenceStrings[_sequences[seqNum].stringIndex1], sX, 100 - _screen->getFontHeight(), 1, 0);
     112                        }
     113                        if (_sequences[seqNum].stringIndex2 != -1) {
     114                                int sX = (320 - _screen->getTextWidth(_sequenceStrings[_sequences[seqNum].stringIndex2])) / 2;
     115                                _screen->printText(_sequenceStrings[_sequences[seqNum].stringIndex2], sX, 100, 1, 0);
     116                        }
    114117                        _screen->setFont(cf);
    115118                        _screen->setCurPage(cp);
    116119                }
     
    205208                                                        uint32 tdiff = _seqEndTime - now;
    206209                                                        uint32 dly = tdiff < _tickLength ? tdiff : _tickLength;
    207210                                                        delay(dly);
    208                                                         //_seqEndTime -= dly;
    209211                                                }
    210212                                        } else {
    211213                                                loop = loop2 = false;
     
    14941496        _screen->loadBitmap("finale.cps", 3, 3, _screen->_currentPalette);
    14951497        _screen->setFont(Screen::FID_GOLDFONT_FNT);
    14961498
     1499        int talkieCreditsSize;
     1500        const uint8 * talkieCredits = _staticres->loadRawData(k2SeqplayCredits, talkieCreditsSize);
     1501
    14971502        _sound->setSoundList(&_soundData[kMusicIngame]);
    14981503        _sound->loadSoundFile(3);
    14991504        _sound->playTrack(3);
     
    19571962                _activeWSA[wsaNum].movie->setY(_activeWSA[wsaNum].y);
    19581963
    19591964                if (_activeWSA[wsaNum].flags & 0x20) {
    1960                         _activeWSA[wsaNum].movie->displayFrame(_activeWSA[wsaNum].control[currentFrame].frameIndex, 0x4000);
    1961                         _activeWSA[wsaNum].frameDelay = _activeWSA[wsaNum].control[currentFrame].frameDelay;
     1965                        _activeWSA[wsaNum].movie->displayFrame(_activeWSA[wsaNum].control[currentFrame * 2], 0x4000);
     1966                        _activeWSA[wsaNum].frameDelay = _activeWSA[wsaNum].control[currentFrame * 2 + 1];
    19621967                } else {
    19631968                        _activeWSA[wsaNum].movie->displayFrame(currentFrame % _activeWSA[wsaNum].movie->frames(), 0x4000);
    19641969                }
     
    21462151        _activeText = new ActiveText[10];
    21472152
    21482153        _res->unloadAllPakFiles();
    2149         _res->loadPakFile("KYRA.DAT");
    2150         _res->loadPakFile("AUDIO.PAK");
    2151         _res->loadPakFile("INTROGEN.PAK");
    2152         _res->loadPakFile("OTHER.PAK");
    2153         _res->loadPakFile("VOC.PAK");
    2154         if (_flags.isTalkie) {
    2155                 _res->loadPakFile("TALKENG.PAK");
    2156                 _res->loadPakFile("TALKGER.PAK");
    2157                 _res->loadPakFile("TALKFRE.PAK");
    2158                 _res->loadPakFile("INTROTLK.PAK");
    2159         } else {
    2160                 _res->loadPakFile("INTROVOC.PAK");
    2161                 if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98)
    2162                         _res->loadPakFile("WSCORE.PAK");
    2163         }
     2154        _res->loadPakFile(StaticResource::staticDataFilename());
     2155        _res->loadFileList(_sequencePakList, _sequencePakListSize);
    21642156}
    21652157
    21662158void KyraEngine_v2::seq_uninit() {
     
    22842276        _screen->showMouse();
    22852277}
    22862278
    2287 // static res
    2288 // TODO: move to staticres.cpp
    2289 
    2290 const Sequence KyraEngine_v2::_sequences_PC[] = {
    2291         // flags, wsaFile, cpsFile, startupCommand, finalCommand, stringIndex1, stringIndex2,
    2292         // startFrame, numFrames, frameDelay, xPos, yPos, callback, duration
    2293         { 2, 0, "virgin.cps",   4, 0, -1, -1, 0, 1,  100,  0, 0, 0,                                 30 },
    2294         { 1, "westwood.wsa", 0, 4, 0, -1, -1, 0, 18, 6,    0, 0, &KyraEngine_v2::seq_introWestwood, 160 },
    2295         { 1, "title.wsa", 0,    4, 0, -1, -1, 0, 26, 6,    0, 0, &KyraEngine_v2::seq_introTitle,    10 },
    2296         { 2, 0, "over.cps",     4, 0, -1, -1, 0, 1,  3600, 0, 0, &KyraEngine_v2::seq_introOverview, 30 },
    2297         { 2, 0, "library.cps",  4, 0, -1, -1, 0, 1,  3600, 0, 0, &KyraEngine_v2::seq_introLibrary,  30 },
    2298         { 2, 0, "hand.cps",     4, 0, -1, -1, 0, 1,  3600, 0, 0, &KyraEngine_v2::seq_introHand,     90 },
    2299         { 1, "point.wsa", 0,    4, 8, -1, -1, 0, 38, 7,    0, 0, &KyraEngine_v2::seq_introPoint,    200 },
    2300         { 1, "zanfaun.wsa", 0,  4, 0, -1, -1, 0, 51, 16,   0, 0, &KyraEngine_v2::seq_introZanfaun,  240 },
    2301 
    2302         { 1, "funters.wsa", 0,  4, 0, -1, -1, 0, 27, 12,   0, 0, &KyraEngine_v2::seq_finaleFunters, 30 },
    2303         { 1, "ferb.wsa", 0,             4, 0, -1, -1, 0, 27, 16,   0, 0, &KyraEngine_v2::seq_finaleFerb,        30 },
    2304         { 1, "fish.wsa", 0,             4, 0, -1, -1, 0, 56, 12,   0, 0, &KyraEngine_v2::seq_finaleFish,        30 },
    2305         { 1, "fheep.wsa", 0,    4, 0, -1, -1, 0, 11, 12,   0, 0, &KyraEngine_v2::seq_finaleFheep,       30 },
    2306         { 1, "farmer.wsa", 0,   4, 0, -1, -1, 0, 22, 12,   0, 0, &KyraEngine_v2::seq_finaleFarmer,      100 },
    2307         { 1, "fuards.wsa", 0,   4, 0, -1, -1, 0, 24, 14,   0, 0, &KyraEngine_v2::seq_finaleFuards,      30 },
    2308         { 1, "firates.wsa", 0,  4, 0, -1, -1, 0, 37, 12,   0, 0, &KyraEngine_v2::seq_finaleFirates,     30 },
    2309         { 1, "frash.wsa", 0,    4, 0, -1, -1, 0, 12, 10,   0, 0, &KyraEngine_v2::seq_finaleFrash,       340 }
    2310 };
    2311 
    2312 const Sequence KyraEngine_v2::_sequences_TOWNS[] = {
    2313         // flags, wsaFile, cpsFile, startupCommand, finalCommand, stringIndex1, stringIndex2,
    2314         // startFrame, numFrames, frameDelay, xPos, yPos, callback, duration
    2315         { 2, 0, "virgin.cps",   4, 0, -1, -1, 0, 1,  100,  0, 0, 0,                                 30 },
    2316         { 1, "westwood.wsa", 0, 4, 0, -1, -1, 0, 18, 12,   0, 0, &KyraEngine_v2::seq_introWestwood, 160 },
    2317         { 1, "title.wsa", 0,    4, 0, -1, -1, 0, 26, 12,   0, 0, &KyraEngine_v2::seq_introTitle,    10 },
    2318         { 2, 0, "over.cps",     4, 0, -1, -1, 0, 1,  3600, 0, 0, &KyraEngine_v2::seq_introOverview, 30 },
    2319         { 2, 0, "library.cps",  4, 0, -1, -1, 0, 1,  3600, 0, 0, &KyraEngine_v2::seq_introLibrary,  30 },
    2320         { 2, 0, "hand.cps",     4, 0, -1, -1, 0, 1,  3600, 0, 0, &KyraEngine_v2::seq_introHand,     90 },
    2321         { 1, "point.wsa", 0,    4, 8, -1, -1, 0, 38, 7,    0, 0, &KyraEngine_v2::seq_introPoint,    200 },
    2322         { 1, "zanfaun.wsa", 0,  4, 0, -1, -1, 0, 51, 16,   0, 0, &KyraEngine_v2::seq_introZanfaun,  240 },
    2323 
    2324         { 1, "funters.wsa", 0,  4, 0, -1, -1, 0, 27, 12,   0, 0, &KyraEngine_v2::seq_finaleFunters, 30 },
    2325         { 1, "ferb.wsa", 0,             4, 0, -1, -1, 0, 27, 16,   0, 0, &KyraEngine_v2::seq_finaleFerb,        30 },
    2326         { 1, "fish.wsa", 0,             4, 0, -1, -1, 0, 56, 12,   0, 0, &KyraEngine_v2::seq_finaleFish,        30 },
    2327         { 1, "fheep.wsa", 0,    4, 0, -1, -1, 0, 11, 12,   0, 0, &KyraEngine_v2::seq_finaleFheep,       30 },
    2328         { 1, "farmer.wsa", 0,   4, 0, -1, -1, 0, 22, 12,   0, 0, &KyraEngine_v2::seq_finaleFarmer,      100 },
    2329         { 1, "fuards.wsa", 0,   4, 0, -1, -1, 0, 24, 14,   0, 0, &KyraEngine_v2::seq_finaleFuards,      30 },
    2330         { 1, "firates.wsa", 0,  4, 0, -1, -1, 0, 37, 12,   0, 0, &KyraEngine_v2::seq_finaleFirates,     30 },
    2331         { 1, "frash.wsa", 0,    4, 0, -1, -1, 0, 12, 10,   0, 0, &KyraEngine_v2::seq_finaleFrash,       340 }
    2332 };
    2333 
    2334 const NestedSequence KyraEngine_v2::_nSequences[] = {
    2335         // flags, wsaFile, startframe, endFrame, frameDelay, callback, x, y, wsaControl, startupCommand, finalCommand, unk1;
    2336         { 0x0C, "figgle.wsa",  0, 3,   60, &KyraEngine_v2::seq_finaleFiggle,  0, 0, 0,                  0, 0, 0 },
    2337 
    2338         { 8,    "over1.wsa",   0, 10,  10, &KyraEngine_v2::seq_introOver1,    0, 0, 0,                  0, 0, 0 },
    2339         { 8,    "over2.wsa",   0, 11,  9,  &KyraEngine_v2::seq_introOver2,    0, 0, 0,                  0, 0, 0 },
    2340         { 8,    "forest.wsa",  0, 22,  6,  &KyraEngine_v2::seq_introForest,   0, 0, 0,                  1, 3, 0 },
    2341         { 8,    "dragon.wsa",  0, 11,  6,  &KyraEngine_v2::seq_introDragon,   0, 0, 0,                  2, 0, 0 },
    2342         { 2,    "darm.wsa",    0, 19,  9,  &KyraEngine_v2::seq_introDarm,     0, 0, 0,                  4, 0, 0 },
    2343         { 2,    "library.wsa", 0, 33,  9,  &KyraEngine_v2::seq_introLibrary2, 0, 0, 0,                  4, 0, 0 },
    2344         { 0x2A, "library.wsa", 0, 19,  9,  &KyraEngine_v2::seq_introLibrary2, 0, 0, _wsaControlLibrary, 0, 0, 0 },
    2345         { 0x0A, "marco.wsa",   0, 37,  9,  &KyraEngine_v2::seq_introMarco,    0, 0, 0,                  4, 0, 0 },
    2346         { 2,    "hand1a.wsa",  0, 34,  9,  &KyraEngine_v2::seq_introHand1a,   0, 0, 0,                  0, 0, 0 },
    2347         { 0x2A, "hand1b.wsa",  0, 16,  9,  &KyraEngine_v2::seq_introHand1b,   0, 0, _wsaControlHand1b,  0, 0, 0 },
    2348         { 0x2A, "hand1c.wsa",  0, 9,   9,  &KyraEngine_v2::seq_introHand1c,   0, 0, _wsaControlHand1c,  0, 0, 0 },
    2349         { 0x2C, "hand2.wsa",   0, 2,   9,  &KyraEngine_v2::seq_introHand2,    0, 0, _wsaControlHand2,   5, 0, 0 },
    2350         { 0x2C, "hand3.wsa",   0, 4,   9,  &KyraEngine_v2::seq_introHand3,    0, 0, _wsaControlHand3,   5, 0, 0 },
    2351         { 0x2C, "hand4.wsa",   0, 8,   9,  0,                                 0, 0, _wsaControlHand4,   5, 0, 0 }
    2352 };
    2353 
    2354 
    2355 const SequenceControl KyraEngine_v2::_wsaControlLibrary[] = {
    2356         {0x00, 0x0A}, {0x01, 0x0A}, {0x02, 0x0A}, {0x03, 0x0A}, {0x04, 0x0A}, {0x05, 0x0A},
    2357         {0x06, 0x0A}, {0x07, 0x0A}, {0x08, 0x0A}, {0x09, 0x0A}, {0x08, 0x0A}, {0x07, 0x0A},
    2358         {0x06, 0x0A}, {0x05, 0x28}, {0x04, 0x0A}, {0x03, 0x0A}, {0x02, 0x0A}, {0x01, 0x0A}
    2359 };
    2360 
    2361 const SequenceControl KyraEngine_v2::_wsaControlHand1b[] = {
    2362         {0x00, 0x06}, {0x01, 0x06}, {0x02, 0x06}, {0x03, 0x06}, {0x04, 0x06}, {0x05, 0x06},
    2363         {0x06, 0x06}, {0x07, 0x06}, {0x08, 0x06}, {0x09, 0x06}, {0x0A, 0x06}, {0x0B, 0x06},
    2364         {0x0B, 0x0C}, {0x0C, 0x0C}, {0x0D, 0x0C}, {0x0C, 0x0C}, {0x0B, 0x0C}
    2365 };
    2366 
    2367 const SequenceControl KyraEngine_v2::_wsaControlHand1c[] = {
    2368         {0x00, 0x06}, {0x01, 0x06}, {0x02, 0x06}, {0x03, 0x06}, {0x04, 0x06}, {0x03, 0x06},
    2369         {0x04, 0x06}, {0x05, 0x40}, {0x05, 0x06}
    2370 };
    2371 
    2372 const SequenceControl KyraEngine_v2::_wsaControlHand2[] = {
    2373         {0x00, 0x06}, {0x01, 0x06}, {0x00, 0x06}, {0x01, 0x06}, {0x00, 0x06}, {0x01, 0x06},
    2374         {0x00, 0x06}, {0x01, 0x06}, {0x00, 0x06}, {0x01, 0x06}, {0x00, 0x06}, {0x01, 0x06},
    2375         {0x00, 0x06}, {0x01, 0x06}, {0x00, 0x06}, {0x01, 0x06}
    2376 };
    2377 
    2378 const SequenceControl KyraEngine_v2::_wsaControlHand3[] = {
    2379         {0x00, 0x06}, {0x01, 0x06}, {0x02, 0x06}, {0x01, 0x06}, {0x00, 0x01}
    2380 };
    2381 
    2382 const SequenceControl KyraEngine_v2::_wsaControlHand4[] = {
    2383         {0x00, 0x06}, {0x01, 0x06}, {0x02, 0x06}, {0x03, 0x06}, {0x04, 0x06},
    2384         {0x03, 0x06}, {0x02, 0x06}, {0x01, 0x06}
    2385 };
    2386 
    23872279} // end of namespace Kyra
    23882280
    23892281
  • sound.h

     
    397397
    398398        Common::Mutex _mutex;
    399399
    400         static const uint8 _sfxBTTable[256];
     400        const uint8 *_sfxBTTable;
    401401        const uint8 *_sfxWDTable;
    402402};
    403403
  • sound_towns.cpp

     
    10861086
    10871087SoundTowns::SoundTowns(KyraEngine *vm, Audio::Mixer *mixer)
    10881088        : Sound(vm, mixer), _lastTrack(-1), _currentSFX(0), _sfxFileData(0),
    1089         _sfxFileIndex((uint)-1), _sfxWDTable(0), _parser(0) {
     1089        _sfxFileIndex((uint)-1), _sfxWDTable(0), _sfxBTTable(0), _parser(0) {
    10901090
    10911091        _driver = new SoundTowns_EuphonyDriver(_mixer);
    10921092        int ret = open();
     
    11091109bool SoundTowns::init() {
    11101110        _vm->checkCD();
    11111111        int unused = 0;
    1112         _sfxWDTable = _vm->staticres()->loadRawData(kKyra1TownsSFXTable, unused);
     1112        _sfxWDTable = _vm->staticres()->loadRawData(kKyra1TownsSFXwdTable, unused);
     1113        _sfxBTTable = _vm->staticres()->loadRawData(kKyra1TownsSFXbtTable, unused);
    11131114
    11141115        return loadInstruments();
    11151116}
     
    13551356        return (float) sampleRate * 10.0f * rateshift / outputRate;
    13561357}
    13571358
    1358 const uint8 SoundTowns::_sfxBTTable[256] = {
    1359         0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F,
    1360         0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F,
    1361         0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF,
    1362         0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF,
    1363         0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF,
    1364         0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF,
    1365         0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,
    1366         0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFE,
    1367         0x7F, 0x7F, 0x7E, 0x7D, 0x7C, 0x7B, 0x7A, 0x79, 0x78, 0x77, 0x76, 0x75, 0x74, 0x73, 0x72, 0x71,
    1368         0x70, 0x6F, 0x6E, 0x6D, 0x6C, 0x6B, 0x6A, 0x69, 0x68, 0x67, 0x66, 0x65, 0x64, 0x63, 0x62, 0x61,
    1369         0x60, 0x5F, 0x5E, 0x5D, 0x5C, 0x5B, 0x5A, 0x59, 0x58, 0x57, 0x56, 0x55, 0x54, 0x53, 0x52, 0x51,
    1370         0x50, 0x4F, 0x4E, 0x4D, 0x4C, 0x4B, 0x4A, 0x49, 0x48, 0x47, 0x46, 0x45, 0x44, 0x43, 0x42, 0x41,
    1371         0x40, 0x3F, 0x3E, 0x3D, 0x3C, 0x3B, 0x3A, 0x39, 0x38, 0x37, 0x36, 0x35, 0x34, 0x33, 0x32, 0x31,
    1372         0x30, 0x2F, 0x2E, 0x2D, 0x2C, 0x2B, 0x2A, 0x29, 0x28, 0x27, 0x26, 0x25, 0x24, 0x23, 0x22, 0x21,
    1373         0x20, 0x1F, 0x1E, 0x1D, 0x1C, 0x1B, 0x1A, 0x19, 0x18, 0x17, 0x16, 0x15, 0x14, 0x13, 0x12, 0x11,
    1374         0x10, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01
    1375 };
    1376 
    13771359//      KYRA 2
    13781360
    13791361SoundTowns_v2::SoundTowns_v2(KyraEngine *vm, Audio::Mixer *mixer)
     
    14131395        if (track == _lastTrack && _musicEnabled)
    14141396                return;
    14151397
    1416         const uint8 * const cdaTracks = (const uint8 * const) cdaData();
     1398        const uint16 * const cdaTracks = (const uint16 * const) cdaData();
    14171399
    14181400        int trackNum = -1;
    14191401        for (uint32 i = 0; i < cdaTrackNum(); i++) {
  • staticres.cpp

     
    3535
    3636namespace Kyra {
    3737
    38 #define RESFILE_VERSION 17
     38#define RESFILE_VERSION 18
    3939
    4040bool StaticResource::checkKyraDat() {
    4141        Common::File kyraDat;
     
    211211                // PALETTE table
    212212                { kPaletteList, kPaletteTable, "1 33 PALTABLE" },
    213213
     214                // AUDIO files
     215                { kAudioTracks, kStringList, "TRACKS.TXT" },
     216                { kAudioTracksIntro, kStringList, "TRACKSINT.TXT" },
     217
    214218                // FM-TOWNS specific
    215                 { kKyra1TownsSFXTable, kRawData, "SFXTABLE" },
     219                { kKyra1TownsSFXwdTable, kRawData, "SFXWDTABLE" },
     220                { kKyra1TownsSFXbtTable, kRawData, "SFXBTTABLE" },
     221                { kKyra1TownsCDATable, kRawData, "CDATABLE" },
    216222                { kCreditsStrings, kRawData, "CREDITS" },
    217223
    218224                { 0, 0, 0 }
    219225        };
    220226
     227        static const FilenameTable kyra2StaticRes[] = {
     228                // Sequence Player
     229                { k2SeqplayPakFiles, kStringList, "S_PAKFILES.TXT" },
     230                { k2SeqplayCredits, kRawData, "S_CREDITS.TXT" },
     231                { k2SeqplayStrings, kLanguageList, "S_STRINGS." },
     232                { k2SeqplaySfxFiles, kStringList, "S_SFXFILES.TXT" },
     233                { k2SeqplayTlkFiles, kLanguageList, "S_TLKFILES." },
     234                { k2SeqplaySeqData, kRawData, "S_DATA.SEQ" },
     235                { k2SeqplayIntroTracks, kStringList, "S_INTRO.TRA" },
     236                { k2SeqplayFinaleTracks, kStringList, "S_FINALE.TRA" },
     237                { k2SeqplayIntroCDA, kRawData, "S_INTRO.CDA" },
     238                { k2SeqplayFinaleCDA, kRawData, "S_FINALE.CDA" },
     239
     240                // Ingame
     241                { k2IngamePakFiles, kStringList, "I_PAKFILES.TXT" },
     242                { k2IngameTracks, kStringList, "I_TRACKS.TRA" },
     243                { k2IngameCDA, kRawData, "I_TRACKS.CDA" },
     244
     245                { 0, 0, 0 }
     246        };
     247
    221248        if (_vm->game() == GI_KYRA1) {
    222249                _builtIn = 0;
    223250                _filenameTable = kyra1StaticRes;
    224         } else if (_vm->game() == GI_KYRA2 || _vm->game() == GI_KYRA3) {
     251        } else if (_vm->game() == GI_KYRA2) {
     252                _builtIn = 0;
     253                _filenameTable = kyra2StaticRes;
     254        } else if (_vm->game() == GI_KYRA3) {
    225255                return true;
    226256        } else {
    227257                error("unknown game ID");
     
    601631uint8 *StaticResource::getFile(const char *name, int &size) {
    602632        char buffer[64];
    603633        const char *ext = "";
     634        if (_vm->gameFlags().gameID == GI_KYRA2)
     635                ext = ".K2";
     636        snprintf(buffer, 64, "%s%s", name, ext);
     637        ext = "";
     638
    604639        if (_vm->gameFlags().isTalkie)
    605640                ext = ".CD";
    606641        else if (_vm->gameFlags().isDemo)
     
    609644                ext = ".TNS";
    610645        else if (_vm->gameFlags().platform == Common::kPlatformAmiga)
    611646                ext = ".AMG";
    612         snprintf(buffer, 64, "%s%s", name, ext);
     647        strcat(buffer, ext);
    613648        uint32 tempSize = 0;
    614649        uint8 *data = _vm->resource()->fileData(buffer, &tempSize);
    615650        size = tempSize;
     
    680715        _guiStrings = _staticres->loadStrings(kGUIStrings, _guiStringsSize);
    681716        _configStrings = _staticres->loadStrings(kConfigStrings, _configStringsSize);
    682717
     718        _soundFiles = _staticres->loadStrings(kAudioTracks, _soundFilesSize);
     719        _soundFilesIntro = _staticres->loadStrings(kAudioTracksIntro, _soundFilesIntroSize);
     720        _cdaTrackTable = (const int32*) _staticres->loadRawData(kKyra1TownsCDATable, _cdaTrackTableSize);
     721
    683722        // copied static res
    684723
    685724        // room list
     
    707746
    708747                _staticres->unloadId(kDefaultShapes);
    709748        }
     749
     750        // audio data tables
     751        static const AudioDataStruct soundData_PC[] = {
     752                { _soundFilesIntro, _soundFilesIntroSize, 0, 0 },
     753                { _soundFiles, _soundFilesSize, 0, 0 },
     754                { 0, 0, 0, 0}
     755        };
     756
     757        static const AudioDataStruct soundData_TOWNS[] = {
     758                { _soundFiles, _soundFilesSize, _cdaTrackTable, _cdaTrackTableSize },
     759                { _soundFiles, _soundFilesSize, _cdaTrackTable, _cdaTrackTableSize },
     760                { 0, 0, 0, 0}
     761        };
     762        _soundData = (_flags.platform == Common::kPlatformPC) ? soundData_PC : soundData_TOWNS;
    710763}
    711764
    712765void KyraEngine_v1::loadMouseShapes() {
     
    854907        _screen->copyRegion(0, 0, 0, 0, 320, 200, page, 0);
    855908}
    856909
     910void KyraEngine_v2::initStaticResource() {
     911        int tmp = 0;
     912
     913        _sequencePakList = _staticres->loadStrings(k2SeqplayPakFiles, _sequencePakListSize);
     914        _ingamePakList = _staticres->loadStrings(k2IngamePakFiles, _ingamePakListSize);
     915        _sequenceStrings = _staticres->loadStrings(k2SeqplayStrings, _sequenceStringsSize);
     916        _sequenceSoundList = (char* const*)_staticres->loadStrings(k2SeqplaySfxFiles, _sequenceSoundListSize);
     917        _musicFileListIntro = _staticres->loadStrings(k2SeqplayIntroTracks, _musicFileListIntroSize);
     918        _musicFileListIngame = _staticres->loadStrings(k2IngameTracks, _musicFileListIngameSize);
     919        _musicFileListFinale = _staticres->loadStrings(k2SeqplayFinaleTracks, _musicFileListFinaleSize);
     920        _cdaTrackTableIntro = _staticres->loadRawData(k2SeqplayIntroCDA, _cdaTrackTableIntroSize);
     921        _cdaTrackTableIngame = _staticres->loadRawData(k2IngameCDA, _cdaTrackTableIngameSize);
     922        _cdaTrackTableFinale = _staticres->loadRawData(k2SeqplayFinaleCDA, _cdaTrackTableFinaleSize);
     923
     924        // replace sequence talkie files with localized versions and cut off .voc
     925        // suffix from voc files so as to allow compression specific file extensions
     926        const char* const* tlkfiles = _staticres->loadStrings(k2SeqplayTlkFiles, tmp);
     927        for (int i = 0; i < _sequenceSoundListSize; i++) {
     928                uint32 len = strlen(_sequenceSoundList[i]);
     929                if (_flags.platform == Common::kPlatformPC)
     930                        len -= 4;
     931
     932                if (tlkfiles) {
     933                        for (int ii = 0; ii < tmp; ii++) {
     934                                if (!stricmp(&_sequenceSoundList[i][1], &tlkfiles[ii][1]))
     935                                        strcpy(_sequenceSoundList[i], tlkfiles[ii]);
     936                        }
     937                }
     938
     939                *(&_sequenceSoundList[i][len]) = 0;
     940        }
     941       
     942        // assign music data
     943        static const char *fmtMusicFileListIntro[] = { "intro" };
     944        static const char *fmtMusicFileListFinale[] = { "finale" };
     945        static const char *fmtMusicFileListIngame[] = { "k2" };
     946
     947        static const AudioDataStruct soundData_PC[] = {
     948                { _musicFileListIntro, _musicFileListIntroSize, 0, 0 },
     949                { _musicFileListIngame, _musicFileListIngameSize, 0, 0},
     950                { _musicFileListFinale, _musicFileListIntroSize, 0, 0 }
     951        };
     952
     953        static const AudioDataStruct soundData_TOWNS[] = {
     954                { fmtMusicFileListIntro, 1, _cdaTrackTableIntro, _cdaTrackTableIntroSize >> 1 },
     955                { fmtMusicFileListIngame, 1, _cdaTrackTableIngame, _cdaTrackTableIngameSize >> 1 },
     956                { fmtMusicFileListFinale, 1, _cdaTrackTableFinale, _cdaTrackTableFinaleSize >> 1 }
     957        };
     958        _soundData = (_flags.platform == Common::kPlatformPC) ? soundData_PC : soundData_TOWNS;
     959
     960        // setup sequence data
     961        const uint8 *seqData = _staticres->loadRawData(k2SeqplaySeqData, tmp);
     962       
     963        static const Seqproc hofSequenceCallbacks[] = { 0,
     964                &KyraEngine_v2::seq_introWestwood,
     965                &KyraEngine_v2::seq_introTitle, &KyraEngine_v2::seq_introOverview,
     966                &KyraEngine_v2::seq_introLibrary, &KyraEngine_v2::seq_introHand,
     967                &KyraEngine_v2::seq_introPoint, &KyraEngine_v2::seq_introZanfaun,
     968                &KyraEngine_v2::seq_finaleFunters, &KyraEngine_v2::seq_finaleFerb,
     969                &KyraEngine_v2::seq_finaleFish, &KyraEngine_v2::seq_finaleFheep,
     970                &KyraEngine_v2::seq_finaleFarmer, &KyraEngine_v2::seq_finaleFuards,
     971                &KyraEngine_v2::seq_finaleFirates, &KyraEngine_v2::seq_finaleFrash
     972        };
     973
     974        static const Seqproc hofNestedSequenceCallbacks[] = {
     975                &KyraEngine_v2::seq_finaleFiggle, &KyraEngine_v2::seq_introOver1,
     976                &KyraEngine_v2::seq_introOver2, &KyraEngine_v2::seq_introForest,
     977                &KyraEngine_v2::seq_introDragon, &KyraEngine_v2::seq_introDarm,
     978                &KyraEngine_v2::seq_introLibrary2, &KyraEngine_v2::seq_introLibrary2,
     979                &KyraEngine_v2::seq_introMarco, &KyraEngine_v2::seq_introHand1a,
     980                &KyraEngine_v2::seq_introHand1b, &KyraEngine_v2::seq_introHand1c,
     981                &KyraEngine_v2::seq_introHand2, &KyraEngine_v2::seq_introHand3, 0
     982        };
     983
     984        static const Seqproc hofDemoSequenceCallbacks[] = {
     985                0 // XXX
     986        };
     987
     988        static const Seqproc hofDemoNestedSequenceCallbacks[] = {
     989                0 // XXX
     990        };
     991
     992        static const Seqproc lolDemoSequenceCallbacks[] = {
     993                0 // XXX
     994        };
     995
     996        uint16 *hdr = (uint16*) seqData;
     997        uint16 numSeq = READ_LE_UINT16(hdr++);
     998        uint16 hdrSize = READ_LE_UINT16(hdr) - 1;
     999
     1000        const Seqproc * cb = hofSequenceCallbacks;
     1001        const Seqproc * ncb = hofNestedSequenceCallbacks;
     1002
     1003        _sequences = new Sequence[numSeq];
     1004        for (int i = 0; i < numSeq; i++) {
     1005                uint8 *offset = (uint8 *) (seqData + READ_LE_UINT16(hdr++));
     1006                _sequences[i].flags = READ_LE_UINT16(offset);
     1007                offset += 2;
     1008                _sequences[i].wsaFile = (const char *) offset;
     1009                offset += 14;
     1010                _sequences[i].cpsFile = (const char *) offset;
     1011                offset += 14;
     1012                _sequences[i].startupCommand = *offset++;
     1013                _sequences[i].finalCommand = *offset++;
     1014                _sequences[i].stringIndex1 = READ_LE_UINT16(offset);
     1015                offset += 2;
     1016                _sequences[i].stringIndex2 = READ_LE_UINT16(offset);
     1017                offset += 2;
     1018                _sequences[i].startFrame = READ_LE_UINT16(offset);
     1019                offset += 2;
     1020                _sequences[i].numFrames = READ_LE_UINT16(offset);
     1021                offset += 2;
     1022                _sequences[i].frameDelay = READ_LE_UINT16(offset);
     1023                offset += 2;
     1024                _sequences[i].xPos = READ_LE_UINT16(offset);
     1025                offset += 2;
     1026                _sequences[i].yPos = READ_LE_UINT16(offset);
     1027                offset += 2;
     1028                _sequences[i].duration = READ_LE_UINT16(offset);
     1029                _sequences[i].callback = cb[i];
     1030        }
     1031
     1032        if (hdr > ((uint16*)(seqData + hdrSize)))
     1033                return;
     1034
     1035        numSeq = READ_LE_UINT16(hdr++);
     1036        _nSequences = new NestedSequence[numSeq];
     1037        for (int i = 0; i < numSeq; i++) {
     1038                uint8 *offset = (uint8 *) (seqData + READ_LE_UINT16(hdr++));
     1039                _nSequences[i].flags = READ_LE_UINT16(offset);
     1040                offset += 2;
     1041                _nSequences[i].wsaFile = (const char *) offset;
     1042                offset += 14;
     1043                _nSequences[i].startframe = READ_LE_UINT16(offset);
     1044                offset += 2;
     1045                _nSequences[i].endFrame = READ_LE_UINT16(offset);
     1046                offset += 2;
     1047                _nSequences[i].frameDelay = READ_LE_UINT16(offset);
     1048                offset += 2;
     1049                _nSequences[i].x = READ_LE_UINT16(offset);
     1050                offset += 2;
     1051                _nSequences[i].y = READ_LE_UINT16(offset);
     1052                offset += 2;
     1053                uint16 ctrlOffs = READ_LE_UINT16(offset);
     1054                offset += 2;
     1055                _nSequences[i].startupCommand = READ_LE_UINT16(offset);
     1056                offset += 2;
     1057                _nSequences[i].finalCommand = READ_LE_UINT16(offset);
     1058                _nSequences[i].callback = ncb[i];
     1059                _nSequences[i].wsaControl = ctrlOffs ? (uint16*) (seqData + ctrlOffs) : 0;
     1060        }
     1061}
     1062
    8571063const ScreenDim Screen::_screenDimTable[] = {
    8581064        { 0x00, 0x00, 0x28, 0xC8, 0x0F, 0x0C, 0x00, 0x00 },
    8591065        { 0x08, 0x48, 0x18, 0x38, 0x0F, 0x0C, 0x00, 0x00 },
     
    9041110         0, -2, -2, -2,  0,  2,  2,  2
    9051111};
    9061112
    907 const char *KyraEngine_v1::_soundFiles[] = {
    908         "KYRA1A",
    909         "KYRA1B",
    910         "KYRA2A",
    911         "KYRA3A",
    912         "KYRA4A",
    913         "KYRA4B",
    914         "KYRA5A",
    915         "KYRA5B",
    916         "KYRAMISC",
    917         "INTRO"
    918 };
    919 
    920 const char *KyraEngine_v1::_soundFilesTowns[] = {
    921         "TW_INTRO.SFX",
    922         "TW_SCEN1.SFX",
    923         "TW_SCEN2.SFX",
    924         "TW_SCEN3.SFX",
    925         "TW_SCEN4.SFX",
    926         "TW_SCEN5.SFX"
    927 };
    928 
    929 const int32 KyraEngine_v1::_cdaTrackTable[] = {
    930         0x04000, 1,  0, 0x05480, 1,  6, 0x05E70, 0,  1,
    931         0x06D90, 1,  3, 0x072C0, 0, -1, 0x075F0, 1, -1,
    932         0x07880, 1, -1, 0x089C0, 0, -1, 0x09080, 0, -1,
    933         0x091D0, 1,  4, 0x0A880, 1,  5, 0x0AF50, 0, -1,
    934         0x0B1A0, 1, -1, 0x0B870, 0, -1, 0x0BCF0, 1, -1,
    935         0x0C5D0, 1,  7, 0x0D3E0, 1,  8, 0x0e7b0, 1,  2,
    936         0x0edc0, 0, -1, 0x0eef0, 1,  9, 0x10540, 1, 10,
    937         0x10d80, 0, -1, 0x10E30, 0, -1, 0x10FC0, 0, -1,
    938         0x11310, 1, -1, 0x11A20, 1, -1, 0x12380, 0, -1,
    939         0x12540, 1, -1, 0x12730, 1, -1, 0x12A90, 1, 11,
    940         0x134D0, 0, -1, 0x00000, 0, -1, 0x13770, 0, -1,
    941         0x00000, 0, -1, 0x00000, 0, -1, 0x00000, 0, -1,
    942         0x00000, 0, -1, 0x14710, 1, 12, 0x15DF0, 1, 13,
    943         0x16030, 1, 14, 0x17030, 0, -1, 0x17650, 0, -1,
    944         0x134D0, 0, -1, 0x178E0, 1, -1, 0x18200, 0, -1,
    945         0x18320, 0, -1, 0x184A0, 0, -1, 0x18BB0, 0, -1,
    946         0x19040, 0, 19, 0x19B50, 0, 20, 0x17650, 0, -1,
    947         0x1A730, 1, 21, 0x00000, 0, -1, 0x12380, 0, -1,
    948         0x1B810, 0, -1, 0x1BA50, 0, 15, 0x1C190, 0, 16,
    949         0x1CA50, 0, 17, 0x1D100, 0, 18
    950 };
    951 
    952 const AudioDataStruct KyraEngine_v1::_soundData_PC[] = {
    953         { _soundFiles, ARRAYSIZE(_soundFiles), 0, 0 },
    954         { 0, 0, 0, 0}
    955 };
    956 
    957 const AudioDataStruct KyraEngine_v1::_soundData_TOWNS[] = {
    958         { _soundFilesTowns, ARRAYSIZE(_soundFilesTowns), _cdaTrackTable, ARRAYSIZE(_cdaTrackTable) },
    959         { 0, 0, 0, 0}
    960 };
    9611113const int8 KyraEngine_v1::_charXPosTable[] = {
    9621114         0,  4,  4,  4,  0, -4, -4, -4
    9631115};
     
    11821334
    11831335// kyra 2 static res
    11841336
    1185 const char *KyraEngine_v2::_sequenceStrings_PC_EN[] = {
    1186         "Kyrandia is disappearing!",
    1187         "Rock by rock...",
    1188         "...and tree by tree.",
    1189         "Kyrandia ceases to exist!",
    1190         "The Royal Mystics are baffled.",
    1191         "Every reference has been consulted.",
    1192         "Even Marko and his new valet have been allowed into the conference.",
    1193         "Luckily, the Hand was experienced in these matters.",
    1194         "And finally a plan was approved...",
    1195         "...that required a magic Anchor Stone...",
    1196         "...to be retrieved from the center of the world.",
    1197         "Zanthia, youngest of the Kyrandian Mystics, has been selected to retrieve the Stone.",
    1198         "Thank you for playing The Hand of Fate.",
    1199         "This should be enough blueberries to open a portal to the center of the world.",
    1200         " DUMMY STRING... ",
    1201         " DUMMY STRING... ",
    1202         "Hey! All my equipment has been stolen!",
    1203         " DUMMY STRING... ",
    1204         "If they think I'm going to walk all the way down there, they're nuts!",
    1205         " DUMMY STRING... ",
    1206         " DUMMY STRING... ",
    1207         "Hurry up Faun!",
    1208 
    1209         "Boy, that was a close call!",
    1210         "You said it pal. I, for one, am never going hunting again!",
    1211         "Ribbit.",
    1212         "How many times do I have to tell you? You're a toad.",
    1213         "Oh no! We're out of cheese!",
    1214         "Let's try this earwax. It's orange.",
    1215         "Mommy, when do I get the ivy?",
    1216         "Get out of here, shoo!",
    1217         "You cut, and I'll choose.",
    1218         "No. You cut and I'll choose.",
    1219         "I still say it was derivative drivel.",
    1220         "Aw, you still wouldn't recognize iambic pentameter if it bit you on the butt!",
    1221 
    1222         "Executive Producer",
    1223         "Brett W. Sperry",
    1224         "Direction & Design",
    1225         "Rick Gush",
    1226         "Lead Programmer",
    1227         "Michael Legg",
    1228         "Art Management",
    1229         "Louis Castle",
    1230         "Joseph B. Hewitt IV",
    1231         "Lead Artist",
    1232         "Rick Parks",
    1233         "Additional Coding by",
    1234         "Philip W. Gorrow",
    1235         "Mike Grayford",
    1236         "Mark McCubbin",
    1237         "Artists",
    1238         "Cameron Chun",
    1239         "Cary Averett",
    1240         "Cindy Chinn",
    1241         "Elie Arabian",
    1242         "Fei Cheng",
    1243         "Ferby Miguel",
    1244         "Frank Mendeola",
    1245         "Jack Martin",
    1246         "Jerry Moore",
    1247         "DUMMY STRING... ",
    1248         "Judith Peterson",
    1249         "Larry Miller",
    1250         "Lenny Lee",
    1251         "Louise Sandoval",
    1252         "Ren Olsen",
    1253         "Music & Sounds by",
    1254         "Paul Mudra",
    1255         "Frank Klepacki",
    1256         "Dwight Okahara",
    1257         "Pat Collins",
    1258         "Quality Assurance by",
    1259         "Glenn Sperry",
    1260         "Michael Lightner",
    1261         "William Foster",
    1262         "Jesse Clemit",
    1263         "Jeff Fillhaber",
    1264         "Manual, Package Design",
    1265         "& Fulfillment",
    1266         "Eydie Laramore",
    1267         "Lisa Marcinko",
    1268         "Lauren Rifkin",
    1269         "Congratulations!",
    1270         "Thank you for playing The Hand of Fate!",
    1271         "Guest Coding",
    1272         "Producer Liaison",
    1273         "Scott Duckett",
    1274         "Irvine Testers",
    1275         "Chris McFarland",
    1276         "Paul Moore",
    1277         "Chad Soares",
    1278         "Jared Brinkley",
    1279         "Jon Willliams",
    1280         "Chris Toft",
    1281         "Joe Kucan's Hair by",
    1282         "Theodore A. Morris",
    1283         "Load a game",
    1284         "Introduction",
    1285         "Start a new game",
    1286         "Exit the game",
    1287         "Special Thanks, to",
    1288         "Sake Joe Bostic-san",
    1289         "Tim Fritz",
    1290         "Kenny Dunne",
    1291         "Thank you for playing \"The Hand of Fate\"."
    1292 };
    1293 
    1294 const char *KyraEngine_v2::_sequenceStrings_TOWNS_EN[] = {
    1295         "Kyrandia is disappearing!",
    1296         "Rock by rock...",
    1297         "...and tree by tree.",
    1298         "Kyrandia ceases to exist!",
    1299         "The Royal Mystics are baffled.",
    1300         "Every reference has been consulted.",
    1301         "Even Marko and his new valet have been allowed into the conference.",
    1302         "Luckily, the Hand was experienced in these matters.",
    1303         "And finally a plan was approved...",
    1304         "...that required a magic Anchor Stone...",
    1305         "...to be retrieved from the center of the world.",
    1306         "Zanthia, youngest of the Kyrandian Mystics, has been selected to retrieve the Stone.",
    1307         "Thank you for playing The Hand of Fate.",
    1308         "This should be enough blueberries to open a portal to the center of the world.",
    1309         " DUMMY STRING... ",
    1310         " DUMMY STRING... ",
    1311         "Hey! All my equipment has been stolen!",
    1312         " DUMMY STRING... ",
    1313         "If they think I'm going to walk all the way down there, they're nuts!",
    1314         " DUMMY STRING... ",
    1315         " DUMMY STRING... ",
    1316         "Hurry up Faun!",
    1317 
    1318         "Boy, that was a close call!",
    1319         "You said it pal. I, for one, am never going hunting again!",
    1320         "Ribbit.",
    1321         "How many times do I have to tell you? You're a toad.",
    1322         "Oh no! We're out of cheese!",
    1323         "Let's try this earwax. It's orange.",
    1324         "Mommy, when do I get the ivy?",
    1325         "Get out of here, shoo!",
    1326         "You cut, and I'll choose.",
    1327         "No. You cut and I'll choose.",
    1328         "I still say it was derivative drivel.",
    1329         "Aw, you still wouldn't recognize iambic pentameter if it bit you on the butt!",
    1330 
    1331         "Executive Producer",
    1332         "Brett W. Sperry",
    1333         "Designed & Directed by",
    1334         "Rick Gush",
    1335         "Lead Programmer",
    1336         "Michael Legg",
    1337         "Art Management",
    1338         "Louis Castle",
    1339         "Joseph B. Hewitt IV",
    1340         "Lead Artist",
    1341         "Rick Parks",
    1342         "Additional Coding by",
    1343         "Philip W. Gorrow",
    1344         "Matt Collins",
    1345         "Mark McCubbin",
    1346         "Artists",
    1347         "Cameron Chun",
    1348         "Cary Averett",
    1349         "Cindy Chinn",
    1350         "Elie Arabian",
    1351         "Fei Cheng",
    1352         "Ferby Miguel",
    1353         "Frank Mendeola",
    1354         "Jack Martin",
    1355         "Jerry Moore",
    1356         "",
    1357         "Judith Peterson",
    1358         "Larry Miller",
    1359         "Lenny Lee",
    1360         "Louise Sandoval",
    1361         "Ren Olsen",
    1362         "Music & Sounds by",
    1363         "Paul Mudra",
    1364         "Frank Klepacki",
    1365         "Dwight Okahara",
    1366         "Pat Collins",
    1367         "Qualilty Assurance by",
    1368         "Glenn Sperry",
    1369         "Michael Lightner",
    1370         "William Foster",
    1371         "Jesse Clemit",
    1372         "Jeff Fillhaber",
    1373         "Manual, Package Design",
    1374         "& Fulfillment",
    1375         "Eydie Laramore",
    1376         "Lisa Marcinko",
    1377         "Lauren Rifkin",
    1378         "Congratulations!",
    1379         "Thank you for playing The Hand of Fate!",
    1380         "Guest Coding",
    1381         "Producer Liaison",
    1382         "Scott Duckett",
    1383         "Irvine Testers",
    1384         "Chris McFarland",
    1385         "Paul Moore",
    1386         "Chad Soares",
    1387         "Jared Brinkley",
    1388         "Jon Willliams",
    1389         "Chris Toft",
    1390         "Chris's Hair by",
    1391         "Cumulo Nimbus",
    1392         "Load a game",
    1393         "Introduction",
    1394         "Start a new game",
    1395         "Exit the game",
    1396         "Special Thanks to",
    1397         "Sake Joe Bostic-san",
    1398         "Tim Fritz",
    1399         "Kenny Dunne",
    1400         "Yukio Sekiguchi (Japan)",
    1401         "Takeshi Abo (Japan)"
    1402 };
    1403 
    1404 const int KyraEngine_v2::_sequenceStringsSize_PC_EN = ARRAYSIZE(KyraEngine_v2::_sequenceStrings_PC_EN);
    1405 const int KyraEngine_v2::_sequenceStringsSize_TOWNS_EN = ARRAYSIZE(KyraEngine_v2::_sequenceStrings_TOWNS_EN);
    1406 
    1407 const char *KyraEngine_v2::_sequenceSoundList_PC[] = {
    1408         "eintro1",
    1409         "eintro2",
    1410         "eintro3",
    1411         "eintro4",
    1412         "eintro5",
    1413         "eintro6",
    1414         "eintro7",
    1415         "eintro8",
    1416         "eintro9",
    1417         "eintro10",
    1418         "eintro11",
    1419         "eintro12",
    1420         "eglow",
    1421         "0000210",
    1422         "0000130",
    1423         "0000180",
    1424         "0000160",
    1425 
    1426         "asong",
    1427         "crowcaw",
    1428         "eyerub2",
    1429         "pluck3",
    1430         "rodnreel",
    1431         "frog1",
    1432         "scavmov2",
    1433         "lambmom3",
    1434         "lambkid1",
    1435         "thunder2",
    1436         "thunder3",
    1437         "wind6",
    1438         "h2odrop2",
    1439         "gasleak",
    1440         "polgulp1",
    1441         "hndslap1",
    1442         "burp1",
    1443         "0000220",
    1444         "0000230",
    1445         "0000250",
    1446         "0000260",
    1447         "0000270",
    1448         "0000280",
    1449         "0000290",
    1450         "0000300",
    1451         "0000310",
    1452         "0000320",
    1453         "0000330",
    1454         "scream1",
    1455         "theend"
    1456 };
    1457 
    1458 const char *KyraEngine_v2::_sequenceSoundList_PCFLOPPY[] = {
    1459         "intro1",
    1460         "intro2",
    1461         "intro3",
    1462         "intro4",
    1463         "intro5",
    1464         "intro6",
    1465         "intro7",
    1466         "intro8",
    1467         "intro9",
    1468         "intro10",
    1469         "intro11",
    1470         "intro12",
    1471         "glow",
    1472 
    1473         "asong",
    1474         "crowcaw",
    1475         "eyerub2",
    1476         "pluck3",
    1477         "rodnreel",
    1478         "frog1",
    1479         "scavmov2",
    1480         "lambmom3",
    1481         "lambkid1",
    1482         "thunder2",
    1483         "thunder3",
    1484         "wind6",
    1485         "h2odrop2",
    1486         "gasleak",
    1487         "polgulp1",
    1488         "hndslap1",
    1489         "burp1",
    1490         "scream1",
    1491         "theend"
    1492 };
    1493 
    1494 const char *KyraEngine_v2::_sequenceSoundList_TOWNS[] = {
    1495         "intro1.pcm",
    1496         "intro2.pcm",
    1497         "intro3.pcm",
    1498         "intro4.pcm",
    1499         "intro5.pcm",
    1500         "intro6.pcm",
    1501         "intro7.pcm",
    1502         "intro8.pcm",
    1503         "intro9.pcm",
    1504         "intro10.pcm",
    1505         "intro11.pcm",
    1506         "intro12.pcm",
    1507         "glow.pcm",
    1508 
    1509         "asong.pcm",
    1510         "crowcaw.pcm",
    1511         "eyerub2.pcm",
    1512         "pluck3.pcm",
    1513         "rodnreel.pcm",
    1514         "frog1.pcm",
    1515         "scavmov2.pcm",
    1516         "lambmom3.pcm",
    1517         "lambkid1.pcm",
    1518         "thunder2.pcm",
    1519         "thunder3.pcm",
    1520         "wind6.pcm",
    1521         "h2odrop2.pcm",
    1522         "gasleak.pcm",
    1523         "polgulp1.pcm",
    1524         "hndslap1.pcm",
    1525         "burp1.pcm",
    1526         "scream1.pcm",
    1527         "theend.pcm"
    1528 };
    1529 
    1530 const int KyraEngine_v2::_sequenceSoundListSize_PC = ARRAYSIZE(KyraEngine_v2::_sequenceSoundList_PC);
    1531 const int KyraEngine_v2::_sequenceSoundListSize_PCFLOPPY = ARRAYSIZE(KyraEngine_v2::_sequenceSoundList_PCFLOPPY);
    1532 const int KyraEngine_v2::_sequenceSoundListSize_TOWNS = ARRAYSIZE(KyraEngine_v2::_sequenceSoundList_TOWNS);
    1533 
    15341337const uint8 KyraEngine_v2::_seqTextColorPresets[] = { 0x01, 0x01, 0x00, 0x3f, 0x3f, 0x3f };
    15351338
    15361339const char *KyraEngine_v2::_languageExtension[] = {
     
    15861389        0,    2,    0,    0,    0,    0,    0,    0
    15871390};
    15881391
    1589 const char *KyraEngine_v2::_dosSoundFileListIntro[] = { "K2INTRO" };
    1590 const char *KyraEngine_v2::_dosSoundFileListFinale[] = { "K2FINALE" };
    1591 
    1592 const char *KyraEngine_v2::_dosSoundFileList[] = {
    1593         "K2TEST1",
    1594         "K2TEST2",
    1595         "K2TEST3",
    1596         "K2TEST4",
    1597         "K2TEST5",
    1598         "K2TEST6",
    1599         "K2TEST7",
    1600         "K2TEST8",
    1601         "K2TEST9",
    1602         "K2TEST10",
    1603         "K2TEST11",
    1604         "K2TEST12",
    1605         "K2TEST13",
    1606         "K2TEST14",
    1607         "K2TEST15"
    1608 };
    1609 
    1610 const char *KyraEngine_v2::_fmtSoundFileListIntro[] = { "intro" };
    1611 const char *KyraEngine_v2::_fmtSoundFileListFinale[] = { "finale" };
    1612 const char *KyraEngine_v2::_fmtSoundFileList[] = { "k2" };
    1613 
    1614 const uint8 KyraEngine_v2::_cdaTrackTableIntro[] =      {
    1615         0x03, 0x01, 0x04, 0x02, 0x05, 0x03, 0x06, 0x04, 0x07, 0x05, 0x08, 0x06
    1616 };
    1617 
    1618 const uint8 KyraEngine_v2::_cdaTrackTableIngame[] =     {
    1619         0x02, 0x07, 0x03, 0x08, 0x04, 0x09, 0x07, 0x0A, 0x0C, 0x0B, 0x0D, 0x0C, 0x0E, 0x0D, 0x0F, 0x0E,
    1620         0x10, 0x0F, 0x12, 0x10, 0x13, 0x11, 0x15, 0x12, 0x17, 0x13, 0x18, 0x14, 0x19, 0x15, 0x1A, 0x16,
    1621         0x1B, 0x17, 0x1C, 0x18, 0x1D, 0x19, 0x1E, 0x1A, 0x1F, 0x1B, 0x21, 0x1C, 0x22, 0x1D, 0x23, 0x1E,
    1622         0x24, 0x1F, 0x25, 0x20, 0x26, 0x21, 0x27, 0x22, 0x28, 0x23, 0x29, 0x24, 0x2A, 0x25, 0x2B, 0x26,
    1623         0x2C, 0x27, 0x2D, 0x28, 0x2E, 0x29, 0x2F, 0x2A, 0x30, 0x2B, 0x31, 0x2C, 0x32, 0x2D, 0x33, 0x2E,
    1624         0x34, 0x2F, 0x35, 0x30, 0x36, 0x31, 0x37, 0x32, 0x38, 0x33, 0x39, 0x34, 0x3A, 0x35, 0x3B, 0x36,
    1625         0x3C, 0x37, 0x3D, 0x38, 0x3E, 0x39, 0x3F, 0x3A, 0x40, 0x3B, 0x41, 0x3C, 0x42, 0x3D, 0x43, 0x3E,
    1626         0x44, 0x3F, 0x45, 0x40, 0x46, 0x41, 0x47, 0x42, 0x48, 0x43, 0x49, 0x44, 0x4A, 0x45, 0x4B, 0x46,
    1627         0x4C, 0x47, 0x4D, 0x48, 0x4E, 0x49, 0x4F, 0x4A, 0x50, 0x4B, 0x51, 0x4C, 0x52, 0x4D, 0x53, 0x4E,
    1628         0x54, 0x4F, 0x55, 0x50, 0x56, 0x51, 0x57, 0x52
    1629 };
    1630 
    1631 const uint8 KyraEngine_v2::_cdaTrackTableFinale[] =     {
    1632         0x03, 0x53, 0x04, 0x54
    1633 };
    1634 
    1635 const AudioDataStruct KyraEngine_v2::_soundData_PC[] = {
    1636         { _dosSoundFileListIntro, ARRAYSIZE(_dosSoundFileListIntro), 0, 0 },
    1637         { _dosSoundFileList, ARRAYSIZE(_dosSoundFileList), 0, 0},
    1638         { _dosSoundFileListFinale, ARRAYSIZE(_dosSoundFileListFinale), 0, 0 }
    1639 };
    1640 
    1641 const AudioDataStruct KyraEngine_v2::_soundData_TOWNS[] = {
    1642         { _fmtSoundFileListIntro, ARRAYSIZE(_fmtSoundFileListIntro), _cdaTrackTableIntro, ARRAYSIZE(_cdaTrackTableIntro) >> 1 },
    1643         { _fmtSoundFileList, ARRAYSIZE(_fmtSoundFileList),_cdaTrackTableIngame, ARRAYSIZE(_cdaTrackTableIngame) >> 1 },
    1644         { _fmtSoundFileListFinale, ARRAYSIZE(_fmtSoundFileListFinale),_cdaTrackTableFinale, ARRAYSIZE(_cdaTrackTableFinale) >> 1 }
    1645 };
    1646 
    16471392const int KyraEngine_v2::_itemStringMapSize = ARRAYSIZE(KyraEngine_v2::_itemStringMap);
    16481393
    16491394const int8 KyraEngine_v2::_dosTrackMap[] = {