Skip to content

Add all padscore functions.#445

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

Add all padscore functions.#445
dkosmari wants to merge 5 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 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.

@GaryOderNichts
Copy link
Copy Markdown
Contributor

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

I'm currently going through some of the WUD functions for Bloopair, and it seems like some of the functions parameters have the wrong types in some places (e.g. pointers instead of enums/integers). This requires awkward casts of integer values to pointers. Fixing the parameters later on would then raise compiler warnings/errors in existing code.
I don't mind functions or structs with a few unknown parameters or members, but I don't see the purpose of adding a function where all parameters and the usage are unknown.

Anyways, what do you think about moving WUD* functions into a separate wud.h?
I can follow up with a PR which fixes the parameters.

- Some doxygen changes (grammar, conjugation, formatting, broken link.)
@dkosmari
Copy link
Copy Markdown
Contributor Author

dkosmari commented May 5, 2026

Moved the WUD* functions into wud.h.

In my opinion, "being usable" should be the only requirement for unknown functions, even if forcing a wrong typecast. If that becomes a bother to someone actually using the function, they can upstream what the correct types are, instead of just keeping a private extern "C" ... declaration in their own repos.

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