Skip to content

Commit

Permalink
vpad: Keep second channel empty if no extra GamePad is configured
Browse files Browse the repository at this point in the history
  • Loading branch information
Exzap committed Aug 15, 2024
1 parent 294a6de commit 958137a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
1 change: 0 additions & 1 deletion src/Cafe/OS/libs/padscore/padscore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,6 @@ void padscoreExport_KPADReadEx(PPCInterpreter_t* hCPU)
osLib_returnFromFunction(hCPU, samplesRead);
}

bool debugUseDRC1 = true;
void padscoreExport_KPADRead(PPCInterpreter_t* hCPU)
{
ppcDefineParamU32(channel, 0);
Expand Down
24 changes: 11 additions & 13 deletions src/Cafe/OS/libs/vpad/vpad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@

extern bool isLaunchTypeELF;

bool debugUseDRC = true;
VPADDir g_vpadGyroDirOverwrite[VPAD_MAX_CONTROLLERS] =
{
{{1.0f,0.0f,0.0f}, {0.0f,1.0f,0.0f}, {0.0f, 0.0f, 0.1f}},
Expand Down Expand Up @@ -240,19 +239,20 @@ namespace vpad
status->tpProcessed2.validity = VPAD_TP_VALIDITY_INVALID_XY;

const auto controller = InputManager::instance().get_vpad_controller(channel);
if (!controller || debugUseDRC == false)
if (!controller)
{
// no controller
// most games expect the Wii U GamePad to be connected, so even if the user has not set it up we should still return empty samples for channel 0
if(channel != 0)
{
if (error)
*error = VPAD_READ_ERR_NO_CONTROLLER;
if (length > 0)
status->vpadErr = -1;
return 0;
}
if (error)
*error = VPAD_READ_ERR_NONE; // VPAD_READ_ERR_NO_DATA; // VPAD_READ_ERR_NO_CONTROLLER;

*error = VPAD_READ_ERR_NONE;
return 1;
//osLib_returnFromFunction(hCPU, 1); return;
}

if (channel != 0)
{
debugBreakpoint();
}

const bool vpadDelayEnabled = ActiveSettings::VPADDelayEnabled();
Expand All @@ -274,9 +274,7 @@ namespace vpad
// not ready yet
if (error)
*error = VPAD_READ_ERR_NONE;

return 0;
//osLib_returnFromFunction(hCPU, 0); return;
}
else if (dif <= ESPRESSO_TIMER_CLOCK)
{
Expand Down

0 comments on commit 958137a

Please sign in to comment.