PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
accdvd_internal.h
1/*
2# _____ ___ ____ ___ ____
3# ____| | ____| | | |____|
4# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5#-----------------------------------------------------------------------
6# Copyright ps2dev - http://www.ps2dev.org
7# Licenced under Academic Free License version 2.0
8# Review ps2sdk README & LICENSE files for further details.
9*/
10
11#ifndef _ACCDVD_INTERNAL_H
12#define _ACCDVD_INTERNAL_H
13
14#include <accdvd.h>
15#include <errno.h>
16#include <irx_imports.h>
17
18typedef acUint32 acd_lsn_t;
19
20struct acd;
21
22typedef void (*acd_done_t)(struct acd *acd, void *arg, int ret);
23
24struct acd
25{
26 acAtapiData c_atapi;
27 acd_done_t c_done;
28 void *c_arg;
29 acInt32 c_thid;
30 acInt32 c_tmout;
31};
32
33typedef void (*cdc_done_t)(int eveid);
34
36{
37 acUint8 *buf;
38 acInt32 size;
39 acInt32 bsize;
40 acInt32 pos;
41 acInt32 bank;
42 acd_lsn_t lsn;
43 cdc_xfer_t xfer;
44 acInt16 spindle;
45 acUint16 maxspeed;
46};
47
49{
50 acUint8 *buf;
51 acInt32 size;
52 acInt32 bsize;
53 acInt32 head;
54 acInt32 tail;
55 acd_lsn_t lsn;
56 acUint32 reqlsn;
57 acInt32 flag;
58};
59
61{
62 acInt32 lockid;
63 acInt32 syncid;
64 acInt32 error;
65 acCdvdsifId fno;
66 acUint8 *buf;
67 cdc_done_t done;
68 acUint32 cdsize;
69 acUint16 tray;
70 acUint16 stat;
71 struct cdc_read_stru rd;
72 struct cdc_stream_stru st;
73 struct acd acd;
74};
75
77{
78 // cppcheck-suppress unusedStructMember
79 unsigned char type[1];
80 // cppcheck-suppress unusedStructMember
81 unsigned char id[5];
82 // cppcheck-suppress unusedStructMember
83 unsigned char version[1];
84 // cppcheck-suppress unusedStructMember
85 unsigned char unused1[1];
86 // cppcheck-suppress unusedStructMember
87 unsigned char system_id[32];
88 // cppcheck-suppress unusedStructMember
89 unsigned char volume_id[32];
90 // cppcheck-suppress unusedStructMember
91 unsigned char unused2[8];
92 // cppcheck-suppress unusedStructMember
93 unsigned char volume_space_size[8];
94 // cppcheck-suppress unusedStructMember
95 unsigned char unused3[32];
96 // cppcheck-suppress unusedStructMember
97 unsigned char volume_set_size[4];
98 // cppcheck-suppress unusedStructMember
99 unsigned char volume_sequence_number[4];
100 // cppcheck-suppress unusedStructMember
101 unsigned char logical_block_size[4];
102 // cppcheck-suppress unusedStructMember
103 unsigned char path_table_size[8];
104 // cppcheck-suppress unusedStructMember
105 unsigned char type_l_path_table[4];
106 // cppcheck-suppress unusedStructMember
107 unsigned char opt_type_l_path_table[4];
108 // cppcheck-suppress unusedStructMember
109 unsigned char type_m_path_table[4];
110 // cppcheck-suppress unusedStructMember
111 unsigned char opt_type_m_path_table[4];
112 // cppcheck-suppress unusedStructMember
113 unsigned char root_directory_record[34];
114 // cppcheck-suppress unusedStructMember
115 unsigned char volume_set_id[128];
116 // cppcheck-suppress unusedStructMember
117 unsigned char publisher_id[128];
118 // cppcheck-suppress unusedStructMember
119 unsigned char preparer_id[128];
120 // cppcheck-suppress unusedStructMember
121 unsigned char application_id[128];
122 // cppcheck-suppress unusedStructMember
123 unsigned char copyright_file_id[37];
124 // cppcheck-suppress unusedStructMember
125 unsigned char abstract_file_id[37];
126 // cppcheck-suppress unusedStructMember
127 unsigned char bibliographic_file_id[37];
128 // cppcheck-suppress unusedStructMember
129 unsigned char creation_date[17];
130 // cppcheck-suppress unusedStructMember
131 unsigned char modification_date[17];
132 // cppcheck-suppress unusedStructMember
133 unsigned char expiration_date[17];
134 // cppcheck-suppress unusedStructMember
135 unsigned char effective_date[17];
136 // cppcheck-suppress unusedStructMember
137 unsigned char file_structure_version[1];
138 // cppcheck-suppress unusedStructMember
139 unsigned char unused4[1];
140 // cppcheck-suppress unusedStructMember
141 unsigned char application_data[512];
142 // cppcheck-suppress unusedStructMember
143 unsigned char unused5[653];
144};
145
147{
148 unsigned char length[1];
149 unsigned char ext_attr_length[1];
150 unsigned char extent[8];
151 unsigned char size[8];
152 unsigned char date[7];
153 unsigned char flags[1];
154 unsigned char file_unit_size[1];
155 unsigned char interleave[1];
156 unsigned char volume_sequence_number[4];
157 unsigned char name_len[1];
158 unsigned char name[];
159};
160
162{
163 unsigned char name_len[2];
164 unsigned char extent[4];
165 unsigned char parent[2];
166 unsigned char name[];
167};
168
170{
171 struct iso9660_path *path;
172 acUint32 size;
173};
174
176{
177 acInt32 semid;
178 acUint32 all;
179 struct cdfs_ptable *ptable;
180 acInt32 ptnum;
181 acUint32 rootlsn;
182 acUint32 rootsize;
183 acInt32 rootidx;
184 struct iso9660_dirent *dcache;
185 acUint32 dclsn;
186 acUint32 dcsize;
187 struct iso9660_path *pcache;
188 acUint32 pcsize;
189 // cppcheck-suppress unusedStructMember
190 acInt32 padding[4];
191 acUint8 buf[2048];
192};
193
195{
196 acUint8 h_len[2];
197 acUint8 h_mtype;
198 // cppcheck-suppress unusedStructMember
199 acUint8 h_nblocks;
200 // cppcheck-suppress unusedStructMember
201 acUint8 h_padding[4];
202};
203
205{
206 // cppcheck-suppress unusedStructMember
207 acUint8 d_pgcode;
208 // cppcheck-suppress unusedStructMember
209 acUint8 d_pglen;
210};
211
213{
214 struct atapi_mode_h me_h;
215 // cppcheck-suppress unusedStructMember
216 struct atapi_mode me_d;
217 // cppcheck-suppress unusedStructMember
218 acUint8 me_param;
219 acUint8 me_rretry;
220 // cppcheck-suppress unusedStructMember
221 acUint8 me_unused1[4];
222 // cppcheck-suppress unusedStructMember
223 acUint8 me_wretry;
224 // cppcheck-suppress unusedStructMember
225 acUint8 me_unused2[3];
226};
227
229{
230 struct atapi_mode_h md_h;
231 // cppcheck-suppress unusedStructMember
232 struct atapi_mode md_d;
233 // cppcheck-suppress unusedStructMember
234 acUint8 md_unused;
235 acUint8 md_timer;
236 // cppcheck-suppress unusedStructMember
237 acUint8 md_spm[2];
238 // cppcheck-suppress unusedStructMember
239 acUint8 md_fps[2];
240};
241
243{
244 struct atapi_mode_h mc_h;
245 // cppcheck-suppress unusedStructMember
246 struct atapi_mode mc_d;
247 // cppcheck-suppress unusedStructMember
248 acUint8 mc_mer;
249 // cppcheck-suppress unusedStructMember
250 acUint8 mc_padding;
251 // cppcheck-suppress unusedStructMember
252 acUint8 mc_cap[4];
253 acUint8 mc_maxspeed[2];
254 // cppcheck-suppress unusedStructMember
255 acUint8 mc_novl[2];
256 // cppcheck-suppress unusedStructMember
257 acUint8 mc_bufsize[2];
258 acUint8 mc_speed[2];
259 // cppcheck-suppress unusedStructMember
260 acUint8 mc_padding2;
261 // cppcheck-suppress unusedStructMember
262 acUint8 mc_flags2;
263 // cppcheck-suppress unusedStructMember
264 acUint8 mc_padding3[2];
265};
266
268{
269 acUint8 lba[4];
270 // cppcheck-suppress unusedStructMember
271 acUint8 blen[4];
272};
273
275{
276 acInt32 active;
277 acUint32 status;
278 acUint32 drive;
279 acCdvdsifId dma;
280 acCdvdsifId medium;
281 acInt32 sense;
282 acUint32 dmamap;
283 acUint32 padding;
284 struct atapi_mode_drive timer;
285 struct atapi_mode_error retry;
286 struct atapi_mode_capmach speed;
287};
288
290{
291 acUint8 t_padding;
292 acUint8 t_sec;
293 acUint8 t_min;
294 acUint8 t_hour;
295 acUint8 t_day;
296 acUint8 t_mon;
297 acUint16 t_year;
298};
299
301{
302 acUint32 d_lsn;
303 acUint32 d_size;
304 acUint32 d_vol;
305 // cppcheck-suppress unusedStructMember
306 acUint32 d_padding;
307 acUint8 d_ftype;
308 acUint8 d_namlen;
309 char d_name[14];
310 struct cdfs_time d_time;
311};
312
314{
315 acUint32 f_lsn;
316 acUint32 f_pos;
317 acUint32 f_size;
318 acUint32 f_padding;
319};
320
322{
323 int (*cm_restart)(int argc, char **argv);
324 int (*cm_start)(int argc, char **argv);
325 int (*cm_status)();
326 int (*cm_stop)();
327};
328
330{
331 int (*start)(int argc, char **argv);
332 int (*stop)();
333 int (*status)();
334};
335
337{
338 acAtaData a_ata;
339 acInt32 a_thid;
340 acInt32 a_result;
341 acUint32 a_padding[2];
342};
343
345{
346 // cppcheck-suppress unusedStructMember
347 acInt32 error;
348 cdc_done_t done;
349 // cppcheck-suppress unusedStructMember
350 acUint32 padding[2];
351};
352
353extern struct acd *acd_setup(struct acd *acd, acd_done_t done, void *arg, int tmout);
354extern int acd_module_status();
355extern int acd_module_start(int argc, char **argv);
356extern int acd_module_stop();
357extern int acd_module_restart(int argc, char **argv);
358extern int cddrv_module_start(int argc, char **argv);
359extern int cddrv_module_stop();
360extern int cddrv_module_restart(int argc, char **argv);
361extern int cddrv_module_status();
362extern int cdfs_umount();
363extern int cdfs_recover(int ret);
364extern int cdfs_lookup(struct cdfs_dirent *result, const char *path, int pathlen);
365extern int cdfs_read(struct cdfs_file *file, void *buf, int size);
366extern int cdfs_module_status();
367extern int cdfs_module_start(int argc, char **argv);
368extern int cdfs_module_stop();
369extern int cdfs_module_restart(int argc, char **argv);
370
371extern int acd_ready(struct acd *acd);
372extern int acd_readcapacity();
373extern int acd_delay();
374extern int acd_getmedium(struct acd *acd);
375extern acCdvdsifId acd_gettray();
376extern int acd_getstatus();
377extern int acd_readtoc(struct acd *acd, void *buf, int size);
378extern int acd_seek(struct acd *acd, acd_lsn_t lsn);
379extern int acd_ioctl(struct acd *acd, int cmd);
380extern int acd_getspeed(struct acd *acd, int maxspeed);
381extern int acd_setspeed(struct acd *acd, int speed);
382extern int acd_setretry(struct acd *acd, int rretry);
383extern int acd_getretry(struct acd *acd);
384extern int acd_read(struct acd *acd, acd_lsn_t lsn, void *buf, int sectors);
385
386#endif
Definition acata.h:46