* renderer: update font handling and add new font support
- Added support for multiple NotoSans fonts including Arabic, Thai, and CJK.
- Refactored font loading logic to use FontStack for better management.
- Removed deprecated NotoSansJP font and updated font paths in CMake.
* optimize atlas size
---------
Co-authored-by: w1naenator <valdis.bogdans@hotmail.com>
- Added support for multiple NotoSans fonts including Arabic, Thai, and CJK.
- Refactored font loading logic to use FontStack for better management.
- Removed deprecated NotoSansJP font and updated font paths in CMake.
Co-authored-by: w1naenator <valdis.bogdans@hotmail.com>
* 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
* 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.
* 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
* 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
* 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
* 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>
* 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>
* 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
* 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
* Implement mods folder
* Add logging when modified files exist
* get mod folder entries in MntPoints::IterateDirectory
* support eboot from mods folder
[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)
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
* WIP: imgui translations
* fallback to original strings if tables are incomplete
* reorder things a bit
* construct tables as consts
* Update imgui_translations.h
* 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
* 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.
* 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>
* 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>
* 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>
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.
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_SyncWindowFixes#3945
* 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.
* 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
* 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.
* 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
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.
* 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.
* 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>
* 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
* 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
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.
* 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
* 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?
* 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
* +
* 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
* 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
* 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
* 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).
* 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.
* 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