aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/include/versions.h
blob: c18840598a909fdbc061804cb05d77b66f849b47 (plain)
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
/* ScummVM - Graphic Adventure Engine
 *
 * ScummVM is the legal property of its developers, whose names
 * are too numerous to list here. Please refer to the COPYRIGHT
 * file distributed with this source distribution.
 *
 * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 * $URL$
 * $Id$
 *
 */

/* Versions management */

#ifndef _SCI_VERSIONS_H_
#define _SCI_VERSIONS_H_

#include "sci/include/scitypes.h"

struct _state;

#define SCI_VERSION(_major_, _minor_, _patchlevel_) (((_major_)<<20) | ((_minor_)<<10) | _patchlevel_)
/* This allows version numbers to be compared directly */

#define SCI_VERSION_MAJOR(_version_) ((_version_) >> 20)
#define SCI_VERSION_MINOR(_version_) (((_version_) >> 10) & 0x3ff)
#define SCI_VERSION_PATCHLEVEL(_version_) ((_version_) & 0x3ff)
#define SCI_VERSION_IGNORE_PATCHLEVEL(_version_) ((_version) & ~0x3ff)

/* Version number guide:
** - Always use the version number of the first known version to have a special feature.
** - Don't assume that special feature changes are linked just because they appeared to change
**   simultaneously.
** - Put all the magic version numbers here, into THIS file.
** - "FTU" means "First To Use"
*/

#define SCI_VERSION_LAST_SCI0 SCI_VERSION(0,000,685)

#define SCI_VERSION_DEFAULT_SCI0 SCI_VERSION_LAST_SCI0
/* AFAIK this is the last published SCI0 version */
#define SCI_VERSION_DEFAULT_SCI01 SCI_VERSION(1,000,72)
/* The version used by my implementation of QfG2 */


#define SCI_VERSION_FTU_CENTERED_TEXT_AS_DEFAULT SCI_VERSION(0,000,629)
/* Last version known not to do this: 0.000.502 */

#define SCI_VERSION_FTU_NEW_GETTIME SCI_VERSION(0,000,629)
/* These versions of SCI has a different set of subfunctions in GetTime() */

#define SCI_VERSION_FTU_NEWER_DRAWPIC_PARAMETERS SCI_VERSION(0,000,502)
/* Last version known not to do this: 0.000.435
** Old SCI versions used to interpret the third DrawPic() parameter inversely,
** with the opposite default value (obviously)
*/

#define SCI_VERSION_FTU_PRIORITY_14_ZONES SCI_VERSION(0,000,502)
/* Last version known to do this: 0.000.490
 * Uses 14 zones from 42 to 190 instead of 15 zones from 42 to 200.
*/


#define SCI_VERSION_FTU_NEW_SCRIPT_HEADER SCI_VERSION(0,000,395)
/* Last version known not to do this: 0.000.343
** Old SCI versions used two word header for script blocks (first word equal
** to 0x82, meaning of the second one unknown). New SCI versions used one
** word header.
*/

#define SCI_VERSION_LTU_BASE_OB1 SCI_VERSION(0,000,256)
/* First version version known not to have this bug: ?
** When doing CanBeHere(), augment y offset by 1
*/

#define SCI_VERSION_FTU_2ND_ANGLES SCI_VERSION(0,000,395)
/* Last version known not to use this: ?
** Earlier versions assign 120 degrees to left & right , and 60 to up and down.
** Later versions use an even 90 degree distribution.
*/

#define SCI_VERSION_RESUME_SUSPENDED_SONG SCI_VERSION(0,000,490)
/* First version (PQ2-new) known to use the different song resumption
   mechanism -- When a new song is initialized, we store its state and
   resume it when the new one finishes.  Older versions completely
   clobbered the old songs.
*/

#define SCI_VERSION_FTU_INVERSE_CANBEHERE SCI_VERSION(1,000,510)
/* FIXME: This shouldn't be a version number.
 * But it'll do for now.
 */

#define SCI_VERSION_FTU_LOFS_ABSOLUTE SCI_VERSION(1,000,200)
/* First version known to do this: ?
   In later versions (SCI1 and beyond), the argument of lofs[as]
   instructions is absolute rather than relative.
*/

#define SCI_VERSION_FTU_DISPLAY_COORDS_FUZZY SCI_VERSION(1,000,510)
/* First version known to do this: ?
   In later versions of SCI1 kDisplay(), if the text would not fit on
   the screen, the text is moved to the left and upwards until it
   fits.
*/

#define SCI_VERSION_FTU_DOSOUND_VARIANT_1 SCI_VERSION(1,000,000)
#define SCI_VERSION_FTU_DOSOUND_VARIANT_2 SCI_VERSION(1,000,510)


typedef int sci_version_t;

struct _state;

void
version_require_earlier_than(struct _state *s, sci_version_t version);
/* Function used in autodetection
** Parameters: (state_t *) s: state_t containing the version
**             (sci_version_t) version: The version that we're earlier than
*/

void
version_require_later_than(struct _state *s, sci_version_t version);
/* Function used in autodetection (read this function "version_require_later_than_or_equal_to")
** Parameters: (state_t *) s: state_t containing the version
**             (sci_version_t) version: The version that we're later than
*/

int
version_parse(const char *vn, sci_version_t *result);
/* Parse a string containing an SCI version number
** Parameters: (char *) vn: The string to parse
** Returns   : (int) 0 on success, 1 on failure
**             (sci_version_t) *result: The resulting version number on success
*/

#endif /* !_SCI_VERSIONS_H_ */