diff --git a/src/xenia/kernel/xam/xam_info.cc b/src/xenia/kernel/xam/xam_info.cc index 815f4180c..f9d7fbfe9 100644 --- a/src/xenia/kernel/xam/xam_info.cc +++ b/src/xenia/kernel/xam/xam_info.cc @@ -36,6 +36,11 @@ SHIM_CALL XamGetSystemVersion_shim(PPCContext* ppc_context, SHIM_SET_RETURN_32(0); } +void XCustomRegisterDynamicActions() { + // ??? +} +DECLARE_XAM_EXPORT(XCustomRegisterDynamicActions, ExportTag::kStub); + SHIM_CALL XGetAVPack_shim(PPCContext* ppc_context, KernelState* kernel_state) { // DWORD // Not sure what the values are for this, but 6 is VGA. @@ -97,16 +102,9 @@ dword_result_t XamLoaderSetLaunchData(lpvoid_t data, dword_t size) { auto xam = kernel_state()->GetKernelModule("xam.xex"); auto& loader_data = xam->loader_data(); - if (loader_data.launch_data_ptr) { - kernel_memory()->SystemHeapFree(loader_data.launch_data_ptr); - } - loader_data.launch_data_present = size ? true : false; - loader_data.launch_data_ptr = kernel_memory()->SystemHeapAlloc(size); - loader_data.launch_data_size = size; - - std::memcpy(kernel_memory()->TranslateVirtual(loader_data.launch_data_ptr), - data, size); + loader_data.launch_data.resize(size); + std::memcpy(loader_data.launch_data.data(), data, size); // FIXME: Unknown return value. return 0; @@ -118,7 +116,7 @@ dword_result_t XamLoaderGetLaunchDataSize(lpdword_t size_ptr) { auto& loader_data = xam->loader_data(); if (loader_data.launch_data_present) { - *size_ptr = xam->loader_data().launch_data_size; + *size_ptr = uint32_t(xam->loader_data().launch_data.size()); return X_ERROR_SUCCESS; } @@ -134,16 +132,9 @@ dword_result_t XamLoaderGetLaunchData(lpvoid_t buffer_ptr, return X_ERROR_NOT_FOUND; } - if (loader_data.launch_data_ptr) { - uint8_t* loader_buffer_ptr = - kernel_memory()->TranslateVirtual(loader_data.launch_data_ptr); - - uint32_t copy_size = - std::min(loader_data.launch_data_size, (uint32_t)buffer_size); - - std::memcpy(buffer_ptr, loader_buffer_ptr, copy_size); - } - + uint32_t copy_size = + std::min(uint32_t(loader_data.launch_data.size()), uint32_t(buffer_size)); + std::memcpy(buffer_ptr, loader_data.launch_data.data(), copy_size); return X_ERROR_SUCCESS; } DECLARE_XAM_EXPORT(XamLoaderGetLaunchData, ExportTag::kSketchy); diff --git a/src/xenia/kernel/xam/xam_module.h b/src/xenia/kernel/xam/xam_module.h index a3ebc2598..8c9fd6550 100644 --- a/src/xenia/kernel/xam/xam_module.h +++ b/src/xenia/kernel/xam/xam_module.h @@ -30,8 +30,7 @@ class XamModule : public KernelModule { struct LoaderData { bool launch_data_present = false; - uint32_t launch_data_ptr = 0; - uint32_t launch_data_size = 0; + std::vector launch_data; uint32_t launch_flags = 0; std::string launch_path; // Full path to next xex };