Ticket #8767: soundDataAssignment.patch
File soundDataAssignment.patch, 26.3 KB (added by , 17 years ago) |
---|
-
kyra.h
56 56 GI_KYRA3 = 2 57 57 }; 58 58 59 struct AudioDataStruct { 60 const char * const *_fileList; 61 const uint32 _fileListLen; 62 const void * const _cdaTracks; 63 const uint32 _cdaNumTracks; 64 }; 65 59 66 // TODO: this is just the start of makeing the debug output of the kyra engine a bit more useable 60 67 // in the future we maybe merge some flags and/or create new ones 61 68 enum kDebugLevels { -
kyra_v1.cpp
180 180 181 181 initStaticResource(); 182 182 183 if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) 184 _sound->setSoundFileList(_soundFilesTowns, _soundFilesTownsCount); 185 else 186 _sound->setSoundFileList(_soundFiles, _soundFilesCount); 183 const AudioDataStruct *const sndList = (_flags.platform == Common::kPlatformFMTowns || 184 _flags.platform == Common::kPlatformPC98) ? _soundData_TOWNS : _soundData_PC; 185 _sound->setSoundList(sndList); 187 186 188 187 _trackMap = _dosTrackMap; 189 188 _trackMapSize = _dosTrackMapSize; -
kyra_v1.h
764 764 const uint8 * const*_specialPalettes; 765 765 766 766 static const char *_soundFiles[]; 767 static const int _soundFilesCount;768 767 static const char *_soundFilesTowns[]; 769 static const int _soundFilesTownsCount; 770 768 static const int32 _cdaTrackTable[]; 769 static const AudioDataStruct _soundData_PC[]; 770 static const AudioDataStruct _soundData_TOWNS[]; 771 771 772 static const int8 _charXPosTable[]; 772 773 static const int8 _charYPosTable[]; 773 774 -
kyra_v2.cpp
139 139 _sequenceStrings = (const char * const *) _sequenceStrings_TOWNS_EN; 140 140 _sequenceStringsSize = _sequenceStringsSize_TOWNS_EN; 141 141 _sequences = (const Sequence*) _sequences_TOWNS; 142 } else { 142 _soundData = (const AudioDataStruct *) _soundData_TOWNS; 143 } else if (_flags.isTalkie) { 143 144 _sequenceSoundList = (const char * const *) _sequenceSoundList_PC; 144 145 _sequenceSoundListSize = _sequenceSoundListSize_PC; 145 146 _sequenceStrings = (const char * const *) _sequenceStrings_PC_EN; 146 147 _sequenceStringsSize = _sequenceStringsSize_PC_EN; 147 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; 148 157 } 149 158 150 159 for (int i = 0; i < 33; i++) … … 170 179 if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) 171 180 seq_showStarcraftLogo(); 172 181 173 seq_playSequences(kSequenceVirgin, kSequenceZanfaun); 174 //seq_playSequences(kSequenceFunters, kSequenceFrash); 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); 175 188 176 if (_menuChoice == 1) {177 // load just the pak files needed for ingame178 189 _res->unloadAllPakFiles(); 179 if (_flags.platform == Common::kPlatformPC && (_flags.isTalkie || _flags.isDemo)) { 180 _res->loadFileList("FILEDATA.FDT"); 181 } else if (_flags.platform == Common::kPlatformPC) { 182 //TODO: 183 //What files are needed for floppy version? 184 } else if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) { 185 char tmpfilename[13]; 186 static const char * pakfiles [] = { "KYRA.DAT", "AUDIO.PAK", "CAULDRON.PAK", 187 "MISC_CPS.PAK", "MISC_EMC.PAK", "OTHER.PAK", "VOC.PAK", "WSCORE.PAK" }; 188 for (int i = 0; i < 8; i++) 189 _res->loadPakFile(pakfiles[i]); 190 for (int i = 1; i < 10; i++) { 191 sprintf(tmpfilename, "COST%d_SH.PAK", i); 192 _res->loadPakFile(tmpfilename); 190 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 } 193 213 } 194 for (int i = 1; i < 6; i++) {195 sprintf(tmpfilename, "HOFCH_%d.PAK", i);196 _res->loadPakFile(tmpfilename);197 }198 214 } 215 } 199 216 217 if (_menuChoice == 1) { 200 218 startup(); 201 219 runLoop(); 202 220 cleanup(); 203 221 } else if (_menuChoice == 3) { 204 // Load Game 222 // TODO: Load Game 223 224 } else if (_menuChoice == 2) { 225 // TODO: Run Demo 226 205 227 } 206 228 207 229 return 0; 208 230 } 209 231 210 232 void KyraEngine_v2::startup() { 211 snd_assignMusicData(kMusicIngame);233 _sound->setSoundList(&_soundData[kMusicIngame]); 212 234 // The track map is exactly the same 213 235 // for FM-TOWNS and DOS 214 236 _trackMap = _dosTrackMap; … … 1567 1589 _sound->loadSoundFile(file); 1568 1590 } 1569 1591 1570 void KyraEngine_v2::snd_assignMusicData(kMusicDataID id) {1571 if (_flags.platform == Common::kPlatformPC) {1572 if (id == kMusicIntro)1573 _sound->setSoundFileList(_dosSoundFileListIntro, 1);1574 else if (id == kMusicFinale)1575 _sound->setSoundFileList(_dosSoundFileListFinale, 1);1576 else1577 _sound->setSoundFileList(_dosSoundFileList, _dosSoundFileListSize);1578 } else {1579 _sound->assignData(id);1580 }1581 }1582 1583 1592 void KyraEngine_v2::playVoice(int high, int low) { 1584 1593 int vocFile = high * 10000 + low * 10; 1585 1594 snd_playVoiceFile(vocFile); -
kyra_v2.h
250 250 251 251 static const char *_dosSoundFileListIntro[]; 252 252 static const char *_dosSoundFileListFinale[]; 253 static const char *_dosSoundFileList[]; 254 static const int _dosSoundFileListSize; 253 static const char *_dosSoundFileList[]; 254 static const char *_fmtSoundFileListIntro[]; 255 static const char *_fmtSoundFileListFinale[]; 256 static const char *_fmtSoundFileList[]; 257 static const uint8 _cdaTrackTableIntro[]; 258 static const uint8 _cdaTrackTableIngame[]; 259 static const uint8 _cdaTrackTableFinale[]; 260 static const AudioDataStruct _soundData_PC[]; 261 static const AudioDataStruct _soundData_TOWNS[]; 255 262 static const int8 _dosTrackMap[]; 256 263 static const int _dosTrackMapSize; 264 const AudioDataStruct * _soundData; 257 265 258 266 protected: 259 267 // game initialization … … 630 638 631 639 virtual void snd_playVoiceFile(int id); 632 640 void snd_loadSoundFile(int id); 633 void snd_assignMusicData(kMusicDataID id);634 641 635 642 void playVoice(int high, int low); 636 643 … … 843 850 844 851 static const char *_sequenceSoundList_PC[]; 845 852 static const int _sequenceSoundListSize_PC; 853 static const char *_sequenceSoundList_PCFLOPPY[]; 854 static const int _sequenceSoundListSize_PCFLOPPY; 846 855 static const char *_sequenceSoundList_TOWNS[]; 847 856 static const int _sequenceSoundListSize_TOWNS; 848 857 static const char *_sequenceStrings_TOWNS_EN[]; -
saveload_v1.cpp
202 202 // In the first version when this entry was introduced, 203 203 // it wasn't made sure that _curSfxFile was initialized 204 204 // so if it's out of bounds we just set it to 0. 205 if (_curSfxFile >= _sound FilesTownsCount|| _curSfxFile < 0)205 if (_curSfxFile >= _soundData_TOWNS->_fileListLen || _curSfxFile < 0) 206 206 _curSfxFile = 0; 207 207 208 208 if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) -
sequences_v2.cpp
51 51 "K2_DEMO", 52 52 "LOLSYSEX" 53 53 }; 54 _sound->setSoundFileList(soundFileList, 2);54 //_sound->setSoundFileList(soundFileList, 2); 55 55 } else { 56 snd_assignMusicData((startSeq > kSequenceZanfaun) ? kMusicFinale : kMusicIntro);56 _sound->setSoundList(&_soundData[(startSeq > kSequenceZanfaun) ? kMusicFinale : kMusicIntro]); 57 57 } 58 58 _sound->loadSoundFile(0); 59 59 … … 1528 1528 _screen->loadBitmap("finale.cps", 3, 3, _screen->_currentPalette); 1529 1529 _screen->setFont(Screen::FID_GOLDFONT_FNT); 1530 1530 1531 snd_assignMusicData(kMusicIngame);1531 _sound->setSoundList(&_soundData[kMusicIngame]); 1532 1532 _sound->loadSoundFile(3); 1533 1533 _sound->playTrack(3); 1534 1534 … … 1537 1537 1538 1538 //XXX 1539 1539 1540 snd_assignMusicData(kMusicFinale);1540 _sound->setSoundList(&_soundData[kMusicFinale]); 1541 1541 _sound->loadSoundFile(0); 1542 1542 } 1543 1543 -
sound.cpp
40 40 41 41 Sound::Sound(KyraEngine *vm, Audio::Mixer *mixer) 42 42 : _vm(vm), _mixer(mixer), _currentVocFile(0), _vocHandle(), _compressHandle(), 43 _musicEnabled(1), _sfxEnabled(true), _sound FileList(0), _soundFileListSize(0) {43 _musicEnabled(1), _sfxEnabled(true), _soundDataList(0) { 44 44 } 45 45 46 46 Sound::~Sound() { … … 259 259 260 260 void SoundMidiPC::loadSoundFile(uint file) { 261 261 char filename[25]; 262 sprintf(filename, "%s.%s", soundFilename(file), _useC55 ? "C55" : "XMI");262 sprintf(filename, "%s.%s", fileListEntry(file), _useC55 ? "C55" : "XMI"); 263 263 264 264 uint32 size; 265 265 uint8 *data = (_vm->resource())->fileData(filename, &size); … … 296 296 297 297 void SoundMidiPC::loadSoundEffectFile(uint file) { 298 298 char filename[25]; 299 sprintf(filename, "%s.%s", soundFilename(file), _useC55 ? "C55" : "XMI");299 sprintf(filename, "%s.%s", fileListEntry(file), _useC55 ? "C55" : "XMI"); 300 300 301 301 uint32 size; 302 302 uint8 *data = (_vm->resource())->fileData(filename, &size); -
sound.h
107 107 * @param list soundfile list 108 108 * @param s number of soundfiles 109 109 */ 110 virtual void setSound FileList(const char * const *list, uint s) { _soundFileList = list; _soundFileListSize = s; }110 virtual void setSoundList(const AudioDataStruct * const list) { _soundDataList = list; } 111 111 112 112 /** 113 * Selects preset bundles of music files114 * and cd audio tracks the output device will use115 * when playing a track and/or sound effect.116 *117 * TODO: this is just needed for Kyrandia 2 FM-Towns version,118 * and is similar to what setSoundFileList is used for, so we119 * should think of a better solution than this.120 * @see setSoundFileList121 *122 * @param id kMusicIntro, kMusicIngame or kMusicFinale123 */124 virtual void assignData(kMusicDataID id) { _currentTheme = id; }125 126 /**127 113 * Load a specifc sound file for use of 128 114 * playing music and sound effects. 129 115 */ … … 190 176 */ 191 177 void voiceStop(); 192 178 193 protected: 194 const char *soundFilename(uint file) { return (file < _soundFileListSize) ? _soundFileList[file] : ""; } 179 protected: 180 const char * fileListEntry(uint file) const { return (file < _soundDataList->_fileListLen) ? _soundDataList->_fileList[file] : ""; } 181 const void * cdaData() const { return _soundDataList->_cdaTracks; } 182 const uint32 cdaTrackNum() const { return _soundDataList->_cdaNumTracks; } 183 195 184 int _musicEnabled; 196 185 bool _sfxEnabled; 197 186 … … 201 190 Audio::Mixer *_mixer; 202 191 203 192 private: 204 const char * const *_soundFileList; 205 uint _soundFileListSize; 206 193 const AudioDataStruct * _soundDataList; 207 194 Audio::AudioStream *_currentVocFile; 208 195 Audio::SoundHandle _vocHandle; 209 196 Common::File _compressHandle; … … 444 431 445 432 //SoundTowns_v2_TwnDriver * _driver; 446 433 uint8 * _twnTrackData; 447 448 static const uint8 _cdaTrackTableK2Intro[];449 static const uint8 _cdaTrackTableK2Ingame[];450 static const uint8 _cdaTrackTableK2Finale[];451 452 static const struct Kyra2AudioThemes {453 const uint8 * cdaTable;454 const uint8 cdaTableSize;455 const char * twnFilename;456 } _themes[];457 434 }; 458 435 459 436 class MixedSoundDriver : public Sound { … … 461 438 MixedSoundDriver(KyraEngine *vm, Audio::Mixer *mixer, Sound *music, Sound *sfx) : Sound(vm, mixer), _music(music), _sfx(sfx) {} 462 439 ~MixedSoundDriver() { delete _music; delete _sfx; } 463 440 464 bool init() { return (_music->init() && _sfx->init()); }441 bool init() { return _music->init() | _sfx->init(); } 465 442 void process() { _music->process(); _sfx->process(); } 466 443 467 444 void setVolume(int volume) { _music->setVolume(volume); _sfx->setVolume(volume); } 468 445 int getVolume() { return _music->getVolume(); } 469 446 470 void setSound FileList(const char * const*list, uint s) { _music->setSoundFileList(list, s); _sfx->setSoundFileList(list, s); }447 void setSoundList(const AudioDataStruct * const list) { _music->setSoundList(list); _sfx->setSoundList(list); } 471 448 void loadSoundFile(uint file) { _music->loadSoundFile(file); _sfx->loadSoundFile(file); } 472 449 473 450 void playTrack(uint8 track) { _music->playTrack(track); } -
sound_adlib.cpp
2267 2267 // sync for each loop. To avoid that, we declare that all four 2268 2268 // of the song channels have to jump "in sync". 2269 2269 2270 if (track == 4 && scumm_stricmp( soundFilename(_soundFileLoaded), "KYRA1B") == 0)2270 if (track == 4 && scumm_stricmp(fileListEntry(_soundFileLoaded), "KYRA1B") == 0) 2271 2271 _driver->setSyncJumpMask(0x000F); 2272 2272 else 2273 2273 _driver->setSyncJumpMask(0); … … 2351 2351 uint8 *file_data = 0; uint32 file_size = 0; 2352 2352 2353 2353 char filename[25]; 2354 sprintf(filename, "%s.ADL", soundFilename(file));2354 sprintf(filename, "%s.ADL", fileListEntry(file)); 2355 2355 2356 2356 file_data = _vm->resource()->fileData(filename, &file_size); 2357 2357 if (!file_data) { -
sound_towns.cpp
1084 1084 _driver->send(0x79B0); 1085 1085 } 1086 1086 1087 SoundTowns::SoundTowns(KyraEngine *vm, Audio::Mixer *mixer) 1088 : Sound(vm, mixer), _lastTrack(-1), _currentSFX(0), _sfxFileData(0), 1089 _sfxFileIndex((uint)-1), _sfxWDTable(0), _parser(0) { 1087 SoundTowns::SoundTowns(KyraEngine *vm, Audio::Mixer *mixer) : Sound(vm, mixer), _lastTrack(-1), 1088 _currentSFX(0), _sfxFileData(0), _sfxFileIndex((uint)-1), _sfxWDTable(0), _parser(0) { 1090 1089 1091 1090 _driver = new SoundTowns_EuphonyDriver(_mixer); 1092 1091 int ret = open(); … … 1118 1117 AudioCD.updateCD(); 1119 1118 } 1120 1119 1121 namespace {1122 1123 struct CDTrackTable {1124 uint32 fileOffset;1125 bool loop;1126 int track;1127 };1128 1129 } // end of anonymous namespace1130 1131 1120 void SoundTowns::playTrack(uint8 track) { 1132 1121 if (track < 2) 1133 1122 return; 1134 1123 track -= 2; 1135 1124 1136 static const CDTrackTable tTable[] = { 1137 { 0x04000, 1, 0 }, { 0x05480, 1, 6 }, { 0x05E70, 0, 1 }, 1138 { 0x06D90, 1, 3 }, { 0x072C0, 0, -1 }, { 0x075F0, 1, -1 }, 1139 { 0x07880, 1, -1 }, { 0x089C0, 0, -1 }, { 0x09080, 0, -1 }, 1140 { 0x091D0, 1, 4 }, { 0x0A880, 1, 5 }, { 0x0AF50, 0, -1 }, 1141 { 0x0B1A0, 1, -1 }, { 0x0B870, 0, -1 }, { 0x0BCF0, 1, -1 }, 1142 { 0x0C5D0, 1, 7 }, { 0x0D3E0, 1, 8 }, { 0x0e7b0, 1, 2 }, 1143 { 0x0edc0, 0, -1 }, { 0x0eef0, 1, 9 }, { 0x10540, 1, 10 }, 1144 { 0x10d80, 0, -1 }, { 0x10E30, 0, -1 }, { 0x10FC0, 0, -1 }, 1145 { 0x11310, 1, -1 }, { 0x11A20, 1, -1 }, { 0x12380, 0, -1 }, 1146 { 0x12540, 1, -1 }, { 0x12730, 1, -1 }, { 0x12A90, 1, 11 }, 1147 { 0x134D0, 0, -1 }, { 0x00000, 0, -1 }, { 0x13770, 0, -1 }, 1148 { 0x00000, 0, -1 }, { 0x00000, 0, -1 }, { 0x00000, 0, -1 }, 1149 { 0x00000, 0, -1 }, { 0x14710, 1, 12 }, { 0x15DF0, 1, 13 }, 1150 { 0x16030, 1, 14 }, { 0x17030, 0, -1 }, { 0x17650, 0, -1 }, 1151 { 0x134D0, 0, -1 }, { 0x178E0, 1, -1 }, { 0x18200, 0, -1 }, 1152 { 0x18320, 0, -1 }, { 0x184A0, 0, -1 }, { 0x18BB0, 0, -1 }, 1153 { 0x19040, 0, 19 }, { 0x19B50, 0, 20 }, { 0x17650, 0, -1 }, 1154 { 0x1A730, 1, 21 }, { 0x00000, 0, -1 }, { 0x12380, 0, -1 }, 1155 { 0x1B810, 0, -1 }, { 0x1BA50, 0, 15 }, { 0x1C190, 0, 16 }, 1156 { 0x1CA50, 0, 17 }, { 0x1D100, 0, 18 } 1157 }; 1125 const int32 * const tTable = (const int32 * const) cdaData(); 1126 int tTableIndex = 3 * track; 1158 1127 1159 int trackNum = tTable[t rack].track;1160 bool loop = tTable[track].loop;1128 int trackNum = tTable[tTableIndex + 2]; 1129 int32 loop = tTable[tTableIndex + 1]; 1161 1130 1162 1131 if (track == _lastTrack && _musicEnabled) 1163 1132 return; … … 1168 1137 AudioCD.play(trackNum+1, loop ? -1 : 1, 0, 0); 1169 1138 AudioCD.updateCD(); 1170 1139 } else if (_musicEnabled) { 1171 playEuphonyTrack( tTable[track].fileOffset, loop);1140 playEuphonyTrack((uint32) tTable[tTableIndex], loop); 1172 1141 } 1173 1142 1174 1143 _lastTrack = track; … … 1195 1164 return; 1196 1165 _sfxFileIndex = file; 1197 1166 delete [] _sfxFileData; 1198 _sfxFileData = _vm->resource()->fileData( soundFilename(file), 0);1167 _sfxFileData = _vm->resource()->fileData(fileListEntry(file), 0); 1199 1168 } 1200 1169 1201 1170 void SoundTowns::playSoundEffect(uint8 track) { … … 1230 1199 if (offset == -1) 1231 1200 return; 1232 1201 1233 struct SfxHeader { 1234 uint32 id; 1235 uint32 inBufferSize; 1236 uint32 unused1; 1237 uint32 outBufferSize; 1238 uint32 unused2; 1239 uint32 unused3; 1240 uint32 rate; 1241 uint32 rootNoteOffs; 1242 } *sfxHeader = (SfxHeader*)(fileBody + offset); 1202 uint32 * sfxHeader = (uint32*)(fileBody + offset); 1243 1203 1244 uint32 sfxHeaderID = TO_LE_32(sfxHeader->id);1245 uint32 sfxHeaderInBufferSize = TO_LE_32(sfxHeader->inBufferSize);1246 uint32 sfxHeaderOutBufferSize = TO_LE_32(sfxHeader->outBufferSize);1247 uint32 sfxRootNoteOffs = TO_LE_32(sfxHeader->rootNoteOffs);1248 uint32 sfxRate = TO_LE_32(sfxHeader->rate);1204 uint32 sfxHeaderID = READ_LE_UINT32(sfxHeader); 1205 uint32 sfxHeaderInBufferSize = READ_LE_UINT32(&sfxHeader[1]); 1206 uint32 sfxHeaderOutBufferSize = READ_LE_UINT32(&sfxHeader[3]); 1207 uint32 sfxRootNoteOffs = READ_LE_UINT32(&sfxHeader[7]); 1208 uint32 sfxRate = READ_LE_UINT32(&sfxHeader[6]); 1249 1209 1250 1210 uint32 playbackBufferSize = (sfxHeaderID == 1) ? sfxHeaderInBufferSize : sfxHeaderOutBufferSize; 1251 1211 … … 1415 1375 1416 1376 // KYRA 2 1417 1377 1418 SoundTowns_v2::SoundTowns_v2(KyraEngine *vm, Audio::Mixer *mixer) 1419 :Sound(vm, mixer), _lastTrack(-1), _currentSFX(0), /*_driver(0),*/1378 SoundTowns_v2::SoundTowns_v2(KyraEngine *vm, Audio::Mixer *mixer) : 1379 Sound(vm, mixer), _lastTrack(-1), _currentSFX(0), /*_driver(0),*/ 1420 1380 _twnTrackData(0) { 1421 1381 } 1422 1382 … … 1452 1412 if (track == _lastTrack && _musicEnabled) 1453 1413 return; 1454 1414 1415 const uint8 * const cdaTracks = (const uint8 * const) cdaData(); 1416 1455 1417 int trackNum = -1; 1456 for ( int i = 0; i < _themes[_currentTheme].cdaTableSize; i++) {1457 if (track == _themes[_currentTheme].cdaTable[i * 2]) {1458 trackNum = _themes[_currentTheme].cdaTable[i * 2 + 1] - 1;1418 for (uint32 i = 0; i < cdaTrackNum(); i++) { 1419 if (track == cdaTracks[i * 2]) { 1420 trackNum = cdaTracks[i * 2 + 1] - 1; 1459 1421 break; 1460 1422 } 1461 1423 } … … 1470 1432 AudioCD.updateCD(); 1471 1433 } else if (_musicEnabled) { 1472 1434 char musicfile[13]; 1473 sprintf(musicfile, "%s%d.twn", _themes[_currentTheme].twnFilename, track);1435 sprintf(musicfile, "%s%d.twn", fileListEntry(0), track); 1474 1436 if (_twnTrackData) 1475 1437 delete [] _twnTrackData; 1476 1438 _twnTrackData = _vm->resource()->fileData(musicfile, 0); … … 1547 1509 haltTrack(); 1548 1510 } 1549 1511 1550 const uint8 SoundTowns_v2::_cdaTrackTableK2Intro[] = {1551 0x03, 0x01, 0x04, 0x02, 0x05, 0x03, 0x06, 0x04, 0x07, 0x05, 0x08, 0x061552 };1553 1554 const uint8 SoundTowns_v2::_cdaTrackTableK2Ingame[] = {1555 0x02, 0x07, 0x03, 0x08, 0x04, 0x09, 0x07, 0x0A, 0x0C, 0x0B, 0x0D, 0x0C, 0x0E, 0x0D, 0x0F, 0x0E,1556 0x10, 0x0F, 0x12, 0x10, 0x13, 0x11, 0x15, 0x12, 0x17, 0x13, 0x18, 0x14, 0x19, 0x15, 0x1A, 0x16,1557 0x1B, 0x17, 0x1C, 0x18, 0x1D, 0x19, 0x1E, 0x1A, 0x1F, 0x1B, 0x21, 0x1C, 0x22, 0x1D, 0x23, 0x1E,1558 0x24, 0x1F, 0x25, 0x20, 0x26, 0x21, 0x27, 0x22, 0x28, 0x23, 0x29, 0x24, 0x2A, 0x25, 0x2B, 0x26,1559 0x2C, 0x27, 0x2D, 0x28, 0x2E, 0x29, 0x2F, 0x2A, 0x30, 0x2B, 0x31, 0x2C, 0x32, 0x2D, 0x33, 0x2E,1560 0x34, 0x2F, 0x35, 0x30, 0x36, 0x31, 0x37, 0x32, 0x38, 0x33, 0x39, 0x34, 0x3A, 0x35, 0x3B, 0x36,1561 0x3C, 0x37, 0x3D, 0x38, 0x3E, 0x39, 0x3F, 0x3A, 0x40, 0x3B, 0x41, 0x3C, 0x42, 0x3D, 0x43, 0x3E,1562 0x44, 0x3F, 0x45, 0x40, 0x46, 0x41, 0x47, 0x42, 0x48, 0x43, 0x49, 0x44, 0x4A, 0x45, 0x4B, 0x46,1563 0x4C, 0x47, 0x4D, 0x48, 0x4E, 0x49, 0x4F, 0x4A, 0x50, 0x4B, 0x51, 0x4C, 0x52, 0x4D, 0x53, 0x4E,1564 0x54, 0x4F, 0x55, 0x50, 0x56, 0x51, 0x57, 0x521565 };1566 1567 const uint8 SoundTowns_v2::_cdaTrackTableK2Finale[] = {1568 0x03, 0x53, 0x04, 0x541569 };1570 1571 const SoundTowns_v2::Kyra2AudioThemes SoundTowns_v2::_themes[] = {1572 { _cdaTrackTableK2Intro, ARRAYSIZE(_cdaTrackTableK2Intro) >> 1, "intro" },1573 { _cdaTrackTableK2Ingame, ARRAYSIZE(_cdaTrackTableK2Ingame) >> 1, "k2" },1574 { _cdaTrackTableK2Finale, ARRAYSIZE(_cdaTrackTableK2Finale) >> 1, "finale" }1575 };1576 1577 1512 } // end of namespace Kyra 1578 1513 1579 1514 #undef EUPHONY_FADEOUT_TICKS -
staticres.cpp
917 917 "INTRO" 918 918 }; 919 919 920 const int KyraEngine_v1::_soundFilesCount = ARRAYSIZE(KyraEngine_v1::_soundFiles);921 922 920 const char *KyraEngine_v1::_soundFilesTowns[] = { 923 921 "TW_INTRO.SFX", 924 922 "TW_SCEN1.SFX", … … 928 926 "TW_SCEN5.SFX" 929 927 }; 930 928 931 const int KyraEngine_v1::_soundFilesTownsCount = ARRAYSIZE(KyraEngine_v1::_soundFilesTowns); 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 }; 932 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 }; 933 961 const int8 KyraEngine_v1::_charXPosTable[] = { 934 962 0, 4, 4, 4, 0, -4, -4, -4 935 963 }; … … 1427 1455 "theend" 1428 1456 }; 1429 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 1430 1494 const char *KyraEngine_v2::_sequenceSoundList_TOWNS[] = { 1431 1495 "intro1.pcm", 1432 1496 "intro2.pcm", … … 1464 1528 }; 1465 1529 1466 1530 const int KyraEngine_v2::_sequenceSoundListSize_PC = ARRAYSIZE(KyraEngine_v2::_sequenceSoundList_PC); 1531 const int KyraEngine_v2::_sequenceSoundListSize_PCFLOPPY = ARRAYSIZE(KyraEngine_v2::_sequenceSoundList_PCFLOPPY); 1467 1532 const int KyraEngine_v2::_sequenceSoundListSize_TOWNS = ARRAYSIZE(KyraEngine_v2::_sequenceSoundList_TOWNS); 1468 1533 1469 1534 const uint8 KyraEngine_v2::_seqTextColorPresets[] = { 0x01, 0x01, 0x00, 0x3f, 0x3f, 0x3f }; … … 1542 1607 "K2TEST15" 1543 1608 }; 1544 1609 1545 const int KyraEngine_v2::_dosSoundFileListSize = ARRAYSIZE(KyraEngine_v2::_dosSoundFileList); 1610 const char *KyraEngine_v2::_fmtSoundFileListIntro[] = { "intro" }; 1611 const char *KyraEngine_v2::_fmtSoundFileListFinale[] = { "finale" }; 1612 const char *KyraEngine_v2::_fmtSoundFileList[] = { "k2" }; 1546 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 1547 1647 const int KyraEngine_v2::_itemStringMapSize = ARRAYSIZE(KyraEngine_v2::_itemStringMap); 1548 1648 1549 1649 const int8 KyraEngine_v2::_dosTrackMap[] = {