GX2: Check actual connection status in GX2SetDRCConnectCallback

Fixes Just Dance 2018 not reacting to any GamePad input
This commit is contained in:
Exzap
2026-09-20 09:29:08 +02:00
parent 14e74ea33f
commit 0d8ff87b6b

View File

@@ -7,6 +7,7 @@
#include "Cafe/OS/libs/coreinit/coreinit_Thread.h"
#include "Cafe/CafeSystem.h"
#include "Cafe/HW/Latte/Core/LattePM4.h"
#include "input/InputManager.h"
#include "GX2_Command.h"
#include "GX2_State.h"
@@ -264,7 +265,14 @@ void gx2Export_GX2SetDRCConnectCallback(PPCInterpreter_t* hCPU)
ppcDefineParamMEMPTR(callback, void, 1);
cemuLog_log(LogType::GX2, "GX2SetDRCConnectCallback({}, 0x{:08x})", channel, callback.GetMPTR());
if(callback.GetPtr())
PPCCoreCallback(callback, channel, TRUE);
{
// force channel 0 to always be present (like VPADRead) but the second GamePad must actually be configured
// note - Just Dance 2018 refuses input if we trigger the callback for second GamePad here
bool connected = InputManager::instance().get_vpad_controller(channel) != nullptr;
if (channel == 0)
connected = true;
PPCCoreCallback(callback, channel, connected ? 1 : 0);
}
osLib_returnFromFunction(hCPU, 0);
}