From 22a9a08b2454b48ea017e8733e69caf63f3717dd Mon Sep 17 00:00:00 2001 From: Michael M Date: Sat, 1 Jul 2017 14:08:58 -0700 Subject: [PATCH] Add Core::State::Starting --- Source/Core/Core/Core.cpp | 3 +++ Source/Core/Core/Core.h | 3 ++- Source/Core/InputCommon/GCAdapter.cpp | 2 +- Source/Core/InputCommon/GCAdapter_Android.cpp | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Source/Core/Core/Core.cpp b/Source/Core/Core/Core.cpp index 6cc3356c3f..d3d34e1ee4 100644 --- a/Source/Core/Core/Core.cpp +++ b/Source/Core/Core/Core.cpp @@ -700,6 +700,9 @@ State GetState() return State::Running; } + if (s_is_booting.IsSet()) + return State::Starting; + return State::Uninitialized; } diff --git a/Source/Core/Core/Core.h b/Source/Core/Core/Core.h index 7787023371..a796f0addf 100644 --- a/Source/Core/Core/Core.h +++ b/Source/Core/Core/Core.h @@ -31,7 +31,8 @@ enum class State Uninitialized, Paused, Running, - Stopping + Stopping, + Starting, }; bool Init(std::unique_ptr boot); diff --git a/Source/Core/InputCommon/GCAdapter.cpp b/Source/Core/InputCommon/GCAdapter.cpp index 685329a693..7a897affdc 100644 --- a/Source/Core/InputCommon/GCAdapter.cpp +++ b/Source/Core/InputCommon/GCAdapter.cpp @@ -179,7 +179,7 @@ void Init() if (s_handle != nullptr) return; - if (Core::GetState() != Core::State::Uninitialized) + if (Core::GetState() != Core::State::Uninitialized && Core::GetState() != Core::State::Starting) { if ((CoreTiming::GetTicks() - s_last_init) < SystemTimers::GetTicksPerSecond()) return; diff --git a/Source/Core/InputCommon/GCAdapter_Android.cpp b/Source/Core/InputCommon/GCAdapter_Android.cpp index 7b0c6e1545..d8628530a3 100644 --- a/Source/Core/InputCommon/GCAdapter_Android.cpp +++ b/Source/Core/InputCommon/GCAdapter_Android.cpp @@ -195,7 +195,7 @@ void Init() if (s_fd) return; - if (Core::GetState() != Core::State::Uninitialized) + if (Core::GetState() != Core::State::Uninitialized && Core::GetState() != Core::State::Starting) { if ((CoreTiming::GetTicks() - s_last_init) < SystemTimers::GetTicksPerSecond()) return;