11#include "accdvd_internal.h"
13static char *argv_20[2] = {
"sceCdInit", 0};
21 Cdic.done = (cdc_done_t)func;
32 return cdc_ready(mode);
47 return cdc_getpos() / 16;
50static int cdi_xfer(
void *dst,
void *src,
int len,
enum cdc_xfer_dir dir)
53 memcpy(dst, src, len);
60 return cdc_seterrno(34);
61 return cdc_readtoc(
toc, cdi_xfer);
69 return mode == 5 && cdc_module_stop() >= 0;
70 if ( cdc_module_status() > 0 && cdc_module_stop() < 0 )
74 if ( cdc_module_start(1, argv_20) < 0 )
78 memset(&Cdic, 0,
sizeof(Cdic));
95 return cdc_pause(Cdic.done);
100 if ( !mode || !buffer || ((uiptr)buffer & 3) != 0 )
102 return cdc_seterrno(34);
105 return cdc_seterrno(0);
106 return cdc_read(lbn, buffer, sectors, mode, 0, Cdic.done);
111 return cdc_sync(mode != 0);
128 v3 = &name[++namlen];
129 if ( namlen >= 1024 )
134 if ( namlen >= 1024 )
138 return cdc_seterrno(34);
139 return cdc_lookup(file, name, namlen, cdi_xfer);
144 return cdc_seek(lbn, Cdic.done);
149 return cdc_standby(Cdic.done);
159 return cdc_stop(Cdic.done);
164 return cdc_tray(param, traychk);
171 if ( !bufmax || !bankmax || !buffer || ((uiptr)buffer & 3) != 0 )
172 return cdc_seterrno(34);
173 v4 = bufmax / bankmax;
174 if ( !(bufmax / bankmax) )
176 return cdc_inits((
void *)buffer, bufmax, v4);
183 if ( !buffer || ((uiptr)buffer & 3) != 0 || !error )
187 return cdc_seterrno(34);
194 return cdc_reads(buffer, sectors, mode, (
int *)error, cdc_xfer);
199 return cdc_seeks(lbn);
205 return cdc_seterrno(34);
206 return cdc_starts(lbn, mode);
226 return cdc_resumes();
int sceCdSearchFile(sceCdlFILE *file, const char *name)
int sceCdStRead(u32 sectors, u32 *buffer, u32 mode, u32 *error)
sceCdCBFunc sceCdCallback(sceCdCBFunc function)
int sceCdStInit(u32 bufmax, u32 bankmax, void *buffer)
int sceCdDiskReady(int mode)
u32 sceCdGetReadPos(void)
int sceCdGetDiskType(void)
int sceCdMmode(int media)
int sceCdStStart(u32 lbn, sceCdRMode *mode)
void(* sceCdCBFunc)(int reason)
int sceCdRead(u32 lbn, u32 sectors, void *buffer, sceCdRMode *mode)
int sceCdTrayReq(int param, u32 *traychk)