aboutsummaryrefslogtreecommitdiff
path: root/engines/agi/detection.cpp
blob: f4be487aec9c497b3edb3cc712293ec74ddd0597 (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
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
/* ScummVM - Scumm Interpreter
 * Copyright (C) 2006 The ScummVM project
 *
 * cinE Engine is (C) 2004-2005 by CinE Team
 *
 * 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:$
 *
 */

#include "common/stdafx.h"

#include "base/plugins.h"

#include "common/advancedDetector.h"
#include "common/file.h"

#include "agi/agi.h"


namespace Agi {
static DetectedGameList GAME_detectGames(const FSList &fslist);
}

using Common::File;

static const PlainGameDescriptor agiGames[] = {
	{"agi", "Sierra AGI Engine" },

	{0, 0}
};

ADVANCED_DETECTOR_DEFINE_PLUGIN(AGI, Agi::AgiEngine, Agi::GAME_detectGames, agiGames, 0);

REGISTER_PLUGIN(AGI, "AGI v2 + v3 Engine", "Sierra AGI Engine (C) Sierra On-Line Software");


namespace Agi {

#define FILE_MD5_BYTES 5000

using Common::ADGameFileDescription;
using Common::ADGameDescription;

using Common::File;

// Kings Quest I entries
static const ADGameFileDescription AGI_KQ1_PC_20F_GameFiles[] = {
	{ "logdir",		0,	"10ad66e2ecbd66951534a50aedcd0128"},
};
static const ADGameFileDescription AGI_KQ1_2GS_10S_GameFiles[] = {
	{ "logdir",		0,	"f4277aa34b43d37382bc424c81627617"},
};
static const ADGameFileDescription AGI_KQ1_MAC_20C_GameFiles[] = {
	{ "logdir",		0,	"d4c4739d4ac63f7dbd29255425077d48"},
};

// Kings Quest II Entries
static const ADGameFileDescription AGI_KQ2_PC_22_GameFiles[] = {
	{ "logdir",		0,	"b944c4ff18fb8867362dc21cc688a283"},
};
static const ADGameFileDescription AGI_KQ2_AMIGA_20F_GameFiles[] = {
	{ "logdir",		0,	"b866f0fab2fad91433a637a828cfa410"},
};
static const ADGameFileDescription AGI_KQ2_MAC_20R_GameFiles[] = {
	{ "logdir",		0,	"cbdb0083317c8e7cfb7ac35da4bc7fdc"},
};


static const AGIGameDescription gameDescriptions[] = {
	{
		// kings quest 1 : pc : 2.0F
		{
			"agi",
			"King's Quest 1 (PC 5.25\"/3.5\") 2.0F [AGI 2.917]",
			ARRAYSIZE(AGI_KQ1_PC_20F_GameFiles),
			AGI_KQ1_PC_20F_GameFiles,
			Common::EN_ANY,
			Common::kPlatformPC,
		},
		GType_V2,
		0,
		0x2917,
	},

	{
		// kings quest 1 : 2gs : 1.0S
		{
			"agi",
			"King's Quest 1 (IIgs) 1.0S-88223",
			ARRAYSIZE(AGI_KQ1_2GS_10S_GameFiles),
			AGI_KQ1_2GS_10S_GameFiles,
			Common::EN_ANY,
			Common::kPlatformApple2GS,
		},
		GType_V2,
		0,
		0x2272,
	},


	{
		// kings quest 1 : Mac : 2.0C
		{
			"agi",
			"King's Quest 1 (Mac) 2.0C",
			ARRAYSIZE(AGI_KQ1_MAC_20C_GameFiles),
			AGI_KQ1_MAC_20C_GameFiles,
			Common::EN_ANY,
			Common::kPlatformMacintosh,
		},
		GType_V2,
		0,
		0x2440,
	},


	{
		// kings quest 2 : PC : 2.2
		{
			"agi",
			"King's Quest 2 (PC 5.25\"/3.5\") 2.2 [AGI 2.426]",
			ARRAYSIZE(AGI_KQ2_PC_22_GameFiles),
			AGI_KQ2_PC_22_GameFiles,
			Common::EN_ANY,
			Common::kPlatformPC,
		},
		GType_V2,
		0,
		0x2917,
	},

	{
		// kings quest 2 : Amiga : 2.0J (not sure if this is broken version or not. need to test
		{
			"agi",
			"King's Quest 2 (Amiga) 2.0J",
			ARRAYSIZE(AGI_KQ2_AMIGA_20F_GameFiles),
			AGI_KQ2_AMIGA_20F_GameFiles,
			Common::EN_ANY,
			Common::kPlatformAmiga,
		},
		GType_V2,
		AGI_AMIGA,
		0x2440,
	},

	{
		// kings quest 2 : Mac : 2.0R
		{
			"agi",
			"King's Quest 2 (Mac) 2.0R",
			ARRAYSIZE(AGI_KQ2_MAC_20R_GameFiles),
			AGI_KQ2_MAC_20R_GameFiles,
			Common::EN_ANY,
			Common::kPlatformMacintosh,
		},
		GType_V2,
		0,
		0x2440,
	},

	{ { NULL, NULL, 0, NULL, Common::UNK_LANG, Common::kPlatformUnknown }, 0, 0, 0 }
};

bool AgiEngine::initGame() {
	int i = Common::real_ADVANCED_DETECTOR_DETECT_INIT_GAME(
		(const byte *)gameDescriptions,
		sizeof(AGIGameDescription),
		FILE_MD5_BYTES,
		agiGames
		);
	_gameDescription = &gameDescriptions[i];
	return true;
}

DetectedGameList GAME_detectGames(const FSList &fslist) {
	return real_ADVANCED_DETECTOR_DETECT_GAMES_FUNCTION(
		fslist,
		(const byte *)gameDescriptions,
		sizeof(AGIGameDescription),
		FILE_MD5_BYTES,
		agiGames
	);
}

} // End of namespace Agi