Commit Graph
81 Commits
Author SHA1 Message Date
Henrik RydgårdandClaude Opus 5.5 5f261bd7ff Utility: Stand in for the HtmlViewer, offering to open the page in a browser
Instead of the PSP's web browser, a dialog shows the URL the game wants
and opens it in the host's browser on X, or backs out on O. Either way the
game sees the browser closed normally. Platforms that can't open a URL
(the new SYSPROP_CAN_LAUNCH_URL) only offer to back out. Only plain
printable-ASCII http(s) addresses are handed over, and on Linux without a
shell.

What the firmware does (sceUtility_Driver, 6.61, plus
utility/dialog/htmlviewer): the HtmlViewer has its own state apart from the
other dialogs, so they don't block each other, and its calls return
WRONG_TYPE until one has started. The request size picks the 2.00 to 3.00
layout, and InitStart allocates 3.5MB of user memory (4.5MB with options
bit 0x400 from 2.70 on), failing with 800200d9 without it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-09-25 12:50:23 -06:00
Henrik RydgårdandClaude Opus 5.5 3c15b2b112 Utility: One dialog at a time whatever its type, like the firmware
On a PSP, every InitStart fails with INVALID_STATUS until the last dialog
started is back at NONE, including while it's shutting down, and before
its params are checked. A failed InitStart leaves the current type alone.
We returned WRONG_TYPE instead, and a failed InitStart (e.g. a bad size)
still switched the current type, so every later dialog was refused. (One of
ours that fails after already starting, as savedata can, still becomes the
current type, since the game may poll it.)

The busy check applies status changes that are due, but doesn't use up an
auto status dialog's one-time INITIALIZE/SHUTDOWN reports; one that only
waits to report SHUTDOWN is let finish. Auto status dialogs now release
volatile memory on the way to NONE, including when the game saw RUNNING
before the init thread was done, which used to leave it locked for the next
dialog. GamedataInstall no longer requires currentDialogActive, which its
ShutdownStart cleared even when it then failed, so it could never finish -
and would now have blocked every other dialog.

Also: MsgDialog accepts exactly the three sizes sceUtility_Driver does (we
memcpy'd whatever size was given), and HtmlViewer GetStatus answers
WRONG_TYPE.

Adds utility/dialog/status and utility/dialog/priority, recorded on a PSP.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-09-25 12:50:23 -06:00
Henrik RydgårdandClaude Opus 5.5 ec00700730 Dialog: Fade in 200ms like the firmware, and accept input while fading in
On a PSP, dialog animations advance by animSpeed frames per Update and the
fades take about 200ms. Ours took 500ms (1/30 s per animSpeed, over
FADE_TIME 1.0), and all input was ignored until it finished, which made
dialogs feel sluggish, noticeably so in 30fps games. Input is still
ignored while fading out, once a choice has been made.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-09-23 19:25:24 -06:00
Henrik RydgårdandClaude Opus 5.5 20970d5fad Dialog: Follow the firmware's thread priorities in init/shutdown
On a PSP, dialog init and shutdown happen partly at the accessThread
priority and partly at the graphicsThread priority, one phase after the
other. Model that with one helper thread that switches priority per phase,
and let starting it reschedule normally instead of disabling interrupts.

A caller with worse priority than both now sees shutdown complete inside
ShutdownStart, as on hardware. NFL Street 3 (graphics 17, access 19,
caller 111) calls the next InitStart right after ShutdownStart and used to
loop forever on 'A save request is already running' (#19957). The utility
pspautotests, where the caller has better priority, are unchanged.

Also logs the dialog thread priorities at debug level.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-09-23 19:25:24 -06:00
Henrik Rydgård e9a3449ede More MIPSState * plumbing (manual) 2026-08-12 14:02:19 +02:00
Henrik Rydgård 198d86a9b1 Move the PSP system language logic into sceUtility. 2025-11-04 11:48:47 +01:00
Henrik Rydgård 7dde367ead Improve logging in sceUtility *GetStatus functions 2025-08-06 17:45:39 +02:00
Henrik Rydgård e2bfc48886 Sanity checks in Vulkan backend, PSPDialog 2025-05-14 00:39:00 +02:00
Henrik Rydgård b2b0ff1753 Consolidate error codes in ErrorCodes.h 2025-02-04 11:53:00 -06:00
Henrik Rydgård 2a924ff4df Logging fixes, buildfix on some systems 2025-01-21 12:55:32 +01:00
Henrik Rydgård ca54fe9234 Deduplicate some code, fix some style 2025-01-14 12:38:20 +01:00
Henrik Rydgård eccd7f3767 More const/static-ification 2024-09-17 15:22:37 +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
Henrik Rydgård c5791764d8 Make the i18n T function use std::string_view
Buildfixes, crashfixes

One more

Android buildfix

Buildfix Qt
2024-02-12 18:44:39 +01:00
Henrik Rydgård eb14c87a71 Allow configuring the game language separately from the PPSSPP UI language, with a new setting. 2023-07-23 11:30:04 +02:00
Henrik Rydgård ee6234ecb6 I18N: Switch to getting categories by index instead of by string lookup
Also gets rid of the shared_ptr usage, and generally makes things nicer.

Needed for later config refactorings, good to get in early.
2023-04-07 10:35:01 +02:00
Unknown W. Brackets d7732f7fd7 Dialog: Warn when ignoring the dialog language. 2023-02-08 19:04:18 -08:00
Unknown W. Brackets fcc1abc7c3 Dialog: Update by button flag consistently.
Always check for the flag to change in Update().
2023-02-08 19:02:37 -08:00
Unknown W. Brackets 87172f9dd5 Dialog: Fix confirm/cancel button reversal. 2023-01-01 09:34:13 -08:00
Henrik Rydgård 5b3a993db7 Typo fix 2022-11-28 09:50:23 +01:00
Henrik Rydgård 21647cd3c1 Blind workaround for Shining Ark circle button problem
Seems the game might not handle the case of confirm button being set to
cross properly, so force it to circle if this game is running.

Fixes #15663 (hopefully..)
2022-11-27 23:32:43 +01:00
Unknown W. Brackets f530be0969 Dialog: Prevent reschedule on shutdown start.
This is a bit strange, but tests seem to suggest this is correct.
A worse priority thread won't run before savedata shutdown hits 0, but the
thread that initiated shutdown runs before shutdown completes.

Fixes Freakout Extreme Freeride loading savedata.
2021-08-14 20:15:34 -07:00
Unknown W. Brackets aecb138f90 Dialog: Avoid crash with hacked dialog start.
See #14727.  If a dialog shutdown is in progress and we incorrectly allow
a startup at that time, it breaks other things.  This tries to at least
work around that.
2021-08-14 07:46:38 -07:00
Unknown W. Brackets 90f4098b3d Dialog: Lock volatile on thread.
This means it doesn't matter if GetStatus is called.
2021-04-07 18:13:51 -07:00
Unknown W. Brackets 429b4594d0 Dialog: Use a thread to init dialogs too. 2021-04-07 18:13:46 -07:00
Unknown W. Brackets 88fe2e9863 Dialog: Use dialog type header more consistently. 2021-02-27 13:43:12 -08:00
Unknown W. Brackets 52c5f4bf95 Dialog: Respect accessThread priority on shutdown.
This influences shutdown timing.
2021-02-27 13:15:12 -08:00
Unknown W. Brackets aa13f5afb7 Dialog: Track type id on dialog class. 2021-02-27 12:01:52 -08:00
Unknown W. Brackets 2b9b157151 Savedata: Eat cycles in savedata shutdown start. 2021-02-27 10:35:26 -08:00
Unknown W. Brackets 2a9dde684d Dialog: Unlock volatile without Update call.
Crisis Core depends on this unlocking, likely it should really be on a
thread.
2021-02-16 19:15:09 -08:00
Unknown W. Brackets d2348897cb Dialog: Clear volatile memory on unlock.
Approximates firmware behavior.
2021-02-15 14:08:16 -08:00
Unknown W. Brackets e42dac2fb4 Dialog: Simulate volatile memory lock behavior.
Also simply clear to zero, which isn't exactly correct but should be
fairly close.  See #8288 (NBA Live 08 hang.)
2021-01-18 11:07:21 -08:00
Unknown W. Brackets 8bd32b6009 Dialog: Manage status only through accessors. 2021-01-18 10:46:57 -08:00
Unknown W. Brackets 4573907098 Savedata: Prevent garbage bleeding into save icons.
This pads out the icon data and also fixes a potential buffer overflow
during image data copy.
2021-01-03 16:26:31 -08:00
Henrik Rydgård ff8148dd92 Move native/util, native/data and native/i18 to Common/Data.
Also move colorutil.cpp/h

linking build fix experiment

Delete a bunch of unused CMakeLists.txt files

CMakeLists.txt linking fix

Don't include NativeApp.h from any headers.

Android.mk buildfix

Half of the UWP fix

Buildfix

Minor project file cleanup

Buildfixes

Guess what? More buildfixes!
2020-10-04 07:28:29 +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
Unknown W. Brackets 143ba22097 PPGe: Handle text shadows more consistently.
Don't really want them wrapping differently or etc.  Let's handle
centrally so we can make them consistent and better.
2020-07-13 18:20:57 -07:00
Unknown W. Brackets 4f586f9567 PPGe: Left align messages in dialogs.
It was previously left aligned, but the TextDrawer was being told to
center.  These are meant to just center the enclosing box of text, not the
individual lines within.

Makes Final Fantasy 3 look a lot better.
2020-05-23 19:59:56 -07:00
Henrik Rydgård 45d94c4877 Switch all images to dynamic lookup in the atlas by string ID.
SLN fix

It works, but with the wrong images and the wrong characters!

Fix another bug in atlastool's binary output

Get Android building again.

Oops, didn't mean to disable this permanently.

Error checking

Minor cleanup

Gotta tweak my git ignores...

Regenerate metadata
2020-03-01 12:06:47 +01:00
Unknown W. Brackets 5009698cc0 Core: Use a shared_ptr for i18n categories.
This does not make them thread safe, but it reduces the chances of a crash
a bit (see #12594.)
2020-02-09 07:35:16 -08:00
Henrik Rydgård 21fe73c8e7 Switch strncpy to truncate_cpy in a bunch of places. 2017-05-26 19:04:08 +02:00
vnctdj d7eba2061e Consistently use *di for the Dialog i18n category 2015-07-01 23:26:55 +02:00
Unknown W. Brackets e30e8937c1 Make it possible to override dialog fade out.
Useful to show multiple osk dialogs.  Not sure if any game actually uses
this feature...
2014-02-08 17:44:14 -08:00
Unknown W. Brackets a0262a5263 Reset savedata to NONE when stopping emulator.
This way the second game you play won't hang.  Also fixes tests.  Oops.
2014-02-08 16:48:40 -08:00
Unknown W. Brackets 67b1aee1f8 Use a time delay to change sceUtility statuses.
This is probably more based on IO (maybe even loading and unloading
the module for the dialog or something?) but time should approximate it.

May improve games not expecting the status to switch right away.
2014-02-08 09:39:50 -08:00
Unknown W. Brackets 77acd0729f Use the latch in dialogs throughout.
This makes it so that rapid fire works for them as well.
2014-02-02 15:48:29 -08:00
Unknown W. Brackets 05ad9721d9 Allow msgdialog override of ok/cancel button text.
Per tests, and hints from JPCSP.
2014-01-23 01:02:41 -08:00
Henrik Rydgård 00c32ddadb Mostly get rid of including "Globals.h" 2013-12-30 10:17:11 +01:00
The Dax 9ea907d7b7 Update comment in PSPDialog::IsButtonHeld. 2013-12-14 19:05:19 -05:00