diff --git a/libstratosphere/include/stratosphere/ams/ams_emummc_api.hpp b/libstratosphere/include/stratosphere/ams/ams_emummc_api.hpp index c919abc1..4597b2ad 100644 --- a/libstratosphere/include/stratosphere/ams/ams_emummc_api.hpp +++ b/libstratosphere/include/stratosphere/ams/ams_emummc_api.hpp @@ -22,6 +22,9 @@ namespace ams::emummc { /* Get whether emummc is active. */ bool IsActive(); + /* Get the active emummc id. */ + u32 GetActiveId(); + /* Get Nintendo redirection path. */ const char *GetNintendoDirPath(); diff --git a/libstratosphere/source/ams/ams_emummc_api.cpp b/libstratosphere/source/ams/ams_emummc_api.cpp index 02dd75f9..2c82a12d 100644 --- a/libstratosphere/source/ams/ams_emummc_api.cpp +++ b/libstratosphere/source/ams/ams_emummc_api.cpp @@ -57,10 +57,10 @@ namespace ams::emummc { }; /* Globals. */ - os::Mutex g_lock(false); - ExosphereConfig g_exo_config; - bool g_is_emummc; - bool g_has_cached; + constinit os::SdkMutex g_lock; + constinit ExosphereConfig g_exo_config; + constinit bool g_is_emummc; + constinit bool g_has_cached; /* Helpers. */ void CacheValues() { @@ -110,6 +110,12 @@ namespace ams::emummc { return g_is_emummc; } + /* Get the active emummc id. */ + u32 GetActiveId() { + CacheValues(); + return g_exo_config.base_cfg.id; + } + /* Get Nintendo redirection path. */ const char *GetNintendoDirPath() { CacheValues();