Commit Graph

3571 Commits

Author SHA1 Message Date
Stephen Miller
a285543134 Filesystem: Directory-related fixes (#3416)
* 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
2025-08-14 14:50:20 +03:00
rainmakerv2
2c906dc280 Log user CPU, total RAM, and OS (#3402)
* 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
2025-08-14 13:04:08 +03:00
Stephen Miller
882dd889df Add entries for . and .. in MntPoints::IterateDirectory (#3414)
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.
2025-08-13 16:36:41 +03:00
kalaposfos13
1b621e4b1d Add stubbed libSceNpProfileDialog library (#3411)
* Stubbed library

* Silence sceNpProfileDialogUpdateStatus

* the loathsome clang-formatter
2025-08-10 20:05:50 +03:00
Stephen Miller
d6b2845dcc Stub NOT_IN_PARTY behavior (#3409)
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.
2025-08-10 20:05:38 +03:00
kalaposfos13
ff6ab9444a Fix handling of RFC 3339 formatted dates (#3410) 2025-08-10 20:04:50 +03:00
DanielSvoboda
54de156e1e Fix sceVoicePortInfo (#3408)
The VoicePortInfo 'state' was changed from 3-RUNNING to 0-IDLE. This prevents it from getting into a loop.
2025-08-10 20:04:15 +03:00
Stephen Miller
d1f9594b9d libSceAppContent: Determine entitlement labels from additional content param.sfo (#3405)
* 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
2025-08-10 00:19:08 +03:00
DanielSvoboda
c5aed0873f SystemGesture - Rename files to match naming convention (#3403) 2025-08-08 15:51:30 -03:00
georgemoralis
4ff9d371f6 New Crowdin updates (#3380)
* New translations en_us.ts (Turkish)

* New translations en_us.ts (Spanish)

* New translations en_us.ts (Polish)

* New translations en_us.ts (Albanian)

* New translations en_us.ts (Ukrainian)

* New translations en_us.ts (German)

* New translations en_us.ts (Greek)

* New translations en_us.ts (Vietnamese)

* New translations en_us.ts (Indonesian)

* New translations en_us.ts (Romanian)

* New translations en_us.ts (French)

* New translations en_us.ts (Arabic)

* New translations en_us.ts (Catalan)

* New translations en_us.ts (Danish)

* New translations en_us.ts (Finnish)

* New translations en_us.ts (Hungarian)

* New translations en_us.ts (Italian)

* New translations en_us.ts (Japanese)

* New translations en_us.ts (Korean)

* New translations en_us.ts (Lithuanian)

* New translations en_us.ts (Dutch)

* New translations en_us.ts (Portuguese)

* New translations en_us.ts (Russian)

* New translations en_us.ts (Slovenian)

* New translations en_us.ts (Swedish)

* New translations en_us.ts (Chinese Simplified)

* New translations en_us.ts (Chinese Traditional)

* New translations en_us.ts (Portuguese, Brazilian)

* New translations en_us.ts (Persian)

* New translations en_us.ts (Norwegian Bokmal)

* New translations en_us.ts (Serbian (Latin))

* New translations en_us.ts (Italian)

* New translations en_us.ts (Catalan)

* New translations en_us.ts (Russian)

* New translations en_us.ts (Portuguese, Brazilian)

* New translations en_us.ts (Ukrainian)

* New translations en_us.ts (Norwegian Bokmal)

* New translations en_us.ts (Russian)

* New translations en_us.ts (Urdu (Pakistan))

* New translations en_us.ts (Urdu (Pakistan))

* New translations en_us.ts (Urdu (Pakistan))

* New translations en_us.ts (Chinese Simplified)

* New translations en_us.ts (Urdu (Pakistan))

* New translations en_us.ts (Urdu (Pakistan))

* New translations en_us.ts (Urdu (Pakistan))

* New translations en_us.ts (Swedish)
2025-08-08 16:13:43 +02:00
DanielSvoboda
adef2ff231 SystemGesture (#3382)
* SystemGesture

* only STUBBED
2025-08-08 15:44:54 +03:00
squidbus
e7b97580b7 vk_instance: Temporarily disable maintenance8 for MoltenVK
Working on getting fix in for image copy issue.
2025-08-08 05:29:01 -07:00
TheTurtle
d9108cd39a video_core: Rework tile manager (#3374)
* 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
2025-08-08 05:27:11 -07:00
Marcin Mikołajczyk
befc5ec17b select (#3353)
* 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>
2025-08-08 00:20:49 +03:00
Valdis Bogdāns
f9ab6c48e3 Ime fixes (#3399)
* 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>
2025-08-07 19:24:14 +03:00
marecl
f83619e313 Fixed green artifacts in movies/animations (ffmpeg) (#3398)
* Fixed green artifacts in movies/animations (ffmpeg)

* cleanup&clang

* Avoid for-loop when source and target widths are equal
2025-08-06 22:08:59 +03:00
kalaposfos13
5b46216bae Make libSceRtc fully HLE (#3330)
* 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
2025-08-06 20:08:26 +03:00
Lander Gallastegi
841aa9e43d video_core: garbage collector (part 1) (#3350)
* Memory information

* Buffer cache GC

* Texture cache GC

* Fix ChangeRegister

* Better image touching

* Buffer async download on GC destroy

* Handle image download, SKIP NON-LINEAR WORKAROUND

* Only download when not dirty

* Correctly handle BDA pagefile update

* Restructure ChangeRegistration
2025-08-06 12:30:13 +02:00
Marcin Mikołajczyk
2f701311f2 Sockets fixes (#3392)
* Print errnos as decimal

* SetSocketOptions: prevent setting SO_TYPE

* Extract net error handler

* Change the local IP retrieval method

* Fix windows
2025-08-06 08:00:29 +03:00
Stephen Miller
074dfe2571 Update file_system.cpp (#3388) 2025-08-05 19:58:23 +03:00
Valdis Bogdāns
7dd64f889f FF9 ImeDialog Hotfix (#3386)
* 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>
2025-08-05 19:57:31 +03:00
Stephen Miller
7ec3a38b89 libSceAppContent: Use last 16 characters of DLC folder to determine entitlement label (#3375)
* 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.
2025-08-05 11:52:53 +03:00
psucien
afb9e220aa libkernel: more network functions for OpenOrbis compatibility (#3373) 2025-08-05 11:25:18 +03:00
Vinicius Rangel
0044a27c1f Simple IPC for external control (#3345)
* add simple IPC protocol

to allow communication via stdin/stdout

* ipc: add PATCH_MEMORY command

enables patches & cheates
2025-08-04 20:32:50 -03:00
Marcin Mikołajczyk
77410fd228 Stub remaining netctl properties (#3385) 2025-08-04 23:20:39 +03:00
Marcin Mikołajczyk
b53bda852d Fix get/setsockopt levels (#3384) 2025-08-04 22:48:56 +03:00
georgemoralis
339081d08f [ci skip] Qt GUI: Update Translation. (#3378)
Co-authored-by: georgemoralis <4313123+georgemoralis@users.noreply.github.com>
2025-08-04 13:20:21 +03:00
georgemoralis
7f4183eb27 New Crowdin updates (#3358)
* New translations en_us.ts (Turkish)

* New translations en_us.ts (Spanish)

* New translations en_us.ts (Polish)

* New translations en_us.ts (Albanian)

* New translations en_us.ts (Ukrainian)

* New translations en_us.ts (German)

* New translations en_us.ts (Greek)

* New translations en_us.ts (Vietnamese)

* New translations en_us.ts (Indonesian)

* New translations en_us.ts (Romanian)

* New translations en_us.ts (French)

* New translations en_us.ts (Arabic)

* New translations en_us.ts (Catalan)

* New translations en_us.ts (Danish)

* New translations en_us.ts (Finnish)

* New translations en_us.ts (Hungarian)

* New translations en_us.ts (Italian)

* New translations en_us.ts (Japanese)

* New translations en_us.ts (Korean)

* New translations en_us.ts (Lithuanian)

* New translations en_us.ts (Dutch)

* New translations en_us.ts (Portuguese)

* New translations en_us.ts (Russian)

* New translations en_us.ts (Slovenian)

* New translations en_us.ts (Swedish)

* New translations en_us.ts (Chinese Simplified)

* New translations en_us.ts (Chinese Traditional)

* New translations en_us.ts (Portuguese, Brazilian)

* New translations en_us.ts (Persian)

* New translations en_us.ts (Norwegian Bokmal)

* New translations en_us.ts (Serbian (Latin))

* New translations en_us.ts (Italian)

* New translations en_us.ts (Catalan)

* New translations en_us.ts (Russian)

* New translations en_us.ts (Russian)

* New translations en_us.ts (Arabic)

* New translations en_us.ts (Arabic)

* New translations en_us.ts (Swedish)

* New translations en_us.ts (Portuguese, Brazilian)

* New translations en_us.ts (Portuguese, Brazilian)

* New translations en_us.ts (Norwegian Bokmal)

* New translations en_us.ts (Spanish)

* New translations en_us.ts (Chinese Simplified)
2025-08-04 13:20:06 +03:00
DanielSvoboda
42e3ce9465 Fix Play Time (#3377) 2025-08-03 23:13:30 +03:00
Valdis Bogdāns
012b01d81f Another ImeDialog hotfix (#3371)
* 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>
2025-08-03 12:51:26 +03:00
rainmakerv2
e56232134f Minor fixes (#3370) 2025-08-03 12:25:08 +03:00
rainmakerv2
c7f1c66b82 Qt: add customizable controller hotkeys (#3369)
* customizable controller hotkeys - initial

* Update input_handler.h
2025-08-03 11:59:12 +03:00
kalaposfos13
a362f20dae Implement ORBIS_NET_CTL_INFO_HTTP_PROXY_CONFIG (#3366) 2025-08-03 11:15:13 +03:00
Valdis Bogdāns
1e7c4bb69c ime-changes (#3348)
* 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>
2025-07-31 12:24:36 +03:00
rainmakerv2
1b195c9613 controller select crash fix + minor changes (#3355)
* fix crash and ingame controller check

* performance issue fix

* add change controller event to imgui
2025-07-31 09:12:06 +03:00
georgemoralis
ecc924791d [ci skip] Qt GUI: Update Translation. (#3357)
Co-authored-by: georgemoralis <4313123+georgemoralis@users.noreply.github.com>
2025-07-31 09:11:53 +03:00
Marcin Mikołajczyk
78936f31fc sys_getpeername (#3354) 2025-07-31 00:28:09 +03:00
Stephen Miller
6c34b86add Net: Fix various socket-related issues (#3347)
* Store platform-specific level in a separate variable

So the level logged in the getsockopt/setsockopt unreachable is actually useful in cases where the level is unknown.

* Define ORBIS_NET_IPPROTO_IPV6

Not implemented yet, but since it's known we might as well add it.

* Fix error codes

Our libSceNet code expects accurate ORBIS_NET_E* errors, while the sys_net code returns ORBIS_NET_ERROR_* errors.

* Remove duplicate getsockname implementation

* Use separate mutex for ReceivePacket calls

Calls to ReceivePacket shouldn't block other socket functions, and allowing them to block these functions frequently causes deadlocks in games that use multiple threads for socket behaviors.
That said, concurrent receives are still a potential issue, so the function should still have a mutex.

* Add missing error codes

* Clang

* Minor nit

Not sure why these were left separate from the rest of the net errnos

* Set __Error() in ConvertReturnErrorCode

Because the new error values are positive, the logic of "negative return is an error" doesn't work anymore. The easiest fix, while retaining corrected error values, is to just set __Error() in ConvertReturnErrorCode, and have that return -1 instead.
I also added some formatting fixes here too.

* Set errno on stubbed P2P socket error returns.

Otherwise the errno is just whatever was set by a previous failing function, which may cause issues in some games.
I used EAGAIN here since it appears to be valid for all three of these functions, but this can be changed if requested.

* Fix missed error returns

* Fix socket methods in file_system

Missed these
2025-07-30 21:54:28 +03:00
georgemoralis
f685233401 New Crowdin updates (#3321)
* New translations en_us.ts (Catalan)

* New translations en_us.ts (Norwegian Bokmal)

* New translations en_us.ts (Italian)

* New translations en_us.ts (Swedish)

* New translations en_us.ts (Portuguese, Brazilian)

* New translations en_us.ts (Serbian (Latin))

* New translations en_us.ts (Ukrainian)

* New translations en_us.ts (Russian)

* New translations en_us.ts (Chinese Simplified)

* New translations en_us.ts (Swedish)

* New translations en_us.ts (Turkish)
2025-07-30 21:53:09 +03:00
rainmakerv2
c924c20575 Multiple controllers: Select active controller and set default controller (#3169)
* initial commit - not cleanup yet, not usable with imGUI

* Ugly solution to working with ImGUI

* Populate the default controller labels

* Add remove default button

* missing tr calls

* edit imgui flag after updating

* Refactor

* Update sirit
2025-07-30 21:37:45 +03:00
DanielSvoboda
35132d9fdc fix patches - Different AppVer (#3344)
* fix patches

* fix linux?

* + mask, mask_jump32 |  - insideMetadata
2025-07-29 10:37:03 +03:00
Marcin Mikołajczyk
26a92d97fa Sockets are now files (#3319)
* Socket support for read/write/fstat

* Sockets are now files

* Fix ssize_t for windows

* Return posix error codes in net functions
2025-07-29 00:20:10 +03:00
TheTurtle
93767ae31b shader_recompiler: Rework sharp tracking for robustness (#3327)
* 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
2025-07-28 13:32:16 -07:00
marecl
d286631798 Patch is enabled only when game version matches patch version (#3336)
Removed redundancies from CheatsPatches::onSaveButtonClicked()
2025-07-28 16:52:23 +03:00
kalaposfos13
968cfe1180 Reset orientation on scePadOpen call (#3341) 2025-07-28 00:27:49 -07:00
baggins183
116554e425 V_ALIGNBYTE_B32 and V_ALIGNBIT_B32 (#3316)
* implement V_ALIGNBYTE_B32 and V_ALIGNBIT_B32

* fix mask

* uncomment alignbit
2025-07-28 00:27:13 -07:00
georgemoralis
df85efde7c fixed RetrieveNetmask for windows (#3338)
* fixed RetrieveNetmask for windows

* clang..
2025-07-27 19:14:11 +03:00
marecl
e3fe6e2809 Fixed missing hint (#3334) 2025-07-27 11:25:47 +03:00
Marcin Mikołajczyk
ee3816ffd6 Fix sceAudioOutOutputs (#3335) 2025-07-26 16:05:01 -07:00
DanielSvoboda
2e237051e3 scePadResetOrientation (#3332) 2025-07-26 15:48:30 -07:00