11#include "accdvd_internal.h"
15static int cddrv_open(
iop_file_t *io,
const char *name,
int flg);
17static int cddrv_read(
iop_file_t *io,
void *buf,
int cnt);
18static int cddrv_write(
iop_file_t *io,
void *buf,
int cnt);
19static int cddrv_lseek(
iop_file_t *io,
int offset,
int whence);
20static int cddrv_ioctl(
iop_file_t *io,
int cmd,
void *arg);
22IOMAN_RETURN_VALUE_IMPL(
EINVAL);
27 IOMAN_RETURN_VALUE(
EINVAL),
34 IOMAN_RETURN_VALUE(
EINVAL),
35 IOMAN_RETURN_VALUE(
EINVAL),
36 IOMAN_RETURN_VALUE(
EINVAL),
37 IOMAN_RETURN_VALUE(
EINVAL),
38 IOMAN_RETURN_VALUE(
EINVAL),
39 IOMAN_RETURN_VALUE(
EINVAL),
40 IOMAN_RETURN_VALUE(
EINVAL),
41 IOMAN_RETURN_VALUE(
EINVAL),
44static iop_device_t Cddrv = {
"cdrom", 16u, 0u,
"ATAPI_C/DVD-ROM", &Cddrv_ops};
60static int cddrv_open(
iop_file_t *io,
const char *name,
int flg)
81 ret_v2 = cdfs_lookup(&dirent, name, strlen(name));
86 ret = cdfs_recover(ret_v2);
88 if ( (dirent.d_ftype & 2) != 0 )
92 v9 = (
struct cdfs_file *)AllocSysMemory(1, 16, 0);
99 v9->f_lsn = dirent.d_lsn;
100 d_size = dirent.d_size;
102 file->f_size = d_size;
117static int cddrv_read(
iop_file_t *io,
void *buf,
int cnt)
124static int cddrv_write(
iop_file_t *io,
void *buf,
int cnt)
133static int cddrv_lseek(
iop_file_t *io,
int offset,
int whence)
142 offset += file->f_pos;
144 else if ( whence == 2 )
148 if ( size < (
unsigned int)offset )
149 offset = file->f_size;
150 file->f_pos = offset;
154static int cddrv_ioctl(
iop_file_t *io,
int cmd,
void *arg)
163int cddrv_module_start(
int argc,
char **argv)
177int cddrv_module_stop()
182 v0 = DelDrv(Cddrv.name);
189int cddrv_module_restart(
int argc,
char **argv)
197int cddrv_module_status()