diff options
Diffstat (limited to 'engines/kyra')
-rw-r--r-- | engines/kyra/kyra_hof.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/kyra_lok.cpp | 10 | ||||
-rw-r--r-- | engines/kyra/sequences_hof.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/sound.h | 15 | ||||
-rw-r--r-- | engines/kyra/sound_intern.h | 7 | ||||
-rw-r--r-- | engines/kyra/sound_lok.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/sound_towns.cpp | 30 | ||||
-rw-r--r-- | engines/kyra/staticres.cpp | 4 |
8 files changed, 33 insertions, 39 deletions
diff --git a/engines/kyra/kyra_hof.cpp b/engines/kyra/kyra_hof.cpp index 9bc71a9dea..953fe246bc 100644 --- a/engines/kyra/kyra_hof.cpp +++ b/engines/kyra/kyra_hof.cpp @@ -313,7 +313,7 @@ Common::Error KyraEngine_HoF::go() { if (_flags.platform == Common::kPlatformPC98) { _res->loadPakFile("AUDIO.PAK"); - _sound->loadSoundFile("sound.dat"); + _sound->loadSoundFile("SOUND.DAT"); } } diff --git a/engines/kyra/kyra_lok.cpp b/engines/kyra/kyra_lok.cpp index 14b18e9c19..68e0eb66d5 100644 --- a/engines/kyra/kyra_lok.cpp +++ b/engines/kyra/kyra_lok.cpp @@ -197,13 +197,7 @@ Common::Error KyraEngine_LoK::init() { if (!_sound->init()) error("Couldn't init sound"); - if (_flags.platform == Common::kPlatformPC98) { - int sfxSize; - const uint8 *sfxData = _staticres->loadRawData(k1PC98IntroSfx, sfxSize); - _sound->loadSoundFile(sfxData, sfxSize); - } else { - _sound->loadSoundFile(0); - } + _sound->loadSoundFile(0); setupButtonData(); @@ -348,7 +342,7 @@ void KyraEngine_LoK::startup() { _sound->setSoundList(&_soundData[kMusicIngame]); if (_flags.platform == Common::kPlatformPC98) - _sound->loadSoundFile("se.dat"); + _sound->loadSoundFile("SE.DAT"); else _sound->loadSoundFile(0); diff --git a/engines/kyra/sequences_hof.cpp b/engines/kyra/sequences_hof.cpp index c6ed21b0fa..8d7cda79c1 100644 --- a/engines/kyra/sequences_hof.cpp +++ b/engines/kyra/sequences_hof.cpp @@ -2772,7 +2772,7 @@ void KyraEngine_HoF::seq_init() { _res->loadFileList(_sequencePakList, _sequencePakListSize); if (_flags.platform == Common::kPlatformPC98) - _sound->loadSoundFile("sound.dat"); + _sound->loadSoundFile("SOUND.DAT"); _screen->setFont(_flags.lang == Common::JA_JPN ? Screen::FID_SJIS_FNT : Screen::FID_GOLDFONT_FNT); diff --git a/engines/kyra/sound.h b/engines/kyra/sound.h index 98ca71f93d..ece53a4dc7 100644 --- a/engines/kyra/sound.h +++ b/engines/kyra/sound.h @@ -83,14 +83,14 @@ public: * Sets the soundfiles the output device will use * when playing a track and/or sound effect. * - * @param list soundfile list + * @param list soundfile list */ virtual void setSoundList(const AudioDataStruct *list) { _soundDataList = list; } /** * Checks if a given sound file is present. * - * @param track track number + * @param track track number * @return true if available, false otherwise */ virtual bool hasSoundFile(uint file) { return (fileListEntry(file) != 0); } @@ -108,12 +108,6 @@ public: virtual void loadSoundFile(Common::String file) = 0; /** - * Load static data for playing sound - * effects from. - */ - virtual void loadSoundFile(const uint8 *soundData, int dataSize) = 0; - - /** * Load a sound file for playing sound * effects from. */ @@ -122,7 +116,7 @@ public: /** * Plays the specified track. * - * @param track track number + * @param track track number */ virtual void playTrack(uint8 track) = 0; @@ -134,7 +128,7 @@ public: /** * Plays the specified sound effect. * - * @param track sound effect id + * @param track sound effect id */ virtual void playSoundEffect(uint8 track) = 0; @@ -274,7 +268,6 @@ public: bool hasSoundFile(uint file) const { return _music->hasSoundFile(file) && _sfx->hasSoundFile(file); } void loadSoundFile(uint file) { _music->loadSoundFile(file); _sfx->loadSoundFile(file); } void loadSoundFile(Common::String file) { _music->loadSoundFile(file); _sfx->loadSoundFile(file); } - void loadSoundFile(const uint8 *soundData, int dataSize) { _sfx->loadSoundFile(soundData, dataSize); } void loadSfxFile(Common::String file) { _sfx->loadSoundFile(file); } diff --git a/engines/kyra/sound_intern.h b/engines/kyra/sound_intern.h index 6ff9fe6ef8..f4aab4db29 100644 --- a/engines/kyra/sound_intern.h +++ b/engines/kyra/sound_intern.h @@ -62,7 +62,6 @@ public: void loadSoundFile(uint file); void loadSoundFile(Common::String file); - void loadSoundFile(const uint8 *soundData, int dataSize) {} void loadSfxFile(Common::String file); void playTrack(uint8 track); @@ -115,7 +114,6 @@ public: void loadSoundFile(uint file); void loadSoundFile(Common::String) {} - void loadSoundFile(const uint8 *soundData, int dataSize) {} void playTrack(uint8 track); void haltTrack(); @@ -172,9 +170,8 @@ public: bool init(); void process() {} - void loadSoundFile(uint file) {} + void loadSoundFile(uint file); void loadSoundFile(Common::String file); - void loadSoundFile(const uint8 *soundData, int dataSize); void playTrack(uint8 track); void haltTrack(); @@ -202,7 +199,6 @@ public: void loadSoundFile(uint file) {} void loadSoundFile(Common::String file); - void loadSoundFile(const uint8 *soundData, int dataSize) {} void playTrack(uint8 track); void haltTrack(); @@ -310,7 +306,6 @@ public: void process() {} void loadSoundFile(uint file); void loadSoundFile(Common::String) {} - void loadSoundFile(const uint8 *soundData, int dataSize) {} void playTrack(uint8 track); void haltTrack(); diff --git a/engines/kyra/sound_lok.cpp b/engines/kyra/sound_lok.cpp index 2a8c2d96c6..1d0b334a09 100644 --- a/engines/kyra/sound_lok.cpp +++ b/engines/kyra/sound_lok.cpp @@ -52,7 +52,7 @@ void KyraEngine_LoK::snd_playWanderScoreViaMap(int command, int restart) { if (command == 1) { _sound->beginFadeOut(); } else if (command >= 35 && command <= 38) { - snd_playSoundEffect(command-20); + snd_playSoundEffect(command - 20); } else if (command >= 2) { if (_lastMusicCommand != command) // the original does -2 here we handle this inside _sound->playTrack() diff --git a/engines/kyra/sound_towns.cpp b/engines/kyra/sound_towns.cpp index 93969deaa0..089cc00c03 100644 --- a/engines/kyra/sound_towns.cpp +++ b/engines/kyra/sound_towns.cpp @@ -4014,13 +4014,13 @@ float SoundTowns::calculatePhaseStep(int8 semiTone, int8 semiToneRootkey, static const float noteFrq[] = { 0004.13f, 0004.40f, 0004.64f, 0004.95f, 0005.16f, 0005.50f, 0005.80f, 0006.19f, 0006.60f, 0006.86f, 0007.43f, 0007.73f, 0008.25f, 0008.80f, 0009.28f, 0009.90f, 0010.31f, 0011.00f, 0011.60f, 0012.38f, - 0013.20f, 0013.75f, 0014.85f, 0015.47f, 0016.50f, 0017.60f, 0018.56f, 0019.80f, 0020.63f, 0022.00f, + 0013.20f, 0013.75f, 0014.85f, 0015.47f, 0016.50f, 0017.60f, 0018.56f, 0019.80f, 0020.63f, 0022.00f, 0023.21f, 0024.75f, 0026.40f, 0027.50f, 0029.70f, 0030.94f, 0033.00f, 0035.20f, 0037.16f, 0039.60f, 0041.25f, 0044.00f, 0046.41f, 0049.50f, 0052.80f, 0055.00f, 0059.40f, 0061.88f, 0066.00f, 0070.40f, 0074.25f, 0079.20f, 0082.50f, 0088.00f, 0092.83f, 0099.00f, 0105.60f, 0110.00f, 0118.80f, 0123.75f, 0132.00f, 0140.80f, 0148.50f, 0158.40f, 0165.00f, 0176.00f, 0185.65f, 0198.00f, 0211.20f, 0220.00f, 0237.60f, 0247.50f, 0264.00f, 0281.60f, 0297.00f, 0316.80f, 0330.00f, 0352.00f, 0371.30f, 0396.00f, - 0422.40f, 0440.00f, 0475.20f, 0495.00f, 0528.00f, 0563.20f, 0594.00f, 0633.60f, 0660.00f, 0704.00f, + 0422.40f, 0440.00f, 0475.20f, 0495.00f, 0528.00f, 0563.20f, 0594.00f, 0633.60f, 0660.00f, 0704.00f, 0742.60f, 0792.00f, 0844.80f, 0880.00f, 0950.40f, 0990.00f, 1056.00f, 1126.40f, 1188.00f, 1267.20f, 1320.00f, 1408.00f, 1485.20f, 1584.00f, 1689.60f, 1760.00f, 1900.80f, 1980.00f, 2112.00f, 2252.80f, 2376.00f, 2534.40f, 2640.00f, 2816.00f, 2970.40f, 3168.00f, 3379.20f, 3520.00f, 3801.60f, 3960.00f @@ -4031,7 +4031,7 @@ float SoundTowns::calculatePhaseStep(int8 semiTone, int8 semiToneRootkey, float rateshift = (noteFrq[semiTone] - ((noteFrq[semiTone] - noteFrq[semiTone + d]) * pwModifier * d)) / noteFrq[semiToneRootkey]; - return (float) sampleRate * 10.0f * rateshift / outputRate; + return (float)sampleRate * 10.0f * rateshift / outputRate; } SoundPC98::SoundPC98(KyraEngine_v1 *vm, Audio::Mixer *mixer) : @@ -4049,15 +4049,27 @@ bool SoundPC98::init() { return _driver->init(); } -void SoundPC98::loadSoundFile(Common::String file) { - delete[] _sfxTrackData; - _sfxTrackData = _vm->resource()->fileData(file.c_str(), 0); +void SoundPC98::loadSoundFile(uint file) { + if (!scumm_strnicmp(fileListEntry(0), "INTRO", 5)) { + delete[] _sfxTrackData; + _sfxTrackData = 0; + + int dataSize = 0; + const uint8 *tmp = _vm->staticres()->loadRawData(k1PC98IntroSfx, dataSize); + + if (!tmp) { + warning("Could not load static intro sound effects data\n"); + return; + } + + _sfxTrackData = new uint8[dataSize]; + memcpy(_sfxTrackData, tmp, dataSize); + } } -void SoundPC98::loadSoundFile(const uint8 *soundData, int dataSize) { +void SoundPC98::loadSoundFile(Common::String file) { delete[] _sfxTrackData; - _sfxTrackData = new uint8[dataSize]; - memcpy(_sfxTrackData, soundData, dataSize); + _sfxTrackData = _vm->resource()->fileData(file.c_str(), 0); } void SoundPC98::playTrack(uint8 track) { diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp index 2147322001..56cac117f6 100644 --- a/engines/kyra/staticres.cpp +++ b/engines/kyra/staticres.cpp @@ -1024,8 +1024,8 @@ void KyraEngine_LoK::initStaticResource() { } // audio data tables - static const char *tIntro98[] = { "intro%d.dat" }; - static const char *tIngame98[] = { "kyram%d.dat" }; + static const char *tIntro98[] = { "INTRO%d.DAT" }; + static const char *tIngame98[] = { "KYRAM%d.DAT" }; // FIXME: It seems Kyra1 MAC CD includes AdLib and MIDI music and sfx, thus we enable // support for those for now. (Based on patch #2767489 "Support for Mac Kyrandia 1 CD" by satz). |