- // Generate filename in the format of SLUS_123.45
- buffer[0] = toupper(CdromId[0]);
- buffer[1] = toupper(CdromId[1]);
- buffer[2] = toupper(CdromId[2]);
- buffer[3] = toupper(CdromId[3]);
- buffer[4] = '_';
- buffer[5] = CdromId[4];
- buffer[6] = CdromId[5];
- buffer[7] = CdromId[6];
- buffer[8] = '.';
- buffer[9] = CdromId[7];
- buffer[10] = CdromId[8];
- buffer[11] = '\0';
-
- sprintf(szPPF, "%s%s", Config.PatchesDir, buffer);
-
- ppffile = fopen(szPPF, "rb");
+ if (!fname) {
+ // Generate filename in the format of SLUS_123.45
+ buffer[0] = toupper(CdromId[0]);
+ buffer[1] = toupper(CdromId[1]);
+ buffer[2] = toupper(CdromId[2]);
+ buffer[3] = toupper(CdromId[3]);
+ buffer[4] = '_';
+ buffer[5] = CdromId[4];
+ buffer[6] = CdromId[5];
+ buffer[7] = CdromId[6];
+ buffer[8] = '.';
+ buffer[9] = CdromId[7];
+ buffer[10] = CdromId[8];
+ buffer[11] = '\0';
+
+ sprintf(szPPF, "%s%s", Config.PatchesDir, buffer);
+ fname = szPPF;
+ }
+ ppffile = fopen(fname, "rb");