Commit Graph
4217 Commits
Author SHA1 Message Date
kalaposfos13 54ec7d00a0 Trigger a lightbar reset on controller connection (#4927)
Because the config is now parsed earlier than controller connection, we can no longer update the lightbar directly from the input config loading code, at least on startup. It's still used for mid-game input config reload though
2026-08-26 23:57:06 +03:00
DDK00011andliam e968c1fff3 common: free Windows thread descriptions (#4911)
Co-authored-by: liam <weaver.us168@gmail.com>
2026-08-26 10:30:38 +03:00
georgemoralis 83511183a2 Net Fixes (#4910)
* added method to retrieve all socket handles

* fixed some error codes

* copyright or kalaposfos will hunt me

* sceNetGetSockInfo added

* small fixups

* fixup
2026-08-26 10:00:33 +03:00
georgemoralis c9a5a014de Trophies online (shadNet) (#4914)
* updated client for trophies

* updated np_handler with trophy commands

* update np_trophy with shadnet commands
2026-08-25 19:18:40 +03:00
TheThunderTurner 616b126b34 Missing ps4/ps5 return function (#4912)
* return false

* i hope this is it

* move to process.cpp

* libkernel-libkernel

* logging

* logging
2026-08-25 09:04:05 -05:00
georgemoralis 7fb1a530c1 Http2 fixes (#4908)
* small http2 corrections - addons

* applied stephen's comments
2026-08-23 11:43:26 -05:00
squidbus 8ca1d49447 video_core: Use stb_image_write for screenshots (#4907) 2026-08-23 10:10:17 +03:00
Stephen Miller f51299942c Revert "Neo: MIMG instructions (#4414)" (#4902)
This reverts commit e4ff203093.
2026-08-22 23:42:04 +03:00
Stephen Miller f952ac205b Log unhandled metadata types instead of asserting (#4903) 2026-08-22 23:21:21 +03:00
TheTurtle f2928289f4 shader_recompiler: Add ssa destruction pass (#4901)
Using the new virtual register infrastructure we can destroy phi nodes back into register load/stores in a general way
2026-08-22 21:59:23 +03:00
TheTurtle 0aea6ef36f shader_recompiler: Add support for virtual registers (#4900)
Useful for expressing load/stores to non guest architectural state
Each virtual register is identified by a unique (index, type) pair
2026-08-22 20:06:28 +03:00
TheTurtle 245d88590d shader_recompiler: Improve ssa rewrite pass correctness and readability (#4899)
The ssa rewrite pass is based on the spirv-opt pass of the same name:
https://github.com/KhronosGroup/SPIRV-Tools/blob/main/source/opt/ssa_rewrite_pass.cpp

This commit brings the pass closer to that reference implementation.
Notably this fixes applying the pass to unstructured graphs which seems to be broken otherwise

Additionally the manual stack iteration of ReadVariable has been replaced with recusion
which is much easier to reason about

Undef handling has also been changed, before each block would define its own Undef instruction,
now the pass will keep track and reuse compatible instructions add insert them to the first block
2026-08-22 19:07:50 +03:00
georgemoralis 3e462bf01b fixed displaying of trophy name (#4898) 2026-08-22 10:41:45 -05:00
Stephen Miller 7d73848b23 Change default GetAuthorizationCode returns to be valid (#4893)
Apparently authentication codes should be 6 characters long, and issuer_id should always be 0x100. These details come from verbose game logs.
2026-08-22 13:03:42 +02:00
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