Commit Graph
57 Commits
Author SHA1 Message Date
Henrik RydgårdandClaude Opus 5.5 eb59b00a37 GE dump playback: Ignore a second INIT in a dump
Before 71210f3fa2, a second dump request during a recording started it again, writing another
INIT (and initial CLUT) into the dump: the GE state of that moment, which already includes the
register writes the dump only has after it. Playback applied it, so the last draws ran with the
wrong state: GOD EATER BURST (13950) and GOD EATER 2 (6343) came out black and Street Riders
(14746) garbled. The recorder only writes an INIT when it starts, so skip any later one. The 15
such dumps in the GitHub issue set now match the PSP's replay, 10 of them exactly.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 18:37:32 +02:00
Henrik RydgårdandClaude Opus 5.5 a418514376 GE dump playback: Load the initial CLUT, and show the last framebuffer when the display is off
The recorder saves the CLUT the GE had loaded right after INIT, as a CLUT command with no
LOADCLUT to follow, unlike the CLUTs it records at a LOADCLUT. Playback only pointed the CLUT
address at it, so draws before the game's first LOADCLUT used whatever CLUT was loaded before:
HotBrain (16131, ULUS10268) drew its save screen background black. Load it, and put the game's
CLUT address back.

A dump whose last DISPLAY turns the display off (address 0), or has none, now shows the last
framebuffer drawn to (Auditorium 9213). The PSP replayer does both the same way.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 18:37:32 +02:00
Henrik RydgårdandClaude Opus 5.5 2317ecbfbd GE dump playback: Write recorded memory into the depth mirrors as the PSP does
A dump records a texture at a swizzled VRAM mirror as the game sampled
it, and the PSP's replayer writes it back with the CPU, which the PSP
sends through the depth layout at any access width. PPSSPP's playback
wrote it raw, so with depth stored in the GE's layout the texture came
back permuted: IL-2's depth texture at 0x04710000 and the two Gensou
Suikoden swizzle dumps. Texture copies, memcpys and memsets into a
mirror now go through the layout, 32 aligned bytes at a time. Against
PSP replays: both Suikoden dumps are now exact (from 1912 and 8083
pixels off), Star Wars #15832 is 67 off (from 2590) and IL-2 894 (from
70505, the rest from a write the next draw reads before it lands).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 18:37:30 +02:00
499cdd55ad Validate untrusted IDs before using them as directory names
Texture pack installs took the destination directory from the archive's
textures.ini, and PKG update installs from the PBOOT's DISC_ID, both
unchecked, so a crafted archive or package could write outside
PSP/TEXTURES or PSP/GAME. Add IsSafePathComponent() to PathUtil and check
both, replacing the WebServer's own upload filename check with it too.

DISC_ID from any PARAM.SFO also names configs, cheats, textures, exdata
and savestates, so ReadSFO now drops one that isn't a safe name and the
game gets a fake ID like homebrew. The same goes for a frame dump's ID.

Combines #22419 and #22420 by Acts1631.

Co-Authored-By: Acts1631 <acts1631kjv@proton.me>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-05 13:39:06 -06:00
Henrik RydgårdandClaude Opus 5.5 ab57dca598 GE dump playback: Restore the base after wrapping the list
The jump back to the start of the list buffer sets BASE to the buffer's,
but vertex and index addresses already queued for the next draw were made
for the previous one, so they pointed 16 MB away. Tiger Woods (ULUS10420)
read a skinned draw's indices as zeros and lost it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-02 15:09:43 -06:00
Henrik RydgårdandClaude Opus 5.5 80a03ead6a GE dump playback: Copy recorded buffers around what the replay drew
The software renderer has the real contents of what a replay drew, and a
recorded framebuffer texture can be stale or run over other buffers at its
recorded size. So a copy leaves out the areas the replay's draws could reach
(region and scissor, or the vertex bounds of a 2D draw), instead of skipping
it only when it starts at a drawn buffer:
- Princess Maker 5 textures from the right half of its 1024 wide
  framebuffer, and the copy blanked the whole frame.
- Rainbow Six (ULUS10206) copies its 512x512 frame texture, which covers its
  display buffer, before each strip it draws into that buffer.
- Burnout keeps a texture beside its frame in columns 480-511, which still
  comes through.
- Depth writes count as whole rows in 8-row bands, since the PSP stores
  depth swizzled (SOCOM UCUS98649's frame texture copy ran into its depth
  buffer's columns 480-511).
Copies also stop at the end of VRAM, and flush the software renderer's
queued draws before writing.

Memsets were also never applied with the software renderer, which leaves
them to the caller.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-02 15:09:43 -06:00
Henrik RydgårdandClaude Opus 5.5 b49fb11261 GE dump playback: Don't overwrite a buffer the replay drew to
With the software renderer, a FRAMEBUF texture snapshot of a framebuffer
this replay already rendered to is skipped: the dump's copy can be stale
(recorded on a hardware backend that never read it back), and it wiped the
frame in a GTA LCS dump (issue 18467's dump now matches the PSP exactly).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-02 15:09:43 -06:00
Henrik RydgårdandClaude Opus 5.5 2c5ff39238 Headless: Add --screenshot-render-target
Lets a dump replay stopped with --replay-end be compared against the PSP on
an offscreen buffer. The framebuffer commands after the draw limit are
dropped too, so it shows the buffer the last drawn primitive went to.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-02 15:09:42 -06:00
Henrik RydgårdandClaude Opus 5.5 3c450eed4b Headless: Add --depth-save and --replay-end for frame dump comparisons
--depth-save writes the depth buffer next to the screenshot (u32 width, u32
height, then u16 depths), and --replay-end stops a frame dump replay after
that many primitives. Both match pspautotests' ppdmp-playback, so a dump's
depth can be compared with the PSP's at any point in the frame.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-02 15:09:42 -06:00
Henrik Rydgård e9a3449ede More MIPSState * plumbing (manual) 2026-08-12 14:02:19 +02:00
Henrik Rydgård 0596ee97f6 More memory access cleanup 2026-08-11 20:14:01 +02:00
Henrik Rydgård 3fd9b42f95 Fix playback of framedumps for headless 2026-07-18 19:09:46 +02:00
Henrik Rydgård a317890c08 Remove the GPUDebugInterface class
Just a pointless extra layer in the class hiearchy, making it
unnecessarily hard to modify the interface.

Might as well hit GPUCommon directly.
2026-06-02 11:15:08 +02:00
Henrik Rydgård cdc3a19284 Fix exiting from framedump playback while paused inside a display list
Fixes #20304
2025-04-30 15:53:55 +02:00
Henrik Rydgård 4d215b1f54 Cleaner exit from when stepping through a frame dump 2025-04-07 16:34:17 +02:00
Henrik Rydgård 605daf879b Minor cleanup. Fix file handle leak when opening zip files from the main screen. 2025-04-07 15:42:51 +02:00
Henrik Rydgård 2cc631338b Correctly unload GE framedumps. Additionally, look up the title when possible and show in titlebar. 2025-03-06 14:58:33 +01:00
Henrik Rydgård 3ab625a0fa Windows: Lock when updating the window title 2025-03-06 14:24:40 +01:00
Henrik Rydgård 85c015efb8 Remove redundant shutdown callback 2025-02-13 15:13:25 -06:00
Henrik Rydgård 638607d29a Refactor: Make GPUCommon own the framedump "recorder". 2024-12-15 12:07:44 +01:00
Henrik Rydgård e3aaf93e28 Add a new log category 2024-12-10 10:34:26 +01:00
Henrik Rydgård 87e9bcdc09 Playback: Remove logging, improve locking, works now it seems 2024-12-10 01:27:25 +01:00
Henrik Rydgård 4befbeac7c Move the dump playback mips code to Playback.cpp. Assorted cleanup. 2024-12-10 01:27:25 +01:00
Henrik Rydgård f20266a089 Playback: Match the real sceGe functions better. 2024-12-10 01:27:25 +01:00
Henrik Rydgård 839df81852 thread solution: initial progress 2024-12-10 01:27:25 +01:00
Henrik Rydgård 8b706ba791 Break out a LoadReplay function 2024-12-10 01:27:25 +01:00
Henrik Rydgård 983ea69a57 Replay: Add some plumbing to propagate the Break status outwards 2024-12-10 01:27:25 +01:00
Henrik Rydgård 10445c97d8 Warning fix 2024-12-10 01:02:49 +01:00
Henrik Rydgård de3617529f const, rename a function 2024-12-10 01:01:31 +01:00
Henrik Rydgård a94431f4fa Remove an unnecessary wrapper function 2024-12-10 01:01:05 +01:00
Henrik Rydgård 474e7acf54 Hook up the new (bare-bones) ImGui debug window to GPU stepping, fix stepping. 2024-12-05 00:51:59 +01:00
Henrik Rydgård c25e6b3933 Add "Split syscall" mechanism 2024-12-05 00:05:39 +01:00
Henrik Rydgård e977906d75 Lift out running the display list to the callers.
This has one tricky case though...
2024-12-03 22:35:36 +01:00
Henrik Rydgård 0df2a40487 Remove the "GPUInterface" base class. Not really useful, GPUCommon is pretty much the same thing. 2024-12-02 11:12:14 +01:00
Henrik Rydgård e01ca5b057 Logging API change (refactor) (#19324)
* Rename LogType to Log

* Explicitly use the Log:: enum when logging. Allows for autocomplete when editing.

* Mac/ARM64 buildfix

* Do the same with the hle result log macros

* Rename the log names to mixed case while at it.

* iOS buildfix

* Qt buildfix attempt, ARM32 buildfix
2024-07-14 14:42:59 +02:00
Henrik Rydgård 8b99c9f9d9 GE dump playback: Don't flip unless DISPLAY is the last command. This messes up the frame structure. 2024-01-30 11:14:38 +01:00
Herman Semenov 309f0d97f2 [Common Data Net/Core Debugger HLE/GPU Debugger] Fixed reduction data type size to strict 32-bit integer 2023-12-14 19:26:10 +03:00
Unknown W. Brackets 6c2001d12d GE Debugger: Correct texture address corruption.
Happened when playing back frame dumps that set bufw after specifying the
texture address, but before drawing.

Seen in Syphon Filter.
2022-11-19 14:59:52 -08:00
Unknown W. Brackets 1ffdf0d5b8 GE Debugger: Respect unchanged VRAM each frame.
Oops, wasn't setting the version each run after caching the frame dump
data.
2022-11-01 22:56:29 -07:00
Unknown W. Brackets 55d5dc3834 GPU: Rename readback and buffer write operations.
Avoid download/upload and pack, which don't have clear directions.
2022-10-09 13:49:41 -07:00
Unknown W. Brackets 978fd9fc60 GE Debugger: Record the Edram translation value. 2022-10-01 23:48:06 -07:00
Unknown W. Brackets 7ff5434968 GE Debugger: Tag frame dump replay VRAM writes.
Just for debugging, it's helpful especially paired with softgpu tagging.
2022-09-23 21:20:14 -07:00
Unknown W. Brackets c3c5450b8f GE Debugger: Fix small tex/clut recopying.
If it's less than 256 bytes, we can't mark the entire VRAM area copied.
This still helps frame dumps avoid excessively slow VRAM recopying
situations, but fixes issues like missing trees in #12738.
2022-09-23 21:18:39 -07:00
Unknown W. Brackets fddcbfc5fa GE Debugger: Include rendered CLUTs in frame dumps.
Like with textures, this uses the VRAM address directly.
2022-09-19 12:01:34 -07:00
Unknown W. Brackets 132686513d GE Debugger: Correct base accounting in playback.
On a jump, was forgetting the base value which caused corruption.
2022-08-14 16:14:23 -07:00
Unknown W. Brackets 4467b7830f Debugger: Bump GE dump version to ignore bad flag. 2022-08-11 20:28:56 -07:00
Unknown W. Brackets 539e2bbbf8 Debugger: Track unchanged VRAM to avoid copy.
See #15251, the framedump here reused a VRAM texture for many draws, and
this caused it to recopy the texture over and over again.  Use a flag to
skip if possible.
2022-02-20 13:51:40 -08:00
Unknown W. Brackets f17f6465ac GE Debugger: Optimize slab lookup.
If the slab is the last one, we can grab it right away.
2022-02-07 23:55:10 -08:00
Unknown W. Brackets 1d37f24e17 GE Debugger: Reduce playback command noise.
No need to reassert these values each prim.
2022-02-05 19:27:20 -08:00
Unknown W. Brackets 2479d52202 Global: Reduce includes of common headers.
In many places, string, map, or Common.h were included but not needed.
2022-01-30 16:35:33 -08:00