Merge pull request #2297 from ergo720/jedi_fix

Simulate correctly the USB enumeration process in XGetDevices
This commit is contained in:
RadWolfie 2021-12-12 15:40:16 -06:00 committed by GitHub
commit e77404472e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -551,7 +551,15 @@ xbox::dword_xt WINAPI xbox::EMUPATCH(XGetDevices)
g_bXppGuard = true;
if (g_bIsDevicesInitializing || g_bIsDevicesEmulating) {
// When simulating the initialization lag of XInitDevices, always report no devices to simulate the USB enumeration process
// Test case: Star Wars Jedi Knight: Jedi Academy
if (g_bIsDevicesInitializing) {
g_bXppGuard = false;
RETURN(0);
}
// Happens during device hotplug, report the last known connectivity status
if (g_bIsDevicesEmulating) {
g_bXppGuard = false;
RETURN(DeviceType->CurrentConnected);
}