System: Disable auto analog mode when starting shell

This commit is contained in:
Connor McLaughlin 2022-10-04 00:20:37 +10:00
parent df06931e36
commit 587fbf6ca7
3 changed files with 15 additions and 1 deletions

View File

@ -45,7 +45,7 @@ void AnalogController::Reset()
if (m_force_analog_on_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( Host::AddIconOSDMessage(
fmt::format("Controller{}AnalogMode", m_index), ICON_FA_GAMEPAD, fmt::format("Controller{}AnalogMode", m_index), ICON_FA_GAMEPAD,

View File

@ -137,6 +137,7 @@ static u32 s_internal_frame_number = 1;
static std::string s_running_game_path; static std::string s_running_game_path;
static std::string s_running_game_code; static std::string s_running_game_code;
static std::string s_running_game_title; static std::string s_running_game_title;
static bool s_running_bios;
static float s_throttle_frequency = 60.0f; static float s_throttle_frequency = 60.0f;
static float s_target_speed = 1.0f; static float s_target_speed = 1.0f;
@ -314,6 +315,11 @@ const std::string& System::GetRunningTitle()
return s_running_game_title; return s_running_game_title;
} }
bool System::IsRunningBIOS()
{
return s_running_bios;
}
float System::GetFPS() float System::GetFPS()
{ {
return s_fps; return s_fps;
@ -912,6 +918,9 @@ void System::ResetSystem()
#ifdef WITH_CHEEVOS #ifdef WITH_CHEEVOS
Achievements::ResetChallengeMode(); Achievements::ResetChallengeMode();
#endif #endif
// need to clear this here, because of eject disc -> reset.
s_running_bios = !s_running_game_path.empty();
} }
void System::PauseSystem(bool paused) void System::PauseSystem(bool paused)
@ -1173,6 +1182,9 @@ bool System::BootSystem(SystemBootParameters parameters)
return false; 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); Bus::SetBIOS(*bios_image);
UpdateControllers(); UpdateControllers();
UpdateMemoryCardTypes(); UpdateMemoryCardTypes();
@ -1421,6 +1433,7 @@ void System::ClearRunningGame()
s_running_game_code.clear(); s_running_game_code.clear();
s_running_game_path.clear(); s_running_game_path.clear();
s_running_game_title.clear(); s_running_game_title.clear();
s_running_bios = false;
s_cheat_list.reset(); s_cheat_list.reset();
s_state = State::Shutdown; s_state = State::Shutdown;

View File

@ -170,6 +170,7 @@ void IncrementInternalFrameNumber();
const std::string& GetRunningPath(); const std::string& GetRunningPath();
const std::string& GetRunningCode(); const std::string& GetRunningCode();
const std::string& GetRunningTitle(); const std::string& GetRunningTitle();
bool IsRunningBIOS();
// TODO: Move to PerformanceMetrics // TODO: Move to PerformanceMetrics
float GetFPS(); float GetFPS();