aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBendegúz Nagy2016-08-16 19:38:52 +0200
committerBendegúz Nagy2016-08-26 23:02:22 +0200
commit621d83c66b0d9781835c274fe23c2ae2d12bc604 (patch)
treef76d0593e1437862d8d8f64b31969e325130f870
parent0eb61d0a7d1450ca79adfe8ef4bd3874de51ce67 (diff)
downloadscummvm-rg350-621d83c66b0d9781835c274fe23c2ae2d12bc604.tar.gz
scummvm-rg350-621d83c66b0d9781835c274fe23c2ae2d12bc604.tar.bz2
scummvm-rg350-621d83c66b0d9781835c274fe23c2ae2d12bc604.zip
DM: Add SoundMan_Atari
-rw-r--r--engines/dm/dm.cpp4
-rw-r--r--engines/dm/sounds.cpp11
-rw-r--r--engines/dm/sounds.h23
3 files changed, 31 insertions, 7 deletions
diff --git a/engines/dm/dm.cpp b/engines/dm/dm.cpp
index 19003bb7f1..e22a41dee6 100644
--- a/engines/dm/dm.cpp
+++ b/engines/dm/dm.cpp
@@ -224,7 +224,7 @@ DMEngine::~DMEngine() {
delete _dialog;
delete _sound;
-
+
delete[] _savedScreenForOpenEntranceDoors;
// clear debug channels
@@ -361,7 +361,7 @@ Common::Error DMEngine::run() {
_timeline = new Timeline(this);
_projexpl = new ProjExpl(this);
_dialog = new DialogMan(this);
- _sound = new SoundMan(this);
+ _sound = SoundMan::getSoundMan(this, _gameVersion);
_displayMan->setUpScreens(320, 200);
f463_initializeGame();
diff --git a/engines/dm/sounds.cpp b/engines/dm/sounds.cpp
index c90409da60..ad9bc09f97 100644
--- a/engines/dm/sounds.cpp
+++ b/engines/dm/sounds.cpp
@@ -27,6 +27,7 @@
#include "audio/audiostream.h"
#include "audio/decoders/raw.h"
+#include <advancedDetector.h>
#include "dm.h"
#include "gfx.h"
@@ -38,6 +39,14 @@
namespace DM {
+SoundMan* SoundMan::getSoundMan(DMEngine* vm, const ADGameDescription* gameVersion) {
+ switch (gameVersion->platform) {
+ default: warning(false, "Unknown platform, using default Amiga SoundMan");
+ case Common::kPlatformAmiga: return new SoundMan(vm);
+ case Common::kPlatformAtariST: return new SoundMan_Atari(vm);
+ }
+}
+
SoundMan::SoundMan(DMEngine* vm) : _vm(vm) {}
SoundMan::~SoundMan() {
@@ -45,6 +54,7 @@ SoundMan::~SoundMan() {
delete[] _gK24_soundData[i]._firstSample;
}
+
Sound g60_sounds[k34_D13_soundCount] = {
Sound(533, 112, 11, 3, 6), /* k00_soundMETALLIC_THUD 0 */
Sound(534, 112, 15, 0, 3), /* k01_soundSWITCH 1 */
@@ -207,4 +217,5 @@ void SoundMan::f064_SOUND_RequestPlay_CPSD(uint16 soundIndex, int16 mapX, int16
_pendingSounds.push(PendingSound(leftVolume, rightVolume, soundIndex));
}
+
}
diff --git a/engines/dm/sounds.h b/engines/dm/sounds.h
index b3add4a423..6377835a66 100644
--- a/engines/dm/sounds.h
+++ b/engines/dm/sounds.h
@@ -63,18 +63,31 @@ public:
class SoundMan {
DMEngine *_vm;
-public:
+protected:
SoundMan(DMEngine* vm);
- ~SoundMan();
+public:
+ virtual ~SoundMan();
+
+ static SoundMan *getSoundMan(DMEngine *vm, const ADGameDescription *gameVersion);
SoundData _gK24_soundData[k34_D13_soundCount]; // @ K0024_as_SoundData
Common::Queue<PendingSound> _pendingSounds;
- void f503_loadSounds(); // @ F0503_SOUND_LoadAll
- void f064_SOUND_RequestPlay_CPSD(uint16 P0088_ui_SoundIndex, int16 P0089_i_MapX, int16 P0090_i_MapY, uint16 P0091_ui_Mode); // @ F0064_SOUND_RequestPlay_CPSD
- void f060_SOUND_Play(uint16 P0921_ui_SoundIndex, uint16 P0085_i_Period, uint8 leftVol, uint8 rightVol); // @ F0060_SOUND_Play
+ virtual void f503_loadSounds(); // @ F0503_SOUND_LoadAll
+ virtual void f064_SOUND_RequestPlay_CPSD(uint16 P0088_ui_SoundIndex, int16 P0089_i_MapX, int16 P0090_i_MapY, uint16 P0091_ui_Mode); // @ F0064_SOUND_RequestPlay_CPSD
+ virtual void f060_SOUND_Play(uint16 P0921_ui_SoundIndex, uint16 P0085_i_Period, uint8 leftVol, uint8 rightVol); // @ F0060_SOUND_Play
void f65_playPendingSound(); // @ F0065_SOUND_PlayPendingSound_CPSD
bool f505_soundGetVolume(int16 mapX, int16 mapY, uint8 *leftVolume, uint8 *rightVolume); // @ F0505_SOUND_GetVolume
};
+class SoundMan_Atari: public SoundMan {
+ friend class SoundMan;
+
+ SoundMan_Atari(DMEngine* vm): SoundMan(vm) {};
+public:
+ void f503_loadSounds() override {} // @ F0503_SOUND_LoadAll
+ void f064_SOUND_RequestPlay_CPSD(uint16 P0088_ui_SoundIndex, int16 P0089_i_MapX, int16 P0090_i_MapY, uint16 P0091_ui_Mode) override {} // @ F0064_SOUND_RequestPlay_CPSD
+ void f060_SOUND_Play(uint16 P0921_ui_SoundIndex, uint16 P0085_i_Period, uint8 leftVol, uint8 rightVol) override {} // @ F0060_SOUND_Play
+};
+
} \ No newline at end of file