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);
21static int cddrv_dummy();
42static iop_device_t Cddrv = {
"cdrom", 16u, 0u,
"ATAPI_C/DVD-ROM", &Cddrv_ops};
58static int cddrv_open(
iop_file_t *io,
const char *name,
int flg)
79 ret_v2 = cdfs_lookup(&dirent, name, strlen(name));
84 ret = cdfs_recover(ret_v2);
86 if ( (dirent.d_ftype & 2) != 0 )
90 v9 = (
struct cdfs_file *)AllocSysMemory(1, 16, 0);
97 v9->f_lsn = dirent.d_lsn;
98 d_size = dirent.d_size;
100 file->f_size = d_size;
115static int cddrv_read(
iop_file_t *io,
void *buf,
int cnt)
122static int cddrv_write(
iop_file_t *io,
void *buf,
int cnt)
131static int cddrv_lseek(
iop_file_t *io,
int offset,
int whence)
140 offset += file->f_pos;
142 else if ( whence == 2 )
146 if ( size < (
unsigned int)offset )
147 offset = file->f_size;
148 file->f_pos = offset;
152static int cddrv_ioctl(
iop_file_t *io,
int cmd,
void *arg)
161static int cddrv_dummy()
166int cddrv_module_start(
int argc,
char **argv)
180int cddrv_module_stop()
185 v0 = DelDrv(Cddrv.name);
192int cddrv_module_restart(
int argc,
char **argv)
200int cddrv_module_status()