* cmake: accept glslang's current tool name and document Python 3
Official glslang release archives for Windows ship the compiler only as
glslang.exe, so configuring with one of them on PATH could not find
glslangValidator. Fall back to glslang; glslangValidator is still
preferred where both exist.
The bundled SPIRV-Tools needs Python 3 at configure time, which the
Windows build requirements did not mention.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* docs: list Python 3 in the Linux and macOS prerequisites
The bundled SPIRV-Tools calls find_host_package(Python3 REQUIRED) on every platform, so the apt and Homebrew package lists need it too, not only the Windows requirements.
* cmake: remove glslang naming comment
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: nmzik <Nmzik@mail.ru>
avplayer_file_tests compiles libs/avPlayer.cpp into the test, and its
PRINT_NAME() calls Loader::Timer::GetTimeMs(). Add loader/timer.cpp to the
target, like the other tests that compile HLE library sources. CI links the
test with LTO, which drops the unused reference, so the failure only shows
in non-LTO builds such as the README's no-Qt instructions.
Clang with libstdc++ rejects optional<IndirectDescriptor>::emplace() with
no arguments in ShaderRecompilerComputeTests.cpp. Assign the descriptor the
same way the neighbouring test does.
trophy_system is registered with ctest but kyty_tests did not build its
executable, so ctest reported it as Not Run.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* loader: enable AMD CPU instruction patching on macOS
The guest instruction patcher was compiled out on macOS and runtimeLinker forced emulate_amd off,
so under Rosetta every SSE4a EXTRQ/INSERTQ took the SIGILL path (about 18 us each). Build the
patcher on all hosts and let --amd-cpu enable it on macOS like on Windows and Linux. The host
feature probe already reports no SSE4a under Rosetta, so EXTRQ becomes a native trampoline and the
remaining fallbacks keep using the x64 instruction emulator through the host exception handler.
* tests: macos_sse4a covers the guest instruction patcher on macOS
Patch EXTRQ/INSERTQ blobs in an RWX area with a trampoline page behind it, with the host features of
Rosetta (no SSE4a/RDPID/CLWB), and compare against the SIGILL emulator: EXTRQ must become a native
trampoline without SIGILL, INSERTQ stays a trap handled by the emulator, and nothing is touched
without emulate_amd.
* loader: emulate the patcher's VRSQRTPS trap and MWAITX on macOS
The AMD CPU patcher marks VRSQRTPS it cannot relocate by clearing a reserved
VEX.vvvv bit, which raises #UD on every host including Rosetta. The macOS build
left TryEmulateReciprocalSquareRoot and TryEmulateMonitorxMwaitx out, so the
guest died with an unhandled SIGILL at the first such site.
Both are plain SSE2/libc, so enable them on macOS. The Darwin context also
gains ClearUpperYmm so the VEX.128 result zeroes YMM[255:128] when the thread
has the AVX context. macos_sse4a covers the trapped VRSQRTPS and MWAITX.
* tests: macos_sse4a runs a plain VEX.128 VRSQRTPS through the patcher
The existing case started from an instruction that was already marked as a trap. The
new cases feed the ordinary encoding to PatchGuestInstructions and compare the result
with the emulated reference, both through a native trampoline and, when the instruction
cannot be relocated, through the trap mark and the signal emulator.
* loader: compact macOS instruction patcher coverage
Share the emulator dispatch chain while keeping SHA emulation limited to non-Apple hosts and preserving handler order. Remove a duplicate VRSQRTPS signal test already covered by both native and trapped patcher cases, plus blank lines left by removed platform guards.
---------
Co-authored-by: nmzik <Nmzik@mail.ru>
* Map UDS events to trophies via dumped metadata and redesign trophy UI
Correlate each UDS event to its stat ID (uds00.ucp) and trophy target (trophy00.ucp) instead of a hard-coded event, store trophy JSON with unlock date/time outside _SaveData, and add a PS5-style toast, viewer and overview.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* Fix trophy rule evaluation and share progress accounting
* Match trophy and reload toolbar styling
---------
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: nmzik <Nmzik@mail.ru>
CMake 4 warns "Compatibility with CMake < 3.10 will be removed" for every
fetched project that declares an older minimum. zydis and its bundled
zycore both declare cmake_minimum_required(VERSION 3.9), so each configure
prints two deprecation warnings. The existing floor of 3.5 does not lift
them past the threshold; 3.10 does.
Existing build directories keep the cached 3.5 until reconfigured with
-U CMAKE_POLICY_VERSION_MINIMUM or a fresh cache.
Tested on Windows 11, clang-cl 19.1.5, CMake 4.4.3: configure prints 0
deprecation warnings (2 with the old floor); virtual_memory_allocation_tests
builds and links zydis/xbyak; ctest guest_red_zone_patcher passes.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* controller: cycle DualSense speaker volume, vibration and trigger intensity in game
Three new input mapping controls cycle the PS5's controller settings in
game (default keys 1, 2 and 3): speaker volume (100% -> off -> 2% -> 12%
-> 42%), vibration intensity and trigger effect intensity (strong -> off
-> weak -> medium). Each starts at full and is not saved.
Changing vibration or trigger intensity re-sends the game's last rumble
and trigger effect, so the change is felt immediately.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Clean up controller settings test captures and formatting
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: nmzik <Nmzik@mail.ru>
* pad: send DualSense speaker and haptic audio over Bluetooth
* ci: fix Opus clang-cl build and macOS memory tracker test
* docs: remove Bluetooth notes from project README
* pad: keep Bluetooth audio work off emulation timing path
* pad: smooth DualSense speaker audio on USB and Bluetooth
* tests: find available macOS guest range for page manager
* pad: keep haptic waveform when Bluetooth queue overflows
* audio: reject zero output sample frequency
* Simplify DualSense audio routing and fix Bluetooth batching
---------
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: nmzik <Nmzik@mail.ru>
* libs: fix CP932 iconv conversion on Windows and macOS
SDL3's SDL_SYSTEM_ICONV build option defaults off on Windows and macOS,
so SDL falls back to its own bundled iconv there, which only implements
ASCII/Latin-1/UTF/UCS. SDL_iconv_open("UTF-8", "CP932") always failed as
a result, crashing games that convert Shift-JIS strings via
sceCesMbcsStrToUtf8Str (e.g. save-data dialogs).
Add a small CesIconv shim selected at compile time: Windows converts one
character at a time via the Win32 codepage-932 APIs, replicating
SDL_iconv's chunked semantics and error codes; macOS calls real POSIX
iconv directly, since libiconv is always present there and does support
CP932, unlike SDL's fallback. Linux is untouched, since SDL already
links real system iconv by default there.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* libs: fix SaveDataDialog infinite loop on save
SaveDataDialogOpen() jumped straight from SAVE_STATUS_INITIALIZED (1) to
SAVE_STATUS_FINISHED (3), skipping SAVE_STATUS_RUNNING (2) entirely. At
least one title's save-write dialog stage only accepts a FINISHED status
after observing a RUNNING poll first; without it, the title assumed the
Open() request never took effect and re-issued it forever, hanging the
save flow (this only became visible once the CP932 crash above stopped
masking it).
Open() now starts the dialog as RUNNING. UpdateStatus() advances the
state machine, reporting RUNNING once before flipping to FINISHED for
subsequent polls; GetStatus() is untouched, staying a pure peek with no
side effects, matching the real SDK's pump-vs-peek split between the two
calls.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* Add iconv linking to macOS
* Fix missing macOS iconv link for tests
* Fix CP932 edge cases and save dialog status consistency
---------
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: nmzik <Nmzik@mail.ru>
* audio: play DualSense haptics from vibration audio ports
Games drive the DualSense's actuators through a vibration audio port, one channel per actuator.
These ports had no device, so their samples were dropped. Over USB the DualSense is a 4-channel
audio device whose back channels feed the actuators; play the port's samples there through SDL.
The device is looked up while the port plays, so the controller can be connected at any time. The
queue keeps about the latency of the regular audio path, with the playback rate nudged by up to 3%
when the port is fed off real time.
While haptic audio plays, hold a DualSense's rumble at zero: SDL disables audio haptics whenever
rumble is non-zero.
Add pad_haptics tests for the sample conversion, device-name matching and rate correction.
* Simplify DualSense audio haptics and restore idle rumble
---------
Co-authored-by: nmzik <Nmzik@mail.ru>
* launcher: keep primary update feed answer when the fallback request fails
When the primary feed is reachable but its tag differs from the build tag,
the result was discarded and the GitHub API fallback was consulted. If the
fallback request failed (api.github.com rate-limits unauthenticated
requests), the launcher reported an error even though the primary feed had
already returned a usable update answer with a working release URL. Keep
the primary feed answer and show it if the fallback fails.
* emulator: validate numeric CLI arguments
--screen-width, --screen-height, --gpu, and --vblank-frequency were parsed
with Common::ToInt32/ToInt64, which ignores std::from_chars errors and
returns 0, so values like "--screen-width abc" or "--gpu xyz" were
silently accepted: zero screen size, or GPU 0 selected instead of auto
(-1). Reject invalid values with an error message like the other options,
using from_chars-based helpers (ParseUint32/ParseInt32); reject zero
screen dimensions.
* tests: add LeastRecentlyUsedCache regression tests
Cover the LRU cache walk order, tick filtering in ForEachItemBelow,
early-exit boolean callbacks, Touch reordering and same-tick skips,
Free, and freed-id reuse by later inserts. Modeled on BitArrayTests.
* tests: use a tick cutoff that detects a stale newest-item tick
Collect(cache, 35) also visits c when Touch(c, 35) failed to update
its tick (30 <= 35). Use a cutoff of 30 and expect only b.
* Run LRU cache tests in CI
---------
Co-authored-by: nmzik <Nmzik@mail.ru>
* audio: support standard NGS2 PCM16 sampler playback
Extend the existing fixed-point PCM path to standard samplers, loops, and progress reporting. Apply voice events immediately and honor callback interruption during source advancement.
Reuse upstream rate and pitch handling. Add regression coverage for streaming, routing, callbacks, loops, and custom sampler controls; ngs2_sampler passes.
* audio: apply NGS2 rear low-pass filters
Handle rear low-pass FCQ controls at the output sample rate with per-channel history and channel masks. Preserve filter tails through streaming gaps and use the standard pi constant for coefficients.
Add regression coverage for frequency response, control layout, channel isolation, and starvation/refill continuity. Emulator build and both audio test suites pass.
* Preserve resampling phase for accepting voices
Only reset voice.sample_phase when there are no blocks and the voice does not accept blocks (change in src/libs/ngs2.cpp). Add TestResamplingPhaseAfterStarvation to tests to ensure sampler and custom sampler retain resampling phase and pending source advancement after starvation, and that SetupSampler still resets the phase. This prevents resampling phase loss during starvation/refill across sample rates.
* audio: correct sampler controls, lifecycle, and filter tails
---------
Co-authored-by: nmzik <Nmzik@mail.ru>
LINK_FLAGS is a space-delimited string, so when the build path contains
spaces the linker map option is split into bogus arguments and the final
link fails:
clang++: error: no such file or directory:
'pro/KytyPS5/_Build/linux/kyty_emulator_clang_lld.map'
Move -Wl,-Map=<path> out of LINK_FLAGS into target_link_options, which
CMake passes to the linker as a single argument. This completes #26 for
the WIN32 OR LINUX branch (clang/gcc builds); the clang-cl branch was
already converted there.
* remove outdated ninja setup action
* Remove deprecated ninja setup action
The seanmiddleditch/gha-setup-ninja action has been archived by its
maintainer, who explicitly states that Ninja is now pre-installed on
all GitHub-hosted runners. This removes the action from all three
build jobs (Windows, macOS, Linux) and removes ninja from the package
install lists on macOS and Linux.
* Add automatic ccache/sccache detection to CMakeLists.txt
Detects sccache (preferred on Windows/MSVC) or ccache at configure time
and sets CMAKE_C_COMPILER_LAUNCHER / CMAKE_CXX_COMPILER_LAUNCHER
automatically. Works for local builds without manual flags.
Priority: sccache > ccache (sccache handles MSVC PDBs better).
* Delete github-actions-version-research.md
* Respect user-specified CMAKE_C_COMPILER_LAUNCHER / CMAKE_CXX_COMPILER_LAUNCHER
Only auto-detect sccache/ccache if no launcher was explicitly provided
via -DCMAKE_C_COMPILER_LAUNCHER=... or -DCMAKE_CXX_COMPILER_LAUNCHER=...
* Preserve explicit compiler launcher settings per language
---------
Co-authored-by: nmzik <Nmzik@mail.ru>
* Persist save-data memory across restarts
* Fix SetSaveDataMemory2 data loss, split saves per user, add atomic writes everywhere
- SaveDataSetSaveDataMemory2 treated data_num=0 as "no entries" even when
a valid data pointer was supplied. Astro Bot calls this with data_num=0
meaning "one entry, at data[0]" (an implicit-count convention), so every
real save write from it was silently dropped as a no-op. Default
data_num to 1 when data is non-null, matching that convention.
- SaveDataSetupSaveDataMemory2/Get/SetSaveDataMemory2 rejected any call
that included a non-null icon pointer. Icon persistence isn't
implemented, but titles are allowed to pass one anyway; rejecting the
whole call over it made every title that does so fail outright. Ignore
icon instead of rejecting.
- SaveDataMount3/SaveDataTransferringMount/SaveDataDelete built their
save-data path from title+dir_name only, dropping the user_id PS5
local users are keyed by (unlike the newer SetSaveDataMemory2 layout,
which already nests by user_id). Nest these under user_id too so saves
from different local users can no longer collide. No migration for the
old flat layout - the project is still pre-release/experimental.
- Classic SaveDataMount3-mounted titles (Blasphemous, Dead Cells, ...)
write their save files directly through the guest's normal file I/O
once mounted, bypassing SaveData's own write path entirely, so they
had none of the crash-safety SetSaveDataMemory2 already had. Added the
same protection at the file-system layer: a guest file opened under a
/savedataN mount that recreates the file from scratch (O_CREAT and/or
O_TRUNC) is now written to a .tmp shadow file and atomically replaces
the real one on close, instead of being truncated in place.
- Both write paths now back up the file they're about to replace into a
sibling "backups" folder (same filename, no added suffix) before the
atomic replace, so a manual recovery copy of the previous save always
survives a write - even one that "succeeds" but wasn't wanted.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* Fix save-memory compatibility and preserve existing saves
---------
Co-authored-by: nmzik <Nmzik@mail.ru>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
* loader: emulate immediate SSE4a instructions on macOS
* tests: simplify macOS SSE4a test integration
Keep the Darwin target, CTest registration, and aggregate dependency in
one conditional block without a separate target list. Preserve the
standalone target when BUILD_TESTING is disabled.
Lowercase the test filename and diagnostic prefix, and drop unrelated
formatting changes from the instruction emulator.
Credit Brandon Strong's related SSE4a work in
https://github.com/KytyPS5/KytyPS5/pull/467.
Co-authored-by: Brandon Strong <brandostrong@gmail.com>
---------
Co-authored-by: nmzik <Nmzik@mail.ru>
Co-authored-by: Brandon Strong <brandostrong@gmail.com>
* graphics: do not arm a fast clear from a read-modify-write dispatch
* tests: cover compute metadata clear classification
---------
Co-authored-by: nmzik <Nmzik@mail.ru>