Implement XamLoaderLaunchTitle and other loader functions.

This commit is contained in:
Dr. Chat
2015-07-05 15:44:46 -05:00
parent d6686fc345
commit 39d6e9a20f
4 changed files with 113 additions and 39 deletions

View File

@@ -274,10 +274,29 @@ X_STATUS Emulator::LaunchStfsContainer(std::wstring path) {
X_STATUS Emulator::CompleteLaunch(const std::wstring& path,
const std::string& module_path) {
// Allow xam to request module loads.
auto xam_module = kernel_state_->GetModule("xam.xex");
auto xam = kernel::object_ref<kernel::XamModule>(
reinterpret_cast<kernel::XamModule*>(xam_module.release()));
auto xboxkrnl_module = kernel_state_->GetModule("xboxkrnl.exe");
auto xboxkrnl = kernel::object_ref<kernel::XboxkrnlModule>(
reinterpret_cast<kernel::XboxkrnlModule*>(xboxkrnl_module.release()));
int result = xboxkrnl->LaunchModule(module_path.c_str());
int result = 0;
auto next_module = module_path;
while (next_module != "") {
XELOGI("Launching module %s", next_module.c_str());
result = xboxkrnl->LaunchModule(next_module.c_str());
// Check xam and see if they want us to load another module.
auto& loader_data = xam->loader_data();
next_module = loader_data.launch_path;
// And blank out the launch path to avoid an infinite loop.
loader_data.launch_path = "";
}
if (result == 0) {
return X_STATUS_SUCCESS;
} else {