0) {
$_SESSION['current_profile'] = $profiles[0]['id'];
} else {
// Create default profile if none exists
$defaultProfileId = createProfile("Player 1", "avatar1.png");
$_SESSION['current_profile'] = $defaultProfileId;
}
}
// Process BIOS file uploads
$uploadMessage = '';
$uploadStatus = '';
if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['upload_type'])) {
if ($_POST['upload_type'] == 'bios' && isset($_FILES['bios_file'])) {
if ($_FILES['bios_file']['error'] == UPLOAD_ERR_OK) {
// Create the bios directory if it doesn't exist
if (!is_dir('bios')) {
mkdir('bios', 0755, true);
}
$tmp_name = $_FILES['bios_file']['tmp_name'];
$name = basename($_FILES['bios_file']['name']);
$console = isset($_POST['console_type']) ? $_POST['console_type'] : pathinfo($name, PATHINFO_FILENAME);
// If console type is specified, rename the file
if (isset($_POST['console_type']) && !empty($_POST['console_type'])) {
$ext = pathinfo($name, PATHINFO_EXTENSION);
$name = $console . '.' . $ext;
}
// Move the uploaded file
if (move_uploaded_file($tmp_name, "bios/$name")) {
$uploadMessage = "BIOS file uploaded successfully!";
$uploadStatus = 'success';
} else {
$uploadMessage = "Error uploading BIOS file.";
$uploadStatus = 'error';
}
} else {
$uploadMessage = "Error uploading BIOS file: " . $_FILES['bios_file']['error'];
$uploadStatus = 'error';
}
}
}
// Get current profile data
$currentProfile = getProfileById($_SESSION['current_profile']);
$allProfiles = getProfiles();
// Get list of BIOS files
$biosFiles = getBiosFiles();
?>
RetroHub - BIOS Files
BIOS Files
Upload BIOS Files
Some systems require BIOS files to function correctly. Upload your BIOS files here.
About BIOS Files
BIOS files are required for some systems to run correctly. They contain low-level system code that the emulator needs to properly emulate the original hardware.
For copyright reasons, BIOS files are not included with RetroHub and must be provided by you.
Once uploaded, BIOS files will be automatically detected and used by the emulator.