feat(libSceIme): implement sceImeKeyboardGetResourceId #696

Merged
tv7 merged 1 commit from upstream-pr/696 into main 2026-10-06 20:58:52 +00:00
tv7 commented 2026-10-05 16:13:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by tv7 on 2026-10-05T16:13:00Z.


What

sceImeKeyboardGetResourceId was a NotImplemented stub on main. It now reports that no USB keyboard is connected, with the same checks as shadPS4, where the comment says some Unity games need it:

  • a null array returns INVALID_ADDRESS (0x80bc0031)
  • user -1 returns INVALID_USER_ID (0x80bc0010)

Both of these leave the array untouched. Otherwise the array is cleared and given the user id, and the result is:

  • NOT_OPENED (0x80bc0002) when sceImeKeyboardOpen has not opened a keyboard for that user, using the per-user set already on main
  • CONNECTION_FAILED (0x80bc0004) when it has

libSceKeyboard already exposes the host keyboard, but IME keyboard events are not delivered to the handler, so reporting no keyboard through the IME is the consistent answer for now. This is recorded under Functional in TechnicalDebt.md.

guest_ime_parameters gains CheckKeyboardResourceIds:

  • the argument errors, and that they leave the output untouched
  • a keyboard that is not opened, an opened one, another user's, and one after sceImeKeyboardClose

Tested

  • Windows 11, MinGW-w64 GCC 15.2.0 (winlibs ucrt posix seh): full build and ctest, 288/288 passed.
  • tools/progress.py against main: +1 implemented function.
  • Spirit of the Island (PPSA13934, Unity) calls it during boot; the same behaviour let it continue in a fork.

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 in TechnicalDebt
  • 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
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes (Claude Opus 5.5)

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4747771159 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/696). Originally posted by [tv7](https://github.com/tv7) on 2026-10-05T16:13:00Z. --- ### What `sceImeKeyboardGetResourceId` was a `NotImplemented` stub on `main`. It now reports that no USB keyboard is connected, with the same checks as [shadPS4](https://github.com/shadps4-emu/shadPS4/blob/main/src/core/libraries/ime/ime.cpp), where the comment says some Unity games need it: - a null array returns `INVALID_ADDRESS` (`0x80bc0031`) - user `-1` returns `INVALID_USER_ID` (`0x80bc0010`) Both of these leave the array untouched. Otherwise the array is cleared and given the user id, and the result is: - `NOT_OPENED` (`0x80bc0002`) when `sceImeKeyboardOpen` has not opened a keyboard for that user, using the per-user set already on `main` - `CONNECTION_FAILED` (`0x80bc0004`) when it has `libSceKeyboard` already exposes the host keyboard, but IME keyboard events are not delivered to the handler, so reporting no keyboard through the IME is the consistent answer for now. This is recorded under Functional in `TechnicalDebt.md`. `guest_ime_parameters` gains `CheckKeyboardResourceIds`: - the argument errors, and that they leave the output untouched - a keyboard that is not opened, an opened one, another user's, and one after `sceImeKeyboardClose` ### Tested - Windows 11, MinGW-w64 GCC 15.2.0 (winlibs ucrt posix seh): full build and `ctest`, 288/288 passed. - `tools/progress.py` against `main`: +1 implemented function. - Spirit of the Island (PPSA13934, Unity) calls it during boot; the same behaviour let it continue in a fork. ### 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](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [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 - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes (Claude Opus 5.5) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
oneandonlydean commented 2026-10-05 19:45:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-05T19:45:48Z.


Thanks for this. It needs a rebase: docs/dev/TechnicalDebt.md conflicts with current main at the end of the Functional list, where your new sceImeKeyboardGetResourceId line sits. Keeping both sides there is enough.

I checked the rest with that conflict resolved. The NID dKadqZFgKKQ matches the name, and it is exported by libSceIme.prx and libSceImeBackend.prx, the same as the other keyboard functions. The checks and error codes follow shadPS4, and using the per-user set for NOT_OPENED versus CONNECTION_FAILED fits what sceImeKeyboardOpen already records. guest_ime_parameters fails on main's code and passes with the change, also 20 times in a row on Linux, and the full ctest passes with it merged (Linux, GCC).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6001774133 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/696#issuecomment-6001774133). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-05T19:45:48Z. --- Thanks for this. It needs a rebase: `docs/dev/TechnicalDebt.md` conflicts with current `main` at the end of the Functional list, where your new `sceImeKeyboardGetResourceId` line sits. Keeping both sides there is enough. I checked the rest with that conflict resolved. The NID `dKadqZFgKKQ` matches the name, and it is exported by `libSceIme.prx` and `libSceImeBackend.prx`, the same as the other keyboard functions. The checks and error codes follow shadPS4, and using the per-user set for `NOT_OPENED` versus `CONNECTION_FAILED` fits what `sceImeKeyboardOpen` already records. `guest_ime_parameters` fails on main's code and passes with the change, also 20 times in a row on Linux, and the full ctest passes with it merged (Linux, GCC).
oneandonlydean commented 2026-10-06 05:34:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-06T05:34:23Z.


An update to my rebase note: #794 (closed IME panel) has landed, so there are more conflicts with current main now, though they're still additive:

  • core/libs/prx/libSceIme/Export.cpp: keep main's version and add your ErrorConnectionFailed constant.
  • core/libs/tests/GuestImeParameters.cpp: keep main's sceImeClose/SetCaret/SetText/SetTextGeometry declarations and CheckClosedPanel(), and add your keyboard declarations and CheckKeyboardResourceIds() (and both calls in main()).
  • docs/dev/TechnicalDebt.md: keep main's lines at the end of the Functional list and add yours after them.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6010066481 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/696#issuecomment-6010066481). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-06T05:34:23Z. --- An update to my rebase note: #794 (closed IME panel) has landed, so there are more conflicts with current main now, though they're still additive: - `core/libs/prx/libSceIme/Export.cpp`: keep main's version and add your `ErrorConnectionFailed` constant. - `core/libs/tests/GuestImeParameters.cpp`: keep main's `sceImeClose`/`SetCaret`/`SetText`/`SetTextGeometry` declarations and `CheckClosedPanel()`, and add your keyboard declarations and `CheckKeyboardResourceIds()` (and both calls in `main()`). - `docs/dev/TechnicalDebt.md`: keep main's lines at the end of the Functional list and add yours after them.
merwie commented 2026-10-06 09:00:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by merwie on 2026-10-06T09:00:48Z.


Data point: PPSA12544 (Hollow Knight: Silksong, Unity) calls sceImeKeyboardGetResourceId at startup and stops on the main stub. Answering NOT_OPENED / CONNECTION_FAILED as this PR does lets it continue to its title menu (bring-up: #726). I closed my duplicate #845 in favour of this one.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6012923218 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/696#issuecomment-6012923218). Originally posted by [merwie](https://github.com/merwie) on 2026-10-06T09:00:48Z. --- Data point: PPSA12544 (Hollow Knight: Silksong, Unity) calls `sceImeKeyboardGetResourceId` at startup and stops on the `main` stub. Answering `NOT_OPENED` / `CONNECTION_FAILED` as this PR does lets it continue to its title menu (bring-up: #726). I closed my duplicate #845 in favour of this one.
github-actions[bot] commented 2026-10-06 09:27:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-06T09:27:12Z.


Progress report (481c85e → 54f0e03)

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

✅ 1 implemented
Library Name
libSceIme sceImeKeyboardGetResourceId
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6013343922 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/696#issuecomment-6013343922). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-06T09:27:12Z. --- <!-- progress-report --> ### Progress report (481c85e → 54f0e03) 📈 **System libraries**: 82.34% (+0.03%, +1 implemented functions) <details> <summary>✅ 1 implemented</summary> | Library | Name | | - | - | | libSceIme | `sceImeKeyboardGetResourceId` | </details>
oneandonlydean commented 2026-10-06 09:27:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-06T09:27:52Z.


Thanks, the rebase resolves all three files as described: ErrorConnectionFailed sits next to main's constants, the keyboard declarations and CheckKeyboardResourceIds() follow CheckClosedPanel(), and your TechnicalDebt line comes after main's. It merges cleanly with main now.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6013355287 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/696#issuecomment-6013355287). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-06T09:27:52Z. --- Thanks, the rebase resolves all three files as described: `ErrorConnectionFailed` sits next to main's constants, the keyboard declarations and `CheckKeyboardResourceIds()` follow `CheckClosedPanel()`, and your TechnicalDebt line comes after main's. It merges cleanly with main now.
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!696
No description provided.