Added a new CD-ROM API function.

This commit is contained in:
OBattler 2022-02-14 19:47:48 +01:00
parent 37c77cf0cf
commit 4f1b49f9ad
2 changed files with 27 additions and 0 deletions

View file

@ -695,6 +695,32 @@ cdrom_read_toc(cdrom_t *dev, unsigned char *b, int type, unsigned char start_tra
return len;
}
/* A new API call for Mitsumi CD-ROM. */
void
cdrom_get_track_buffer(cdrom_t *dev, uint8_t *buf)
{
track_info_t ti;
int first_track, last_track;
if (dev != NULL) {
dev->ops->get_tracks(dev, &first_track, &last_track);
buf[0] = 1;
buf[1] = last_track + 1;
dev->ops->get_track_info(dev, 1, 0, &ti);
buf[2] = ti.m;
buf[3] = ti.s;
buf[4] = ti.f;
dev->ops->get_track_info(dev, last_track + 1, 0, &ti);
buf[5] = ti.m;
buf[6] = ti.s;
buf[7] = ti.f;
buf[8] = 0x00;
} else
memset(buf, 0x00, 9);
}
void
cdrom_read_disc_info_toc(cdrom_t *dev, unsigned char *b, unsigned char track, int type)
{

View file

@ -147,6 +147,7 @@ extern uint8_t cdrom_get_current_subchannel(cdrom_t *dev, uint8_t *b, int msf);
extern uint8_t cdrom_get_current_subcodeq_playstatus(cdrom_t *dev, uint8_t *b);
extern int cdrom_read_toc(cdrom_t *dev, unsigned char *b, int type,
unsigned char start_track, int msf, int max_len);
extern void cdrom_get_track_buffer(cdrom_t *dev, uint8_t *buf);
extern int cdrom_readsector_raw(cdrom_t *dev, uint8_t *buffer, int sector, int ismsf,
int cdrom_sector_type, int cdrom_sector_flags, int *len);
extern void cdrom_read_disc_info_toc(cdrom_t *dev, unsigned char *b, unsigned char track, int type);