Commit Graph

3293 Commits

Author SHA1 Message Date
Niram7777
2b7d54f785
Dont use logger after Shutdown (#4302)
* Only flush log if not Shutdown

* Fix null logger deref, copy it
2026-04-21 15:24:05 -05:00
Marcin Mikołajczyk
dcdbd174d2
Define new GCN instructions present in Neo mode (#4297) 2026-04-20 20:53:40 +02:00
squidbus
01e8606f14
renderer_vulkan: Fix additional validation errors (#4296) 2026-04-20 17:00:18 +03:00
squidbus
d1643d1475
renderer_vulkan: Add a few more feature support guards. (#4291) 2026-04-20 02:01:09 -07:00
Marcin Mikołajczyk
ffbcd0d364
For OpImageFetch, do not provide both Lod and Sample operands (#4210) 2026-04-20 11:26:24 +03:00
Kravickas
ae1acfa94d
VUID-vkCmdDraw-None-06887 (#4204)
turtle agreed on that
2026-04-20 11:03:41 +03:00
TheTurtle
526c346f90
renderer_vulkan: Renderer microoptimizations (#4290)
* renderer_vulkan: Microoptimizations from profiling

* buffer_cache: Only use streaming path on cpu modified memory

If the pages arent cpu modified, then a gpu buffer with valid data exists that can be used instead

* clang format

* fix max num_layers
2026-04-20 09:20:07 +03:00
squidbus
90b75eadec
address_space: Fix order of operations (#4288) 2026-04-19 14:26:14 -07:00
Stephen Miller
3400bdf4b1
Core: Fix issues with #4273 (#4287)
* Assert on failed mappings, ignore segment prot

* Re-add segment prot conversion

* Disable backing for execute mappings

Macs don't allow this apparently.

* Add assert for file execute permissions
2026-04-19 14:20:42 -07:00
Stephen Miller
9af4aa2e25
Kernel.Vmm: Proper address checking in QueryProtection (#4286) 2026-04-19 14:20:14 -07:00
Niram7777
0bdc2020b4
HOTFIX: set_color not defined (#4285)
lld-link: error: undefined symbol: public: void __cdecl spdlog::sinks::wincolor_sink<class std::mutex>::set_color(enum spdlog::level, unsigned short)
2026-04-19 15:15:38 -05:00
Niram7777
8fcf8ca894
Logging like in the old days (#4284)
* Log level first letter uppercase

* Old log color

* Missing include Windows
2026-04-19 22:34:35 +03:00
Niram7777
a95e71e156
Remove namespaces in logs (#4283) 2026-04-19 21:37:38 +03:00
Stephen Miller
67edac4c9e
Fix compiler directives in stack.S
Was hidden before because the file was .s (lowercase). When turtle fixed that, this issue became noticeable.
2026-04-19 11:24:00 -05:00
TheTurtle
1a234a566d
kernel: Rename stack file for proper preprocessor support 2026-04-19 18:04:35 +03:00
Niram7777
f65368a3f8
Only flush log on quick_exit or crash (#4281) 2026-04-19 15:44:12 +03:00
Stephen Miller
92cd61fbf5
Core: Proper module memory mappings (#4273)
* Early memory regions setup

Needed to enable flexible allocations before mapping the eboot

* Improved accuracy of module mappings

To keep our current logic intact, reserve the full memory space, then perform fixed mappings for trampoline and segments. Segment mappings use type flexible, so they properly count toward flexible usage, while trampoline mappings use type code to bypass this.

* Asserts for failed offset finding

Always check before you leap.

* Hex logging for segment sizes

* Only map game modules to flex mem.

* Revert "Asserts for failed offset finding"

This reverts commit 38083f8cbb.

* Revert "Early memory regions setup"

This reverts commit da1552d4ac.

* Initialize memory regions in MemoryManager constructor

Much simpler approach to enabling the necessary flexible mappings on startup.
2026-04-19 12:45:02 +03:00
kalaposfos13
26c5963481
temp fix (#4276) 2026-04-19 12:30:51 +03:00
rainmakerv2
1cd61ba2da
slight cleanup and reorganization (#4278) 2026-04-19 12:12:10 +03:00
Vladislav Mikhalin
9ec75c32ad
threads: remove low level threads on windows (#4277) 2026-04-19 12:00:49 +03:00
Vladislav Mikhalin
9141c19302 align stack to 16 2026-04-19 09:37:55 +03:00
Niram7777
854b291c63
Spdlog migration (#4069)
* spdlog migration

* gitmodule instead of cmake
2026-04-19 00:57:05 +03:00
Vladislav Mikhalin
beba435a09
separate thread init and run stacks (#4274)
* separate thread init and run stacks

* copyrights

* remove TEB setting

* revert fibers

* fix linux

* remove unused variables
2026-04-18 16:17:48 +03:00
rainmakerv2
16633df872
Big Picture Settings: Add game folder selection (#4271)
* Add game folder selection

* reuse

* add enable/disable checkboxes

* column width fix

* Update ImGuiFileDialog submodule URL and branch

---------

Co-authored-by: georgemoralis <giorgosmrls@gmail.com>
2026-04-18 10:05:34 +03:00
Stephen Miller
2d559a4f77
Remove scePadOpen errors for special pad (#4265)
This has caused issues since the moment they were added, and other devs have mentioned they're inaccurate before
2026-04-16 23:29:53 +03:00
georgemoralis
95ba5918dd
Shadnet preparations (#4269)
* replace psn_signed_in settings with shad_net_enabled and added shadnet_server setting

* improved user manager to update new fields and add new variables

* clang

* better message :D
2026-04-16 20:55:55 +03:00
rainmakerv2
396d397ec6
Big Picture Settings: cleanup (#4268)
* cleanup, declare variables in cpp instead of header

* navigate navigate tabs with tab key as well

* update comment
2026-04-16 11:13:14 +03:00
Stephen Miller
830c5ba435
Core: Fix Debug Dump (#4266)
* Fix

* Clang
2026-04-16 09:20:33 +03:00
rainmakerv2
be224a4556
Big Picture: add settings configuration (#4255)
* prototype settings look

* put categories on top instead of on the side, plays nicer with input system

* added profiles + saving and loading framework

* add helper functions

* fix autofocusing

* add code for using embedded image files

* put settings in different files

* clang

* remove sdl_image submodule, unify functions when possible

* Always display selected profile in settings content areas

* Fix focusing, logs, highlight profile text

* persist highlight on focused buttons, add all categories placeholders

* All settings added

* navigate tabs with l1/r1
2026-04-15 18:19:22 +03:00
georgemoralis
7759f4eb2e
Revert "avplayer/videodec fixup (#4225)" (#4264)
This reverts commit f242655fbb.
2026-04-15 18:02:53 +03:00
rainmakerv2
72f514f350
Trophy: Replace sdl mixer library with minimp3 header for playing trophy sounds (#4261)
* Replace sdl mixer library with minimp3 header

* clang

* set spec before putting in audiostream

* respect main audio output device setting

* fixup

* replace file with submodule

* cleanup

* capitalize functions like the others

* move buffer to heap

* use vector for pcm buffer instead
2026-04-15 10:48:55 +03:00
Kravickas
f242655fbb
avplayer/videodec fixup (#4225)
* avplayer NV12 frame copy

* videodec NV12 frame copy
2026-04-15 10:28:49 +03:00
Marcin Mikołajczyk
f476379b80
Define more GS regs (#4233) 2026-04-15 10:09:15 +03:00
georgemoralis
c395897fbe
Fixed scePthreadSemTimedwait absolute timespec (#4238)
* The usec parameter is a relative timeout, but posix_sem_timedwait expects an absolute timespec

* posix_sem_post , concurrent fix
2026-04-15 08:57:02 +03:00
Marcin Mikołajczyk
c1e496efcd
SDWA (#4203) 2026-04-14 22:41:55 +03:00
rainmakerv2
b12ca606c8
fix real-time volume adjustment with game-specific configs (#4259) 2026-04-14 15:57:08 +03:00
rainmakerv2
cead66d3c6
Big Picture Mode (#4250)
* imguitest

* button tests

* fix gamepad nav

* placeholder hardcoded eboot path

* set focus correctly, move to own files

* get installed game information

* dynamically adjust rows

* use slider for ui scale

* launch big picture with CLI arg

* Use emulator settings for UI scale and window size

* center scrolling on focused item

* fix item focus on scrolling when navigating with keyboard or pad

* minor fixups and comments

* fix performance degradation

* adjust fonts to show TM symbol and higher overscale

* reuse and clang

* add exists check before iterator

* flatten navigation (gamepad navigation crosses child window container)

* cleanup and comments

* simplify update checker a bit

---------

Co-authored-by: georgemoralis <giorgosmrls@gmail.com>
2026-04-13 01:40:11 +03:00
georgemoralis
1c8ace6619
fixed trophy extraction (#4254)
* fixed trophy extraction

* opps

* fixing indexing in np_trophy

* fix
2026-04-13 01:23:00 +03:00
Valdis Bogdāns
311c2dd1cd
Implement screenshot functionality with overlays and game-only options (#4248)
* Implement screenshot functionality with overlays and game-only options

* CLang 🤦

* video: F12 game screenshot, Alt+F12 HUD screenshot

- Capture game-only screenshots from the VideoOut image before FSR/PP scaling (native guest output res)
- Capture overlay screenshots from the swapchain/output image; HDR screenshots are tone-mapped to SDR PNG
- Split screenshot request counters + consumption for game-only vs with-overlays
- Add A2R10G10B10 readback handling and force opaque alpha in PNG output
- Update default hotkeys (keep backward-compat with hotkey_renderdoc_capture)
- Ignore tmp/artifacts/

* Add legacy capture binding support in input configuration

---------

Co-authored-by: w1naenator <valdis.bogdans@hotmail.com>
2026-04-12 17:41:01 +03:00
georgemoralis
cfa5838a13
used default addcont folder if not set (#4253) 2026-04-12 15:45:28 +03:00
Stephen Miller
e16a59be82
Use U64 for U64 value. (#4246) 2026-04-10 01:51:09 +03:00
TheTurtle
1f50aa3172
frontend: Add helper methods for thread bit getters and setters (#4243)
Co-authored-by: georgemoralis <giorgosmrls@gmail.com>
2026-04-09 23:32:21 +03:00
TheTurtle
0d3b6f7dd0
shader_recompiler: Minor improvements to buffer atomics (#4242)
* resource_tracking_pass: Adjust buffer type if host doesn't support float buffer atomic

* resource_tracking_pass: Implement data append/consume as buffer atomics in IR level

This was previously done in spirv backend, the implementation was exactly the same as the buffer atomics, so unify them

* ir: Bump instruction flag to 8 bytes

* frontend: Pass pc to buffer flags for better debugging when sharp tracking fails

* clang format

---------

Co-authored-by: georgemoralis <giorgosmrls@gmail.com>
2026-04-09 23:31:33 +03:00
kalaposfos13
3c390f9889
Implement reserved attribute of OrbisPadTouchData for LLE libSceSystemGesture (#4245) 2026-04-09 14:26:47 -05:00
TheTurtle
927e044f92
constant_propagation_pass: Fold unpack ops with constants and reverse ops (#4240)
Co-authored-by: georgemoralis <giorgosmrls@gmail.com>
2026-04-09 22:13:20 +03:00
kalaposfos13
daa7b5c04b
Fix scePadResetLightBar for TV remotes (#4244) 2026-04-09 21:43:27 +03:00
georgemoralis
474a910ac4
Dialogs fixups (Np_profile_dialog , np_webbrowser dialog) (#4232)
* better transaction handling

* more fixup

* fixup some logs

* refactor : move np_profile_dialog to it's own folder

* initial np_profile_dialog_ui

* fixes a bit more ui

* more fixups

* forgot cmakelists :D

* improvements in np profile dialog + UI

* improved logging

* few more logging improvals

* dummy npscore

* fixup
2026-04-09 21:03:41 +03:00
georgemoralis
15279c42ac
Races and leak fixes part 2 (#4241)
* fixed Unsynchronized free_threads.size()` Read in ThreadState::Free

* fixed data race in posix_pthread_key_create , allocated and seqno are atomic now

* fixed playtime thread

* argv array size fix

* destroy mutex on object deletion with pthread_mutex_destroy

* fixed object_pool
2026-04-09 20:47:47 +03:00
georgemoralis
5ca2b07f94
The above could trigger wrong writes and read one extra VMA entry (fixed) (#4237) 2026-04-09 18:05:48 +03:00
georgemoralis
2c6d41cdd4
Races and ThreadSafe issues (#4239)
* used atomics for thread safety

* equeue: Save filter/ident before std:move since we access them out of the locked loop

* fixed kqueues memory leak

* clean storage objects effectively

* fixed memory leak

* fix some races

* fixed race condition
2026-04-09 17:46:36 +03:00
Marcin Mikołajczyk
36e11fcce5
GS: Only use number of comps if greater than VERT_ITEMSIZE (#4236) 2026-04-08 13:01:23 +03:00
kalaposfos13
c11fa6ff81
Update scePadGetInfo (#4234)
* Add OrbisPadInfo struct and return correct controller colours

* oof
2026-04-08 10:08:53 +03:00
Marcin Mikołajczyk
e64f038ad6
Give MS priority over LOD in Image opcodes (#4207) 2026-04-07 19:01:37 +03:00
Stephen Miller
d3c25281e9
Add proper function names (#4231)
Found these with the help of @red-prig
2026-04-06 21:15:19 -07:00
Kravickas
13da5a82cc
protect (#4212)
Protection change may override page fault tracking set by the GPU buffer cache. Invalidate so the cache re-uploads and re-tracks.
2026-04-05 19:44:09 +03:00
rainmakerv2
eb429be1cc
FS: easy mods folder for games (#4216)
* Implement mods folder

* Add logging when modified files exist

* get mod folder entries in MntPoints::IterateDirectory

* support eboot from mods folder
2026-04-05 15:56:18 +03:00
Niram7777
304a2c7c78
Vulkan presenter reset CommandBuffer on *_scheduler (#4221)
[Render.Vulkan] <error> (shadPS4:Main) vk_platform.cpp:58 DebugUtilsCallback: VUID-vkDestroyImage-image-01000: vkDestroyImage(): can't be called on VkImage 0x850000000085[Frame image #2] that is currently in use by VkCommandBuffer 0x560ea08752c0[CommandPool: Command Buffer 2].
The Vulkan spec states: All submitted commands that refer to image, either directly or via a VkImageView, must have completed execution (https://docs.vulkan.org/spec/latest/chapters/resources.html#VUID-vkDestroyImage-image-01000)

Finish needed because of:

[Render.Vulkan] <error> (shadPS4:Main) vk_platform.cpp:58 DebugUtilsCallback: VUID-vkEndCommandBuffer-commandBuffer-00059: vkEndCommandBuffer(): Cannot be called for VkCommandBuffer 0x55c62bfbb580[CommandPool: Command Buffer 3] when it is not in a recording state, vkBeginCommandBuffer() must first be called.
The Vulkan spec states: commandBuffer must be in the recording state (https://docs.vulkan.org/spec/latest/chapters/cmdbuffers.html#VUID-vkEndCommandBuffer-commandBuffer-00059)
2026-04-05 07:44:50 +03:00
Niram7777
162cb18d9d
Vulkan destroy presenter members before device (#4222) 2026-04-05 00:47:26 +03:00
Stephen Miller
e24f42b03c
Lib.Sysmodule: Allow libSceSystemGesture LLE (#4223)
* Run libSceSystemGesture LLE

It's fully safe.

* Update sysmodule table appropriately.
2026-04-05 00:35:53 +03:00
kalaposfos13
93733a9ae8
Fix edge case for touch states (#4219) 2026-04-04 15:26:41 -05:00
Niram7777
fb067bc43f
Vulkan device destroy images_view on Swapchain::Destroy (#4218) 2026-04-04 22:30:28 +03:00
Niram7777
b365d5fe78
Vulkan device destroy DescriptorPool on Shutdown (#4217)
Validation Error: [ VUID-vkDestroyDevice-device-05137 ] | MessageID = 0x4872eaa0
vkDestroyDevice(): Object Tracking - For VkDevice 0x55ac6bd22670, VkDescriptorPool 0x300000000030 has not been destroyed.
The Vulkan spec states: All child objects created on device that can be destroyed or freed must have been destroyed or freed prior to destroying device (https://docs.vulkan.org/spec/latest/chapters/devsandqueues.html#VUID-vkDestroyDevice-device-05137)
Objects: 1
    [0] VkDescriptorPool 0x300000000030
2026-04-04 21:57:22 +03:00
Marcin Mikołajczyk
73520ae094
GS fixes (#4213)
* Handle S_BFM_I32 in a copy shader

* GS: set dwords_per_vertex based on the number of buffer loads if different from VERT_ITEMSIZE
2026-04-04 13:02:44 +03:00
rainmakerv2
450472b51f
Update serdes.h (#4214) 2026-04-04 08:38:51 +03:00
Marcin Mikołajczyk
26e2689b06
VOP3P instructions definitions (#4202) 2026-04-02 09:37:18 +03:00
Stephen Miller
deb8c66ffb
Cleaner fix (#4167) 2026-04-01 23:12:04 +03:00
Kravickas
5945c8719b
Implement BUFFER_ATOMIC_FCMPSWAP (#4200)
Implement BUFFER_ATOMIC_FCMPSWAP via descriptor aliasing + bitcast
2026-04-01 12:55:06 +03:00
Ploo
5d489ff03d
posix: implement sysconf() and sigalstack() (#4201)
* posix: implement sysconf() and sigalstack()

Signed-off-by: lizzie <lizzie@eden-emu.dev>

* mark as stubbed

* oh clang format

---------

Signed-off-by: lizzie <lizzie@eden-emu.dev>
Co-authored-by: lizzie <lizzie@eden-emu.dev>
2026-04-01 08:58:54 +03:00
Ploo
a87abee8e3
WIP: port: Add x64 FreeBSD (#3927)
* port: Add x64 FreeBSD

* clang formaa

* fix epoll stuffs

* date-tz for fbsd, force submodule zydis

* fix filesystem hang + date-tz

* fix

* fix freebsd SIGBUS

* madvise() ifdef

* signal fix + camera fix

* proper %gs tls for once

* better tls? + clang format

---------

Co-authored-by: lizzie <lizzie@eden-emu.dev>
2026-03-30 13:44:29 +03:00
rainmakerv2
2334981be8
respect emulator settings home directory for trophies (#4188) 2026-03-29 10:21:21 +03:00
rainmakerv2
1012f84bf9
use cpp file for function (#4187) 2026-03-29 09:58:48 +03:00
kalaposfos13
1018660ad7
Make sure user trophy folder exists before creating files in it (#4186)
* Make sure user trophy folder exists before creating files in it

* ???
2026-03-28 18:34:30 +01:00
rainmakerv2
96411a17cb
Imgui: translations (#4124)
* WIP: imgui translations

* fallback to original strings if tables are incomplete

* reorder things a bit

* construct tables as consts

* Update imgui_translations.h
2026-03-28 18:08:02 +02:00
kalaposfos13
df32a2076b
readd missing line (#4180)
Co-authored-by: dsprogrammingprojects <theneworb5@yahoo.com>
2026-03-27 18:20:26 +02:00
georgemoralis
5b60b73e9a
added new trophies and saves dirs (#4177) 2026-03-27 17:58:54 +02:00
kalaposfos13
8a1500d7ad
Local multiplayer support (#4169)
* multiple controllers v2

* the c language formatter tool

* review comments (the easy ones)

* c++ copy semantics

* correct error return for remotes without the system user id

* update pad handle handling logic

* controller override colour
2026-03-27 06:37:25 -05:00
georgemoralis
e0a86dc8f9
added transfer of sysmodules path and fonts path (#4175) 2026-03-26 22:33:31 +02:00
rainmakerv2
650652db42
Vblank frequency setting fix + utf 8 encoding for paths (#4174)
* vblank frequency setting fix

* force utf-8 encoding upon json serialization/deserialization for path strings
2026-03-26 00:13:43 +02:00
Stephen Miller
3cc56bf84c
More verbose errors for file opening failures (#4173)
* Verbose errors for file opening failures

These can be pretty helpful, and games don't usually spam them outside loading screens.

* oops
2026-03-25 23:43:30 +02:00
Stephen Miller
bb9c223d42
Core: Minor code cleanup (#4166)
* Log filters cleanup

* Clearer dialog options for config update

* Smaller button labels

These don't auto-resize, and I don't want to read SDL's docs for something so small.
2026-03-24 08:40:18 +02:00
georgemoralis
f450405f35
General Misses (0.15.1 WIP part 6) (#4165)
* fixes

* fixed a few more config misses

* missed include
2026-03-23 22:38:05 +02:00
georgemoralis
d0a4718fb9
General Misses (0.15.1 WIP part 5) (#4164)
* more from 0.15.1 WIP branch

* fixup
2026-03-23 13:52:33 +02:00
georgemoralis
edd50ab2d0
more files for syncing with 0.15.1 branch (#4161) 2026-03-22 10:26:23 +02:00
georgemoralis
880445c2ce
Initial camera (Part 3 of 0.15.1 branch) (#4156)
* using new emulator_settings

* the default user is now just player one

* transfer install, addon dirs

* fix load custom config issue

* initial openal backend

* linux fix?

* camera module updated

---------

Co-authored-by: kalaposfos13 <153381648+kalaposfos13@users.noreply.github.com>
2026-03-22 09:08:44 +02:00
georgemoralis
060703f627
Initial Openal (Part 2 of 0.15.1 branch) (#4155)
* using new emulator_settings

* the default user is now just player one

* transfer install, addon dirs

* fix load custom config issue

* initial openal backend

* linux fix?

---------

Co-authored-by: kalaposfos13 <153381648+kalaposfos13@users.noreply.github.com>
2026-03-22 00:27:55 +02:00
georgemoralis
08168dc386
New config mode (part1 of 0.15.1 branch series) (#4145)
* using new emulator_settings

* the default user is now just player one

* transfer install, addon dirs

* fix load custom config issue

---------

Co-authored-by: kalaposfos13 <153381648+kalaposfos13@users.noreply.github.com>
2026-03-21 22:26:36 +02:00
Stephen Miller
0a722d69e6
Only iterate to next VMA if we're past the current VMA. (#4158)
It's possible we're merging with a later memory area. If that occurred here, we would end up iterating past where we need to be, which then messes up logic.
2026-03-21 12:02:17 +02:00
Kravickas
2bb20e4650
waw fix (#4154) 2026-03-20 13:43:41 +02:00
Kravickas
980919b07b
Fix FSR crash on content area resize (#4153)
* fsr

* fsr

* fsr
2026-03-20 08:46:22 +02:00
Semahegn
64e10e6f98
sdl_window: Call SDL_SyncWindow after setting fullscreen mode (#4131)
SDL_SetWindowFullscreen is asynchronous on Windows. Without
SDL_SyncWindow, the window may not have finished transitioning
to borderless fullscreen before the Vulkan surface and swapchain
are created, causing borderless mode to silently fail at startup.

This is most visible with Immediate (No VSync) present mode where
the swapchain is created quickly, but the fix is correct for all
present modes.

SDL3 docs state: "On asynchronous windowing systems, this acts as a
synchronization barrier for pending window state." and SDL_SyncWindow
is listed as the recommended follow-up to SDL_SetWindowFullscreen.
https://wiki.libsdl.org/SDL3/SDL_SyncWindow

Fixes #3945
2026-03-19 10:02:03 +02:00
Kravickas
f245cf76a7
waw hotfix (#4146) 2026-03-18 23:52:15 +02:00
Kravickas
78411c4b8a
Write after write sync hazard (#4142)
* WAW barrier

* clang
2026-03-18 23:09:19 +02:00
kalaposfos13
ec1719e4d3
update current firmware version (#4144) 2026-03-18 19:58:00 +02:00
Kravickas
2ca342970a
MIP fixes (#4141)
* int32-modifiers

GCN VOP3 abs/neg modifier bits always operate on the sign bit (bit 31)
regardless of instruction type. For integer operands this means:
	
abs = clear bit 31   (x & 0x7FFFFFFF)
neg = toggle bit 31  (x ^ 0x80000000)

* int64-modifiers

Previously GetSrc64<IR::U64> completely ignored input modifiers
for integer operands. Now unpacks to two U32s, modifies the high
dword's bit 31 (= bit 63 of the 64-bit value), and repacks.

* V_MUL_LEGACY_F32

GCN V_MUL_LEGACY_F32: if either source is zero, result is +0.0
regardless of the other operand (even NaN or Inf). Standard IEEE
multiply produces NaN for 0*Inf. The fix adds a zero-check select
before the multiply.
2026-03-18 10:05:20 +02:00
rosenkolev1
9a3e7b097c
Make thread TidCounter atomic (#4133) 2026-03-18 09:40:37 +02:00
georgemoralis
6e843d0c4b feeling dangerous , let's re-enable lod where supported 2026-03-17 22:18:26 +02:00
baggins183
1bb152d976
IMAGE_STORE_MIP fallback (#4075)
* fallback for IMAGE_STORE_MIP when not natively supported

* Lod should be treated as absolute, independent of sharp's base_level (judging by other implemented instructions)

* fix descriptor set layouts

* dumb error

* force fallback for testing

* treat Lod as relative to base_level

* optimization when lod index is constant
2026-03-17 21:47:19 +02:00
kalaposfos13
e6b743032d
Don't print unresolved libc and libSceFios2 stubs (#4137) 2026-03-17 15:58:31 +02:00
Stephen Miller
844cfe5185
Lib.Ssl2: Stub data for sceSslGetCaCerts (#4127)
* Test

* More robust logic for storing and freeing dummy data

Anything heap allocated is invalidated when the function returns. Use malloc to allocate the string instead, and make sure to free those allocations in sceSslFreeCaCerts.
2026-03-14 17:12:26 +02:00
Санька Четвёртый
f336096b12
PSF file format: close file after encode() (#4122) 2026-03-13 12:38:22 +02:00
kalaposfos13
67ffd0334b
Properly fix game flag handling (#4119)
* fix the fix for the fix

* fine there's no debug info then because of Ubuntu things
2026-03-12 17:15:04 +01:00
Stephen Miller
c8b3d63e7e
Core: Fix game arguments (#4118)
* Fix game arguments.

Tested with Crash Team Racing Nitro Fueled

* Fix the fix

This callback runs unconditionally, so only perform erase if we actually place anything in gameArgs
2026-03-12 08:53:12 +02:00
Stephen Miller
ac3786f533
Fix return type for ImageAtomicU32CmpSwap (#4115)
Somedays I wonder how I miss these details. But hey, least there are two other people who also missed this 😅
2026-03-10 16:25:22 -07:00
Stephen Miller
3ee06a91df
Relocate imports on HLE loads (#4113)
Now that dynamic HLE loads happen after the eboot loads, HLEs for most "preload" modules wouldn't detect if you didn't have libSceRtc dumped. This was because, while we stored all the new symbols from the HLE lib, we weren't relocating loaded modules to use these symbols.
2026-03-10 07:25:45 +02:00
Stephen Miller
85476e55ea
Recompiler: Implement IMAGE_ATOMIC_CMPSWAP (#4109)
* To implement ImageAtomicCmpSwap

...but it doesn't work, so here it shall stay.

* a fix

* Clang

* Add to MayHaveSideEffects

I missed this while digging through IR code.
2026-03-09 18:02:22 +02:00
TheTurtle
df6bb8562e
renderer_vulkan: Force subgroup size to 64 when possible (#4111) 2026-03-09 17:46:51 +02:00
TheTurtle
e16ba06ab0
shader_recompiler: Support 32 thread sharing mode (#4110) 2026-03-09 17:33:58 +02:00
kalaposfos13
0579569f13
Improve signal emulation (#4108)
* improve signal emulation

* make the sce function use the new posix ones

* ifdefing away the issues

* fix me being very tired yesterday night

* let macOS handle SIGRT signals with the native sigaction call instead of an early error return

* windows still has no clue what the fuck is going on

* the loathsome clang-formatter

* fix oact

* return the guest handler, not the host one

* Clear any existing signal mask for game threads.

* don't rely on implementation specific things

* Fix Windows support and sceKernelRaiseException bug

* Review suggestions

@kalaposfos13 suggested I push these.

---------

Co-authored-by: Stephen Miller <56742918+StevenMiller123@users.noreply.github.com>
2026-03-09 14:20:14 +02:00
Stephen Miller
cc6af03adf
Lib.SysModule: Proper HLE implementation (#4102)
* Replace sysmodule enums with table

Dumped this from the 12.52 module, using a script I created.

* Better documentation

* Separate from system libraries

That system folder is going to be getting quite large if I left all the sysmodule stuff in there.

* More arrays from library

* Found another preload list

Ghidra really hates decompiling libSceSysmodule, so I didn't notice this one at first.
Also documented specific versions tied to each preload list.

* Start work on implementation

* Some basic implementations

* Initial stub for module loading

Just enough to see if the logic functions appropriately.

* Clang

* sceSysmoduleLoadModule

Now I need to get sceSysmodulePreloadModuleForLibkernel done so that we don't have bugs from not loading internal LLEs.

* sceSysmoduleLoadModuleInternal

* sceSysmodulePreloadModuleForLibkernel

I have successfully broken quite literally everything.
I shall debug this tomorrow.

* Slight fix

* Maybe fix?

* Change log

Enjoy the log spam 😄

* Increased defined stub count

Now that libc and libSceLibcInternal loads later, all the auto stubs are getting consumed by it.

* sceSysmoduleUnloadModule stub

Also a couple fixes. Sysmodule does pass argc and argv to game modules, but only after loading them once to check  binaries.
Shouldn't matter for the most part.

* Clang

* Less stubs

2 thousand is seemingly enough.

* sceSysmoduleLoadModuleInternalWithArg

Doesn't hurt to have, since Apex Legends calls it.

* Oops

* Oops 2

* Rename isModuleLoaded to getModuleHandle

Review comment

* Remove debug game module loads

These cases only trigger when specific sceRegMgr key values are set, and for our purposes, we can treat that case as false.

* Allow preloading to fail

For kalaposfos

* Clang
2026-03-08 21:48:03 +02:00
Stephen Miller
014b11e9da
Return an empty certificate (#4104)
This is enough to get past initialization checks in Rise of the Tomb Raider.
2026-03-07 09:15:32 +02:00
georgemoralis
50d5ce9a83
fixed an issue in sceKernelRemoveExceptionHandler (#4086)
* fixed an issue in sceKernelRemoveExceptionHandler

* fixed comment
2026-03-07 08:55:17 +02:00
Pavel
89e74828e6
fixup r128 (#4100) 2026-03-05 22:44:37 +02:00
georgemoralis
14450d330f
CopyImage stencil fixes (#4095)
* stencil fixes hope it fixes driveclub

* revert image copy to the one that had driveclub worked

* reverted texture cache change

* some more fixes and reverts

* added logging for overlap again
2026-03-03 08:52:12 +02:00
Stephen Miller
1f5430e4c2
More targeted fix (#4096)
Cyberpunk's issue seems to actually come from the incrementing in the loop. It wasn't clear while debugging, but the problem is that the pattern the game supplies causes match to fail when str_wild_it hits the end, and then tries iterating past end due to the loop condition.
Our pattern matching code seems broken for the case Cyberpunk triggers, but since I'm not aware of the intricacies of how real hardware behaves, best to just revert the loop condition change and instead break the loop before the broken iteration.
2026-03-02 20:35:58 +02:00
georgemoralis
e5d7dc4090
the uber fix (#4092) 2026-03-01 21:02:21 +02:00
georgemoralis
636efaf2b5
changed readbacks mode to Relaxed,Precised (#4091) 2026-03-01 20:49:55 +02:00
Stephen Miller
dbf23a66af
fix (#4088) 2026-03-01 07:30:19 +02:00
rainmakerv2
6a8c50c3a2
Low readbacks mode (#4085) 2026-02-28 17:17:11 +02:00
Stephen Miller
49c2a4999b
Lib.Net: Misc fixes (#4082)
* Fix Windows-specific incorrect error in PosixSocket::Connect

* Hide typical non-blocking errors

* Also hide EWOULDBLOCK from recvfrom

* Fix the resolver fix
2026-02-28 09:09:01 +02:00
Stephen Miller
aae10ecdf7
Lib.GnmDriver: Implement sceGnmDrawIndirectMulti (#4083) 2026-02-27 21:32:32 -08:00
Stephen Miller
8bb29695ed
Lib.Net: Proper resolver errors when isConnectedToNetwork is disabled (#4081)
* Force resolver errors when not connected to network

Error values are based on real hardware testing.
sceNetResolverGetError is based on libSceNet decompilation.

* Update net_resolver.h
2026-02-28 00:50:41 +02:00
evill33t
19d2027105
skipped guest/host marker parsing/calls when disabled (#4078)
* skipped guest/host marker parsing/calls when disabled

* clang-format

---------

Co-authored-by: Ronny Stiftel <ronny.stiftel@tomcom.de>
2026-02-26 17:02:14 +02:00
georgemoralis
f91b8410fd
SDL Audio3d (#4077)
* implemented dummy audio3d for sdl

* removed sdl::free
2026-02-26 15:31:50 +02:00
Vladislav Mikhalin
e1ecd8e98c
threads: initialize tls on thread creation (take 2) (#4070) 2026-02-24 20:35:05 +03:00
kalaposfos13
af9cbb8e8a
Fix some logic bugs in sceHttpUriParse (#4067) 2026-02-24 09:00:17 +02:00
ElBread3
407d287fb1
tweak LoadFigure and RemoveFigure (#4071) 2026-02-23 21:30:57 +02:00
kalaposfos13
c265a39227 fix typo 2026-02-23 09:08:39 +01:00
Stephen Miller
6cbab87745
Kernel.Event: Implement kqueue and kevent (#4065)
* Remove dead code from EqueueInternal::WaitForEvents

No longer necessary now that we avoid using small timers when falling back on equeue logic.

* Refactor type names

Might as well

* Properly define OrbisKernelEqueue as a handle

Most of the functions using an "OrbisKernelEqueue" call directly into kevent. Therefore, OrbisKernelEqueue should be a equeue handle.

* Clang

* Widen OrbisKernelEqueue type

On real hardware, it's some value that contains the handle, as opposed to just the handle itself.

* kqueue implementation

The easy part

* Hardware-accurate timer data

Needed to make kevent simpler for these uses.

* Move callback scheduling to EqueueInternal::AddEvent

kevent would become excessively bloated if I needed to deal with that in there.

* posix_kevent

kevent is a bit of a pain, for now I've implemented as much as libkernel actually uses for it's wrappers, and left error logs to skip behavior when necessary.

* Log calls

* Apple, why are you calling fstat on an equeue?
2026-02-22 23:41:05 +02:00
kalaposfos13
607d704707
Mount /data to <userdir>/data instead of <userdir>/data/gameid (#4066) 2026-02-22 19:10:55 +02:00
kalaposfos13
fb5c36fa11
Implement guest signal handlers (#4064)
* Change thread pausing to use SIGTRMIN on UNIX

* Allow handling of the rest of the signals

* Add orbis-native signal number conversion and fix a few bugs

* ifdefing away the issues

* add check for mac for the signal that's used for thread pausing there

* Add a few more registers

* Don't break HLE memory tracking
Now, if a guest app installs a handler for SIGSEGV/SIGBUS/SIGILL, that'll be handled by keeping the original signal handler, and if we can't handle the signal ourselves (as in it didn't come from HLE memory tracking), we pass it on to the guest

* copyright 2026

* +
2026-02-22 18:56:54 +02:00
kalaposfos13
b37e0a6ea6
Miscallenous function exports and implementations (#4068)
* _nanosleep

* pthread_mutexattr_setpshared

* pthread_attr_setschedpolicy

* getuid

* copyright 2026
2026-02-22 17:08:06 +02:00
Vladislav Mikhalin
9241ebd4dd
Revert "threads: initialize TLS on thread creation (#4048)" (#4062)
This reverts commit f6d71646c0.
2026-02-21 14:10:25 +03:00
Stephen Miller
248b3e2d30
Core: Force logging of critical errors (#4061)
* Ignore enabled flag on critical log entries

This ensures critical errors (asserts and unreachables) are logged when the log file exceeds 100MB, or when logging is disabled.

* I apparently need sleep
2026-02-21 09:53:28 +02:00
Stephen Miller
1eb09ab440
Kernel.Equeue: Various event fixes (#4059)
* Fix vblank event data

* Various logical fixes for timer events

Store timer timeouts in nanoseconds now, properly handle event "replacement", avoid employing small timers when adding events to equeues, fix stored timer data

* Clang
2026-02-21 09:37:59 +02:00
georgemoralis
06b901a47b
Gpu fixes misc (#4050)
Some checks failed
Build and Release / reuse (push) Has been cancelled
Build and Release / clang-format (push) Has been cancelled
Build and Release / get-info (push) Has been cancelled
Build and Release / windows-sdl (push) Has been cancelled
Build and Release / macos-sdl (push) Has been cancelled
Build and Release / linux-sdl (push) Has been cancelled
Build and Release / linux-sdl-gcc (push) Has been cancelled
Build and Release / pre-release (push) Has been cancelled
* fixed image copy to ignore stencil aspect

* Added logging for "Encountered unresolvable image overlap with equal memory address."

* fixed overlap issues with different pitch , added more detailed logging for rest of overlap issues

* improved log error

* maybe mipmaps ?

* array layers or different mip map range

* rewrote case  new image has fewer mip levels than cached image

* array with 2 layers?

* last case

* improved

* no it didn't work
2026-02-19 21:11:33 +02:00
Vladislav Mikhalin
f6d71646c0
threads: initialize TLS on thread creation (#4048)
* initialize TLS on thread creation
* initialize tls in dimensions toypad writer thread
* clear most of the stack on thread init with some black magic
2026-02-19 21:26:33 +03:00
georgemoralis
a99c814739
Image copy Enhancement (#4041)
Some checks failed
Build and Release / reuse (push) Has been cancelled
Build and Release / clang-format (push) Has been cancelled
Build and Release / get-info (push) Has been cancelled
Build and Release / windows-sdl (push) Has been cancelled
Build and Release / macos-sdl (push) Has been cancelled
Build and Release / linux-sdl (push) Has been cancelled
Build and Release / linux-sdl-gcc (push) Has been cancelled
Build and Release / pre-release (push) Has been cancelled
* copy image handle 2d->3d copies and opossite now

* make gcc happy

* fixed colouring issue
2026-02-17 22:41:18 +02:00
kalaposfos13
3a99051df9
filesystem: fix crashes caused by returning a pointer from an std::vector (#4043)
Co-authored-by: Stephen Miller <56742918+StevenMiller123@users.noreply.github.com>
2026-02-16 22:56:35 +02:00
Stephen Miller
547198af6f
Lib.VideoOut: Fix pending flips limit (#4039)
Some checks failed
Build and Release / reuse (push) Has been cancelled
Build and Release / clang-format (push) Has been cancelled
Build and Release / get-info (push) Has been cancelled
Build and Release / windows-sdl (push) Has been cancelled
Build and Release / macos-sdl (push) Has been cancelled
Build and Release / linux-sdl (push) Has been cancelled
Build and Release / linux-sdl-gcc (push) Has been cancelled
Build and Release / pre-release (push) Has been cancelled
* Hardcoded limit to pending flips

Real hardware has a fixed-size queue, and doesn't depend on the number of registered buffers.
While the kernel supposedly uses an array of 18 elements, my tests suggest the cap is 16 pending flips.

* Assert on trying to flip unregistered buffer

I haven't seen anything do this intentionally yet, but I do have cases where games do this unintentionally (do to unimplemented functions).
2026-02-16 08:31:35 +02:00
Stephen Miller
4a370519a5
Lib.GnmDriver: Fix flip arg for sceGnmSubmitAndFlipCommandBuffers (#4038)
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-sdl-gcc (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
* There is a mountain of evidence suggesting that flip_arg for these functions should be a 64-bit integer.

This fixes "memory" errors in some Unity titles.

* oops

* Fix sceVideoOutGetEventData

This bug went unnoticed for a while because the selection of Unity games I had at the time didn't actually care.
This + the prior fix is needed for Unity titles.
2026-02-15 09:29:33 +02:00
Valdis Bogdāns
0f92285e50
GR2-win-crash-fix (#4033)
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-sdl-gcc (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
* Improve stack clearing logic in ExecuteGuest

Added a check for fiber stacks before clearing the stack in ExecuteGuest.
That fixes Gravity Rush 2 crash on Windows.

* Refactor ExecuteGuest to simplify stack clearing logic

This enough for GR2

* Recover thread initialization in ExecuteGuest function

* Enhance null check for thread control block

* Fix condition to check tcb before clearing stack
2026-02-14 23:30:09 +02:00
Stephen Miller
98af227a8d
More hotfixes (#4036)
User events don't increment fflags, so don't increment it.
Also added a bugfix for dce events, as static_cast wasn't properly unpacking event.data.
2026-02-14 22:47:28 +02:00
Niram7777
8d4cbdbca9
Log actually not always compact (#4035) 2026-02-14 22:31:19 +02:00
Stephen Miller
e0850d5cfc
Kernel.Equeue: Only reset trigger state on events that clear. (#4032)
Some checks failed
Build and Release / reuse (push) Has been cancelled
Build and Release / clang-format (push) Has been cancelled
Build and Release / get-info (push) Has been cancelled
Build and Release / windows-sdl (push) Has been cancelled
Build and Release / macos-sdl (push) Has been cancelled
Build and Release / linux-sdl (push) Has been cancelled
Build and Release / linux-sdl-gcc (push) Has been cancelled
Build and Release / pre-release (push) Has been cancelled
* Don't clear events that don't need clearing

Unless the event has the clear flag, it will be returned multiple times after triggering.

* Fix event flags

As older code suggests, the PS4 kernel does append the clear flag to various event types internally. This is visible when observing the returned event data from sceKernelWaitEqueue (or kevent, if you're feeling ambitious)

Add flag is also removed from events internally.
2026-02-14 01:59:23 +02:00
kalaposfos13
d189b0cc29
up is not down (#4031)
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-sdl-gcc (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
2026-02-13 11:37:28 +02:00
Stephen Miller
1a06020f70
Core: Mount system fonts (#4028)
* Mount system fonts

Now that font LLE works, these are necessary for some titles.

* Make fonts path configurable

By user request.
2026-02-13 09:02:30 +02:00
Stephen Miller
50130a6b7c
Prevent protects during unmaps (#4029)
Some games fail in this VirtualProtectEx call because they unmapped on one thread while another thread is hitting exception handling.
2026-02-13 08:34:24 +02:00
Stephen Miller
cdafdb7443
Better handle check in scePadRead, scePadReadState (#4027) 2026-02-12 22:34:43 +02:00
Stephen Miller
0435ada3a5
Update np_web_api_internal.cpp (#4025)
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-sdl-gcc (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
2026-02-11 23:22:38 +02:00
kalaposfos13
7bdb5eb7e1
improved motion controls emulation (#4022) 2026-02-11 18:09:34 +02:00