Migrate SConfig::m_is_mios to System.

This commit is contained in:
Admiral H. Curtiss 2024-01-30 03:45:17 +01:00
parent e1ec47b504
commit 8d515d407c
No known key found for this signature in database
GPG Key ID: F051B4C4044F33FB
7 changed files with 16 additions and 12 deletions

View File

@ -60,13 +60,13 @@ bool BootCore(std::unique_ptr<BootParameters> boot, const WindowSystemInfo& wsi)
if (!boot)
return false;
auto& system = Core::System::GetInstance();
SConfig& StartUp = SConfig::GetInstance();
if (!StartUp.SetPathsAndGameMetadata(*boot))
if (!StartUp.SetPathsAndGameMetadata(system, *boot))
return false;
// Movie settings
auto& system = Core::System::GetInstance();
auto& movie = system.GetMovie();
if (movie.IsPlayingInput() && movie.IsConfigSaved())
{

View File

@ -335,9 +335,9 @@ private:
DiscIO::Region* region;
};
bool SConfig::SetPathsAndGameMetadata(const BootParameters& boot)
bool SConfig::SetPathsAndGameMetadata(Core::System& system, const BootParameters& boot)
{
m_is_mios = false;
system.SetIsMIOS(false);
m_disc_booted_from_game_list = false;
if (!std::visit(SetGameMetadata(this, &m_region), boot.parameters))
return false;

View File

@ -22,7 +22,8 @@ class IniFile;
namespace Core
{
class CPUThreadGuard;
}
class System;
} // namespace Core
namespace DiscIO
{
@ -52,7 +53,6 @@ struct SConfig
bool bCopyWiiSaveNetplay = true;
bool bWii = false;
bool m_is_mios = false;
DiscIO::Region m_region;
@ -80,7 +80,7 @@ struct SConfig
void LoadDefaults();
static std::string MakeGameID(std::string_view file_name);
bool SetPathsAndGameMetadata(const BootParameters& boot);
bool SetPathsAndGameMetadata(Core::System& system, const BootParameters& boot);
DiscIO::Language GetCurrentLanguage(bool wii) const;
DiscIO::Language GetLanguageAdjustedForRegion(bool wii, DiscIO::Region region) const;
std::string GetGameTDBImageRegionCode(bool wii, DiscIO::Region region) const;

View File

@ -11,7 +11,6 @@
#include "Common/Config/Config.h"
#include "Core/Config/MainSettings.h"
#include "Core/ConfigManager.h"
#include "Core/Core.h"
#include "Core/GeckoCode.h"
#include "Core/HLE/HLE_Misc.h"
@ -85,7 +84,7 @@ void PatchFixedFunctions(Core::System& system)
// that get patched by MIOS. See https://bugs.dolphin-emu.org/issues/11952 for more info.
// Not applying the Gecko HLE patches means that Gecko codes will not work under MIOS,
// but this is better than the alternative of having specific games crash.
if (SConfig::GetInstance().m_is_mios)
if (system.IsMIOS())
return;
// HLE jump to loader (homebrew). Disabled when Gecko is active as it interferes with the code

View File

@ -101,7 +101,7 @@ bool Load(Core::System& system)
memory.Write_U32(0x00000000, ADDRESS_INIT_SEMAPHORE);
NOTICE_LOG_FMT(IOS, "IPL ready.");
SConfig::GetInstance().m_is_mios = true;
system.SetIsMIOS(true);
system.GetDVDInterface().UpdateRunningGameMetadata();
SConfig::OnNewTitleLoad(guard);
return true;

View File

@ -139,7 +139,9 @@ void EnableCompression(bool compression)
static void DoState(PointerWrap& p)
{
bool is_wii = SConfig::GetInstance().bWii || SConfig::GetInstance().m_is_mios;
auto& system = Core::System::GetInstance();
bool is_wii = SConfig::GetInstance().bWii || system.IsMIOS();
const bool is_wii_currently = is_wii;
p.Do(is_wii);
if (is_wii != is_wii_currently)
@ -152,7 +154,6 @@ static void DoState(PointerWrap& p)
}
// Check to make sure the emulated memory sizes are the same as the savestate
auto& system = Core::System::GetInstance();
auto& memory = system.GetMemory();
u32 state_mem1_size = memory.GetRamSizeReal();
u32 state_mem2_size = memory.GetExRamSizeReal();

View File

@ -135,6 +135,9 @@ public:
bool IsDualCoreMode() const { return m_separate_cpu_and_gpu_threads; }
bool IsMMUMode() const { return m_mmu_enabled; }
bool IsPauseOnPanicMode() const { return m_pause_on_panic_enabled; }
bool IsMIOS() const { return m_is_mios; }
void SetIsMIOS(bool is_mios) { m_is_mios = is_mios; }
SoundStream* GetSoundStream() const;
void SetSoundStream(std::unique_ptr<SoundStream> sound_stream);
@ -188,5 +191,6 @@ private:
bool m_separate_cpu_and_gpu_threads = false;
bool m_mmu_enabled = false;
bool m_pause_on_panic_enabled = false;
bool m_is_mios = false;
};
} // namespace Core