2002-03-25 08:51:34 +00:00
|
|
|
/* ScummVM - Scumm Interpreter
|
|
|
|
* Copyright (C) 2001 Ludvig Strigeus
|
2003-03-06 21:46:56 +00:00
|
|
|
* Copyright (C) 2001-2003 The ScummVM project
|
2002-03-25 08:51:34 +00:00
|
|
|
*
|
|
|
|
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*
|
|
|
|
* $Header$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2002-03-23 20:34:47 +00:00
|
|
|
#include "stdafx.h"
|
2003-10-02 22:52:57 +00:00
|
|
|
|
2003-07-31 12:33:33 +00:00
|
|
|
#include "backends/intern.h"
|
2003-10-02 22:52:57 +00:00
|
|
|
#include "base/engine.h"
|
2003-09-17 22:41:01 +00:00
|
|
|
#include "base/gameDetector.h"
|
|
|
|
#include "base/plugins.h"
|
2003-10-02 22:52:57 +00:00
|
|
|
|
2003-10-08 21:59:23 +00:00
|
|
|
#include "common/config-manager.h"
|
2003-08-01 12:21:04 +00:00
|
|
|
#include "common/scaler.h" // Only for gfx_modes
|
2003-10-02 22:52:57 +00:00
|
|
|
|
2002-04-19 11:12:27 +00:00
|
|
|
#include "sound/mididrv.h"
|
2003-09-08 17:42:53 +00:00
|
|
|
#include "sound/mixer.h"
|
2002-04-19 11:12:27 +00:00
|
|
|
|
2003-05-18 13:39:02 +00:00
|
|
|
#if defined(HAVE_CONFIG_H)
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
2002-05-02 18:59:31 +00:00
|
|
|
#define CHECK_OPTION() if ((current_option != NULL) || (*s != '\0')) goto ShowHelpAndExit
|
|
|
|
#define HANDLE_OPTION() if ((*s == '\0') && (current_option == NULL)) goto ShowHelpAndExit; \
|
|
|
|
if ((*s != '\0') && (current_option != NULL)) goto ShowHelpAndExit; \
|
|
|
|
option = (*s == '\0' ? current_option : s); \
|
|
|
|
current_option = NULL
|
|
|
|
#define HANDLE_OPT_OPTION() if ((*s != '\0') && (current_option != NULL)) goto ShowHelpAndExit; \
|
|
|
|
if ((*s == '\0') && (current_option == NULL)) option = NULL; \
|
|
|
|
else option = (*s == '\0' ? current_option : s); \
|
|
|
|
current_option = NULL
|
2002-04-12 10:34:46 +00:00
|
|
|
|
2002-12-28 12:20:55 +00:00
|
|
|
// DONT FIXME: DO NOT ORDER ALPHABETICALY, THIS IS ORDERED BY IMPORTANCE/CATEGORY! :)
|
2003-10-10 11:15:14 +00:00
|
|
|
// FIXME: Reconsider and reevaluate our command line options. I propose some changes:
|
|
|
|
// * add long alternatives for (almost?) all options. There should be some generic way
|
|
|
|
// to specify this, in order to avoid code duplication and to simplify the code
|
|
|
|
// * some more obscure options which currently have a single-letter options assigned
|
|
|
|
// really don't need it. E.g. the "-t<NUM>" option probably is rarely used, and anybody
|
|
|
|
// who needs it should still be happy with "--tempo=NUM"
|
|
|
|
// This will make room in the ranks of single-letter options for other more useful options
|
|
|
|
// (for example, "-t" could stand for "List (T)argets")
|
|
|
|
// * -y, -t, -c, -j all are candidates for this, IMHO: their settings are rather obscure,
|
|
|
|
// and anybody who needs them always should put them into the config file anyway
|
|
|
|
//
|
2003-04-30 12:43:56 +00:00
|
|
|
#ifdef __PALM_OS__
|
|
|
|
static const char USAGE_STRING[] = "NoUsageString"; // save more data segment space
|
|
|
|
#else
|
2002-04-12 10:34:46 +00:00
|
|
|
static const char USAGE_STRING[] =
|
2003-08-04 12:42:40 +00:00
|
|
|
"ScummVM - Graphical Adventure Game Interpreter\n"
|
2002-04-12 10:34:46 +00:00
|
|
|
"Syntax:\n"
|
2003-10-02 22:52:57 +00:00
|
|
|
" scummvm [OPTIONS] [game]\n"
|
2003-08-04 12:42:40 +00:00
|
|
|
"Options:\n"
|
2003-10-02 22:52:57 +00:00
|
|
|
" -p<path> - Look for game in <path>\n"
|
|
|
|
" -x[num] - Load this savegame (default: 0 - autosave)\n"
|
|
|
|
" -f - Full-screen mode (-F forces window mode.)\n"
|
|
|
|
" -g<mode> - Graphics mode (normal,2x,3x,2xsai,super2xsai,supereagle,\n"
|
|
|
|
" advmame2x,advmame3x,hq2x,hq3x,tv2x,dotmatrix)\n"
|
|
|
|
" -e<mode> - Set music engine (see README for details)\n"
|
|
|
|
" -q<lang> - Specify language (en,de,fr,it,pt,es,jp,zh,kr,se,gb,hb)\n"
|
2002-12-28 12:20:55 +00:00
|
|
|
"\n"
|
2003-10-02 22:52:57 +00:00
|
|
|
" -c<num> - Use cdrom <num> for cd audio\n"
|
|
|
|
" -j[num] - Enable input with joystick (default: 0 - first joystick)\n"
|
|
|
|
" -m<num> - Set music volume to <num> (0-255)\n"
|
|
|
|
" -o<num> - Set master volume to <num> (0-255)\n"
|
|
|
|
" -s<num> - Set sfx volume to <num> (0-255)\n"
|
2003-10-08 21:59:23 +00:00
|
|
|
#ifndef DISABLE_SCUMM
|
2003-10-02 22:52:57 +00:00
|
|
|
" -t<num> - Set music tempo (50-200, default 100%%)\n"
|
2003-10-08 21:59:23 +00:00
|
|
|
#endif
|
2002-12-28 12:20:55 +00:00
|
|
|
"\n"
|
2003-10-02 22:52:57 +00:00
|
|
|
" -n - No subtitles for speech\n"
|
2003-10-08 21:59:23 +00:00
|
|
|
#ifndef DISABLE_SCUMM
|
2003-10-02 22:52:57 +00:00
|
|
|
" -y - Set text speed (default: 60)\n"
|
2003-10-08 21:59:23 +00:00
|
|
|
#endif
|
2002-12-28 12:20:55 +00:00
|
|
|
"\n"
|
2003-10-02 22:52:57 +00:00
|
|
|
" -v - Show version info and exit\n"
|
|
|
|
" -h - Display this text and exit\n"
|
2003-10-08 21:59:23 +00:00
|
|
|
" -z - Display list of supported games\n"
|
2002-12-28 12:20:55 +00:00
|
|
|
"\n"
|
2003-10-02 22:52:57 +00:00
|
|
|
" -b<num> - Pass number to the boot script (boot param)\n"
|
|
|
|
" -d[num] - Enable debug output (debug level [0])\n"
|
|
|
|
" -u - Dump scripts\n"
|
2003-05-17 03:06:16 +00:00
|
|
|
"\n"
|
2003-10-02 22:52:57 +00:00
|
|
|
" --platform= - Specify version of game (amiga,atari-st,macintosh)\n"
|
|
|
|
" --multi-midi - Enable combination Adlib and native MIDI\n"
|
|
|
|
" --native-mt32 - True Roland MT-32 (disable GM emulation)\n"
|
|
|
|
" --fullscreen - Full-screen mode (same as -f)\n"
|
|
|
|
" --aspect-ratio - Enable aspect ratio correction\n"
|
2003-07-29 12:13:39 +00:00
|
|
|
#ifndef DISABLE_SCUMM
|
2003-10-02 22:52:57 +00:00
|
|
|
" --demo-mode - Start demo mode of Maniac Mansion (Classic version)\n"
|
2003-07-29 12:13:39 +00:00
|
|
|
#endif
|
2003-07-05 00:57:03 +00:00
|
|
|
#ifndef DISABLE_SKY
|
2003-10-02 22:52:57 +00:00
|
|
|
" --floppy-intro - Use floppy version intro for Beneath a Steel Sky CD\n"
|
2003-07-05 00:57:03 +00:00
|
|
|
#endif
|
2003-07-04 06:54:47 +00:00
|
|
|
"\n"
|
|
|
|
"The meaning of long options can be inverted by prefixing them with \"no-\",\n"
|
|
|
|
"e.g. \"--no-aspect-ratio\".\n"
|
2002-04-12 10:34:46 +00:00
|
|
|
;
|
2003-04-30 12:43:56 +00:00
|
|
|
#endif
|
2003-03-01 22:04:48 +00:00
|
|
|
|
2003-10-02 22:52:57 +00:00
|
|
|
struct GraphicsMode {
|
|
|
|
const char *name;
|
|
|
|
const char *description;
|
|
|
|
int id;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* List of graphic 'modes' we potentially support. Potentially because not all
|
|
|
|
* backends actually support all the filters listed here. At this point only
|
|
|
|
* the SDL backend supports all (except for the PalmOS ones of course).
|
|
|
|
* @todo Remove this explicit list of graphic modes and rather extend the
|
|
|
|
* OSystem API to allow querying a backend for the modes it supports.
|
|
|
|
*/
|
2003-03-25 00:26:53 +00:00
|
|
|
static const struct GraphicsMode gfx_modes[] = {
|
2002-12-13 23:29:18 +00:00
|
|
|
{"normal", "Normal (no scaling)", GFX_NORMAL},
|
|
|
|
{"1x", "Normal (no scaling)", GFX_NORMAL},
|
2003-04-30 12:43:56 +00:00
|
|
|
#ifndef __PALM_OS__ // reduce contant data size
|
2002-12-13 23:29:18 +00:00
|
|
|
{"2x", "2x", GFX_DOUBLESIZE},
|
|
|
|
{"3x", "3x", GFX_TRIPLESIZE},
|
|
|
|
{"2xsai", "2xSAI", GFX_2XSAI},
|
|
|
|
{"super2xsai", "Super2xSAI", GFX_SUPER2XSAI},
|
|
|
|
{"supereagle", "SuperEagle", GFX_SUPEREAGLE},
|
|
|
|
{"advmame2x", "AdvMAME2x", GFX_ADVMAME2X},
|
2003-05-09 22:44:16 +00:00
|
|
|
{"advmame3x", "AdvMAME3x", GFX_ADVMAME3X},
|
2003-09-27 21:20:00 +00:00
|
|
|
{"hq2x", "HQ2x", GFX_HQ2X},
|
|
|
|
{"hq3x", "HQ3x", GFX_HQ3X},
|
2003-01-15 02:11:37 +00:00
|
|
|
{"tv2x", "TV2x", GFX_TV2X},
|
2003-03-02 16:36:52 +00:00
|
|
|
{"dotmatrix", "DotMatrix", GFX_DOTMATRIX},
|
2003-06-22 14:18:33 +00:00
|
|
|
{"opengl", "OpenGL", GFX_BILINEAR},
|
2003-04-30 12:43:56 +00:00
|
|
|
#else
|
|
|
|
{"flipping", "Page Flipping", GFX_FLIPPING},
|
|
|
|
{"dbuffer", "Double Buffer", GFX_DOUBLEBUFFER},
|
2003-05-26 12:59:16 +00:00
|
|
|
{"wide", "Wide (HiRes+ only)", GFX_WIDE},
|
2003-04-30 12:43:56 +00:00
|
|
|
#endif
|
2003-05-21 16:59:51 +00:00
|
|
|
{0, 0, 0}
|
2002-12-13 23:29:18 +00:00
|
|
|
};
|
|
|
|
|
2003-03-06 16:27:06 +00:00
|
|
|
GameDetector::GameDetector() {
|
2003-05-17 03:06:16 +00:00
|
|
|
|
2003-10-08 21:59:23 +00:00
|
|
|
// Graphics
|
|
|
|
ConfMan.registerDefault("fullscreen", false);
|
|
|
|
ConfMan.registerDefault("aspect_ratio", false);
|
2002-09-30 00:55:47 +00:00
|
|
|
#ifndef _WIN32_WCE
|
2003-10-08 21:59:23 +00:00
|
|
|
ConfMan.registerDefault("gfx_mode", "2x");
|
2002-09-30 00:55:47 +00:00
|
|
|
#else
|
2003-10-08 21:59:23 +00:00
|
|
|
ConfMan.registerDefault("gfx_mode", "normal");
|
2002-09-30 00:55:47 +00:00
|
|
|
#endif
|
2003-09-05 16:30:05 +00:00
|
|
|
|
2003-10-08 21:59:23 +00:00
|
|
|
// Sound & Music
|
2003-10-15 23:16:52 +00:00
|
|
|
ConfMan.registerDefault("master_volume", 192);
|
|
|
|
ConfMan.registerDefault("music_volume", 192);
|
|
|
|
ConfMan.registerDefault("sfx_volume", 192);
|
2002-04-27 16:58:29 +00:00
|
|
|
|
2003-10-08 21:59:23 +00:00
|
|
|
ConfMan.registerDefault("multi_midi", false);
|
|
|
|
ConfMan.registerDefault("native_mt32", false);
|
|
|
|
// ConfMan.registerDefault("music_driver", ???);
|
2002-08-18 23:29:40 +00:00
|
|
|
|
2003-10-08 21:59:23 +00:00
|
|
|
ConfMan.registerDefault("cdrom", 0);
|
2003-10-01 10:47:19 +00:00
|
|
|
|
2003-10-08 21:59:23 +00:00
|
|
|
// Game specifc
|
|
|
|
ConfMan.registerDefault("path", "");
|
2002-05-07 05:12:39 +00:00
|
|
|
|
2003-10-12 20:44:52 +00:00
|
|
|
// ConfMan.registerDefault("amiga", false);
|
2003-10-08 21:59:23 +00:00
|
|
|
ConfMan.registerDefault("platform", kPlatformPC);
|
|
|
|
ConfMan.registerDefault("language", "en");
|
|
|
|
ConfMan.registerDefault("nosubtitles", false);
|
|
|
|
ConfMan.registerDefault("boot_param", 0);
|
|
|
|
ConfMan.registerDefault("save_slot", -1);
|
2003-07-05 00:57:03 +00:00
|
|
|
|
2003-07-29 12:13:39 +00:00
|
|
|
#ifndef DISABLE_SCUMM
|
2003-10-08 21:59:23 +00:00
|
|
|
ConfMan.registerDefault("demo_mode", false);
|
|
|
|
ConfMan.registerDefault("talkspeed", 60);
|
|
|
|
ConfMan.registerDefault("tempo", 0);
|
2003-07-29 12:13:39 +00:00
|
|
|
#endif
|
|
|
|
|
2003-10-08 21:59:23 +00:00
|
|
|
#ifndef DISABLE_SKY
|
|
|
|
ConfMan.registerDefault("floppy_intro", false);
|
|
|
|
#endif
|
2002-12-21 00:27:10 +00:00
|
|
|
|
2003-10-08 21:59:23 +00:00
|
|
|
// Miscellaneous
|
|
|
|
ConfMan.registerDefault("debuglevel", 0);
|
|
|
|
ConfMan.registerDefault("joystick_num", -1);
|
|
|
|
ConfMan.registerDefault("confirm_exit", false);
|
2002-05-07 05:12:39 +00:00
|
|
|
|
2003-10-08 21:59:23 +00:00
|
|
|
_dumpScripts = false;
|
|
|
|
_midi_driver = MD_AUTO;
|
2003-05-17 03:06:16 +00:00
|
|
|
|
2003-10-08 21:59:23 +00:00
|
|
|
_saveconfig = false;
|
2003-07-28 01:36:16 +00:00
|
|
|
|
2003-10-08 21:59:23 +00:00
|
|
|
_game.features = 0;
|
|
|
|
_plugin = 0;
|
2002-04-27 16:58:29 +00:00
|
|
|
}
|
|
|
|
|
2003-03-06 16:27:06 +00:00
|
|
|
void GameDetector::list_games() {
|
2003-10-08 21:59:23 +00:00
|
|
|
// FIXME / TODO: config rewrite
|
|
|
|
// Right now this lists all known built-in targets; and also for each of
|
|
|
|
// those it tells the user if the target is "configured".
|
|
|
|
// To me this seems like an ill mix of two different functionalities.
|
|
|
|
// IMHO we should split this into two seperate commands/options:
|
|
|
|
// 1) List all built-in gameids (e.g. monkey, atlantis, ...) similiar to
|
|
|
|
// what this code does, but without the "Config" column.
|
|
|
|
// 2) List all available (configured) targets, including those with custom
|
|
|
|
// names, e.g. "monkey-mac", "skycd-demo", ...
|
2003-10-08 22:10:59 +00:00
|
|
|
const PluginList &plugins = PluginManager::instance().getPlugins();
|
2002-10-18 07:08:45 +00:00
|
|
|
|
2003-10-08 21:59:23 +00:00
|
|
|
printf("Game Full Title \n"
|
|
|
|
"---------------- ------------------------------------------------------\n");
|
2002-10-18 07:08:45 +00:00
|
|
|
|
2003-10-05 14:03:07 +00:00
|
|
|
PluginList::ConstIterator iter = plugins.begin();
|
|
|
|
for (iter = plugins.begin(); iter != plugins.end(); ++iter) {
|
2003-10-17 12:18:58 +00:00
|
|
|
GameList list = (*iter)->getSupportedGames();
|
|
|
|
for (GameList::Iterator v = list.begin(); v != list.end(); ++v) {
|
2003-10-08 21:59:23 +00:00
|
|
|
#if 1
|
2003-10-12 18:40:12 +00:00
|
|
|
printf("%-17s%-56s\n", v->gameName, v->description);
|
2003-10-08 21:59:23 +00:00
|
|
|
#else
|
2003-10-12 18:40:12 +00:00
|
|
|
const char *config = (g_config->has_domain(v->gameName)) ? "Yes" : "";
|
|
|
|
printf("%-17s%-56s%s\n", v->gameName, v->description, config);
|
2003-10-08 21:59:23 +00:00
|
|
|
#endif
|
2003-09-08 17:13:40 +00:00
|
|
|
}
|
2002-10-18 07:08:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-10-17 12:18:58 +00:00
|
|
|
GameSettings GameDetector::findGame(const String &gameName, const Plugin **plugin) {
|
2003-10-12 18:40:12 +00:00
|
|
|
// Find the GameSettings for this target
|
2003-10-08 22:10:59 +00:00
|
|
|
const PluginList &plugins = PluginManager::instance().getPlugins();
|
2003-10-17 12:18:58 +00:00
|
|
|
GameSettings result = {NULL, NULL, 0, 0, MDT_NONE, 0, NULL};
|
2003-09-08 17:13:40 +00:00
|
|
|
|
2003-10-05 14:03:07 +00:00
|
|
|
PluginList::ConstIterator iter = plugins.begin();
|
|
|
|
for (iter = plugins.begin(); iter != plugins.end(); ++iter) {
|
2003-10-17 12:18:58 +00:00
|
|
|
result = (*iter)->findGame(gameName.c_str());
|
|
|
|
if (result.gameName) {
|
2003-09-17 22:41:01 +00:00
|
|
|
if (plugin)
|
2003-10-05 14:03:07 +00:00
|
|
|
*plugin = *iter;
|
2003-10-17 12:18:58 +00:00
|
|
|
break;
|
2003-09-17 22:41:01 +00:00
|
|
|
}
|
2003-09-08 15:38:34 +00:00
|
|
|
}
|
2003-10-17 12:18:58 +00:00
|
|
|
return result;
|
2003-09-08 15:38:34 +00:00
|
|
|
}
|
|
|
|
|
2003-03-06 16:27:06 +00:00
|
|
|
void GameDetector::parseCommandLine(int argc, char **argv) {
|
2002-04-11 17:19:16 +00:00
|
|
|
int i;
|
|
|
|
char *s;
|
2002-05-02 18:59:31 +00:00
|
|
|
char *current_option = NULL;
|
|
|
|
char *option = NULL;
|
2002-08-18 23:29:40 +00:00
|
|
|
char c;
|
2003-07-04 06:54:47 +00:00
|
|
|
bool long_option_value;
|
2002-04-11 17:19:16 +00:00
|
|
|
|
2003-10-08 21:59:23 +00:00
|
|
|
// Iterate over all comman line arguments, backwards.
|
|
|
|
// FIXME: Looping backwards has a major problem: Consider this example
|
|
|
|
// invocation: "scummvm -g 1x". It should work exactly like "scummvm -g1x"
|
|
|
|
// but it doesn't! Instead of starting the launcher with the 1x sacler
|
|
|
|
// in effect, it will give an error about target 1x being unknown.
|
|
|
|
// This can be fixed by forward iterating the args. Of course doing that
|
|
|
|
// essentially means we have to rewrite the whole command line parser,
|
|
|
|
// but that seems like a good idea anyway.
|
2002-05-02 18:59:31 +00:00
|
|
|
for (i = argc - 1; i >= 1; i--) {
|
2002-04-11 17:19:16 +00:00
|
|
|
s = argv[i];
|
|
|
|
|
2002-05-02 18:59:31 +00:00
|
|
|
if (s[0] == '-') {
|
2002-04-11 17:19:16 +00:00
|
|
|
s++;
|
2002-08-18 23:29:40 +00:00
|
|
|
c = *s++;
|
|
|
|
switch (tolower(c)) {
|
2002-05-02 18:59:31 +00:00
|
|
|
case 'b':
|
|
|
|
HANDLE_OPTION();
|
2003-10-08 21:59:23 +00:00
|
|
|
ConfMan.set("boot_param", (int)strtol(option, 0, 10));
|
2002-05-02 18:59:31 +00:00
|
|
|
break;
|
|
|
|
case 'c':
|
|
|
|
HANDLE_OPTION();
|
2003-10-08 21:59:23 +00:00
|
|
|
ConfMan.set("cdrom", (int)strtol(option, 0, 10));
|
2002-05-02 18:59:31 +00:00
|
|
|
break;
|
|
|
|
case 'd':
|
|
|
|
HANDLE_OPT_OPTION();
|
|
|
|
if (option != NULL)
|
2003-10-08 21:59:23 +00:00
|
|
|
ConfMan.set("debuglevel", (int)strtol(option, 0, 10));
|
|
|
|
if (ConfMan.getInt("debuglevel")) {
|
|
|
|
printf("Debuglevel (from command line): %d\n", ConfMan.getInt("debuglevel"));
|
2003-10-01 11:42:32 +00:00
|
|
|
} else {
|
2003-10-14 06:02:38 +00:00
|
|
|
printf("Debuglevel (from command line): 0 - Game only\n");
|
2003-09-06 04:07:20 +00:00
|
|
|
}
|
2002-05-02 18:59:31 +00:00
|
|
|
break;
|
|
|
|
case 'e':
|
|
|
|
HANDLE_OPTION();
|
2003-10-02 22:52:57 +00:00
|
|
|
// TODO: Instead of just showing the generic help text,
|
|
|
|
// maybe print a message like:
|
|
|
|
// "'option' is not a supported music driver on this machine.
|
|
|
|
// Available driver: ..."
|
2003-10-08 21:59:23 +00:00
|
|
|
if (parseMusicDriver(option) < 0)
|
2002-05-02 18:59:31 +00:00
|
|
|
goto ShowHelpAndExit;
|
2003-10-08 21:59:23 +00:00
|
|
|
ConfMan.set("music_driver", option);
|
2002-05-02 18:59:31 +00:00
|
|
|
break;
|
|
|
|
case 'f':
|
|
|
|
CHECK_OPTION();
|
2003-10-08 21:59:23 +00:00
|
|
|
ConfMan.set("fullscreen", (c == 'f'));
|
2002-05-02 18:59:31 +00:00
|
|
|
break;
|
2003-10-08 21:59:23 +00:00
|
|
|
case 'g':{
|
2002-05-02 18:59:31 +00:00
|
|
|
HANDLE_OPTION();
|
2003-10-08 21:59:23 +00:00
|
|
|
int _gfx_mode = parseGraphicsMode(option);
|
2003-10-02 22:52:57 +00:00
|
|
|
// TODO: Instead of just showing the generic help text,
|
|
|
|
// maybe print a message like:
|
|
|
|
// "'option' is not a supported graphic mode on this machine.
|
|
|
|
// Available graphic modes: ..."
|
2002-05-02 18:59:31 +00:00
|
|
|
if (_gfx_mode == -1)
|
|
|
|
goto ShowHelpAndExit;
|
2003-10-08 21:59:23 +00:00
|
|
|
ConfMan.set("gfx_mode", option);
|
|
|
|
break;}
|
2003-02-27 10:10:28 +00:00
|
|
|
// case 'h': reserved for help
|
2003-10-01 10:47:19 +00:00
|
|
|
case 'j':
|
|
|
|
HANDLE_OPT_OPTION();
|
2003-10-08 21:59:23 +00:00
|
|
|
ConfMan.set("joystick_num", (option != NULL) ? (int)strtol(option, 0, 10) : 0);
|
2003-10-01 10:47:19 +00:00
|
|
|
break;
|
2002-05-02 18:59:31 +00:00
|
|
|
case 'm':
|
|
|
|
HANDLE_OPTION();
|
2003-10-08 21:59:23 +00:00
|
|
|
ConfMan.set("music_volume", (int)strtol(option, 0, 10));
|
2002-05-02 18:59:31 +00:00
|
|
|
break;
|
|
|
|
case 'n':
|
|
|
|
CHECK_OPTION();
|
2003-10-08 21:59:23 +00:00
|
|
|
ConfMan.set("nosubtitles", (c == 'n'));
|
2002-05-02 18:59:31 +00:00
|
|
|
break;
|
2002-10-23 10:34:14 +00:00
|
|
|
case 'o':
|
2003-06-19 15:14:17 +00:00
|
|
|
HANDLE_OPTION();
|
2003-10-08 21:59:23 +00:00
|
|
|
ConfMan.set("master_volume", (int)strtol(option, 0, 10));
|
2003-06-19 15:14:17 +00:00
|
|
|
break;
|
2002-05-02 18:59:31 +00:00
|
|
|
case 'p':
|
|
|
|
HANDLE_OPTION();
|
2003-10-08 21:59:23 +00:00
|
|
|
// TODO: Verify path is valid
|
|
|
|
ConfMan.set("path", option);
|
2002-05-02 18:59:31 +00:00
|
|
|
break;
|
2003-01-29 08:07:10 +00:00
|
|
|
case 'q':
|
|
|
|
HANDLE_OPTION();
|
2003-10-17 15:35:46 +00:00
|
|
|
if (Common::parseLanguage(option) == Common::UNK_LANG)
|
2003-01-29 08:07:10 +00:00
|
|
|
goto ShowHelpAndExit;
|
2003-10-08 21:59:23 +00:00
|
|
|
ConfMan.set("language", option);
|
2002-05-02 18:59:31 +00:00
|
|
|
break;
|
|
|
|
case 's':
|
|
|
|
HANDLE_OPTION();
|
2003-10-08 21:59:23 +00:00
|
|
|
ConfMan.set("sfx_volume", (int)strtol(option, 0, 10));
|
2002-05-02 18:59:31 +00:00
|
|
|
break;
|
2003-10-08 21:59:23 +00:00
|
|
|
#ifndef DISABLE_SCUMM
|
2002-05-02 18:59:31 +00:00
|
|
|
case 't':
|
|
|
|
HANDLE_OPTION();
|
2003-10-08 21:59:23 +00:00
|
|
|
// Use the special value '0' for the base in (int)strtol.
|
|
|
|
// Doing that makes it possible to enter hex values
|
|
|
|
// as "0x1234", but also decimal values ("123").
|
|
|
|
ConfMan.set("tempo", (int)strtol(option, 0, 0));
|
2002-05-02 18:59:31 +00:00
|
|
|
break;
|
2003-10-08 21:59:23 +00:00
|
|
|
#endif
|
2002-12-31 02:09:57 +00:00
|
|
|
case 'u':
|
|
|
|
CHECK_OPTION();
|
|
|
|
_dumpScripts = true;
|
|
|
|
break;
|
2002-05-02 18:59:31 +00:00
|
|
|
case 'v':
|
|
|
|
CHECK_OPTION();
|
2003-07-15 02:16:33 +00:00
|
|
|
printf("%s\n", gScummVMFullVersion);
|
2003-10-08 21:59:23 +00:00
|
|
|
exit(0);
|
|
|
|
break;
|
2002-07-19 12:06:45 +00:00
|
|
|
case 'x':
|
|
|
|
HANDLE_OPT_OPTION();
|
2003-10-08 21:59:23 +00:00
|
|
|
ConfMan.set("save_slot", (option != NULL) ? (int)strtol(option, 0, 10) : 0);
|
2002-07-19 12:06:45 +00:00
|
|
|
break;
|
2003-10-08 21:59:23 +00:00
|
|
|
#ifndef DISABLE_SCUMM
|
2002-05-05 20:08:41 +00:00
|
|
|
case 'y':
|
|
|
|
HANDLE_OPTION();
|
2003-10-08 21:59:23 +00:00
|
|
|
ConfMan.set("talkspeed", (int)strtol(option, 0, 10));
|
2002-05-05 20:08:41 +00:00
|
|
|
break;
|
2003-10-08 21:59:23 +00:00
|
|
|
#endif
|
2002-10-18 07:08:45 +00:00
|
|
|
case 'z':
|
|
|
|
CHECK_OPTION();
|
|
|
|
list_games();
|
2003-10-10 11:15:14 +00:00
|
|
|
exit(0);
|
2003-05-17 03:06:16 +00:00
|
|
|
case '-':
|
|
|
|
// Long options. Let the fun begin!
|
2003-09-05 16:12:54 +00:00
|
|
|
if (!strncmp(s, "platform=", 9)) {
|
|
|
|
s += 9;
|
2003-10-17 15:35:46 +00:00
|
|
|
int platform = Common::parsePlatform(s);
|
2003-10-08 21:59:23 +00:00
|
|
|
if (platform == kPlatformUnknown)
|
2003-09-05 10:53:57 +00:00
|
|
|
goto ShowHelpAndExit;
|
|
|
|
|
2003-10-08 21:59:23 +00:00
|
|
|
ConfMan.set("platform", platform);
|
2003-09-05 10:53:57 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2003-07-04 06:54:47 +00:00
|
|
|
if (!strncmp(s, "no-", 3)) {
|
|
|
|
long_option_value = false;
|
|
|
|
s += 3;
|
|
|
|
} else
|
|
|
|
long_option_value = true;
|
2003-08-11 09:48:26 +00:00
|
|
|
|
2003-09-05 10:53:57 +00:00
|
|
|
if (!strcmp (s, "multi-midi")) {
|
2003-10-08 21:59:23 +00:00
|
|
|
ConfMan.set("multi_midi", long_option_value);
|
2003-05-17 03:06:16 +00:00
|
|
|
} else if (!strcmp (s, "native-mt32")) {
|
2003-10-08 21:59:23 +00:00
|
|
|
ConfMan.set("native_mt32", long_option_value);
|
2003-06-22 11:55:40 +00:00
|
|
|
} else if (!strcmp (s, "aspect-ratio")) {
|
2003-10-08 21:59:23 +00:00
|
|
|
ConfMan.set("aspect_ratio", long_option_value);
|
2003-08-11 09:48:26 +00:00
|
|
|
} else if (!strcmp (s, "fullscreen")) {
|
2003-10-08 21:59:23 +00:00
|
|
|
ConfMan.set("fullscreen", long_option_value);
|
2003-07-29 12:13:39 +00:00
|
|
|
#ifndef DISABLE_SCUMM
|
|
|
|
} else if (!strcmp (s, "demo-mode")) {
|
2003-10-08 21:59:23 +00:00
|
|
|
ConfMan.set("demo_mode", long_option_value);
|
2003-07-29 12:13:39 +00:00
|
|
|
#endif
|
|
|
|
|
2003-07-05 00:57:03 +00:00
|
|
|
#ifndef DISABLE_SKY
|
|
|
|
} else if (!strcmp (s, "floppy-intro")) {
|
2003-10-08 21:59:23 +00:00
|
|
|
ConfMan.set("floppy_intro", long_option_value);
|
2003-07-05 00:57:03 +00:00
|
|
|
#endif
|
2003-05-17 03:06:16 +00:00
|
|
|
} else {
|
|
|
|
goto ShowHelpAndExit;
|
|
|
|
}
|
|
|
|
break;
|
2002-05-02 18:59:31 +00:00
|
|
|
default:
|
|
|
|
goto ShowHelpAndExit;
|
2002-04-11 17:19:16 +00:00
|
|
|
}
|
|
|
|
} else {
|
2003-10-10 14:12:01 +00:00
|
|
|
// Last argument: this could be a target name.
|
|
|
|
// To verify this, check if there is either a game domain (i.e
|
|
|
|
// a configured target) matching this argument, or if we can
|
|
|
|
// find any target with that name.
|
2003-10-17 12:18:58 +00:00
|
|
|
if (i == (argc - 1) && (ConfMan.hasGameDomain(s) || findGame(s).gameName)) {
|
2003-10-12 18:40:12 +00:00
|
|
|
setTarget(s);
|
2002-05-02 18:59:31 +00:00
|
|
|
} else {
|
|
|
|
if (current_option == NULL)
|
|
|
|
current_option = s;
|
|
|
|
else
|
|
|
|
goto ShowHelpAndExit;
|
|
|
|
}
|
2002-04-11 17:19:16 +00:00
|
|
|
}
|
|
|
|
}
|
2002-04-27 16:58:29 +00:00
|
|
|
|
2002-05-02 18:59:31 +00:00
|
|
|
return;
|
|
|
|
|
2003-03-06 16:27:06 +00:00
|
|
|
ShowHelpAndExit:
|
2002-05-02 18:59:31 +00:00
|
|
|
printf(USAGE_STRING);
|
|
|
|
exit(1);
|
2002-03-23 20:34:47 +00:00
|
|
|
}
|
|
|
|
|
2003-10-12 18:40:12 +00:00
|
|
|
void GameDetector::setTarget(const String &name) {
|
|
|
|
_targetName = name;
|
2003-10-08 21:59:23 +00:00
|
|
|
ConfMan.setActiveDomain(name);
|
2002-09-30 00:55:47 +00:00
|
|
|
}
|
|
|
|
|
2003-10-08 21:59:23 +00:00
|
|
|
int GameDetector::parseGraphicsMode(const String &str) {
|
2003-10-09 11:15:54 +00:00
|
|
|
if (str.isEmpty())
|
|
|
|
return -1;
|
|
|
|
|
2003-10-08 21:59:23 +00:00
|
|
|
const char *s = str.c_str();
|
2003-03-25 00:26:53 +00:00
|
|
|
const GraphicsMode *gm = gfx_modes;
|
2003-10-08 21:59:23 +00:00
|
|
|
while (gm->name) {
|
2003-03-18 06:53:47 +00:00
|
|
|
if (!scumm_stricmp(gm->name, s)) {
|
2002-04-12 21:26:59 +00:00
|
|
|
return gm->id;
|
2003-03-18 06:53:47 +00:00
|
|
|
}
|
2002-12-13 23:29:18 +00:00
|
|
|
gm++;
|
2002-04-12 21:26:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2003-10-08 21:59:23 +00:00
|
|
|
int GameDetector::parseMusicDriver(const String &str) {
|
2003-10-09 11:15:54 +00:00
|
|
|
if (str.isEmpty())
|
2003-10-09 06:52:28 +00:00
|
|
|
return -1;
|
|
|
|
|
2003-10-08 21:59:23 +00:00
|
|
|
const char *s = str.c_str();
|
2003-10-02 22:52:57 +00:00
|
|
|
const MidiDriverDescription *md = getAvailableMidiDrivers();
|
2002-04-13 18:34:11 +00:00
|
|
|
|
2002-12-13 23:29:18 +00:00
|
|
|
while (md->name) {
|
2002-04-13 18:34:11 +00:00
|
|
|
if (!scumm_stricmp(md->name, s)) {
|
2003-10-08 21:59:23 +00:00
|
|
|
return md->id;
|
2002-04-13 18:34:11 +00:00
|
|
|
}
|
2002-12-13 23:29:18 +00:00
|
|
|
md++;
|
2002-04-13 18:34:11 +00:00
|
|
|
}
|
|
|
|
|
2003-10-08 21:59:23 +00:00
|
|
|
return -1;
|
2002-04-13 18:34:11 +00:00
|
|
|
}
|
|
|
|
|
2003-03-06 16:27:06 +00:00
|
|
|
bool GameDetector::detectGame() {
|
2003-10-08 21:59:23 +00:00
|
|
|
String realGame;
|
2002-10-28 09:03:02 +00:00
|
|
|
|
2003-10-08 21:59:23 +00:00
|
|
|
if (ConfMan.hasKey("gameid"))
|
|
|
|
realGame = ConfMan.get("gameid");
|
|
|
|
else
|
2003-10-12 18:40:12 +00:00
|
|
|
realGame = _targetName;
|
2003-10-08 21:59:23 +00:00
|
|
|
printf("Looking for %s\n", realGame.c_str());
|
2003-09-08 15:38:34 +00:00
|
|
|
|
2003-10-17 12:18:58 +00:00
|
|
|
_game = findGame(realGame, &_plugin);
|
2003-09-08 15:38:34 +00:00
|
|
|
|
2003-10-17 12:18:58 +00:00
|
|
|
if (_game.gameName) {
|
2003-09-08 15:38:34 +00:00
|
|
|
printf("Trying to start game '%s'\n", _game.description);
|
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
printf("Failed game detection\n");
|
|
|
|
return false;
|
|
|
|
}
|
2002-03-23 20:34:47 +00:00
|
|
|
}
|
|
|
|
|
2003-09-20 00:37:09 +00:00
|
|
|
bool GameDetector::detectMain() {
|
2003-10-12 18:40:12 +00:00
|
|
|
if (_targetName.isEmpty()) {
|
2002-03-25 00:45:09 +00:00
|
|
|
warning("No game was specified...");
|
2003-09-20 00:37:09 +00:00
|
|
|
return false;
|
2002-03-25 00:45:09 +00:00
|
|
|
}
|
|
|
|
|
2002-04-11 17:19:16 +00:00
|
|
|
if (!detectGame()) {
|
2003-10-12 18:40:12 +00:00
|
|
|
warning("%s is an invalid target. Use the -z parameter to list targets", _targetName.c_str());
|
2003-09-20 00:37:09 +00:00
|
|
|
return false;
|
2002-04-11 17:19:16 +00:00
|
|
|
}
|
2002-03-25 00:45:09 +00:00
|
|
|
|
2002-11-19 16:31:41 +00:00
|
|
|
/* Use the adlib sound driver if auto mode is selected,
|
|
|
|
* and the game is one of those that want adlib as
|
2003-05-19 19:50:28 +00:00
|
|
|
* default, OR if the game is an older game that doesn't
|
|
|
|
* support anything else anyway. */
|
2003-10-08 21:59:23 +00:00
|
|
|
_midi_driver = parseMusicDriver(ConfMan.get("music_driver"));
|
|
|
|
if (_midi_driver == MD_AUTO || _midi_driver < 0) {
|
2003-08-18 23:19:53 +00:00
|
|
|
if (_game.midi & MDT_PREFER_NATIVE)
|
|
|
|
_midi_driver = getMidiDriverType();
|
|
|
|
else
|
2003-10-05 15:36:52 +00:00
|
|
|
_midi_driver = MD_TOWNS;
|
2003-08-18 23:19:53 +00:00
|
|
|
}
|
2003-08-13 15:34:00 +00:00
|
|
|
bool nativeMidiDriver =
|
|
|
|
(_midi_driver != MD_NULL && _midi_driver != MD_ADLIB &&
|
2003-10-05 15:36:52 +00:00
|
|
|
_midi_driver != MD_PCSPK && _midi_driver != MD_PCJR &&
|
|
|
|
_midi_driver != MD_TOWNS);
|
2003-08-15 10:19:24 +00:00
|
|
|
if (nativeMidiDriver && !(_game.midi & MDT_NATIVE))
|
2003-10-05 15:36:52 +00:00
|
|
|
_midi_driver = MD_TOWNS;
|
|
|
|
if (_midi_driver == MD_TOWNS && !(_game.midi & MDT_TOWNS))
|
2002-11-21 19:06:42 +00:00
|
|
|
_midi_driver = MD_ADLIB;
|
2003-08-15 10:19:24 +00:00
|
|
|
if (_midi_driver == MD_ADLIB && !(_game.midi & MDT_ADLIB))
|
|
|
|
_midi_driver = MD_PCJR;
|
|
|
|
if ((_midi_driver == MD_PCSPK || _midi_driver == MD_PCJR) && !(_game.midi & MDT_PCSPK))
|
|
|
|
_midi_driver = MD_NULL;
|
2002-04-13 18:34:11 +00:00
|
|
|
|
2003-10-08 21:59:23 +00:00
|
|
|
String gameDataPath(ConfMan.get("path"));
|
|
|
|
if (gameDataPath.isEmpty()) {
|
2002-04-16 15:49:21 +00:00
|
|
|
warning("No path was provided. Assuming the data files are in the current directory");
|
2003-04-30 12:43:56 +00:00
|
|
|
#ifndef __PALM_OS__ // add last slash also in File::fopenNoCase, so this is not needed
|
2003-10-08 21:59:23 +00:00
|
|
|
} else if (gameDataPath.lastChar() != '/'
|
2002-07-04 19:43:58 +00:00
|
|
|
#ifdef __MORPHOS__
|
2003-10-08 21:59:23 +00:00
|
|
|
&& gameDataPath.lastChar() != ':'
|
2002-07-04 19:43:58 +00:00
|
|
|
#endif
|
2003-10-08 21:59:23 +00:00
|
|
|
&& gameDataPath.lastChar() != '\\') {
|
|
|
|
gameDataPath += '/';
|
|
|
|
ConfMan.set("path", gameDataPath);
|
2003-04-30 12:43:56 +00:00
|
|
|
#endif
|
2002-04-11 17:19:16 +00:00
|
|
|
}
|
2002-03-23 20:34:47 +00:00
|
|
|
|
2003-09-20 00:37:09 +00:00
|
|
|
return true;
|
2002-04-11 17:19:16 +00:00
|
|
|
}
|
2002-04-13 18:34:11 +00:00
|
|
|
|
|
|
|
OSystem *GameDetector::createSystem() {
|
2003-10-08 21:59:23 +00:00
|
|
|
int _gfx_mode = parseGraphicsMode(ConfMan.get("gfx_mode")); // FIXME: Get rid of this again!
|
|
|
|
|
2003-03-25 00:26:53 +00:00
|
|
|
#if defined(USE_NULL_DRIVER)
|
|
|
|
return OSystem_NULL_create();
|
2002-04-20 17:41:42 +00:00
|
|
|
#elif defined(__DC__)
|
2003-03-25 00:26:53 +00:00
|
|
|
return OSystem_Dreamcast_create();
|
|
|
|
#elif defined(X11_BACKEND)
|
|
|
|
return OSystem_X11_create();
|
2002-04-20 17:41:42 +00:00
|
|
|
#elif defined(__MORPHOS__)
|
2003-10-08 21:59:23 +00:00
|
|
|
return OSystem_MorphOS_create(_gfx_mode, ConfMan.getBool("fullscreen"));
|
2003-03-25 00:26:53 +00:00
|
|
|
#elif defined(_WIN32_WCE)
|
|
|
|
return OSystem_WINCE3_create();
|
2002-05-05 20:04:26 +00:00
|
|
|
#elif defined(MACOS_CARBON)
|
2003-10-08 21:59:23 +00:00
|
|
|
return OSystem_MAC_create(_gfx_mode, ConfMan.getBool("fullscreen"));
|
2003-03-25 00:26:53 +00:00
|
|
|
#elif defined(__GP32__) // ph0x
|
|
|
|
return OSystem_GP32_create(GFX_NORMAL, true);
|
2003-04-30 12:43:56 +00:00
|
|
|
#elif defined(__PALM_OS__) //chrilith
|
2003-10-08 21:59:23 +00:00
|
|
|
return OSystem_PALMOS_create(_gfx_mode, ConfMan.getBool("fullscreen"));
|
2002-04-20 17:41:42 +00:00
|
|
|
#else
|
2003-03-25 00:26:53 +00:00
|
|
|
/* SDL is the default driver for now */
|
2003-10-09 11:33:34 +00:00
|
|
|
return OSystem_SDL_create(_gfx_mode, ConfMan.getBool("fullscreen"), ConfMan.getBool("aspect_ratio"), ConfMan.getInt("joystick_num"));
|
2002-04-16 23:24:59 +00:00
|
|
|
#endif
|
2002-04-13 18:34:11 +00:00
|
|
|
}
|
|
|
|
|
2003-10-09 14:05:09 +00:00
|
|
|
Engine *GameDetector::createEngine(OSystem *sys) {
|
2003-09-17 22:41:01 +00:00
|
|
|
assert(_plugin);
|
2003-10-09 14:05:09 +00:00
|
|
|
return _plugin->createInstance(this, sys);
|
2003-09-08 17:13:40 +00:00
|
|
|
}
|
|
|
|
|
2003-05-12 23:21:35 +00:00
|
|
|
int GameDetector::getMidiDriverType() {
|
2002-04-13 18:34:11 +00:00
|
|
|
|
2003-05-12 23:21:35 +00:00
|
|
|
if (_midi_driver != MD_AUTO) return _midi_driver;
|
2002-11-19 13:37:14 +00:00
|
|
|
|
|
|
|
#if defined (WIN32) && !defined(_WIN32_WCE)
|
2003-05-12 23:21:35 +00:00
|
|
|
return MD_WINDOWS; // MD_WINDOWS is default MidiDriver on windows targets
|
2002-11-19 13:37:14 +00:00
|
|
|
#elif defined(MACOSX)
|
2003-05-12 23:21:35 +00:00
|
|
|
return MD_COREAUDIO;
|
2003-04-30 12:43:56 +00:00
|
|
|
#elif defined(__PALM_OS__) // must be before mac
|
2003-05-12 23:21:35 +00:00
|
|
|
return MD_YPA1;
|
2002-11-19 13:37:14 +00:00
|
|
|
#elif defined(macintosh)
|
2003-05-12 23:21:35 +00:00
|
|
|
return MD_QTMUSIC;
|
2002-11-19 13:37:14 +00:00
|
|
|
#elif defined(__MORPHOS__)
|
2003-05-12 23:21:35 +00:00
|
|
|
return MD_ETUDE;
|
2002-11-19 13:37:14 +00:00
|
|
|
#elif defined (_WIN32_WCE) || defined(UNIX) || defined(X11_BACKEND)
|
2003-03-26 12:30:41 +00:00
|
|
|
// Always use MIDI emulation via adlib driver on CE and UNIX device
|
2002-09-29 11:11:42 +00:00
|
|
|
|
2003-03-26 12:30:41 +00:00
|
|
|
// TODO: We should, for the Unix targets, attempt to detect
|
|
|
|
// whether a sequencer is available, and use it instead.
|
2003-05-12 23:21:35 +00:00
|
|
|
return MD_ADLIB;
|
2002-05-12 22:24:10 +00:00
|
|
|
#endif
|
2003-05-12 23:21:35 +00:00
|
|
|
return MD_NULL;
|
|
|
|
}
|
|
|
|
|
2003-09-08 17:42:53 +00:00
|
|
|
SoundMixer *GameDetector::createMixer() {
|
|
|
|
return new SoundMixer();
|
|
|
|
}
|
|
|
|
|
2003-05-12 23:21:35 +00:00
|
|
|
MidiDriver *GameDetector::createMidi() {
|
|
|
|
int drv = getMidiDriverType();
|
2002-05-12 22:24:10 +00:00
|
|
|
|
2002-04-13 18:34:11 +00:00
|
|
|
switch(drv) {
|
2003-08-13 14:08:21 +00:00
|
|
|
case MD_NULL: return MidiDriver_NULL_create();
|
2003-10-05 15:36:52 +00:00
|
|
|
|
2003-05-16 22:00:33 +00:00
|
|
|
// In the case of Adlib, we won't specify anything.
|
|
|
|
// IMuse is designed to set up its own Adlib driver
|
|
|
|
// if need be, and we only have to specify a native
|
|
|
|
// driver.
|
2003-08-13 14:08:21 +00:00
|
|
|
case MD_ADLIB: return NULL;
|
|
|
|
|
2003-10-05 15:36:52 +00:00
|
|
|
case MD_TOWNS: return MidiDriver_YM2612_create(g_engine->_mixer);
|
|
|
|
|
2003-08-13 14:08:21 +00:00
|
|
|
// Right now PC Speaker and PCjr are handled
|
|
|
|
// outside the MidiDriver architecture, so
|
|
|
|
// don't create anything for now.
|
|
|
|
case MD_PCSPK:
|
|
|
|
case MD_PCJR: return NULL;
|
2003-06-17 08:50:15 +00:00
|
|
|
#if defined(__PALM_OS__)
|
2003-08-13 14:08:21 +00:00
|
|
|
case MD_YPA1: return MidiDriver_YamahaPa1_create();
|
2003-04-30 12:43:56 +00:00
|
|
|
#endif
|
2002-04-19 06:23:49 +00:00
|
|
|
#if defined(WIN32) && !defined(_WIN32_WCE)
|
2003-08-13 14:08:21 +00:00
|
|
|
case MD_WINDOWS: return MidiDriver_WIN_create();
|
2002-04-18 21:40:24 +00:00
|
|
|
#endif
|
2002-04-21 04:14:42 +00:00
|
|
|
#if defined(__MORPHOS__)
|
2003-08-13 14:08:21 +00:00
|
|
|
case MD_ETUDE: return MidiDriver_ETUDE_create();
|
2002-04-13 19:06:10 +00:00
|
|
|
#endif
|
2002-12-13 23:29:18 +00:00
|
|
|
#if defined(UNIX) && !defined(__BEOS__) && !defined(MACOSX)
|
2003-08-13 14:08:21 +00:00
|
|
|
case MD_SEQ: return MidiDriver_SEQ_create();
|
2002-04-26 13:18:49 +00:00
|
|
|
#endif
|
2003-04-30 12:43:56 +00:00
|
|
|
#if (defined(MACOSX) || defined(macintosh)) && !defined(__PALM_OS__)
|
2003-08-13 14:08:21 +00:00
|
|
|
case MD_QTMUSIC: return MidiDriver_QT_create();
|
2002-05-05 19:06:51 +00:00
|
|
|
#endif
|
2002-08-18 23:29:40 +00:00
|
|
|
#if defined(MACOSX)
|
2003-08-13 14:08:21 +00:00
|
|
|
case MD_COREAUDIO: return MidiDriver_CORE_create();
|
2002-05-16 06:46:50 +00:00
|
|
|
#endif
|
|
|
|
#if defined(UNIX) && defined(USE_ALSA)
|
2003-08-13 14:08:21 +00:00
|
|
|
case MD_ALSA: return MidiDriver_ALSA_create();
|
2002-04-21 04:14:42 +00:00
|
|
|
#endif
|
2002-04-13 18:34:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
error("Invalid midi driver selected");
|
|
|
|
return NULL;
|
2002-04-16 20:28:56 +00:00
|
|
|
}
|