Commit Graph
147 Commits
Author SHA1 Message Date
Henrik RydgårdandClaude Opus 5 396f9e802d GameInfoCache: report the firmware updater bundled on a game disc
Adds GameInfoFlags::BUNDLED_UPDATE_INFO, holding the version, title, size
and timestamp of the updater in PSP_GAME/SYSDIR/UPDATE. It comes from the
PARAM.SFO and the directory entry next to the archive, so it's a couple of
small reads on the ISOFileSystem the worker already has open - no
decryption, and DATA.BIN itself is only sniffed for its magic. Only
computed for ISOs; everything else is marked complete with an empty struct.

ISOFileSystem now parses the date out of the ISO9660 directory record,
stored as Unix UTC seconds and reported as the PSP's atime/ctime/mtime.
Those used to always read back as zero, so games calling sceIoGetstat on a
UMD file saw 1900 where hardware gives the mastering date.

Shown on GameScreen as e.g. "Firmware update on disc: 6.60 (2011-10-05),
25.6 MB".

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0149QcTVgZEXKXbgHyvXF4ZY
2026-08-23 16:44:38 +02:00
Henrik Rydgård c5e4d0d90d Rename the get-memory-pointer functions to make it clear where CPU exceptions can happen. 2026-08-12 14:06:16 +02:00
Henrik Rydgård f15f8453f0 ISOFileSystem: fix path table re-read bug and validate directory entry size
Ioctl's ISO9660 path table read re-read sector `block` (the first
sector, already consumed by the preceding ReadBlocks) for the trailing
partial sector instead of `block + blocks`, returning duplicated data
from the start of the table instead of its actual tail.

ReadDirectory() advanced by the raw on-disk dir.size without checking
it's at least as large as the record's own header+identifier. A
crafted directory sector could set dir.size = 1 repeatedly, making the
loop reinterpret the same overlapping bytes as many separate entries -
allocating far more TreeEntry objects than the sector's actual size
should allow.
2026-08-11 08:57:15 +02:00
Henrik Rydgård e9d5e451fb Avoid some unnecessary error reporting while loading ISOs for the file browser 2026-05-31 23:31:06 +02:00
Henrik Rydgård 935a50ac59 ISO file system: Clean out version numbers from filenames.
Followup to #21599
2026-04-27 12:36:58 +02:00
Henrik Rydgård 0e55129fab Prepare for dumping NPDRM isos, use shared_ptr to manage lifetime of BlockDevice 2026-03-19 13:59:04 +01:00
Henrik Rydgård b7ad74d309 MetaFileSystem: Turn another argument into string_view 2026-02-25 00:52:25 +01:00
Henrik Rydgård 22bfa0087c Minor code cleanup 2026-02-25 00:52:25 +01:00
Henrik Rydgård f8077347e4 FileSystems: Change multiple internal functions to take std::string_view 2026-02-06 12:31:49 +01:00
Henrik Rydgård c85496c84d ISOFileSystem: Some const correctness 2026-02-06 12:00:53 +01:00
Henrik Rydgård 841e4c8564 Add various checks trying to avoid various crashes found in Google Play crash reports. 2026-02-05 11:12:53 +01:00
Henrik Rydgård 5f7a937466 Rename ValidSize to ClampValidSizeAt 2025-12-30 20:31:07 +01:00
Henrik Rydgård 08d1e0b3d8 Logspam cleanup 2025-04-17 11:06:06 +02:00
Henrik Rydgård 41b77bf1ae More log cleanup 2025-04-14 22:27:51 +02:00
Henrik Rydgård ef386ac4c5 Add "GetFileInfoByHandle" function to (many) file systems 2025-03-19 10:42:30 +01:00
Henrik Rydgård c91169e702 Restore removed <algorithm> includes.
Turns out these were needed after all. For some reason, on Windows and
Mac, <algorithm> gets auto-included by something else so I don't notice
when it's missing, and MSVC's include dependency tracker doesn't see it
either.
2024-12-19 09:53:07 +01:00
Henrik Rydgård 3e198c53b2 More include cleanup 2024-12-18 13:57:26 +01:00
Henrik Rydgård 1eadea2589 Show the filesystem types and origins in the list (except ISO) 2024-11-26 00:36:58 +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
Florin9doi 777569e4c4 Fix Go!Explore🗺️🧭 issue with GetDirListing(/); closes #15932 2024-01-04 14:47:07 +02:00
Henrik Rydgård 2193dcafc3 Remove wrong reserve call. Fixes new crash reported in #15932 2024-01-02 11:10:23 +01:00
Herman Semenov b871e76d05 [Core/Debugger/FileLoaders/FileSystems/MIPS] Using reserve if possible 2023-12-15 13:59:19 +03:00
Herman Semenov af41281761 [Core/Dialog/ELF/FileSystems/HLE/HW/Util] Added const reference for function params 2023-12-14 14:22:24 +03:00
Henrik Rydgård 63144340f5 First-boot memstick screen: Attempt to fix some logic holes
This handles some cases better that I don't really see how they can
happen, but who knows. Intended to help #17683
2023-07-12 11:29:24 +02:00
Henrik Rydgård a920b6100c Improve logging about corrupt ISOs 2023-07-12 10:22:53 +02:00
Unknown W. Brackets dea9cac16c Core: Add range checks to some helpers and similar. 2023-01-09 16:56:18 -08:00
Unknown W. Brackets 4942692558 Io: Provide directory existence with listing.
Sometimes, you need to tell the difference between an empty directory and
one that doesn't exist at all.  We can do this in a single call.
2022-10-09 14:42:31 -07:00
lainon fec708489a Correct cleaning string and remove unused vars 2022-09-30 12:26:30 +03:00
Henrik Rydgård e6403d7157 Split GetPointer into two versions, to help with const correctness 2022-07-24 13:26:19 +02:00
Unknown W. Brackets c766536914 Io: Show message if files are outside valid ISO.
This should catch more cases of a corrupt ISO file.
2022-07-11 18:58:57 -07: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
Henrik Rydgård 025bcb1673 Introduce Path, start using it all over the place.
Still lots left to convert!

Convert GetSysDirectory to return Path.

More buildfixing

Remove unnecessary Path( constructors
2021-05-13 10:39:16 +02:00
Unknown W. Brackets 1aae6e5ffc Io: Prevent error on bad handle for DevType(). 2021-04-21 20:11:23 -07:00
Unknown W. Brackets 788e8c3bbc Io: Truncate reads/writes to valid memory.
A PSP might crash in these cases, but it's better if we avoid a crash.
2021-02-13 08:24:39 -08:00
Unknown W. Brackets 49e9400670 Io: Consistently use LE values of ISO entries.
Better to be consistent across big endian and little endian, in case
something was mastered wrong.
2021-01-30 12:00:40 -08:00
Gleb Mazovetskiy 093a36eec5 Fix alignment issues in ISOFileSystem
Fixes #14002
2021-01-30 00:28:34 +00:00
Henrik Rydgård 26ba65f385 Some minor logging improvements that get to tag along the previous commit 2020-08-22 00:32:51 +02:00
Unknown W. Brackets b8342fb8ec SaveState: Rename ChunkFile files to Serialize.
Makes more sense and less weird than ChunkFileDoMap, etc.
2020-08-10 08:04:05 +00:00
Unknown W. Brackets 4b4e3432cd SaveState: Split Do() into a separate header. 2020-08-10 08:03:41 +00:00
Henrik Rydgård c5e0b799d9 Remove category from _assert_msg_ functions. We don't filter these by category anyway.
Fixes the inconsistency where we _assert_ didn't take a category but
_assert_msg_ did.
2020-07-19 20:33:25 +02:00
Unknown W. Brackets d7ad43b1d9 Io: Cleanup access bits for files.
Also, we default a lot of these members, so don't need to reset.
2020-05-21 18:58:24 -07:00
Unknown W. Brackets 49abe9ed6c Io: Open sce_lbn references and whole ISO faster. 2020-05-21 18:58:24 -07:00
Unknown W. Brackets c829ccb87d Io: Track whether the game is on a UMD or storage. 2020-05-21 18:57:46 -07:00
Unknown W. Brackets 913121cf2b Io: Consistently use error codes with OpenFile().
This gets rid of OpenWithError(), and just always returns a negative value
on error for OpenFile().  Also fixed the sequence rollover, which could've
returned 0.

0 should be considered a valid handle ideally, but left it never returning
0 to simplify cleanup in some areas.
2019-10-20 11:03:37 -07:00
Unknown W. Brackets 45516783f6 Io: Return error code for write attempt to UMD.
Previously, we were returning file not found (because 0), which was not
correct.  We were also allowing write handles to sce_lbn.
2019-10-20 10:36:13 -07:00
Unknown W. Brackets ce6cb7e7c9 Core: Report disc read errors to the user.
At least when we can detect this, better not to keep silent about it.
2018-09-29 00:45:50 -07:00
Henrik Rydgard 792dd1557c Improve StorageFileLoader enough to actually kind of work 2017-03-23 10:02:28 +01:00
Henrik Rydgard d64f367e1d Assorted warning fixes 2017-03-05 10:52:45 +01:00
Unknown W. Brackets 5fcf6ee012 Provide clearer errors for invalid ISOs. 2016-06-04 22:10:47 -07:00
Henrik Rydgard d4e432dadd Fix issue with lazy loading directory entries. Fixes #8613. 2016-03-06 14:28:14 +01:00