~ubuntu-branches/debian/sid/mame/sid

« back to all changes in this revision

Viewing changes to src/emu/gamedrv.h

  • Committer: Package Import Robot
  • Author(s): Jordi Mallach, Emmanuel Kasper, Jordi Mallach
  • Date: 2012-06-05 20:02:23 UTC
  • mfrom: (0.3.1) (0.1.4)
  • Revision ID: package-import@ubuntu.com-20120605200223-gnlpogjrg6oqe9md
Tags: 0.146-1
[ Emmanuel Kasper ]
* New upstream release
* Drop patch to fix man pages section and patches to link with flac 
  and jpeg system lib: all this has been pushed upstream by Cesare Falco
* Add DM-Upload-Allowed: yes field.

[ Jordi Mallach ]
* Create a "gnu" TARGETOS stanza that defines NO_AFFINITY_NP.
* Stop setting TARGETOS to "unix" in d/rules. It should be autodetected,
  and set to the appropriate value.
* mame_manpage_section.patch: Change mame's manpage section to 6 (games),
  in the TH declaration.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
 
 
3
    gamedrv.h
 
4
 
 
5
    Definitions for game drivers.
 
6
 
 
7
****************************************************************************
 
8
 
 
9
    Copyright Aaron Giles
 
10
    All rights reserved.
 
11
 
 
12
    Redistribution and use in source and binary forms, with or without
 
13
    modification, are permitted provided that the following conditions are
 
14
    met:
 
15
 
 
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
 
21
          distribution.
 
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.
 
25
 
 
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.
 
37
 
 
38
***************************************************************************/
 
39
 
 
40
#pragma once
 
41
 
 
42
#ifndef __GAMEDRV_H__
 
43
#define __GAMEDRV_H__
 
44
 
 
45
 
 
46
//**************************************************************************
 
47
//  CONSTANTS
 
48
//**************************************************************************
 
49
 
 
50
// maxima
 
51
const int MAX_DRIVER_NAME_CHARS = 8;
 
52
 
 
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,...)
 
74
 
 
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
 
78
 
 
79
 
 
80
 
 
81
//**************************************************************************
 
82
//  TYPE DEFINITIONS
 
83
//**************************************************************************
 
84
 
 
85
// static driver initialization callback
 
86
typedef void (*driver_init_func)(running_machine &machine);
 
87
 
 
88
// static POD structure describing each game driver entry
 
89
struct game_driver
 
90
{
 
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
 
104
};
 
105
 
 
106
 
 
107
 
 
108
//**************************************************************************
 
109
//  MACROS
 
110
//**************************************************************************
 
111
 
 
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)
 
116
 
 
117
#define driver_init_0                           NULL
 
118
 
 
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)
 
122
 
 
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))
 
126
 
 
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) =      \
 
130
{                                                                                       \
 
131
        __FILE__,                                                               \
 
132
        #PARENT,                                                                \
 
133
        #NAME,                                                                  \
 
134
        FULLNAME,                                                               \
 
135
        #YEAR,                                                                  \
 
136
        COMPANY,                                                                \
 
137
        MACHINE_CONFIG_NAME(MACHINE),                   \
 
138
        INPUT_PORTS_NAME(INPUT),                                \
 
139
        DRIVER_INIT_NAME(INIT),                                 \
 
140
        ROM_NAME(NAME),                                                 \
 
141
        NULL,                                                                   \
 
142
        (MONITOR)|(FLAGS)|GAME_TYPE_ARCADE,             \
 
143
        &LAYOUT[0]                                                              \
 
144
};
 
145
 
 
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) =      \
 
149
{                                                                                       \
 
150
        __FILE__,                                                               \
 
151
        #PARENT,                                                                \
 
152
        #NAME,                                                                  \
 
153
        FULLNAME,                                                               \
 
154
        #YEAR,                                                                  \
 
155
        COMPANY,                                                                \
 
156
        MACHINE_CONFIG_NAME(MACHINE),                   \
 
157
        INPUT_PORTS_NAME(INPUT),                                \
 
158
        DRIVER_INIT_NAME(INIT),                                 \
 
159
        ROM_NAME(NAME),                                                 \
 
160
        #COMPAT,                                                                \
 
161
        ROT0|(FLAGS)|GAME_TYPE_CONSOLE,                 \
 
162
        NULL                                                                    \
 
163
};
 
164
 
 
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) =      \
 
168
{                                                                                       \
 
169
        __FILE__,                                                               \
 
170
        #PARENT,                                                                \
 
171
        #NAME,                                                                  \
 
172
        FULLNAME,                                                               \
 
173
        #YEAR,                                                                  \
 
174
        COMPANY,                                                                \
 
175
        MACHINE_CONFIG_NAME(MACHINE),                   \
 
176
        INPUT_PORTS_NAME(INPUT),                                \
 
177
        DRIVER_INIT_NAME(INIT),                                 \
 
178
        ROM_NAME(NAME),                                                 \
 
179
        #COMPAT,                                                                \
 
180
        ROT0|(FLAGS)|GAME_TYPE_COMPUTER,                \
 
181
        NULL                                                                    \
 
182
};
 
183
 
 
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) =      \
 
187
{                                                                                       \
 
188
        __FILE__,                                                               \
 
189
        #PARENT,                                                                \
 
190
        #NAME,                                                                  \
 
191
        FULLNAME,                                                               \
 
192
        #YEAR,                                                                  \
 
193
        COMPANY,                                                                \
 
194
        MACHINE_CONFIG_NAME(MACHINE),                   \
 
195
        INPUT_PORTS_NAME(INPUT),                                \
 
196
        DRIVER_INIT_NAME(INIT),                                 \
 
197
        ROM_NAME(NAME),                                                 \
 
198
        #COMPAT,                                                                \
 
199
        ROT0|(FLAGS)|GAME_TYPE_OTHER,                   \
 
200
        NULL                                                                    \
 
201
};
 
202
 
 
203
 
 
204
 
 
205
//**************************************************************************
 
206
//  GLOBAL VARIABLES
 
207
//**************************************************************************
 
208
 
 
209
GAME_EXTERN(___empty);
 
210
 
 
211
#endif