]> Shamusworld >> Repos - virtualjaguar/blob - src/include/cdi.h
Update for 1.0.6 release
[virtualjaguar] / src / include / cdi.h
1 //
2 // CDI.H: Header file
3 //
4
5 #ifndef __CDI_H__
6 #define __CDI_H__
7
8 #include "jaguar.h"
9 #include "types.h"
10 #include <stdio.h>
11 #include <stdlib.h>
12 #include <fcntl.h>
13
14 struct s_cdi_track
15 {
16         uint8   filename_length;
17         uint32  pregap_length;
18         uint32  length;
19         uint32  mode;
20         uint32  start_lba;
21         uint32  total_length;
22         uint32  sector_size;
23         uint32  sector_size_value;
24         uint32  position;
25 };
26
27 struct s_cdi_session
28 {
29         uint16 nb_of_tracks;
30         s_cdi_track *tracks;
31 };
32
33 struct s_cdi_descriptor
34 {
35         uint32 length;
36         uint32 version;
37         uint32 header_offset;
38         uint16 nb_of_sessions;
39         s_cdi_session *sessions;
40 };
41
42 // Exported variables
43
44 extern int cdi_fp;
45 extern uint32 cdi_load_address;
46 extern uint32 cdi_code_length;
47 extern s_cdi_descriptor * cdi_descriptor;
48 extern s_cdi_track ** cdi_tracks;
49 extern uint32 cdi_tracks_count;
50
51 // Exported functions
52
53 int cdi_open(char * path);
54 void cdi_close(int fp);
55 s_cdi_descriptor * cdi_get_descriptor(int fp, FILE * stdfp);
56 void cdi_dump_descriptor(FILE * fp,s_cdi_descriptor * cdi_descriptor);
57 uint8 * cdi_extract_boot_code(int fp, s_cdi_descriptor * cdi_descriptor);
58 void cdi_load_sector(uint32 sector, uint8 * buffer);
59
60 #endif  // __CDI_H__