diff --git a/src/common/xbe/Xbe.cpp b/src/common/xbe/Xbe.cpp index 9e1e11323..6c03ae6e0 100644 --- a/src/common/xbe/Xbe.cpp +++ b/src/common/xbe/Xbe.cpp @@ -46,7 +46,7 @@ extern "C" void CxbxKrnlPrintUEM(ULONG); #endif // construct via Xbe file -Xbe::Xbe(const char *x_szFilename, bool bFromGUI) +Xbe::Xbe(const char *x_szFilename) { char szBuffer[MAX_PATH]; @@ -63,14 +63,15 @@ Xbe::Xbe(const char *x_szFilename, bool bFromGUI) // NOTE: the check for the existence of the child window is necessary because the user could have previously loaded the dashboard, // removed/changed the path and attempt to load it again from the recent list, which will crash CxbxInitWindow below - // Note that GetHwnd(), CxbxKrnl_hEmuParent and HalReturnToFirmware are all not suitable here for various reasons - if (XbeName.compare(std::string("xboxdash.xbe")) == 0 + // Note that GetHwnd(), CxbxKrnl_hEmuParent and HalReturnToFirmware are all not suitable here for various reasons #ifdef CXBXR_EMU - && !bFromGUI - ) { + if (XbeName.compare(std::string("xboxdash.xbe")) == 0) { // The dashboard could not be found on partition2. This is a fatal error on the Xbox so we display the UEM. The // error code is different if we have a launch data page + // This is necessary because CxbxInitWindow internally calls g_AffinityPolicy->SetAffinityOther. If we are launched directly from the command line and the dashboard + // cannot be opened, we will crash below because g_AffinityPolicy will be empty + g_AffinityPolicy = AffinityPolicy::InitPolicy(); CxbxInitWindow(false); ULONG FatalErrorCode = FATAL_ERROR_XBE_DASH_GENERIC; @@ -86,13 +87,13 @@ Xbe::Xbe(const char *x_szFilename, bool bFromGUI) // TODO: FATAL_ERROR_XBE_DASH_X2_PASS (requires DVD drive authentication emulation...) } else { -#else - ) { #endif // Report which xbe could not be found SetFatalError(std::string("Could not open the Xbe file ") + XbeName); return; +#ifdef CXBXR_EMU } +#endif } printf("OK\n"); diff --git a/src/common/xbe/Xbe.h b/src/common/xbe/Xbe.h index 81d8dfe3e..6e4b913f0 100644 --- a/src/common/xbe/Xbe.h +++ b/src/common/xbe/Xbe.h @@ -50,7 +50,7 @@ class Xbe : public Error { public: // construct via Xbe file - Xbe(const char *x_szFilename, bool bFromGUI); + Xbe(const char *x_szFilename); // deconstructor ~Xbe(); diff --git a/src/core/kernel/init/CxbxKrnl.cpp b/src/core/kernel/init/CxbxKrnl.cpp index 9fd11d04d..d1381bb76 100644 --- a/src/core/kernel/init/CxbxKrnl.cpp +++ b/src/core/kernel/init/CxbxKrnl.cpp @@ -640,7 +640,7 @@ static bool CxbxrKrnlXbeSystemSelector(int BootFlags, unsigned& reserved_systems } #endif // Chihiro wip block - CxbxKrnl_Xbe = new Xbe(xbePath.c_str(), false); // TODO : Instead of using the Xbe class, port Dxbx _ReadXbeBlock() + CxbxKrnl_Xbe = new Xbe(xbePath.c_str()); // TODO : Instead of using the Xbe class, port Dxbx _ReadXbeBlock() if (CxbxKrnl_Xbe->HasFatalError()) { CxbxrAbort(CxbxKrnl_Xbe->GetError().c_str()); diff --git a/src/gui/WndMain.cpp b/src/gui/WndMain.cpp index 3aec49882..5e609d3ed 100644 --- a/src/gui/WndMain.cpp +++ b/src/gui/WndMain.cpp @@ -1934,7 +1934,7 @@ void WndMain::OpenXbe(const char *x_filename) strcpy(m_XbeFilename, x_filename); - m_Xbe = new Xbe(m_XbeFilename, true); + m_Xbe = new Xbe(m_XbeFilename); if(m_Xbe->HasError()) {