libretro: boot dreamcast bios when loading core without content

Get rid of "Boot to BIOS" core setting.
Issue #2007
This commit is contained in:
Flyinghead 2025-07-15 15:49:32 +02:00
parent 738b95d2be
commit 5d3b7fae6b
2 changed files with 22 additions and 45 deletions

View File

@ -109,7 +109,6 @@ extern void retro_audio_flush_buffer(void);
extern void retro_audio_upload(void);
std::string arcadeFlashPath;
static bool boot_to_bios;
static bool devices_need_refresh = false;
static int device_type[4] = {-1,-1,-1,-1};
@ -304,6 +303,8 @@ void retro_set_environment(retro_environment_t cb)
{ 0 },
};
environ_cb(RETRO_ENVIRONMENT_SET_CONTROLLER_INFO, (void*)ports);
const bool b = true;
environ_cb(RETRO_ENVIRONMENT_SET_SUPPORT_NO_GAME, (void *)&b);
}
static void retro_keyboard_event(bool down, unsigned keycode, uint32_t character, uint16_t key_modifiers);
@ -432,8 +433,6 @@ static bool set_variable_visibility(void)
// Show/hide Dreamcast options
option_display.visible = platformIsDreamcast;
option_display.key = CORE_OPTION_NAME "_boot_to_bios";
environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_DISPLAY, &option_display);
option_display.key = CORE_OPTION_NAME "_hle_bios";
environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_DISPLAY, &option_display);
option_display.key = CORE_OPTION_NAME "_gdrom_fast_loading";
@ -790,17 +789,6 @@ static void update_variables(bool first_startup)
DEBUG_LOG(COMMON, "Got height: %u", (int)config::RenderResolution);
}
var.key = CORE_OPTION_NAME "_boot_to_bios";
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
{
if (!strcmp(var.value, "enabled"))
boot_to_bios = true;
else if (!strcmp(var.value, "disabled"))
boot_to_bios = false;
}
else
boot_to_bios = false;
var.key = CORE_OPTION_NAME "_alpha_sorting";
var.value = nullptr;
RenderType previous_renderer = config::RendererType;
@ -2072,14 +2060,26 @@ bool retro_load_game(const struct retro_game_info *game)
}
#endif
NOTICE_LOG(BOOT, "retro_load_game: %s", game->path);
bool boot_to_bios = false;
if (game != nullptr && game->path != nullptr && game->path[0] != '\0')
{
NOTICE_LOG(BOOT, "retro_load_game: %s", game->path);
extract_basename(g_base_name, game->path, sizeof(g_base_name));
extract_directory(game_dir, game->path, sizeof(game_dir));
// Storing rom dir for later use
snprintf(g_roms_dir, sizeof(g_roms_dir), "%s%c", game_dir, slash);
extract_basename(g_base_name, game->path, sizeof(g_base_name));
extract_directory(game_dir, game->path, sizeof(game_dir));
// Storing rom dir for later use
snprintf(g_roms_dir, sizeof(g_roms_dir), "%s%c", game_dir, slash);
}
else
{
NOTICE_LOG(BOOT, "retro_load_game: (no content)");
g_base_name[0] = '\0';
game_dir[0] = '\0';
g_roms_dir[0] = '\0';
settings.platform.system = DC_PLATFORM_DREAMCAST;
boot_to_bios = true;
}
if (environ_cb(RETRO_ENVIRONMENT_GET_RUMBLE_INTERFACE, &rumble) && log_cb)
log_cb(RETRO_LOG_DEBUG, "Rumble interface supported!\n");
@ -2147,18 +2147,9 @@ bool retro_load_game(const struct retro_game_info *game)
}
}
if (game->path[0] == '\0')
{
if (settings.platform.isConsole())
boot_to_bios = true;
else
return false;
}
if (settings.platform.isArcade())
boot_to_bios = false;
if (boot_to_bios)
if (boot_to_bios) {
game_data.clear();
}
// if an m3u file was loaded, disk_paths will already be populated so load the game from there
else if (disk_paths.size() > 0)
{

View File

@ -157,20 +157,6 @@ struct retro_core_option_v2_definition option_defs_us[] = {
},
"disabled",
},
{
CORE_OPTION_NAME "_boot_to_bios",
"Boot to BIOS (Restart Required)",
NULL,
"Boot directly into the Dreamcast BIOS menu.",
NULL,
"system",
{
{ "disabled", NULL },
{ "enabled", NULL },
{ NULL, NULL },
},
"disabled",
},
{
CORE_OPTION_NAME "_enable_dsp",
"Enable DSP",