mirror of
https://github.com/libretro/libretro-common.git
synced 2025-02-25 19:20:39 +00:00
Update
This commit is contained in:
parent
a205a1bf69
commit
0e069748e0
@ -1682,6 +1682,8 @@ static chd_error hunk_read_into_memory(chd_file *chd, UINT32 hunknum, UINT8 *des
|
||||
bytes = read_compressed(chd, blockoffs, blocklen);
|
||||
if (bytes == NULL)
|
||||
return CHDERR_READ_ERROR;
|
||||
if (!chd->codecintf[rawmap[0]])
|
||||
return CHDERR_UNSUPPORTED_FORMAT;
|
||||
switch (chd->codecintf[rawmap[0]]->compression)
|
||||
{
|
||||
case CHD_CODEC_CD_LZMA:
|
||||
|
@ -31,25 +31,31 @@ RETRO_BEGIN_DECLS
|
||||
* of a CD (following the ISO-9660 directory structure definition)
|
||||
*/
|
||||
|
||||
typedef struct cdfs_track_t
|
||||
{
|
||||
intfstream_t* stream;
|
||||
unsigned int stream_sector_size;
|
||||
unsigned int stream_sector_header_size;
|
||||
unsigned int pregap_sectors;
|
||||
} cdfs_track_t;
|
||||
|
||||
typedef struct cdfs_file_t
|
||||
{
|
||||
int first_sector;
|
||||
int current_sector;
|
||||
unsigned int current_sector_offset;
|
||||
int sector_buffer_valid;
|
||||
unsigned int stream_sector_size;
|
||||
unsigned int stream_sector_header_size;
|
||||
unsigned int size;
|
||||
unsigned int pos;
|
||||
intfstream_t* stream;
|
||||
uint8_t sector_buffer[2048];
|
||||
struct cdfs_track_t* track;
|
||||
} cdfs_file_t;
|
||||
|
||||
/* opens the specified file within the CD or virtual CD.
|
||||
* if path is NULL, will open the raw CD (useful for reading CD without having to worry about sector sizes,
|
||||
* headers, or checksum data)
|
||||
*/
|
||||
int cdfs_open_file(cdfs_file_t* file, intfstream_t* stream, const char* path);
|
||||
int cdfs_open_file(cdfs_file_t* file, cdfs_track_t* stream, const char* path);
|
||||
|
||||
void cdfs_close_file(cdfs_file_t* file);
|
||||
|
||||
@ -61,6 +67,8 @@ int64_t cdfs_tell(cdfs_file_t* file);
|
||||
|
||||
int64_t cdfs_seek(cdfs_file_t* file, int64_t offset, int whence);
|
||||
|
||||
void cdfs_seek_sector(cdfs_file_t* file, unsigned int sector);
|
||||
|
||||
/* opens the specified track in a CD or virtual CD file - the resulting stream should be passed to
|
||||
* cdfs_open_file to get access to a file within the CD.
|
||||
*
|
||||
@ -75,11 +83,11 @@ int64_t cdfs_seek(cdfs_file_t* file, int64_t offset, int whence);
|
||||
* MODE1/2048 - untested
|
||||
* MODE2/2336 - untested
|
||||
*/
|
||||
intfstream_t* cdfs_open_track(const char* path, unsigned int track_index);
|
||||
cdfs_track_t* cdfs_open_track(const char* path, unsigned int track_index);
|
||||
|
||||
/* opens the first data track in a CD or virtual CD file. see cdfs_open_track for supported file formats
|
||||
*/
|
||||
intfstream_t* cdfs_open_data_track(const char* path);
|
||||
cdfs_track_t* cdfs_open_data_track(const char* path);
|
||||
|
||||
/* opens a raw track file for a CD or virtual CD.
|
||||
*
|
||||
@ -89,7 +97,10 @@ intfstream_t* cdfs_open_data_track(const char* path);
|
||||
* bin - path will point to the bin file
|
||||
* iso - path will point to the iso file
|
||||
*/
|
||||
intfstream_t* cdfs_open_raw_track(const char* path);
|
||||
cdfs_track_t* cdfs_open_raw_track(const char* path);
|
||||
|
||||
/* closes the CD or virtual CD track and frees the associated memory */
|
||||
void cdfs_close_track(cdfs_track_t* track);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
|
@ -2524,7 +2524,7 @@ struct retro_core_option_display
|
||||
/* Maximum number of values permitted for a core option
|
||||
* NOTE: This may be increased on a core-by-core basis
|
||||
* if required (doing so has no effect on the frontend) */
|
||||
#define RETRO_NUM_CORE_OPTION_VALUES_MAX 192
|
||||
#define RETRO_NUM_CORE_OPTION_VALUES_MAX 128
|
||||
|
||||
struct retro_core_option_value
|
||||
{
|
||||
|
@ -57,6 +57,8 @@ int64_t chdstream_seek(chdstream_t *stream, int64_t offset, int whence);
|
||||
|
||||
ssize_t chdstream_get_size(chdstream_t *stream);
|
||||
|
||||
uint32_t chdstream_get_pregap(chdstream_t* stream);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
|
@ -96,6 +96,8 @@ int64_t intfstream_get_size(intfstream_internal_t *intf);
|
||||
|
||||
int intfstream_flush(intfstream_internal_t *intf);
|
||||
|
||||
uint32_t intfstream_get_chd_pregap(intfstream_internal_t *intf);
|
||||
|
||||
intfstream_t* intfstream_open_file(const char *path,
|
||||
unsigned mode, unsigned hints);
|
||||
|
||||
|
@ -426,5 +426,22 @@ int64_t chdstream_seek(chdstream_t *stream, int64_t offset, int whence)
|
||||
|
||||
ssize_t chdstream_get_size(chdstream_t *stream)
|
||||
{
|
||||
return stream->track_end;
|
||||
return stream->track_end;
|
||||
}
|
||||
|
||||
uint32_t chdstream_get_pregap(chdstream_t *stream)
|
||||
{
|
||||
metadata_t meta;
|
||||
uint32_t frame_offset = 0;
|
||||
uint32_t i;
|
||||
|
||||
for (i = 0; chdstream_get_meta(stream->chd, i, &meta); ++i)
|
||||
{
|
||||
if (stream->track_frame == frame_offset)
|
||||
return meta.pregap;
|
||||
|
||||
frame_offset += meta.frames + meta.extra;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -421,6 +421,16 @@ void intfstream_putc(intfstream_internal_t *intf, int c)
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t intfstream_get_chd_pregap(intfstream_internal_t *intf)
|
||||
{
|
||||
#ifdef HAVE_CHD
|
||||
if (intf->type == INTFSTREAM_CHD)
|
||||
return chdstream_get_pregap(intf->chd.fp);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
intfstream_t* intfstream_open_file(const char *path,
|
||||
unsigned mode, unsigned hints)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user