Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alexbevi
GitHub Repository: alexbevi/BizHawk
Path: blob/master/psx/octoshock/cdrom/lec.h
2 views
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 <sys/types.h>
28
#include <inttypes.h>
29
30
typedef uint32_t u_int32_t;
31
typedef uint16_t u_int16_t;
32
typedef uint8_t u_int8_t;
33
34
#ifndef TRUE
35
#define TRUE 1
36
#endif
37
38
/* Encodes a MODE 0 sector.
39
* 'adr' is the current physical sector address
40
* 'sector' must be 2352 byte wide
41
*/
42
void lec_encode_mode0_sector(u_int32_t adr, u_int8_t *sector);
43
44
/* Encodes a MODE 1 sector.
45
* 'adr' is the current physical sector address
46
* 'sector' must be 2352 byte wide containing 2048 bytes user data at
47
* offset 16
48
*/
49
void lec_encode_mode1_sector(u_int32_t adr, u_int8_t *sector);
50
51
/* Encodes a MODE 2 sector.
52
* 'adr' is the current physical sector address
53
* 'sector' must be 2352 byte wide containing 2336 bytes user data at
54
* offset 16
55
*/
56
void lec_encode_mode2_sector(u_int32_t adr, u_int8_t *sector);
57
58
/* Encodes a XA form 1 sector.
59
* 'adr' is the current physical sector address
60
* 'sector' must be 2352 byte wide containing 2048+8 bytes user data at
61
* offset 16
62
*/
63
void lec_encode_mode2_form1_sector(u_int32_t adr, u_int8_t *sector);
64
65
/* Encodes a XA form 2 sector.
66
* 'adr' is the current physical sector address
67
* 'sector' must be 2352 byte wide containing 2324+8 bytes user data at
68
* offset 16
69
*/
70
void lec_encode_mode2_form2_sector(u_int32_t adr, u_int8_t *sector);
71
72
/* Scrambles and byte swaps an encoded sector.
73
* 'sector' must be 2352 byte wide.
74
*/
75
void lec_scramble(u_int8_t *sector);
76
77
#endif
78
79