feat(libSceDiscMap): report no disc bitmap from sceDiscMapGetPackageSize #8647

Closed
nikowolf123 wants to merge 1 commit from upstream-pr/8647 into main
nikowolf123 commented 2026-10-20 20:04:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by nikowolf123 on 2026-10-20T20:04:09Z.


What

sceDiscMapGetPackageSize (NID fl1eoDnwQ4s) was a throwing stub, declared in #8106. It now returns SCE_DISC_MAP_ERROR_NO_BITMAP_INFO (0x81100004) for every input and writes nothing. This is the no-disc-bitmap state that #6527 set up for the library's other two calls, sceDiscMapIsRequestOnHDD and ioKMruft1ek, which already return the same error.

Sources:

  • shadPS4's sceDiscMapGetPackageSize(s64 fflags, int* ret1, int* ret2) returns ORBIS_DISC_MAP_ERROR_NO_BITMAP_INFO and writes nothing (disc_map.cpp L12-L14). The value is 0x81100004 (disc_map_codes.h L9).
  • shadps4-emu/shadPS4#2686 added those parameters. It explains the result: "According to RE on ghidra all calls seems to check if lib is init first using a global", and while that global is clear a call returns ORBIS_DISC_MAP_ERROR_NO_BITMAP_INFO.
  • fpPS4's ps4_sceDiscMapGetPackageSize(fflags:Int64;pret1,pret2:PInt64) also returns SCE_DISC_MAP_ERROR_NO_BITMAP_INFO and writes nothing (ps4_libscediscmap.pas L53-L56). It defines the value as 0x81100004 at L18 and registers the function under $7E5D5EA039F0438B at L69. Those 8 bytes in base64 are fl1eoDnwQ4s.
  • The name and NID are listed in the PS5 3.20 export inventory. The C name does not change, so the export keeps NID fl1eoDnwQ4s.

Signature: the two outputs change from int* to void* because their width is unknown: shadPS4 uses int* and fpPS4 uses PInt64. Nothing is written to them, as with ioKMruft1ek. The return type is now std::int32_t, like the other two calls. The function checks no arguments and keeps no state.

What stays unverified is recorded in docs/dev/debt/libSceDiscMap.md. Nothing was measured on a console: not the meaning of fflags or of the two outputs, not the output widths, and not the result once the console library has a bitmap.

  • Under Silent stubs, the library entry now lists sceDiscMapGetPackageSize with the other two calls.
  • Under Unknown function info, the sceDiscMapGetPackageSize entry is cut to what is still open. It no longer says that every call throws.

#6527 left fl1eoDnwQ4s out because no title reported there imports it.

tools/progress.py --module libSceDiscMap goes from 2 of 3 functions done (66.67%) to 3 of 3 (100%). Like the other two calls, the function is listed in inert_names because it only returns a constant.

Overlap: #6977, which conflicts with main, adds its own copies of this library's CMakeLists.txt, Export.cpp, GuestDiscMap.cpp and debt file. None of them mentions this function, so the overlap is textual only. #9124 adds a check to GuestDiscMap.cpp that this function throws, the opposite of this PR; the two conflict there. The open draft #9137 changes this library's other outputs and its debt entry and leaves sceDiscMapGetPackageSize throwing. I found no other open PR that changes these files.

Tested

Linux: WSL2 Ubuntu 26.04, GCC 15.2.0 (Ubuntu 15.2.0-16ubuntu1), Release with BUILD_TESTING=ON. I built the targets libSceDiscMap and guest_disc_map_tests and ran ctest -R '^guest_disc_map$'. guest_disc_map passed (1 of 1, 0.02 s), and again at 2093e7b96 on main 2c4b116da.

guest_disc_map (core/libs/tests/GuestDiscMap.cpp) now also calls sceDiscMapGetPackageSize:

  • with fflags 0, 0x1 and 0x100. Each call must return 0x81100004 and leave both 64-bit outputs at ~0ull.
  • with null outputs. The call must return 0x81100004.

The new checks fail on main. I put only this PR's GuestDiscMap.cpp on main 434e965d46 and ran the same build and ctest command. guest_disc_map failed (Subprocess aborted) with terminate called after throwing an instance of 'std::runtime_error' and what(): sceDiscMapGetPackageSize not implemented.

Windows: not built.

No title was run.

tools/check_conventions.py --base origin/main passes.

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
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4941734098 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8647). Originally posted by [nikowolf123](https://github.com/nikowolf123) on 2026-10-20T20:04:09Z. --- ### What `sceDiscMapGetPackageSize` (NID `fl1eoDnwQ4s`) was a throwing stub, declared in #8106. It now returns `SCE_DISC_MAP_ERROR_NO_BITMAP_INFO` (`0x81100004`) for every input and writes nothing. This is the no-disc-bitmap state that #6527 set up for the library's other two calls, `sceDiscMapIsRequestOnHDD` and `ioKMruft1ek`, which already return the same error. Sources: - shadPS4's `sceDiscMapGetPackageSize(s64 fflags, int* ret1, int* ret2)` returns `ORBIS_DISC_MAP_ERROR_NO_BITMAP_INFO` and writes nothing ([disc_map.cpp L12-L14](https://github.com/shadps4-emu/shadPS4/blob/f68923fe807f657348e6719ce658bcbd0a2b1c72/src/core/libraries/disc_map/disc_map.cpp#L12-L14)). The value is `0x81100004` ([disc_map_codes.h L9](https://github.com/shadps4-emu/shadPS4/blob/f68923fe807f657348e6719ce658bcbd0a2b1c72/src/core/libraries/disc_map/disc_map_codes.h#L9)). - [shadps4-emu/shadPS4#2686](https://github.com/shadps4-emu/shadPS4/pull/2686) added those parameters. It explains the result: "According to RE on ghidra all calls seems to check if lib is init first using a global", and while that global is clear a call returns `ORBIS_DISC_MAP_ERROR_NO_BITMAP_INFO`. - fpPS4's `ps4_sceDiscMapGetPackageSize(fflags:Int64;pret1,pret2:PInt64)` also returns `SCE_DISC_MAP_ERROR_NO_BITMAP_INFO` and writes nothing ([ps4_libscediscmap.pas L53-L56](https://github.com/red-prig/fpPS4/blob/04cefd43e6fddd1ab033e7980cd356d14c964905/src/ps4_libscediscmap.pas#L53-L56)). It defines the value as `0x81100004` at [L18](https://github.com/red-prig/fpPS4/blob/04cefd43e6fddd1ab033e7980cd356d14c964905/src/ps4_libscediscmap.pas#L18) and registers the function under `$7E5D5EA039F0438B` at [L69](https://github.com/red-prig/fpPS4/blob/04cefd43e6fddd1ab033e7980cd356d14c964905/src/ps4_libscediscmap.pas#L69). Those 8 bytes in base64 are `fl1eoDnwQ4s`. - The name and NID are listed in the [PS5 3.20 export inventory](https://github.com/DNNDHH/PS5-3.20_Libs/blob/b2a77c09cd71c01f34c790cfbe98c751a13262ad/libSceDiscMap.c). The C name does not change, so the export keeps NID `fl1eoDnwQ4s`. Signature: the two outputs change from `int*` to `void*` because their width is unknown: shadPS4 uses `int*` and fpPS4 uses `PInt64`. Nothing is written to them, as with `ioKMruft1ek`. The return type is now `std::int32_t`, like the other two calls. The function checks no arguments and keeps no state. What stays unverified is recorded in `docs/dev/debt/libSceDiscMap.md`. Nothing was measured on a console: not the meaning of `fflags` or of the two outputs, not the output widths, and not the result once the console library has a bitmap. - Under Silent stubs, the library entry now lists `sceDiscMapGetPackageSize` with the other two calls. - Under Unknown function info, the `sceDiscMapGetPackageSize` entry is cut to what is still open. It no longer says that every call throws. #6527 left `fl1eoDnwQ4s` out because no title reported there imports it. `tools/progress.py --module libSceDiscMap` goes from 2 of 3 functions done (66.67%) to 3 of 3 (100%). Like the other two calls, the function is listed in `inert_names` because it only returns a constant. Overlap: #6977, which conflicts with `main`, adds its own copies of this library's `CMakeLists.txt`, `Export.cpp`, `GuestDiscMap.cpp` and debt file. None of them mentions this function, so the overlap is textual only. #9124 adds a check to `GuestDiscMap.cpp` that this function throws, the opposite of this PR; the two conflict there. The open draft #9137 changes this library's other outputs and its debt entry and leaves `sceDiscMapGetPackageSize` throwing. I found no other open PR that changes these files. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Linux: WSL2 Ubuntu 26.04, GCC 15.2.0 (Ubuntu 15.2.0-16ubuntu1), Release with `BUILD_TESTING=ON`. I built the targets `libSceDiscMap` and `guest_disc_map_tests` and ran `ctest -R '^guest_disc_map$'`. `guest_disc_map` passed (1 of 1, 0.02 s), and again at 2093e7b96 on `main` 2c4b116da. `guest_disc_map` (`core/libs/tests/GuestDiscMap.cpp`) now also calls `sceDiscMapGetPackageSize`: - with `fflags` 0, 0x1 and 0x100. Each call must return `0x81100004` and leave both 64-bit outputs at `~0ull`. - with null outputs. The call must return `0x81100004`. The new checks fail on `main`. I put only this PR's `GuestDiscMap.cpp` on `main` 434e965d46 and ran the same build and `ctest` command. `guest_disc_map` failed (Subprocess aborted) with `terminate called after throwing an instance of 'std::runtime_error'` and `what(): sceDiscMapGetPackageSize not implemented`. Windows: not built. No title was run. `tools/check_conventions.py --base origin/main` passes. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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 under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/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 - [x] Generic behaviour, not specific to one title - [x] Depends on: <!-- #PR, or none --> none - [x] Fixes: <!-- issue it closes as Fixes #N, or none --> none - [x] Unblocks: <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> none - [x] GPUs tested: <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> n/a - [x] AI-assisted: <!-- yes / no --> yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-actions[bot] commented 2026-10-20 20:04:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-20T20:04:56Z.


Progress report (cecb540 → 2093e7b)

📈 System libraries: 42.11% (+0.01%, +1 implemented functions)

✅ 1 implemented
Library Name
libSceDiscMap sceDiscMapGetPackageSize
⚪ 1 behaviourally empty (constant return or throw)
Library Name
libSceDiscMap sceDiscMapGetPackageSize
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6300313249 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8647#issuecomment-6300313249). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-20T20:04:56Z. --- <!-- progress-report --> ### Progress report (cecb540 → 2093e7b) 📈 **System libraries**: 42.11% (+0.01%, +1 implemented functions) <details> <summary>✅ 1 implemented</summary> | Library | Name | | - | - | | libSceDiscMap | `sceDiscMapGetPackageSize` | </details> <details> <summary>⚪ 1 behaviourally empty (constant return or throw)</summary> | Library | Name | | - | - | | libSceDiscMap | `sceDiscMapGetPackageSize` | </details>
xXPBSXx commented 2026-10-21 04:48:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-21T04:48:38Z.


Independent Windows run of this PR (data only).

Environment: Windows 10 Pro 10.0.19045, Ryzen 7 5800X3D, WinLibs GCC 15.2.0 r7 (MinGW-w64 UCRT), Release, BUILD_TESTING=ON. Merge-tree of the PR head against main is clean. I built only guest_disc_map_tests; ctest -N -R guest_disc_map lists exactly one test.

Results (3 runs each):

  • PR head: guest_disc_map passes 3/3.
  • Baseline: I kept the PR's test and replaced only core/libs/prx/libSceDiscMap/Export.cpp with the version from the PR's merge base (434e965d46), then rebuilt. The test fails 3/3 (exit 0xc0000409). I restored the PR's files afterwards.

Not run: other platforms, the other tests in the same family, the full repository CTest, and any title or console run.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6308301294 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8647#issuecomment-6308301294). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-21T04:48:38Z. --- Independent Windows run of this PR (data only). **Environment:** Windows 10 Pro 10.0.19045, Ryzen 7 5800X3D, WinLibs GCC 15.2.0 r7 (MinGW-w64 UCRT), Release, BUILD_TESTING=ON. Merge-tree of the PR head against `main` is clean. I built only `guest_disc_map_tests`; `ctest -N -R guest_disc_map` lists exactly one test. **Results (3 runs each):** - PR head: `guest_disc_map` passes 3/3. - Baseline: I kept the PR's test and replaced only `core/libs/prx/libSceDiscMap/Export.cpp` with the version from the PR's merge base (`434e965d46`), then rebuilt. The test fails 3/3 (exit 0xc0000409). I restored the PR's files afterwards. **Not run:** other platforms, the other tests in the same family, the full repository CTest, and any title or console run. AI-assisted (Claude Code).
MarcZX10 commented 2026-10-23 04:06:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T04:06:03Z.

Review: CHANGES_REQUESTED


Reviewed this original DiscMap implementation and ran its exact-head focused test locally: GCC 12.2 built Export.cpp plus GuestDiscMap.cpp with -O2 -Wall -Wextra -Werror; the test passed. Current-main conventions and diff checks pass against 9d6adeb, and the PR reports an independent Windows 3/3 positive run with a 3/3 failing baseline control.

The head still needs updating before merge. GitHub reports it non-mergeable, and current main has changed core/libs/prx/libSceDiscMap/Export.cpp since this PR's base (including the other export's signature from #9137). Please rebase onto current main, preserve that current signature alongside this function, and rerun the focused test against the rebased tree. A newer PR #9997 now proposes the same function; I asked its author to coordinate rather than maintain two implementations.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5623756784 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8647#pullrequestreview-5623756784). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-23T04:06:03Z. **Review:** CHANGES_REQUESTED --- Reviewed this original DiscMap implementation and ran its exact-head focused test locally: GCC 12.2 built `Export.cpp` plus `GuestDiscMap.cpp` with `-O2 -Wall -Wextra -Werror`; the test passed. Current-main conventions and diff checks pass against 9d6adeb, and the PR reports an independent Windows 3/3 positive run with a 3/3 failing baseline control. The head still needs updating before merge. GitHub reports it non-mergeable, and current main has changed `core/libs/prx/libSceDiscMap/Export.cpp` since this PR's base (including the other export's signature from #9137). Please rebase onto current main, preserve that current signature alongside this function, and rerun the focused test against the rebased tree. A newer PR #9997 now proposes the same function; I asked its author to coordinate rather than maintain two implementations.

Pull request closed

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!8647
No description provided.