libSceJson2: InitParameter2::setSpecialFloatFormatType stops Resident Evil 4 and PRAGMATA; fix branch ready #3348

Closed
opened 2026-10-11 08:26:20 +00:00 by screamm · 3 comments
screamm commented 2026-10-11 08:26:20 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-11T08:26:20Z.


Resident Evil 4 (PPSA07411, #2776) and PRAGMATA (PPSA02530, #3043) stop at start-up on the absent libSceJson2 export sce::Json::InitParameter2::setSpecialFloatFormatType:

what():  _ZN3sce4Json14InitParameter225setSpecialFloatFormatTypeENS0_22SpecialFloatFormatTypeE not implemented

In the same library the InitParameter2 base constructor (C2), InitParameterRtti2::setAllocatorRtti and the InitParameterRtti constructor are NotImplemented_nid_no_patch stubs that Deathloop, Minecraft Legends and Cyberpunk import.

Fix branch ready: screamm:feat/json2-init-parameter2 (b5ad862c, one commit on main a4b0b16b). I cannot open it as a PR because of the intake check; anyone eligible is welcome to carry it, keeping the commit as is.

  • setSpecialFloatFormatType is added with NID WVZBP4IyM+E, computed from the mangled name with tools/nid_names.py and matching the aerolib entry; it stores the 32-bit value at offset 0x18 and accepts any value, because no public source gives the enum's range (SharpEmu, KytyPS5, pcsx5, fpPS4 all store it unchecked). InitParameter2 becomes the 40-byte object SharpEmu JsonExports.cs (1811cef9) and KytyPS5 libJson2.cpp (eda6ba37) agree on (allocator, user data, file buffer size, format type, 12 reserved bytes), zeroed by both constructors; C2 forwards to C1; setAllocatorRtti stores the allocation parameters and user data like setAllocator; the InitParameterRtti constructor writes its three arguments to the first 24 bytes. Initializer::initialize is unchanged (it reads no field). The serializer still throws on NaN and infinity whatever format type is set. TechnicalDebt gets one bullet replacing the old "Unknown function info" note.
  • guest_json gains both constructors zeroing a 0xff-filled buffer, the setters read back with other fields untouched, initialize succeeding on the result, and the Rtti constructor leaving bytes 24 to 39 untouched.

Tested on Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release, BUILD_TESTING=ON, full build including libs: guest_json 3/3; ctest -j8 -E "^agc_driver_|^video_out_flip" 507/507 (with the #3329 test fix applied locally so the tree builds); with main's Export.cpp the extended test fails; tools/check_conventions.py --base main and git diff --check pass. Not run on Linux, and not run with either title.

Written with Claude Code assistance (implementation by a subagent, reviewed and validated in this session).

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5799385688 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3348). Originally posted by [screamm](https://github.com/screamm) on 2026-10-11T08:26:20Z. --- Resident Evil 4 (PPSA07411, #2776) and PRAGMATA (PPSA02530, #3043) stop at start-up on the absent libSceJson2 export `sce::Json::InitParameter2::setSpecialFloatFormatType`: ``` what(): _ZN3sce4Json14InitParameter225setSpecialFloatFormatTypeENS0_22SpecialFloatFormatTypeE not implemented ``` In the same library the `InitParameter2` base constructor (C2), `InitParameterRtti2::setAllocatorRtti` and the `InitParameterRtti` constructor are `NotImplemented_nid_no_patch` stubs that Deathloop, Minecraft Legends and Cyberpunk import. **Fix branch ready:** [`screamm:feat/json2-init-parameter2`](https://github.com/screamm/AnyPS5/tree/feat/json2-init-parameter2) (`b5ad862c`, one commit on `main` `a4b0b16b`). I cannot open it as a PR because of the intake check; anyone eligible is welcome to carry it, keeping the commit as is. - `setSpecialFloatFormatType` is added with NID `WVZBP4IyM+E`, computed from the mangled name with `tools/nid_names.py` and matching the aerolib entry; it stores the 32-bit value at offset 0x18 and accepts any value, because no public source gives the enum's range (SharpEmu, KytyPS5, pcsx5, fpPS4 all store it unchecked). `InitParameter2` becomes the 40-byte object SharpEmu `JsonExports.cs` (`1811cef9`) and KytyPS5 `libJson2.cpp` (`eda6ba37`) agree on (allocator, user data, file buffer size, format type, 12 reserved bytes), zeroed by both constructors; C2 forwards to C1; `setAllocatorRtti` stores the allocation parameters and user data like `setAllocator`; the `InitParameterRtti` constructor writes its three arguments to the first 24 bytes. `Initializer::initialize` is unchanged (it reads no field). The serializer still throws on NaN and infinity whatever format type is set. TechnicalDebt gets one bullet replacing the old "Unknown function info" note. - `guest_json` gains both constructors zeroing a 0xff-filled buffer, the setters read back with other fields untouched, `initialize` succeeding on the result, and the Rtti constructor leaving bytes 24 to 39 untouched. **Tested** on Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release, `BUILD_TESTING=ON`, full build including `libs`: `guest_json` 3/3; `ctest -j8 -E "^agc_driver_|^video_out_flip"` 507/507 (with the #3329 test fix applied locally so the tree builds); with `main`'s `Export.cpp` the extended test fails; `tools/check_conventions.py --base main` and `git diff --check` pass. Not run on Linux, and not run with either title. Written with Claude Code assistance (implementation by a subagent, reviewed and validated in this session).
blawesom commented 2026-10-11 09:52:43 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-11T09:52:43Z.


Independent verification on Linux (the gap noted in the report): CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, BUILD_TESTING=ON.

  • Rebased b5ad862c onto current main (the branch was 244 commits behind): one conflict in Export.cpp — main has since added stubs for InitParameter2C2, setAllocatorRtti and setNullAccessCallBack in a different spot than this branch's implementations; the two superseded stubs were dropped and main's setNullAccessCallBack stub kept, which this branch does not touch. One TechnicalDebt.md conflict resolved by keeping both entries.
  • tools/check_conventions.py --base origin/main and git diff --check pass.
  • guest_json passes.
  • Full suite mirroring the Windows run (ctest -j8 -E "^agc_driver_|^video_out_flip"): 520/520 passed.

The rebased branch is available at blawesom:verify/3348 for anyone carrying — the commit is otherwise unchanged.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6107768385 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3348#issuecomment-6107768385). Originally posted by [blawesom](https://github.com/blawesom) on 2026-10-11T09:52:43Z. --- Independent verification on **Linux** (the gap noted in the report): CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, `BUILD_TESTING=ON`. - Rebased `b5ad862c` onto current `main` (the branch was 244 commits behind): one conflict in `Export.cpp` — main has since added stubs for `InitParameter2C2`, `setAllocatorRtti` and `setNullAccessCallBack` in a different spot than this branch's implementations; the two superseded stubs were dropped and main's `setNullAccessCallBack` stub kept, which this branch does not touch. One `TechnicalDebt.md` conflict resolved by keeping both entries. - `tools/check_conventions.py --base origin/main` and `git diff --check` pass. - `guest_json` passes. - Full suite mirroring the Windows run (`ctest -j8 -E "^agc_driver_|^video_out_flip"`): **520/520 passed**. The rebased branch is available at [`blawesom:verify/3348`](https://github.com/blawesom/AnyPS5/tree/verify/3348) for anyone carrying — the commit is otherwise unchanged.
MarcZX10 commented 2026-10-11 16:12:44 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-11T16:12:44Z.


I carried the ready #3348 implementation into PR #3737, including the setter covered by #3575 plus the related constructors and RTTI allocator setter. The PR is based on current main and includes local Linux guest_json verification. I noted the related JSON2 PRs and their adjacent file overlap in the description.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6111004764 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3348#issuecomment-6111004764). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-11T16:12:44Z. --- I carried the ready #3348 implementation into [PR #3737](https://github.com/boykopovar/AnyPS5/pull/3737), including the setter covered by #3575 plus the related constructors and RTTI allocator setter. The PR is based on current main and includes local Linux `guest_json` verification. I noted the related JSON2 PRs and their adjacent file overlap in the description.
oneandonlydean commented 2026-10-13 02:07:58 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T02:07:58Z.


Closing: fixed by #3737. PPSA07411 and PPSA02530 continue in #2776 and #3043.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6136616799 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3348#issuecomment-6136616799). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-13T02:07:58Z. --- Closing: fixed by #3737. PPSA07411 and PPSA02530 continue in #2776 and #3043.
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#3348
No description provided.