Skip to content

Add all padscore functions.#445

Open
dkosmari wants to merge 4 commits intodevkitPro:masterfrom
dkosmari:complete-padscore
Open

Add all padscore functions.#445
dkosmari wants to merge 4 commits intodevkitPro:masterfrom
dkosmari:complete-padscore

Conversation

@dkosmari
Copy link
Copy Markdown
Contributor

@dkosmari dkosmari commented May 4, 2026

This adds declarations for all padscore functions listed in padscore.def, even the stubs.

  • Added all WPAD functions.
  • Added all KPAD functions, and documentation.
  • Changed KPADStatus::mplus to have all directions in a KPADBase3D struct.

The functions I could not figure out entirely, I just made sure the arguments match the usage in the implementation, through ghidra.

- Added all KPAD functions.
- Changed KPADStatus::mplus to have all directions in a KPADBase3D struct.
Copy link
Copy Markdown
Contributor

@GaryOderNichts GaryOderNichts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!
I think all the functions which are completely unknown or have parameters with unknown types, shouldn't be included for now (e.g. WUDSerialFlash*, WUDSetSniffMode, etc.). Once these have been fully figured out they can be added with a separate PR.

Comment thread include/padscore/kpad.h Outdated
Comment thread include/padscore/kpad.h Outdated
Comment thread include/padscore/kpad.h
Comment thread include/padscore/kpad.h Outdated
Comment thread include/padscore/kpad.h Outdated
Comment thread include/padscore/wpad.h Outdated
Comment on lines +1519 to +1538
/**
* Called by `WPADInit()`.
*/
void
wpad_im_setup(void);

void
wpad_im_state_active(WPADChan chan);

void
wpad_im_state_home(uint32_t type, uint32_t unknown);

void
wpad_im_state_inactive(WPADChan chan);

void
wpad_im_state_power(void);

void
wpad_im_teardown(void);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like these should be moved below all the regular user-facing WPAD functions, if added at all.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My reasoning was to have 100% of the exported symbols there. There are already other internal functions in the header.
I tried to keep the order alphabetical, without sorting the existing functions. I think somebody can find the best aesthetics for ordering the headers later.

Comment thread include/padscore/wpad.h Outdated
Comment thread include/padscore/wpad.h Outdated
Comment thread include/padscore/wpad.h Outdated
Comment thread include/padscore/wpad.h Outdated
Daniel K. O. (dkosmari) added 3 commits May 4, 2026 19:43
- Replaced snake_case vars with camelCase.
- Removed leftover comment.
- Fixed `WPADClearDeviceCallback` to take a `uint32_t` argument.
- Fixed second argument of `WPADSyncDeviceCallback` to be uknown `uint32_t`.
- Fixed return type of `WPADiControllerInfoInNand` to be `BOOL`.
@dkosmari
Copy link
Copy Markdown
Contributor Author

dkosmari commented May 4, 2026

I think all the functions which are completely unknown or have parameters with unknown types, shouldn't be included for now (e.g. WUDSerialFlash*, WUDSetSniffMode, etc.). Once these have been fully figured out they can be added with a separate PR.

What harm does it do? We have plenty of functions and structs with unknown arguments, fields in wut.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants