Repository navigation
fix(libs): values measured on a PS5 (firmware 13.40) from inside retail games - #7965
Conversation
…r as a PS5 does
On a PS5 (firmware 13.40) sceKernelGetEventError returned 0 for fflags 0 and 0x80020000 | fflags otherwise, whatever flags and data held: {0x4000, 0, 22} -> 0, {0x4000, 5, 0} -> 0x80020005, {0x4000, 5, 22} -> 0x80020005, {0, 7, 22} -> 0x80020007, {0x8000, 3, 9} -> 0x80020003. fflags above 0xFFFF were not measured and throw.
… PS5 reports Inside Gran Turismo 7 on a PS5 (firmware 13.40) scePadGetControllerInformation for the DualSense reported touch pad resolution 1920 x 1080 and stick dead zones 13 and 13; pixel density 44.86 already matched. Touch y coordinates now span that height: a host touch pad scales y to 0..1079 and the view-button and injected touches sit at y 540 instead of 0..942 and 471.
…parameters as a PS5 does Inside Gran Turismo 7 on a PS5 (firmware 13.40) parameters 7 (game parental level) and 1000 (enter button assignment) returned 0x80A10003 like every other unknown parameter; 1 to 5, 100 and 400 answered.
… a PS5 Measured on firmware 13.40 inside Gran Turismo 7 through ptrace remote calls and GPU buffers submitted from the game.
…measured-1340 # Conflicts: # core/libs/tests/GuestPad.cpp
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
MarcZX10
left a comment
There was a problem hiding this comment.
I checked the event-error and parameter changes against the recorded measurements. sceKernelGetEventError now follows the measured fflags cases independent of EV_ERROR and data, and it explicitly leaves values above the measured 16-bit range unsupported; the tests cover the 0xFFFF boundary and rejection above it. The system-service tests also check unknown IDs return the measured error without changing the output. The PR notes that Windows and physical touch-pad input were not tested. I did not independently rerun the reported Linux/Rosetta test matrix.
…measured-1340 # Conflicts: # docs/dev/debt/shader.md
…measured-1340 # Conflicts: # docs/dev/debt/libSceAgcDriver.md
|
@frankea thanks for measuring these on a console. #8138 just merged (3e7d1d2) with the DualSense touchpad part of this PR: 1920x1080 in both controller-information calls, the x1079 finger scaling and the y 540 contacts, now in shared constants in Could you rebase onto current |
…measured-1340 # Conflicts: # core/libs/prx/libScePad/Export.cpp # core/libs/prx/libScePad/src/PadState.cpp # core/libs/prx/libSceVideoOut/src/PadInput.cpp # core/libs/tests/GuestPad.cpp
…measured-1340 # Conflicts: # docs/dev/debt/libSceVideoOut.md
|
@oneandonlydean thanks. I merged current AI-assisted: yes (Claude Code). |
|
@frankea thanks for the console measurements and for trimming the touchpad entry. The values and their source (PS5 firmware 13.40, measured 2026-10-19 from a retail title's own calls) are exactly what these debt lines need. One change before this can go in: the measurement sentences this PR adds name the title they were taken in, by name and title id, in |
|
@oneandonlydean done in 62b29b6. The measurement sentences this PR adds no longer name the title or its id: each now says the value was measured on a PS5 (firmware 13.40, 2026-10-19) inside a retail title. That covers AI-assisted: yes (Claude Code). |
…measured-1340 # Conflicts: # docs/dev/debt/shader.md
…measured-1340 # Conflicts: # docs/dev/debt/libSceSystemService.md
…measured-1340 # Conflicts: # docs/dev/debt/libSceAgcDriver.md
…measured-1340 # Conflicts: # core/libs/prx/libSceSystemService/Export.cpp
|
@frankea, the overlap bot on my #9086 flags our shared |
|
Two titles that need the parameter 100 case. Since #9137,
#9591 adds the same parameter 100 case. A local change with only that case gave 007 the same result. Linux 7.2.11 (Arch), RX 9070 XT, RADV Mesa 26.2.5, Release. One run each. |
|
@frankea a data point for this PR's |
|
@boykopovar, a note on merging this: it changes two The latest main merge here resolved a conflict with #9137. Parameters 7 (game parental level) and 1000 (enter button assignment) now return If you have a console reading that shows 7 or 1000 answering on PS5, I'll put them back. |
|
@EagleBearerYS @hugodearaujo I measured all of them on the PS5 (firmware 13.40) today, inside a retail title through ptrace remote calls in the game process, as before. The probe called
For Spider-Man 2's reads that means 100 = 0, 208 = 0 and 210 = 71 on this console. These are one console's values with its current settings, so some of them may be user settings that differ elsewhere; which ones, and what each parameter means, this doesn't show. For reference, the same runs read 1 = 1 (English (United States)), 2 = 2, 3 = 0, 4 = -300, 5 = 1, 100 = 0 and 400 = 1. 4 and 5 agree with the libSceSystemService debt entry's reading of them: the time zone is the offset less the summer time shift (UTC-5 with summer time in effect, the console's clock at UTC-4). No open PR answers these ids yet as far as I can find, so I've opened #10077, which returns these values for 101 to 111, 200 to 213 and 300 instead of throwing, with the debt entry and AI-assisted: yes (Claude Code) |
|
@frankea thank you, that's exactly what was missing: 208 = 0 and 210 = 71 cover Marvel's Spider-Man 2 (PPSA03016)'s reads at that stop, and the full 0-2048 sweep with the 4-byte write and the null-pointer result gives a PR something solid to test against. Your caveat about one console's settings is noted. Please link your PR here when it's up; @hugodearaujo can then run Spider-Man 2 on it. |
What
Values measured on a PS5 on firmware 13.40 on 2026-10-19. Library calls were made inside retail game processes (Gran Turismo 7 PPSA01317, MLB The Show 25 PPSA23479) through ptrace remote calls: a payload attaches to the game, borrows a stopped thread, calls the export the game itself resolved and restores the thread. GPU results come from command buffers built by the probe and submitted with
sceAgcDriverSubmitDcb/sceAgcDriverSubmitAcbfrom inside GT7, including a gfx1013 compute kernel assembled with LLVM 18.sceKernelGetEventErrorwas measured in a plain payload process. Three code changes where the console disagrees with main (the touch pad values are onmainthrough #8138), and debt entries rewritten with the measured values where it agrees or where the code stays as it is.sceKernelGetEventError. It now returns 0 whenfflagsis 0 and0x80020000 | fflagsotherwise, whateverflagsanddatahold, as fpPS4 does. Main returneddatawhenEV_ERRORwas set. Console:{flags 0x4000, fflags 0, data 22}0,{0x4000, 0, -1}0,{0x4000, 0, 0x80020016}0,{0, 0, 0}0,{0x4000, 5, 0}0x80020005,{0x4000, 5, 22}0x80020005,{0, 7, 22}0x80020007,{0x8000, 3, 9}0x80020003.fflagsabove 0xFFFF were not measured, and that is where OR and addition differ, so they throw. The debt entry is rewritten and points out that video-out events, which carry their count infflags, now get 0x80020001 and up.scePadGetControllerInformationandscePadGetExtControllerInformationnow report stick dead zones 13 / 13 (main 2 / 2), which is what GT7's DualSense handle got on the console. Its touch pad answered 1920 x 1080 at 44.86, the values fix(libScePad): report the DualSense touchpad resolution #8138 put onmain, and connection type 0, connected count 1, connected 1 and device class 0 already matched. The libScePad debt entry "Touchpad resolution" said the console's values were not measured; it now gives them.sceSystemServiceParamGetInt. Unknown parameters now return 0x80A10003 without writing, where main wrote 0 and returned 0. Parameters 7 (game parental level) and 1000 (enter button assignment) are no longer answered, because inside GT7 both returned 0x80A10003. Console: 0, 6, 7, 8-20, 401, 999, 1000 and 1001-1008 returned 0x80A10003, and a null value pointer did too, as main already does. 1 to 5 and 400 answered (1, 2, 0, -300, 1, 1 on that console), and 100 answered the value 0, which this PR keeps as an explicit case. A new debt entry records this.sceVideoOutGetResolutionStatus: the 48-byte layout is confirmed (GT7's handle 0x4e100100 on a 4K TV: 3840 x 2160, pane 3840 x 2160, refreshRate 3, screenSizeInInch 60.0f, flags 0). The repo still writes screenSizeInInch 0.sceVideoOutGetOutputStatusWithVrr: bytes 48-53 were the 16-bit values 48, 60, 60 on a TV that takes 120 Hz (the repo writes 0), and the null 0x80290002 and unknown-handle 0x8029000B codes match.sceVideoOutIsOutputSupported: the unsupported mode set matches exactly. Mode 18 answered 0x8029001E on this console, the third console measured, so it stays a throw.sceVideoOutGetVblankStatus: the third u64,reservedhere and written 0, is a running counter on the console. GT7's own call returned 0x1c485ffaadc at a processTime of 941 s, about 970 s at ~2 GHz, which fits a TSC. This is a new entry.WRITE_DATAwith DST_SEL 3 (control 0x00100300, also 0x06100300 with cache policy 3) did not write its label in direct memory, even after aRELEASE_MEMwith GL2 write-back and invalidate (0x00300514). A GDSCOPY_DATAat that address returned 0, while DST_SEL 1, 2 and 5 wrote. The console's ownsceAgcDcbWriteData(dst 6)emits 0x00110300, DST_SEL 3, as the repo's builder does. This PR records the measurement and does not change the code, because Killzone's fence still needs some path to the label that is not established. "COPY_DATA from the GPU clock": SRC_SEL 9 and theRELEASE_MEMDATA_SEL 3 timestamp are the same counter, measured at 98.0 and 99.8 MHz over two 1.1 s CPU intervals, so the repo's 10 ns model holds. New entry forsceAgcDriverSubmitAcb: queues 0x20, 0x30, 0x40, 0x50, 0x57 and 0x58 returned 0 and ran a buffer (the repo throws for 0x58), and queue 0x1F faulted inside the console's driver.src_shared_base/src_shared_limit0x80000000_00000000 / 0x80000000_FFFFFFFF andsrc_private_base/src_private_limit0x70000000_00000000 / 0x70000000_FFFFFFFF, the values the code already uses.s_memtimeadvanced 22.35 times faster thans_memrealtime(44,041,632 against 1,970,792 ticks over the same loop), which puts the core clock at ~2.23 GHz against the 100 MHz reference. The console runs alignment mode DWORD. A rawbuffer_load_dwordwith the V# base 1 byte past a dword, or an aligned base with voffset 1, returned the aligned dword 0x44332211 (not 0x55443322).s_buffer_load_dwordreturned 0x44332211 as the repo does, andbuffer_atomic_addat byte 0x0D updated the dword at 0x0C as the repo does. The raw-access difference is recorded in "V# bases off a DWORD boundary" with aCloses when:. The recompiler is not changed in this PR.Measurement logs and the full tables: the probe and the per-run logs can be attached on request.
Tested
Ubuntu 24.04 x86-64 container (GCC, Ninja, Release,
BUILD_TESTING=ON) under Rosetta on macOS, onmain892a4f1 + these commits:ctest -R "^(guest_pad|guest_equeue_events|guest_system_service_language|pad_input|pad_sdl|pad_input_mapping|pad_keyboard_mouse)$": 100% tests passed, 0 tests failed out of 7.guest_equeue_eventschecks every console case above plusfflags0xFFFF (0x8002FFFF) and a throw for 0x80000001.guest_padchecks the dead zones of both information calls, next to #8138's touch pad checks.guest_system_service_languagechecks that ids 0, 6, 7, 8, 20, 401, 999, 1000, 1001 and 1008 return 0x80A10003 without writing and with a null pointer, and that 100 answers 0. Since 83a268a libkernel refuses a host CPU without AVX2/BMI2, which the Rosetta container is, so theCheckHostCpucall inHostCpu.cppwas bypassed locally for this run only and is not part of the PR.python3 tools/check_conventions.py --base origin/mainreports 0 errors. Its warnings are debt-length on entries that were already over 1000 characters before this PR, plus "V# bases off a DWORD boundary" (1113 characters) ands_memtime(1311). Not tested: Windows and any title.Checklist
main; no other open PR implements the same functions (feat(pad): support up to 4 controllers with dynamic user discovery #7881 moves the pad information code and keeps the old dead zones)NotImplemented_nid_no_patch); silent stubs are listed in the technical debt file.mdfiles or images added to the repository