1
/***************************************************************************
5
Definitions for game drivers.
7
****************************************************************************
12
Redistribution and use in source and binary forms, with or without
13
modification, are permitted provided that the following conditions are
16
* Redistributions of source code must retain the above copyright
17
notice, this list of conditions and the following disclaimer.
18
* Redistributions in binary form must reproduce the above copyright
19
notice, this list of conditions and the following disclaimer in
20
the documentation and/or other materials provided with the
22
* Neither the name 'MAME' nor the names of its contributors may be
23
used to endorse or promote products derived from this software
24
without specific prior written permission.
26
THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29
DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36
POSSIBILITY OF SUCH DAMAGE.
38
***************************************************************************/
46
//**************************************************************************
48
//**************************************************************************
51
const int MAX_DRIVER_NAME_CHARS = 8;
53
// flags for game drivers
54
const UINT32 ORIENTATION_MASK = 0x00000007;
55
const UINT32 GAME_NOT_WORKING = 0x00000008;
56
const UINT32 GAME_UNEMULATED_PROTECTION = 0x00000010; // game's protection not fully emulated
57
const UINT32 GAME_WRONG_COLORS = 0x00000020; // colors are totally wrong
58
const UINT32 GAME_IMPERFECT_COLORS = 0x00000040; // colors are not 100% accurate, but close
59
const UINT32 GAME_IMPERFECT_GRAPHICS = 0x00000080; // graphics are wrong/incomplete
60
const UINT32 GAME_NO_COCKTAIL = 0x00000100; // screen flip support is missing
61
const UINT32 GAME_NO_SOUND = 0x00000200; // sound is missing
62
const UINT32 GAME_IMPERFECT_SOUND = 0x00000400; // sound is known to be wrong
63
const UINT32 GAME_SUPPORTS_SAVE = 0x00000800; // game supports save states
64
const UINT32 GAME_IS_BIOS_ROOT = 0x00001000; // this driver entry is a BIOS root
65
const UINT32 GAME_NO_STANDALONE = 0x00002000; // this driver cannot stand alone
66
const UINT32 GAME_REQUIRES_ARTWORK = 0x00004000; // the driver requires external artwork for key elements of the game
67
const UINT32 GAME_UNOFFICIAL = 0x00008000; // unofficial hardware change
68
const UINT32 GAME_NO_SOUND_HW = 0x00010000; // sound hardware not available
69
const UINT32 GAME_MECHANICAL = 0x00020000; // contains mechanical parts (pinball, redemption games,...)
70
const UINT32 GAME_TYPE_ARCADE = 0x00040000; // arcade machine (coin operated machines)
71
const UINT32 GAME_TYPE_CONSOLE = 0x00080000; // console system
72
const UINT32 GAME_TYPE_COMPUTER = 0x00100000; // any kind of computer including home computers, minis, calcs,...
73
const UINT32 GAME_TYPE_OTHER = 0x00200000; // any other emulated system that doesn't fit above (ex. clock, satelite receiver,...)
75
// useful combinations of flags
76
const UINT32 GAME_IS_SKELETON = GAME_NO_SOUND | GAME_NOT_WORKING; // mask for skelly games
77
const UINT32 GAME_IS_SKELETON_MECHANICAL = GAME_IS_SKELETON | GAME_MECHANICAL | GAME_REQUIRES_ARTWORK; // mask for skelly mechanical games
81
//**************************************************************************
83
//**************************************************************************
85
// static driver initialization callback
86
typedef void (*driver_init_func)(running_machine &machine);
88
// static POD structure describing each game driver entry
91
const char * source_file; // set this to __FILE__
92
const char * parent; // if this is a clone, the name of the parent
93
const char * name; // short (8-character) name of the game
94
const char * description; // full name of the game
95
const char * year; // year the game was released
96
const char * manufacturer; // manufacturer of the game
97
machine_config_constructor machine_config; // machine driver tokens
98
ioport_constructor ipt; // pointer to constructor for input ports
99
void (*driver_init)(running_machine &machine); // DRIVER_INIT callback
100
const rom_entry * rom; // pointer to list of ROMs for the game
101
const char * compatible_with;
102
UINT32 flags; // orientation and other flags; see defines below
103
const char * default_layout; // default internally defined layout
108
//**************************************************************************
110
//**************************************************************************
112
// wrappers for the DRIVER_INIT callback
113
#define DRIVER_INIT_NAME(name) driver_init_##name
114
#define DRIVER_INIT(name) void DRIVER_INIT_NAME(name)(running_machine &machine)
115
#define DRIVER_INIT_CALL(name) DRIVER_INIT_NAME(name)(machine)
117
#define driver_init_0 NULL
119
// wrappers for declaring and defining game drivers
120
#define GAME_NAME(name) driver_##name
121
#define GAME_EXTERN(name) extern const game_driver GAME_NAME(name)
123
// standard GAME() macro
124
#define GAME(YEAR,NAME,PARENT,MACHINE,INPUT,INIT,MONITOR,COMPANY,FULLNAME,FLAGS) \
125
GAMEL(YEAR,NAME,PARENT,MACHINE,INPUT,INIT,MONITOR,COMPANY,FULLNAME,FLAGS,((const char *)0))
127
// standard macro with additional layout
128
#define GAMEL(YEAR,NAME,PARENT,MACHINE,INPUT,INIT,MONITOR,COMPANY,FULLNAME,FLAGS,LAYOUT) \
129
extern const game_driver GAME_NAME(NAME) = \
137
MACHINE_CONFIG_NAME(MACHINE), \
138
INPUT_PORTS_NAME(INPUT), \
139
DRIVER_INIT_NAME(INIT), \
142
(MONITOR)|(FLAGS)|GAME_TYPE_ARCADE, \
146
// standard console definition macro
147
#define CONS(YEAR,NAME,PARENT,COMPAT,MACHINE,INPUT,INIT,COMPANY,FULLNAME,FLAGS) \
148
extern const game_driver GAME_NAME(NAME) = \
156
MACHINE_CONFIG_NAME(MACHINE), \
157
INPUT_PORTS_NAME(INPUT), \
158
DRIVER_INIT_NAME(INIT), \
161
ROT0|(FLAGS)|GAME_TYPE_CONSOLE, \
165
// standard computer definition macro
166
#define COMP(YEAR,NAME,PARENT,COMPAT,MACHINE,INPUT,INIT,COMPANY,FULLNAME,FLAGS) \
167
extern const game_driver GAME_NAME(NAME) = \
175
MACHINE_CONFIG_NAME(MACHINE), \
176
INPUT_PORTS_NAME(INPUT), \
177
DRIVER_INIT_NAME(INIT), \
180
ROT0|(FLAGS)|GAME_TYPE_COMPUTER, \
184
// standard system definition macro
185
#define SYST(YEAR,NAME,PARENT,COMPAT,MACHINE,INPUT,INIT,COMPANY,FULLNAME,FLAGS) \
186
extern const game_driver GAME_NAME(NAME) = \
194
MACHINE_CONFIG_NAME(MACHINE), \
195
INPUT_PORTS_NAME(INPUT), \
196
DRIVER_INIT_NAME(INIT), \
199
ROT0|(FLAGS)|GAME_TYPE_OTHER, \
205
//**************************************************************************
207
//**************************************************************************
209
GAME_EXTERN(___empty);