35 Commits
Author SHA1 Message Date
Brian Degenhardt 3e077eff9b Merge yaps2: arm64 JIT transplant + test/perf/libretro infrastructure
Merges yaps2/main (github.com/yaps2/yaps2, c16b88cb7) into ARMSX2,
replacing the arm64 recompiler family with the yaps2 JITs and importing
the yaps2 testing, perf, and libretro infrastructure. Common ancestor is
upstream PCSX2 342db5152 (2026-06-19); git auto-merged all but 38 files.

Replaced (deleted in this merge, recoverable from history):
- arm64/aR5900*, aR3000A*, aVU* -> arm64/iR5900*/iR3000A*/microVU*-arm64:
  EE static-pin register file with lazy dirty tracking, dual-residence
  allocator, IOP block linking, native COP2 macro ops, inline unaligned
  fastmem, persisted VU program cache, call-ret shadow ring, VU0 spin
  fast-forward.
- MVU_DIFF shadow-run hooks in shared VU interpreter TUs (superseded by
  the offline vurunner JIT-vs-interp oracle).

Imported from yaps2:
- tests/ctest/core/recompilers: ~80 gtest suites (EE/IOP/VU differential
  harnesses, fuzzers, ABI digest tripwire, capture format pins) plus the
  gs_vertex_tests kernel oracle.
- pcsx2-vurunner / pcsx2-eerunner headless capture-replay runners.
- tools/perf counter-based A/B rigs, perf jitdump productionization,
  PmuCounters, clang-perf/clang-handheld presets.
- pcsx2-libretro core (ENABLE_LIBRETRO, default OFF; rename pending).
- GS vertex-kick fast path (GV series): TBL-based packed parse,
  register-resident kick, scalar-outcode cull, fused draw-rect/FindMinMax.
- Null renderer, VK_KHR_display direct WSI, swapchain PresentStats.
- SPU2 NEON mixer vectorization, EE timer read clamp (NFL 2K5 hang),
  IOP ioman signed-compare fix, assorted UB fixes.

Kept from ARMSX2 in the both-touched files:
- iOS dual-map W^X and fastmem-unavailable resilience (Memory, HostSys,
  vtlb). The split data/code area model is retained; both areas now take
  fixed VA hints so cached VU JIT code stays deterministic on Linux.
- Android thread-affinity model, VMState shutdown early-outs, all
  platform frontends, branding, CI, RetroAchievements identity/policy.
- GSDeviceVK: ARMSX2's push-descriptor decision logic (Mali crash gate,
  proprietary-vs-turnip Adreno split) merged with yaps2's descriptor-pool
  exhaustion recovery (flush + render-pass restart instead of dropped
  binds). Vendor feature policy is the union: Mali fbfetch policy with
  MediaTek/G57/Xclipse gates from ARMSX2; Adreno stencil/ROV/
  test-and-sample-depth hang avoidance and no_ps2_z_quantization from
  yaps2.

Build-system notes:
- The Qt debugger is now gated behind ENABLE_QT_DEBUGGER (default off on
  arm64) so handheld builds drop the KDDockWidgets dependency.
- GSDeviceNone and remaining yaps2 GS code were ported to the newer
  upstream GSTexture Usage-flags API.

The replaced backend's interpreter-fallback glue (intExecuteOneInst,
AndroidEEOpHist) and the EEDiffVerify runtime differ are retained for
now; dead pieces will be removed in a follow-up commit.
2026-07-19 10:24:29 -07:00
jpolo1224 98c90a2124 Android 2.5.8: OSD off-by-default + rumble + MP4 wallpaper + controller keyboard/nav
OSD now hides via RenderOverlays mirror of EmuConfig.GS->GSConfig + seed-false on first launch. Rumble: forward SetPadVibrationIntensity to Native::onPadRumble on Android (mono core had no call site). Library: bundled PS3 XMB-wave MP4 as default background, drawn edge-to-edge via ArmsBackdrop backgroundLayer (fixes landscape strip). In-app on-screen keyboard for library search; Recently Played shelf selection highlight; settings category tabs reachable via Row+horizontalScroll. Persian (fa) translation; gold RetroAchievements trophy.
2026-07-11 18:08:27 -04:00
jpolo1224 d01b94d055 Recover mono ui-overhaul (PR#3 base + session UI edits) + prebuilt native .so from vc1063 2026-07-11 08:35:55 -04:00
jpolo1224 11e9289454 Android: bring the platform up on the unified monorepo core
Wire platforms/android to build against the shared core and reconcile the
pieces the Android native lib needs, so the Android target compiles and
links on this repo (produces libemucore_4k.so). Per-platform builds stay
independent; the PC and iOS targets are unchanged.

Build/CMake:
- Android-aware cmake modules under platforms/android/.../cmake with
  CMAKE_MODULE_PATH repointed at them (root desktop modules untouched)
- ryml::ryml alias, TOP_CMAKE_WAS_SOURCED, drop the fatal 3rdparty
  add_subdirectory; pcsx2 PCAP guard elseif(NOT ANDROID)
- git-sync-deps step for shaderc third_party (fetch-on-demand, not
  submodules); android .gitignore for keystores/artifacts/shaderc deps
- dual-core rotation-signed build scripts (release APK + Play AAB)

Core reconciliation (APIs the native lib expects):
- GS present-cap/frameskip, Adreno framebuffer-fetch GSOption round-trip
- SPU2 channel swap + output-pause suppression
- Achievements JSON, VMManager autosave slot, WindowInfo::Android
- FileSystem SAF hooks, custom Vulkan driver path, BIOS-from-fd
- Oboe audio stream, EGL native-window, Linux/Android source guards

refresh-experimental fixes layered onto the shared recompiler/GS:
- IOP direct block chaining (aR3000A, gated s_iopBlockLinkEnabled,
  default off so behaviour is byte-identical until enabled)
- COP2 CO-bit macro-mode gate (aVU_Macro)
- EE mixed-operand constant folding
- Adreno GL coherent depth feedback via gl_LastFragDepthARM, gated to the
  Adreno GPU profile (inert on every other GPU)
- Android GPU gates: GPU-profile shader-header keystone, FIFO_RELAXED
  present mode, Mali coherent readback, Adreno-650 boot-crash gates,
  ROAA VK_ARM alias
2026-07-08 21:46:23 -04:00
Brian DegenhardtandClaude Opus 4.8 2bd014f27b common: read CNTVCT_EL0 directly for GetCPUTicks on AArch64 Linux
An SD865 profile of SotC (locked 60, Release, MTVU) shows
__kernel_clock_gettime at 4.1% of the EE thread - the largest non-JIT
symbol. GetCPUTicks() went through the vDSO (function call + seqlock +
isb + ns conversion) on every read, and the framelimiter's
frame-boundary spin in VMManager::Internal::Throttle() calls it tens of
thousands of times per frame.

Read the architected virtual counter directly instead: CNTVCT_EL0 ticks
at CNTFRQ_EL0 (19.2MHz on SD865, 24MHz on Apple M2), is monotonic and
consistent across cores, and is exactly what the vDSO reads underneath.
Measured 1.24ns vs 13.39ns per call (10.8x) on M2/Asahi.
GetTickFrequency() now returns CNTFRQ_EL0 so every freq-relative
consumer is unaffected. Resolution drops from 1ns to ~52ns, ample for
frame pacing and the sub-ms throttle spin. This mirrors a bare-mrs
pattern used elsewhere for GS counters.

Caller audit for the tick-unit change (only one thing assumed
nanoseconds):

- VMManager::Throttle, GSDumpReplayer, GSDevice present throttle,
  PerformanceMetrics, HostSys spin calibration: all convert through
  GetTickFrequency() - unaffected. (HostSys's "time > 100" calibration
  threshold now means 100 counter ticks, ~5.2us; the doubling loop just
  runs slightly longer.)
- Threading::SleepUntil (Linux) built an absolute CLOCK_MONOTONIC
  timespec directly from the tick value, which breaks with raw counter
  ticks (different epoch). Rewritten as a relative sleep off the
  remaining delta with an early-wakeup retry loop, matching the
  Windows/Darwin implementations.
- common/Perf.cpp jitdump timestamps use their own clock_gettime and
  must stay in perf's clock domain - untouched.
- Common::Timer is a separate clock domain, never mixed with
  GetCPUTicks values - untouched.
- GSRendererSW/GSFunctionMap LOG-gated dev stats print raw ticks -
  compile-time disabled dev code, freq-relative where it matters.

x86 Linux and Darwin (already on mach_absolute_time) are unchanged.

Validated: recompiler_tests 1083/1083 green; standalone check on
M2/Asahi shows 0 monotonicity violations over 10M reads, 0.0002% error
vs CLOCK_MONOTONIC over 500ms, SleepUntil overshoot ~60us (normal
nanosleep wakeup latency) and instant return for past targets.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-03 11:45:16 -07:00
b884f93dd7 arm64: build infrastructure, perf counters, and JIT perf-dump plumbing
CMake/preset wiring for the ARM64 target, the vixl C++20 enum-conversion warning
suppression, PmuCounters (cycle/instret PMU reads), and the Perf jitdump dir/enable
controls (EmuConfig.Profiler.EnablePerfDump, redirected out of /tmp into the cache
dir). Plus small platform/build fixes (ALSA thread naming, SmallString, X11 guards,
ARM MIDR CPU-name fallback, gcc lambda decay). The ARCH_ARM64 status banner now
reflects that EE/IOP/VU recompilers are all implemented.

Co-Authored-By: Ryan Walklin <ryan@testtoast.com>
Co-Authored-By: Brian Degenhardt <bmd@bmdhacks.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-20 20:27:55 -07:00
SternXD d983b2b066 Copyright: Change year from 2002-2025 to 2002-2026 2026-01-15 00:22:32 +01:00
lightningterror f6e0d1d368 common-linux: Fix -Wformat warnings. 2025-04-30 22:43:23 +02:00
lightningterror 003452fbbb common-linux: Try to read cached/buffered memory using MemAvailable.
Add two fallbacks if MemAvailable isn't available:
1. Add manual approximation/Linux-like heuristic fallback.
2. Add sysinfo if manual approximation fails.
2025-04-22 10:00:11 +02:00
lightningterror 842190e15e CDVD: Adjust ram requirements when precaching on linux/Mac. 2025-04-19 13:41:41 +02:00
Ty e252cb6643 HostSys: Implement platform Specific mouse lock osx/windows/x11 2025-02-19 11:18:17 -05:00
TheLastRar de9d08075e Misc: Don't use deprecated fmt/core.h header 2025-01-17 04:35:29 +01:00
spixi a5e4274cd2 common: Add support for MATE Desktop. (#12174)
This extends the screensaver inhibition function to MATE Desktop,
2025-01-09 15:07:09 +01:00
GovanifY 132431b7c8 headers: relicense to GPL-3.0+
also update to 2024 while i'm at it
2024-07-30 17:17:13 -04:00
Stenzek d48f527d6d Common: Tidy up signal handlers
Move MacOS into its own file.
Fix assertion failure crash dumping.
2024-05-31 13:39:36 +10:00
Stenzek c7a21a60cf GS: Improve vsync mode selection
All games use mailbox/triple buffering. Except when you enable sync to
host refresh, in which case FIFO/double buffering is used.

This means vsync enabled will ever tear, but at the same time, never
drop to 30fps on a missed frame due to frame rate differences.

To have the "best of both worlds", you should enable vsync and sync to
host refresh. Previously, this resulted in additional input lag, since
the host vsync would drive the EE frame timing. Now, this behaviour is
disabled by default, unless you enable "Use Host VSync Timing".
2024-05-25 14:06:50 +10:00
Stenzek 85a33971e7 Misc: Add gstreamer fallback to aplay 2024-04-26 20:30:16 +10:00
Ty Lamontagne 46e039dab2 VMManager: Log power profile and GPUs on startup 2024-03-07 01:21:28 +00:00
Stenzek 59d29b3648 Common: Rename General to HostSys
Actually fits what it's doing.
2023-12-27 13:55:35 +10:00
Stenzek d9abe10308 Misc: Remove explicit PCH include, switch to SPDX 2023-12-24 14:03:14 +10:00
Stenzek bd54729257 CMake: Simplify X11 dependencies 2023-09-16 19:32:13 +10:00
charlesthobe 85d2ca626f Common: Linux: fix potentially unsafe screensaver inhibitor 2023-07-17 20:11:32 +10:00
Stenzek 8a8e6c5d20 Common: Purge CPU frequency measurement
It's not accurate, and we can query the registry for the TSC frequency
for thread timers.

Also replaces InitCPUTicks() with a global constructor.
2023-06-16 18:26:28 +10:00
CharlesThobe 7aff4ee4cb Misc: Minor cleanup 2023-05-04 14:39:14 +01:00
CharlesThobe 9de152b8ee Linux: implement DBus screensaver inhibitor 2023-04-30 19:18:53 +01:00