19607 Commits

Author SHA1 Message Date
Megamouse 7a90d09cfe Qt: move guest memory dump code to own class 2026-07-23 10:58:18 +02:00
caner 5ecfc95c13 Qt: add guest memory dump utility (#19068)
This adds a tool that writes a snapshot of the full PS3 guest address
space to disk for offline analysis.

This tool produces a flat image that any hex editor or script can index
directly by guest address. It dumps allocated PS3 guest memory only, not
RPCS3 host-process memory, host registers, or GPU-side state.

What it does:

1. Pauses emulation and waits up to five seconds for every PPU, SPU, and
RSX thread to settle. If they do not settle, nothing is written.
2. Copies every allocated guest page into an intermediate buffer on a
named worker thread, then writes it to a sparse `guest_memory.bin` whose
file offset equals the PS3 effective address. Reads go through
`vm::g_sudo_addr` so guest protected pages are captured too.
3. Saves each live SPU thread's 256 KB local store to its own file, with
its ID, LV2 ID, PC, and type recorded.
4. Writes `manifest.json`, listing every allocated region with its
addresses and permissions, the storage mode, and the SPU local-store
table.
5. Resumes emulation.

The menu entry is under Utilities next to Memory Viewer and is enabled
while a game is loaded. Free space is checked before writing. If sparse
file setup fails, the incomplete attempt is removed and the user can
choose another destination or cancel. Failed or cancelled dumps remove
their output folder instead of leaving a partial image.

Tested on Windows using an NTFS destination with a build from this
branch: dumped a running game with 479,535,104 allocated guest bytes
across 76 regions and five SPU local stores. The image was sparse, its
offsets matched guest addresses, and emulation resumed cleanly. The
sparse file failure path was also exercised with a temporary local test:
choosing another location reopened the destination picker, while
cancelling aborted the attempt without leaving partial output. Runtime
behavior on Linux and macOS is untested.

The first draft of this implementation was AI assisted. I reviewed and
adjusted the code and tested the Windows/NTFS path myself. I am happy to
rework anything or answer any questions.
2026-07-23 00:08:05 +00:00
Megamouse 8604f1c5d8 cli: allow to boot last savestate of a game 2026-07-22 09:13:41 +02:00
RipleyTom 8b05c8cc1f bugfixes 2026-07-21 21:49:00 +03:00
Elad d75543a5b1 LLVM: Add short fallback for get_known_bits
Supports: when value is the immediate result of either a bitwise OR operation or a bitwise AND when either operands is a constant.

Prevents some false positives when the value has PHI nodes in its ancestors.
2026-07-21 21:49:00 +03:00
RipleyTom 2aeb08f929 Fix: get_known_bits fix 2026-07-21 21:49:00 +03:00
Elad 85c59207f7 LLVM: Improve v128 constant extraction 2026-07-21 20:35:56 +03:00
Ani 63851f4242 atomic: Fix BSD compilation 2026-07-20 18:34:57 +02:00
schm1dtmac ee37ef277d [macOS] Update to the latest MoltenVK 1.4.2 prebuilt, re-disable Game Mode for now 2026-07-20 13:39:47 +02:00
Megamouse 357b7d4462 vfs: add source location to exception 2026-07-19 15:58:26 +02:00
Megamouse 8df0fcc0cc ARM: Fix some warning 2026-07-19 15:58:26 +02:00
Megamouse a7d90852dd pad settings: Fix for clearing bindings
Fix accidentally clearing a binding during remap if the same button is assigned to rightclick in the pad navigation.
Only allow clearing a binding on release if the same button was also pressed while no remapping occured.
2026-07-18 19:08:08 +02:00
Walter 9b3a916af0 [SPU LLVM] Use select in FMA to shorten its dependency chain (#19052)
The `FMA` instruction conditionally zeros one multiplicand if the other
is zero/denormal to emulate the xfloat's extended range. This patch
replaces that with a `select(is_non_zero, fma(a, b, c), c)` which has a
shorter dependency chain in most situations and probably allows LLVM to
better optimize it with surrounding instructions.

I added a AVX512 path that uses `vfixupimmps` to prevent a pessimization
where LLVM transforms it into a strictly serial predicate chain. I
confirmed that it works with denormals and both zeros.

https://godbolt.org/z/hsP5G43Ye
2026-07-18 08:18:10 +00:00
Elad 0fcb15ab18 SPU: Revert 49abd6d8e5 2026-07-18 04:05:46 +03:00
Elad 1d657c4e63 Skip 2026-07-17 22:04:57 +03:00
Elad 5d62ee4b42 Fix possible multi-platform race-condition (depending on kernel)
As well as remove another pthread_self call.
2026-07-17 22:04:57 +03:00
Elad 4e49c5319d Avoid using pthread_self() partially 2026-07-17 22:04:57 +03:00
Elad 6f0e78b6b5 SPU LLVM: Avoid raw pointers 2026-07-17 22:04:57 +03:00
Elad b35e4434aa SPU: LLVM: Add spu_thread::state check in Reduced Loop 2026-07-17 22:04:57 +03:00
Elad 21d5336753 SPU LLVM: Disable NaN rulling-out in Reduced Loop on ARM64 2026-07-17 22:04:57 +03:00
Elad 4e2839f3d3 SPU: Fix ppu_check_patch_spu_images 2026-07-17 22:04:57 +03:00
Elad 45a1da2d89 Disable trap on MacOs 2026-07-17 22:04:57 +03:00
Elad 8cc37e036d SPU: Extend LS memory mirrors 2026-07-17 22:04:57 +03:00
Elad 9bf67f0312 SPU LLVM: Discourage memory mirrors use on LQD/STQD 2026-07-17 22:04:57 +03:00
Jordan Jones 430984729d qt: Fix save manager crash when deleting multiple entries (#19019) 2026-07-17 11:27:07 +00:00
Ani 95da0365a3 metainfo: Update screenshot preview 2026-07-17 12:45:54 +02:00
Elad e9f833a2e8 PPU LLVM: Accelerate NJ handling in FTZ environment 2026-07-17 12:23:54 +03:00
Walter 656bc2a92c Fix LLVM version macro typo 2026-07-17 10:31:26 +03:00
Walter 634a41b488 LLVM 21 compatible computeKnownFPClass
The signature for `computeKnownFPClass` changed with LLVM 21, so this commit includes a conditional compilation which is compatible.
2026-07-17 10:31:26 +03:00
Walter 53835b294e Include KnownFPClass.h with later LLVM versions
LLVM 21 moved the KnownFPClass definition from `ValueTracking.h` to its own file. I verified that specific version moved it, with 20 being the last without it.
2026-07-17 10:31:26 +03:00
Walter fa418f0dbb [SPU LLVM] Add KnownFPClass to FMAs
Replaced the denormal/zero check in `fma32x4` with LLVM's `KnownFPClass` analysis.

That method now includes a overload which expects the caller to provide the known struct. This is used for memorization with the FMA instructions, where the range clamping and instruction specific special value handling are combined. `FMS` and `FNMS` has a larger search depth as it can potentially shorten the chain by a lot.
2026-07-17 10:31:26 +03:00
Walter d0fdd9bb6d [SPU LLVM] Add KnownFPClass to multiply and equals
Replace constant checks in `FM`, `FCEQ`, and `FCMEQ` with `KnownFPClass`. The equality compares now also optimize for when the operands is infinity, which is safe as it behaves identically to the default path.
2026-07-17 10:31:26 +03:00
Walter aec0917a86 [SPU LLVM] Add KnownFPClass to clamping
Avoid clamping if the value is known not to be Inf/NaN (overflow). Includes a optional precalculated argument, which only calculates the known if it has not been done already.
2026-07-17 10:31:26 +03:00
yahfz cdbc43712b PPU LLVM: Optimize vector denormal handling 2026-07-16 15:47:22 +03:00
yahfz 50df95d6c4 PPU LLVM: Optimize vector NaN handling 2026-07-16 12:00:23 +03:00
Megamouse 1269ebff27 Fix some warnings 2026-07-15 15:19:36 +02:00
Megamouse bdd28bfa0d Update fusion to 1.3.1 2026-07-15 15:19:36 +02:00
Elad 49b0306b1d sys_fs: Secure ENOTDIR for sys_fs_stat 2026-07-14 23:22:41 +03:00
Elad 217769d801 sys_fs: Fix ENOTDIR check for paths ending with /dot or /dotdot
They must be directories, even file-path/dot points to itself.
2026-07-14 23:22:41 +03:00
Elad 9d9f210ddb sys_fs: Debug validation layer for ENOTDIR detector 2026-07-14 23:22:41 +03:00
Elad 2f7b8a7149 Fix sys_rsx_context_iomap error check 2026-07-14 13:00:58 +03:00
Elad 2cacaa2da4 IDM: Optimize IDs for concurrency 2026-07-14 13:00:58 +03:00
Walter d755124c48 [SPU ASMJIT] Optimize FCGT, FM, FCMGT
Optimize the float multiply and compare methods by taking advantage of the `denormals-are-zero` flag, removing duplicated logic, and generally doing things more efficiently.
2026-07-13 11:05:29 +03:00
Walter 700ca262f4 [SPU LLVM] Refactor SELB
Refactors SELB by changing "division accuracy correction" pattern match to reduce nesting, include more comments, and use more descriptive variable names. Also replaced duplicated granularity-check loops with single loop which determines byte granularity as a integer.
2026-07-10 19:47:17 +03:00
Megamouse 4003b017f5 Fix PS1 classics shortcuts 2026-07-09 22:14:11 +02:00
Megamouse a71d3b8cab Update curl to 8.21.0 2026-07-09 18:12:27 +02:00
Megamouse bb5dc93bec Update fusion to 1.3.0 2026-07-08 16:50:07 +02:00
Zion Nimchuk 5c90bf5865 Optionally include opencv geometry.hpp if it exists, adding support for opencv 5 2026-07-07 07:21:01 +02:00
Megamouse d87cf99b65 VK: fix video_out_calibration_pass::get_fragment_inputs 2026-07-03 08:27:52 +02:00
Simon Capriotti dc06cac014 Bump global savestate version 2026-07-02 22:46:53 +03:00