cdrom: add PC Engine CD detection

This commit is contained in:
Brad Parker 2019-07-29 15:11:28 -04:00
parent 39187f33b1
commit a191112634
3 changed files with 24 additions and 3 deletions

View File

@ -34,7 +34,8 @@ enum media_detect_cd_system
MEDIA_CD_SYSTEM_SATURN,
MEDIA_CD_SYSTEM_DREAMCAST,
MEDIA_CD_SYSTEM_PSX,
MEDIA_CD_SYSTEM_3DO
MEDIA_CD_SYSTEM_3DO,
MEDIA_CD_SYSTEM_PC_ENGINE_CD
};
typedef struct

View File

@ -265,6 +265,12 @@ bool media_detect_cd_info(const char *path, media_detect_cd_info_t *info)
strlcpy(info->system, "3DO", sizeof(info->system));
}
else if (!memcmp(buf + offset + 0x950, "PC Engine CD-ROM SYSTEM", 23))
{
info->system_id = MEDIA_CD_SYSTEM_PC_ENGINE_CD;
strlcpy(info->system, "TurboGrafx-CD / PC-Engine CD", sizeof(info->system));
}
free(buf);
}

View File

@ -5015,13 +5015,27 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
if (file)
{
const cdrom_toc_t *toc = retro_vfs_file_get_cdrom_toc();
unsigned first_data_track = 1;
atip = cdrom_has_atip(filestream_get_vfs_handle(file));
filestream_close(file);
/* open first track */
cdrom_device_fillpath(file_path, sizeof(file_path), drive, 1, false);
{
unsigned i;
for (i = 0; i < toc->num_tracks; i++)
{
if (!toc->track[i].audio)
{
first_data_track = i + 1;
break;
}
}
}
/* open first data track */
cdrom_device_fillpath(file_path, sizeof(file_path), drive, first_data_track, false);
if (media_detect_cd_info(file_path, &cd_info))
{