ScummVM API documentation
disk_image.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 AGI_DISK_IMAGE_H
23#define AGI_DISK_IMAGE_H
24
25namespace Common {
26class SeekableReadStream;
27class Path;
28}
29
30namespace Agi {
31
32// PC disk image values and helpers for AgiLoader_v1 and AgiMetaEngineDetection
33
34// Disk image detection requires that image files have a known extension
35static const char * const pcDiskImageExtensions[] = { ".ima", ".img" };
36
37#define PC_DISK_SIZE (2 * 40 * 9 * 512)
38#define PC_DISK_POSITION(h,t,s,o) (((((h + (t * 2)) * 9) + (s - 1)) * 512) + o)
39
40#define PC_INITDIR_POSITION_V1 PC_DISK_POSITION(0, 0, 9, 0)
41#define PC_INITDIR_ENTRY_SIZE_V1 8
42#define PC_INITDIR_SIZE_V1 (PC_INITDIR_ENTRY_SIZE_V1 * 10)
43
44#define PC_INITDIR_LOGDIR_INDEX_V1 3
45#define PC_INITDIR_PICDIR_INDEX_V1 4
46#define PC_INITDIR_VIEWDIR_INDEX_V1 5
47#define PC_INITDIR_SOUNDDIR_INDEX_V1 6
48#define PC_INITDIR_OBJECTS_INDEX_V1 1
49#define PC_INITDIR_WORDS_INDEX_V1 2
50
51#define PC_INITDIR_POSITION_V2001 PC_DISK_POSITION(0, 0, 2, 0)
52#define PC_INITDIR_ENTRY_SIZE_V2001 3
53
54#define PC_INITDIR_LOGDIR_INDEX_V2001 10
55#define PC_INITDIR_PICDIR_INDEX_V2001 11
56#define PC_INITDIR_VIEWDIR_INDEX_V2001 12
57#define PC_INITDIR_SOUNDDIR_INDEX_V2001 13
58#define PC_INITDIR_OBJECTS_INDEX_V2001 8
59#define PC_INITDIR_WORDS_INDEX_V2001 9
60#define PC_INITDIR_VOL0_INDEX_V2001 14
61
62// A2 disk image values and helpers for AgiLoader_A2 and AgiMetaEngineDetection
63
64// Disk image detection requires that image files have a known extension
65static const char * const a2DiskImageExtensions[] = { ".do", ".dsk", ".img", ".nib", ".woz" };
66
67#define A2_DISK_SIZE (35 * 16 * 256)
68#define A2_DISK_POSITION(t, s, o) ((((t * 16) + s) * 256) + o)
69
70#define A2_INITDIR_POSITION A2_DISK_POSITION(1, 3, 0)
71#define A2_INITDIR_ENTRY_SIZE 4
72
73#define A2_INITDIR_LOGDIR_INDEX 3
74#define A2_INITDIR_PICDIR_INDEX 4
75#define A2_INITDIR_VIEWDIR_INDEX 5
76#define A2_INITDIR_SOUNDDIR_INDEX 6
77#define A2_INITDIR_OBJECTS_INDEX 1
78#define A2_INITDIR_WORDS_INDEX 2
79#define A2_INITDIR_VOLUME_MAP_POSITION (A2_INITDIR_POSITION + 5 + 33)
80
81#define A2_KQ2_LOGDIR_POSITION A2_DISK_POSITION(1, 0, 0)
82#define A2_KQ2_PICDIR_POSITION A2_DISK_POSITION(1, 3, 0)
83#define A2_KQ2_VIEWDIR_POSITION A2_DISK_POSITION(1, 6, 0)
84#define A2_KQ2_SOUNDDIR_POSITION A2_DISK_POSITION(1, 9, 0)
85#define A2_KQ2_OBJECTS_POSITION A2_DISK_POSITION(2, 9, 0)
86#define A2_KQ2_WORDS_POSITION A2_DISK_POSITION(3, 0, 0)
87#define A2_KQ2_VOL0_POSITION A2_DISK_POSITION(26, 0, 0)
88#define A2_KQ2_VOL1_POSITION A2_DISK_POSITION(18, 0, 0)
89#define A2_KQ2_DISK_COUNT 5
90
91#define A2_BC_LOGDIR_POSITION A2_DISK_POSITION(1, 7, 0)
92#define A2_BC_PICDIR_POSITION A2_DISK_POSITION(1, 12, 0)
93#define A2_BC_VIEWDIR_POSITION A2_DISK_POSITION(1, 9, 0)
94#define A2_BC_SOUNDDIR_POSITION A2_DISK_POSITION(1, 13, 0)
95#define A2_BC_OBJECTS_POSITION A2_DISK_POSITION(1, 3, 0)
96#define A2_BC_WORDS_POSITION A2_DISK_POSITION(1, 5, 0)
97#define A2_BC_VOLUME_MAP_POSITION A2_DISK_POSITION(7, 11, 254)
98#define A2_BC_DISK_COUNT 5
99#define A2_BC_VOLUME_COUNT 9
100
101// GAL disk image values and helpers for GalLoader and AgiMetaEngineDetection
102
103#define GAL_LOGIC_COUNT 84
104#define GAL_PICTURE_COUNT 84
105#define GAL_VIEW_COUNT 110
106#define GAL_SOUND_COUNT 10
107
108#define GAL_DIR_POSITION_PCJR 0x0500
109#define GAL_DIR_POSITION_PC 0x1400
110#define GAL_DIR_SIZE 948
111
112// GAL disk image values and helpers for GalLoader_A2 and AgiMetaEngineDetection
113
114#define GAL_A2_LOGIC_COUNT 81
115#define GAL_A2_PICTURE_COUNT 85
116#define GAL_A2_VIEW_COUNT 110
117
118#define GAL_A2_LOGDIR_POSITION A2_DISK_POSITION(18, 7, 2)
119#define GAL_A2_PICDIR_POSITION A2_DISK_POSITION(18, 6, 2)
120#define GAL_A2_VIEWDIR_POSITION A2_DISK_POSITION(18, 8, 2)
121#define GAL_A2_WORDS_POSITION A2_DISK_POSITION(17, 8, 0)
122#define GAL_A2_LOGDIR_SIZE (GAL_A2_LOGIC_COUNT * 3)
123#define GAL_A2_DISK_COUNT 3
124
125Common::SeekableReadStream *openPCDiskImage(const Common::Path &path, const Common::FSNode &node);
126Common::SeekableReadStream *openA2DiskImage(const Common::Path &path, const Common::FSNode &node, bool loadAllTracks = true);
127
128} // End of namespace Agi
129
130#endif /* AGI_DISK_IMAGE_H */
Definition: fs.h:69
Definition: path.h:52
Definition: stream.h:745
Definition: agi.h:64
Definition: algorithm.h:29
Path
Definition: game.h:76