Debian Codegraph @

mednafen/cdrom/lec.h

raw symbols SCIP
1 /* cdrdao - write audio CD-Rs in disc-at-once mode
2 *
3 * Copyright (C) 1998-2002 Andreas Mueller <[email protected]>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19
20 #ifndef __LEC_H__
21 #define __LEC_H__
22
23 #ifdef HAVE_CONFIG_H
24 #include <config.h>
25 #endif
26
27 #include <stdint.h>
28
29 typedef uint32_t u_int32_t;
30 typedef uint16_t u_int16_t;
31 typedef uint8_t u_int8_t;
32
33 #ifndef TRUE
34 #define TRUE 1
35 #endif
36
37 /* Encodes a MODE 0 sector.
38 * 'adr' is the current physical sector address
39 * 'sector' must be 2352 byte wide
40 */
41 void lec_encode_mode0_sector(u_int32_t adr, u_int8_t *sector);
42
43 /* Encodes a MODE 1 sector.
44 * 'adr' is the current physical sector address
45 * 'sector' must be 2352 byte wide containing 2048 bytes user data at
46 * offset 16
47 */
48 void lec_encode_mode1_sector(u_int32_t adr, u_int8_t *sector);
49
50 /* Encodes a MODE 2 sector.
51 * 'adr' is the current physical sector address
52 * 'sector' must be 2352 byte wide containing 2336 bytes user data at
53 * offset 16
54 */
55 void lec_encode_mode2_sector(u_int32_t adr, u_int8_t *sector);
56
57 /* Encodes a XA form 1 sector.
58 * 'adr' is the current physical sector address
59 * 'sector' must be 2352 byte wide containing 2048+8 bytes user data at
60 * offset 16
61 */
62 void lec_encode_mode2_form1_sector(u_int32_t adr, u_int8_t *sector);
63
64 /* Encodes a XA form 2 sector.
65 * 'adr' is the current physical sector address
66 * 'sector' must be 2352 byte wide containing 2324+8 bytes user data at
67 * offset 16
68 */
69 void lec_encode_mode2_form2_sector(u_int32_t adr, u_int8_t *sector);
70
71 /* Scrambles and byte swaps an encoded sector.
72 * 'sector' must be 2352 byte wide.
73 */
74 void lec_scramble(u_int8_t *sector);
75
76 #endif