PRAGMATA (PPSA02530) calls sceConvertKeycodeGetCharacter with a second argument of 0x4000000, which throws "unsupported state 67108864" (follow-up to #5366) #5726

Closed
opened 2026-10-14 08:04:38 +00:00 by xXPBSXx · 3 comments
xXPBSXx commented 2026-10-14 08:04:38 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-14T08:04:38Z.


What

After #5366 (sceConvertKeycodeGetCharacter for the US layout), PRAGMATA (PPSA02530) stops at the same export:

what():  sceConvertKeycodeGetCharacter: unsupported state 67108864

67108864 is 0x4000000. The throw is in core/libs/prx/libSceConvertKeycode/Export.cpp on main (line 46: if (state != 0) throw std::runtime_error("sceConvertKeycodeGetCharacter: unsupported state " + std::to_string(state));; the function is declared as (std::uint16_t keycode, std::uint32_t state, std::uint32_t type, char16_t* character)).

The #5366 description says the signature is inferred from one other title (PPSA12361), that the second argument is unknown and that the title never passed anything but 0 there. PRAGMATA passes 0x4000000 as that second argument. I have not established what this value means: whether it is a flag word, a modifier state, or not an argument of this call at all (the signature itself is inferred). I am not proposing a fix or a meaning here.

Log: PPSA02530_rS/run_095418.err, line 111 (485 lines, counted with Python), followed by FATAL: abort() (SIGABRT).

Tested

Windows 10 (19045), MinGW-w64 GCC 15.2, Release, NVIDIA GeForce RTX 4080 SUPER. main 1209d370723d439477ad10940ebd1163b6873501 (contains #5366), no other PR merged in, no local stub; ninja -j 8 libs exit code 0 (09:52:28 to 09:54:02), 128 .prx (libSceAgcDriver.prx 09:53:54, libkernel/libc 09:54:01; the oldest .prx, dated 2026-10-13 09:50, was not rebuilt by ninja); nid_patcher dated 2026-10-14 08:00:09; run_title.ps1, one game at a time, 300 s requested (script times 09:54:17 to 09:58:38), one run. Title executable: PPSA02530_rS/app.exe, a hardlink of D's PPSA02530_rO/app.exe dated 2026-10-14 07:36:44; relinker commit and relink command for it are not recorded in my notes.
Not tested: Linux, other GPUs, a second run, what the title does with the returned character.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5844216631 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5726). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-14T08:04:38Z. --- ### What After #5366 (`sceConvertKeycodeGetCharacter` for the US layout), PRAGMATA (PPSA02530) stops at the same export: ``` what(): sceConvertKeycodeGetCharacter: unsupported state 67108864 ``` `67108864` is `0x4000000`. The throw is in `core/libs/prx/libSceConvertKeycode/Export.cpp` on `main` (line 46: `if (state != 0) throw std::runtime_error("sceConvertKeycodeGetCharacter: unsupported state " + std::to_string(state));`; the function is declared as `(std::uint16_t keycode, std::uint32_t state, std::uint32_t type, char16_t* character)`). The #5366 description says the signature is inferred from one other title (PPSA12361), that the second argument is unknown and that the title never passed anything but 0 there. PRAGMATA passes `0x4000000` as that second argument. I have not established what this value means: whether it is a flag word, a modifier state, or not an argument of this call at all (the signature itself is inferred). I am not proposing a fix or a meaning here. Log: `PPSA02530_rS/run_095418.err`, line 111 (485 lines, counted with Python), followed by `FATAL: abort() (SIGABRT)`. ### Tested Windows 10 (19045), MinGW-w64 GCC 15.2, Release, NVIDIA GeForce RTX 4080 SUPER. `main` `1209d370723d439477ad10940ebd1163b6873501` (contains #5366), no other PR merged in, no local stub; `ninja -j 8 libs` exit code 0 (09:52:28 to 09:54:02), 128 `.prx` (libSceAgcDriver.prx 09:53:54, libkernel/libc 09:54:01; the oldest `.prx`, dated 2026-10-13 09:50, was not rebuilt by `ninja`); `nid_patcher` dated 2026-10-14 08:00:09; `run_title.ps1`, one game at a time, 300 s requested (script times 09:54:17 to 09:58:38), one run. Title executable: `PPSA02530_rS/app.exe`, a hardlink of D's `PPSA02530_rO/app.exe` dated 2026-10-14 07:36:44; relinker commit and relink command for it are not recorded in my notes. Not tested: Linux, other GPUs, a second run, what the title does with the returned character. AI-assisted (Claude Code).
simonbronk commented 2026-10-14 09:56:14 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by simonbronk on 2026-10-14T09:56:14Z.


Onimusha: Way of the Sword (PPSA27836 01.000.001, also RE Engine) stops at the same throw with the same value, on Windows 11, RTX 5070, main 0b97f8b9f plus #5770 and #5771:

terminate called after throwing an instance of 'std::runtime_error'
  what():  sceConvertKeycodeGetCharacter: unsupported state 67108864

The caller is a thread started at boot (abort backtrace app.exe+0x31cf5 called from app.exe+0x16f4093, in the thread function started at app.exe+0x16f4030). Like you, I have not found what 0x4000000 means. Ignoring only that bit locally lets the title continue to shader preparation, so the returned character does not seem to matter at this point; that is a local experiment, not a proposal. Listed in #5769.

AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6165715672 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5726#issuecomment-6165715672). Originally posted by [simonbronk](https://github.com/simonbronk) on 2026-10-14T09:56:14Z. --- Onimusha: Way of the Sword (PPSA27836 01.000.001, also RE Engine) stops at the same throw with the same value, on Windows 11, RTX 5070, `main` 0b97f8b9f plus #5770 and #5771: ``` terminate called after throwing an instance of 'std::runtime_error' what(): sceConvertKeycodeGetCharacter: unsupported state 67108864 ``` The caller is a thread started at boot (abort backtrace `app.exe+0x31cf5` called from `app.exe+0x16f4093`, in the thread function started at `app.exe+0x16f4030`). Like you, I have not found what `0x4000000` means. Ignoring only that bit locally lets the title continue to shader preparation, so the returned character does not seem to matter at this point; that is a local experiment, not a proposal. Listed in #5769. AI-assisted: yes (Claude Code).
simonbronk commented 2026-10-14 10:06:29 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by simonbronk on 2026-10-14T10:06:29Z.


Proposed a fix in #5776. In Onimusha the second argument is the constant 0x4000000, passed while the title loops over keycodes 0 to 0x8F to build a table of key names; it upper-cases a to z itself, so it expects the unshifted character. The disassembly is in the PR. PRAGMATA was not run here; if you can, a run of #5776 on PPSA02530 would confirm it passes there too.

AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6165900950 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5726#issuecomment-6165900950). Originally posted by [simonbronk](https://github.com/simonbronk) on 2026-10-14T10:06:29Z. --- Proposed a fix in #5776. In Onimusha the second argument is the constant `0x4000000`, passed while the title loops over keycodes 0 to 0x8F to build a table of key names; it upper-cases `a` to `z` itself, so it expects the unshifted character. The disassembly is in the PR. PRAGMATA was not run here; if you can, a run of #5776 on PPSA02530 would confirm it passes there too. AI-assisted: yes (Claude Code).
jotitadev commented 2026-10-15 18:52:04 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-15T18:52:04Z.


This looks fixed on main by #5776 (merged as e2bcee655): sceConvertKeycodeGetCharacter now masks the 0x4000000 state bit before the unsupported state check (core/libs/prx/libSceConvertKeycode/Export.cpp, kIgnoredStateBits), and GuestConvertKeycode.cpp covers states 0 and 0x4000000.

Checked by reading main at 44df21632; I did not run PRAGMATA (PPSA02530), so a run of current main on that title would confirm it before closing.

Written with AI assistance (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6199821036 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5726#issuecomment-6199821036). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-15T18:52:04Z. --- This looks fixed on `main` by #5776 (merged as `e2bcee655`): `sceConvertKeycodeGetCharacter` now masks the `0x4000000` state bit before the `unsupported state` check (`core/libs/prx/libSceConvertKeycode/Export.cpp`, `kIgnoredStateBits`), and `GuestConvertKeycode.cpp` covers states `0` and `0x4000000`. Checked by reading `main` at `44df21632`; I did not run PRAGMATA (PPSA02530), so a run of current `main` on that title would confirm it before closing. Written with AI assistance (Claude Code).
Sign in to join this conversation.
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#5726
No description provided.