aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorNorbert Lange2009-07-18 00:04:28 +0000
committerNorbert Lange2009-07-18 00:04:28 +0000
commit9e16e3b3e644b64c198bbe680e138dad008c2fac (patch)
treee30e738b9c9383d93fccfa019b9706dd9fc71893 /engines
parentbb64bf008d03e01760a468d0df8cacb164725d41 (diff)
downloadscummvm-rg350-9e16e3b3e644b64c198bbe680e138dad008c2fac.tar.gz
scummvm-rg350-9e16e3b3e644b64c198bbe680e138dad008c2fac.tar.bz2
scummvm-rg350-9e16e3b3e644b64c198bbe680e138dad008c2fac.zip
first attempt at enabling soundeffects using an table from the executeable. Doesnt quite work as it should
svn-id: r42575
Diffstat (limited to 'engines')
-rw-r--r--engines/kyra/seqplayer.cpp5
-rw-r--r--engines/kyra/sound_amiga.cpp139
-rw-r--r--engines/kyra/sound_intern.h7
3 files changed, 144 insertions, 7 deletions
diff --git a/engines/kyra/seqplayer.cpp b/engines/kyra/seqplayer.cpp
index 2145591c03..aeac4ce9df 100644
--- a/engines/kyra/seqplayer.cpp
+++ b/engines/kyra/seqplayer.cpp
@@ -413,8 +413,6 @@ void SeqPlayer::s1_fillRect() {
void SeqPlayer::s1_playEffect() {
uint8 track = *_seqData++;
- if (_vm->gameFlags().platform == Common::kPlatformAmiga)
- return;
_vm->delay(3 * _vm->tickLength());
_sound->playSoundEffect(track);
}
@@ -422,9 +420,6 @@ void SeqPlayer::s1_playEffect() {
void SeqPlayer::s1_playTrack() {
uint8 msg = *_seqData++;
- if (_vm->gameFlags().platform == Common::kPlatformAmiga)
- return;
-
if (msg == 1) {
_sound->beginFadeOut();
} else {
diff --git a/engines/kyra/sound_amiga.cpp b/engines/kyra/sound_amiga.cpp
index 985afa2d32..36d900828c 100644
--- a/engines/kyra/sound_amiga.cpp
+++ b/engines/kyra/sound_amiga.cpp
@@ -56,7 +56,6 @@ bool SoundAmiga::init() {
void SoundAmiga::loadSoundFile(uint file) {
assert(file < ARRAYSIZE(kFilenameTable));
-
if (_fileLoaded == file)
return;
@@ -96,6 +95,142 @@ void SoundAmiga::beginFadeOut() {
}
void SoundAmiga::playSoundEffect(uint8 track) {
- assert("Dont call me" == 0);
+ debug("play sfx %d", track);
+ uint16 extVar = 1; // maybe indicates music playing or enabled
+ uint16 extVar2 = 1; // no idea
+ if (0x61 <= track && track <= 0x63 && extVar) {
+ assert(false);//some music-commands
+ }
+ assert(track < ARRAYSIZE(kEffectsTable));
+ const EffectEntry &entry = kEffectsTable[track];
+ if (extVar2 && entry.note) {
+ _driver->playNote(entry.note, entry.patch, entry.duration, entry.volume, entry.pan != 0);
+ if (!_mixer->isSoundHandleActive(_soundChannels[0]))
+ _mixer->playInputStream(Audio::Mixer::kPlainSoundType, &_soundChannels[0], _driver);
+ }
}
+
+const SoundAmiga::EffectEntry SoundAmiga::kEffectsTable[120] = {
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x0000, 0x01, 0x00, 0, 0 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x0156, 0x3C, 0x13, 120, 1 },
+ { 0x272C, 0x3C, 0x14, 120, 1 },
+ { 0x1B91, 0x3C, 0x15, 120, 1 },
+ { 0x1E97, 0x3C, 0x16, 120, 1 },
+ { 0x122B, 0x3C, 0x17, 120, 1 },
+ { 0x1E97, 0x3C, 0x16, 120, 1 },
+ { 0x0224, 0x45, 0x03, 120, 1 },
+ { 0x1E97, 0x3C, 0x16, 120, 1 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x252C, 0x3C, 0x19, 120, 1 },
+ { 0x0910, 0x2C, 0x04, 120, 1 },
+ { 0x252C, 0x3C, 0x19, 120, 1 },
+ { 0x3AEB, 0x3C, 0x1A, 120, 1 },
+ { 0x138B, 0x25, 0x1B, 120, 1 },
+ { 0x0F52, 0x18, 0x03, 120, 1 },
+ { 0x0622, 0x3E, 0x1C, 120, 1 },
+ { 0x0754, 0x3B, 0x1C, 120, 1 },
+ { 0x206F, 0x16, 0x03, 120, 1 },
+ { 0x252C, 0x3C, 0x19, 120, 1 },
+ { 0x09EA, 0x3C, 0x1D, 120, 1 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x272C, 0x3C, 0x14, 120, 1 },
+ { 0x036E, 0x3C, 0x1E, 120, 1 },
+ { 0x122B, 0x3C, 0x17, 120, 1 },
+ { 0x0991, 0x4E, 0x0B, 120, 1 },
+ { 0x02BC, 0x47, 0x1B, 120, 1 },
+ { 0x0211, 0x4C, 0x1B, 120, 1 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x0156, 0x3C, 0x13, 120, 1 },
+ { 0x0156, 0x3C, 0x13, 120, 1 },
+ { 0x0E9E, 0x3C, 0x1F, 120, 1 },
+ { 0x010C, 0x3C, 0x20, 120, 1 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x252C, 0x3C, 0x19, 120, 1 },
+ { 0x0F7C, 0x3C, 0x21, 120, 1 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x4C47, 0x2A, 0x0B, 120, 1 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x0528, 0x3C, 0x1B, 120, 1 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x0910, 0x2C, 0x04, 120, 1 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x0AEE, 0x3C, 0x22, 120, 1 },
+ { 0x1E97, 0x3C, 0x16, 120, 1 },
+ { 0x1B91, 0x3C, 0x15, 120, 1 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x272C, 0x3C, 0x14, 120, 1 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x0AEE, 0x3C, 0x22, 120, 1 },
+ { 0x272C, 0x3C, 0x14, 120, 1 },
+ { 0x1419, 0x32, 0x23, 156, 1 },
+ { 0x171C, 0x3C, 0x19, 120, 1 },
+ { 0x272C, 0x3C, 0x14, 120, 1 },
+ { 0x0622, 0x3E, 0x1C, 120, 1 },
+ { 0x0201, 0x43, 0x13, 120, 1 },
+ { 0x1243, 0x3C, 0x24, 90, 1 },
+ { 0x00EE, 0x3E, 0x20, 120, 1 },
+ { 0x252C, 0x3C, 0x19, 120, 1 },
+ { 0x19EA, 0x29, 0x04, 120, 1 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x010C, 0x3C, 0x20, 120, 1 },
+ { 0x30B6, 0x3C, 0x25, 120, 1 },
+ { 0x252C, 0x3C, 0x19, 120, 1 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x1E97, 0x3C, 0x16, 120, 1 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x3AEB, 0x3C, 0x1A, 120, 1 },
+ { 0x39F3, 0x1B, 0x04, 120, 1 },
+ { 0x1699, 0x30, 0x23, 80, 1 },
+ { 0x1B91, 0x3C, 0x15, 120, 1 },
+ { 0x19EA, 0x29, 0x06, 80, 1 },
+ { 0x252C, 0x3C, 0x19, 120, 1 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x3AEB, 0x3C, 0x1A, 120, 1 },
+ { 0x252C, 0x3C, 0x19, 120, 1 },
+ { 0x0713, 0x3C, 0x26, 120, 1 },
+ { 0x0713, 0x3C, 0x26, 120, 1 },
+ { 0x272C, 0x3C, 0x14, 120, 1 },
+ { 0x1699, 0x30, 0x23, 80, 1 },
+ { 0x1699, 0x30, 0x23, 80, 1 },
+ { 0x0000, 0x00, 0x00, 0, 0 },
+ { 0x0156, 0x3C, 0x13, 120, 1 }
+};
+
} // end of namespace Kyra \ No newline at end of file
diff --git a/engines/kyra/sound_intern.h b/engines/kyra/sound_intern.h
index 792887ab35..8ee1ad9209 100644
--- a/engines/kyra/sound_intern.h
+++ b/engines/kyra/sound_intern.h
@@ -310,6 +310,13 @@ protected:
uint _fileLoaded;
static const char *const kFilenameTable[3][2];
+ static const struct EffectEntry {
+ uint16 duration;
+ uint8 note;
+ uint8 patch;
+ int8 volume;
+ int8 pan;
+ } kEffectsTable[120];
};
} // end of namespace Kyra