fix(libSceConvertKeycode): ignore the state bit 0x4000000 RE Engine titles pass #5776
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5776"
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 simonbronk on 2026-10-14T10:06:04Z.
What
PRAGMATA (PPSA02530, #5726) and Onimusha: Way of the Sword (PPSA27836, #5769) stop at boot with:
In Onimusha the caller (ELF address
0x16e2b70,app.exe+0x16f2b70when relinked with--windows-fixed-base 0x400000000) is a loop over keycodes 0 to 0x8F that builds a table of key names. The second argument is the constant0x4000000, not a value read from the keyboard:It then upper-cases
atozitself before mapping the character to its own key id, so it expects the unshifted character. The bit is now ignored and the call returns the US-layout character as for state 0. Any other bit still throws. The meaning of the bit is still unknown; the debt entry says so and records the evidence.Tested
main0b97f8b9f: fullctest -j 8, 1142/1142 pass.guest_convert_keycodegainssceConvertKeycodeGetCharacterchecks with state 0 and0x4000000(a,1, and 0 for F1). Withmain'sExport.cppit fails; with the change it passes.APS5_TRACE_CALLS=libSceConvertKeycodeshows 113sceConvertKeycodeGetCharactercalls and no stop; the title goes on to shader preparation and stops at the per-lane T# described in #5769.python tools/check_conventions.py --base upstream/main: passes.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file — not applicable, no stub.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-14T10:48:34Z.
Tested on head
378ac6178(the current head of this pull request on GitHub, same SHA).PPSA02530 (PRAGMATA v01.200.000) gets past
sceConvertKeycodeGetCharacterwith this pull request.main0b97f8b9f): the run ends atwhat(): sceConvertKeycodeGetCharacter: unsupported state 67108864(PPSA02530_rQ2/run_113916.errline 111 of 607; 67108864 =0x4000000, the value the title passes asstate).main3e577edac+378ac6178, merge57789cc4d, clean merge): that message does not appear any more (0 lines withConvertKeycodein the 824 lines ofPPSA02530_rZ5/run_123537.err). The title goes on and ends at line 219 withwhat(): shader 0x2234455200 stage 5: ShaderRecompiler::Recompile: GetImageResource dword 0 is not a valid runtime value; chain: ReadConstBuffer@pc=0x00000568(...(a GPU/shader-recompiler stop, not related to this pull request).Test conditions
main3e577edac+ this head (merge57789cc4d).ninja -C build -j4 relinkerplus all 126core/libs/libs/*.prxof that tree, finished 12:34:11 local time (libSceAgcDriver.prx12:34:10,libkernel.prx11:54:00 - ninja found it up to date);relinker.exe2026-10-14 12:34:03.relink_title_trace.ps1 -Id PPSA02530 -ElfDir <eboot.bin and sce_module of the title> -Repo <that tree>=relinker.exe --windows --registry --trace-imports; no-ModuleDir, no--windows-fixed-base. Run:run_title.ps1 -Seconds 90,APS5_TRACE_CALLS=all, start 12:35:36.Limits
One title, one run per tree. I did not check what the title does with the characters it gets, and I did not run this pull request's own tests.
AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T12:09:31Z.
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.
core/libs/tests/GuestConvertKeycode.cppImported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-15T12:50:23Z.
Checked the diff, the debt entry and the new
guest_convert_keycoderows (state 0 and0x4000000); the test fails without theExport.cppchange, and build + ctest pass on main merged with this PR. PPSA02530 confirmed past this export by @xXPBSXx. Merging.