diff --git a/src/core/analog_controller.cpp b/src/core/analog_controller.cpp index b5e239a27..f2240e95f 100644 --- a/src/core/analog_controller.cpp +++ b/src/core/analog_controller.cpp @@ -45,7 +45,7 @@ void AnalogController::Reset() if (m_force_analog_on_reset) { - if (g_settings.controller_disable_analog_mode_forcing) + if (g_settings.controller_disable_analog_mode_forcing || System::IsRunningBIOS()) { Host::AddIconOSDMessage( fmt::format("Controller{}AnalogMode", m_index), ICON_FA_GAMEPAD, diff --git a/src/core/system.cpp b/src/core/system.cpp index b63886e46..26973dc01 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -137,6 +137,7 @@ static u32 s_internal_frame_number = 1; static std::string s_running_game_path; static std::string s_running_game_code; static std::string s_running_game_title; +static bool s_running_bios; static float s_throttle_frequency = 60.0f; static float s_target_speed = 1.0f; @@ -314,6 +315,11 @@ const std::string& System::GetRunningTitle() return s_running_game_title; } +bool System::IsRunningBIOS() +{ + return s_running_bios; +} + float System::GetFPS() { return s_fps; @@ -912,6 +918,9 @@ void System::ResetSystem() #ifdef WITH_CHEEVOS Achievements::ResetChallengeMode(); #endif + + // need to clear this here, because of eject disc -> reset. + s_running_bios = !s_running_game_path.empty(); } void System::PauseSystem(bool paused) @@ -1173,6 +1182,9 @@ bool System::BootSystem(SystemBootParameters parameters) return false; } + // Allow controller analog mode for EXEs and PSFs. + s_running_bios = s_running_game_path.empty() && !exe_boot && !psf_boot; + Bus::SetBIOS(*bios_image); UpdateControllers(); UpdateMemoryCardTypes(); @@ -1421,6 +1433,7 @@ void System::ClearRunningGame() s_running_game_code.clear(); s_running_game_path.clear(); s_running_game_title.clear(); + s_running_bios = false; s_cheat_list.reset(); s_state = State::Shutdown; diff --git a/src/core/system.h b/src/core/system.h index 56d7bbf28..145633c74 100644 --- a/src/core/system.h +++ b/src/core/system.h @@ -170,6 +170,7 @@ void IncrementInternalFrameNumber(); const std::string& GetRunningPath(); const std::string& GetRunningCode(); const std::string& GetRunningTitle(); +bool IsRunningBIOS(); // TODO: Move to PerformanceMetrics float GetFPS();