mirror of
https://github.com/izzy2lost/PSX2.git
synced 2026-07-05 15:18:36 -07:00
Finally fixed BIOS problem
This commit is contained in:
@@ -1006,20 +1006,23 @@ public class MainActivity extends AppCompatActivity implements GamesCoverDialogF
|
||||
if (hasAnyBiosFiles(f)) return true;
|
||||
} else {
|
||||
String name = f.getName();
|
||||
// Common PCSX2 BIOS components: SCPH*.bin (main), and component ROMs ROM0/ROM1/ROM2/EROM
|
||||
if (name != null) {
|
||||
String lower = name.toLowerCase(Locale.ROOT);
|
||||
boolean isMainBios = lower.startsWith("scph") && (lower.endsWith(".bin") || lower.endsWith(".rom"));
|
||||
boolean isComponentSuffix = lower.endsWith(".rom0") || lower.endsWith(".rom1") || lower.endsWith(".rom2") || lower.endsWith(".erom");
|
||||
boolean isBareComponent = lower.equals("rom0") || lower.equals("rom1") || lower.equals("rom2") || lower.equals("erom");
|
||||
|
||||
if (isMainBios) {
|
||||
if (f.length() >= 256 * 1024) return true; // main BIOS typically >= 2MB, but allow 256KB+
|
||||
} else if (isComponentSuffix || isBareComponent) {
|
||||
|
||||
// Check for component ROM files (these have specific names)
|
||||
boolean isComponentSuffix = lower.endsWith(".rom0") || lower.endsWith(".rom1") ||
|
||||
lower.endsWith(".rom2") || lower.endsWith(".erom");
|
||||
boolean isBareComponent = lower.equals("rom0") || lower.equals("rom1") ||
|
||||
lower.equals("rom2") || lower.equals("erom");
|
||||
|
||||
if (isComponentSuffix || isBareComponent) {
|
||||
if (f.length() >= 64 * 1024) return true; // component ROMs can be smaller
|
||||
} else if (lower.endsWith(".bin") || lower.endsWith(".rom")) {
|
||||
// Fallback: any .bin/.rom over 256KB
|
||||
if (f.length() >= 256 * 1024) return true;
|
||||
}
|
||||
|
||||
// Accept any .bin or .rom file that's at least 256KB (likely a BIOS)
|
||||
// This covers all regional variants and renamed files
|
||||
if ((lower.endsWith(".bin") || lower.endsWith(".rom")) && f.length() >= 256 * 1024) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,11 +194,22 @@ public class SetupWizardDialogFragment extends DialogFragment {
|
||||
for (File f : fs) {
|
||||
if (f != null && f.isFile()) {
|
||||
String lower = f.getName().toLowerCase(java.util.Locale.ROOT);
|
||||
boolean isMainBios = lower.startsWith("scph") && (lower.endsWith(".bin") || lower.endsWith(".rom"));
|
||||
boolean isComponentSuffix = lower.endsWith(".rom0") || lower.endsWith(".rom1") || lower.endsWith(".rom2") || lower.endsWith(".erom");
|
||||
boolean isBareComponent = lower.equals("rom0") || lower.equals("rom1") || lower.equals("rom2") || lower.equals("erom");
|
||||
if ((isMainBios && f.length() >= 256 * 1024) || (isComponentSuffix || isBareComponent))
|
||||
|
||||
// Check for component ROM files (these have specific names)
|
||||
boolean isComponentSuffix = lower.endsWith(".rom0") || lower.endsWith(".rom1") ||
|
||||
lower.endsWith(".rom2") || lower.endsWith(".erom");
|
||||
boolean isBareComponent = lower.equals("rom0") || lower.equals("rom1") ||
|
||||
lower.equals("rom2") || lower.equals("erom");
|
||||
|
||||
if (isComponentSuffix || isBareComponent) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Accept any .bin or .rom file that's at least 256KB (likely a BIOS)
|
||||
// This covers renamed files and all regional variants
|
||||
if ((lower.endsWith(".bin") || lower.endsWith(".rom")) && f.length() >= 256 * 1024) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user