Commit Graph
143 Commits
Author SHA1 Message Date
Henrik Rydgård 1e35f00965 wsdbg: add :snapshot/:snapshots/:diff for quick memory comparisons
New REPL-only commands, kept entirely client-side (no new PPSSPP-side
event) since a snapshot is a debugging-session-scoped concept with no
real emulator-side meaning - memory.read's existing base64 response is
already the only primitive actually needed:

- :snapshot <name> <address> <size> - blocks on a memory.read (unlike the
  rest of the REPL, which is fire-and-forget or just waits without
  looking at the payload) and stores the decoded bytes locally under
  <name>. address/size are passed through to the server exactly as
  typed, same as any other event param.
- :snapshots - list what's been captured so far.
- :diff <name1> <name2> - byte-compare two snapshots, printing each
  differing run as "+offset (N bytes): old_hex -> new_hex".

Replaces the throwaway PowerShell/Bash diffing scripts written by hand at
least twice during the VSH boot investigation (see
docs/VSHBootInvestigation.md - the sceBSMan before/after test, and the GE
display list re-checks) with one correct, reusable implementation. In
memory only for now (lives as long as the wsdbg process does, which is
fine for the actual usage pattern - one piped batch of commands per
invocation, same as everything else in this tool); can add disk
persistence later if a real need for cross-invocation snapshots comes up.

Verified live against PPSSPPHeadless: snapshot/list/diff (both a
real detected difference and an identical-buffer comparison) all produce
correct output.
2026-08-14 11:04:32 +02:00
Henrik Rydgård 25b9b60694 wsdbg: tokenize REPL lines with quote-awareness instead of splitting on any whitespace
handle_repl_line() used line.split_whitespace(), so any parameter value
containing a space (most commonly a logFormat string with multiple
{expression} placeholders, e.g. logFormat="v0={v0} a0={a0}") got silently
split into multiple bogus key=value tokens - build_event_json then either
failed outright ("not in key=value form") or, worse, sent a malformed
request with the value truncated at the first space, with no indication
to the user that their command wasn't parsed as intended. Cost real
debugging time this session before being traced to this (see
docs/VSHBootInvestigation.md).

Added split_shell_words(): a minimal shell-like tokenizer that treats
'single' or "double" quotes as protecting spaces (and the other quote
character) from being treated as a separator, stripping the quotes from
the resulting token; backslash escapes the next character, including
inside quotes. Not a full shell-parsing crate, just enough for this
tool's key=value parameters.

Verified live against PPSSPPHeadless: logFormat="job hit pc={pc} ra={ra}"
now arrives as a single correctly-quoted JSON string value instead of
being split apart.
2026-08-14 11:04:32 +02:00
Henrik Rydgård 8160a7e3eb wsdbg: add --sync to wait for responses instead of guessing sleeps
Scripted sequences piped into the REPL previously had no way to know
when a command's response had arrived, so every multi-step script in
this repo's investigation docs needed "sleep N" between commands,
guessed per case and often wrong in either direction.

--sync makes each line block until its response arrives before the
next line is read: the matching ticketed response for most events,
or (since cpu.resume/stepInto/stepOver/stepOut/runUntil/nextHLE are
all documented as having no immediate response at all - only the
eventual unticketed cpu.stepping broadcast) that broadcast for the
resume/step family specifically. Everything still prints as it
arrives; only the timing of the next send changes. Bounded by
--sync-timeout (default 30s) so a breakpoint that never trips can't
hang a script forever.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GZq8ZtJmFY7bkX5FVkr3P9
(cherry picked from commit 9ee89fd16ba4557a245ca2a96c69a9c9478cf59e)
2026-08-14 11:04:32 +02:00
Henrik RydgårdandClaude Sonnet 5 ffad0acea1 Plumb an explicit MIPSState *mips through the interpreter's Int_* handlers
All ~82 MIPSInt::Int_* functions (Interpreter.cpp/.h,
InterpreterVFPU.cpp/.h) now take an explicit MIPSState *mips instead
of reaching for the global currentMIPS internally, along with their
file-local helpers (DelayBranchTo, SkipLikely, ApplySwizzleS/T,
ApplyPrefixD/ST, RetainInvalidSwizzleST, EatPrefixes). MIPSInterpretFunc,
Interpret(), ExecInstruction()/InterpreterDispatch.cpp (regenerated),
and RunUntilFast() all thread mips through accordingly.

Deliberately left on currentMIPS for now: MIPSVFPUUtils.cpp's
ReadVector/WriteVector/ReadMatrix/WriteMatrix/VFPURewritePrefix -
these are shared with every JIT backend's compile-time VFPU code, so
parameterizing them would balloon this into a JIT-wide refactor. This
is a partial refactor; that's the next boundary to push on.

Several JIT backends (x86 Jit.cpp, ARM/ArmJit.cpp, ARM64/Arm64Jit.cpp,
x86/X64IRJit.cpp, RiscV/RiscVJit.cpp, LoongArch64/LoongArch64Jit.cpp,
ARM64/Arm64IRJit.cpp) bake the raw interpreter function pointer
directly into JIT-generated machine code as their "fall back to the
interpreter for this one op" mechanism, with only a single argument
register set up for the call. Rather than hand-editing register
allocation across four architectures that can't be build-tested here,
added MIPSInterpretTrampoline(MIPSOpcode op) - a 1-arg wrapper around
MIPSInterpret(currentMIPS, op) - and pointed all 7 such call sites at
it instead, leaving that codegen untouched. Two other call sites
(JitLogMiss, JitBranchLog) were plain C++ calls and just got the
extra argument directly.

Verified (Windows x64): PPSSPPWindows/PPSSPPHeadless/UnitTest all
build clean, 49/49 unit tests pass. `test.py -g --graphics=software`:
interpreter 312/314 (cpu/fpu/fpu is the pre-existing, unrelated
interpreter-vs-JIT denormal difference; gpu/rendertarget/copy passes
standalone, so was cross-test state bleed in the batch run, not a
regression), default JIT 314/314, jit-ir 313/314 (gpu/vertices/morph
is an expected difference from the vertex decoder taking a different
mode with this core change, not a bug).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019SKhm9wKEQzRUsx9mTrrtQ
2026-08-12 14:02:19 +02:00
Henrik RydgårdandClaude Sonnet 5 d000d5366a Wire the generated ExecInstruction dispatcher into the interpreter's hot loop
Adds Core/MIPS/InterpreterDispatch.cpp, the checked-in output of
GenerateInterpreterDispatch() (see the previous commit), and hooks it
into RunUntilFast() in MIPSTables.cpp in place of the old
MIPSGetInstruction()-based table walk + indirect call through
instr->interpret. The checked-with-breakpoints/memchecks path
(RunUntilWithChecks) is untouched for now, since it inspects
MIPSInstruction flags directly and correctness there matters most.

Also fixes a real crash in headless.cpp found while testing this:
cmdLineOptions.gpuBackend.value() would throw when unset (e.g. with
--graphics=software), now uses value_or().

Verified with `test.py -g --cpu=interpreter --graphics=software`:
313/314 pass; the one failure (cpu/fpu/fpu) is a pre-existing
interpreter-vs-JIT denormal (flush-to-zero) difference, confirmed to
fail identically with the old table-walking dispatch, so unrelated to
this change.

Adds Tools/update-dispatcher.py to regenerate InterpreterDispatch.cpp
from a built PPSSPPHeadless binary whenever the MIPSTables.cpp tables
change.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019SKhm9wKEQzRUsx9mTrrtQ
2026-08-12 10:52:47 +02:00
Henrik Rydgård b16c8accff cargo bumps 2026-08-03 11:22:05 +02:00
Henrik RydgårdandClaude Opus 5 34b23b611e Add wsdbg, a small CLI client for the WebSocket debugger
A Rust REPL/one-shot tool for talking directly to PPSSPP's WebSocket
debugger interface (Tools/wsdbg), for scripting and manual poking during
debugging/reverse-engineering sessions.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XDNwPPuidmNxQGRJxBuRL6
2026-07-26 21:01:04 +02:00
Henrik Rydgård 035278516f Bump langtool deps 2026-07-14 17:02:26 +02:00
Henrik Rydgård 167f8af0a2 Bump Cargo.lock for langtool, remove string 2026-07-08 18:29:40 +02:00
Henrik Rydgård 36bdde68f9 Delete the "Lazy texture cache" option 2026-06-09 23:49:54 +02:00
Henrik Rydgård affdeb827e Change rewindstate metadata to say X seconds ago 2026-05-19 12:19:31 +02:00
Henrik Rydgård 6e9d603314 Bump langtool/Cargo.lock 2026-05-13 23:09:04 +02:00
Henrik Rydgård e63c209fa7 Bump Cargo.lock for langtool 2026-04-28 22:17:09 +02:00
Henrik Rydgård 79ead80f87 Bump Cargo.lock
Replaces #21592
2026-04-27 12:36:58 +02:00
Henrik Rydgård 00526a9964 Bump cargo.lock for langtool.
Replaces #21553 by dependabot
2026-04-14 10:07:13 -06:00
Henrik Rydgård 8304d8622a Hide the save/load indicator by default, add a (developer) setting. Also sneak in an adhoc server list bug fix.
Fixes #21523
2026-04-06 10:04:09 -06:00
Henrik Rydgård cfc5d74602 Some progress with server status UI 2026-03-30 11:34:19 -06:00
Henrik Rydgård b8463b9203 Fix assorted warnings, bump Cargo.lock 2026-03-24 10:26:49 -06:00
Henrik Rydgård 1c31db1b76 Bump langtool dependencies.
Replaces #21471
2026-03-21 08:56:28 -06:00
dependabot[bot] b9753ab6b3 Bump quinn-proto from 0.11.13 to 0.11.14 in /Tools/langtool
Bumps [quinn-proto](https://github.com/quinn-rs/quinn) from 0.11.13 to 0.11.14.
- [Release notes](https://github.com/quinn-rs/quinn/releases)
- [Commits](https://github.com/quinn-rs/quinn/compare/quinn-proto-0.11.13...quinn-proto-0.11.14)

---
updated-dependencies:
- dependency-name: quinn-proto
  dependency-version: 0.11.14
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-11 00:19:11 +00:00
Henrik Rydgård 86dc349c1b Lang fixes 2026-03-07 10:19:17 +01:00
Henrik Rydgård 0791f542ea Fix bug in langtool 2026-03-07 10:03:43 +01:00
Henrik Rydgård 733c45cc94 Bump langtool deps to make dependabot happy 2026-03-04 12:45:22 +01:00
Henrik Rydgård c74e21243d Add support for installing plugins directly from zip files 2026-02-25 14:28:57 +01:00
Henrik Rydgård 57dffcb571 Refactor langtool a bit 2026-02-20 09:42:58 +01:00
Henrik Rydgård e8927ddf3e langtool: Add new feature to split keys with descriptions into separate key/value 2026-02-19 00:15:49 +01:00
Henrik Rydgård 911ffa64c4 Cargo bump 2026-02-14 12:04:15 +01:00
Henrik Rydgård 236a0acf71 Minor tweaks 2026-02-06 11:37:09 +01:00
Henrik Rydgård 48d50fe712 Add strings for the two gesture zones 2026-02-04 15:01:06 +01:00
Henrik Rydgård efc920c948 langtool: Clippy fixes, add ability to avoid overwriting already-translated strings with AI 2026-02-04 10:42:41 +01:00
Henrik Rydgård 28bc558619 Langtool: Bump deps 2026-02-04 00:30:01 +01:00
Henrik Rydgård 68ca54bca2 langtool regex: make the replacement parameter optional (default to empty) 2026-01-29 21:53:22 +01:00
Henrik Rydgård 21da9d6900 Langtool: Add regex command. 2026-01-29 21:53:21 +01:00
Henrik Rydgård a0e6991fdc bump 2026-01-29 17:41:57 +01:00
Henrik Rydgård c232867fba Correct functionality of the display rotation control rotation.
Fixes #19775

A future step might be to also rotate the touch screen inputs..
2026-01-23 01:18:58 +01:00
Henrik Rydgård cd1c89d4cb New hint string for packet relay, auto translated to start with 2026-01-21 01:41:34 +01:00
Henrik Rydgård 6a9b2e1e87 RetroAchievements: Improve completion messages (subset, differentiate hardcore mode) 2026-01-20 18:25:48 +01:00
Henrik Rydgård fce30fccfa Bump Cargo.lock 2026-01-20 18:25:19 +01:00
Henrik Rydgård 77b9a6e2e8 Prepare for adjustable save state slot count by making the Win32 menu dynamic 2026-01-08 16:07:48 +01:00
Henrik Rydgård 11a9430e5a Improve a translation string 2026-01-07 19:51:16 +01:00
Henrik Rydgård b7aa38a738 WASAPI: Re-enable AudioClient3. Fix a possible crash. 2026-01-05 19:48:22 +01:00
Henrik Rydgård 6484382092 Reformat crashcleaner, improve output slightly 2026-01-02 14:20:20 +01:00
Henrik Rydgård 481d0fd18c Switch TouchInputFlags to enum class, fix some minor UI issues
Scroll views now only wheel-scroll if the mouse is hovering over them.
2025-12-19 11:38:56 +01:00
Henrik Rydgård c875b22efa Bump cargo.lock 2025-12-15 16:19:36 +01:00
Henrik Rydgård 49001ef42e Add a simple crash dump cleaner as a HTML tool 2025-12-15 11:52:10 +01:00
Henrik Rydgård 3c6429a922 Bump cargo.lock 2025-11-23 21:24:22 +01:00
Henrik Rydgård 636e5b33b6 Upgrade some dependencies (#21009)
* Bump some deps

* Bump rcheevos

* Bump langtool deps
2025-11-16 11:30:54 +01:00
Henrik Rydgård 7b05ccafd4 Remove unnecessary linebreaks 2025-11-10 15:34:53 +01:00
Henrik Rydgård 068f055a36 langtool dep bump 2025-10-27 12:20:24 +01:00
Henrik Rydgård 7da47995dc Bump langtools deps 2025-10-20 19:53:21 +02:00