From: kosmirror <kos...@us...> - 2025-06-18 20:29:00
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via 9e6dc6e35cf72f458c459a2880050dabcc1fef4c (commit) from 65b232b0fc206eb9dfd4705d460a9f29fc942839 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 9e6dc6e35cf72f458c459a2880050dabcc1fef4c Author: DC-SWAT <sw...@21...> Date: Sat Jun 14 09:40:50 2025 +0700 cdrom: Fixed confusion between sessions and areas. GD-ROM drive does not differentiate sessions at all. This TOC is always divided into two, for the low-density area and the high-density area, which is only on the GD-ROM disc. And in fact, this is one and the same TOC, itâs just that for non-requested area the tracks are erased (and first/last changed) in this common TOC, because the tracks numbering remains the same. There may be multiple sessions in one area, but there is no division between them. ----------------------------------------------------------------------- Summary of changes: kernel/arch/dreamcast/fs/fs_iso9660.c | 2 +- kernel/arch/dreamcast/hardware/cdrom.c | 6 +++--- kernel/arch/dreamcast/include/dc/cdrom.h | 7 ++++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/kernel/arch/dreamcast/fs/fs_iso9660.c b/kernel/arch/dreamcast/fs/fs_iso9660.c index e0f8b435..c8a1aaba 100644 --- a/kernel/arch/dreamcast/fs/fs_iso9660.c +++ b/kernel/arch/dreamcast/fs/fs_iso9660.c @@ -343,7 +343,7 @@ static int init_percd(void) { return -1; } - if((i = cdrom_read_toc(&toc, 0)) != 0) + if((i = cdrom_read_toc(&toc, false)) != 0) return i; if(!(session_base = cdrom_locate_data_track(&toc))) diff --git a/kernel/arch/dreamcast/hardware/cdrom.c b/kernel/arch/dreamcast/hardware/cdrom.c index d76692e4..46d9551d 100644 --- a/kernel/arch/dreamcast/hardware/cdrom.c +++ b/kernel/arch/dreamcast/hardware/cdrom.c @@ -332,14 +332,14 @@ int cdrom_reinit_ex(int sector_part, int cdxa, int sector_size) { } /* Read the table of contents */ -int cdrom_read_toc(CDROM_TOC *toc_buffer, int session) { +int cdrom_read_toc(CDROM_TOC *toc_buffer, bool high_density) { struct { - int session; + int area; void *buffer; } params; int rv; - params.session = session; + params.area = high_density ? 1 : 0; params.buffer = toc_buffer; rv = cdrom_exec_cmd(CMD_GETTOC2, ¶ms); diff --git a/kernel/arch/dreamcast/include/dc/cdrom.h b/kernel/arch/dreamcast/include/dc/cdrom.h index 828e3bc2..9511bfa0 100644 --- a/kernel/arch/dreamcast/include/dc/cdrom.h +++ b/kernel/arch/dreamcast/include/dc/cdrom.h @@ -406,13 +406,14 @@ int cdrom_reinit_ex(int sector_part, int cdxa, int sector_size); /** \brief Read the table of contents from the disc. \ingroup gdrom - This function reads the TOC from the specified session of the disc. + This function reads the TOC from the specified area of the disc. + On regular CD-ROMs, there are only low density area. \param toc_buffer Space to store the returned TOC in. - \param session The session of the disc to read. + \param high_density Whether to read from the high density area. \return \ref cd_cmd_response */ -int cdrom_read_toc(CDROM_TOC *toc_buffer, int session); +int cdrom_read_toc(CDROM_TOC *toc_buffer, bool high_density); /** \brief Read one or more sector from a CD-ROM. \ingroup gdrom hooks/post-receive -- A pseudo Operating System for the Dreamcast. |