mirror of
https://github.com/cemu-project/Cemu.git
synced 2026-08-27 20:44:00 -05:00
custom argstr for non-standalone titles, cos names
- renamed cli flags (and their associated API functions as requested) - title arguments can now apply to non standalone titles. - are cleared after first RPX is launched.
This commit is contained in:
@@ -687,7 +687,7 @@ namespace CafeSystem
|
||||
|
||||
void MountExtras()
|
||||
{
|
||||
for (const auto& [host_path, emulatedPath] : LaunchSettings::ExtraMounts())
|
||||
for (const auto& [host_path, emulatedPath] : LaunchSettings::CosMounts())
|
||||
{
|
||||
FSCDeviceHostFS_Mount(boost::nowide::narrow(emulatedPath), _pathToUtf8(host_path), FSC_PRIORITY_BASE);
|
||||
}
|
||||
@@ -695,7 +695,7 @@ namespace CafeSystem
|
||||
|
||||
void UnmountExtras()
|
||||
{
|
||||
for (const auto& [_, emulatedPath] : LaunchSettings::ExtraMounts())
|
||||
for (const auto& [_, emulatedPath] : LaunchSettings::CosMounts())
|
||||
{
|
||||
fsc_unmount(boost::nowide::narrow(emulatedPath), FSC_PRIORITY_BASE);
|
||||
}
|
||||
@@ -978,13 +978,11 @@ namespace CafeSystem
|
||||
|
||||
std::string GetForegroundTitleArgStr()
|
||||
{
|
||||
auto optional_arguments = LaunchSettings::CosArgstr();
|
||||
if (optional_arguments.has_value())
|
||||
return *optional_arguments;
|
||||
if (sLaunchModeIsStandalone)
|
||||
{
|
||||
auto optional_arguments = LaunchSettings::StandaloneTitleArguments();
|
||||
if (optional_arguments.has_value())
|
||||
return *optional_arguments;
|
||||
return "";
|
||||
}
|
||||
auto& update = sGameInfo_ForegroundTitle.GetUpdate();
|
||||
if (update.IsValid())
|
||||
return update.GetArgStr();
|
||||
@@ -1067,25 +1065,26 @@ namespace CafeSystem
|
||||
{
|
||||
if(!sSystemRunning)
|
||||
return;
|
||||
coreinit::OSSchedulerEnd();
|
||||
Latte_Stop();
|
||||
// reset Cafe OS userspace modules
|
||||
snd_core::reset();
|
||||
coreinit::OSAlarm_Shutdown();
|
||||
GX2::_GX2DriverReset();
|
||||
nn::save::ResetToDefaultState();
|
||||
coreinit::__OSDeleteAllActivePPCThreads();
|
||||
RPLLoader_UnloadAll();
|
||||
coreinit::OSSchedulerEnd();
|
||||
Latte_Stop();
|
||||
// reset Cafe OS userspace modules
|
||||
snd_core::reset();
|
||||
coreinit::OSAlarm_Shutdown();
|
||||
GX2::_GX2DriverReset();
|
||||
nn::save::ResetToDefaultState();
|
||||
coreinit::__OSDeleteAllActivePPCThreads();
|
||||
RPLLoader_UnloadAll();
|
||||
for(auto it = s_iosuModules.rbegin(); it != s_iosuModules.rend(); ++it)
|
||||
(*it)->TitleStop();
|
||||
// reset Cemu subsystems
|
||||
PPCRecompiler_Shutdown();
|
||||
GraphicPack2::Reset();
|
||||
UnmountCurrentTitle();
|
||||
UnmountExtras();
|
||||
MlcStorageUnmountAllTitles();
|
||||
UnmountBaseDirectories();
|
||||
DestroyMemorySpace();
|
||||
// reset Cemu subsystems
|
||||
PPCRecompiler_Shutdown();
|
||||
GraphicPack2::Reset();
|
||||
UnmountCurrentTitle();
|
||||
UnmountExtras();
|
||||
MlcStorageUnmountAllTitles();
|
||||
UnmountBaseDirectories();
|
||||
DestroyMemorySpace();
|
||||
LaunchSettings::ClearCosArgstr();
|
||||
sSystemRunning = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -71,9 +71,9 @@ bool LaunchSettings::HandleCommandline(const std::vector<std::wstring>& args)
|
||||
|
||||
("account,a", po::value<std::string>(), "Persistent id of account")
|
||||
|
||||
("extra-mounts", po::wvalue<std::vector<std::wstring>>()->composing(), "A series of mounts in the form of: (path on host:path within emulated system, e.g. `/tmp:/vol/temporary/`)")
|
||||
("cos-mounts", po::wvalue<std::vector<std::wstring>>()->composing(), "A series of mounts in the form of: (path on host:path within emulated system, e.g. `/tmp:/vol/temporary/`)")
|
||||
("forward-console-logging", "Forward OSReport, OSConsoleWrite, etc. to stdout/stderr.")
|
||||
("standalone-title-arguments", po::value<std::string>(), "Custom arguments to pass as arguments to a standalone RPX that is launched.")
|
||||
("cos-argstr", po::value<std::string>(), "A custom argstr used to override to the arguments to the first RPX that is launched, will be unset after the first launch.")
|
||||
|
||||
("force-interpreter", po::value<bool>()->implicit_value(true), "Force interpreter CPU emulation, disables recompiler. Useful for debugging purposes where you want to get accurate memory accesses and stack traces.")
|
||||
("force-multicore-interpreter", po::value<bool>()->implicit_value(true), "Force multi-core interpreter CPU emulation, disables recompiler. Only useful for getting stack traces, but slightly faster than the single-core interpreter mode.")
|
||||
@@ -199,12 +199,12 @@ bool LaunchSettings::HandleCommandline(const std::vector<std::wstring>& args)
|
||||
s_forward_console_logging = true;
|
||||
}
|
||||
|
||||
if (vm.count("standalone-title-arguments"))
|
||||
s_standalone_title_arguments = vm["standalone-title-arguments"].as<std::string>();
|
||||
if (vm.count("cos-argstr"))
|
||||
s_cos_argstr = vm["cos-argstr"].as<std::string>();
|
||||
|
||||
if (vm.count("extra-mounts"))
|
||||
if (vm.count("cos-mounts"))
|
||||
{
|
||||
for (const auto& argument : vm["extra-mounts"].as<std::vector<std::wstring>>())
|
||||
for (const auto& argument : vm["cos-mounts"].as<std::vector<std::wstring>>())
|
||||
{
|
||||
size_t colon_location = argument.find(L':');
|
||||
if (colon_location == std::wstring::npos)
|
||||
@@ -213,7 +213,7 @@ bool LaunchSettings::HandleCommandline(const std::vector<std::wstring>& args)
|
||||
continue;
|
||||
}
|
||||
|
||||
s_extra_mounts[argument.substr(0, colon_location)] = argument.substr(colon_location + 1);
|
||||
s_cos_mounts[argument.substr(0, colon_location)] = argument.substr(colon_location + 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,8 +26,9 @@ public:
|
||||
static bool Verbose() { return s_verbose; }
|
||||
|
||||
static bool ForwardConsoleLogging() { return s_forward_console_logging; }
|
||||
static std::optional<std::string> StandaloneTitleArguments() { return s_standalone_title_arguments; }
|
||||
static std::unordered_map<fs::path, std::wstring>& ExtraMounts() { return s_extra_mounts; }
|
||||
static std::optional<std::string> CosArgstr() { return s_cos_argstr; }
|
||||
static void ClearCosArgstr() { s_cos_argstr.reset(); }
|
||||
static std::unordered_map<fs::path, std::wstring>& CosMounts() { return s_cos_mounts; }
|
||||
|
||||
static bool GDBStubEnabled() { return s_enable_gdbstub; }
|
||||
static bool NSightModeEnabled() { return s_nsight_mode; }
|
||||
@@ -51,8 +52,8 @@ private:
|
||||
inline static bool s_verbose = false;
|
||||
|
||||
inline static bool s_forward_console_logging = false;
|
||||
inline static std::optional<std::string> s_standalone_title_arguments{};
|
||||
inline static std::unordered_map<fs::path, std::wstring> s_extra_mounts{};
|
||||
inline static std::optional<std::string> s_cos_argstr{};
|
||||
inline static std::unordered_map<fs::path, std::wstring> s_cos_mounts{};
|
||||
|
||||
inline static bool s_enable_gdbstub = false;
|
||||
inline static bool s_nsight_mode = false;
|
||||
|
||||
Reference in New Issue
Block a user