CD access to the GD-ROM drive. More...
|TOC structure returned by the BIOS. More...|
|Read via PIO. |
|Read via DMA. |
|Read TOC. |
|Read TOC. |
|Play track. |
|Play sectors. |
|Pause playback. |
|Resume from pause. |
|Initialize the drive. |
|Seek to a new position. |
|Read raw sectors. |
|Stop the disc from spinning. |
|Get subcode data. |
|Get session. |
|No error. |
|No disc in drive. |
|Disc changed, but not reinitted yet. |
|System error. |
|Command aborted. |
|System inactive? |
|Command failed. |
|System inactive? |
|Processing command. |
|Command completed successfully. |
|Command aborted before completion. |
|Play by track number. |
|Play by sector number. |
|Drive is busy. |
|Disc is paused. |
|Drive is in standby. |
|Drive is currently playing. |
|Drive is currently seeking. |
|Drive is scanning. |
|Disc tray is open. |
|No disc inserted. |
|Audio CD (Red book) |
|CD-ROM or CD-R (Yellow book) |
|CD-ROM XA (Yellow book extension) |
|CD-i (Green book) |
|#define||TOC_LBA(n) ((n) & 0x00ffffff)|
|Get the FAD address of a TOC entry. |
|#define||TOC_ADR(n) ( ((n) & 0x0f000000) >> 24 )|
|Get the address of a TOC entry. |
|#define||TOC_CTRL(n) ( ((n) & 0xf0000000) >> 28 )|
|Get the control data of a TOC entry. |
|#define||TOC_TRACK(n) ( ((n) & 0x00ff0000) >> 16 )|
|Get the track number of a TOC entry. |
|void||cdrom_set_sector_size (int size)|
|Set the sector size for read sectors. |
|int||cdrom_exec_cmd (int cmd, void *param)|
|Execute a CD-ROM command. |
|int||cdrom_get_status (int *status, int *disc_type)|
|Get the status of the GD-ROM drive. |
|Re-initialize the GD-ROM drive. |
|int||cdrom_read_toc (CDROM_TOC *toc_buffer, int session)|
|Read the table of contents from the disc. |
|int||cdrom_read_sectors (void *buffer, int sector, int cnt)|
|Read one or more sector from a CD-ROM. |
|uint32||cdrom_locate_data_track (CDROM_TOC *toc)|
|Locate the sector of the data track. |
|int||cdrom_cdda_play (uint32 start, uint32 end, uint32 loops, int mode)|
|Play CDDA audio tracks or sectors. |
|Pause CDDA audio playback. |
|Resume CDDA audio playback after a pause. |
|Spin down the CD. |
|Initialize the GD-ROM for reading CDs. |
|Shutdown the CD reading system. |
CD access to the GD-ROM drive.
This file contains the interface to the Dreamcast's GD-ROM drive. It is simply called cdrom.h and cdrom.c because, by design, you cannot directly use this code to read the high-density area of GD-ROMs. This is the way it always has been, and always will be.
The way things are set up, as long as you're using fs_iso9660 to access the CD, it will automatically detect and react to disc changes for you.
This file only facilitates reading raw sectors and doing other fairly low- level things with CDs. If you're looking for higher-level stuff, like normal file reading, consult with the stuff for the fs and for fs_iso9660.
Pause CDDA audio playback.
Play CDDA audio tracks or sectors.
This function starts playback of CDDA audio.
|start||The track or sector to start playback from.|
|end||The track or sector to end playback at.|
|loops||The number of times to repeat (max of 15).|
|mode||The mode to play (see CDDA read modes).|
Resume CDDA audio playback after a pause.
Execute a CD-ROM command.
This function executes the specified command using the BIOS syscall for executing GD-ROM commands.
|cmd||The command number to execute.|
|param||Data to pass to the syscall.|
|int cdrom_get_status||(||int *||status,|
Initialize the GD-ROM for reading CDs.
This initializes the CD-ROM reading system, reactivating the drive and handling initial setup of the disc.
|-1||If cdrom_init() has already been called.|
Locate the sector of the data track.
This function will search the toc for the last entry that has a CTRL value of 4, and return its FAD address.
|toc||The TOC to search through.|
|int cdrom_read_sectors||(||void *||buffer,|
Read one or more sector from a CD-ROM.
This function reads the specified number of sectors from the disc, starting where requested. This will respect the size of the sectors set with cdrom_set_sector_size(). The buffer must have enough space to store the specified number of sectors.
|buffer||Space to store the read sectors.|
|sector||The sector to start reading from.|
|cnt||The number of sectors to read.|
|int cdrom_read_toc||(||CDROM_TOC *||toc_buffer,|
Read the table of contents from the disc.
This function reads the TOC from the specified session of the disc.
|toc_buffer||Space to store the returned TOC in.|
|session||The session of the disc to read.|
Re-initialize the GD-ROM drive.
This function is for reinitializing the GD-ROM drive after a disc change, or something of the like.
Set the sector size for read sectors.
This function sets the sector size that the cdrom_read_sectors() function will return. Be sure to set this to the correct value for the type of sectors you're trying to read. Common values are 2048 (for reading CD-ROM sectors) or 2352 (for reading raw sectors).
|size||The size of the sector data.|
Shutdown the CD reading system.
Spin down the CD.
This stops the disc in the drive from spinning until it is accessed again.