Commit Graph
4503 Commits
Author SHA1 Message Date
Connor Garey d316ff1001 Passed relevant dependencies to build and run shadPS4 through the development shell. (#4894)
Boot to black screen.

Fully booting.

Move runtime-deps to top scope.

Fully booting with reduced inputs.

Concat runtimeDeps to sdlConfigureDeps.

Removed duplicate packages in sdlConfigureDeps

Removed vulkan-loader and libX11 from runtimeDeps as not shared with
sdlConfigureDeps, moved directly into makeLibraryPath

Flatten lists before passing to makeLibraryPath

Formating.
2026-08-22 00:42:57 -07:00
Connor Garey 500f413735 Swap the 3 to 2, clear OOB (#4895) 2026-08-21 11:27:12 -05:00
Stephen Miller 443676d825 reduce sceImeDialogGetStatus to trace (#4888)
Not gonna touch the rest of this vibe-coded garbage, but I am tired of this spamming when it's effectively meaningless to everyone.
2026-08-21 09:03:00 +03:00
TheTurtleandTdlife Peng c1d5b311b4 More gpu improvements (#4889)
* spirv: emulate GCN MSAA sample index wrapping in ImageRead

GCN hardware silently wraps out-of-range MSAA sample indices
(e.g. index 2→0, 3→1 on a 2x render target).  Vulkan requires
valid sample indices and returns undefined values otherwise,
which corrupts neighbourhood min/max in the TAA resolve pass
and produces severe motion ghosting.

Fix by emitting OpImageQuerySamples + OpUMod to compute
ms %= actual_sample_count when the image is Color2DMsaa.

(Claude Code / deepseek-v4-pro)

* buffer_cache: add memory barrier before download copyBuffer

DownloadBufferMemory copies a GPU buffer into the download staging buffer
without any barrier between the compute dispatch that wrote the buffer
(SHADER_WRITE) and the vkCmdCopyBuffer that reads it (TRANSFER_READ).
The copy can therefore read stale L2 contents written before the
dispatch.  This surfaced as all-zero readbacks of the cascade shadow
AABB ring buffer, which produced wrong split distances and flickering /
missing shadows.

Insert a pipelineBarrier2 before the copy, synchronising the whole buffer
from eMemoryRead|eMemoryWrite to eTransfer|eTransferRead.

(Claude Code · deepseek-v4-pro)

* buffer_cache: Stub HTILE zmask bits to uncompressed state on reads

* vk_rasterizer: Replace assert with warning

The assertion isnt actually useful at all but still keeping it as a log since its a rare case

* vk_rasterizer: Log invalid T# rejection

* vk_rasterizer: Reject T# with pitch smaller than width

* clang format

---------

Co-authored-by: Tdlife Peng <tdlief.peng@gmail.com>
2026-08-21 07:52:56 +03:00
Marcin Mikołajczyk e4ff203093 Neo: MIMG instructions (#4414) 2026-08-20 11:48:18 -07:00
TheTurtle be21649dd9 Improve tsharp robustness (#4884)
* vk_rasterizer: Check T# validity before binding

* image_view: Clamp base layer to last layer

* memory: Lower clamp log to debug

* vk_rasterizer: Reject invalid data and number format enums
2026-08-20 16:52:16 +03:00
TheTurtle fb79c3a6c5 presenter: Use present scheduler for blank frame prepare (#4883) 2026-08-20 15:29:51 +03:00
squidbus fff4431523 core: Add libScePngDec to LLE list (#4881) 2026-08-19 14:48:16 -07:00
georgemoralis 0deda5e2a4 stubbed fs (#4879) 2026-08-19 10:27:15 -05:00
georgemoralis bdab2f960d Added support for zar in FindGameByID (#4871)
* added support for zar in FindGameByID

* fixed file read in zarchive
2026-08-19 14:09:05 +02:00
Connor Garey fceea0e005 Nix remove abseil (#4876)
* Updated flake lock and removed abseilCPPSource input.

Removed abseilCppSource references.

Removed abseilCPPSource input from flake.lock, updated lockfile.

* Fixed Documentation which should be "releaseWithDebInfo" not "releaseWithDebugInfo"
2026-08-19 13:32:57 +02:00
squidbus dd96818229 shader_recompiler: Storage buffer related clean-up (#4874)
* shader_recompiler: Clean up buffer storage classes

* video_core: Align buffer-for-image to storage alignment
2026-08-19 13:55:13 +03:00
TheTurtleandTdlife Peng d6857fbc34 shader_recompiler: compute GDS offset dynamically instead of as compile-time constant (#4875)
The existing code was written before M0 was added to SSA rewrite pass
Avoid hardcoding the offset then and use the value directly

Co-authored-by: Tdlife Peng <tdlief.peng@gmail.com>
2026-08-19 13:37:10 +03:00
Marcin Mikołajczyk ff62c9952f Properly handle BaryCoord attributes on non-AMD GPUs (#4401)
* Properly handle BaryCoord attributes on non-AMD GPUs

* Fix BaryCoordSmoothSample
2026-08-19 11:47:46 +03:00
georgemoralis 46ae080038 stubbed signals (#4873) 2026-08-19 00:36:12 +03:00
squidbus 8bc251210b externals: Use abseil as submodule instead of fetching at build time (#4872) 2026-08-18 14:34:08 -07:00
kalaposfos13 11a5e47a7f Fix the emulator hanging on attempting to close normally (#4870)
I have no clue what causes this to happen.
2026-08-18 16:32:41 +03:00
kalaposfos13 db2f820a9f fix incorrect libc and libSceFios2 checks (#4868) 2026-08-18 13:33:14 +02:00
kalaposfos13 f80c7ae149 Add asserts for some common corrupt dump indicators (#4867)
* Assert on attempting to load existing but invalid/corrupt executables

* Assert if guest apps actually use libc and libSceFio2 but they're absent

* Update wording if the main executable doesn't exist
2026-08-18 13:03:03 +03:00
kalaposfos13 e67d5676d9 Rewrite signal emulation again (#4858)
* Rewrite signal emulation again
This time, use only one host signal as a communication primitive, instead of trying to map host -> guest signals to each other. This allows us to ignore host limits and emulate an arbitrary amount of signals at the cost of more manual bookkeeping. Hardware signals like SIGSEGV or SIGILL have their own logic, but ultimately also slot into the same backend.

i read way more man pages for this than one might think

* fix macOS

* well I guess we start fixing windows compile errors one by one

* more ifndef

* more ifndef

* this time for sure

* +

* let's see how much of this compiles

* -

* Propagate info and context in the non-hardware-signal path as well (might be subject to race conditions)

* small refactor

* Update SigDflHandler to preserve original access violation logging

* Populate _si_addr in guest siginfo and add basic Windows hardware signals
Also check if g_curthread is valid because host threads can also technically get a signal I guess

* Support modifying context on POSIX

* this isn't const anymore

* missed cast to void*

* Apparently this is valid for windows too, not sure if it works for anything other than the emulated hardware signals though

* fix windows build

* this is the last time I'll ever develop anything on a platform I can't (be assed to) compile for

* Make CallbackWrapper PS4_SYSV_ABI

* Initialize mc_rip in Ucontext's Windows constructor as well

* more Windows hardware signals

* openorbis defines strike again

* I'm never trusting OO with fucking anything ever again

* Fix non-signal-related asserts and unreachables just hanging the emulator by removing the handlers before executing the breakpoint

* factor out signal related defines into a header and add si_code-s

* NativeSiCodeToGuest

* Some reasonable default codes for Windows exceptions

* copyright 2026

* fix macos
2026-08-18 12:19:04 +03:00
georgemoralis 5869ff1e03 starting 0.18.1 2026-08-18 11:39:21 +03:00
georgemoralis e3ce810f3a tagged 0.18.0 release v.0.18.0 2026-08-18 10:49:32 +03:00
kalaposfos13 0000a06d8f Fix issues related to platinum trophies (#4865)
* Check unlocked trophy count in the file the unlock state is actually saved to

* Ignore DLC trophies when checking for platinum unlock

* Delay the platinum popup to after the previous one has finished

* Update np_trophy.cpp
2026-08-18 00:22:18 +03:00
Stephen Miller 4cc54cdadd Update thread_state.cpp (#4860) 2026-08-16 02:00:01 +03:00
georgemoralis 4c4eb586f5 fixing stop deadlocks (#4859) 2026-08-15 13:06:16 -05:00
junminlee2004 555c458c9f video_core: honor STENCILOPVAL for GCN ReplaceOp stencil writes (#4857)
* video_core: honor STENCILOPVAL for GCN ReplaceOp stencil writes

* video_core: log warning if op_val breaks stencil check
2026-08-15 16:35:40 +02:00
kalaposfos13 87114b0e20 Silence the extremely spammy compiler warning after #4804 (#4856)
* Silence the extremely spammy compiler warning after #4804

* Change WIN32 check to MSVC check
2026-08-15 08:11:02 -05:00
Gabriele C. bed2fd8d5f Core: Load guest modules below 4 GiB (#4848)
* Core: Load guest modules below 4 GiB

At the moment, modules are mapped starting from 0x800000000. This address
lies beyond the SYSTEM_MANAGED_MAX limit (0x7FFFFBFFF), so the modules end
up outside the system-managed area to which they belong, and no pointer to
them fits within 32 bits.

A title ported from PS3 may contain code that truncates an address to 32
bits, which is harmless on a real console because modules are mapped low,
but causes addressing issues here.

Let's map them starting from 0x80000000 as recommended by @raphaelthegreat.

* Core: Give executables and system modules their own load base

The previous commit moved everything to 0x80000000, system modules
included, which have no reason to be there. Split the base in three: an
executable asks for the bottom of the address space, a title's own modules
start at 0x80000000, and system modules stay at 0x800000000, where they
were.

Executables are told apart by their ELF type rather than by file name, so
that ET_SCE_EXEC and ET_SCE_DYNEXEC both land low.

Suggested by @StevenMiller123 and @red-prig.

* Core: Load executables at the game module base for now

Giving executables the bottom of the address space crashed some titles, so
put them back with a title's own modules at 0x80000000 until that is
understood. System modules keep their own base. With executables and game
modules sharing one, there is nothing left for the ELF type to tell apart,
so that test goes away too.

Reported by @StevenMiller123.

* Revert "Core: Load executables at the game module base for now"

This reverts commit c310dbc5bb.

The crashes behind it turned out to come from another PR, so executables go
back to the bottom of the address space, which is where Final Fantasy XII
needs them.
2026-08-14 11:53:20 -05:00
Vladislav Mikhalin 2c69246d81 recompiler: use a*b+c instead of fma for v_mad* ops (#4850) 2026-08-14 14:49:58 +02:00
georgemoralis 1921aee3af sceNpTus support (#4810)
* started tus rewriting

* namespace fix

* initial implementation

* changed copyright until kalapsofos figure out

* more initial work

* synced proto file with shadnet tus changes

* stuctures update

* sceNpTusGetMultiSlotVariableAsync

* fixed structure

* clang always

* fixed structures

* sceNpTusSetMultiSlotVariableAsync

* fixed tus replies

* cleanups

* some more accurate ownerid handling

* ahh comon clang

* sceNpTusGetMultiSlotVariableAVUserAsync,sceNpTusSetMultiSlotVariableVUserAsync

* np_handler fixes

* clang chronicles part2

* added a few sync functions

* small cleanup

* improve abort requests

* FakeAsyncComplete

* fixed OrbisNpTusVariable and added some logging

* added sceNpTssCreateNpTitleCtxA

* sceNpTusSetMultiSlotVariableAAsync,sceNpTusGetMultiSlotVariableAAsync

* sceNpTusGetDataAAsync,sceNpTusSetDataAAsync

* sceNpTusGetDataAVUserAsync,sceNpTusSetDataAVUserAsync

* sceNpTusSetDataAVUserAsync

* improved debugging logging

* a lot more nptus commands (needs server side updated pr as well)

* ;/

* even more tus

* completed tus calls (still TSS partial but later)

* added crosssave tus

* clang
2026-08-14 14:29:01 +03:00
Stephen Miller 28c84fb5a7 Use a recursive mutex so deferred operations can defer more operations (#4846)
DMA needs buffer cache stuff, and the buffer cache likes to defer ops.
2026-08-13 23:51:02 +03:00
Stephen Miller 8dcf3e9bd6 Only clear oact if oact is provided (#4845)
Thought I fixed this before merge, guess not.
2026-08-13 14:28:07 -05:00
Stephen Miller c76f37c1b6 Hopefully fix random UE crashes for real this time? (#4844)
Apparently the C++ container classes generally aren't considered thread safe. As a result, PopPendingOperations could race with calls to DeferOperation, causing undefined behavior.

Also, missed this in my prior fix, but PopPendingOperations cannot race with the priority op runners, as they're using two separate queues. The reason my prior PR targetting this issue seemed like it helped was probably just because it prevented the GPU thread from running pending ops whenever priority runners were dealing with their priority ops.
2026-08-13 22:08:39 +03:00
Stephen Miller e81418b46e Lib.Sysmodule: Enable more safe library LLEs (#4843)
* Allow libScePsmKitSystem LLE

Loaded and used by psmkit software (basically just Media Player). All this library does is return hardcoded paths to fonts, it's basically just libSceWkFontConfig, but for psmkit instead of webkit.

* Also add libSceBeisobmf and libSceBemp2sys to the list

Not too sure what these do, but they're not using any special libs, just basic libSceLibcInternal operations.

* Document libSceAvPlayer and libSceAvPlayerStreaming

These were added, but not mentioned in the readme. Though honestly, I think the list is large enough that we should probably just get rid of it and replace it with a blanket "put all libraries in sys_modules" statement.
2026-08-13 19:59:36 +03:00
Vladislav Mikhalin b1a33c3db7 vdec2: revert CPU and GPU memory calculations (#4842) 2026-08-13 19:39:32 +03:00
Vladislav Mikhalin 85382937e8 avplayer: allow LLE (#4833)
* avplayer: allow LLE

* got rid of global picture info storage

* fixed vdec1 videos stuttering or not working

* vdec: pass opaque data correctly, use mem calc from vdec in vdec2

* uhh

* fixed half speed videos (don't ask why it works)

* final touchups
2026-08-13 09:26:22 +03:00
kalaposfos13 23392e1835 Add config option extra_fmem_in_mbytes (#4832)
* extra_fmem_in_mbytes config option

* Update memory impl to use the new option
2026-08-12 22:17:00 +03:00
Stephen Miller 345565ad50 Various fixes around Media Player (#4804)
* Set oact in Windows sigaction stub

Media Player, being the rather strange mess it is, bases the success of sigaction based on the output oact data. If you don't touch oact, it is filled with garbage data, and the app will not proceed.

* psmkit exception exports

* posix_access

* handle posix_stat on filesystem root

* Fix environ export

* module exports

* Adjust pthread struct to ensure pthread specific elements are at offset 0x1c8

In what most would consider a programming war crime, Sony has once again imported thr_private.h into some of their libraries 😆
The mono runtime Sony created for internal use accesses pthread specific elements directly through pthread objects, using either pthread_self or even the tcb.

I've moved some of the class objects around to ensure the specific elements have the same offset cross-platform, then added padding to give it the proper offset.

* use unique_ptr instead of modifying the struct

* Handle TCB related instructions with any offset

Now that I understand this is all part of the actual TCB struct, things are much easier.
For Linux, do nothing since the putseg was already doing everything for us.
On Windows, we need to get the correct data from in the TCB struct to return to the guest. which is just an extra instruction.

Doing this properly also allows us to remove the GenerateStackCheck and GenerateStackCanary patches, as this behavior is covered by GenerateTcbAccess and GenerateTcbExclusiveOr now.

* Export sceKernelGetFsSandboxRandomWord

for psm stuff

* Return module ids in Module::GetModuleInfoEx

Doesn't seem to fix anything, but doesn't hurt to have.

* Clang

* Rename cookie to canary

More technically accurate name

* Bump access log to info

* Fix compile after rebase

* Single device for deci_tty, allow opening /dev/deci_tty7

Another thing psmkit uses.

* Fix default sched policy

FreeBSD defaults to SCHED_OTHER, but PS4 (based on libkernel) defaults to SCHED_FIFO

* Fix environ, part 2

I don't fully understand why this is necessary, but it fixes issues we're having with stuff that reads from environ when you actually populate it.
In the future, it might be good to add a guest argument for setting environ variables?
2026-08-12 20:47:29 +03:00
junminlee2004 e5fcae6a54 video_core: service readback faults at widened window (#4839)
* video_core: service readback faults at widened window

* Increase buffer cache window size to 512 KB

* video_core: mark cpu-modified regions at the download call sites
2026-08-12 17:56:02 +03:00
kalaposfos13 63075c4820 Add --env flag to pass environment variables to the guest (#4836)
* Fix environ export that was not working for some reason

* Add --env flag to pass environment variables to the guest
2026-08-12 10:43:10 +03:00
DanielSvoboda 4d39337392 FMask (#4821) 2026-08-11 19:57:08 -07:00
Stephen Miller 05302af14d Only parse what's before the double-dash arg when the double-dash arg is actually specified. (#4837) 2026-08-11 16:43:18 -05:00
kalaposfos13 11aaefe217 Implement sceKernelIsDevkit and sceKernelIsCex (#4831)
* Implement sceKernelIsDevkit and sceKernelIsCex

* I guess some logging never hurt anybody except windows users before
2026-08-11 23:41:01 +03:00
kalaposfos13 b70f264142 Add --mount flag, update the no flags popup text with Big Picture mode info, and fix a few edge cases with command line parsing (#4827)
* Add --mount flag, update the no flags popup text with Big Picture mode info, and fix a few edge cases with command line parsing

* fix windows

* I probably should build this locally before pushing but I just can't be bothered to wait through recompiling everything each time from all the branch switches

* we do not like clang-format here, sir
2026-08-11 22:09:58 +03:00
rainmakerv2 b5850c7e20 big picture: fix update checker crash with certain zar/folder combinations (#4828) 2026-08-11 21:51:43 +03:00
kalaposfos13 2042f90dde Add back HLE sceLibcHeapGetTraceInfo for when LLE libSceLibcInternal is not present (#4835) 2026-08-11 10:02:37 -05:00
Stephen Miller 7fe6a0aa0c Core: Call sceLibcInternalMemoryMutexEnable LLE on startup (#4822)
* Call sceLibcInternalMemoryMutexEnable LLE on startup

Also use mod->FindByName instead of doing the manual lookup

* Remove forced-hle for sceLibcHeapGetTraceInfo
2026-08-11 05:26:48 -07:00
kalaposfos13 cda4c7780a Add some exports for VSH (#4826)
* libkernel-libkernel sem_* functions

* posix_pthread_exit

* sceVideoOutSysGetVblankStatus

* sceVideoOutSysGetResolutionStatus

* sceVideoOutSysAddVblankEvent

* posix_pthread_getschedparam
2026-08-11 14:30:23 +03:00
kalaposfos13 00c16a72eb Add /dev/zero (#4825)
* /dev/zero

* bro had one job
2026-08-11 13:49:53 +03:00
rainmakerv2 c5ae3c6812 Big Picture: zar support (#4815) 2026-08-08 22:13:34 +03:00