fix(libSceMouse): implement sceMouseResetAbsolutePosition with the arguments its callers pass #5986

Merged
oneandonlydean merged 2 commits from upstream-pr/5986 into main 2026-10-16 23:22:57 +00:00
oneandonlydean commented 2026-10-14 18:28:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T18:28:27Z.


What

Carries #4439 by @snydercodes09 (closed for an assumed signature), keeping their commit, with the signature taken from a call site.

PPSA30601 (Resonance: A Plague Tale Legacy) stops at start-up with sceMouseResetAbsolutePosition not implemented on main. Its only call passes the mouse handle in edi and two values zero-extended from 16 bits in esi and edx: half of the display width and height minus one, from a size query. The result is not read.

  • sceMouseResetAbsolutePosition(int32 handle, uint16 x, uint16 y) validates initialization and the handle the same way sceMouseRead does and returns MOUSE_OK.
  • The position is not stored. libSceMouse reports relative motion only and has no absolute position to reset. docs/dev/debt/libSceMouse.md records this and that the behaviour is not measured on hardware.

Tested

Linux (CachyOS, GCC, Release, BUILD_TESTING=ON):

  • mouse_input covers the call before init, before open, with a wrong handle, on an open handle and after close. It aborts against main's libSceMouse.prx (sceMouseResetAbsolutePosition not implemented) and passes with this change. video_out_mouse and pad_keyboard_mouse also pass.
  • PPSA30601 gets past this call. It stops 6 s in at the first presentation with AGC graphics: clip rectangles are unsupported, which is a separate issue.
  • tools/check_conventions.py and git diff --check pass.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source (none)
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: PPSA30601 #4067
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4862576143 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5986). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-14T18:28:27Z. --- ### What Carries #4439 by @snydercodes09 (closed for an assumed signature), keeping their commit, with the signature taken from a call site. PPSA30601 (Resonance: A Plague Tale Legacy) stops at start-up with `sceMouseResetAbsolutePosition not implemented` on main. Its only call passes the mouse handle in `edi` and two values zero-extended from 16 bits in `esi` and `edx`: half of the display width and height minus one, from a size query. The result is not read. - `sceMouseResetAbsolutePosition(int32 handle, uint16 x, uint16 y)` validates initialization and the handle the same way `sceMouseRead` does and returns `MOUSE_OK`. - The position is not stored. libSceMouse reports relative motion only and has no absolute position to reset. `docs/dev/debt/libSceMouse.md` records this and that the behaviour is not measured on hardware. ### Tested Linux (CachyOS, GCC, Release, `BUILD_TESTING=ON`): - `mouse_input` covers the call before init, before open, with a wrong handle, on an open handle and after close. It aborts against main's `libSceMouse.prx` (`sceMouseResetAbsolutePosition not implemented`) and passes with this change. `video_out_mouse` and `pad_keyboard_mouse` also pass. - PPSA30601 gets past this call. It stops 6 s in at the first presentation with `AGC graphics: clip rectangles are unsupported`, which is a separate issue. - `tools/check_conventions.py` and `git diff --check` pass. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's technical debt file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source (none) - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: PPSA30601 #4067 - [x] GPUs tested: n/a - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-14 18:29:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-14T18:29:14Z.


Progress report (9e9d86f → b816673)

📈 System libraries: 89.02% (+0.03%, +1 implemented functions)

✅ 1 implemented
Library Name
libSceMouse sceMouseResetAbsolutePosition
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6175439821 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5986#issuecomment-6175439821). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-14T18:29:14Z. --- <!-- progress-report --> ### Progress report (9e9d86f → b816673) 📈 **System libraries**: 89.02% (+0.03%, +1 implemented functions) <details> <summary>✅ 1 implemented</summary> | Library | Name | | - | - | | libSceMouse | `sceMouseResetAbsolutePosition` | </details>
github-actions[bot] commented 2026-10-14 18:35:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-14T18:35:34Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 6964 docs/dev/debt/libSceJson2.md L13-14

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 6039 docs/dev/debt/libSceJson2.md
PR 6126 docs/dev/debt/libSceJson2.md
PR 6447 core/libs/prx/libSceMouse/Export.cpp
docs/dev/debt/libSceJson2.md
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6175559213 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5986#issuecomment-6175559213). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-14T18:35:34Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | [PR 6964](https://www.github.com/boykopovar/AnyPS5/pull/6964) | `docs/dev/debt/libSceJson2.md` [L13-14](https://github.com/boykopovar/AnyPS5/blob/b35f5b7940d192716f192f2e3633fb91ad397bab/docs/dev/debt/libSceJson2.md#L13-L14) | | | Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | [PR 6039](https://www.github.com/boykopovar/AnyPS5/pull/6039) | `docs/dev/debt/libSceJson2.md` | | [PR 6126](https://www.github.com/boykopovar/AnyPS5/pull/6126) | `docs/dev/debt/libSceJson2.md` | | [PR 6447](https://www.github.com/boykopovar/AnyPS5/pull/6447) | `core/libs/prx/libSceMouse/Export.cpp`<br>`docs/dev/debt/libSceJson2.md` |
oneandonlydean commented 2026-10-14 20:30:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T20:30:14Z.


Holding this until the behaviour is measured on a console: what sceMouseResetAbsolutePosition returns for an open handle, a wrong handle and before init, and whether a later read reports the position it was given. If anyone has a probe set up, those cases would settle it.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6177785798 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5986#issuecomment-6177785798). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-14T20:30:14Z. --- Holding this until the behaviour is measured on a console: what `sceMouseResetAbsolutePosition` returns for an open handle, a wrong handle and before init, and whether a later read reports the position it was given. If anyone has a probe set up, those cases would settle it.
MarcZX10 commented 2026-10-15 02:04:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T02:04:22Z.


The overlap notice points to #5923, which adds an unconditional no-argument success stub. This PR instead uses the (handle, x, y) call-site shape and validates initialization/handle state. #5923 appears to be a separate implementation proposal for the same export. Could you and @Kurenaiiiii agree on sequencing and whether this PR supersedes that proposal? Your reported title run and the existing overlap details give reviewers useful evidence for the decision.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6182720133 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5986#issuecomment-6182720133). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-15T02:04:22Z. --- The overlap notice points to #5923, which adds an unconditional no-argument success stub. This PR instead uses the `(handle, x, y)` call-site shape and validates initialization/handle state. #5923 appears to be a separate implementation proposal for the same export. Could you and @Kurenaiiiii agree on sequencing and whether this PR supersedes that proposal? Your reported title run and the existing overlap details give reviewers useful evidence for the decision.
adriadam10 commented 2026-10-16 20:11:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-16T20:11:49Z.


Checked sceMouseResetAbsolutePosition(int32 handle, uint16 x, uint16 y) against the call site described in the body and the mouse_input test (before init, before open, wrong handle, open, closed, merged open): build and test pass on Linux. Rebased onto current main (only the libSceJson2.md debt line conflicted). #6447 changes the same export without arguments and will need to rebase on this one. Merging.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6223816125 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5986#issuecomment-6223816125). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-16T20:11:49Z. --- Checked `sceMouseResetAbsolutePosition(int32 handle, uint16 x, uint16 y)` against the call site described in the body and the `mouse_input` test (before init, before open, wrong handle, open, closed, merged open): build and test pass on Linux. Rebased onto current `main` (only the `libSceJson2.md` debt line conflicted). #6447 changes the same export without arguments and will need to rebase on this one. Merging.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!5986
No description provided.