Skip to content

Commit

Permalink
COMMON: move Miles Audio AdLib+MT32 to common
Browse files Browse the repository at this point in the history
- remove Miles Audio from Sherlock engine
- put Miles Audio into common audio (namespace Audio)
- Miles Audio is used at least by the engines
TINSEL, GROOVIE, TOLTECS, SAGA and KYRA
This way it can be used by the other engines
  • Loading branch information
Martin Kiewitz committed Jun 27, 2015
1 parent 9cfe5c1 commit 0655839
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 24 deletions.
11 changes: 5 additions & 6 deletions ...erlock/tattoo/drivers/tattoo_mididriver.h → audio/miles.h
Expand Up @@ -20,14 +20,13 @@
*
*/

#ifndef SHERLOCK_TATTOO_DRIVERS_MIDIDRIVER_H
#define SHERLOCK_TATTOO_DRIVERS_MIDIDRIVER_H
#ifndef AUDIO_MILES_MIDIDRIVER_H
#define AUDIO_MILES_MIDIDRIVER_H

#include "sherlock/sherlock.h"
#include "audio/mididrv.h"
#include "common/error.h"

namespace Sherlock {
namespace Audio {

#define MILES_MIDI_CHANNEL_COUNT 16

Expand Down Expand Up @@ -64,6 +63,6 @@ extern MidiDriver *MidiDriver_Miles_AdLib_create(const Common::String instrument

extern MidiDriver *MidiDriver_Miles_MT32_create(const Common::String instrumentDataFilename);

} // End of namespace Sherlock
} // End of namespace Audio

#endif // SHERLOCK_TATTOO_DRIVERS_MIDIDRIVER_H
#endif // AUDIO_MILES_MIDIDRIVER_H
Expand Up @@ -20,8 +20,7 @@
*
*/

#include "sherlock/sherlock.h"
#include "sherlock/tattoo/drivers/tattoo_mididriver.h"
#include "audio/miles.h"

#include "common/file.h"
#include "common/system.h"
Expand All @@ -30,12 +29,11 @@
#include "audio/fmopl.h"
#include "audio/softsynth/emumidi.h"

namespace Sherlock {
namespace Audio {

// Miles Audio supported the following things:
// regular AdLib OPL card
// Dual-OPL2 <-- we don't do this atm
// OPL3 <-- we do support this, but there is no support for 4-op voices atm
// Miles Audio AdLib/OPL3 driver
//
// TODO: currently missing: OPL3 4-op voices

#define MILES_ADLIB_VIRTUAL_FMVOICES_COUNT_MAX 20
#define MILES_ADLIB_PHYSICAL_FMVOICES_COUNT_MAX 18
Expand Down Expand Up @@ -1134,4 +1132,4 @@ MidiDriver *MidiDriver_Miles_AdLib_create(const Common::String instrumentDataFil
return new MidiDriver_Miles_AdLib(g_system->getMixer(), instrumentTablePtr, instrumentTableCount);
}

} // End of namespace Sherlock
} // End of namespace Audio
Expand Up @@ -20,15 +20,19 @@
*
*/

#include "sherlock/sherlock.h"
#include "sherlock/tattoo/drivers/tattoo_mididriver.h"
#include "audio/miles.h"

#include "common/config-manager.h"
#include "common/file.h"
#include "common/mutex.h"
#include "common/system.h"
#include "common/textconsole.h"

namespace Sherlock {
namespace Audio {

// Miles Audio MT32 driver
//
// TODO: currently missing: timbre file support (used in 7th Guest)

#define MILES_MT32_PATCH_COUNT 128

Expand Down Expand Up @@ -434,4 +438,4 @@ MidiDriver *MidiDriver_Miles_MT32_create(const Common::String instrumentDataFile
return new MidiDriver_Miles_MT32();
}

} // End of namespace Sherlock
} // End of namespace Audio
2 changes: 2 additions & 0 deletions audio/module.mk
Expand Up @@ -9,6 +9,8 @@ MODULE_OBJS := \
midiparser_xmidi.o \
midiparser.o \
midiplayer.o \
miles_adlib.o \
miles_mt32.o \
mixer.o \
mpu401.o \
musicplugin.o \
Expand Down
2 changes: 0 additions & 2 deletions engines/sherlock/module.mk
Expand Up @@ -19,8 +19,6 @@ MODULE_OBJS = \
scalpel/scalpel_talk.o \
scalpel/scalpel_user_interface.o \
scalpel/settings.o \
tattoo/drivers/tattoo_adlib.o \
tattoo/drivers/tattoo_mt32.o \
tattoo/tattoo.o \
tattoo/tattoo_fixed_text.o \
tattoo/tattoo_journal.o \
Expand Down
9 changes: 5 additions & 4 deletions engines/sherlock/music.cpp
Expand Up @@ -25,7 +25,8 @@
#include "sherlock/sherlock.h"
#include "sherlock/music.h"
#include "sherlock/scalpel/drivers/mididriver.h"
#include "sherlock/tattoo/drivers/tattoo_mididriver.h"
// for Miles Audio (Sherlock Holmes 2)
#include "audio/miles.h"
// for 3DO digital music
#include "audio/decoders/aiff.h"

Expand Down Expand Up @@ -269,14 +270,14 @@ Music::Music(SherlockEngine *vm, Audio::Mixer *mixer) : _vm(vm), _mixer(mixer) {
// SAMPLE.AD -> regular AdLib instrument data
// SAMPLE.OPL -> OPL-3 instrument data
// although in case of Rose Tattoo both files are exactly the same
_midiDriver = MidiDriver_Miles_AdLib_create("SAMPLE.AD", "SAMPLE.OPL");
_midiDriver = Audio::MidiDriver_Miles_AdLib_create("SAMPLE.AD", "SAMPLE.OPL");
break;
case MT_MT32:
_midiDriver = MidiDriver_Miles_MT32_create("SAMPLE.MT");
_midiDriver = Audio::MidiDriver_Miles_MT32_create("SAMPLE.MT");
break;
case MT_GM:
if (ConfMan.getBool("native_mt32")) {
_midiDriver = MidiDriver_Miles_MT32_create("SAMPLE.MT");
_midiDriver = Audio::MidiDriver_Miles_MT32_create("SAMPLE.MT");
_musicType = MT_MT32;
}
break;
Expand Down

0 comments on commit 0655839

Please sign in to comment.