ScummVM API documentation
detection.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef SCUMM_DETECTION_H
23 #define SCUMM_DETECTION_H
24 
25 #include "common/language.h"
26 #include "common/platform.h"
27 
28 namespace Scumm {
29 
30 
31 // GUI-options, primarily used by detection_tables.h
32 #define GUIO_TRIM_FMTOWNS_TO_200_PIXELS GUIO_GAMEOPTIONS1
33 #define GUIO_ENHANCEMENTS GUIO_GAMEOPTIONS2
34 #define GUIO_AUDIO_OVERRIDE GUIO_GAMEOPTIONS3
35 #define GUIO_ORIGINALGUI GUIO_GAMEOPTIONS4
36 #define GUIO_LOWLATENCYAUDIO GUIO_GAMEOPTIONS5
37 #define GUIO_NETWORK GUIO_GAMEOPTIONS6
38 
39 /* Game enhancements */
40 
41 /* "How should I mark an enhancement?" - A practical guide for the developer:
42 *
43 * Hi! If you're here it means that you are probably trying to make up
44 * your mind about how to correctly mark your brand new game enhancement:
45 * if that's the case... congratulations, you've come to the right place! :-)
46 *
47 * Marking a piece of code as an enhancement is as simple as guarding it with
48 * a conditional check using the enhancementEnabled(<class>) function.
49 * For example:
50 *
51 * if (enhancementEnabled(<kMyBeautifulEnhancementClass>)) {
52 * // Piece of code which makes Guybrush hair white
53 * }
54 *
55 * That's it! :-)
56 *
57 * You've probably noticed that the function above needs a class in order to work.
58 * Of course there is no one kind of enhancement: each of them might tackle
59 * different aspect of the game, from the graphics to the gameplay itself.
60 * So it all comes to identifying the correct class for your enhancement.
61 *
62 * We identify nine different enhancement classes:
63 *
64 * --- Gamebreaking Bug Fixes ---
65 *
66 * This is a class of enhancements which is ALWAYS active; it encapsulates
67 * code changes which were not in the original game but which are absolutely
68 * necessary in order to avoid deadlocks or even crashes! Being able to differentiate
69 * between original code and these enhancements can be quite useful for future
70 * developers and their research (e.g. "why is this code different from the disassembly?",
71 * "why did they change it like that?").
72 *
73 * --- Minor Bug Fixes ---
74 *
75 * Did the original developers blit a green pixel on a blue tinted background
76 * and YOU'RE ABSOLUTELY SURE that they didn't do that on purpose? Is one of the
77 * voice files playing as garbled noise instead of sounding like normal speech?
78 * Is the game looking like there is something which is clearly wrong with it?
79 * This is the class you're looking for, then!
80 *
81 * --- Text and Localization Fixes ---
82 *
83 * If you spot any issues which pertain texts (accents not being rendered properly
84 * on localizations, placeholder lines forgotten by the developers, obvious typos), and
85 * which are NOT about the format of the subtitle (color, position) or the content,
86 * then this is the class you should be using.
87 * Do not use this class when changing an already grammatically correct line to another
88 * line for the purpose of matching the text to the speech line!
89 * Use "Subtitle Format/Content Changes" instead.
90 *
91 * --- Visual Changes ---
92 *
93 * Any graphical change which is not classifiable as a "fix" but is, as a matter of fact,
94 * a deliberate change which strays away from the original intentions, should be marked
95 * with this class. Some examples of this are enhancements which modify palettes and add
96 * or edit graphical elements in order to better match a particular "reference" version.
97 *
98 * --- Audio Changes ---
99 *
100 * Like above, but for anything sound related.
101 *
102 * --- Timing Adjustments ---
103 *
104 * Are you making a scene slower or faster for any reason? Are you changing the framerate
105 * of an in-game situation? Choose this class!
106 *
107 * --- Subtitles Format/Content Changes ---
108 *
109 * Any changes to the subtitles format should be classified under this class.
110 * This also includes changes to the subtitles content when not under the "fix" umbrella,
111 * for example when you are changing an already grammatically and graphically correct line
112 * to match it with the corresponding speech file.
113 *
114 * --- Restored Cut Content ---
115 *
116 * Have you found any line of dialog, a graphical element or even a piece of music which
117 * is in the game data but is not being used? Go nuts with this enhancement class then! :-)
118 *
119 * --- UI/UX Enhancements ---
120 *
121 * These old games are beautiful. But sometimes they can be so clunky... :-)
122 * If you make any changes in order to yield a slightly-less-clunky user experience
123 * you should classify them under this class. Here's a couple of real use cases:
124 * - SAMNMAX: the CD version of the game begins with what seems to be a fake loading
125 * screen for the sounds. We have an enhancement which just skips that :-)
126 * - Early games: some early titles use a save menu screen which is piloted by SCUMM scripts,
127 * and therefore run at an in-game framerate. This causes lag and lost keypresses
128 * from your keyboard when attempting to write the names of your savegames.
129 * We remove the framerate cap so that writing is not painful anymore... :-P
130 *
131 */
132 
133 enum {
134  kEnhGameBreakingBugFixes = 1 << 0, // Gamebreaking Bug Fixes
135  kEnhMinorBugFixes = 1 << 1, // Minor Bug Fixes
136  kEnhTextLocFixes = 1 << 2, // Text and Localization Fixes
137  kEnhVisualChanges = 1 << 3, // Visual Changes
138  kEnhAudioChanges = 1 << 4, // Audio Changes
139  kEnhTimingChanges = 1 << 5, // Timing Adjustments
140  kEnhSubFmtCntChanges = 1 << 6, // Subtitles Format/Content Changes
141  kEnhRestoredContent = 1 << 7, // Restored Cut Content
142  kEnhUIUX = 1 << 8, // UI/UX Enhancements
143 };
144 
145 /* "How are the enhancements grouped?" - A practical guide to follow if you're lost:
146 *
147 * GROUP 1: Fix original bugs
148 *
149 * This category includes both game-breaking bugs which cause the game to crash/deadlock and
150 * minor bug fixes (e.g. text and localization issues). Enhancements in this category should
151 * pertain stuff which is very clearly a bug (for example a badly shaped walkbox, a wrong accent
152 * in a word from the subtitles, a strip of pixels which is very clearly out of place/with the
153 * wrong palette, AND NOT include things like subtitles and boxes color changes, enhancements
154 * which make a version similar to another, etc.). Basically when this and only this is active,
155 * the game should not have deadlock situations and the immersiveness should not be broken by
156 * very evident graphical glitches, charset issues, etc.
157 *
158 * GROUP 2: Audio-visual improvements
159 *
160 * This category comprises visual and audio changes as well as timing adjustments. This is the
161 * category in which we can basically put everything which I said not to put in the previous
162 * category. This includes: changing the spacing of the font from the original, changing colors
163 * of subtitles for consistency, changes to the subtitles content in order to match the speech
164 * or to fix the localization, music changes (like the ones in COMI and FT), graphic changes
165 * which are not as essential as the ones from the previous category, etc.
166 *
167 * GROUP 3: Restored content
168 *
169 * This category reintroduces content cut or unused which was not in the original. This
170 * can include content which was somehow masked by mistake by the scripts.
171 *
172 * GROUP 4: Modern UI/UX adjustments
173 *
174 * This category pertains to all enhancements to the user interface and user experience:
175 * e.g. the artificial loading screen at the beginning of Sam&Max, speeding up the framerate
176 * in old original menus to have a decent keyboard polling rate.
177 *
178 */
179 
180 enum {
181  kEnhGrp1 = (kEnhMinorBugFixes | kEnhTextLocFixes),
182  kEnhGrp2 = (kEnhVisualChanges | kEnhAudioChanges | kEnhTimingChanges | kEnhSubFmtCntChanges),
183  kEnhGrp3 = (kEnhRestoredContent),
184  kEnhGrp4 = (kEnhUIUX)
185 };
186 
191 struct GameSettings {
195  const char *gameid;
196 
207  const char *variant;
208 
213  const char *preferredTag;
214 
222  byte id;
223 
225  byte version;
226 
228  byte heversion;
229 
231  int midi;
232 
237  uint32 features;
238 
245 
249  const char *guioptions;
250 };
251 
252 enum FilenameGenMethod {
253  kGenDiskNum,
254  kGenDiskNumSteam,
255  kGenRoomNum,
256  kGenRoomNumSteam,
257  kGenHEMac,
258  kGenHEMacNoParens,
259  kGenHEPC,
260  kGenHEIOS,
261  kGenUnchanged
262 };
263 
265  const char *pattern;
266  FilenameGenMethod genMethod;
267 };
268 
270  const char *gameid;
271  const char *pattern;
272  FilenameGenMethod genMethod;
273  Common::Language language;
275  const char *variant;
276 };
277 
279  FilenamePattern fp;
280  GameSettings game;
281  Common::Language language;
282  Common::String md5;
283  const char *extra;
284 };
285 
293  GF_DEMO = 1 << 0,
294 
296  GF_NEW_COSTUMES = 1 << 2,
297 
299  GF_USE_KEY = 1 << 4,
300 
302  GF_SMALL_HEADER = 1 << 5,
303 
305  GF_OLD_BUNDLE = 1 << 6,
306 
308  GF_16COLOR = 1 << 7,
309 
311  GF_OLD256 = 1 << 8,
312 
314  GF_AUDIOTRACKS = 1 << 9,
315 
320  GF_FEW_LOCALS = 1 << 11,
321 
323  GF_HE_LOCALIZED = 1 << 13,
324 
329  GF_HE_985 = 1 << 14,
330 
332  GF_16BIT_COLOR = 1 << 15,
333 
338  GF_MAC_CONTAINER = 1 << 16,
339 
345  GF_HE_NO_BIDI = 1 << 17,
346 
352 
357  GF_HE_995 = 1 << 19
358 };
359 
360 enum ScummGameId {
361  GID_CMI,
362  GID_DIG,
363  GID_FT,
364  GID_INDY3,
365  GID_INDY4,
366  GID_LOOM,
367  GID_MANIAC,
368  GID_MONKEY_EGA,
369  GID_MONKEY_VGA,
370  GID_MONKEY,
371  GID_MONKEY2,
372  GID_PASS,
373  GID_SAMNMAX,
374  GID_TENTACLE,
375  GID_ZAK,
376 
377  GID_HEGAME, // Generic name for all HE games with default behavior
378  GID_PUTTDEMO,
379  GID_FBEAR,
380  GID_PUTTMOON,
381  GID_FUNPACK,
382  GID_PUTTZOO,
383  GID_FREDDI,
384  GID_FREDDI3,
385  GID_FREDDI4,
386  GID_BIRTHDAYRED,
387  GID_BIRTHDAYYELLOW,
388  GID_TREASUREHUNT,
389  GID_PUTTRACE,
390  GID_FUNSHOP, // Used for all three funshops
391  GID_FOOTBALL,
392  GID_FOOTBALL2002,
393  GID_SOCCER,
394  GID_SOCCERMLS,
395  GID_SOCCER2004,
396  GID_BASEBALL2001,
397  GID_BASEBALL2003,
398  GID_BASKETBALL,
399  GID_MOONBASE,
400  GID_PJGAMES,
401  GID_HECUP // CUP demos
402 };
403 
405  ScummGameId gameid;
406  const char *variant;
407  const char *patcherName;
408 };
409 } // End of namespace Scumm
410 
411 
412 #endif
Definition: str.h:59
Definition: detection.h:320
Definition: detection.h:269
Definition: detection.h:305
Definition: detection.h:264
byte heversion
Definition: detection.h:228
byte id
Definition: detection.h:222
Definition: detection.h:293
Definition: detection.h:332
Definition: detection.h:308
Common::Platform platform
Definition: detection.h:244
Definition: detection.h:323
byte version
Definition: detection.h:225
Definition: detection.h:311
const char * guioptions
Definition: detection.h:249
Definition: detection.h:191
Definition: detection.h:404
Definition: detection.h:345
const char * variant
Definition: detection.h:207
Definition: detection.h:357
uint32 features
Definition: detection.h:237
Definition: detection.h:299
Definition: detection.h:296
const char * preferredTag
Definition: detection.h:213
Definition: detection.h:302
GameFeatures
Definition: detection.h:291
Definition: detection.h:329
Definition: detection.h:314
int midi
Definition: detection.h:231
Definition: actor.h:30
Definition: detection.h:338
Platform
Definition: platform.h:46
const char * gameid
Definition: detection.h:195
Definition: detection.h:278
Definition: detection.h:351
Language
Definition: language.h:45