* Initial work on improved stubs
Simulates library behaviors for when a camera is not connected.
* Get* functions complete
I ended up leaving some stubs behind, but most of what I didn't do seem to be internal functions called by other libraries we'd be running HLE anyway.
* Finished stubs
Everything I can reasonably confirm the behavior of should behave as expected, emulating the behavior of a PS4 with no camera attached.
* sceCameraStart firmware check
This check only applies to higher eboot firmwares, since my previous test eboots used firmware 1.00 I completely missed this.
* sceCameraGetAutoExposureGain fix
When option is provided and valid, size is also set to 0.
* Track opened handles
Extremely basic for now, if the library was ever properly implemented this could be swapped for a map of some kind instead.
* Fix errors for sceCameraStart
The firmware-related parameter checks come after the library opened check.
* Promote sceCameraIsAttached log to info
Since you don't need to initialize the library to call this function, some games will call sceCameraIsAttached before anything else.
* 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
* ir: Perform degamma in shader when sampler sets force_degamma
* specialization: Add srgb if image is sampled
Might fix cases where sampler force_degamma is used with srgb image
Previously a buffer load in a vertex shader could be treated like a ring access, dropping offen vgpr and possibly asserting during resource tracking because of mismatch between types (u32x2 vs U32), caused by inconsistencies in flags (index_enable and offset_enable)
* Properly align address and size in munmap
Based on observations of FreeBSD source code, fixes a Windows-related memory issue in War Thunder (CUSA00224)
* Format len and phys_addr in mmap
This should make logs slightly easier to understand, since we format these parameters in other memory calls.
* Update memory.cpp
* Various GetDents fixes
Fixed return and parameter types, and made the function return all the entries that will fit in nbytes during one call.
* Fstat dir stub changes
Changes the returned statistics to match what my PS4 tests generally show.
* Stat dir stub changes
To match my fstat changes
* 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
Grand Theft Auto V uses sceKernelGetdents in a loop to search through the contents of /download0, but will always check the first returned directory entry regardless of what value the function returns.
As it turns out, this will never fail on real hardware because all directories have entries for . and .., while the game code throws an exception on shadPS4 because we don't emulate these entries.
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.
* Update app_content.cpp
* Use hyphenation to determine entitlement id from folder name
The original approach I took had two limitations: it relied on entitlement ids being 16 characters long, and it relied on the end of the folder name containing the entitlement. If the former wasn't the case, my code would throw an exception, while the latter would cause the DLC to not detect.
To resolve both issues, I've created a more robust algorithm based on observations from the most commonly used PS4 dumpers for modern firmware.
* Use DLC param.sfo to determine entitlement id
While the logic ends up slightly more complex, this makes the code more robust for other dumping methods/weird DLC folder names from people installing DLC manually.
* Update sceAppContentAddcontMount to properly detect additional content folders
Based on what I've done in sceAppContentInitialize, I've added code for detecting the correct folder to mount.
I've also removed the redundant check for addcont_info status, since we're marking all additional content as installed during sceAppContentInitialize
* 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
* select
* select for windows
* fixed windows only function
* windows error converts
* fixed up
* fixed compile
* another implementation for windows
* draft rewrite for windows
* implementation for windows
* added some debugging info
* more debugging
* extensive log
* Windows: Add device files to output fd_sets
Cyberpunk 2077 breaks without this.
Also added some formatting changes, to bring the implementation closer to our typical coding standards.
* Clang
* Formatting + cleanup
Removed some excessive logging used for debugging, and did some cleanup on the non-Windows implementation.
---------
Co-authored-by: georgemoralis <giorgosmrls@gmail.com>
Co-authored-by: Stephen Miller <millerste004@gmail.com>
* Changes
-Added support for OrbisImeParamExtended (extended IME parameters) in ImeHandler, ImeState, and ImeUi
-Updated all relevant constructors and logic to propagate and store the extended parameter
- Now fully supports passing extended options from sceImeOpen to the IME UI and backend
* Potential CUSA00434 [Debug] <Critical> assert.cpp:30 assert_fail_debug_msg: Assertion Failed!
buf_len + 1 <= buf_size && "Is your input buffer properly zero-terminated?" at C:/VS/shadPS4-ime-fixes/externals/dear_imgui/imgui_widgets.cpp:4601 fix
* Attempting to resolve an assertion failure in Diablo III:
- Adjusted buffer sizes
- Updated the calculation of text‑length values
* ime-lib another hotfix
Fixed incorrect param->title validation, which caused the IME dialog to fail to appear in Stardew Valley. Need to be checked.
* Clang fix
* FF9 ImeDialog Hotfix
* Removed the validation that disallowed null text and null placeholder, since using null values is valid in `ImeDialog`.
* Added additional debug logs to aid troubleshooting.
* IME Fixes
- Add missing flags to `OrbisImeExtOption`
- Improve debug logging
- Resolve nonstop `sceImeKeyboardOpen` calls in Stardew Valley (MonoGame engine) for `userId = 254`
---------
Co-authored-by: w1naenator <valdis.bogdans@hotmail.com>
* Add stubbed libkernel time functions
* Implement remaining stubbed Rtc functions
* Move Rtc from the optionally HLE loading part to the always loaded part
* Remove Rtc from the README list of LLE modules
* Mfw last second hotfix I noticed while double checking that everything's good before opening the PR
* Changes
-Added support for OrbisImeParamExtended (extended IME parameters) in ImeHandler, ImeState, and ImeUi
-Updated all relevant constructors and logic to propagate and store the extended parameter
- Now fully supports passing extended options from sceImeOpen to the IME UI and backend
* Potential CUSA00434 [Debug] <Critical> assert.cpp:30 assert_fail_debug_msg: Assertion Failed!
buf_len + 1 <= buf_size && "Is your input buffer properly zero-terminated?" at C:/VS/shadPS4-ime-fixes/externals/dear_imgui/imgui_widgets.cpp:4601 fix
* Attempting to resolve an assertion failure in Diablo III:
- Adjusted buffer sizes
- Updated the calculation of text‑length values
* ime-lib another hotfix
Fixed incorrect param->title validation, which caused the IME dialog to fail to appear in Stardew Valley. Need to be checked.
* Clang fix
* FF9 ImeDialog Hotfix
* Removed the validation that disallowed null text and null placeholder, since using null values is valid in `ImeDialog`.
* Added additional debug logs to aid troubleshooting.
---------
Co-authored-by: w1naenator <valdis.bogdans@hotmail.com>
* Use last 16 characters of DLC folder name to determine entitlement label
Code comments and commit name say it all.
* Clang
* Adjust comment
ftpdump appends -ac at the end of the entitlement label, so my comment was partially incorrect.
* Changes
-Added support for OrbisImeParamExtended (extended IME parameters) in ImeHandler, ImeState, and ImeUi
-Updated all relevant constructors and logic to propagate and store the extended parameter
- Now fully supports passing extended options from sceImeOpen to the IME UI and backend
* Potential CUSA00434 [Debug] <Critical> assert.cpp:30 assert_fail_debug_msg: Assertion Failed!
buf_len + 1 <= buf_size && "Is your input buffer properly zero-terminated?" at C:/VS/shadPS4-ime-fixes/externals/dear_imgui/imgui_widgets.cpp:4601 fix
* Attempting to resolve an assertion failure in Diablo III:
- Adjusted buffer sizes
- Updated the calculation of text‑length values
* ime-lib another hotfix
Fixed incorrect param->title validation, which caused the IME dialog to fail to appear in Stardew Valley. Need to be checked.
* Clang fix
---------
Co-authored-by: w1naenator <valdis.bogdans@hotmail.com>
* Changes
-Added support for OrbisImeParamExtended (extended IME parameters) in ImeHandler, ImeState, and ImeUi
-Updated all relevant constructors and logic to propagate and store the extended parameter
- Now fully supports passing extended options from sceImeOpen to the IME UI and backend
* Potential CUSA00434 [Debug] <Critical> assert.cpp:30 assert_fail_debug_msg: Assertion Failed!
buf_len + 1 <= buf_size && "Is your input buffer properly zero-terminated?" at C:/VS/shadPS4-ime-fixes/externals/dear_imgui/imgui_widgets.cpp:4601 fix
* Attempting to resolve an assertion failure in Diablo III:
- Adjusted buffer sizes
- Updated the calculation of text‑length values
---------
Co-authored-by: w1naenator <valdis.bogdans@hotmail.com>