summaryrefslogtreecommitdiff
path: root/libpcsxcore
diff options
context:
space:
mode:
Diffstat (limited to 'libpcsxcore')
-rw-r--r--libpcsxcore/ppf.c80
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;
+}