1848 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
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 45a1da2d89 Disable trap on MacOs 2026-07-17 22:04:57 +03:00
Megamouse 1269ebff27 Fix some warnings 2026-07-15 15:19:36 +02:00
Elad 88f81381e8 MacOS/Thread.cpp: Attempt recovery if pthread_jit_write_protect_np state is invalid 2026-07-01 19:31:41 +03:00
Elad 5bbce42adc MacOS: Do not leak MAP_JIT on utils::memory_decommit 2026-07-01 19:31:41 +03:00
Elad 9dc9730898 vm: Make vm::g_exec_addr not use MAP_JIT 2026-07-01 19:31:41 +03:00
Elad 99d15190e5 PPU: Cleanup MacOs executable write protection guards 2026-07-01 19:31:41 +03:00
Elad 537ad399bb Utilities/sema.cpp: Minor optimization 2026-07-01 12:52:13 +03:00
Megamouse 8eaa3ec9a2 Propagate src_loc in write_to_ptr and read_from_ptr 2026-06-29 16:14:42 +02:00
Antonino Di Guardo 2af7b58ce4 fix double path delimiter (#18923)
A cosmetic fix. It removes a double delimiter at the end of a path in
`games.yml` when using `VFS games` path.
2026-06-21 19:38:03 +02:00
Megamouse 0735c55bfd Add user agent to curl requests 2026-06-18 21:16:12 +02:00
Megamouse e5cdae8c5a Use std::string_view in cpu code 2026-06-16 12:07:57 +02:00
Megamouse fbe9ad0f45 Use more fmt::split_sv 2026-06-16 01:28:35 +02:00
Megamouse 41a7cd29f8 Use std::string_view in input code 2026-06-14 17:41:33 +02:00
Megamouse 5252f47a33 Use more std::move 2026-06-13 19:08:16 +02:00
Rad0van d25972e196 JIT/AArch64: advertise +i8mm to the LLVM target machine
The PPU/SPU recompilers emit i8mm intrinsics (ummla/smmla, used by the
SPU GBB/GBH gather paths) gated on utils::has_i8mm(). The JIT's MAttrs
list mirrored dotprod/sha3/sve from HWCAP but never added i8mm, and the
resolved -mcpu on Apple silicon is the cortex-a78 fallback (no i8mm), so
the backend aborted with "Cannot select: intrinsic %llvm.aarch64.neon.ummla"
on every game. Mirror i8mm into MAttrs like the other features.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit 52d121fee79cc569c9ac273852edd0e493ae51fc)
2026-06-06 18:34:38 +03:00
Megamouse 44b33f1962 Force renderer to default renderer if not supported 2026-06-02 21:49:09 +02:00
Megamouse 2b9368abf5 Fix potential OOB access in try_to_enum_value 2026-06-02 16:10:21 +02:00
Megamouse 375eb21c07 Fix some format and logger typos 2026-05-31 15:49:32 +02:00
Malcolm a87d175295 SPU LLVM: Retry ARM64 TBL2 register scavenger failures
- Some SPU programs inexplicably fail to compile when TBL2/TBX2 are used.
- As an insane workaround, first try to compile with TBL2/TBX2, if LLVM crashes while compiling, try to compile the same program without TBL2/TBX2.
2026-05-27 02:46:11 +03:00
Megamouse d8710c431d Fix named_thread_group constructor
m_count - 1 could underflow
2026-05-22 09:14:16 +03:00
Megamouse da599f7286 Fix localization of anaglyph_settings_dialog 2026-05-20 22:26:08 +02:00
Elad d7da6a713b RawSPU: Implement 16-bit and 8-bit read MMIO 2026-05-20 20:44:24 +03:00
kd-11 a4712a283f C++ things 2026-05-13 11:43:32 +03:00
Megamouse 4312221498 Add anaglyph settings 2026-05-08 21:42:29 +02:00
Antonino Di Guardo 026297334f Some fixes (#18686)
### FIXES + MINOR IMPROVEMENTS:
- Fixed issue18685: Not a real issue. PR18648 added some logging that made
evident a missing check on the validity of the paths in `games.yml`
before trying to manage the path as a possible ISO file. That missing
check was already present but simply invisible due to missing log
- Fixed `bytes_to_hex()` function used to store file hash hex string: In
some cases the integrity check wrongly reported the check as failed
- Optimized `fs::get_optical_raw_device()` function: Moved under
`_WIN32` block a check valid only on `Windows` and simplified the logic
to detect a CDROM / BD as raw device
- Used `iso_file` objects instead of `fs:file` in `ISO.cpp`: It allows
to use proper `bool()` operator on some checks
2026-05-07 06:38:57 +03:00
Megamouse a8dd053593 Fix some warnings 2026-04-30 20:41:35 +02:00
digant73 79d0e0eb3c reduce check for raw device 2026-04-30 10:39:10 +03:00
digant73 570b2bddca Avoid to open bd drive if no content is present 2026-04-30 10:39:10 +03:00
Antonino Di Guardo b212935c70 Add support to play from a BD Drive (currently only on Windows) (#18648)
Follow up of #18345 to add support (currently only on `Windows`; see
notes below) for playing a PS3 disc game directly from a Blu-Ray Disc
Drive.

### HOW IT WORKS:
- The BD drive can be added as any other game so from `VFS games` or
from `Add Games` menu. In case it is selected from `VFS games`, any
attempt to write files is discarded, e.g. file `Disc Games Can Be Put
Here For Automatic Detection.txt`
- It scans the default redump keys folder `<rpcs3>/data/redump` (it
currently needs to be manually created due it is not yet provided by
rpcs3 installation) to find a matching decryption key

### NOTES:
- Support is currently provided on `Windows` where I can fully test it.
I cannot test under other OS. However, the additions needed for the
other OS are limited only on `fs::file.h/cpp`. In particular inside the
following new functions:
  - `bool is_optical_raw_device(const std::string& path);`
- `bool get_optical_raw_device(const std::string& path, std::string*
raw_device = nullptr);`
- Icons etc. are always refreshed (ISO cache cannot be used due `mtime`
on raw device is not available and any cache check would always fail)
- Code in `ISO.h/cpp` needed some rework to properly manage a read on a
raw device (alignment on offset, size and memory is mandatory). The BD
drive needs to be detected as a file, not as a folder

### MINOR FIXES:
- Fixed wrong specifier used in logging on `ISO.h/cpp`
2026-04-29 05:42:49 +03:00
Antonino Di Guardo e26c80c129 Add ISO integrity check 2026-04-22 15:06:02 +02:00
Megamouse 88175aa84f Check for unknown keys during config validation 2026-04-16 21:28:34 +02:00
Megamouse 50d6396f99 implement config db 2026-04-16 01:18:05 +02:00
Megamouse 7d41bbdd2b Fix Disk Usage thread 2026-04-15 13:05:54 +02:00
luci4 bcd9663349 Thread.cpp: Added stack trace and register logging to exception filter (#18564) 2026-04-13 15:47:44 +03:00
Elad aa841ac332 LLVM: Add source location for bitcast error 2026-04-04 01:08:05 +03:00
Elad bd95c728f0 sys_fs: Implement ENOTDIR 2026-03-31 21:56:30 +02:00
Megamouse bd2b2c2747 Qt: add recording settings dialog 2026-03-30 09:17:20 +02:00
Elad a4523651c7 RPCS3: Notify RAM shortage, Log current and peak RAM usage 2026-03-27 20:20:29 +03:00
Elad bb3e2689d4 Thread.cpp: Fix game exit on access violation
Fixes game closing in Twisted Metal.
This commit also aloows to debug such states by using cpu_flag::req_exit as a broker
2026-03-26 13:55:00 +02:00
kd-11 dbb6c87a10 utils: Implement enum size computation 2026-03-16 19:08:07 +03:00
Megamouse 0d80e300a0 Qt: add log level settings 2026-03-06 15:06:25 +01:00
Megamouse d97851376d Add stacktrace in case of exception 2026-03-06 13:56:04 +01:00
Megamouse ec00a06caf Fix warning suppression in windows clang 2026-03-05 21:05:15 +01:00
RipleyTom 5ca19eabd5 NP code review
sceNpTrophy fixes

- sceNpTrophyGetTrophyUnlockState: signed 1 was potentially shifted by 31(UB)
- sceNpTrophyUnlockTrophy: used a reader_lock and was missing check for read only context

cellGame fixes

- cellHddGameCheck: missing log parameters
- cellGameDataCheckCreate2: missing log parameter
- cellGameThemeInstall: condition inverted checking for extension + added tolower just in case
- cellGameThemeInstallFromBuffer: OOB access, buf is always filled from the start and then used as a parameter to the CB

sceNp fixes

- sceNpManagerGetTicket: Made accurate from RE
- sceNpDrmGetTimelimit: Fix msec calculation

sceNp2 fixes

-sceNpMatching2ContextStartAsync: avoid capturing ctx
-sceNpMatching2ContextStop: Minor error value swap

rpcn_client fixes

-add_friend: missing log parameter
-handle_friend_notification: misc validation issue

np_handler fixes
-ticket: Missing move in move constructor
-ticket::parse: Misc validation fix
-get_player_history_entry: potential UB fix

np_requests fixes

-Wrong CB event_type set for get_room_member_data_external_list!
-reply_tus_get_data was not copying status data!
-Order of error check in reply_get_room_member_data_external_list was wrong
-Improved logging

np_requests_gui:

-Added missing guards for gui_notifications

upnp_handler fixes

-Highest density of bugs per line of code in the west, let's pretend I never wrote this

signaling_handler fixes

-Swapped to multimap to avoid collisions on timestamps

Misc fixes
2026-03-01 09:20:32 +02:00
Elad 35ccd63dbc Win32/File.cpp: Fix fs::file constraints to avoid crashes 2026-02-28 10:58:25 +02:00
Elad cc1b4c8fd1 Fix strcpy_trunc type validation 2026-02-28 10:58:25 +02:00