Libdream provides the capability to use CD and CDR discs in the GD-Rom drive using this module.
Note that this file has been specifically crippled (or rather, we just never wrote it in) so that it can't access Sega's GD discs. This means that you can't access the data on any commercial game. There are really only a few legitimate reasons for doing this so we've disabled the feature to avoid coming under fire for assisting with copyright infringement. If you really want to know how, I'm sure you can figure it out =).
The following functions are available:
Open a file on the CD, using absolute path ``path'', with open flags ``oflag''. Note that in the current system, ``path'' must use forward slashes for path seperators (but can mix upper and lower case freely with no troubles), and ``oflag'' must be O_RDONLY or (O_RDONLY | O_DIR). A file descriptor will be returned, or a zero on error.
Close the file referenced by the given file descriptor.
Read ``nbyte'' bytes from the file referenced by ``fd'', into buffer ``buf''. Note that this function will always read the surrounding 2048 byte sector before extracting the parts you want, so you should never read less than 2048 bytes unless that's all you want. Reading more than 2048 does work. The number of bytes read will be returned.
Seek in file ``fd'' by ``offset'' bytes, relative to ``whence''. ``whence'' is one of the standard STDIO constants: SEEK_SET, SEEK_CUR, SEEK_END. ``offset'' may be positive or negative depending on the usage. The new file location will be returned.
Returns the current file pointer within ``fd''.
Read the next entry (if any) from the opened directory. Returns a pointer to a dirent_t on success (see fs_iso9660.h for more info on dirent_t) or NULL if nothing is left.
Initialize the GD-Rom drive for reading CD/CDR media, and initialize the file system driver.