11#define MAX_DIR_CACHE_SECTORS 32
17 unsigned int fileLBA_bigend;
18 unsigned int fileSize;
19 unsigned int fileSize_bigend;
20 unsigned char dateStamp[6];
21 unsigned char reserved1;
22 unsigned char fileProperties;
23 unsigned char reserved2[6];
24 unsigned char filenameLength;
38 unsigned int path_depth;
40 unsigned int sector_start;
41 unsigned int sector_num;
42 unsigned int cache_offset;
43 unsigned int cache_size;
88 u16 volDescSize_bigend;
97 u8 publisherName[128];
99 u8 applicationName[128];
100 u8 copyrightFileName[37];
101 u8 abstractFileName[37];
102 u8 bibliographyFileName[37];
125static u8 dvdvBuffer[2064];
127static int cdvdChangedMagic = 0;
128static int cdvdChangedMagicLast[CHANGED_MAX] = {-1};
137static int strcasecmp(
const char *s1,
const char *s2) {
138 while (*s1 !=
'\0' && tolower(*s1) == tolower(*s2)) {
143 return tolower(*(
unsigned char *)s1) - tolower(*(
unsigned char *)s2);
149static int isValidDisc(
void) {
169static void copyToTocEntry(
struct TocEntry *tocEntry,
struct DirTocEntry *internalTocEntry) {
172 DPRINTF(
"copyToTocEntry: from=%p, to=%p\n\n", tocEntry, internalTocEntry);
173 DPRINTF(
"copyToTocEntry: DirTocEntry=%p\n", internalTocEntry);
174 DPRINTF(
" length......... %hd\n", internalTocEntry->length);
175 DPRINTF(
" fileLBA........ %u\n", internalTocEntry->fileLBA);
176 DPRINTF(
" fileLBA_bigend. %u\n", internalTocEntry->fileLBA_bigend);
177 DPRINTF(
" fileSize....... %u\n", internalTocEntry->fileSize);
178 DPRINTF(
" fileSize_bigend %u\n", internalTocEntry->fileSize_bigend);
179 DPRINTF(
" dateStamp...... %s\n", internalTocEntry->dateStamp);
180 DPRINTF(
" reserved1...... %u\n", internalTocEntry->reserved1);
181 DPRINTF(
" fileProperties. %u\n", internalTocEntry->fileProperties);
182 DPRINTF(
" reserved2...... %s\n", internalTocEntry->reserved2);
183 DPRINTF(
" filenameLength. %u\n", internalTocEntry->filenameLength);
184 DPRINTF(
" filename....... %s\n", internalTocEntry->filename);
186 tocEntry->fileSize = internalTocEntry->fileSize;
187 tocEntry->fileLBA = internalTocEntry->fileLBA;
188 tocEntry->fileProperties = internalTocEntry->fileProperties;
190 if (cdVolDesc.filesystemType == 2) {
194 filenamelen = internalTocEntry->filenameLength / 2;
196 for (i = 0; i < filenamelen; i++)
197 tocEntry->filename[i] = internalTocEntry->filename[(i << 1) + 1];
199 filenamelen = internalTocEntry->filenameLength;
202 strncpy(tocEntry->filename, internalTocEntry->filename, 128);
205 tocEntry->filename[filenamelen] = 0;
207 if (!(tocEntry->fileProperties & 0x02)) {
209 strtok(tocEntry->filename,
";");
212 DPRINTF(
"copyToTocEntry: tocEntry=%p\n\n", tocEntry);
213 DPRINTF(
" fileLBA........ %u\n\n", tocEntry->fileLBA);
214 DPRINTF(
" fileSize....... %u\n\n", tocEntry->fileSize);
215 DPRINTF(
" filename....... %s\n\n", tocEntry->filename);
216 DPRINTF(
" fileProperties. %u\n\n", tocEntry->fileProperties);
225static int findPath(
char *pathname) {
232 dirname = strtok(pathname,
"\\/");
233 DPRINTF(
"findPath: trying to find directory %s\n\n", pathname);
240 while (dirname != NULL) {
248 tocEntryPointer = (
struct DirTocEntry *)cacheInfoDir.cache;
251 tocEntryPointer = (
struct DirTocEntry *)((u8 *)tocEntryPointer + tocEntryPointer->length);
255 for (; tocEntryPointer < (
struct DirTocEntry *)(cacheInfoDir.cache + (cacheInfoDir.cache_size * 2048)); tocEntryPointer = (
struct DirTocEntry *)((u8 *)tocEntryPointer + tocEntryPointer->length)) {
257 if (tocEntryPointer->length == 0) {
258 DPRINTF(
"Got a null pointer entry, so either reached end of dir, or end of sector\n\n");
259 tocEntryPointer = (
struct DirTocEntry *)(cacheInfoDir.cache + (((((u8 *)tocEntryPointer - cacheInfoDir.cache) / 2048) + 1) * 2048));
262 if (tocEntryPointer >= (
struct DirTocEntry *)(cacheInfoDir.cache + (cacheInfoDir.cache_size * 2048))) {
266 if ((cacheInfoDir.cache_offset + cacheInfoDir.cache_size) < cacheInfoDir.sector_num) {
268 cacheInfoDir.cache_offset += cacheInfoDir.cache_size;
269 cacheInfoDir.cache_size = cacheInfoDir.sector_num - cacheInfoDir.cache_offset;
271 if (cacheInfoDir.cache_size > MAX_DIR_CACHE_SECTORS)
272 cacheInfoDir.cache_size = MAX_DIR_CACHE_SECTORS;
274 if (!cdfs_readSect(cacheInfoDir.sector_start + cacheInfoDir.cache_offset, cacheInfoDir.cache_size, cacheInfoDir.cache)) {
275 DPRINTF(
"Couldn't Read from CD !\n\n");
276 cacheInfoDir.valid = FALSE;
280 tocEntryPointer = (
struct DirTocEntry *)cacheInfoDir.cache;
282 cacheInfoDir.valid = FALSE;
288 if (tocEntryPointer->fileProperties & 0x02) {
290 copyToTocEntry(&localTocEntry, tocEntryPointer);
293 if (dir_entry == 0) {
294 if (cacheInfoDir.path_depth != 0) {
295 DPRINTF(
"First directory entry in dir, so name it '..'\n\n");
296 strcpy(localTocEntry.filename,
"..");
301 if (strcasecmp(dirname, localTocEntry.filename) == 0) {
302 DPRINTF(
"Found the matching sub-directory\n\n");
305 if (dir_entry == 0) {
309 if (cacheInfoDir.path_depth > 0)
310 cacheInfoDir.path_depth--;
312 if (cacheInfoDir.path_depth == 0) {
315 cacheInfoDir.pathname[0] = 0;
317 seperator = strrchr(cacheInfoDir.pathname,
'/');
319 if (seperator != NULL)
325 strcat(cacheInfoDir.pathname,
"/");
326 DPRINTF(
"Adding '%s' to cached pathname - path depth = %u\n\n", dirname, cacheInfoDir.path_depth);
327 strcat(cacheInfoDir.pathname, dirname);
328 cacheInfoDir.path_depth++;
335 DPRINTF(
"Found a directory, but it doesn't match\n\n");
346 cacheInfoDir.valid = FALSE;
351 dirname = strtok(NULL,
"\\/");
353 cacheInfoDir.sector_start = localTocEntry.fileLBA;
354 cacheInfoDir.sector_num = (localTocEntry.fileSize >> 11) + ((cdVolDesc.rootToc.tocSize & 2047) != 0);
359 cacheInfoDir.cache_offset = 0;
360 cacheInfoDir.cache_size = cacheInfoDir.sector_num;
362 if (cacheInfoDir.cache_size > MAX_DIR_CACHE_SECTORS)
363 cacheInfoDir.cache_size = MAX_DIR_CACHE_SECTORS;
365 if (!cdfs_readSect(cacheInfoDir.sector_start + cacheInfoDir.cache_offset, cacheInfoDir.cache_size, cacheInfoDir.cache)) {
366 DPRINTF(
"Couldn't Read from CD, trying to read %u sectors, starting at sector %u !\n\n",
367 cacheInfoDir.cache_size, cacheInfoDir.sector_start + cacheInfoDir.cache_offset);
368 cacheInfoDir.valid = FALSE;
374 DPRINTF(
"findPath found the path\n\n");
375 cacheInfoDir.valid = TRUE;
379static int cdfs_getVolumeDescriptor(
void) {
383 DPRINTF(
"cdfs_getVolumeDescriptor called\n\n");
385 for (volDescSector = 16; volDescSector < 20; volDescSector++) {
386 cdfs_readSect(volDescSector, 1, (u8*)&localVolDesc);
389 if (memcmp(localVolDesc.volID,
"CD001", 5) == 0) {
390 if ((localVolDesc.filesystemType == 1) ||
391 (localVolDesc.filesystemType == 2)) {
392 memcpy(&cdVolDesc, &localVolDesc,
sizeof(
struct CDVolDesc));
399 switch (cdVolDesc.filesystemType) {
401 DPRINTF(
"CD FileSystem is ISO9660\n\n");
404 DPRINTF(
"CD FileSystem is Joliet\n\n");
407 DPRINTF(
"CD FileSystem is unknown type\n\n");
415static enum PathMatch comparePath(
const char *path) {
419 length = strlen(cacheInfoDir.pathname);
421 for (i = 0; i < length; i++) {
423 if (path[i] != cacheInfoDir.pathname[i]) {
425 if ((path[i] ==
'/') || (path[i] ==
'\\')) {
426 if ((cacheInfoDir.pathname[i] ==
'/') || (cacheInfoDir.pathname[i] ==
'\\')) {
438 if (path[length] == 0)
443 if ((path[length] ==
'/') || (path[length] ==
'\\'))
454static int cdfs_cacheDir(
const char *pathname,
enum Cache_getMode getMode) {
456 static char dirname[1024];
458 DPRINTF(
"Attempting to find, and cache, directory: %s\n", pathname);
461 if (cdfs_checkDiskChanged(CHANGED_TOC)) {
462 cacheInfoDir.valid = FALSE;
466 if (cacheInfoDir.valid) {
469 if (comparePath(pathname) == MATCH) {
470 DPRINTF(
"CacheDir: The requested path is already cached\n");
472 if (getMode == CACHE_START) {
473 DPRINTF(
" and requested cache from start of dir\n");
475 if (cacheInfoDir.cache_offset == 0) {
478 DPRINTF(
" and start of dir is already cached so nothing to do :o)\n");
480 cacheInfoDir.valid = TRUE;
485 DPRINTF(
" but dir isn't cached from start, so re-cache existing dir from start\n");
488 cacheInfoDir.cache_offset = 0;
489 cacheInfoDir.cache_size = cacheInfoDir.sector_num;
491 if (cacheInfoDir.cache_size > MAX_DIR_CACHE_SECTORS)
492 cacheInfoDir.cache_size = MAX_DIR_CACHE_SECTORS;
495 if (!cdfs_readSect(cacheInfoDir.sector_start + cacheInfoDir.cache_offset, cacheInfoDir.cache_size, cacheInfoDir.cache)) {
496 DPRINTF(
"Couldn't Read from CD !\n");
498 cacheInfoDir.valid = FALSE;
502 cacheInfoDir.valid = TRUE;
508 cacheInfoDir.cache_offset += cacheInfoDir.cache_size;
509 cacheInfoDir.cache_size = cacheInfoDir.sector_num - cacheInfoDir.cache_offset;
511 if (cacheInfoDir.cache_size > MAX_DIR_CACHE_SECTORS)
512 cacheInfoDir.cache_size = MAX_DIR_CACHE_SECTORS;
515 if (!cdfs_readSect(cacheInfoDir.sector_start + cacheInfoDir.cache_offset, cacheInfoDir.cache_size, cacheInfoDir.cache)) {
516 DPRINTF(
"Couldn't Read from CD !\n");
518 cacheInfoDir.valid = FALSE;
522 cacheInfoDir.valid = TRUE;
527 DPRINTF(
"Cache is valid, but cached directory, is not the requested one\n"
528 "so check if the requested directory is a sub-dir of the cached one\n");
529 DPRINTF(
"Requested Path = %s , Cached Path = %s\n", pathname, cacheInfoDir.pathname);
531 if (comparePath(pathname) == SUBDIR) {
535 DPRINTF(
"Requested dir is a sub-dir of the cached directory,\n"
536 "so start search from current cached dir\n");
539 if (cacheInfoDir.cache_offset != 0) {
540 cacheInfoDir.cache_offset = 0;
541 cacheInfoDir.cache_size = cacheInfoDir.sector_num;
542 if (cacheInfoDir.cache_size > MAX_DIR_CACHE_SECTORS)
543 cacheInfoDir.cache_size = MAX_DIR_CACHE_SECTORS;
546 if (!cdfs_readSect(cacheInfoDir.sector_start + cacheInfoDir.cache_offset, cacheInfoDir.cache_size, cacheInfoDir.cache)) {
547 DPRINTF(
"Couldn't Read from CD !\n");
548 cacheInfoDir.valid = FALSE;
554 path_len = strlen(cacheInfoDir.pathname);
555 strcpy(dirname, pathname + path_len);
562 return (findPath(dirname));
570 DPRINTF(
"The cache is not valid, or the requested directory is not a sub-dir of the cached one\n\n");
572 if (!isValidDisc()) {
573 DPRINTF(
"No supported disc inserted.\n");
580 if (!cdfs_getVolumeDescriptor()) {
581 DPRINTF(
"Could not read the CD/DVD Volume Descriptor\n");
585 DPRINTF(
"Read the CD Volume Descriptor\n\n");
587 cacheInfoDir.path_depth = 0;
588 strcpy(cacheInfoDir.pathname,
"");
591 cacheInfoDir.cache_offset = 0;
592 cacheInfoDir.sector_start = cdVolDesc.rootToc.tocLBA;
593 cacheInfoDir.sector_num = (cdVolDesc.rootToc.tocSize >> 11) + ((cdVolDesc.rootToc.tocSize & 2047) != 0);
594 cacheInfoDir.cache_size = cacheInfoDir.sector_num;
596 if (cacheInfoDir.cache_size > MAX_DIR_CACHE_SECTORS)
597 cacheInfoDir.cache_size = MAX_DIR_CACHE_SECTORS;
600 if (!cdfs_readSect(cacheInfoDir.sector_start + cacheInfoDir.cache_offset, cacheInfoDir.cache_size, cacheInfoDir.cache)) {
601 DPRINTF(
"Couldn't Read from CD !\n");
602 cacheInfoDir.valid = FALSE;
606 DPRINTF(
"Read the first block from the root directory\n");
607 DPRINTF(
"Calling findPath\n");
608 strcpy(dirname, pathname);
610 return (findPath(dirname));
613static void splitPath(
const char *constpath,
char *dir,
char *fname) {
616 static char pathcopy[1024 + 1];
619 strncpy(pathcopy, constpath, 1024);
620 slash = strrchr(pathcopy,
'/');
624 slash = strrchr(pathcopy, (
int)
'\\');
631 strncpy(dir, pathcopy, 1024);
635 strncpy(fname, slash + 1, 128);
640 strncpy(fname, pathcopy, 128);
651int cdfs_prepare(
void) {
654 strcpy(cacheInfoDir.pathname,
"");
655 cacheInfoDir.valid = FALSE;
656 cacheInfoDir.path_depth = 0;
657 cacheInfoDir.sector_start = 0;
658 cacheInfoDir.sector_num = 0;
659 cacheInfoDir.cache_offset = 0;
660 cacheInfoDir.cache_size = 0;
662 if (cacheInfoDir.cache == NULL)
663 cacheInfoDir.cache = (u8 *)AllocSysMemory(0, MAX_DIR_CACHE_SECTORS * 2048, NULL);
673int cdfs_start(
void) {
677int cdfs_finish(
void) {
678 if (cacheInfoDir.cache)
679 FreeSysMemory(cacheInfoDir.cache);
684int cdfs_findfile(
const char *fname,
struct TocEntry *tocEntry) {
685 static char filename[128 + 1];
686 static char pathname[1024 + 1];
690 DPRINTF(
"cdfs_findfile called\n\n");
692 splitPath(fname, pathname, filename);
693 DPRINTF(
"Trying to find file: %s in directory: %s\n", filename, pathname);
696 if (cdfs_checkDiskChanged(CHANGED_TOC)) {
697 cacheInfoDir.valid = FALSE;
700 if ((cacheInfoDir.valid) && (comparePath(pathname) == MATCH)) {
704 tocEntryPointer = (
struct DirTocEntry *)cacheInfoDir.cache;
706 for (; tocEntryPointer < (
struct DirTocEntry *)(cacheInfoDir.cache + (cacheInfoDir.cache_size * 2048)); tocEntryPointer = (
struct DirTocEntry *)((u8 *)tocEntryPointer + tocEntryPointer->length)) {
707 if (tocEntryPointer->length == 0) {
708 DPRINTF(
"Got a null pointer entry, so either reached end of dir, or end of sector\n");
709 tocEntryPointer = (
struct DirTocEntry *)(cacheInfoDir.cache + (((((u8 *)tocEntryPointer - cacheInfoDir.cache) / 2048) + 1) * 2048));
712 if (tocEntryPointer >= (
struct DirTocEntry *)(cacheInfoDir.cache + (cacheInfoDir.cache_size * 2048))) {
717 copyToTocEntry(tocEntry, tocEntryPointer);
719 if (strcasecmp(tocEntry->filename, filename) == 0) {
726 if (cacheInfoDir.cache_size == cacheInfoDir.sector_num)
730 if (cacheInfoDir.cache_offset == 0) {
732 if (!cdfs_cacheDir(pathname, CACHE_NEXT))
736 if (!cdfs_cacheDir(pathname, CACHE_START))
740 DPRINTF(
"Trying to cache directory\n\n");
742 if (!cdfs_cacheDir(pathname, CACHE_START)) {
743 DPRINTF(
"Failed to cache directory\n\n");
750 DPRINTF(
"cache_size = %u\n", cacheInfoDir.cache_size);
751 while (cacheInfoDir.cache_size > 0) {
752 tocEntryPointer = (
struct DirTocEntry *)cacheInfoDir.cache;
754 if (cacheInfoDir.cache_offset == 0)
755 tocEntryPointer = (
struct DirTocEntry *)((u8 *)tocEntryPointer + tocEntryPointer->length);
757 for (; tocEntryPointer < (
struct DirTocEntry *)(cacheInfoDir.cache + (cacheInfoDir.cache_size * 2048)); tocEntryPointer = (
struct DirTocEntry *)((u8 *)tocEntryPointer + tocEntryPointer->length)) {
758 if (tocEntryPointer->length == 0) {
759 DPRINTF(
"Got a null pointer entry, so either reached end of dir, or end of sector\n");
760 DPRINTF(
"Offset into cache = %d bytes\n", (
int)((u8 *)tocEntryPointer - cacheInfoDir.cache));
761 tocEntryPointer = (
struct DirTocEntry *)(cacheInfoDir.cache + (((((u8 *)tocEntryPointer - cacheInfoDir.cache) / 2048) + 1) * 2048));
764 if (tocEntryPointer >= (
struct DirTocEntry *)(cacheInfoDir.cache + (cacheInfoDir.cache_size * 2048))) {
769 copyToTocEntry(tocEntry, tocEntryPointer);
771 if (strcasecmp(tocEntry->filename, filename) == 0) {
772 DPRINTF(
"Found a matching file\n\n");
777 DPRINTF(
"Non-matching file - looking for %s , found %s\n", filename, tocEntry->filename);
780 DPRINTF(
"Reached end of cache block\n");
782 cdfs_cacheDir(pathname, CACHE_NEXT);
786 DPRINTF(
"cdfs_findfile: could not find file\n");
794int cdfs_readSect(u32 lsn, u32 sectors, u8 *buf) {
796 u32 consecutive_sectors = (sectors > 2) ? (sectors * 2048) / 2064 : 0;
801 for (retry = 0; retry < 32; retry++) {
814 if (consecutive_sectors > 0)
816 result = !sceCdReadDVDV(lsn, consecutive_sectors, buf, &cdReadMode);
827 for (i = 0; i < consecutive_sectors; i += 1)
829 memmove(buf + (2048 * i), buf + (2064 * i) + 12, 2048);
831 for (i = consecutive_sectors; i < sectors; i += 1)
833 result = !sceCdReadDVDV(lsn + i, 1, dvdvBuffer, &cdReadMode);
843 memcpy(buf + (2048 * i), dvdvBuffer + 12, 2048);
848 result = !
sceCdRead(lsn, sectors, buf, &cdReadMode);
866 memset(buf, 0, (sectors << 11));
871int cdfs_getDir(
const char *pathname,
struct TocEntry tocEntry[],
unsigned int req_entries) {
878 DPRINTF(
"cdfs_getDir Request\n\n");
883 if (!cdfs_cacheDir(pathname, CACHE_START)) {
884 DPRINTF(
"cdfs_getDir - Call of cdfs_cacheDir failed\n\n");
888 DPRINTF(
"requested directory is %u sectors\n", cacheInfoDir.sector_num);
891 if (!cdfs_cacheDir(cacheInfoDir.pathname, CACHE_START)) {
892 DPRINTF(
"cdfs_getDir - Call of cdfs_cacheDir failed\n\n");
896 tocEntryPointer = (
struct DirTocEntry *)cacheInfoDir.cache;
898 tocEntryPointer = (
struct DirTocEntry *)((u8 *)tocEntryPointer + tocEntryPointer->length);
901 if (cacheInfoDir.path_depth == 0)
902 tocEntryPointer = (
struct DirTocEntry *)((u8 *)tocEntryPointer + tocEntryPointer->length);
907 DPRINTF(
"cdfs_getDir - inside while-loop\n\n");
910 for (; tocEntryPointer < (
struct DirTocEntry *)(cacheInfoDir.cache + (cacheInfoDir.cache_size * 2048)); tocEntryPointer = (
struct DirTocEntry *)((u8 *)tocEntryPointer + tocEntryPointer->length)) {
911 if (tocEntryPointer->length == 0) {
916 tocEntryPointer = (
struct DirTocEntry *)(cacheInfoDir.cache + (((((u8 *)tocEntryPointer - cacheInfoDir.cache) / 2048) + 1) * 2048));
919 if (tocEntryPointer >= (
struct DirTocEntry *)(cacheInfoDir.cache + (cacheInfoDir.cache_size * 2048))) {
926 if (tocEntryPointer->fileProperties & 0x02) {
927 DPRINTF(
"We found a dir, and we want all dirs\n\n");
928 copyToTocEntry(&localTocEntry, tocEntryPointer);
930 if (dir_entry == 0) {
931 if (cacheInfoDir.path_depth != 0) {
932 DPRINTF(
"It's the first directory entry, so name it '..'\n\n");
933 strcpy(localTocEntry.filename,
"..");
938 tocEntry[matched_entries] = localTocEntry;
941 DPRINTF(
"We found a file, but we dont want files (at least not yet)\n\n");
946 if ((
unsigned int)matched_entries >= req_entries)
947 return (matched_entries);
952 if ((cacheInfoDir.cache_offset + cacheInfoDir.cache_size) < cacheInfoDir.sector_num) {
953 if (!cdfs_cacheDir(cacheInfoDir.pathname, CACHE_NEXT)) {
961 tocEntryPointer = (
struct DirTocEntry *)cacheInfoDir.cache;
966 if (!cdfs_cacheDir(cacheInfoDir.pathname, CACHE_START)) {
967 DPRINTF(
"cdfs_getDir - Call of cdfs_cacheDir failed\n\n");
971 tocEntryPointer = (
struct DirTocEntry *)cacheInfoDir.cache;
974 tocEntryPointer = (
struct DirTocEntry *)((u8 *)tocEntryPointer + tocEntryPointer->length);
977 if (cacheInfoDir.path_depth == 0)
978 tocEntryPointer = (
struct DirTocEntry *)((u8 *)tocEntryPointer + tocEntryPointer->length);
983 DPRINTF(
"cdfs_getDir - inside while-loop\n\n");
986 for (; tocEntryPointer < (
struct DirTocEntry *)(cacheInfoDir.cache + (cacheInfoDir.cache_size * 2048)); tocEntryPointer = (
struct DirTocEntry *)((u8 *)tocEntryPointer + tocEntryPointer->length)) {
987 if (tocEntryPointer->length == 0) {
992 tocEntryPointer = (
struct DirTocEntry *)(cacheInfoDir.cache + (((((u8 *)tocEntryPointer - cacheInfoDir.cache) / 2048) + 1) * 2048));
995 if (tocEntryPointer >= (
struct DirTocEntry *)(cacheInfoDir.cache + (cacheInfoDir.cache_size * 2048))) {
1002 if (tocEntryPointer->fileProperties & 0x02) {
1003 DPRINTF(
"We don't want files now\n\n");
1005 copyToTocEntry(&localTocEntry, tocEntryPointer);
1007 tocEntry[matched_entries] = localTocEntry;
1013 if ((
unsigned int)matched_entries >= req_entries)
1014 return (matched_entries);
1020 if ((cacheInfoDir.cache_offset + cacheInfoDir.cache_size) < cacheInfoDir.sector_num) {
1021 if (!cdfs_cacheDir(cacheInfoDir.pathname, CACHE_NEXT)) {
1029 tocEntryPointer = (
struct DirTocEntry *)cacheInfoDir.cache;
1033 return (matched_entries);
1040int cdfs_checkDiskChanged(
enum Cdvd_Changed_Index index) {
1044 cdvdChangedMagic += 1;
1046 if (cdvdChangedMagic != cdvdChangedMagicLast[index]) {
1047 cdvdChangedMagicLast[index] = cdvdChangedMagic;
int sceCdDiskReady(int mode)
int sceCdGetDiskType(void)
int sceCdRead(u32 lbn, u32 sectors, void *buffer, sceCdRMode *mode)
int sceCdTrayReq(int param, u32 *traychk)