Commit Graph
135 Commits
Author SHA1 Message Date
J1coding 915e914ba6 GS: let a hack the player picked outrank the game database
Right now changing one sprite hack is all or nothing. With manual hacks off,
MaskUserHacks wipes whatever the player set and the game database writes its own
value on top, so for the 227 games that carry alignSprite the toggle does nothing
in either direction while the settings screen still shows the player's value.
Turning manual hacks on to get around that throws away every other automatic fix
the game had, which tends to trade one glitch for a different one.

So let a single hack be claimed instead. GSOptions carries a bitmask of the ones
the player set on purpose. MaskUserHacks leaves those alone and clears the rest
as before, and applyGSHardwareFixes skips a claimed fix down the same path it
already uses for manual mode, so it still gets named in the warning and every
other database fix for the game is applied normally.

The mask sits outside the bitfield union deliberately. That packing is what
OptionsAreEqual compares wholesale, and this is not a hack value, it is who owns
one. It gets its own comparison so that claiming or releasing a hack counts as a
settings change even when no value moved with it.

MaskUpscalingHacks does not honour the mask. Below 2x the renderer skips these
regardless, so keeping one set there would only leave GSConfig and the settings
overlay claiming something that never runs.

The warning text now depends on which of the two cases fired, since blaming
manual mode when someone only claimed one hack would be wrong.

Nothing sets a bit yet, so behaviour is unchanged until a frontend does.
2026-07-29 20:18:58 +02:00
Brian Degenhardt e2474e14b9 GameDB: stop discarding a HWDownloadMode of Asynchronous
The GSHWFixId::HWDownloadMode apply path range-checks the raw wire value with
`value > Enabled && value <= Disabled`. Asynchronous (5) was appended after
Disabled (4) for ini/GameDB wire compatibility, so an entry asking for it was
accepted by the parser and then silently dropped here -- no diagnostic, no
fallback, the game just kept the default.

Bound the check at the last enumerator instead, and say in the comment that
this is a range check over the wire value rather than the accuracy ordering
Config.h forbids comparing on, so the next append updates it.

Twin of the VMManager.cpp warning fixed in 8a161bddc5, which was the same enum
tripping the same way.
2026-07-26 15:01:08 -07:00
Brian Degenhardt 44e950e7d5 GS: expose render-pass coalescing in the settings UI and GameDB
Coalescing has only been reachable by hand-editing the INI. It needs to be
switchable per game, because whether it is worth anything depends entirely on
the title: it pays off when a game alternates between two render targets, and
does nothing at all otherwise.

Add the GameDB key coalesceRenderPasses, so a game that benefits can turn it on
by itself, and a checkbox in Graphics > Advanced plus a Full Screen UI toggle
next to the other driver-level GS options, so it can be tried on anything.

It classifies as a user-hack fix, which means enabling Manual Hardware Renderer
Fixes turns it back off - the usual escape hatch, and worth having while this is
new. Note the consequence for A/B testing: GameDB is applied after settings are
loaded, so for a game carrying the key, -set cannot switch it off.
2026-07-25 18:17:16 -07:00
jpolo1224 6a1e12a3c3 GameDB: apply per-game hardware download mode; default Dirge to no-readbacks
hwDownloadMode was parsed as an invalid GS HW fix and dropped, silently
ignoring the entries that used it. Make it a real fix that sets HWDownloadMode,
applied as a default only so a player's own Hardware Download Mode still wins.
Dirge of Cerberus (all regions) now ships with no-readbacks, holding full speed
on GPU-bound devices.
2026-07-22 15:39:39 -04:00
Brian Degenhardt 5dd362bc94 Merge remote-tracking branch 'yaps2/main' into jit-transplant 2026-07-20 12:51:28 -07:00
Brian DegenhardtandClaude 37bc5e1646 ee/fpu: make add/sub guard-bit emulation unconditional
The fpuGuardedAddSub Recompiler option (and its GameDB
clampModes.guardedAddSub override) is gone; both JITs now always mask
the smaller-exponent operand's guard bits on the single-precision
ADD/SUB fast path, matching the Full-mode DOUBLE path's unconditional
guard. Games like True Crime NYC and Jak 3 misrender without the
masking, and per-game flagging proved impractical to maintain — the
failures take cross-build diffing to even attribute. The |exp diff|<=1
early-out keeps the common case at a plain op.

Test-side, EnableFpuGuarded() is removed (the masked behavior is now
the default the guard-bit suite pins directly) and the
DefaultOffEmitsPlainOpMatchingInterp test goes away with the option.
recompiler_tests: 1389/1389 green.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-20 00:22:24 -07:00
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
Brian DegenhardtandClaude Opus 4.8 843a00c7ca EE FPU: gate add/sub guard-bit emulation behind an off-by-default option
The single-precision FPU add/sub guard-bit emulation (fpuEmitGuardedAddSub on
arm64, FPU_ADD/FPU_SUB on x86) was applied unconditionally, matching x86's
compile-time FPU_CORRECT_ADD_SUB=1. A SotC census measured it at ~4.4% of all
EE-emitted code — a per-op deviation vs AetherSX2 (PCSX2 v1.0 base), which emits
a plain fadd + result clamp and has no guard-bit path. The masking is a ~1 ULP
accuracy effect only observable on cancelling add/sub; most titles never need it.

Make it opt-in via a new Recompiler option, fpuGuardedAddSub, off by default:

- Config.h: new RecompilerOptions bit + CHECK_FPU_GUARDED macro.
- Pcsx2Config.cpp: INI load/save (EmuCore/CPU/Recompiler); default off.
- GameDatabase: per-game override via clampModes.guardedAddSub (std::optional).
- Both JITs gate the single-precision masking on CHECK_FPU_GUARDED so they stay
  behaviorally identical under one config (x86 stays the correctness oracle); the
  x86 plain path was already present as dead else-code. The Full-mode DOUBLE path
  keeps its own unconditional guard on both arches (iFPUd), so eeClampMode 3
  titles are unaffected. Decoupled from the Extra/Full clamp tiers by request.

Off by default means the common path now emits a plain fadd/fsub, which also
makes the JIT bit-identical to the single-precision interpreter there (interp
never masked) — one fewer JIT-vs-interp divergence at the default config.

Tests: harness EnableFpuGuarded() (mirrors EnableFpuFullMode); the guard-bit
tests and the two FCR31-clobber CompareSurvivesInterposedGuardedAdd tests opt in;
new DefaultOffEmitsPlainOpMatchingInterp pins the off-by-default plain path via
Run()'s JIT-vs-interp auto-diff. Full suite 1284/1284.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-16 14:51:27 -07:00
jpolo1224 ecfebfd6b2 Android: bring unified core to refresh-experimental parity
Vulkan render fixes (GS device backends), Oboe audio backend, GameDB armsx2_overrides.yaml override loader, EE+VU mac-port recompiler graft, PGO=optimize, and the VU-slam fix: an Android-only force-float in VMManager::SetEmuThreadAffinities (the slam was thread pinning locking the VU1 worker off the prime core, not the VU codegen). Also: CPU-name SoC-property fallback, Mali VK attachment-feedback-loop crash gate, MediaTek fbfetch disable, and on-device thread-placement diagnostic helpers.

The recompiler grafts and GS deltas are unguarded and land in the shared core (they reach the mac/Linux arm64 builds) - see REFACTOR_STATUS.md items 2 and 3 for the reconciliation this still needs; the VU graft is reducible to just the force-float fix.
2026-07-10 11:16:31 -04:00
Silent 78d0cf4a4f YAML: Add support for resolving anchors, and use it for GameDB 2026-07-09 15:53:38 -04:00
JordanTheToaster d09ce46700 GameDB: Add AA1 rec to the DB 2026-06-26 10:35:51 +02:00
JordanTheToaster 3afc1c2663 GameDB: Add AAT rec to the DB 2026-06-26 10:35:51 +02:00
refractionpcsx2 1fa3c6aa4a GS: Move new Draw Buffering to a UI option 2026-04-17 21:13:30 +02:00
chaoticgd 0beb18c9e1 Deps: Update rapidyaml to v0.11.1 2026-04-03 12:41:47 -04:00
JordanTheToaster 2be34a6938 ImGui/GameDB: Add accurate alpha test 2026-03-20 12:54:00 +01:00
JordanTheToaster 497dc14d11 GS/HW: Add Limit 24 Bit Depth fix to db 2026-03-17 16:13:08 +01:00
KamFretoZ 7ea5234049 OSD: Make Recommended Blending Accuracy Translatable 2026-03-12 18:35:17 +01:00
Mrlinkwii 9acadb21fe GameDB: remove left over schemea options 2026-01-30 18:06:02 +01:00
SternXD d983b2b066 Copyright: Change year from 2002-2025 to 2002-2026 2026-01-15 00:22:32 +01:00
KamFretoZ 213569f3d7 Deps: Remove version number from fontawesome 2026-01-12 12:05:17 +01:00
chaoticgd 0ce312c1c3 GameDB: Fix infinite loops caused by UB when YAML parsing fails 2025-10-30 14:02:55 -04:00
Silent 815d7b2967 rapidyaml: c4 namespace is an implementation detail, use ryml instead 2025-08-09 18:34:16 -04:00
TheLastRarandKamFretoZ 888e024d0c 3rdparty: Update FontAwesome to 6.7.2
Co-Authored-By: KamFretoZ <14798312+kamfretoz@users.noreply.github.com>
2025-07-05 20:01:42 -05:00
TheTechnician27 23fd57f641 Copyright: Change year from 2002-2024 to 2002-2025 2025-01-20 05:07:26 +01:00
TheLastRar de9d08075e Misc: Don't use deprecated fmt/core.h header 2025-01-17 04:35:29 +01:00