- snprintf(path, path_size, "%s%c%s", dirpath, SLASH, ent->d_name);
- ret = try_use_bios(path);
- if (ret)
- break;
+ // another pass to look for anything fitting, even ps2 bios
+ rewinddir(dir);
+ while ((ent = readdir(dir)))
+ {
+ for (i = 0; i < sizeof(substr_alt) / sizeof(substr_alt[0]); i++)
+ {
+ const char *substr = substr_alt[i];
+ if ((strncasecmp(ent->d_name, substr, strlen(substr)) != 0))
+ continue;
+ snprintf(path, path_size, "%s%c%s", dirpath, SLASH, ent->d_name);
+ ret = try_use_bios(path, false);
+ if (ret)
+ goto finish;
+ }