Commit Graph

414 Commits

Author SHA1 Message Date
Megamouse
a8559a526a tar: fix save_header regression 2026-06-17 13:13:38 +02:00
Megamouse
7a4ec42362 Use std::string_view in loader code 2026-06-16 12:07:57 +02:00
Megamouse
4f321eb319 Do not throw on hex_to_bytes error in iso get_key
Just treat it as a regular key processing error
2026-06-14 12:06:54 +02:00
Megamouse
4fed5e7b88 Fix iso integrity log message 2026-06-14 09:04:03 +02:00
Antonino Di Guardo
23b414ac84
Add integrity check to PSN Content, DLC and Game Update files (#18669) 2026-06-14 07:35:49 +02:00
Megamouse
5252f47a33 Use more std::move 2026-06-13 19:08:16 +02:00
Megamouse
9c719a5857 trophies: fix return value of GetUnlockedPlatinumID with invalid file 2026-05-31 15:49:32 +02:00
Megamouse
1bd246d2d3 Fix some gcc warnings 2026-05-30 23:58:51 +02:00
Megamouse
8c82ce8bed Fix slicing warning in tar_object::save_directory 2026-05-30 19:31:16 +02:00
Antonino Di Guardo
6b5a2f781a
ISO: Fix missing read of remaining chunk of data on next extent, if present (#18706) 2026-05-10 16:59:15 +00: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
Vishrut Sachan
d93d9b2c5a
game_list: Fix ISO cache bypass in is_from_yml branch for multi-game ISOs (#18683)
Fixes regression from #18546 and #18679.

## Problem
The is_from_yml ISO branch constructed iso_archive unconditionally,
bypassing the cache check inside add_game, making the cache write-only
for yml-sourced ISOs.

## Fix
Added a lightweight index cache entry (iso_path + "//index") storing the
subdir list + mtime. On hit, skips archive construction entirely. On
miss, walks as before and writes the index
2026-05-05 11:14:16 +02:00
Vishrut Sachan
ca87d103fd game_list: Add multi-game collection support for ISO format discs 2026-05-03 10:14:44 +03:00
Megamouse
a8dd053593 Fix some warnings 2026-04-30 20:41:35 +02:00
Megamouse
985703058b ISO: Improve path logging 2026-04-30 14:15:29 +02: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
digant73
b6c8374aa5 Fix region range check on ISO file 2026-04-19 19:23:37 +03:00
Megamouse
b10c742f10 iso stuff 2026-04-14 09:37:18 +02:00
Vishrut Sachan
11050a7032
ISO: Add metadata cache to speed up game list scanning (#18546)
Every launch constructs a fresh iso_archive for each ISO game, which
calls iso_form_hierarchy() and walks the full directory tree. On top of
that, qt_utils opens a second iso_archive just for icon loading, so
every ISO game ends up doing two full directory tree walks on every
launch.
This adds a metadata cache keyed by ISO path + mtime stored under
fs::get_config_dir()/iso_cache/. Each entry stores the raw SFO binary,
resolved icon/movie/audio paths and raw icon bytes.

- On cache hit, iso_archive construction is skipped entirely for both
game list scanning and icon loading
- On cache miss archive is scanned as before and the result is persisted
to disk
- Cache is automatically invalidated when the ISO file's mtime changes

Tested with a decrypted PS3 disc ISO (God of War III):

- First launch writes cache files correctly to iso_cache/
- Second launch reads from cache with correct title and icon
- touch game.iso correctly invalidates the cache and triggers a rescan
2026-04-12 09:07:25 +00:00
digant73
110c786d80 Add support to encrypted ISO
fix compile errors and suppress minor warnings

strip minor bug fixes and cleanup

minor cleanup

minor cleanup

Fixed crash at boot parsing an ISO with a empty directory entry at file head

applied suggested changes

added missing break in switch

Update rpcs3/Loader/ISO.cpp

Co-authored-by: Megamouse <studienricky89@googlemail.com>

use hex_to_bytes() instead of self made functions

minor cleanup

rewrite nested if()

add explicit support to .key

minor cleanup

optimize partial sector read

minor optimization

fix conflict
2026-04-10 22:41:05 +02:00
Megamouse
8e80ddd99f
ISO: optimize some file reads (#18511)
- Batch some file reads in iso_read_directory_entry (speeds up indexing
by ~41% on my test iso)
- Fix some warnings
2026-04-08 10:52:03 +02:00
Elad
bd95c728f0 sys_fs: Implement ENOTDIR 2026-03-31 21:56:30 +02:00
Darkhost1999
6523afa69a overlays/home: Fix restarting games from home menu 2026-03-17 21:39:18 +01:00
Megamouse
9f3adb3fc7 Fix steam banners for iso files 2026-03-17 14:47:17 +01:00
Megamouse
f2c8b157ef ISO: pass mode to file 2026-03-05 21:05:15 +01:00
Megamouse
ff992a67c8 win/fs: check file handle with GetFileInformationByHandle when creating fs::file
Some checks failed
Generate Translation Template / Generate Translation Template (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ${{ matrix.os }} ${{ matrix.compiler }} (/rpcs3/.ci/build-linux-aarch64.sh, gcc, rpcs3/rpcs3-ci-jammy-aarch64:1.8, ubuntu-24.04-arm) (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ${{ matrix.os }} ${{ matrix.compiler }} (/rpcs3/.ci/build-linux.sh, gcc, rpcs3/rpcs3-ci-jammy:1.8, ubuntu-24.04) (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ${{ matrix.os }} ${{ matrix.compiler }} (a1d35836e8d45bfc6f63c26f0a3e5d46ef622fe1, rpcs3/rpcs3-binaries-linux-arm64, /rpcs3/.ci/build-linux-aarch64.sh, clang, rpcs3/rpcs3-ci-jammy-aarch64:1.8, ubuntu-24.04-arm) (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ${{ matrix.os }} ${{ matrix.compiler }} (d812f1254a1157c80fd402f94446310560f54e5f, rpcs3/rpcs3-binaries-linux, /rpcs3/.ci/build-linux.sh, clang, rpcs3/rpcs3-ci-jammy:1.8, ubuntu-24.04) (push) Has been cancelled
Build RPCS3 / RPCS3 Mac ${{ matrix.name }} (0, 51ae32f468089a8169aaf1567de355ff4a3e0842, rpcs3/rpcs3-binaries-mac, Intel) (push) Has been cancelled
Build RPCS3 / RPCS3 Mac ${{ matrix.name }} (1, 8e21bdbc40711a3fccd18fbf17b742348b0f4281, rpcs3/rpcs3-binaries-mac-arm64, Apple Silicon) (push) Has been cancelled
Build RPCS3 / RPCS3 Windows (push) Has been cancelled
Build RPCS3 / RPCS3 Windows Clang ${{ matrix.arch }} (aarch64, clang, clangarm64, ARM64, windows-11-arm) (push) Has been cancelled
Build RPCS3 / RPCS3 Windows Clang ${{ matrix.arch }} (x86_64, clang, clang64, X64, windows-2025) (push) Has been cancelled
Build RPCS3 / RPCS3 FreeBSD (push) Has been cancelled
On empty mounted drives CreateFileW may return a valid handle even if the drive is not usable.
We have to check the file handle early. Otherwise other functions may fail later as a result.
2026-02-20 11:25:39 +02:00
Megamouse
9faf9a6145 ISO: optimize byteswap and utf16 string conversion 2026-01-10 15:22:41 +01:00
Megamouse
36bce33684 ISO: use string_view in retrieve 2026-01-10 15:22:41 +01:00
Megamouse
f712de0c91 ISO: Remove psf hack 2026-01-10 15:22:41 +01:00
Megamouse
a8624682a7 ISO: add some logging 2026-01-10 12:14:09 +01:00
Megamouse
19129eddd7 Qt: ISO clean up
Should fix some potential Qt bugs as well
2026-01-10 06:36:58 +01:00
Functionable
a53f2fc7b9 ISO: Fix save states in games with multiple executables
- Some games will load into a different executable from EBOOT.BIN, and
attempting to restore those games from savestate causes the game to
crash immediately.
- This commit repurposes the disc_info field in a savestate generated
from an ISO game to store the running game executable at the time of the
save state.
2026-01-09 14:40:51 +02:00
Functionable
4cd75971f0 ISO: Move code to load psf::registry into iso_archive
- Multiple places end up needing to retrieve a psf::registry from an is
o archive.
- Added a safety check along with this
2026-01-09 14:40:51 +02:00
Functionable
38daf8d325 ISO: Add empty path check to iso_archive::retrieve 2026-01-09 14:40:51 +02:00
Functionable
48f39acac7 ISO: Unload the iso_device on shutdown 2026-01-09 14:40:51 +02:00
Functionable
257043529a ISO: Loader improvements
- Don't use floating point when advancing sectors
- Remove redudndant seek in iso_archive constructor
- Drop error code checks in iso_file::read_at
- Don't use lexically_normal for handling path in iso_archive::retrieve.
More complete directory search implementation.
2026-01-09 14:40:51 +02:00
Functionable
acdb0ee729 ISO: Small clean up
Cleaning up old comments and fixing small mistakes in ISO.cpp
2026-01-09 14:40:51 +02:00
Functionable
6c083d6184 ISO: Add ISO reader code and ISO device
Adds infrastructure to read files/data from ISOs.

Also adds classes extending fs::device_base and fs::file_base in order
to allow reading files through fs namespace functions. This approach
should allow ISO data to be read by the emulator with the least changes
to existing code.
2026-01-09 14:40:51 +02:00
Megamouse
27f39d2ac0 fmt: add more string_view versions of string functions 2025-12-08 19:49:42 +01:00
Elad
bfe54a29ae Savestates/TAR: Extract files asynchronously 2025-11-10 13:04:43 +02:00
Elad
cc8929ef4a PSF.cpp: Fixup 2025-11-02 17:23:46 +02:00
Elad
ede8382c6a Remove std::strcpy
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ${{ matrix.os }} ${{ matrix.compiler }} (/rpcs3/.ci/build-linux-aarch64.sh, gcc, rpcs3/rpcs3-ci-jammy-aarch64:1.7, ubuntu-24.04-arm) (push) Waiting to run
Build RPCS3 / RPCS3 Linux ${{ matrix.os }} ${{ matrix.compiler }} (/rpcs3/.ci/build-linux.sh, gcc, rpcs3/rpcs3-ci-jammy:1.7, ubuntu-24.04) (push) Waiting to run
Build RPCS3 / RPCS3 Linux ${{ matrix.os }} ${{ matrix.compiler }} (a1d35836e8d45bfc6f63c26f0a3e5d46ef622fe1, rpcs3/rpcs3-binaries-linux-arm64, /rpcs3/.ci/build-linux-aarch64.sh, clang, rpcs3/rpcs3-ci-jammy-aarch64:1.7, ubuntu-24.04-arm) (push) Waiting to run
Build RPCS3 / RPCS3 Linux ${{ matrix.os }} ${{ matrix.compiler }} (d812f1254a1157c80fd402f94446310560f54e5f, rpcs3/rpcs3-binaries-linux, /rpcs3/.ci/build-linux.sh, clang, rpcs3/rpcs3-ci-jammy:1.7, ubuntu-24.04) (push) Waiting to run
Build RPCS3 / RPCS3 Mac ${{ matrix.name }} (51ae32f468089a8169aaf1567de355ff4a3e0842, rpcs3/rpcs3-binaries-mac, .ci/build-mac.sh, Intel) (push) Waiting to run
Build RPCS3 / RPCS3 Mac ${{ matrix.name }} (8e21bdbc40711a3fccd18fbf17b742348b0f4281, rpcs3/rpcs3-binaries-mac-arm64, .ci/build-mac-arm64.sh, Apple Silicon) (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
Build RPCS3 / RPCS3 Windows Clang (win64, clang, clang64) (push) Waiting to run
Build RPCS3 / RPCS3 FreeBSD (push) Waiting to run
2025-11-02 14:22:11 +02:00
elad335
dcc263ca5d SPU Image Finder Fixes 2025-04-25 19:52:38 +03:00
DH
d766baef12 fs::file: implement release_handle
cleanup
2025-03-10 21:09:27 +01:00
DH
adaf24310d add missed include to PUP.h 2025-03-10 21:09:27 +01:00
oltolm
2b0f786b2d
Fix std::basic_string warnings (#16261) 2024-11-11 21:54:44 +02:00
Megamouse
2262ac1684 Qt: Replace QMap with std::map
This should reduce the amount of string conversions during list refreshes
2024-11-06 09:34:32 +01:00
Elad Ashkenazi
a2dcbb9c13 Replace src_loc with std::soource_location 2024-05-21 14:19:12 +03:00
Megamouse
e164d462b4 cellVideoOut: support interlaced scan modes 2024-05-05 01:38:54 +02:00