* add recursive scanning - force depth 2 for now, make configurable later
* make setting configurable
* match item widths
* correctly load language as specific, fix profile button naming with multiple same titleid entries
* catch fs errors, while ensuring all other items are scanned
* cpu_patches: Apply CPU patches ahead of time on macOS
* module: Use one static patching flag for Windows and macOS
* cpu_patches: Patch SSE4a instructions between the functions of the EH frame table
* emulator: Log the red zone patching setting on macOS
* Revert "emulator: Log the red zone patching setting on macOS"
* module: Share one static patching block between Windows and macOS
- Fix alignment validation in sceKernelReserveVirtualRange to check both power-of-2 and 16KB page alignment per libkernel.sprx (0x1861e)
- Enforce 2GB maximum alignment bound per libkernel.sprx
- Implement sceKernelClearVirtualRangeName (NID mkgXxsoxWHg)
- Match libkernel 16 KB page alignment and madvise/VirtualAlloc(MEM_RESET) page release semantics
- Return ORBIS_KERNEL_ERROR_EINVAL on failure or invalid parameters
- Add posix_mlock/munlock with parameter checks and wrap sceKernelMlock/munlock
- Register POSIX and SCE NID mappings in libkernel and libScePosix
* vk_rasterizer: Only redirect stencil reads for stencil-compatible formats
The stencil-to-depth association is keyed on the stencil plane address
alone, so it also lands on unrelated surfaces that reuse that memory.
Following it for a non-stencil format builds a view of the depth-stencil
image in another compatibility class with a Depth|Stencil aspect, and
storage writes through that view corrupt the depth buffer. Only redirect
when the request can actually be a stencil view.
Together with readbacks set to Precise this fixes the missing world
geometry in Uncharted: Drake's Fortune Remastered (CUSA03280).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* texture_cache: Only link stencil images with a stencil format
Don't associate a color image with the depth buffer in the first place,
as suggested in review, instead of skipping the redirect in BindTextures.
FindDepthTarget now only links the placeholder or an image with a stencil
compatible format at the stencil address, and doesn't create a
placeholder over a color image. The BindTextures check is reverted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* texture_cache: Keep dummy stencil associations at reused addresses
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* shader_recompiler: Zero PackedAncillary left over after lowering
LowerPackedAncillary replaces the raw ancillary VGPR value with zero once
it lowers a bitfield extract from it. Since #5116 moved
LowerHardwareIntrinsics after dead code elimination, a dead extract is
already gone at that point, so the raw value is never zeroed and reaches
the SPIR-V emitter, which cannot emit it. God of War III (CUSA01715)
crashes on fs 0xeb50917148e7d775, where the shader reuses VGPR4 and one
path still carries the ancillary value into a Phi.
Zero any GetAttributeU32 PackedAncillary still left after the lowering
loop. The pass order from #5116 is kept, and shaders that compiled
before are unaffected, since the emitter could not handle the raw value.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* shader_recompiler: Lower PackedAncillary from its load
Start from the GetAttributeU32 that loads PackedAncillary, lower the
bitfield extracts that use it and then always replace the load with
zero, as suggested in review. This no longer depends on an extract
surviving DCE, so the separate loop after lowering is removed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* scePthreadRwlockTimedrdlock / scePthreadRwlockTimedwrlock take a relative timeout in microseconds (SceKernelUseconds), not a pointer to an absolute timespec like the POSIX calls.
* changed naming to proper
* make rwlock happy
* Fix config annoyances
Removed a million "Windows static guest red-zone protection" logs, removed the excessively wordy logging for red-zone being enabled, made the red-zone patches setting a proper setting in our general category (with backwards-compat for the old setting behavior so users don't need to change anything and GUI doesn't need adjusting)
Also fixed implementation for the userfaultfd and inline_fetch_parsing config settings introduced in recent PRs. Due to oversights from those respective devs, neither setting was actually getting read from the config.
* Nuke the red-zone config tests
These were all dependent on the old behavior. There's no point in these now that red zone patches are a proper config setting.
Ancient libSceFios2 versions have a module_stop export which falls into the `ids.size() == 1 && sym_type == Loader::SymbolType::NoType` branch. Because we were initializing library and module up here, the game was accessing oob indexes and causing debug asserts.
* shader_recompiler: Handle 1D images as 2D for compatibility
* shader_recompiler: Restore Cube image type and move array lowering to backend
* shader_recompiler: Move cube calculations to SPIR-V