Merge pull request #14544 from jordan-woyak/gba-always-on-thread
HW/GBACore: Make GBAs always run on dedicated threads in preparation for future improvements.
This commit is contained in:
8 files changed
+3
-29
No files matched your search
@@ -407,7 +407,6 @@ const std::array<Info<std::string>, 5> MAIN_GBA_ROM_PATHS{
|
||||
};
|
||||
const Info<std::string> MAIN_GBA_SAVES_PATH{{System::Main, "GBA", "SavesPath"}, ""};
|
||||
const Info<bool> MAIN_GBA_SAVES_IN_ROM_PATH{{System::Main, "GBA", "SavesInRomPath"}, false};
|
||||
const Info<bool> MAIN_GBA_THREADS{{System::Main, "GBA", "Threads"}, true};
|
||||
#endif
|
||||
|
||||
// Main.Network
|
||||
|
||||
@@ -227,7 +227,6 @@ extern const Info<std::string> MAIN_GBA_BIOS_PATH;
|
||||
extern const std::array<Info<std::string>, 5> MAIN_GBA_ROM_PATHS;
|
||||
extern const Info<std::string> MAIN_GBA_SAVES_PATH;
|
||||
extern const Info<bool> MAIN_GBA_SAVES_IN_ROM_PATH;
|
||||
extern const Info<bool> MAIN_GBA_THREADS;
|
||||
|
||||
static constexpr std::size_t GBPLAYER_GBA_INDEX = 4;
|
||||
#endif
|
||||
|
||||
@@ -264,12 +264,8 @@ bool Core::Start(u64 gc_ticks)
|
||||
// Notify the host and handle a dimension change if that happened after reset()
|
||||
SetVideoBuffer();
|
||||
|
||||
if (Config::Get(Config::MAIN_GBA_THREADS))
|
||||
{
|
||||
m_event_thread.Reset(fmt::format("GBA{}", m_device_number + 1),
|
||||
std::bind_front(&Core::HandleEvent, this));
|
||||
}
|
||||
|
||||
m_event_thread.Reset(fmt::format("GBA{}", m_device_number + 1),
|
||||
std::bind_front(&Core::HandleEvent, this));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -550,10 +546,7 @@ void Core::Flush()
|
||||
|
||||
void Core::PushEvent(SyncEvent event)
|
||||
{
|
||||
if (m_event_thread.IsRunning())
|
||||
m_event_thread.Push(event);
|
||||
else
|
||||
HandleEvent(event);
|
||||
m_event_thread.Push(event);
|
||||
}
|
||||
|
||||
void Core::HandleEvent(SyncEvent event)
|
||||
|
||||
Reference in new issue
Block a user