AUDIO/GUI: add SegaCD sound settings

This commit is contained in:
athrxx 2020-07-11 18:05:43 +02:00
parent f2b02a77ce
commit 5e276286ae
9 changed files with 50 additions and 10 deletions

View file

@ -109,6 +109,7 @@ static const struct {
{ MT_APPLEIIGS, GUIO_MIDIAPPLEIIGS },
{ MT_TOWNS, GUIO_MIDITOWNS },
{ MT_PC98, GUIO_MIDIPC98 },
{ MT_SEGACD, GUIO_MIDISEGACD },
{ MT_GM, GUIO_MIDIGM },
{ MT_MT32, GUIO_MIDIMT32 },
{ 0, 0 },
@ -229,6 +230,11 @@ MidiDriver::DeviceHandle MidiDriver::detectDevice(int flags) {
reslt = hdl;
break;
case MT_SEGACD:
if (flags & MDT_SEGACD)
reslt = hdl;
break;
case MT_GM:
case MT_GS:
case MT_MT32:
@ -363,6 +369,9 @@ MidiDriver::DeviceHandle MidiDriver::detectDevice(int flags) {
} else if (flags & MDT_PC98) {
tp = MT_PC98;
flags &= ~MDT_PC98;
} else if (flags & MDT_SEGACD) {
tp = MT_SEGACD;
flags &= ~MDT_SEGACD;
} else if (flags & MDT_ADLIB) {
tp = MT_ADLIB;
flags &= ~MDT_ADLIB;

View file

@ -47,6 +47,7 @@ enum MusicType {
MT_APPLEIIGS, // Apple IIGS
MT_TOWNS, // FM-TOWNS
MT_PC98, // PC98
MT_SEGACD, // SegaCD
MT_GM, // General MIDI
MT_MT32, // MT-32
MT_GS // Roland GS
@ -77,11 +78,12 @@ enum MidiDriverFlags {
MDT_AMIGA = 1 << 5,
MDT_APPLEIIGS = 1 << 6,
MDT_TOWNS = 1 << 7, // FM-TOWNS: Maps to MT_TOWNS
MDT_PC98 = 1 << 8, // FM-TOWNS: Maps to MT_PC98
MDT_MIDI = 1 << 9, // Real MIDI
MDT_PREFER_MT32 = 1 << 10, // MT-32 output is preferred
MDT_PREFER_GM = 1 << 11, // GM output is preferred
MDT_PREFER_FLUID= 1 << 12 // FluidSynth driver is preferred
MDT_PC98 = 1 << 8, // PC-98: Maps to MT_PC98
MDT_SEGACD = 1 << 9,
MDT_MIDI = 1 << 10, // Real MIDI
MDT_PREFER_MT32 = 1 << 11, // MT-32 output is preferred
MDT_PREFER_GM = 1 << 12, // GM output is preferred
MDT_PREFER_FLUID= 1 << 13 // FluidSynth driver is preferred
};
/**

View file

@ -76,10 +76,36 @@ Common::Error PC98EmuMusicPlugin::createInstance(MidiDriver **mididriver, MidiDr
return Common::kUnknownError;
}
class SegaCDSoundPlugin : public MusicPluginObject {
public:
const char *getName() const {
return _s("SegaCD Audio");
}
const char *getId() const {
return "segacd";
}
MusicDevices getDevices() const;
Common::Error createInstance(MidiDriver **mididriver, MidiDriver::DeviceHandle = 0) const;
};
MusicDevices SegaCDSoundPlugin::getDevices() const {
MusicDevices devices;
devices.push_back(MusicDevice(this, "", MT_SEGACD));
return devices;
}
Common::Error SegaCDSoundPlugin::createInstance(MidiDriver **mididriver, MidiDriver::DeviceHandle) const {
*mididriver = 0;
return Common::kUnknownError;
}
//#if PLUGIN_ENABLED_DYNAMIC(TOWNS)
//REGISTER_PLUGIN_DYNAMIC(TOWNS, PLUGIN_TYPE_MUSIC, TownsEmuMusicPlugin);
//REGISTER_PLUGIN_DYNAMIC(TOWNS, PLUGIN_TYPE_MUSIC, TownsEmuMusicPlugin);
//REGISTER_PLUGIN_DYNAMIC(PC98, PLUGIN_TYPE_MUSIC, PC98EmuMusicPlugin);
//#else
REGISTER_PLUGIN_STATIC(TOWNS, PLUGIN_TYPE_MUSIC, TownsEmuMusicPlugin);
REGISTER_PLUGIN_STATIC(PC98, PLUGIN_TYPE_MUSIC, PC98EmuMusicPlugin);
REGISTER_PLUGIN_STATIC(SEGACD, PLUGIN_TYPE_MUSIC, SegaCDSoundPlugin);
//#endif

View file

@ -137,6 +137,7 @@ public:
LINK_PLUGIN(APPLEIIGS)
LINK_PLUGIN(TOWNS)
LINK_PLUGIN(PC98)
LINK_PLUGIN(SEGACD)
#if defined(USE_TIMIDITY)
LINK_PLUGIN(TIMIDITY)
#endif

View file

@ -53,6 +53,7 @@ const struct GameOpt {
{ GUIO_MIDIAPPLEIIGS,"midiAppleIIgs" },
{ GUIO_MIDITOWNS, "midiTowns" },
{ GUIO_MIDIPC98, "midiPC98" },
{ GUIO_MIDISEGACD, "midiSegaCD" },
{ GUIO_MIDIMT32, "midiMt32" },
{ GUIO_MIDIGM, "midiGM" },

View file

@ -41,6 +41,7 @@
#define GUIO_MIDIAPPLEIIGS "\015"
#define GUIO_MIDITOWNS "\016"
#define GUIO_MIDIPC98 "\017"
#define GUIO_MIDISEGACD "\018"
#define GUIO_MIDIMT32 "\020"
#define GUIO_MIDIGM "\021"

View file

@ -1840,7 +1840,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::EN_ANY,
Common::kPlatformSegaCD,
ADGF_NO_FLAGS,
GUIO3(GUIO_NOSPEECH, GUIO_NOMIDI, GAMEOPTION_EOB_MOUSESWAP)
GUIO3(GUIO_NOSPEECH, GUIO_MIDISEGACD, GAMEOPTION_EOB_MOUSESWAP)
},
EOB_FLAGS
},

View file

@ -434,7 +434,7 @@ Common::Error EoBCoreEngine::init() {
_sound = new SoundAmiga_EoB(this, _mixer);
break;
case Common::kPlatformSegaCD:
dev = MidiDriver::detectDevice(/*MDT_SEGACD*/MDT_TOWNS);
dev = MidiDriver::detectDevice(MDT_SEGACD);
_sound = new SoundSegaCD_EoB(this, _mixer);
break;
default:

View file

@ -1284,8 +1284,8 @@ void OptionsDialog::addAudioControls(GuiObject *boss, const Common::String &pref
for (MusicDevices::iterator d = i.begin(); d != i.end(); ++d) {
Common::String deviceGuiOption = MidiDriver::musicType2GUIO(d->getMusicType());
if ((_domain == Common::ConfigManager::kApplicationDomain && d->getMusicType() != MT_TOWNS // global dialog - skip useless FM-Towns, C64, Amiga, AppleIIGS options there
&& d->getMusicType() != MT_C64 && d->getMusicType() != MT_AMIGA && d->getMusicType() != MT_APPLEIIGS && d->getMusicType() != MT_PC98)
if ((_domain == Common::ConfigManager::kApplicationDomain && d->getMusicType() != MT_TOWNS // global dialog - skip useless FM-Towns, C64, Amiga, AppleIIGS and SegaCD options there
&& d->getMusicType() != MT_C64 && d->getMusicType() != MT_AMIGA && d->getMusicType() != MT_APPLEIIGS && d->getMusicType() != MT_PC98 && d->getMusicType() != MT_SEGACD)
|| (_domain != Common::ConfigManager::kApplicationDomain && !hasMidiDefined) // No flags are specified
|| (_guioptions.contains(deviceGuiOption)) // flag is present
// HACK/FIXME: For now we have to show GM devices, even when the game only has GUIO_MIDIMT32 set,