Libs: add libSceDiscMap HLE exports - #79
Merged
Merged
Conversation
Port the libSceDiscMap stubs from Kyty (InoriRus/Kyty, MIT) into the SysAbiExport model. Disc-installed titles probe these NIDs on most file accesses to decide whether a read must be redirected to the disc drive; answering that every request is already resident on internal storage keeps I/O on the regular file system path instead of failing with unresolved-import errors. - sceDiscMapIsRequestOnHDD (lbQKqsERhtE): validates args, writes 1 to the result pointer, returns 0 - fJgP+wqifno / ioKMruft1ek: zero-fill the three output pointers, return 0 (names not present in ps5_names.txt; kept as descriptive Unknown exports like the existing sceKernelUnknown* convention) - DISC_MAP_ERROR_INVALID_ARGUMENT (0x81100001) on null pointers, matching the documented libSceDiscMap error range - optional tracing via SHARPEMU_LOG_DISCMAP=1
|
@par274 If I remember correctly, this ABI/API (DiscMap) is only available on the PS4, not the PS5 |
Collaborator
|
These may be leftovers on the PS5. The real question is: which game called them? |
Contributor
Author
|
It is actually used on the PlayStation 5. I looked through the PS5-3.20_Libs, and there's a file called libSceDiscMap |
Collaborator
|
Yes, that's correct. I don't know whether any games actually call them, but they shouldn't hurt the semantics |
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
Adds an HLE implementation of
libSceDiscMapas a newDiscMapExportsclass inSharpEmu.Libs, following the existingSysAbiExportconventions (validated pointers,OrbisGen2Resultcodes, optional env-gated tracing).Disc-installed titles call into
libSceDiscMapon most file accesses to decide whether a read has to be redirected to the Blu-ray drive. Without these exports the imports resolve toORBIS_GEN2_ERROR_NOT_FOUND, which titles can treat as an I/O failure. Reporting every request as already resident on internal storage keeps reads on the regular file system path.Exports
lbQKqsERhtEsceDiscMapIsRequestOnHDD1to the result pointer, returns0fJgP+wqifnosceDiscMapUnknownFJgP0ioKMruft1eksceDiscMapUnknownIoKM0DISC_MAP_ERROR_INVALID_ARGUMENT(0x81100001), consistent with the known0x811000xxlibSceDiscMap error range.ORBIS_GEN2_ERROR_MEMORY_FAULT.SHARPEMU_LOG_DISCMAP=1to trace calls (path, offset, size), matching theSHARPEMU_LOG_PTHREADSpattern.sceDiscMapIsRequestOnHDDis already inscripts/ps5_names.txt, so Aerolib resolves the name; the two unidentified NIDs keep descriptiveUnknownexport names like the existingsceKernelUnknown*entries.Source / attribution
Behavior is ported from the
LibDiscMap.cppstubs in Kyty (MIT), rewritten in C# for SharpEmu's export model. shadPS4's HLE discmap work was used as a cross-reference for the argument layout of the two unidentified NIDs (path, offset, nbytes, three out-pointers). This PR was prepared with the help of an AI assistant; flagging that for the maintainers' awareness.Testing
dotnet build SharpEmu.slnx— clean, 0 warnings / 0 errors (SDK 10.0.103)ModuleManager.RegisterFromAssembly: all three NIDs register and dispatch,sceDiscMapIsRequestOnHDDwrites1and returns0, null-pointer calls return0x81100001, and the triple-output NIDs zero their out-params.No existing NIDs are touched; the change is purely additive.