From d89ddabd0175b9b23147baabda612d9bc0bf95ad Mon Sep 17 00:00:00 2001 From: Luke Usher Date: Fri, 10 Mar 2017 23:49:56 +0000 Subject: [PATCH] Fixes to the new LaunchDataPage implementation --- src/CxbxKrnl/EmuKrnlHal.cpp | 1 + src/CxbxKrnl/EmuXapi.cpp | 21 ++++++++++----------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/CxbxKrnl/EmuKrnlHal.cpp b/src/CxbxKrnl/EmuKrnlHal.cpp index 4a18c1485..32686d9b2 100644 --- a/src/CxbxKrnl/EmuKrnlHal.cpp +++ b/src/CxbxKrnl/EmuKrnlHal.cpp @@ -454,6 +454,7 @@ XBSYSAPI EXPORTNUM(49) xboxkrnl::VOID DECLSPEC_NORETURN xboxkrnl::HalReturnToFir CxbxKrnlCleanup("Could not launch %s", lpTitlePath); } } + break; }; case ReturnFirmwareHard: diff --git a/src/CxbxKrnl/EmuXapi.cpp b/src/CxbxKrnl/EmuXapi.cpp index 0dd04b08d..e49bc68b7 100644 --- a/src/CxbxKrnl/EmuXapi.cpp +++ b/src/CxbxKrnl/EmuXapi.cpp @@ -934,18 +934,17 @@ DWORD WINAPI XTL::EMUPATCH(XLaunchNewImage) if (xboxkrnl::LaunchDataPage == NULL) xboxkrnl::LaunchDataPage = (xboxkrnl::LAUNCH_DATA_PAGE *)xboxkrnl::MmAllocateContiguousMemory(sizeof(xboxkrnl::LAUNCH_DATA_PAGE)); - if (lpTitlePath != NULL) - // Without a title, return to dashboard : - xboxkrnl::LaunchDataPage->Header.dwLaunchDataType = LDT_TITLE; - else - { - Xbe::Certificate *pCertificate = (Xbe::Certificate*)CxbxKrnl_XbeHeader->dwCertificateAddr; - xboxkrnl::LaunchDataPage->Header.dwTitleId = pCertificate->dwTitleId; - xboxkrnl::LaunchDataPage->Header.dwFlags = 0; // TODO : What to put in here? - if (pLaunchData != NULL) - // Save the launch data - memcpy(&(xboxkrnl::LaunchDataPage->LaunchData[0]), pLaunchData, sizeof(LAUNCH_DATA)); + Xbe::Certificate *pCertificate = (Xbe::Certificate*)CxbxKrnl_XbeHeader->dwCertificateAddr; + xboxkrnl::LaunchDataPage->Header.dwTitleId = pCertificate->dwTitleId; + xboxkrnl::LaunchDataPage->Header.dwFlags = 0; // TODO : What to put in here? + xboxkrnl::LaunchDataPage->Header.dwLaunchDataType = LDT_TITLE; + if (pLaunchData != NULL) + // Save the launch data + memcpy(&(xboxkrnl::LaunchDataPage->LaunchData[0]), pLaunchData, sizeof(LAUNCH_DATA)); + + if (lpTitlePath == NULL) + { // If no path is specified, then the xbe is rebooting to dashboard char szDashboardPath[MAX_PATH] = { 0 }; XboxDevice* rootDevice = CxbxDeviceByDevicePath(DeviceHarddisk0Partition2);