Repository navigation
feat(libSceDiscMap): report no disc bitmap from the two disc map queries - #6527
Merged
Merged
Conversation
Until Dawn (CUSA02636) bundles a libSceFios2.prx that imports two libSceDiscMap functions, sceDiscMapIsRequestOnHDD (lbQKqsERhtE) and ioKMruft1ek, and no host library exported them. Both now return SCE_DISC_MAP_ERROR_NO_BITMAP_INFO (0x81100004) and write nothing, as shadPS4 and fpPS4 do. That is the error the console library returns while it has no disc bitmap loaded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Progress report (44df216 → 716d811)➖ System libraries: 88.8% (+0.0%, +2 implemented functions) ✅ 2 implemented
⚪ 2 behaviourally empty (constant return or throw)
|
14 tasks
12 tasks done
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
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.
|
12 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Until Dawn (CUSA02636) bundles
libSceFios2.prx(01.00), which imports two functions from the system librarylibSceDiscMap.prx. SuperCatElvis reported the stop on #3093, on an earlier Windows checkout (#3141, #3142 and local changes): "The EXE then starts and stops at load onlibSceDiscMap.prx, imported by the bundledlibSceFios2.prx(NIDs ioKMruft1ek, lbQKqsERhtE)". No log line was posted. AnyPS5 has no libSceDiscMap; the only mention onmainis the sysmodule table entry0xd7.Bloodborne bundles an old
libSceFios2.prxtoo, and it imports the same two NIDs and no other libSceDiscMap function:libSceFios2.elf(symbols/imports.csv L690-L691).Why the missing library matters. As for #4960, every module in
sce_moduleis converted and loaded at start-up. Each module's DT_NEEDED goes into the converted executable's host libraries (GuestModuleBuilder.cpp L301-L304), solibSceDiscMap.prxis needed at start-up.On Linux, it becomes a DT_NEEDED entry of the executable (L312), found through the run path
$ORIGIN/libs, onmainand with #6381 alike.On Windows, what the start-up stub (WindowsEntryStubBuilder.cpp) does with a missing file depends on whether the imports name their library. I read both cases from the stub; I didn't run them.
main,libSceFios2.prx's imports have no library, becausemaindoesn't read the PS4 needed-module tag. So the missing file is skipped (L512-L524), and both NIDs would fail at start-up withunresolved ELF import. This title can't get there onmain: even past its earlier stops, the same untied imports stop its conversion at stop 8 (Cyclic guest initialization dependency: libSceFios2.prx), which fix(relinker): read the PS4 needed-module tag in guest modules #6381 fixes.libSceDiscMap.prxand the load is required. The start then stops withFailed to load module: ...\libs\libSceDiscMap.prx.Is it a system library? Yes. Titles ship
libSceFios2.prxinsce_module. SuperCatElvis's CUSA02636 01.00 haslibc.prxandlibSceFios2.prxthere (comment). The console provideslibSceDiscMap.prxinsystem/common/lib(ps4libdoc 9.00), and the sysmodule table lists it as module0xd7.Change. New system library
core/libs/prx/libSceDiscMap, with the two functions:lbQKqsERhtEsceDiscMapIsRequestOnHDD(const char* path, int64 offset, int64 size, int32* result)ioKMruft1eksceDiscMapUnknown_ioKMruft1ek, exported withAPS5_EXPORT)(const char* path, int64 offset, int64 size, void* flags, void* out1, void* out2)Both return
SCE_DISC_MAP_ERROR_NO_BITMAP_INFO(0x81100004) and write nothing. That is what the console library appears to return before it is initialised:libSceFios2.prx, shadPS4 lists CUSA02636 as in-game on Linux (shadps4-game-compatibility#617).sceDiscMapIsRequestOnHDD's result and 64-bit zeros to all threeioKMruft1ekoutputs, and returns 0. I found no title evidence for either.Neither function throws,
ioKMruft1ekincluded. #2686 reads every console libSceDiscMap call as returning this error while the library is uninitialised, and in that state nothing is written. So the unknown widths ofioKMruft1ek's outputs (shadPS4int*, fpPS4PInt64) don't matter here; they arevoid*and never written.Not added: the other libSceDiscMap NIDs. No title reported here imports them; Bloodborne's Fios2 also imports only these two. A title that does import one fails at start-up with a clear error.
fJgP+wqifnois the likely next one: by firmware 3.55 the systemlibSceFios2imports it instead ofioKMruft1ek, so a title that bundles a newerlibSceFios2.prxwill need it. ps4libdoc's 3.00 Fios2 importsioKMruft1ekand its 3.55 Fios2 importsfJgP+wqifno; it has no dump in between.fl1eoDnwQ4s(sceDiscMapGetPackageSize) and5+vOlukvkfg.Listed as silent stubs. Both functions are listed under Silent stubs in the new
docs/dev/debt/libSceDiscMap.md. CONTRIBUTING allows a silent stub only when it only affects the UI, and this one doesn't: its caller is Fios2, the title's file I/O library.libSceFios2.prxdoes with that error wasn't seen here. shadPS4 returns the same error to the same module, and the title is in-game there (test(agc): discard the results of recompiles expected to be refused #617, above).Tested
Ubuntu 24.04, GCC 13.3, Release with
BUILD_TESTING=ON, onmain92e5041. Locally the libusb submodule isn't checked out, so I removed its two lines fromCMakeLists.txt.New
guest_disc_map(core/libs/tests/GuestDiscMap.cpp, registered from the library'sCMakeLists.txtas for libSceMbus) calls both functions with sentinel outputs. It requires 0x81100004 from each and every output unchanged.mainit does not build: nothing defines either function.sceDiscMapIsRequestOnHDDwrites 1 to its result, or ifioKMruft1ekwrites a 32-bit or 64-bit zero to any output.Full
cteston the RTX 3050 Ti: 1,259 of 1,264 pass.agc_driver_stencil_ref_exporton this GPU, and the VideoOut flip and frame-dump tests, which need a display.patched_librariesandguest_usbdare Not Run, because the libusb submodule isn't checked out. So I patchedlibSceDiscMap.prxby hand with the build'snid_patchercommand.libSceDiscMap.prx:agc_pending_key_storesfails onmainsince perf(agc): clear a register fast clear without waiting for a known key store #6247.agc_driver_store_over_untrackedfails atstore over untracked: the result did not reach a block the CPU left alone. adriadam10 also sees it fail intermittently withmain's code (#5815, #5750).video_out_hdr_presentfails atSDR presentation of the DCC-cleared PQ buffer at 437 nits (clear value conversion) has no frame dump within one level of the CPU conversion, 4 runs out of 4. It passed in my first full run onmainff23657, before the rebase, so something inmainsince then or this host is the cause; I haven't looked further.nm -Don the NID-patchedlibSceDiscMap.prxlistslbQKqsERhtEandioKMruft1ek, andrYeuVKb2RZQ, the NID of the C namesceDiscMapUnknown_ioKMruft1ek(libScePad's unnamed exports get the same).tools/check_conventions.pyfrommainpasses with this title and body.@SuperCatElvis, if you can, could you swap this in for your local state and check that the start-up gets past
libSceDiscMap.prx? The exact start-up line from your earlier run would help too.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.mdfiles or images added to the repository (attach them to this PR)main:mainthe title stops during conversion. Of the 11 stops SuperCatElvis listed ond92a8da:libSceDiscMap.prxstop was seen on their earlier Windows checkout, which passed the eboot's TLS import through.import_audit.pyrun on the executable's registry (a checkout with fix(relinker): read SCE dynamic tables from PT_SCE_DYNLIBDATA #3141 and fix(relinker): stop code scans at the PLT for PS4 executables #3142) counted 230 absent of 748.--lazy-bindingdoesn't apply with bundled modules.cteston NVIDIA GeForce RTX 3050 Ti Laptop GPU, driver 580.178.04, Ubuntu 24.04🤖 Generated with Claude Code