diff options
| author | SND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2011-01-13 02:43:59 +0000 |
|---|---|---|
| committer | SND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2011-01-13 02:43:59 +0000 |
| commit | 16cc6e4f142b3162ed92507aa89a07090e40eb65 (patch) | |
| tree | 541a0efbea8e6dd5f9f32d3a87d6e1eb94da3a18 /libpcsxcore | |
| parent | 2db43c9279b994dfaf5f7f74c17b86d6b637aefd (diff) | |
| download | pcsxr-16cc6e4f142b3162ed92507aa89a07090e40eb65.tar.gz | |
my stupid error
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@62052 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'libpcsxcore')
| -rw-r--r-- | libpcsxcore/ppf.c | 80 |
1 files changed, 41 insertions, 39 deletions
diff --git a/libpcsxcore/ppf.c b/libpcsxcore/ppf.c index d421d09e..44414a6c 100644 --- a/libpcsxcore/ppf.c +++ b/libpcsxcore/ppf.c @@ -332,13 +332,13 @@ void BuildPPFCache() { SysPrintf(_("Loaded PPF %d.0 patch: %s.\n"), method + 1, szPPF); } -// redump.org SBI files
-static u8 sbitime[256][3], sbicount;
-
-void LoadSBI() {
- FILE *sbihandle;
- char buffer[16], sbifile[MAXPATHLEN];
-
+// redump.org SBI files +static u8 sbitime[256][3], sbicount; + +void LoadSBI() { + FILE *sbihandle; + char buffer[16], sbifile[MAXPATHLEN]; + // Generate filename in the format of SLUS_123.45.sbi buffer[0] = toupper(CdromId[0]); buffer[1] = toupper(CdromId[1]); @@ -356,35 +356,37 @@ void LoadSBI() { buffer[13] = 'b'; buffer[14] = 'i'; buffer[15] = '\0'; -
- sprintf(sbifile, "%s%s", Config.PatchesDir, buffer);
-
- // init
- sbicount = 0;
-
- sbihandle = fopen(sbifile, "rb");
- if (sbihandle == NULL) return;
-
- // 4-byte SBI header
- fseek(sbihandle, 4, SEEK_SET);
- while (!feof(sbihandle)) {
- fread(sbitime[sbicount++], 1, 3, sbihandle);
- fseek(sbihandle, 11, SEEK_CUR);
- }
-
- SysPrintf(_("Loaded SBI file: %s.\n"), sbifile);
-}
-
-boolean CheckSBI(const u8 *time) {
- int lcv;
-
- // both BCD format
- for (lcv = 0; lcv < sbicount; lcv++) {
- if (time[0] == sbitime[lcv][0] &&
- time[1] == sbitime[lcv][1] &&
- time[2] == sbitime[lcv][2])
- return TRUE;
- }
-
- return FALSE;
-}
+ + sprintf(sbifile, "%s%s", Config.PatchesDir, buffer); + + // init + sbicount = 0; + + sbihandle = fopen(sbifile, "rb"); + if (sbihandle == NULL) return; + + // 4-byte SBI header + fread(buffer, 1, 4, sbihandle); + while (!feof(sbihandle)) { + fread(sbitime[sbicount++], 1, 3, sbihandle); + fread(buffer, 1, 11, sbihandle); + } + + fclose(sbihandle); + + SysPrintf(_("Loaded SBI file: %s.\n"), sbifile); +} + +boolean CheckSBI(const u8 *time) { + int lcv; + + // both BCD format + for (lcv = 0; lcv < sbicount; lcv++) { + if (time[0] == sbitime[lcv][0] && + time[1] == sbitime[lcv][1] && + time[2] == sbitime[lcv][2]) + return TRUE; + } + + return FALSE; +} |
