-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathprototype.h
258 lines (209 loc) · 4.26 KB
/
prototype.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
#ifndef _MAMEPGUITYPES_H_
#define _MAMEPGUITYPES_H_
#include <QtGui>
class BiosSet : public QObject
{
public:
QString description;
bool isDefault;
BiosSet(QObject *parent = 0);
};
class RomInfo : public QObject
{
public:
QString name;
QString bios;
quint64 size;
//quint32 crc is the key
//md5
//sha1
QString merge;
QString region;
//offset
QString status;
//dispose
/* internal */
bool available;
RomInfo(QObject *parent = 0);
};
class DiskInfo : public QObject
{
public:
QString name;
//md5
//QString sha1 is the key
QString merge;
QString region;
quint8 index;
QString status;
//dispose
/* internal */
bool available;
DiskInfo(QObject *parent = 0);
};
class ChipInfo : public QObject
{
public:
QString name;
QString tag;
QString type;
quint32 clock;
ChipInfo(QObject *parent = 0);
};
class DisplayInfo : public QObject
{
public:
QString type;
QString rotate;
bool flipx;
quint16 width;
quint16 height;
QString refresh;
// int pixclock;
quint16 htotal;
quint16 hbend;
quint16 hbstart;
quint16 vtotal;
quint16 vbend;
quint16 vbstart;
DisplayInfo(QObject *parent = 0);
};
class ControlInfo : public QObject
{
public:
QString type;
quint16 minimum;
quint16 maximum;
quint16 sensitivity;
quint16 keydelta;
bool reverse;
ControlInfo(QObject *parent = 0);
};
class DeviceInfo : public QObject
{
public:
QString type;
QString tag;
bool mandatory;
bool isConst;
QString mountedPath;
// QString instanceName is the key
QStringList extensionNames;
DeviceInfo(QObject *parent = 0);
};
class SoftwareListInfo : public QObject
{
public:
QString name;
QString status;
QString filter;
SoftwareListInfo(QObject *parent = 0);
};
class TreeItem;
class GameInfo : public QObject
{
public:
/* game */
QString sourcefile;
bool isBios;
bool isDevice;
// bool runnable;
QString cloneof;
QString romof;
QString sampleof;
QString description;
QString year;
QString manufacturer;
/* biosset */
QHash<QString /*name*/, BiosSet *> biosSets;
/* rom */
QMultiHash<quint32 /*crc*/, RomInfo *> roms;
/* disk */
QHash<QString /*sha1*/, DiskInfo *> disks;
/* sample */
QStringList samples;
/* chip */
QList<ChipInfo *> chips;
/* display */
QList<DisplayInfo *> displays;
/* sound */
quint8 channels;
/* softwarelist */
QList<SoftwareListInfo *> softwarelists;
/* input */
bool service;
bool tilt;
quint8 players;
quint8 buttons;
quint8 coins;
QList<ControlInfo *> controls;
//dipswitch
/* driver, impossible for a game to have multiple drivers */
quint8 status;
quint8 emulation;
quint8 color;
quint8 sound;
quint8 graphic;
quint8 cocktail;
quint8 protection;
quint8 savestate;
quint32 palettesize;
/* device */
QMap<QString /* instanceName */, DeviceInfo *> devices;
/*ramoption */
QList<quint32> ramOptions;
quint32 defaultRamOption;
/* extension */
QByteArray extraInfo;
/* updater only */
QString url;
qint64 size;
quint32 crc;
QString directory;
QString filter; //only for filenames, no paths
/* internal */
QString lcDesc;
QString lcMftr;
QString reading;
bool isExtRom;
bool isHorz;
bool isMechanical;
bool isGamble;
qint8 available;
QByteArray icondata;
TreeItem *pModItem;
QSet<QString> clones;
GameInfo(QObject *parent = 0);
~GameInfo();
QString biosof();
DeviceInfo *getDevice(QString type, int = 0);
QString getDeviceInstanceName(QString type, int = 0);
};
class MameDat : public QObject
{
Q_OBJECT
public:
QString defaultIni;
QString mameVersion;
QHash<QString, GameInfo *> games;
MameDat(QObject * = 0, int = 0);
MameDat(const QByteArray&);
int load();
void save();
int completeData();
private:
QProcess *loadProc;
int numTotalGames;
QByteArray mameOutputBuf;
void parseListXml(int = 0);
private slots:
// external process management
void loadListXmlReadyReadStandardOutput();
void loadListXmlFinished(int, QProcess::ExitStatus);
void loadDefaultIniReadyReadStandardOutput();
void loadDefaultIniFinished(int, QProcess::ExitStatus);
};
extern MameDat *pMameDat;
extern MameDat *pFixDat;
extern MameDat *pTempDat;
#endif