forked from MiSTer-devel/Main_MiSTer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cd.h
53 lines (43 loc) · 796 Bytes
/
cd.h
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
#ifndef CD_H
#define CD_H
#include <libchdr/chd.h>
#include "file_io.h"
typedef enum
{
SUBCODE_NONE = 0, SUBCODE_RW, SUBCODE_RW_RAW
} cd_subcode_types_t;
typedef struct
{
fileTYPE f;
int offset;
int start;
int end;
int type;
int sector_size;
int index1;
cd_subcode_types_t sbc_type;
} cd_track_t;
typedef struct
{
int end;
int last;
int sectorSize;
chd_file *chd_f;
cd_track_t tracks[100];
fileTYPE sub;
} toc_t;
typedef struct
{
uint8_t m;
uint8_t s;
uint8_t f;
} msf_t;
#define BCD(v) ((uint8_t)((((v)/10) << 4) | ((v)%10)))
typedef int (*SendDataFunc) (uint8_t* buf, int len, uint8_t index);
inline int FindIndexInTOC(toc_t* toc, int lba)
{
int index = 0;
while ((toc->tracks[index].end <= lba) && (index < toc->last)) index++;
return index;
}
#endif