diff options
| author | SND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2010-01-23 08:44:23 +0000 |
|---|---|---|
| committer | SND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2010-01-23 08:44:23 +0000 |
| commit | 912c53cda0997e17d32d0b854823c3334b419db5 (patch) | |
| tree | 158f8a7ae9c68235fe4e1c14fa1efe5533242dc8 /libpcsxcore/misc.c | |
| parent | cd40452e610e32935cfc5bae96cc77209f79e7d9 (diff) | |
| download | pcsxr-912c53cda0997e17d32d0b854823c3334b419db5.tar.gz | |
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@40648 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'libpcsxcore/misc.c')
| -rw-r--r-- | libpcsxcore/misc.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/libpcsxcore/misc.c b/libpcsxcore/misc.c index cdcd6cce..4c0e6cfd 100644 --- a/libpcsxcore/misc.c +++ b/libpcsxcore/misc.c @@ -25,6 +25,7 @@ #include "misc.h" #include "cdrom.h" #include "mdec.h" +#include "ppf.h" int Log = 0; @@ -95,7 +96,8 @@ void mmssdd( char *b, char *p ) #define READTRACK() \ if (CDR_readTrack(time) == -1) return -1; \ - buf = CDR_getBuffer(); if (buf == NULL) return -1; + buf = CDR_getBuffer(); \ + if (buf == NULL) return -1; else CheckPPFCache(buf, time[0], time[1], time[2]); #define READDIR(_dir) \ READTRACK(); \ @@ -112,8 +114,8 @@ int GetCdromFile(u8 *mdir, u8 *time, s8 *filename) { int i; // only try to scan if a filename is given - if(!strlen(filename)) return -1; - + if (!strlen(filename)) return -1; + i = 0; while (i < 4096) { dir = (struct iso_directory_record*) &mdir[i]; @@ -123,19 +125,19 @@ int GetCdromFile(u8 *mdir, u8 *time, s8 *filename) { i += dir->length[0]; if (dir->flags[0] & 0x2) { // it's a dir - if (!strnicmp((char*)&dir->name[0], filename, dir->name_len[0])) { + if (!strnicmp((char *)&dir->name[0], filename, dir->name_len[0])) { if (filename[dir->name_len[0]] != '\\') continue; - - filename+= dir->name_len[0] + 1; - mmssdd(dir->extent, (char*)time); + filename += dir->name_len[0] + 1; + + mmssdd(dir->extent, (char *)time); READDIR(ddir); i = 0; mdir = ddir; } } else { - if (!strnicmp((char*)&dir->name[0], filename, strlen(filename))) { - mmssdd(dir->extent, (char*)time); + if (!strnicmp((char *)&dir->name[0], filename, strlen(filename))) { + mmssdd(dir->extent, (char *)time); break; } } @@ -274,6 +276,8 @@ int CheckCdrom() { char exename[256]; int i, c; + FreePPFCache(); + time[0] = itob(0); time[1] = itob(2); time[2] = itob(0x10); @@ -344,6 +348,8 @@ int CheckCdrom() { SysPrintf("CD-ROM Label: %.32s\n", CdromLabel); SysPrintf("CD-ROM ID: %.9s\n", CdromId); + BuildPPFCache(); + return 0; } |
