|
KallistiOS git master
Independent SDK for the Sega Dreamcast
|
GDROM Syscalls and Data Types More...
Data Structures | |
| struct | cd_check_drive_status_t |
| Status filled by Check Drive syscall. More... | |
| struct | cd_read_params_t |
| Params for READ commands. More... | |
| struct | cd_toc_t |
| TOC structure returned by the BIOS. More... | |
| struct | cd_cmd_toc_params_t |
| Params for GETTOC commands. More... | |
| struct | cd_cmd_play_params_t |
| Params for PLAY command. More... | |
| struct | cd_cmd_getscd_params_t |
| Params for GETSCD command. More... | |
| struct | cd_cmd_chk_status_t |
| GDROM Command Extra Status. More... | |
| struct | cd_sec_mode_params_t |
| Sector mode params. More... | |
| struct | cd_transfer_params_t |
| Parameters for transfer. More... | |
Typedefs | |
| typedef int32_t | gdc_cmd_hnd_t |
| Handle for a requested command. | |
Functions | |
| void | syscall_gdrom_init (void) |
| Initialize the GDROM drive. | |
| void | syscall_gdrom_reset (void) |
| Reset the GDROM drive. | |
| int | syscall_gdrom_check_drive (cd_check_drive_status_t *status) |
| Checks the GDROM drive status. | |
| gdc_cmd_hnd_t | syscall_gdrom_send_command (cd_cmd_code_t cmd, void *params) |
| Send a command to the GDROM command queue. | |
| cd_cmd_chk_t | syscall_gdrom_check_command (gdc_cmd_hnd_t hnd, cd_cmd_chk_status_t *status) |
| Check status of queued command for the GDROM. | |
| void | syscall_gdrom_exec_server (void) |
| Process queued GDROM commands. | |
| int | syscall_gdrom_abort_command (gdc_cmd_hnd_t hnd) |
| Abort a queued GDROM command. | |
| int | syscall_gdrom_sector_mode (cd_sec_mode_params_t *mode) |
| Sets/gets the sector mode for read commands. | |
| void | syscall_gdrom_dma_callback (uintptr_t callback, void *param) |
| Setup GDROM DMA callback. | |
| int | syscall_gdrom_dma_transfer (gdc_cmd_hnd_t hnd, const cd_transfer_params_t *params) |
| Initiates a GDROM DMA transfer. | |
| int | syscall_gdrom_dma_check (gdc_cmd_hnd_t hnd, size_t *size) |
| Checks a GDROM DMA transfer. | |
| void | syscall_gdrom_pio_callback (uintptr_t callback, void *param) |
| Setup GDROM PIO callback. | |
| int | syscall_gdrom_pio_transfer (gdc_cmd_hnd_t hnd, const cd_transfer_params_t *params) |
| Initiates a GDROM PIO transfer. | |
| int | syscall_gdrom_pio_check (gdc_cmd_hnd_t hnd, size_t *size) |
| Checks a GDROM PIO transfer. | |
GDROM Syscalls and Data Types
These are the syscalls that allow operation of the GDROM drive as well as data types for their returns and parameters.
| typedef int32_t gdc_cmd_hnd_t |
Handle for a requested command.
This is returned by syscall_gdrom_send_command and then is passed to other syscalls to specify which command to act on.
| enum cd_area_t |
| enum cd_cmd_chk_t |
Responses from GDROM check command syscall.
These are return values of syscall_gdrom_check_command.
| enum cd_cmd_code_t |
Command codes for GDROM syscalls.
These are the syscall command codes used to actually do stuff with the GDROM drive. These were originally provided by maiwe.
| enum cd_disc_types_t |
Disc types the GDROM can identify.
These are the values that can be returned as the second param of syscall_gdrom_check_drive.
| enum cd_read_sec_part_t |
Read Sector Part.
Parts of the a disc sector to read. These are possible values for the second parameter word sent with syscall_gdrom_sector_mode.
| Enumerator | |
|---|---|
| CDROM_READ_WHOLE_SECTOR | Read the whole sector. |
| CDROM_READ_DATA_AREA | Read the data area. |
| CDROM_READ_DEFAULT | cdrom_reinit default |
| enum cd_stat_t |
Status of GDROM drive.
These are the values that can be returned as the first param of syscall_gdrom_check_drive.
| enum cd_sub_audio_t |
Subcode Audio Statuses.
Information about CDDA playback returned by the GETSCD syscall command. This is returned in the second byte of the buffer.
| Enumerator | |
|---|---|
| CD_SUB_AUDIO_STATUS_INVALID | |
| CD_SUB_AUDIO_STATUS_PLAYING | |
| CD_SUB_AUDIO_STATUS_PAUSED | |
| CD_SUB_AUDIO_STATUS_ENDED | |
| CD_SUB_AUDIO_STATUS_ERROR | |
| CD_SUB_AUDIO_STATUS_NO_INFO | |
| enum cd_sub_type_t |
Types of data to read from sector subcode.
Types of data available to read from the sector subcode. These are possible values for the first parameter sent to the GETSCD syscall.
| int syscall_gdrom_abort_command | ( | gdc_cmd_hnd_t | hnd | ) |
Abort a queued GDROM command.
This function tries to abort a previously queued command.
| hnd | The request to abort. |
| cd_cmd_chk_t syscall_gdrom_check_command | ( | gdc_cmd_hnd_t | hnd, |
| cd_cmd_chk_status_t * | status ) |
Check status of queued command for the GDROM.
This function checks if a queued command has completed.
| hnd | The request to check. |
| status | cd_cmd_chk_status_t that will receive the status. |
| CD_CMD_FAILED | Request has failed. |
| CD_CMD_NOT_FOUND | Request not found. |
| CD_CMD_PROCESSING | Request is still being processed. |
| CD_CMD_COMPLETED | Request completed successfully. |
| CD_CMD_STREAMING | Stream type command is in progress. |
| CD_CMD_BUSY | GD syscalls are busy. |
| int syscall_gdrom_check_drive | ( | cd_check_drive_status_t * | status | ) |
Checks the GDROM drive status.
This function retrieves the general condition of the GDROM drive. It populates a provided array with two elements. The first element indicates the current drive status (cd_stat_t), and the second element identifies the type of disc inserted if any (cd_disc_types_t).
| status | A cd_check_drive_status_t filled with drive status information. |
| void syscall_gdrom_dma_callback | ( | uintptr_t | callback, |
| void * | param ) |
Setup GDROM DMA callback.
This function sets up DMA transfer end callback for CMD_DMAREAD_STREAM_EX (dc/cdrom.h).
| callback | The function to call upon completion of the DM. |
| param | The data to pass to the callback function. |
| int syscall_gdrom_dma_check | ( | gdc_cmd_hnd_t | hnd, |
| size_t * | size ) |
Checks a GDROM DMA transfer.
This function checks the progress of a DMA transfer for CMD_DMAREAD_STREAM_EX (see dc/cdrom.h).
| hnd | The stream request to check. |
| size | The pointer to receive the remaining amount of bytes to transfer. |
| 0 | On success. |
| -1 | On failure. |
| int syscall_gdrom_dma_transfer | ( | gdc_cmd_hnd_t | hnd, |
| const cd_transfer_params_t * | params ) |
Initiates a GDROM DMA transfer.
This function initiates a DMA transfer for CMD_DMAREAD_STREAM_EX (dc/cdrom.h).
| hnd | The stream request to start transferring. |
| params | The pointer to a cd_transfer_params_t. |
| void syscall_gdrom_exec_server | ( | void | ) |
Process queued GDROM commands.
This function starts processing queued commands. This must be called a few times to process all commands. An example of it in use can be seen in
| void syscall_gdrom_init | ( | void | ) |
Initialize the GDROM drive.
This function initializes the GDROM drive. Should be called before any commands are sent.
| void syscall_gdrom_pio_callback | ( | uintptr_t | callback, |
| void * | param ) |
Setup GDROM PIO callback.
This function sets up PIO transfer end callback for CMD_PIOREAD_STREAM_EX (see dc/cdrom.h).
| callback | The function to call upon completion of the transfer. |
| param | The data to pass to the callback function. |
| int syscall_gdrom_pio_check | ( | gdc_cmd_hnd_t | hnd, |
| size_t * | size ) |
Checks a GDROM PIO transfer.
This function checks the progress of a PIO transfer for CMD_PIOREAD_STREAM_EX (see dc/cdrom.h).
| hnd | The stream request to check. |
| size | The pointer to receive the remaining amount of bytes to transfer. |
| 0 | On success. |
| -1 | On failure. |
| int syscall_gdrom_pio_transfer | ( | gdc_cmd_hnd_t | hnd, |
| const cd_transfer_params_t * | params ) |
Initiates a GDROM PIO transfer.
This function initiates a PIO transfer for CMD_PIOREAD_STREAM_EX (see dc/cdrom.h).
| hnd | The stream request to start transferring. |
| params | The pointer to a cd_transfer_params_t. |
| void syscall_gdrom_reset | ( | void | ) |
Reset the GDROM drive.
This function resets the GDROM drive.
| int syscall_gdrom_sector_mode | ( | cd_sec_mode_params_t * | mode | ) |
Sets/gets the sector mode for read commands.
This function sets/gets the sector mode for read commands.
| mode | The pointer to a struct of four 32 bit integers containing new values, or to receive the old values. |
| 0 | On success. |
| -1 | On failure. |
| gdc_cmd_hnd_t syscall_gdrom_send_command | ( | cd_cmd_code_t | cmd, |
| void * | params ) |
Send a command to the GDROM command queue.
This function sends a command to the GDROM queue.
| cmd | The command code (see cd_cmd_code_t above). |
| params | The pointer to parameter block for the command, can be NULL if the command does not take parameters. |