aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2014-05-15 22:13:02 -0400
committerPaul Gilbert2014-05-15 22:13:02 -0400
commite776a76241b9c0ba46c268cccf1b04610f86a715 (patch)
tree286a9ec5fffdf11514ff425158eda921de381390 /engines
parent41c93dc0b5861df729b7da7ea41225e51811a0a5 (diff)
downloadscummvm-rg350-e776a76241b9c0ba46c268cccf1b04610f86a715.tar.gz
scummvm-rg350-e776a76241b9c0ba46c268cccf1b04610f86a715.tar.bz2
scummvm-rg350-e776a76241b9c0ba46c268cccf1b04610f86a715.zip
MADS: Implemented sound player for scene group 7
Diffstat (limited to 'engines')
-rw-r--r--engines/mads/nebular/sound_nebular.cpp206
-rw-r--r--engines/mads/nebular/sound_nebular.h32
-rw-r--r--engines/mads/sound.cpp3
3 files changed, 241 insertions, 0 deletions
diff --git a/engines/mads/nebular/sound_nebular.cpp b/engines/mads/nebular/sound_nebular.cpp
index b839caddf5..997ea18405 100644
--- a/engines/mads/nebular/sound_nebular.cpp
+++ b/engines/mads/nebular/sound_nebular.cpp
@@ -2643,6 +2643,212 @@ int ASound6::command29() {
return 0;
}
+/*-----------------------------------------------------------------------*/
+
+const ASound7::CommandPtr ASound7::_commandList[38] = {
+ &ASound7::command0, &ASound7::command1, &ASound7::command2, &ASound7::command3,
+ &ASound7::command4, &ASound7::command5, &ASound7::command6, &ASound7::command7,
+ &ASound7::command8, &ASound7::command9, &ASound7::nullCommand, &ASound7::nullCommand,
+ &ASound7::nullCommand, &ASound7::nullCommand, &ASound7::nullCommand, &ASound7::command15,
+ &ASound7::command16, &ASound7::command16, &ASound7::command18, &ASound7::command19,
+ &ASound7::command20, &ASound7::command21, &ASound7::command22, &ASound7::command23,
+ &ASound7::command24, &ASound7::command25, &ASound7::command26, &ASound7::command27,
+ &ASound7::command28, &ASound7::nullCommand, &ASound7::command30, &ASound7::nullCommand,
+ &ASound7::command32, &ASound7::command33, &ASound7::command34, &ASound7::command35,
+ &ASound7::command36, &ASound7::command37
+};
+
+ASound7::ASound7(Audio::Mixer *mixer) : ASound(mixer, "asound.007", 0x1460) {
+ // Load sound samples
+ _soundFile.seek(_dataOffset + 0x122);
+ for (int i = 0; i < 214; ++i)
+ _samples.push_back(AdlibSample(_soundFile));
+}
+
+int ASound7::command(int commandId, int param) {
+ if (commandId > 38)
+ return 0;
+
+ _frameCounter = 0;
+ return (this->*_commandList[commandId])();
+}
+
+int ASound7::command9() {
+ byte *pData1 = loadData(0x2992, 122);
+ if (!isSoundActive(pData1)) {
+ _channels[0].load(pData1);
+ _channels[1].load(loadData(0x2A0C, 76));
+ _channels[2].load(loadData(0x2A58, 122));
+ _channels[3].load(loadData(0x2AD2, 38));
+ }
+
+ return 0;
+}
+
+int ASound7::command15() {
+ byte *pData = loadData(0x2B3E, 10);
+ pData[6] = (getRandomNumber() & 7) + 85;
+
+ return 0;
+}
+
+int ASound7::command16() {
+ playSound(0x2CE2, 8);
+
+ return 0;
+}
+
+int ASound7::command18() {
+ playSound(0x2C94, 22);
+
+ return 0;
+}
+
+int ASound7::command19() {
+ byte *pData1 = loadData(0x2C94, 22);
+ byte *pData2 = loadData(0x2CAA, 16);
+ if (_channels[8]._ptr1 == pData1 || _channels[8]._ptr1 == pData2) {
+ _channels[8]._soundData = loadData(0x2CBA, 12);
+ _channels[8]._field17 = 1;
+ _channels[8]._field19 = 1;
+ }
+
+ return 0;
+}
+
+int ASound7::command20() {
+ playSound(0x2CD0, 18);
+
+ return 0;
+}
+
+int ASound7::command21() {
+ playSound(0x2CC6, 10);
+
+ return 0;
+}
+
+int ASound7::command22() {
+ playSound(0x2C08, 140);
+
+ return 0;
+}
+
+int ASound7::command23() {
+ playSound(0x2B08, 34);
+ playSound(0x2B2A, 20);
+
+ return 0;
+}
+
+int ASound7::command24() {
+ byte *pData1 = loadData(0x14C6, 144);
+ if (!isSoundActive(pData1)) {
+ command1();
+ _channels[0].load(pData1);
+ _channels[1].load(loadData(0x1556, 146));
+ _channels[2].load(loadData(0x15E8, 138));
+ _channels[3].load(loadData(0x1672, 122));
+ _channels[4].load(loadData(0x16EC, 74));
+ }
+
+ return 0;
+}
+
+int ASound7::command25() {
+ byte *pData1 = loadData(0x1DBE, 182);
+ if (!isSoundActive(pData1)) {
+ command1();
+ _channels[0].load(pData1);
+ _channels[1].load(loadData(0x1E74, 182));
+ _channels[2].load(loadData(0x1F2A, 186));
+ _channels[3].load(loadData(0x1FE4, 244));
+ }
+
+ return 0;
+}
+
+int ASound7::command26() {
+ byte *pData1 = loadData(0x20D8, 312);
+ if (!isSoundActive(pData1)) {
+ command1();
+ _channels[0].load(pData1);
+ _channels[1].load(loadData(0x2210, 304));
+ _channels[2].load(loadData(0x2340, 222));
+ _channels[3].load(loadData(0x241E, 522));
+ _channels[4].load(loadData(0x2628, 874));
+ }
+
+ return 0;
+}
+
+int ASound7::command27() {
+ byte *pData1 = loadData(0x1736, 158);
+ if (!isSoundActive(pData1)) {
+ command1();
+ _channels[0].load(pData1);
+ _channels[1].load(loadData(0x17D4, 288));
+ _channels[2].load(loadData(0x18F4, 290));
+ _channels[3].load(loadData(0x1A16, 396));
+ _channels[4].load(loadData(0x1BA2, 380));
+ _channels[5].load(loadData(0x1D1E, 160));
+ }
+
+ return 0;
+}
+
+int ASound7::command28() {
+ playSound(0x2CAA, 16);
+
+ return 0;
+}
+
+int ASound7::command30() {
+ playSound(0x2B86, 22);
+ playSound(0x2B9C, 22);
+ playSound(0x2BB2, 22);
+
+ return 0;
+}
+
+int ASound7::command32() {
+ playSound(0x2BFE, 10);
+
+ return 0;
+}
+
+int ASound7::command33() {
+ playSound(0x2BEE, 16);
+
+ return 0;
+}
+
+int ASound7::command34() {
+ playSound(0x2BDE, 16);
+
+ return 0;
+}
+
+int ASound7::command35() {
+ playSound(0x2BC8, 22);
+
+ return 0;
+}
+
+int ASound7::command36() {
+ playSound(0x2AF8, 16);
+
+ return 0;
+}
+
+int ASound7::command37() {
+ playSound(0x2B48, 20);
+ playSound(0x2B5C, 32);
+ playSound(0x2B7C, 10);
+
+ return 0;
+}
+
} // End of namespace Nebular
} // End of namespace MADS
diff --git a/engines/mads/nebular/sound_nebular.h b/engines/mads/nebular/sound_nebular.h
index 771aac4b0e..997f6bbffb 100644
--- a/engines/mads/nebular/sound_nebular.h
+++ b/engines/mads/nebular/sound_nebular.h
@@ -638,6 +638,38 @@ public:
virtual int command(int commandId, int param);
};
+class ASound7 : public ASound {
+private:
+ typedef int (ASound7::*CommandPtr)();
+ static const CommandPtr _commandList[38];
+
+ int command9();
+ int command15();
+ int command16();
+ int command18();
+ int command19();
+ int command20();
+ int command21();
+ int command22();
+ int command23();
+ int command24();
+ int command25();
+ int command26();
+ int command27();
+ int command28();
+ int command30();
+ int command32();
+ int command33();
+ int command34();
+ int command35();
+ int command36();
+ int command37();
+public:
+ ASound7(Audio::Mixer *mixer);
+
+ virtual int command(int commandId, int param);
+};
+
} // End of namespace Nebular
} // End of namespace MADS
diff --git a/engines/mads/sound.cpp b/engines/mads/sound.cpp
index 79a2b4ee5f..b6563ce792 100644
--- a/engines/mads/sound.cpp
+++ b/engines/mads/sound.cpp
@@ -67,6 +67,9 @@ void SoundManager::init(int sectionNumber) {
case 6:
_driver = new Nebular::ASound6(_mixer);
break;
+ case 7:
+ _driver = new Nebular::ASound1(_mixer);
+ break;
default:
_driver = nullptr;
break;