diff options
| author | Xavi Del Campo <xavi.dcr@tutanota.com> | 2020-01-31 10:32:23 +0100 |
|---|---|---|
| committer | Xavi Del Campo <xavi.dcr@tutanota.com> | 2020-01-31 10:32:23 +0100 |
| commit | 7c24e9a9b02b04dcaf9507acb94091ea70a2c02d (patch) | |
| tree | c28d0748652ad4b4222309e46e6cfc82c0906220 /libpsx/include/psxcdrom.h | |
| parent | a2b7b6bb1cc2f4a3258b7b2dbc92399d151f864d (diff) | |
| download | psxsdk-7c24e9a9b02b04dcaf9507acb94091ea70a2c02d.tar.gz | |
Imported pristine psxsdk-20190410 from official repo
Diffstat (limited to 'libpsx/include/psxcdrom.h')
| -rw-r--r-- | libpsx/include/psxcdrom.h | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/libpsx/include/psxcdrom.h b/libpsx/include/psxcdrom.h new file mode 100644 index 0000000..2f18e68 --- /dev/null +++ b/libpsx/include/psxcdrom.h @@ -0,0 +1,82 @@ +#ifndef _PSXCDROM_H +#define _PSXCDROM_H + +#define CDSTATUS_PLAY 0x80 +#define CDSTATUS_SEEK 0x40 +#define CDSTATUS_SHELLOPEN 0x10 + +// Command names + +enum +{ + CdlSync = 0, + CdlNop = 1, CdlGetstat = 1, + CdlSetloc = 2, + CdlPlay = 3, + CdlForward = 4, + CdlBackward = 5, + CdlReadN = 6, + CdlStandby = 7, + CdlStop = 8, + CdlPause = 9, + CdlInit = 10, + CdlMute = 11, + CdlDemute = 12, + CdlSetfilter = 13, + CdlSetmode = 14, + CdlSetparam = 15, + CdlGetlocL = 16, + CdlGetlocP = 17, + CdlCmd18 = 18, + CdlGetTN = 19, + CdlGetTD = 20, + CdlSeekL = 21, + CdlSeekP = 22, + CdlCmd23 = 23, + CdlCmd24 = 24, + CdlTest = 25, + CdlID = 26, + CdlReadS = 27, + CdlReset = 28, + CdlCmd29 = 29, + CdlReadTOC = 30 +}; + +/* + * Send a low-level CDROM command + * cmd = command number + * num = number of arguments + * ... = arguments + */ + +void CdSendCommand(int cmd, int num, ...); + +/** + * Reads the results of a low-level CDROM command + * + * @param out Pointer to array of chars where the output will be stored + * @param max Maximum number of bytes to store + * + * Return value: number of results. + */ + +int CdReadResults(unsigned char *out, int max); + +/** + * Gets CDROM drive status + * @return CDROM drive status bitmask + */ + +int CdGetStatus(void); + +/** + * Play an Audio CD track + * @return 1 on success, 0 on failure + */ + +int CdPlayTrack(unsigned int track); + +unsigned char CdRamRead(unsigned short addr); + + +#endif |
