diff options
-rw-r--r-- | base/plugins.cpp | 5 | ||||
-rw-r--r-- | common/util.cpp | 3 | ||||
-rw-r--r-- | common/util.h | 11 | ||||
-rw-r--r-- | engines/scumm/detection_tables.h | 4 | ||||
-rw-r--r-- | engines/scumm/scumm.cpp | 6 | ||||
-rw-r--r-- | gui/options.cpp | 3 | ||||
-rw-r--r-- | po/POTFILES | 3 | ||||
-rw-r--r-- | sound/mididrv.cpp | 35 | ||||
-rw-r--r-- | sound/mididrv.h | 26 | ||||
-rw-r--r-- | sound/mods/paula.cpp | 32 | ||||
-rw-r--r-- | sound/module.mk | 1 | ||||
-rw-r--r-- | sound/softsynth/appleiigs.cpp | 57 | ||||
-rw-r--r-- | sound/softsynth/sid.cpp | 31 |
13 files changed, 197 insertions, 20 deletions
diff --git a/base/plugins.cpp b/base/plugins.cpp index 5d0be11065..be6c30e243 100644 --- a/base/plugins.cpp +++ b/base/plugins.cpp @@ -200,6 +200,11 @@ public: LINK_PLUGIN(ADLIB) LINK_PLUGIN(PCSPK) LINK_PLUGIN(PCJR) + #ifndef DISABLE_SID + LINK_PLUGIN(C64) + #endif + LINK_PLUGIN(AMIGA) + LINK_PLUGIN(APPLEIIGS) LINK_PLUGIN(TOWNS) #if defined (UNIX) LINK_PLUGIN(TIMIDITY) diff --git a/common/util.cpp b/common/util.cpp index 9e36e0f161..d8a621568c 100644 --- a/common/util.cpp +++ b/common/util.cpp @@ -306,6 +306,9 @@ const struct GameOpt { { GUIO_MIDICMS, "midiCMS" }, { GUIO_MIDIPCJR, "midiPCJr" }, { GUIO_MIDIADLIB, "midiAdLib" }, + { GUIO_MIDIC64, "midiC64" }, + { GUIO_MIDIAMIGA, "midiAmiga" }, + { GUIO_MIDIAPPLEIIGS,"midiAppleIIgs" }, { GUIO_MIDITOWNS, "midiTowns" }, { GUIO_MIDIPC98, "midiPC98" }, { GUIO_MIDIMT32, "midiMt32" }, diff --git a/common/util.h b/common/util.h index 7a9cf4fb2d..99adc0c82f 100644 --- a/common/util.h +++ b/common/util.h @@ -223,10 +223,13 @@ enum GameGUIOption { GUIO_MIDICMS = (1 << 7), GUIO_MIDIPCJR = (1 << 8), GUIO_MIDIADLIB = (1 << 9), - GUIO_MIDITOWNS = (1 << 10), - GUIO_MIDIPC98 = (1 << 11), - GUIO_MIDIMT32 = (1 << 12), - GUIO_MIDIGM = (1 << 13) + GUIO_MIDIC64 = (1 << 10), + GUIO_MIDIAMIGA = (1 << 11), + GUIO_MIDIAPPLEIIGS = (1 << 12), + GUIO_MIDITOWNS = (1 << 13), + GUIO_MIDIPC98 = (1 << 14), + GUIO_MIDIMT32 = (1 << 15), + GUIO_MIDIGM = (1 << 16) }; bool checkGameGUIOption(GameGUIOption option, const String &str); diff --git a/engines/scumm/detection_tables.h b/engines/scumm/detection_tables.h index 336d0c51c0..f275b1c93f 100644 --- a/engines/scumm/detection_tables.h +++ b/engines/scumm/detection_tables.h @@ -207,8 +207,8 @@ using Common::GUIO_NOSPEECH; // only a single unique variant. This is used to help the detector quickly // decide whether it has to worry about distinguishing multiple variants or not. static const GameSettings gameVariantsTable[] = { - {"maniac", "Apple II", 0, GID_MANIAC, 0, 0, MDT_PCSPK, 0, Common::kPlatformApple2GS, GUIO_NOSPEECH | GUIO_NOMIDI}, - {"maniac", "C64", 0, GID_MANIAC, 0, 0, MDT_PCSPK, 0, Common::kPlatformC64, GUIO_NOSPEECH | GUIO_NOMIDI}, + {"maniac", "Apple II", 0, GID_MANIAC, 0, 0, MDT_APPLEIIGS, 0, Common::kPlatformApple2GS, GUIO_NOSPEECH | GUIO_NOMIDI}, + {"maniac", "C64", 0, GID_MANIAC, 0, 0, MDT_C64, 0, Common::kPlatformC64, GUIO_NOSPEECH | GUIO_NOMIDI}, {"maniac", "V1", "v1", GID_MANIAC, 1, 0, MDT_PCSPK | MDT_PCJR, 0, Common::kPlatformPC, GUIO_NOSPEECH | GUIO_NOMIDI}, {"maniac", "V1 Demo", "v1", GID_MANIAC, 1, 0, MDT_PCSPK | MDT_PCJR, GF_DEMO, Common::kPlatformPC, GUIO_NOSPEECH | GUIO_NOMIDI}, {"maniac", "NES", 0, GID_MANIAC, 1, 0, MDT_NONE, 0, Common::kPlatformNES, GUIO_NOSPEECH | GUIO_NOMIDI}, diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index d72306abc3..6e3815d314 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -1663,6 +1663,12 @@ void ScummEngine::setupMusic(int midi) { case MT_ADLIB: _musicType = MDT_ADLIB; break; + case MT_C64: + _musicType = MDT_C64; + break; + case MT_APPLEIIGS: + _musicType = MDT_APPLEIIGS; + break; default: _musicType = MDT_MIDI; break; diff --git a/gui/options.cpp b/gui/options.cpp index d1901e9219..69e92bf5eb 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -672,7 +672,8 @@ void OptionsDialog::addAudioControls(GuiObject *boss, const Common::String &pref for (MusicDevices::iterator d = i.begin(); d != i.end(); ++d) { const uint32 deviceGuiOption = MidiDriver::musicType2GUIO(d->getMusicType()); - if ((_domain == Common::ConfigManager::kApplicationDomain && d->getMusicType() != MT_TOWNS) // global dialog - skip useless FM-Towns option there + 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) || (_domain != Common::ConfigManager::kApplicationDomain && !(_guioptions & allFlags)) // No flags are specified || (_guioptions & deviceGuiOption) // flag is present // HACK/FIXME: For now we have to show GM devices, even when the game only has GUIO_MIDIMT32 set, diff --git a/po/POTFILES b/po/POTFILES index 28ca60d31b..59af170c2f 100644 --- a/po/POTFILES +++ b/po/POTFILES @@ -26,7 +26,10 @@ sound/fmopl.cpp sound/musicplugin.cpp sound/null.h sound/null.cpp +sound/mods/paula.cpp sound/softsynth/adlib.cpp +sound/softsynth/appleiigs.cpp +sound/softsynth/sid.cpp sound/softsynth/mt32.cpp sound/softsynth/pcspk.cpp sound/softsynth/ym2612.cpp diff --git a/sound/mididrv.cpp b/sound/mididrv.cpp index c7587992e0..0f4b4d779f 100644 --- a/sound/mididrv.cpp +++ b/sound/mididrv.cpp @@ -61,8 +61,12 @@ static const uint32 GUIOMapping[] = { /*MDT_CMS, Common::GUIO_MIDICMS,*/ MT_PCJR, Common::GUIO_MIDIPCJR, MT_ADLIB, Common::GUIO_MIDIADLIB, - MT_TOWNS, Common::GUIO_MIDITOWNS, - MT_GM, Common::GUIO_MIDIGM, + MT_C64, Common::GUIO_MIDIC64, + MT_AMIGA, Common::GUIO_MIDIAMIGA, + MT_APPLEIIGS, Common::GUIO_MIDIAPPLEIIGS, + MT_TOWNS, Common::GUIO_MIDITOWNS, + MT_PC98, Common::GUIO_MIDIPC98, + MT_GM, Common::GUIO_MIDIGM, MT_MT32, Common::GUIO_MIDIMT32, 0, 0 }; @@ -150,6 +154,21 @@ MidiDriver::DeviceHandle MidiDriver::detectDevice(int flags) { return hdl; break; + case MT_C64: + if (flags & MDT_C64) + return hdl; + break; + + case MT_AMIGA: + if (flags & MDT_AMIGA) + return hdl; + break; + + case MT_APPLEIIGS: + if (flags & MDT_APPLEIIGS) + return hdl; + break; + case MT_TOWNS: if (flags & MDT_TOWNS) return hdl; @@ -224,11 +243,21 @@ MidiDriver::DeviceHandle MidiDriver::detectDevice(int flags) { MusicType tp = MT_AUTO; if (flags & MDT_TOWNS) tp = MT_TOWNS; + else if (flags & MDT_PC98) + tp = MT_PC98; else if (flags & MDT_ADLIB) tp = MT_ADLIB; else if (flags & MDT_PCSPK) tp = MT_PCSPK; - else if (l == 0) + else if (flags & MDT_PCJR) + tp = MT_PCJR; + else if (flags & MDT_C64) + tp = MT_C64; + else if (flags & MDT_AMIGA) + tp = MT_AMIGA; + else if (flags & MDT_APPLEIIGS) + tp = MT_APPLEIIGS; + else if (l == 0) // if we haven't tried to find a MIDI device yet we do this now. continue; else diff --git a/sound/mididrv.h b/sound/mididrv.h index 1184adee6c..ff21b891da 100644 --- a/sound/mididrv.h +++ b/sound/mididrv.h @@ -57,6 +57,9 @@ enum MusicType { MT_PCJR, // PCjr MT_CMS, // CMS MT_ADLIB, // AdLib + MT_C64, // C64 + MT_AMIGA, // Amiga + MT_APPLEIIGS, // Apple IIGS MT_TOWNS, // FM-TOWNS MT_PC98, // PC98 MT_GM, // General MIDI @@ -75,16 +78,19 @@ enum MusicType { * @todo Rename MidiDriverFlags to MusicDriverFlags */ enum MidiDriverFlags { - MDT_NONE = 0, - MDT_PCSPK = 1 << 0, // PC Speaker: Maps to MD_PCSPK and MD_PCJR - MDT_CMS = 1 << 1, // Creative Music System / Gameblaster: Maps to MD_CMS - MDT_PCJR = 1 << 2, // Tandy/PC Junior driver - MDT_ADLIB = 1 << 3, // AdLib: Maps to MT_ADLIB - MDT_TOWNS = 1 << 4, // FM-TOWNS: Maps to MT_TOWNS - MDT_PC98 = 1 << 5, // FM-TOWNS: Maps to MT_PC98 - MDT_MIDI = 1 << 6, // Real MIDI - MDT_PREFER_MT32 = 1 << 7, // MT-32 output is preferred - MDT_PREFER_GM = 1 << 8 // GM output is preferred + MDT_NONE = 0, + MDT_PCSPK = 1 << 0, // PC Speaker: Maps to MD_PCSPK and MD_PCJR + MDT_CMS = 1 << 1, // Creative Music System / Gameblaster: Maps to MD_CMS + MDT_PCJR = 1 << 2, // Tandy/PC Junior driver + MDT_ADLIB = 1 << 3, // AdLib: Maps to MT_ADLIB + MDT_C64 = 1 << 4, + 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 }; /** diff --git a/sound/mods/paula.cpp b/sound/mods/paula.cpp index 45626bb2ec..c39b37f83d 100644 --- a/sound/mods/paula.cpp +++ b/sound/mods/paula.cpp @@ -24,6 +24,7 @@ */ #include "sound/mods/paula.h" +#include "sound/null.h" namespace Audio { @@ -178,3 +179,34 @@ int Paula::readBufferIntern(int16 *buffer, const int numSamples) { } } // End of namespace Audio + + +// Plugin interface +// (This can only create a null driver since apple II gs support seeems not to be implemented +// and also is not part of the midi driver architecture. But we need the plugin for the options +// menu in the launcher and for MidiDriver::detectDevice() which is more or less used by all engines.) + +class AmigaMusicPlugin : public NullMusicPlugin { +public: + const char *getName() const { + return _s("Amiga Audio Emulator"); + } + + const char *getId() const { + return "amiga"; + } + + MusicDevices getDevices() const; +}; + +MusicDevices AmigaMusicPlugin::getDevices() const { + MusicDevices devices; + devices.push_back(MusicDevice(this, "", MT_AMIGA)); + return devices; +} + +//#if PLUGIN_ENABLED_DYNAMIC(AMIGA) + //REGISTER_PLUGIN_DYNAMIC(AMIGA, PLUGIN_TYPE_MUSIC, AmigaMusicPlugin); +//#else + REGISTER_PLUGIN_STATIC(AMIGA, PLUGIN_TYPE_MUSIC, AmigaMusicPlugin); +//#endif diff --git a/sound/module.mk b/sound/module.mk index caf14be547..70bffb13d2 100644 --- a/sound/module.mk +++ b/sound/module.mk @@ -40,6 +40,7 @@ MODULE_OBJS := \ softsynth/fmtowns_pc98/towns_euphony.o \ softsynth/fmtowns_pc98/towns_pc98_driver.o \ softsynth/fmtowns_pc98/towns_pc98_fmsynth.o \ + softsynth/appleiigs.o \ softsynth/ym2612.o \ softsynth/fluidsynth.o \ softsynth/mt32.o \ diff --git a/sound/softsynth/appleiigs.cpp b/sound/softsynth/appleiigs.cpp new file mode 100644 index 0000000000..9004d1f0ab --- /dev/null +++ b/sound/softsynth/appleiigs.cpp @@ -0,0 +1,57 @@ +/* ScummVM - Graphic Adventure Engine +* +* ScummVM is the legal property of its developers, whose names +* are too numerous to list here. Please refer to the COPYRIGHT +* file distributed with this source distribution. +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. + +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. + +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +* $URL$ +* $Id$ +* +*/ + +#include "sound/null.h" + +// Plugin interface +// (This can only create a null driver since apple II gs support seeems not to be implemented +// and also is not part of the midi driver architecture. But we need the plugin for the options +// menu in the launcher and for MidiDriver::detectDevice() which is more or less used by all engines.) + +class AppleIIGSMusicPlugin : public NullMusicPlugin { +public: + const char *getName() const { + return _s("Apple II GS Emulator (NOT IMPLEMENTED)"); + } + + const char *getId() const { + return "appleIIgs"; + } + + MusicDevices getDevices() const; +}; + +MusicDevices AppleIIGSMusicPlugin::getDevices() const { + MusicDevices devices; + devices.push_back(MusicDevice(this, "", MT_APPLEIIGS)); + return devices; +} + +//#if PLUGIN_ENABLED_DYNAMIC(APPLEIIGS) + //REGISTER_PLUGIN_DYNAMIC(APPLEIIGS, PLUGIN_TYPE_MUSIC, AppleIIGSMusicPlugin); +//#else + REGISTER_PLUGIN_STATIC(APPLEIIGS, PLUGIN_TYPE_MUSIC, AppleIIGSMusicPlugin); +//#endif + diff --git a/sound/softsynth/sid.cpp b/sound/softsynth/sid.cpp index e925f4a447..c05ae2e8f5 100644 --- a/sound/softsynth/sid.cpp +++ b/sound/softsynth/sid.cpp @@ -31,6 +31,7 @@ #ifndef DISABLE_SID #include "sid.h" +#include "sound/null.h" #include <math.h> namespace Resid { @@ -1422,4 +1423,34 @@ int SID::clock(cycle_count& delta_t, short* buf, int n, int interleave) { } +// Plugin interface +// (This can only create a null driver since C64 audio support is not part of the +// midi driver architecture. But we need the plugin for the options menu in the launcher +// and for MidiDriver::detectDevice() which is more or less used by all engines.) + +class C64MusicPlugin : public NullMusicPlugin { +public: + const char *getName() const { + return _s("C64 Audio Emulator"); + } + + const char *getId() const { + return "C64"; + } + + MusicDevices getDevices() const; +}; + +MusicDevices C64MusicPlugin::getDevices() const { + MusicDevices devices; + devices.push_back(MusicDevice(this, "", MT_C64)); + return devices; +} + +//#if PLUGIN_ENABLED_DYNAMIC(C64) + //REGISTER_PLUGIN_DYNAMIC(C64, PLUGIN_TYPE_MUSIC, C64MusicPlugin); +//#else + REGISTER_PLUGIN_STATIC(C64, PLUGIN_TYPE_MUSIC, C64MusicPlugin); +//#endif + #endif |