Issue 13: Minimal libpad (SIO2/PAD) stubs, input mapping and tests#69
Open
Whoneon wants to merge 3 commits intoran-j:mainfrom
Open
Issue 13: Minimal libpad (SIO2/PAD) stubs, input mapping and tests#69Whoneon wants to merge 3 commits intoran-j:mainfrom
Whoneon wants to merge 3 commits intoran-j:mainfrom
Conversation
Add a minimal libpad implementation backed by raylib input Provide override hooks for deterministic tests Add pad input tests and link runtime into test target
ran-j
requested changes
Feb 21, 2026
| void TODO_NAMED(const char *name, uint8_t *rdram, R5900Context *ctx, PS2Runtime *runtime); | ||
|
|
||
| // Test hook: override pad input for scePadRead. | ||
| void setPadOverrideState(uint16_t buttons, uint8_t lx, uint8_t ly, uint8_t rx, uint8_t ry); |
Owner
There was a problem hiding this comment.
please move this to ps2_call_list.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR wants to add a minimal libpad layer to unblock basic controller input in the runtime. It focuses on functional stubs, simple input mapping and test coverage. Remaining part of issue #13
What’s included
scePadInit,scePadPortOpen,scePadGetState, etc.)scePadReadimplementation that maps:PadInputadded to ps2x_testsWhat’s NOT included (out of scope)
Tests
ps2x_tests(52/52 passed). in details:scePadRead uses override state: verifies that the override hook correctly fills button mask + analog axes.scePadRead button bits are active-low: ensures that each button is cleared (0) when pressed.scePadGetButtonMask returns all buttons: expects0xFFFF.basic pad init/port/state functions return expected values: checks return codes for init/open/state helpers.pad info and mode helpers return consistent values: validates info/mode APIs return stable, reasonable values.pad setters return success: ensures setters return success codes.pad string helpers map state codes: verifiesscePadStateIntToStr/scePadReqIntToStroutput expected strings.scePadGetFrameCount increments: checks increasing frame count.Notes
The next step is a real SIO2 implementation and packet-level emulation, if more accurate behavior is needed