11 #include "accdvd_internal.h"
15 static int cddrv_open(
iop_file_t *io,
const char *name,
int flg);
17 static int cddrv_read(
iop_file_t *io,
void *buf,
int cnt);
18 static int cddrv_write(
iop_file_t *io,
void *buf,
int cnt);
19 static int cddrv_lseek(
iop_file_t *io,
int offset,
int whence);
20 static int cddrv_ioctl(
iop_file_t *io,
int cmd,
void *arg);
22 IOMAN_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),
44 static iop_device_t Cddrv = {
"cdrom", 16u, 0u,
"ATAPI_C/DVD-ROM", &Cddrv_ops};
60 static 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;
117 static int cddrv_read(
iop_file_t *io,
void *buf,
int cnt)
124 static int cddrv_write(
iop_file_t *io,
void *buf,
int cnt)
133 static 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;
154 static int cddrv_ioctl(
iop_file_t *io,
int cmd,
void *arg)
163 int cddrv_module_start(
int argc,
char **argv)
177 int cddrv_module_stop()
182 v0 = DelDrv(Cddrv.name);
189 int cddrv_module_restart(
int argc,
char **argv)
197 int cddrv_module_status()