From 4d75a6c79d02aea6f85a244faae4e7ad5dc7282f Mon Sep 17 00:00:00 2001 From: Luke Usher Date: Sun, 28 May 2017 16:31:55 +0100 Subject: [PATCH] JSRF Hack: Prevent crash after XGetDeviceChanges --- src/CxbxKrnl/EmuXapi.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/CxbxKrnl/EmuXapi.cpp b/src/CxbxKrnl/EmuXapi.cpp index 804eed60d..ca35c439f 100644 --- a/src/CxbxKrnl/EmuXapi.cpp +++ b/src/CxbxKrnl/EmuXapi.cpp @@ -193,6 +193,17 @@ BOOL WINAPI XTL::EMUPATCH(XGetDeviceChanges) BOOL ret = FALSE; + // JSRF Hack: Always return no device changes + // Without this, JSRF hard crashes sometime after calling this function + // I HATE game specific hacks, but I've wasted three weeks trying to solve this already + // TitleID 0x49470018 = JSRF NTSC-U + // TitleID 0x5345000A = JSRF PAL + // ~Luke Usher + Xbe::Certificate *pCertificate = (Xbe::Certificate*)CxbxKrnl_XbeHeader->dwCertificateAddr; + if (pCertificate->dwTitleId == 0x49470018 || pCertificate->dwTitleId == 0x5345000A) { + RETURN(ret); + } + // If we have no connected devices, report one insertion if (DeviceType->CurrentConnected == 0) { *pdwInsertions = 1;