[Scummvm-cvs-logs] SF.net SVN: scummvm: [21185] scummvm/trunk/engines/kyra
lordhoto at users.sourceforge.net
lordhoto at users.sourceforge.net
Thu Mar 9 12:51:02 CET 2006
Revision: 21185
Author: lordhoto
Date: 2006-03-09 12:50:19 -0800 (Thu, 09 Mar 2006)
ViewCVS: http://svn.sourceforge.net/scummvm/?rev=21185&view=rev
Log Message:
-----------
- Removes deleted waitTicks prototype in KyraEngine
- Adds sound fading support to the adlib player
- Adds support for stopping running tracks
- Changes baseFreq type back to uint8
- corrects octave handling in updateAndOutput1
(Thanks to eriktorbjorn for doing that)
Modified Paths:
--------------
scummvm/trunk/engines/kyra/kyra.h
scummvm/trunk/engines/kyra/sound.cpp
scummvm/trunk/engines/kyra/sound.h
scummvm/trunk/engines/kyra/sound_adlib.cpp
Modified: scummvm/trunk/engines/kyra/kyra.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra.h 2006-03-09 18:42:05 UTC (rev 21184)
+++ scummvm/trunk/engines/kyra/kyra.h 2006-03-09 20:50:19 UTC (rev 21185)
@@ -303,7 +303,6 @@
void enableTimer(uint8 timer);
void disableTimer(uint8 timer);
- void waitTicks(int ticks);
void delayWithTicks(int ticks);
void saveGame(const char *fileName, const char *saveName);
Modified: scummvm/trunk/engines/kyra/sound.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sound.cpp 2006-03-09 18:42:05 UTC (rev 21184)
+++ scummvm/trunk/engines/kyra/sound.cpp 2006-03-09 20:50:19 UTC (rev 21185)
@@ -445,6 +445,7 @@
if (command != 1) {
if (_lastMusicCommand != command) {
_lastMusicCommand = command;
+ _sound->haltTrack();
_sound->playTrack(soundTable[command*2+1], true);
}
} else {
Modified: scummvm/trunk/engines/kyra/sound.h
===================================================================
--- scummvm/trunk/engines/kyra/sound.h 2006-03-09 18:42:05 UTC (rev 21184)
+++ scummvm/trunk/engines/kyra/sound.h 2006-03-09 20:50:19 UTC (rev 21185)
@@ -114,6 +114,9 @@
private:
void loadSoundFile(const char *file);
+ void unk1();
+ void unk2();
+
AdlibDriver *_driver;
uint8 _trackEntries[120];
Modified: scummvm/trunk/engines/kyra/sound_adlib.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sound_adlib.cpp 2006-03-09 18:42:05 UTC (rev 21184)
+++ scummvm/trunk/engines/kyra/sound_adlib.cpp 2006-03-09 20:50:19 UTC (rev 21185)
@@ -115,7 +115,7 @@
uint8 unk38;
uint8 unk26;
uint8 unk7;
- int8 baseFreq;
+ uint8 baseFreq;
int8 unk1;
int8 unk4;
uint8 regAx;
@@ -723,7 +723,7 @@
state.rawNote = rawNote;
int8 note = (rawNote & 0x0F) + state.baseNote;
- int8 octave = ((rawNote >> 4) & 0x0F) + state.baseOctave;
+ int8 octave = ((rawNote + state.baseOctave) >> 4) & 0x0F;
// There are only twelve notes. If we go outside that, we have to
// adjust the note and octave.
@@ -1946,17 +1946,17 @@
}
void SoundAdlibPC::stopMusic() {
- playSoundEffect(0);
+ //playSoundEffect(0);
}
void SoundAdlibPC::playTrack(uint8 track, bool looping) {
- // snd_stopSound();
- // snd_unk1();
playSoundEffect(track);
}
void SoundAdlibPC::haltTrack() {
- playSoundEffect(0);
+ unk1();
+ unk2();
+ _engine->_system->delayMillis(3 * 60);
}
void SoundAdlibPC::startTrack() {
@@ -2002,6 +2002,7 @@
}
void SoundAdlibPC::beginFadeOut() {
+ playSoundEffect(1);
}
bool SoundAdlibPC::fadeOut() {
@@ -2012,6 +2013,10 @@
if (_soundFileLoaded == file)
return;
+ if (_soundDataPtr) {
+ haltTrack();
+ }
+
uint8 *file_data = 0; uint32 file_size = 0;
char filename[25];
@@ -2023,8 +2028,8 @@
return;
}
- // snd_stopSound();
- // snd_unk1();
+ unk2();
+ unk1();
_driver->callback(8, int(-1));
_soundDataPtr = 0;
@@ -2049,5 +2054,14 @@
_soundFileLoaded = file;
}
+void SoundAdlibPC::unk1() {
+ playSoundEffect(0);
+ //_engine->_system->delayMillis(5 * 60);
+}
+
+void SoundAdlibPC::unk2() {
+ playSoundEffect(0);
+}
+
} // end of namespace Kyra
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list