* Np library cleanup
Moved all Np libraries to a Np folder, created files for Np error codes and structs shared between the libraries, removed empty auto-generated stubs from NpCommon and NpManager, and more things of that nature.
Also implemented sceNpGetAccountCountry, since we already had sceNpGetAccountCountryA anyway.
* Cleanup NpManager signed_out checks
The PR that introduced the PSN signed in status reverted some of the changes I'd previously made to improve accuracy.
Also they missed sceNpHasSignedUp, which just uses an internal variant of sceNpGetState for it's own check.
* Copyright dates
* Move signin check to NpManager RegisterLib
Hardcoding it the way I did caused it to read signin status before config was read.
* Fix RegisterLib names
Not sure why these weren't adjusted yet, so I've adjusted them myself.
* Fix NpCommon exports
* Basic parameter validation in sceNpDeleteRequest and sceNpCreateRequest
* More thorough request logic
Created an enum to capture the current state of each request, using a vector to store them.
I've made 3 states, none represents deleted requests, active represents requests that were made, but haven't been used yet, and complete represents used requests (a request cannot be used for multiple functions).
* Functions
sceNpCheckAvailability, sceNpCheckAvailabilityA, sceNpCheckNpReachability, sceNpGetAccountDateOfBirth, sceNpGetAccountDateOfBirthA added.
* sceNpGetAccountLanguage, sceNpGetAccountLanguageA
* sceNpGetGamePresenceStatus, sceNpGetGamePresenceStatusA
Also reduced debug logging for functions with early signed out returns, since those should behave identically to real hardware so long as you keep PSN emulation disabled.
* Fix sceNpGetAccountLanguage parameters
Oops
* sceNpGetNpReachabilityState
* sceNpGetParentalControlInfo, sceNpGetParentalControlInfoA
* Move OrbisNpState back to np_manager.h
Until this sees use elsewhere, this doesn't need to be with np-wide things.
* Clang
* AF_UNIX preliminary support
* fixed windows
* added windows implemenation for socketpair
* More gotos
* added sys_socketpair for libkernel_ps2emu
---------
Co-authored-by: georgemoralis <giorgosmrls@gmail.com>
* Log presets feature
- Add “Load Presets…” button in Logger → Log Filter (settings_dialog.ui)
- Implement LogPresetsDialog (table: Comment, Filter)
- Support add (+), multi-remove (−), load via button or double-click
- Persist presets via QSettings at logger_presets/entries (qt_ui.ini)
- Wire button to open dialog and set logFilterLineEdit
- Update CMakeLists.txt to include new dialog sources
* CLang fix
* CLang fix again
* Log Presets: checkbox selection + tri-state header
- Added first column with per-row checkboxes
- Implemented header checkbox with tri-state; click toggles select-all/none
- Synced checkboxes and row selection in both directions
- Header toggle also updates row selection to match
- Remove operates on checked rows; falls back to selected rows if none checked
- Load uses first checked row; falls back to first selected row
- Double-click row triggers the same action as Load
- Load button visible only when exactly one row is selected
- Remove button visible only when at least one row is selected
- Dialog opens with no selected rows and no focused buttons; focus set to table
- New rows start editing in the Comment column
- Serialization updated for new column indices; checkbox state not persisted
- Cleanups: removed unused include and empty helper; pruned temporary comments
* Clang
* Fix: tri‑state header checkbox visible and aligned
- Overlay real QCheckBox in header section 0 (tri‑state)
- Align with row checkboxes using SE_ItemViewItemCheckIndicator
- Reposition on header resize and geometry changes
- Header click + checkbox click toggle select‑all/none
- Tri‑state reflects per‑row checkbox states
* CLang
---------
Co-authored-by: w1naenator <valdis.bogdans@hotmail.com>
* Allow vector and scalar offset in buffer address arg to
LoadBuffer/StoreBuffer
* remove is_ring check
* fix atomics and update pattern matching for tess factor stores
* remove old asserts about soffset
* small fixes
* copyright
* Handle sgpr initialization for 2 special hull shader values, including tess factor buffer offset
* libSceVrTracker stubs, structs, enums, and errors
* sceVrTrackerQueryMemory
* Clang and slight struct cleanup
* Implement sceVrTrackerInit
* Store memory pointers and sizes
Mainly for future developers, since I doubt these memory areas will be particularly useful for these stubs.
* sceVrTrackerRegisterDevice
I haven't really identified the difference between the two register device functions, but I do know that they both internally call the internal function with slightly different parameters.
* sceVrTrackerUnregisterDevice
Also changes Hmd and Move handles to be values closer to what real hardware returns, since this function seemingly relies on handles being different for all these device types.
* sceVrTrackerTerm
* Additional error checks in sceVrTrackerRegisterDeviceInternal
* sceVrTrackerGetTime
* sceVrTrackerRecalibrate
Recalibration succeeds on real hardware (at least for some device types), so I've left the stub log intact.
* Update vr_tracker.cpp
* sceVrTrackerSetDurationUntilStatusNotTracking stub
Only handled the error checks, so I left the stub log intact.
* sceVrTrackerGpu* functions
Most of these can't succeed without a camera attached.
* Rename SceKernelIovec to OrbisKernelIovec
Fixes the naming scheme to match the rest of the project.
* Type fixups
Noticed this while working on the actual thing this PR is about.
* More type fixups
* Update file_system.cpp
* Abstract directory handling
* Clang
* Directory fstat
* Fix dirent loading logic
* PfsDirectory size
Seemed to be hardcoded when I ran tests, so I've hardcoded it here.
Also fixed up the reclen-aligning logic based on hardware observations.
* GetDents cleanup
Bring back the bytes < 512 error return from before, as that's still something that can be checked for out here.
I've also swapped the file type stuff to run from a switch case, so that the check for invalid file type can be used as the default case
* Support reading directories
* getdents
For PfsDirectory, getdents behaves like read does on normal directories. Since dirents are stored internally with a different struct, this means getdents has to convert the dirents before returning data.
For NormalDirectory, getdents is identical to read, so it can just call read and set the basep output.
* Directory readv
* Directory preadv
Since the file mutex is locked before these calls, messing with dirents_index like this shouldn't cause any weird side effects.
* return ORBIS_OK instead of 0
to better align with our coding standards.
* Directory lseek
* Un-modify CMakePresets.json
I keep this modified locally for Linux, but accidentally pushed it.
* Clang
* Fix mac compile
* Potential windows compile fix?
* Filename fix
* Fix normal directory d_reclen
* Comment cleanup
* Remove unnecessary dirent conversion logic
On real hardware, the records are still returned with the same reclen, despite the change in structure.
* PfsDirectory dirents_index fixes
Some weird stuff happens once you reach eof on directories.
Thankfully, PfsDirectories are rather tame in this regard.
* Change comment
* Rewrite normal directory reads
The logic for these seems to behave like a normal file, so instead of tracking a dirents_index, keep an internal buffer representing the file contents, and copy that to output buffers as needed.
* Update pfs_directory.cpp
* Clang
* Fix normal dirents
When rewriting the code, I forgot to account for the increased reclen value for the last dirent in the buffer.
* PfsDirectory::lseek fixes
Based on some additional tests, it seems like lseek unconditionally returns dirents_index, not the actual file position.
Also fixed some bugs with the logic for calculating the proper offset when games do wonky things, and fixed a potential area where games could crash.
* Downgrade stat and fstat log to debug
These functions can get pretty spammy.
* PfsDirectory: Properly track if end of file is reached
Using the metric `dirents_index < directory_content_size` fails when `directory_content_size` is larger than the actual directory size we report.
Since, from what I can tell, PfsDirectories shouldn't ever report more than 0x10000 bytes for size, this change is necessary.
* Revert "PfsDirectory: Properly track if end of file is reached"
I need to do some hardware tests to see if all this excess logic is actually necessary.
* Fix PfsDirectory directory_size
Turns out, if your game has over 1000 files in a folder, it will actually cause the size to increase.
* Update copyright date
* Move devices and directories into file_sys
I've also updated the copyright dates on all these files.
* C++ style type casts
* Remove unnecessary memset
* Use a vector for the data buffer
Simplifies logic for freeing the buffer, based on review suggestions.
* Fix potential oob array access
* Change type casts in Create function
* Clang
* std::memcpy instead of memcpy
* NormalDirectory::lseek cleanup
* Create constants for directory alignment values.
* Use const wherever possible
* Includes cleanup
* vk_pipeline_cache: Cleanup graphics key refresh
* position: Don't assert on None mapping
Also check outputs in runtime info so shader is recompiled if they change
* Initial work
* More work
* More stuff
* Update hmd.cpp
* Separate Reprojection and Distortion functions
Mainly doing this to clean up the code, since these sub-libraries are fairly self-contained.
* Fix weird Git issue
* Improve error documentation
After thorough decompilation, it seems clear that Sony didn't really put much thought into how libSceHmd behaves with no headset connected.
* Fix sceHmdGet2DEyeOffset
* Update hmd.cpp
* Add sceHmdInternalGetDeviceInformation and sceHmdInternalGetDeviceInformationByHandle
Based entirely off decompilation, these two functions are internally the cause of much of my trouble with this library.
They're also called by libSceVrTracker, but I don't think we'll be LLE'ing that anytime soon.
* Cleanup
* sceHmdGetAssyError
Struct isn't fully decompiled, but since it goes entirely unused when PSVR is disconnected, it doesn't matter too much.
I'm pretty certain it's 4 floats though, based on what I've decompiled of this function.
* More organization and fixes
* sceHmdGetInertialSensorData
Behavior should be fully accurate, but I've left the stub log since I haven't decompiled the parameters properly.
Also gave NID aTg7K0466r8 a proper name, based on what I've seen while decompiling. It behaves identically to sceHmdGetInertialSensorData, but with a slight difference in the params used for an internal function call.
* Update hmd.cpp
* Revert name change
* Organizational changes
These two functions modify internal variables used exclusively by reprojection functions.
* Remove internal device information calls
* Log PSVR-related attributes from param.sfo
Would mainly be helpful for compatibility list moderation, since these notices will be much more reliable for games that crash instantly.
* Remove unnecessary includes
* Improved libSceMove stubs
These should more accurately represent how an actual PS4 behaves when a game calls libSceMove functions while no move controllers are connected.
* Clang
* Change sceMoveGetExtensionPortInfo stub
Not entirely sure the ExtensionPortData struct is for this one, but the struct itself isn't exactly important for now anyway.
* Fix sceMoveTerm
* Update move.cpp
* cpu info
Update cpu_info.h
Revert "Update cpu_info.h"
This reverts commit 6db3814e7f8162ca546c33479942d7204524b281.
Revert "cpu info"
This reverts commit cfecdf694fd7bee0fdf025c3933ff7b9498a1c3f.
hardware info
* log OS
* Round RAM, add space
* switch temporarily to local fork
* Update CMakeLists.txt
* set shallow = true for submodule
* Log logical cores as well
* point submodule to shadps4 fork
From what I can tell, this is valid behavior since a user could choose not to enter a party.
This fixes a potential crash on boot in Grand Theft Auto V.
* video_core: Rework detiling
* video_core: Support tiling and macrotile detiling
* clang format
* image_info: Cleanups
* resource: Revert some changes
* texture_cache: Fix small error
* image_info: Set depth flag on depth promote
* buffer_cache: Remove level check
* tile_manager: Handle case of staging buffer causing flush
* image_info: Add 2D thick array mode
* image_info: Add slices to mip size
* tile_manager: Set bank swizzle
* buffer_cache: Support image copies from DmaData
* vk_rasterizer: Accelerate trivial render target copies with compute
Before tiling PR compute image copies were done with the following sequence
vkCmdCopyImageToBuffer (in SynchronizeBufferFromImage) -> vkCmdDispatch (copy) -> vkCmdCopyBufferToImage (in RefreshImage)
With the tiling PR it added extra tiling/detiling steps
vkCmdCopyImageToBuffer -> vkCmdDispatch (tiling) -> vkCmdDispatch (copy) -> vkCmdDispatch (detiling) -> vkCmdCopyBufferToImage
This is quite a bit of overhead for a simple image copy. This commit tries to detect trivial image copies i.e cs shaders that copy the full source image to all of the destination.
So now all this sequence is just a vkCmdCopyImage. How much it triggers depends on the guest
* texture_cache: Fix build
* image: Copy all subresources with buffer too
* shader_recompiler: Remove remnants of old discard
Also constant propagate conditional discard if condition is constant
* resource_tracking_pass: Rework sharp tracking for robustness
* resource_tracking_pass: Add source dominance analysis
When reachability is not enough to prune source list, check if a source dominates all other sources
* resource_tracking_pass: Fix immediate check
How did this work before
* resource_tracking_pass: Remove unused template type
* readlane_elimination_pass: Don't add phi when all args are the same
New sharp tracking exposed some bad sources coming on sampler sharps with aniso disable pattern that also were part of readlane pattern, fix tracking by removing the unnecessary phis inbetween
* resource_tracking_pass: Allow phi in disable aniso pattern
* resource_tracking_pass: Handle not valid buffer sharp and more phi in aniso pattern
* Remapping GUI V2 - initial commit
* Unmap button with escape key
* Allow combination inputs
* Use separate class for SDL event signals so that i can work with the SDL window event loop
* Automatically pause game when GUI open to better manage event queue
* Move sd;_gamepad_added event from remap object to GUI object to avoid conflicts with sdl window
* Use signals on button/trigger to release to make GUI more responsive
* pause game while KBM window is open for consistency
* don't check gamepad when game is running to avoid conflicts
* Block all other sdl events instead of pausing game, automatic parse inputs after saving
* Don't block window restored or window exposed cases
* Properly exit event loop thread on exit
* Bit array test
* Some corrections
* Fix AVX path on SetRange
* Finish bitArray
* Batched protect progress
* Inclusion fix
* Last logic fixes for BitArray
* Page manager: batch protect, masked ranges
* Page manager bitarray
* clang-format
* Fix out of bounds read
* clang
* clang
* Lock during callbacks
* Rename untracked to writeable
* Construct and mask in one step
* Sync on region mutex for thw whole protection
This is a temporary workarround until a fix is found for the page manager having issues when multiple threads update the same page at the same time.
* Bring back the gpu masking until properly handled
* Sync page manager protections
* clang-format
* Rename and fixups
* I fucked up clang-formatting one more time...
* kek
* initial save classes for gui save file
* fixup
* some more settings passed to the new saving file
* even more variables parsing
* more settings
* fixup
* more settings
* more settings
* clang fix
* fixed wrong setting
* more setting
* more setting
* added ca_ES
* rename to general_settings
* added set-addon-folder in main
* fixup
* fixup2
* added sr_CS
* Update CMakeLists.txt
---------
Co-authored-by: kalaposfos13 <153381648+kalaposfos13@users.noreply.github.com>
* pixel_format: Remove unused tables, refactor
* host_compatibilty: Cleanup and support uncompressed views of compressed formats
* texture_cache: Handle compressed views of uncompressed images
* tile_manager: Bump max supported mips to 16
Fixes a crash during start
* oops
* texture_cache: Fix order of format compat check
* Import memory
* 64K pages and fix memory mapping
* Queue coverage
* Buffer syncing, faulted readback adn BDA in Buffer
* Base DMA implementation
* Preparations for implementing SPV DMA access
* Base impl (pending 16K pages and getbuffersize)
* 16K pages and stack overflow fix
* clang-format
* clang-format but for real this time
* Try to fix macOS build
* Correct decltype
* Add testing log
* Fix stride and patch phi node blocks
* No need to check if it is a deleted buffer
* Clang format once more
* Offset in bytes
* Removed host buffers (may do it in another PR)
Also some random barrier fixes
* Add IR dumping from my read-const branch
* clang-format
* Correct size insteed of end
* Fix incorrect assert
* Possible fix for NieR deadlock
* Copy to avoid deadlock
* Use 2 mutexes insteed of copy
* Attempt to range sync error
* Revert "Attempt to range sync error"
This reverts commit dd287b48682b50f215680bb0956e39c2809bf3fe.
* Fix size truncated when syncing range
And memory barrier
* Some fixes (and async testing (doesn't work))
* Use compute to parse fault buffer
* Process faults on submit
* Only sync in the first time we see a readconst
Thsi is partialy wrong. We need to save the state into the submission context itself, not the rasterizer since we can yield and process another sumission (if im not understanding wrong).
* Use spec const and 32 bit atomic
* 32 bit counter
* Fix store_index
* Better sync (WIP, breaks PR now)
* Fixes for better sync
* Better sync
* Remove memory coveragte logic
* Point sirit to upstream
* Less waiting and barriers
* Correctly checkout moltenvk
* Bring back applying pending operations in wait
* Sync the whole buffer insteed of only the range
* Implement recursive shared/scoped locks
* Iterators
* Faster syncing with ranges
* Some alignment fixes
* fixed clang format
* Fix clang-format again
* Port page_manager from readbacks-poc
* clang-format
* Defer memory protect
* Remove RENDERER_TRACE
* Experiment: only sync on first readconst
* Added profiling (will be removed)
* Don't sync entire buffers
* Added logging for testing
* Updated temporary workaround to use 4k pages
* clang.-format
* Cleanup part 1
* Make ReadConst a SPIR-V function
---------
Co-authored-by: georgemoralis <giorgosmrls@gmail.com>