File: disk_image.h

package info (click to toggle)
scummvm 2.9.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 450,580 kB
  • sloc: cpp: 4,299,825; asm: 28,322; python: 12,901; sh: 11,302; java: 9,289; xml: 7,895; perl: 2,639; ansic: 2,465; yacc: 1,670; javascript: 1,020; makefile: 933; lex: 578; awk: 275; objc: 82; sed: 11; php: 1
file content (130 lines) | stat: -rw-r--r-- 5,519 bytes parent folder | download
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
/* 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 3 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, see <http://www.gnu.org/licenses/>.
 *
 */

#ifndef AGI_DISK_IMAGE_H
#define AGI_DISK_IMAGE_H

namespace Common {
class SeekableReadStream;
class Path;
}

namespace Agi {

// PC disk image values and helpers for AgiLoader_v1 and AgiMetaEngineDetection

// Disk image detection requires that image files have a known extension
static const char * const pcDiskImageExtensions[] = { ".ima", ".img" };

#define PC_DISK_SIZE                     (2 * 40 * 9 * 512)
#define PC_DISK_POSITION(h,t,s,o)        (((((h + (t * 2)) * 9) + (s - 1)) * 512) + o)

#define PC_INITDIR_POSITION_V1           PC_DISK_POSITION(0, 0, 9, 0)
#define PC_INITDIR_ENTRY_SIZE_V1         8
#define PC_INITDIR_SIZE_V1               (PC_INITDIR_ENTRY_SIZE_V1 * 10)

#define PC_INITDIR_LOGDIR_INDEX_V1       3
#define PC_INITDIR_PICDIR_INDEX_V1       4
#define PC_INITDIR_VIEWDIR_INDEX_V1      5
#define PC_INITDIR_SOUNDDIR_INDEX_V1     6
#define PC_INITDIR_OBJECTS_INDEX_V1      1
#define PC_INITDIR_WORDS_INDEX_V1        2

#define PC_INITDIR_POSITION_V2001        PC_DISK_POSITION(0, 0, 2, 0)
#define PC_INITDIR_ENTRY_SIZE_V2001      3

#define PC_INITDIR_LOGDIR_INDEX_V2001    10
#define PC_INITDIR_PICDIR_INDEX_V2001    11
#define PC_INITDIR_VIEWDIR_INDEX_V2001   12
#define PC_INITDIR_SOUNDDIR_INDEX_V2001  13
#define PC_INITDIR_OBJECTS_INDEX_V2001   8
#define PC_INITDIR_WORDS_INDEX_V2001     9
#define PC_INITDIR_VOL0_INDEX_V2001      14

// A2 disk image values and helpers for AgiLoader_A2 and AgiMetaEngineDetection

// Disk image detection requires that image files have a known extension
static const char * const a2DiskImageExtensions[] = { ".do", ".dsk", ".img", ".nib", ".woz" };

#define A2_DISK_SIZE                     (35 * 16 * 256)
#define A2_DISK_POSITION(t, s, o)        ((((t * 16) + s) * 256) + o)

#define A2_INITDIR_POSITION              A2_DISK_POSITION(1, 3, 0)
#define A2_INITDIR_ENTRY_SIZE            4

#define A2_INITDIR_LOGDIR_INDEX          3
#define A2_INITDIR_PICDIR_INDEX          4
#define A2_INITDIR_VIEWDIR_INDEX         5
#define A2_INITDIR_SOUNDDIR_INDEX        6
#define A2_INITDIR_OBJECTS_INDEX         1
#define A2_INITDIR_WORDS_INDEX           2
#define A2_INITDIR_VOLUME_MAP_POSITION   (A2_INITDIR_POSITION + 5 + 33)

#define A2_KQ2_LOGDIR_POSITION           A2_DISK_POSITION(1,  0,  0)
#define A2_KQ2_PICDIR_POSITION           A2_DISK_POSITION(1,  3,  0)
#define A2_KQ2_VIEWDIR_POSITION          A2_DISK_POSITION(1,  6,  0)
#define A2_KQ2_SOUNDDIR_POSITION         A2_DISK_POSITION(1,  9,  0)
#define A2_KQ2_OBJECTS_POSITION          A2_DISK_POSITION(2,  9,  0)
#define A2_KQ2_WORDS_POSITION            A2_DISK_POSITION(3,  0,  0)
#define A2_KQ2_VOL0_POSITION             A2_DISK_POSITION(26, 0,  0)
#define A2_KQ2_VOL1_POSITION             A2_DISK_POSITION(18, 0,  0)
#define A2_KQ2_DISK_COUNT                5

#define A2_BC_LOGDIR_POSITION            A2_DISK_POSITION(1,  7,  0)
#define A2_BC_PICDIR_POSITION            A2_DISK_POSITION(1,  12, 0)
#define A2_BC_VIEWDIR_POSITION           A2_DISK_POSITION(1,  9,  0)
#define A2_BC_SOUNDDIR_POSITION          A2_DISK_POSITION(1,  13, 0)
#define A2_BC_OBJECTS_POSITION           A2_DISK_POSITION(1,  3,  0)
#define A2_BC_WORDS_POSITION             A2_DISK_POSITION(1,  5,  0)
#define A2_BC_VOLUME_MAP_POSITION        A2_DISK_POSITION(7,  11, 254)
#define A2_BC_DISK_COUNT                 5
#define A2_BC_VOLUME_COUNT               9

// GAL disk image values and helpers for GalLoader and AgiMetaEngineDetection

#define GAL_LOGIC_COUNT                  84
#define GAL_PICTURE_COUNT                84
#define GAL_VIEW_COUNT                   110
#define GAL_SOUND_COUNT                  10

#define GAL_DIR_POSITION_PCJR            0x0500
#define GAL_DIR_POSITION_PC              0x1400
#define GAL_DIR_SIZE                     948

// GAL disk image values and helpers for GalLoader_A2 and AgiMetaEngineDetection

#define GAL_A2_LOGIC_COUNT               81
#define GAL_A2_PICTURE_COUNT             85
#define GAL_A2_VIEW_COUNT                110

#define GAL_A2_LOGDIR_POSITION           A2_DISK_POSITION(18, 7,  2)
#define GAL_A2_PICDIR_POSITION           A2_DISK_POSITION(18, 6,  2)
#define GAL_A2_VIEWDIR_POSITION          A2_DISK_POSITION(18, 8,  2)
#define GAL_A2_WORDS_POSITION            A2_DISK_POSITION(17, 8,  0)
#define GAL_A2_LOGDIR_SIZE               (GAL_A2_LOGIC_COUNT * 3)
#define GAL_A2_DISK_COUNT                3

Common::SeekableReadStream *openPCDiskImage(const Common::Path &path, const Common::FSNode &node);
Common::SeekableReadStream *openA2DiskImage(const Common::Path &path, const Common::FSNode &node, bool loadAllTracks = true);

} // End of namespace Agi

#endif /* AGI_DISK_IMAGE_H */