MCPcopy Create free account
hub / github.com/cemu-project/Cemu / SetupExecutable

Function SetupExecutable

src/Cafe/CafeSystem.cpp:727–760  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

725 }
726
727 PREPARE_STATUS_CODE SetupExecutable()
728 {
729 // set rpx path from cos.xml if available
730 _pathToBaseExecutable = _pathToExecutable;
731 if (!sLaunchModeIsStandalone)
732 {
733 std::string _argstr = CafeSystem::GetForegroundTitleArgStr();
734 const char* argstr = _argstr.c_str();
735 if (argstr && *argstr != '\0')
736 {
737 const std::string tmp = argstr;
738 const auto index = tmp.find(".rpx");
739 if (index != std::string::npos)
740 {
741 fs::path rpx = _pathToExecutable;
742 rpx.replace_filename(tmp.substr(0, index + 4)); // cut off after .rpx
743
744 std::string rpxPath;
745 rpxPath = "/internal/current_title/code/";
746 rpxPath.append(rpx.generic_string());
747
748 int status;
749 const auto file = fsc_open(rpxPath.c_str(), FSC_ACCESS_FLAG::OPEN_FILE | FSC_ACCESS_FLAG::READ_PERMISSION, &status);
750 if (file)
751 {
752 _pathToExecutable = std::move(rpxPath);
753 fsc_close(file);
754 }
755 }
756 }
757 }
758 LoadMainExecutable();
759 return PREPARE_STATUS_CODE::SUCCESS;
760 }
761
762 void SetupMemorySpace()
763 {

Callers 2

PrepareForegroundTitleFunction · 0.85

Calls 7

GetForegroundTitleArgStrFunction · 0.85
fsc_openFunction · 0.85
fsc_closeFunction · 0.85
LoadMainExecutableFunction · 0.85
c_strMethod · 0.45
findMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected