feat(systemgesture): implement the recognizer and no-touch event exports #572
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/572"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by Phi1ow on 2026-10-04T22:45:29Z.
What
Ten
libSceSystemGestureexports were throwing stubs. No touch input is fed to the recognizers,so they report no gestures, following the functions already implemented in this file:
sceSystemGestureAppendTouchRecognizer/RemoveTouchRecognizer/ResetTouchRecognizer/UpdateTouchRecognizerRectangle-> check the handle and recognizer likesceSystemGestureCreateTouchRecognizer.sceSystemGestureResetPrimitiveTouchRecognizer/UpdateAllTouchRecognizer-> check the handlelike
sceSystemGestureUpdateTouchRecognizer.sceSystemGestureGetPrimitiveTouchEventsCount->0, likesceSystemGestureGetTouchEventsCount.sceSystemGestureGetPrimitiveTouchEventByIndex->INDEX_OUT_OF_ARRAY, likesceSystemGestureGetTouchEventByIndex.sceSystemGestureGetTouchEvents/GetPrimitiveTouchEvents-> report zero events.Adds a
CMakeLists.txtso the library can carry its guest test.The three lookup/info exports (
GetTouchEventByEventID,GetPrimitiveTouchEventByPrimitiveID,GetTouchRecognizerInformation) stay stubs: the not-found error for an id that never existed andthe recognizer-information layout aren't known, so I left them throwing rather than guess.
Tested
New test
core/libs/tests/GuestSystemGesture.cpp(registered asguest_system_gesture) opens agesture context and checks the returns, the zero event counts and the handle/argument errors.
Built with MinGW-w64 GCC 15.2.0 (the CI toolchain) on Windows 11;
ctest -R guest_system_gesturepasses. On
mainthe ten functions thrownot implemented, so the test aborts without the change.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)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-04T22:46:58Z.
Progress report (
5fc8755→633b8f3)📈 System libraries: 87.43% (+0.35%, +10 implemented functions)
✅ 10 implemented
sceSystemGestureAppendTouchRecognizersceSystemGestureGetPrimitiveTouchEventByIndexsceSystemGestureGetPrimitiveTouchEventssceSystemGestureGetPrimitiveTouchEventsCountsceSystemGestureGetTouchEventssceSystemGestureRemoveTouchRecognizersceSystemGestureResetPrimitiveTouchRecognizersceSystemGestureResetTouchRecognizersceSystemGestureUpdateAllTouchRecognizersceSystemGestureUpdateTouchRecognizerRectangleImported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-04T23:44:01Z.
Thanks. All ten names recompute to their NIDs, and the bodies follow the functions already in the file: the handle and recognizer checks of
sceSystemGestureCreateTouchRecognizer, the zero count ofsceSystemGestureGetTouchEventsCountand theINDEX_OUT_OF_ARRAYofsceSystemGestureGetTouchEventByIndex. Leaving the three lookup and information exports throwing is the right call.One thing before it goes in. The "no touch input is emulated" premise (it's also the code comment at the top of the file) isn't true on main any more:
PadState.cppreports touchpad contacts from the controller and from the keyboard bindings (touch_data_touch_numand the two touch points). So with this PR a title that builds its touch UI on SystemGesture recognizers gets a recognizer that never reports a tap or a drag while the pad shows a finger on it. That changes input, not only UI, so CONTRIBUTING's silent-stub exception doesn't cover it on its own (the same point I made on #565).Recognizing gestures from the pad data would be a much bigger change, so I'm not asking for it here. Could you add libSceSystemGesture to the "Silent stubs" list in docs/dev/TechnicalDebt.md, saying that recognizers accept every call but never report touch or primitive events, although libScePad reports touchpad contacts? That covers the existing update and count functions too.
Optional:
sceSystemGestureGetTouchEventsandsceSystemGestureGetPrimitiveTouchEventsreturn OK for a nullnumber_of_event, andsceSystemGestureGetPrimitiveTouchEventByIndexdoesn't check the handle (the same assceSystemGestureGetTouchEventByIndexon main). Neither is wrong as far as I know, just noting it in case you have the real error order.guest_system_gesturepasses here and throws on main. PPSA21564 doesn't import any SystemGesture function.Imported from boykopovar/AnyPS5. Originally posted by Phi1ow on 2026-10-06T21:52:22Z.
Done. Added a libSceSystemGesture "Silent stubs" line saying the recognizers accept every call but never report a touch or primitive event although libScePad reports touchpad contacts, and removed the file's outdated "no touch input is emulated" comment. On the optional points: the null number_of_event and the missing handle check match sceSystemGestureGetTouchEventByIndex / GetTouchEvents already on main, so I kept them the same; happy to tighten if you have the real error order. guest_system_gesture passes here.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-06T22:40:46Z.
Thanks for adding the silent-stubs line and removing the outdated comment. Keeping the
number_of_eventand handle checks the same as the functions already on main is fine.One question remains, which the owner has since asked us to check on every PR: which title calls these? A silent stub is allowed only when it unblocks a title, and if a title needs only some of the ten, the PR should keep just those. If you know one, please name it with the log line where it stops on main.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-07T01:20:42Z.
Following up on the question above: do you know which title calls these SystemGesture exports? The code itself looks fine now; the title (with the log line where it stops on
main), and which of the ten it needs, is the last thing needed before it can be merged.If no title needs them yet, we'd rather close it for now and reopen it once one does.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-07T15:48:25Z.
Review: CHANGES_REQUESTED
Following up on oneandonlydean's open question (asked twice, still unanswered):
main? Without one this is a silent stub that unblocks nothing (CONTRIBUTING). I also checked a first-party title dump: it doesn't importlibSceSystemGesture, so there's no static evidence either. If a title needs only some of the ten, keep just those.docs/dev/TechnicalDebt.md:31: the new line is the last one in "Silent stubs", where every PR appends and #910 already touches the same spot. Move it a few lines away from the end of the section.If no title needs them yet, we'll close this for now; it can be reopened once one does.
Imported from boykopovar/AnyPS5. Originally posted by gjonn on 2026-10-07T19:40:45Z.
A title that needs this: PPSA06320 (Ape Escape, PS1HD emulator 1.7.17772), relinked for Windows.
It imports 10
libSceSystemGesturefunctions. Three of them are in this PR:sceSystemGestureAppendTouchRecognizer,sceSystemGestureRemoveTouchRecognizerandsceSystemGestureUpdateAllTouchRecognizer. The other seven (Open,Close,CreateTouchRecognizer,GetTouchEventByIndex,GetTouchEventsCount,InitializePrimitiveTouchRecognizer,UpdatePrimitiveTouchRecognizer) are already onmain.Without this PR it stops right after save data init (with #1247 and #1188 merged locally to get that far):
With this PR merged locally, it gets past that, sets up the pad and submits its first GPU frame. The next stop is an unrelated AGC
WRITE_DATApacket.AppendTouchRecognizeris the one confirmed called.RemoveTouchRecognizerandUpdateAllTouchRecognizerare imported, but the title doesn't get far enough yet to confirm it calls them.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-10T18:08:19Z.
Closing for now: the points from 2026-10-07 are still open. If you pick it back up, please comment here and it can be reopened.
Pull request closed