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-08-18 17:48:18 +00:00
|
|
|
#ifndef GAMEDETECTOR_H
|
|
|
|
#define GAMEDETECTOR_H
|
|
|
|
|
2002-09-30 00:55:47 +00:00
|
|
|
#include "common/str.h"
|
|
|
|
|
2003-09-08 17:13:40 +00:00
|
|
|
class Engine;
|
|
|
|
class GameDetector;
|
2002-08-18 17:48:18 +00:00
|
|
|
class MidiDriver;
|
2003-09-08 17:42:53 +00:00
|
|
|
class OSystem;
|
|
|
|
class SoundMixer;
|
2003-09-17 22:41:01 +00:00
|
|
|
class Plugin;
|
2002-08-18 17:48:18 +00:00
|
|
|
|
2003-06-15 01:42:19 +00:00
|
|
|
/** Default sound/music volumes.
|
|
|
|
* @todo move this to a better place.
|
|
|
|
*/
|
2002-11-06 16:01:36 +00:00
|
|
|
enum {
|
|
|
|
kDefaultMasterVolume = 192,
|
|
|
|
kDefaultSFXVolume = 192,
|
|
|
|
kDefaultMusicVolume = 192
|
|
|
|
};
|
|
|
|
|
2003-06-15 01:42:19 +00:00
|
|
|
/** Global (shared) game feature flags. */
|
|
|
|
enum {
|
|
|
|
GF_DEFAULT_TO_1X_SCALER = 1 << 31
|
|
|
|
};
|
|
|
|
|
2003-10-02 22:52:57 +00:00
|
|
|
/**
|
|
|
|
* List of language ids.
|
|
|
|
* @note The order and mappings of the values 0..8 are *required* to stay the
|
|
|
|
* way they are now, as scripts in COMI rely on them. So don't touch them.
|
2003-03-23 13:44:59 +00:00
|
|
|
*/
|
|
|
|
enum {
|
|
|
|
EN_USA = 0,
|
|
|
|
DE_DEU = 1,
|
|
|
|
FR_FRA = 2,
|
|
|
|
IT_ITA = 3,
|
|
|
|
PT_BRA = 4,
|
|
|
|
ES_ESP = 5,
|
|
|
|
JA_JPN = 6,
|
|
|
|
ZH_TWN = 7,
|
|
|
|
KO_KOR = 8,
|
2003-07-12 03:40:44 +00:00
|
|
|
SE_SWE = 9,
|
|
|
|
EN_GRB = 10,
|
2003-03-23 13:44:59 +00:00
|
|
|
HB_HEB = 20
|
|
|
|
};
|
|
|
|
|
2003-08-15 10:19:24 +00:00
|
|
|
enum MidiDriverType {
|
|
|
|
MDT_NONE = 0,
|
|
|
|
MDT_PCSPK = 1, // MD_PCSPK and MD_PCJR
|
|
|
|
MDT_ADLIB = 2, // MD_ADLIB
|
2003-08-18 23:19:53 +00:00
|
|
|
MDT_NATIVE = 4, // Everything else
|
|
|
|
MDT_PREFER_NATIVE = 8
|
2003-08-15 10:19:24 +00:00
|
|
|
};
|
|
|
|
|
2003-09-08 15:38:34 +00:00
|
|
|
struct TargetSettings {
|
|
|
|
const char *targetName;
|
|
|
|
const char *description;
|
2003-06-06 22:51:33 +00:00
|
|
|
byte id, version;
|
2003-08-15 10:19:24 +00:00
|
|
|
int midi; // MidiDriverType values
|
2002-12-14 11:53:58 +00:00
|
|
|
uint32 features;
|
2003-07-03 22:06:13 +00:00
|
|
|
const char *detectname;
|
2002-09-27 23:27:14 +00:00
|
|
|
};
|
|
|
|
|
2002-03-25 08:51:34 +00:00
|
|
|
class GameDetector {
|
2003-10-02 17:43:02 +00:00
|
|
|
typedef Common::String String;
|
2002-12-13 23:29:18 +00:00
|
|
|
|
2002-03-23 20:34:47 +00:00
|
|
|
public:
|
2002-09-30 00:55:47 +00:00
|
|
|
GameDetector();
|
2003-03-06 16:27:06 +00:00
|
|
|
|
2002-03-23 20:34:47 +00:00
|
|
|
void parseCommandLine(int argc, char **argv);
|
2003-09-20 00:37:09 +00:00
|
|
|
bool detectMain();
|
2002-09-30 00:55:47 +00:00
|
|
|
void setGame(const String &name);
|
2002-10-23 12:56:30 +00:00
|
|
|
const String& getGameName(void);
|
2003-09-08 17:13:40 +00:00
|
|
|
|
|
|
|
String _gameFileName;
|
|
|
|
TargetSettings _game;
|
2003-09-17 22:41:01 +00:00
|
|
|
const Plugin *_plugin;
|
2002-12-13 23:29:18 +00:00
|
|
|
|
2002-03-23 20:34:47 +00:00
|
|
|
bool _fullScreen;
|
2003-06-22 11:55:40 +00:00
|
|
|
bool _aspectRatio;
|
2002-04-12 10:34:46 +00:00
|
|
|
|
2003-03-25 15:32:36 +00:00
|
|
|
int _master_volume;
|
2002-08-07 00:32:13 +00:00
|
|
|
int _music_volume;
|
|
|
|
int _sfx_volume;
|
2003-09-05 16:30:05 +00:00
|
|
|
bool _amiga;
|
2003-09-05 10:53:57 +00:00
|
|
|
int _platform;
|
2003-01-29 08:07:10 +00:00
|
|
|
int _language;
|
2002-04-14 18:13:08 +00:00
|
|
|
|
2003-07-29 12:13:39 +00:00
|
|
|
bool _demo_mode;
|
2003-07-05 00:57:03 +00:00
|
|
|
bool _floppyIntro;
|
|
|
|
|
2002-05-05 20:08:41 +00:00
|
|
|
uint16 _talkSpeed;
|
2002-03-23 20:34:47 +00:00
|
|
|
uint16 _debugMode;
|
2002-12-06 15:24:14 +00:00
|
|
|
uint16 _debugLevel;
|
2002-12-31 02:09:57 +00:00
|
|
|
bool _dumpScripts;
|
2002-09-30 00:55:47 +00:00
|
|
|
bool _noSubtitles;
|
2002-03-23 20:34:47 +00:00
|
|
|
uint16 _bootParam;
|
2002-04-12 10:34:46 +00:00
|
|
|
|
2002-03-23 20:34:47 +00:00
|
|
|
char *_gameDataPath;
|
|
|
|
int _gameTempo;
|
|
|
|
int _midi_driver;
|
2003-06-06 22:51:33 +00:00
|
|
|
|
2002-04-12 21:26:59 +00:00
|
|
|
int _gfx_mode;
|
2003-03-18 06:53:47 +00:00
|
|
|
bool _default_gfx_mode;
|
2003-05-17 03:06:16 +00:00
|
|
|
|
|
|
|
bool _multi_midi;
|
|
|
|
bool _native_mt32;
|
2002-04-12 10:34:46 +00:00
|
|
|
|
2002-04-07 07:33:39 +00:00
|
|
|
int _cdrom;
|
2003-10-01 10:47:19 +00:00
|
|
|
int _joystick_num;
|
2002-07-19 12:06:45 +00:00
|
|
|
int _save_slot;
|
2002-04-27 16:58:29 +00:00
|
|
|
|
|
|
|
bool _saveconfig;
|
2003-07-28 01:36:16 +00:00
|
|
|
bool _confirmExit;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2002-12-13 23:29:18 +00:00
|
|
|
public:
|
|
|
|
OSystem *createSystem();
|
2003-09-08 17:13:40 +00:00
|
|
|
Engine *createEngine(OSystem *system);
|
|
|
|
|
2003-09-08 17:42:53 +00:00
|
|
|
SoundMixer *createMixer();
|
2002-12-13 23:29:18 +00:00
|
|
|
MidiDriver *createMidi();
|
2003-05-12 23:21:35 +00:00
|
|
|
int getMidiDriverType();
|
2002-12-13 23:29:18 +00:00
|
|
|
|
2003-01-12 07:19:03 +00:00
|
|
|
int parseGraphicsMode(const char *s);
|
2002-12-13 23:29:18 +00:00
|
|
|
void updateconfig();
|
2003-09-08 15:38:34 +00:00
|
|
|
|
2003-09-17 22:41:01 +00:00
|
|
|
const TargetSettings *findTarget(const char *targetName, const Plugin **plugin = NULL) const;
|
2002-12-13 23:29:18 +00:00
|
|
|
|
|
|
|
protected:
|
2003-06-06 22:51:33 +00:00
|
|
|
String _gameText;
|
|
|
|
|
2002-12-13 23:29:18 +00:00
|
|
|
bool detectGame(void);
|
2002-04-13 18:34:11 +00:00
|
|
|
bool parseMusicDriver(const char *s);
|
2003-01-29 08:07:10 +00:00
|
|
|
int parseLanguage(const char *s);
|
2002-10-18 07:08:45 +00:00
|
|
|
void list_games();
|
2002-03-23 20:34:47 +00:00
|
|
|
};
|
2002-08-18 17:48:18 +00:00
|
|
|
|
|
|
|
#endif
|