Skip to content

Commit a3d71b2

Browse files
committed
cdrom: Fixed confusion between sessions and areas.
1 parent 65b232b commit a3d71b2

3 files changed

Lines changed: 8 additions & 7 deletions

File tree

kernel/arch/dreamcast/fs/fs_iso9660.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ static int init_percd(void) {
343343
return -1;
344344
}
345345

346-
if((i = cdrom_read_toc(&toc, 0)) != 0)
346+
if((i = cdrom_read_toc(&toc, false)) != 0)
347347
return i;
348348

349349
if(!(session_base = cdrom_locate_data_track(&toc)))

kernel/arch/dreamcast/hardware/cdrom.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,14 +332,14 @@ int cdrom_reinit_ex(int sector_part, int cdxa, int sector_size) {
332332
}
333333

334334
/* Read the table of contents */
335-
int cdrom_read_toc(CDROM_TOC *toc_buffer, int session) {
335+
int cdrom_read_toc(CDROM_TOC *toc_buffer, bool high_density) {
336336
struct {
337-
int session;
337+
int area;
338338
void *buffer;
339339
} params;
340340
int rv;
341341

342-
params.session = session;
342+
params.area = high_density ? 1 : 0;
343343
params.buffer = toc_buffer;
344344

345345
rv = cdrom_exec_cmd(CMD_GETTOC2, &params);

kernel/arch/dreamcast/include/dc/cdrom.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,13 +406,14 @@ int cdrom_reinit_ex(int sector_part, int cdxa, int sector_size);
406406
/** \brief Read the table of contents from the disc.
407407
\ingroup gdrom
408408
409-
This function reads the TOC from the specified session of the disc.
409+
This function reads the TOC from the specified area of the disc.
410+
On regular CD-ROMs, there are only low density area.
410411
411412
\param toc_buffer Space to store the returned TOC in.
412-
\param session The session of the disc to read.
413+
\param high_density Whether to read from the high density area.
413414
\return \ref cd_cmd_response
414415
*/
415-
int cdrom_read_toc(CDROM_TOC *toc_buffer, int session);
416+
int cdrom_read_toc(CDROM_TOC *toc_buffer, bool high_density);
416417

417418
/** \brief Read one or more sector from a CD-ROM.
418419
\ingroup gdrom

0 commit comments

Comments
 (0)