Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions runtime/src/hle/input/wpad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,20 @@ extern "C" int32_t WUDGetStatus_HLE()
}
PPC_NATIVE_OVERRIDE(801CDB84, WUDGetStatus_HLE, int32_t, (), ());

// WPADGetDataFormat reads the per-channel format set by WPADSetDataFormat. Can't reuse the
// translated SDK implementation: it dereferences Bluetooth control blocks that HLE'd WPADInit
// never constructs.
// WPADGetDataFormat: the format KPAD runs the attached extension in (WPAD_FMT_*_ACC_DPD).
// WPADClampStick keys off it. Can't reuse the translated SDK implementation: it dereferences
// Bluetooth control blocks that HLE'd WPADInit never constructs.
extern "C" int32_t WPADGetDataFormat_HLE(uint32_t chan)
{
return g_state.contract.GetDataFormat(chan);
const int32_t status = g_state.contract.GetDataFormat(chan);
if (status < 0) {
return status;
}
switch (WiiRemoteInput::EffectiveKind(chan)) {
case WiiRemoteInput::Kind::RemoteWithNunchuk: return 5;
case WiiRemoteInput::Kind::RemoteWithClassic: return 8;
default: return 2;
}
}
PPC_NATIVE_OVERRIDE(801C0B54, WPADGetDataFormat_HLE, int32_t, (uint32_t chan), (chan));

Expand Down
Loading