Commit Graph
16 Commits
Author SHA1 Message Date
Brian Degenhardt 7f0ae7a6c6 GameDB: internal FPS by DISPFB blit for NASCAR Thunder 2002 through NASCAR 06
The register-write detector reads these engines as producing a new image every
vblank, so duplicate-frame skipping never fires and every repeat pays for a full
present. Counting blits into the displayed framebuffer restores it.

Reported-by: yuasasa
2026-08-18 20:04:16 -07:00
Brian Degenhardt 0daaf5a6f7 GameDB overlay: stop erasing upstream fixes the overlay never meant to drop
The mobile overlay layers onto bin/resources/GameIndex.yaml, and the loader
clears-then-replaces each map rather than merging: an entry that lists one
gsHWFix erases every other fix upstream sets for that serial. The file header
states the invariant - each entry must carry the complete block - but nothing
enforces it and nothing warns when it is broken. 115 serials were silently
dropping at least one upstream fix.

The bulk of it is one generation defect, not sync drift. Android used to carry
a forked copy of the GameDB; 54f0f8ba91 generated this overlay by diffing that
stale copy against bin and treating every difference as an intentional
override. Where the stale copy merely lacked a fix, the generator promoted the
absence into a deliberate-looking one, and the replace semantics then erased
the upstream value at runtime. Nothing upstream added after generation is
involved: every fix upstream sets today it already set on 2026-07-22.

Three changes here.

drawBuffering restored on 63 serials. All of them are entries the stale copy
also lacked, so the class has a single cause and no residue; before this,
exactly one overlay entry carried the key at all. It is a pure performance fix
lost on the tier that needs it most. Measured on NFS Underground 2 (SLUS-21065),
GS-dump replay on the SD865 at 2x, fan pinned, 3 interleaved reps per arm with
disjoint ranges:

               draws/frame  passes  RT copies  frame ms
  as shipped          6250    2640       2630      29.1
  + drawBuffering     3559    1633       1623      18.9

-35% frame time, 1.55x, and visually free: deterministic in both arms with
0.12% of pixels differing by 2/255 or less.

Delta Force: Black Hawk Down (SLUS-21124, SLES-53299) restated complete. That
entry listed hwDownloadMode alone and thereby erased upstream's autoFlush,
halfPixelOffset, textureInsideRT and nativeScaling - the bloom, sky-bloom and
post-processing fixes. Both commit messages behind it describe only an
addition, and the entry is hand-appended above the sorted body, so this was an
accident rather than a decision. It keeps its out-of-sorted position; moving it
risks a future regeneration adding a second SLUS-21124 in the sorted slot.

Valkyrie Profile 2 (11 serials) keeps its configuration and regains the comment
explaining it. Upstream's halfPixelOffset:4 with nativeScaling:2 blows out the
render target when upscaling on Adreno and Mali; only nativeScaling:1 with
roundSprite:1 renders cleanly, so the drop is the point. The original entry
said so in an 8-line comment that 54f0f8ba91 stripped when it re-sorted the
file, which is why the entry has read as unexplained collateral since. The
intent was never lost, only the record of it - so the rationale now lives next
to the entry, where a regeneration cannot separate them, and it warns that an
audit will flag it.

57 entries still drop some other upstream fix and are deliberately untouched.
That residue is a mix of causes and needs per-fix judgement: the 7
preloadFrameData removals are the Rogue Galaxy see-through-wall fix and must
stay dropped, 10 more are advisory-only keys that change no setting, and the
cpuSpriteRender and minimumBlendingLevel drops would cost performance on this
exact tier if restored. drawBuffering was the one class safe to restore
wholesale.

Audit re-run clean: no serial drops drawBuffering, none sets it where upstream
does not, and no other fix class was touched.
2026-08-09 15:13:46 -07:00
Brian Degenhardt d08356d954 GameDB: give Rogue Galaxy the asynchronous GS download mode
Rogue Galaxy blocks the GS thread 7.5 ms every frame to read back sixty-four
pixels. It is an 8x8 patch of the depth buffer at a fixed screen position, read
once a frame -- a depth occlusion probe, the test a game does before deciding
whether to draw a lens flare. The cost is entirely GPU-fence synchronisation, so
it does not scale with the payload: the emulator submits, waits for the GPU to
finish, and reads 256 bytes.

The asynchronous download mode issues the same copy into a throwaway staging
texture and retires it at a later vsync, so the GS thread never waits. Measured
on the M2 by timing the readback directly rather than the frame, which keeps the
number clear of the gsrunner -perf perturbation: 7.2-7.8 ms becomes 0.005-0.008
ms. On a 45 ms frame that stall was around a fifth of the time.

It is not the blunt option. NoReadbacks and Unsynchronized, which this overlay
already ships for other titles, either skip the readback or race it. Async does
the real download and merely serves it a frame late, and it drops a late result
outright when an EE upload or a local-to-local move has since claimed those
pages, so stale data cannot overwrite newer contents.

Output is unchanged on every frame we can compare: four captured scenes, thirty
two colour frames, all pixel-identical, each scored against three baseline runs
of the unmodified binary first so run-to-run dump nondeterminism could not be
read as a result.

What that evidence cannot cover is motion. A frame-old occlusion probe differs
from a fresh one exactly when the probe's answer changes, which needs the camera
or the light to move, and every capture we hold is near-static. The visible
failure would be a lens flare blinking a frame late as it passes behind
scenery. That is the thing to watch for in play, and reverting is a one-line
change if anyone sees it.

Seven serials, every Rogue Galaxy entry the overlay carries, including the three
Japanese ones -- SCPS-15102, SCPS-17013 and SCPS-19254 are the same game under
its Japanese title.

OutRun 2006 is the only other title of the eight we profile that reads back at
all, three times a frame for 3.3-4.2 ms, and it is deliberately not included
here. Its readbacks are small colour buffers rather than depth, and there is an
open unexplained brightness bug in that game; feeding frame-old data into what
may be an adaptive-exposure loop is not something to do before understanding it.
2026-08-02 17:55:38 -07:00
Brian Degenhardt bf65e8604b GameDB: drop autoFlush on Rogue Galaxy — a deliberate speed/accuracy trade
Rogue Galaxy is the slowest title we track on handhelds and users report it as
such. Turning autoFlush off is the largest lever we have found for it: render
passes -38%, texture copies -74%. On the Adreno 610, which has no headroom, that
is -1.82 ms/frame and +2.6 fps. On the Adreno 650 it is -1.67 ms banked as
headroom, both arms already at 100% speed.

This is not free and should not be recorded as if it were. The software
renderer, an exact per-pixel GS model and an independent oracle here because
AutoFlushSW is a separate setting, scores level 0 3.4x further from truth than
level 2 on the contested pixels (mean error 9.436 vs 2.808; level 2 is closer on
17312 of 22424). What degrades is the light a lamp contributes to nearby lit
surfaces, so chests, blades and floors read slightly bright and warm. The glow
cones themselves are pixel-identical.

It is taken because the error is imperceptible in practice: bounded at 21-23/255
in all three captured scenes, diffuse rather than a missing object, and four
independent side-by-side looks at 1:1 failed to distinguish the two. Revert to
level 1 -- not 2 -- if anyone reports a regression: level 1 is pixel- and
cost-identical to 2 on Rogue Galaxy at 1x, 3x and 6x, and since 381bc41ded it is
also worth -5.8% of GS-thread cycles because it moves the game's non-sprite prims
onto the direct vertex kick. Level 2 buys nothing measurable over level 1 here.

Seven serials, which is every Rogue Galaxy entry the overlay carries. The Korean
release is SCKA-30005 and upstream gives it no gsHWFixes at all, so it is absent
here too rather than newly missed.

⚠ SLKA-25372 is Black, not Rogue Galaxy -- it is Criterion's Burnout engine,
which is why it carries OI_BurnoutGames. An earlier working copy had it in the
Rogue Galaxy set and flipped it to 0; it stays at 2.
2026-07-30 21:55:58 -07:00
jpolo1224 9d735f9ccb GameDB: no readbacks for Need for Speed Underground 1 & 2 2026-07-30 18:20:12 -04:00
jpolo1224 3cb1e88029 Merge remote-tracking branch 'origin/master' into jit-android-catchup-gv7
# Conflicts:
#	tests/ctest/core/gs/CMakeLists.txt
2026-07-30 01:10:19 -04:00
jpolo1224 15538d066d GameDB: no readbacks for Guitar Hero II and III
The note-highway render target is never sampled back, so the GPU->CPU download is
pure cost on a tiler. Covers GH2 (SLES-54442, SLUS-21447 — the latter is also the
serial GH2 Deluxe ships under) and GH3 (SLES-54962, SLES-54974, SLKA-25363,
SLKA-25414, SLUS-21672).

gsHWFixes is a clear-then-replace map in this overlay, so each GH3 entry restates
every upstream key. Dropping one would have silently undone the crowd-texture,
bloom and post-processing fixes those entries already carry.
2026-07-30 01:08:39 -04:00
Brian Degenhardt a8c5521c66 GameDB: Rogue Galaxy no longer preloads frame data
preloadFrameData primes every newly created render target from the game's
GS local memory. Where the frame's geometry doesn't cover the target, those
preloaded pixels stay visible: in the church interior the outdoor town shows
through the rear wall, washed out and semi-transparent. Bisected on a
Snapdragon 865 with the other six fixes held either way — the artifact
tracks preloadFrameData alone, and the three alignment fixes are innocent.

Upstream added it in f5570b7f40 next to roundSprite, and that commit
message justifies only roundSprite; the preload line came with no stated
reason beyond "Fixes corrupt textures especially on water". Dragon Quest
VIII and Dark Cloud 2 run the same Level-5 engine and share this title's
roundSprite, halfPixelOffset and nativeScaling values, but neither enables
the preload — both handle their water and sprite errors with CPU sprite
rendering. So if the water corruption does resurface, that targeted pair is
the replacement rather than this.

Dropped from all seven serials. The remaining six fixes are restated because
an override replaces the fixes map wholesale; names, compat and kozarovv's
out-of-bounds patches still inherit from bin.
2026-07-29 20:28:41 -07:00
J1coding d4296f9fd3 iOS: repair the dead guard tests and stop two UI-thread config writes
Three follow-ups from the graphics live-apply work.

The two iOS guard tests had been failing with FileNotFoundError since the core
moved out of platforms/ios -- both still pointed at app/src/main/cpp/pcsx2 and
app/src/main/assets. Dead tests read as coverage, so repoint them.

Repointing the True Crime one turned up a real regression. It guards
"mvuFlag: 0 # Fixes texture flickering caused by the VU Flag Hack" on the six
New York City serials, and that fix is gone: the iOS build used to bundle its own
GameIndex.yaml carrying it, and when we converged on the overlay only the
gameFixes came across. The speedHack has been missing ever since, unnoticed
because the test that would have caught it broke in the same move. Restored in
the overlay, which is where our GameDB changes live now, and the test follows it
there.

The renderer picker stayed live with a game loaded. Returning to the menu only
pauses the VM, so you could switch renderer, change any other graphics setting,
and have the next apply take GSUpdateConfig down the reopen path -- a full Metal
teardown under a loaded game. The picker already said "Requires restart"; now it
means it.

applyOsdPreset and setPerformanceOverlayVisible wrote GSConfig and EmuConfig.GS
from the UI thread. Those flags are bitfield members sharing storage with the GS
device-restart flags, so a read-modify-write off-thread can write back a stale
neighbour and flip RestartOptionsAreEqual -- the same teardown, from a stats
toggle. Both compute their values up front and hand the writes to the CPU thread.
isPerformanceOverlayVisible reads the INI now rather than GSConfig, which the
setter no longer updates synchronously.
2026-07-26 15:47:05 +02:00
jpolo1224 589852a23e GameDB: Dirge of Cerberus no longer needs hardware readbacks disabled
Render-pass coalescing (Brian Degenhardt) carries the cost the readback
workaround was compensating for, so drop hwDownloadMode from all six regional
serials and let them run with readbacks on. coalesceRenderPasses stays.
2026-07-26 02:02:10 -04:00
Brian Degenhardt b9504ac752 GameDB: enable render-pass coalescing for Dirge of Cerberus
Dirge alternates 1:1 between a colour target and a mask target for most of the
frame, which is the exact pattern the scheduler exists for. On a four-frame
capture it takes the frame from 8035 render passes to 523, with every frame hash
identical to the unscheduled path, and on an Adreno 650 handheld the difference
is plainly visible.

All six regional serials get it. This goes in the mobile overlay rather than the
canonical GameIndex, because it is worth nothing on a desktop GPU where a pass
boundary is cheap - the overlay ships on Android, iOS and ARM64 Linux handhelds,
which is exactly the set of targets that pay for tile load and store.
2026-07-25 18:17:24 -07:00
jpolo1224 069f8a44f3 Android 2.6.5.1: Local Link LAN play, async GS readback, pause/rotation/settings fixes
Crash and correctness
- Fix a crash when backgrounding the app mid-game: onPause flushed the Vulkan
  pipeline cache from the UI thread while the GS thread was creating pipelines
  into the same VkPipelineCache. Vulkan requires that handle to be externally
  synchronised, so this was a driver-level data race and crashed on Adreno and
  Xclipse alike. The flush now runs on the GS thread, posted via the CPU thread
  so it does not race the EE-owned MTGS ring.
- Fix an unbounded out-of-bounds vertex read in the GSRendererHW sprite-merge
  paving path: the inner loop advanced i instead of j, so j stayed loop-invariant
  and the scan walked past m_vertex->tail.
- Fix per-game settings being silently ignored: gamesettings/<serial>_<CRC>.ini
  loads into a higher-priority layer than anything the app writes, and saves made
  from the library never regenerated it, so any key already in that file
  overrode the user permanently. Only the category-Reset path rewrote it, which
  is why Reset appeared to be the only thing that worked.
- Fix screen rotation: the BIOS followed the launcher rotation instead of the
  renderer's (it has no GameInfo, and the tier was keyed on that), and the
  launcher stayed locked in a game's orientation after exit because the cleanup
  lived only inside stop()'s vmRunLoopActive-guarded branch, which loses a race
  against the VM thread's own finally. Rotation tier is now an explicit flag and
  the cleanup runs on every terminal path.
- Discard the Vulkan pipeline blob whenever the SPIR-V cache is discarded. It was
  validated only against the device header (vendor/device/pipelineCacheUUID),
  which is identical across an app update, so a SHADER_CACHE_VERSION bump kept
  every pipeline built from the old shaders and nothing pruned it.
- Make eeRecExitRequested atomic: it was a plain bool written from the JNI thread
  and read on the CPU thread.
- OpenGL: restore GL_PACK_ALIGNMENT after readback, add the missing memory
  barrier after the CAS dispatch, and initialise GLState::depth_mask to GL's
  actual default.
- DEV9: log the GetNetAdapter default: bail and the InitNet skip. Both returned
  silently, so a settings mistake surfaced as missing hardware three layers away.

Local Link (new)
- New DEV9 backend bridging emulated PS2 Ethernet between devices over
  authenticated local UDP, so games with a built-in LAN / System Link mode can
  play together. Ported from EmuCoreX (sashkinbro) with the wire format
  unchanged, so peers remain compatible across both forks.
- Network mode picker (Online / Host / Join), host address readout, auto-derived
  peer ids, generated room codes, hostname support alongside numeric IPv4, and a
  link to the supported-games list. Fully controller-navigable.

Performance
- Asynchronous hardware download mode (experimental, opt-in): non-blocking
  GPU->CPU readback so the EE thread no longer waits on the GS thread. Ported
  from EmuCoreX. Appending Asynchronous to GSHardwareDownloadMode makes the enum
  non-ordered, so the relational comparisons on it are replaced with
  IsHardwareDownloadReadbackEnabled / IsHardwareDownloadEEThreadRead.
- Affinity Control Mode (experimental, opt-in): EE/VU/GS priority orders plus a
  Performance Cores mode. Android otherwise leaves these threads unpinned.
- Raise the texture-replacement cache ceiling from 6 to 16 GB; RAM/2 remains the
  real limiter, so this only binds at 12 GB RAM and up.
- Low Latency frame pacing is no longer the default, with a one-time migration
  for installs that took the earlier flip.

Features
- Auto renderer resolves to Vulkan HW on Adreno.
- Auto Progressive Scan (per-game): holds Triangle+Cross through boot.
- OLED black as a modifier over any accent colour, including Custom and RGB.
- Optional system keyboard instead of the built-in on-screen one.

Game compatibility
- Everybody's Golf 4 / Hot Shots Golf Fore! hwDownloadMode across all regions
  (PR #421, XDarkFallenX).
- Delta Force: Black Hawk Down (PR #401, XDarkFallenX).
- Reduced input latency and input handling improvements (PR #403, Splaser).

RetroAchievements
- Inject the client version from a build-time secret kept out of public source,
  with a stock-PCSX2 fallback for secret-less builds, so third parties cannot
  copy the client identity. Covers the iOS token too.
2026-07-25 00:48:56 -04:00
jpolo1224 8e23439b26 Android 2.6.5: Adreno Vulkan default, low-latency default, UI sounds, RA client hardening, GameDB
Rendering
- Auto renderer now resolves to Vulkan HW on Adreno (OpenGL elsewhere).
- Mobile hardware ROV (Phase 0): tile-native depth feedback behind the ROV toggle.

Performance & input
- Low Latency frame pacing is the default on capable devices, with a one-time
  migration for existing installs; low-end devices keep the queued pacing.
- Reduce Android input latency and improve input handling (PR #403, Splaser).
- Experimental CPU clock hint (ADPF) toggle in Performance settings (default off).

Audio & UI
- Pop-up open/close sound cues (info, hardcore confirm, patches & cheats).
- Alternating controller navigation / slider tick sounds.

RetroAchievements
- Inject the RA client version from a build-time secret kept out of public source,
  with a stock-PCSX2 fallback (no hardcore) for secret-less builds. Applies to the
  iOS client token too. Prevents third parties from copying our User-Agent.

Game compatibility
- Delta Force: Black Hawk Down (SLUS-21124 / SLES-53299) GameDB fixes
  (PR #401, XDarkFallenX).
2026-07-24 02:40:17 -04:00
XForYouX 6cdb8fd90c GameDB-Android : Fixes Sun Effect To Rumble Racing 2026-07-24 03:50:47 +07:00
Brian Degenhardt 7bfe6a44a1 gamedb-overlay: let SLPM-74405 inherit InstantDMAHack from bin
The mobile GameDB base predated upstream PCSX2's addition of InstantDMAHack
("Stops hang when entering Sword Select screen") to Samurai: Complete Edition
and never resynced, so the Android/iOS copies carried EETimingHack alone. The
generated overlay faithfully reproduced that stale state, which the override
loader's clear-then-replace on gameFixes would re-inflict on mobile/ARM64-Linux.

The drop was never intentional (no commit in the Android line ever touched this
entry's fixes; the fix is an arch-neutral DMA-timing hang fix). Remove the
overlay entry so the mobile tiers inherit bin's full [EETimingHack,
InstantDMAHack].
2026-07-22 21:16:45 -07:00
Brian Degenhardt 54f0f8ba91 resources: add the canonical mobile GameDB overlay
Introduce bin/resources-overlay/armsx2_overrides.yaml as the single source of
truth for mobile-tier GameDB deltas, replacing the three independently-drifting
copies (Android's committed GameIndex.yaml + its 124-line runtime overrides, and
iOS's GameIndex[override].yaml). It is deliberately kept OUT of bin/resources/
so the desktop GLOB_RECURSE copy never picks it up; it is layered only on the
tiler-GPU tiers.

Generated by diffing the Android GameIndex (field-merged with the former runtime
armsx2_overrides.yaml, the most-exercised mobile config) against the now-canonical
bin/resources/GameIndex.yaml, and carrying only the behavioral fields that
actually change emulation (gsHWFixes, clamp/round modes, gameFixes, speedHacks,
patches, memcardFilters). Game names/region/compat are intentionally NOT carried
so mobile inherits current upstream metadata rather than stale mobile copies.

The GameDatabase override loader already applies this file from EmuFolders::Resources
on every platform (initDatabase, is_override=true) and silently no-ops when it is
absent, so nothing but the build's copy step gates whether a given tier gets it.

Verified: loading bin + this overlay reproduces every one of Android's current
behavioral GameDB fields with zero losses and zero value changes. The only
differences from today's Android behavior are 37 additions across 36 serials
(accurateAlphaTest, Silent Hill / Flushed Away / GT4 fixes, etc.) that Android's
copy was simply stale on and now inherits from the upstream-tracked base — the
overlay mechanism cannot express a field-removal, and inheriting the newer
upstream value is the correct outcome for all of them.
2026-07-22 21:16:45 -07:00