Commit Graph
172 Commits
Author SHA1 Message Date
Henrik Rydgård 00939f76fc sceFont: Only require the fonts the running game's firmware could have
The disc-updater install ran when ltn0.pgf was missing, so a font set unpacked
from an old UMD looked complete forever, and a later game wanting a font its own
firmware added silently got a bundled substitute instead.

Requiring the whole registry doesn't work either: firmwares older than a font
can never satisfy it, so we'd unpack the same updater on every launch and
announce it each time. What settles it is that a game can't ask for a font that
didn't exist when it was made. Record the earliest firmware known to ship each
font in the registry, and only require the ones the running game's firmware
would have had.

The version comes from PARAM.SFO's PSP_SYSTEM_VER, with the bundled updater's
version as a fallback. That keeps the whole thing stateless - nothing recorded
that could go stale when flash0 or the ini gets moved around.

Survey of a large library, unpacking flash0:/font from each disc's updater
across firmware 1.50 to 6.60: jpn0 and ltn0..ltn15 are in every one of them, and
kr0.pgf is the only registry font that arrived later - absent in 1.50, present
from 1.52.

Uses one directory listing rather than a stat per font, since on Android's
scoped storage the individual checks are slow.
2026-09-05 09:36:26 -06:00
Henrik RydgårdandClaude Opus 5 a641305c75 sceFont: use the fonts in NAND, and take them off the disc if we have none
sceFont never looked at flash0:, so a firmware the user installed was
ignored and we always fell back to our bundled substitutes - despite
the "ignoring NAND" warning suggesting otherwise. It reads flash0:/font
now, after the game's own fonts and the classic ms0 override.

And if there's nothing in NAND, we unpack just flash0:/font out of the
firmware updater on the running disc, which most UMDs carry. That turns
"install a firmware first" into something that happens by itself for
anyone playing a retail game.

EmulatedModelGeneration moves from InstallUpdateScreen into PSARUnpack
so both callers pick the same firmware file list.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JvJR8oJNSCimCM9KXVLjfq
2026-09-04 18:35:07 -06:00
Henrik Rydgård 632fa10b23 Use VFS directly to read HLE-sceFont fonts instead of relying on the flash0: mount 2026-08-24 09:30:42 +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 0596ee97f6 More memory access cleanup 2026-08-11 20:14:01 +02:00
Henrik Rydgård dbe6ec80a0 Fix some bad "for (auto x : y)" usage 2025-04-29 16:46:14 +02:00
Henrik Rydgård 4e25f44eef Rename some module-related functions to include HLE where appropriate 2025-03-31 11:17:50 +02:00
Henrik Rydgård 82728652d8 Move Font and Psmf error codes to the big enum 2025-03-21 20:44:46 +01:00
Henrik Rydgård 7e3e944e3b Update GetSecondBufferInfo 2025-03-05 17:02:46 +01:00
Henrik Rydgård 82780b6d2a More logging cleanup in sceFont 2025-03-02 02:28:45 +01:00
Henrik Rydgård 28b2c7f540 HLE log rename part 1: Remove duplicate log functions. Return type should be determined by metadata. 2025-01-29 09:45:39 +01:00
Henrik Rydgård e24317b20b A lot more logging fixes 2025-01-20 12:20:21 +01:00
Henrik Rydgård 2523690584 Flip around so sceDelayResult is always outermost. Start using HLECall. 2025-01-20 12:20:18 +01:00
Henrik Rydgård 5f5ad32f7e Start cleaning up logging 2025-01-19 12:10:57 +01:00
Henrik Rydgård 3e198c53b2 More include cleanup 2024-12-18 13:57:26 +01:00
Henrik Rydgård 83af54950f Move more core-related stuff into Core.cpp/h 2024-12-08 11:54:58 +01:00
Henrik Rydgård 2e85eb5128 More static code analysis fixes 2024-10-28 17:59:06 +01:00
Herman Semenov 192650f551 [Core/HLE/GPU/D3D11/GLES] Using for based loop C++17 and replaced on structured binding map C++17 2024-09-18 11:10:10 +02:00
Henrik Rydgård a1010e3b2e Add some more checks in sceFont 2024-07-20 10:42:01 +02:00
Henrik Rydgård 30c768a966 sceFont: Improve debug asserts 2024-07-20 10:32:02 +02: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
Herman Semenov 2a31f8c6c0 [Common/Core/HLE] Object out of scope optimization for better codegeneration (lower level scope) 2023-12-20 12:33:56 +03:00
Herman Semenov 315340fc62 Using const reference for C++17 range-based loop and freq used objects 2023-12-13 17:33:01 +01:00
Henrik Rydgård 731d9b6d59 Merge branch 'master' into Font-ltn12-hack 2023-08-17 14:47:46 +02:00
Henrik Rydgård 66d2fb2aa4 Reduce logspam from fonts, and a less angry error message for missing textures.zip. 2023-03-16 23:12:46 +01:00
sum2012 aa047233e1 Add font's logging of requestedStyle 2023-01-28 01:58:52 +08:00
sum2012 ad83a5a201 Add more logging in sceFontFindOptimumFont
Will easier to compare real psp's font
2023-01-26 05:30:47 +08:00
Unknown W. Brackets 7ed238a0b7 Font: Avoid late load on save state.
If they weren't loaded yet, we can stay that way.
2023-01-01 10:25:05 -08:00
sum2012 0e52856faf Merge remote-tracking branch 'upstream/master' into Font-ltn12-hack 2022-10-16 07:27:12 +08:00
Unknown W. Brackets 6fd2940376 Font: Reduce internal font loading IO.
Improves startup for games that load sceFont on devices with slow storage.
2022-10-09 14:42:31 -07:00
Unknown W. Brackets 79c7a91d98 Font: Remove needless ReadStruct(). 2022-09-03 10:44:11 -07:00
sum2012 112951e6bd Fix Earth Saver Plus font 2022-08-14 20:31:45 +08:00
Unknown W. Brackets f16d6c6011 Font: Correct uninitialized values. 2022-08-13 08:10:46 -07:00
Unknown W. Brackets 10ffdc9f54 Font: Cleanup logging for invalid pointers.
Also fixes some duplicate logging and includes return code/error code.
2021-09-13 08:29:45 -07:00
Unknown W. Brackets 9882f2854a Font: Match stingy selection per test. 2021-08-07 17:55:21 -07:00
Unknown W. Brackets 0772557a49 Font: Limit max references to fonts.
This seems to match the font/open test behavior.
2021-08-07 17:55:21 -07:00
Unknown W. Brackets cb5954c9e3 Font: Delay only on first open of internal font. 2021-08-07 17:55:21 -07:00
Unknown W. Brackets 323d06bbc2 Font: Reuse alloc when reopening internal fonts.
As shown in the font/open test.
2021-08-07 17:55:21 -07:00
aliaspider 9a3e5879bb Global: Correct many endian types and casts. 2021-02-18 22:25:24 -08:00
Unknown W. Brackets f32f89dd90 Global: Remove some unused variables. 2021-02-15 11:59:45 -08:00
Henrik Rydgård ccc0331279 Move timeutil to Common. (Experiment to see how much work it is to move these). 2020-08-15 20:53:08 +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 1dc5ee424b SaveState: Split out Do types to reduce headers. 2020-08-10 08:03:44 +00:00
Unknown W. Brackets 4b4e3432cd SaveState: Split Do() into a separate header. 2020-08-10 08:03:41 +00:00
shenweip d1cafd103c Use the alloc size from real PSP for FONT_OPEN_INTERNAL_STINGY mode. the 2020-07-22 23:47:29 +08:00
Unknown W. Brackets e6b42f3921 SaveState: Prevent edge case on old save state.
If we load an old save state and it errors, could crash.
2020-06-29 19:40:54 -07:00
Unknown W. Brackets 54e1afda1e HLE: Make calling mips funcs simpler.
This makes their return value handling, scheduling, etc. more
straight-forward.
2020-03-22 06:59:43 -07:00
Henrik Rydgård 0d2acb6d73 Merge pull request #12740 from unknownbrackets/font-minor
Font: Prevent crash on game exit
2020-03-21 23:11:34 +01:00
Unknown W. Brackets 000a166dba Font: Prevent crash on game exit.
We should not try to call __KernelDirectMipsCall() on shutdown.
2020-03-21 12:36:09 -07:00
shenweip fc55d2b81b Correcting return value of some mipscalls without after action. 2020-03-18 16:58:07 +08:00