aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/sound.h
diff options
context:
space:
mode:
Diffstat (limited to 'engines/kyra/sound.h')
-rw-r--r--engines/kyra/sound.h57
1 files changed, 43 insertions, 14 deletions
diff --git a/engines/kyra/sound.h b/engines/kyra/sound.h
index 1baeb3064a..cebfdf491f 100644
--- a/engines/kyra/sound.h
+++ b/engines/kyra/sound.h
@@ -73,7 +73,8 @@ public:
kAdlib,
kMidiMT32,
kMidiGM,
- kTowns
+ kTowns,
+ kPC98
};
virtual kType getMusicType() const = 0;
@@ -382,7 +383,9 @@ private:
Common::Mutex _mutex;
};
-class SoundTowns_EuphonyDriver;
+class Towns_EuphonyDriver;
+class TownsPC98_OpnDriver;
+
class SoundTowns : public MidiDriver, public Sound {
public:
SoundTowns(KyraEngine_v1 *vm, Audio::Mixer *mixer);
@@ -417,6 +420,7 @@ public:
static float semitoneAndSampleRate_to_sampleStep(int8 semiTone, int8 semiToneRootkey,
uint32 sampleRate, uint32 outputRate, int32 pitchWheel);
+
private:
bool loadInstruments();
void playEuphonyTrack(uint32 offset, int loop);
@@ -430,7 +434,7 @@ private:
uint _sfxFileIndex;
uint8 *_sfxFileData;
- SoundTowns_EuphonyDriver * _driver;
+ Towns_EuphonyDriver * _driver;
MidiParser * _parser;
Common::Mutex _mutex;
@@ -439,13 +443,38 @@ private:
const uint8 *_sfxWDTable;
};
-//class SoundTowns_v2_TwnDriver;
-class SoundTowns_v2 : public Sound {
+class SoundPC98 : public Sound {
public:
- SoundTowns_v2(KyraEngine_v1 *vm, Audio::Mixer *mixer);
- ~SoundTowns_v2();
+ SoundPC98(KyraEngine_v1 *vm, Audio::Mixer *mixer);
+ ~SoundPC98();
- kType getMusicType() const { return kTowns; }
+ virtual kType getMusicType() const { return kPC98; }
+
+ bool init();
+
+ void process() {}
+ void loadSoundFile(uint file) {}
+
+ void playTrack(uint8 track);
+ void haltTrack();
+ void beginFadeOut();
+
+ int32 voicePlay(const char *file, bool isSfx = false) { return -1; }
+ void playSoundEffect(uint8);
+
+protected:
+ int _lastTrack;
+ uint8 *_musicTrackData;
+ uint8 *_sfxTrackData;
+ TownsPC98_OpnDriver *_driver;
+};
+
+class SoundTownsPC98_v2 : public Sound {
+public:
+ SoundTownsPC98_v2(KyraEngine_v1 *vm, Audio::Mixer *mixer);
+ ~SoundTownsPC98_v2();
+
+ kType getMusicType() const { return _vm->gameFlags().platform == Common::kPlatformFMTowns ? kTowns : kPC98; }
bool init();
void process();
@@ -457,15 +486,15 @@ public:
void beginFadeOut();
int32 voicePlay(const char *file, bool isSfx = false);
- void playSoundEffect(uint8) {}
-
-private:
- int _lastTrack;
+ void playSoundEffect(uint8 track);
+protected:
Audio::AudioStream *_currentSFX;
+ int _lastTrack;
+ bool _useFmSfx;
- //SoundTowns_v2_TwnDriver *_driver;
- uint8 *_twnTrackData;
+ uint8 *_musicTrackData;
+ TownsPC98_OpnDriver *_driver;
};
class MixedSoundDriver : public Sound {