@@ -31,25 +31,31 @@ RETRO_BEGIN_DECLS
3131 * of a CD (following the ISO-9660 directory structure definition)
3232 */
3333
34+ typedef struct cdfs_track_t
35+ {
36+ intfstream_t * stream ;
37+ unsigned int stream_sector_size ;
38+ unsigned int stream_sector_header_size ;
39+ unsigned int pregap_sectors ;
40+ } cdfs_track_t ;
41+
3442typedef struct cdfs_file_t
3543{
3644 int first_sector ;
3745 int current_sector ;
3846 unsigned int current_sector_offset ;
3947 int sector_buffer_valid ;
40- unsigned int stream_sector_size ;
41- unsigned int stream_sector_header_size ;
4248 unsigned int size ;
4349 unsigned int pos ;
44- intfstream_t * stream ;
4550 uint8_t sector_buffer [2048 ];
51+ struct cdfs_track_t * track ;
4652} cdfs_file_t ;
4753
4854/* opens the specified file within the CD or virtual CD.
4955 * if path is NULL, will open the raw CD (useful for reading CD without having to worry about sector sizes,
5056 * headers, or checksum data)
5157 */
52- int cdfs_open_file (cdfs_file_t * file , intfstream_t * stream , const char * path );
58+ int cdfs_open_file (cdfs_file_t * file , cdfs_track_t * stream , const char * path );
5359
5460void cdfs_close_file (cdfs_file_t * file );
5561
@@ -61,6 +67,8 @@ int64_t cdfs_tell(cdfs_file_t* file);
6167
6268int64_t cdfs_seek (cdfs_file_t * file , int64_t offset , int whence );
6369
70+ void cdfs_seek_sector (cdfs_file_t * file , unsigned int sector );
71+
6472/* opens the specified track in a CD or virtual CD file - the resulting stream should be passed to
6573 * cdfs_open_file to get access to a file within the CD.
6674 *
@@ -75,11 +83,11 @@ int64_t cdfs_seek(cdfs_file_t* file, int64_t offset, int whence);
7583 * MODE1/2048 - untested
7684 * MODE2/2336 - untested
7785 */
78- intfstream_t * cdfs_open_track (const char * path , unsigned int track_index );
86+ cdfs_track_t * cdfs_open_track (const char * path , unsigned int track_index );
7987
8088/* opens the first data track in a CD or virtual CD file. see cdfs_open_track for supported file formats
8189 */
82- intfstream_t * cdfs_open_data_track (const char * path );
90+ cdfs_track_t * cdfs_open_data_track (const char * path );
8391
8492/* opens a raw track file for a CD or virtual CD.
8593 *
@@ -89,7 +97,10 @@ intfstream_t* cdfs_open_data_track(const char* path);
8997 * bin - path will point to the bin file
9098 * iso - path will point to the iso file
9199 */
92- intfstream_t * cdfs_open_raw_track (const char * path );
100+ cdfs_track_t * cdfs_open_raw_track (const char * path );
101+
102+ /* closes the CD or virtual CD track and frees the associated memory */
103+ void cdfs_close_track (cdfs_track_t * track );
93104
94105RETRO_END_DECLS
95106
0 commit comments