Unverified Commit 1d213d34 authored by SeventySixx's avatar SeventySixx Committed by GitHub
Browse files

Portable BIOS config + check and log if a valid BIOS is not found (#155)

* - BIOS in game config now is stored by name instead of full path, making it more portable

* - added check if bios folder is empty, logging in that case an explicit message
parent 2f70a673
Pipeline #52570 passed with stage
in 2 minutes and 8 seconds
......@@ -264,12 +264,23 @@ void retro_init(void)
wxString description;
if (IsBIOSlite(bios_file, description)) {
std::string log_bios = (std::string)description;
std::string log_bios = (std::string)description;
wxFileName f;
// check if there are bios file in the bios folders, otherwise terminates with a explicit log message
if (bios_files.size() == 0) {
std::string checked_path = bios_dir.GetFullPath().ToStdString();
log_cb(RETRO_LOG_ERROR, "Could not find valid BIOS files! \n");
log_cb(RETRO_LOG_ERROR, "Please provide required BIOS file in %s folder \n", checked_path.c_str());
for (retro_core_option_definition& def : option_defs)
......@@ -286,12 +297,23 @@ void retro_init(void)
// loads the options structure to the frontend
// start init some core settings
option_upscale_mult = option_value(INT_PCSX2_OPT_UPSCALE_MULTIPLIER, KeyOptionInt::return_type);
sel_bios_path = option_value(STRING_PCSX2_OPT_BIOS, KeyOptionString::return_type);
log_cb(RETRO_LOG_DEBUG, "let's generate teh bios path \n");
wxFileName f_bios;
f_bios.Assign(option_value(STRING_PCSX2_OPT_BIOS, KeyOptionString::return_type));
f_bios = wxFileName(bios_dir.GetFullPath(), option_value(STRING_PCSX2_OPT_BIOS, KeyOptionString::return_type));
sel_bios_path = f_bios.GetFullPath().ToStdString();
// instantiate the pcsx2 app and so some things on it
pcsx2 = &wxGetApp();
pxDoOutOfMemory = SysOutOfMemory_EmergencyResponse;
......@@ -584,7 +606,7 @@ bool retro_load_game(const struct retro_game_info* game)
const char* selected_bios = option_value(STRING_PCSX2_OPT_BIOS, KeyOptionString::return_type);
const char* selected_bios = sel_bios_path.c_str();
if (selected_bios == NULL)
log_cb(RETRO_LOG_ERROR, "Could not find any valid PS2 Bios File in %s\n", (const char*)bios_dir.GetFullPath());
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment