Repository navigation
fix(libScePad): queue input states for scePadRead - #1076
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sceKernelGetProcessTime and sceKernelGetProcessTimeCounter subtracted GetStartNanos() from GetMonotonicNanos() in one expression. GCC reads the clock first, so on the first call in a process the start was captured after it and the result wrapped to about 2^64. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scePadRead reported only the current state, so input that changed and changed back between two reads was lost. Published states are now kept in a queue of up to 64 and drained oldest first; with none queued the current state is returned as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Per CONVENTIONS, code comments only mark technical debt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Could you split the |
# Conflicts: # core/libs/prx/libScePad/Export.cpp
Keeping lastFuseTime at its maximum never let it recover from a process time that wrapped on the first call (fixed separately in boykopovar#1501), so tilt correction stopped and guest_pad failed. Queued states keep their own timestamp; the orientation is fused once at the time of the read, as scePadReadState does.
adriadam10
left a comment
There was a problem hiding this comment.
Checked on Linux (merged onto current main): build clean, full ctest green, guest_pad passes, and fails with the library changes reverted (test kept). Behaviour matches KytyPS5 PadRead and shadPS4 scePadRead, which both return queued states (oldest first) and fall back to one current state when none are queued, so I consider Dean's request for a title satisfied by those references.
|
Thanks for checking this, and for accepting the KytyPS5/shadPS4 references. This PR no longer depends on #1501. Since CI on So this can go in on its own, before or after #1501. Could you take another look? |
|
Checked on Windows 11 with WinLibs GCC 16.2.0 (UCRT, posix-seh), Release,
#1501 is now merged into |
adriadam10
left a comment
There was a problem hiding this comment.
Rechecked on the current head (39463913) merged onto main: builds clean, guest_pad and the libs/libScePad ctests pass, and guest_pad fails with the library changes reverted (test kept). The Time.cpp dependency is gone (read-time orientation fusion) and #1501 is merged, so the earlier blocker no longer applies. Behaviour (oldest-first drain, one current state when the queue is empty) matches KytyPS5 PadRead and shadPS4 scePadRead. CI linux and windows are green; merging.
What
scePadReadreported only the current pad state and always returned 1, so input that changed and changed back between two reads (a quick tap) was lost.PadPublishInputis queued (up to 64, oldest dropped).scePadReaddrains up tonumentries oldest first, each with its own timestamp, and returns the count. With nothing queued it writes the current state and returns 1, as before.scePadReadStateis unchanged. ThescePadReadentry in TechnicalDebt added earlier in this PR is removed.New test:
CheckReadQueueinguest_pad(press and release between two reads must both be reported).Tested
ctest, 386/387 pass. The one failure,agc_driver_scalar_sop1(movrelsd_2_b32 s13 is 0x00007fff, expected 0xd4cbd76d), fails identically onmainwithout these changes.39463913(merged into currentmain):linuxandwindowspass, includingguest_pad, without theTime.cppfix from fix(libkernel): read the process start before the clock in process time #1501.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code