Commit Graph
53 Commits
Author SHA1 Message Date
libretroadmin f1208a7a5a Make threading lock-free
The core and the headless tools no longer use mutexes, condition variables,
spinlocks, std::atomic, std::thread or volatile flags. Threads hand off through
libretro-common's retro_atomic and rthreads plus a few small pieces on top of
them in Common/Thread: Thread, MpscQueue, EventCounter, ParkingLot waits and
ReaderGate. Every wait blocks until it's woken; nothing polls on a timer.

State that only one thread touches just loses its lock. The PSP filesystem,
sceIo and the savedata dialog now belong to the emulation thread: async reads
and writes run when they're queued and complete later in emulated time, and
the IO and savedata threads are gone. The friend finder only talks to the
adhoc server and hands what it gets to the emulation thread. GPU init always
runs on the thread that starts the game.

The Vulkan render and compile queues, pipeline and render pass caches, delete
list and SPIR-V cache, the GL render queue, the software renderer's jit caches,
the file loader caches, the web debugger, UPnP, input, savestates, logging and
the GE debugger all hand off through queues and atomics. The IR jit's spinning
profiler thread goes.

A CPU thread with nothing to run now sleeps until work is queued instead of
spinning. Headless with --debugger waits for a client while stopped, and ends
the run once every client that connected has left. Web server shutdown keeps
servicing the CPU queue until the server has finished.
2026-10-09 04:56:16 +02:00
Henrik RydgårdandClaude Opus 5.5 52e47f8e39 OSK: Check the request and output like the firmware, fix native box races
- InitStart checks the address and size the way sceUtility_Driver does
  (0x40 and 0x44 are both fine, utility/dialog/sizes) and that the field
  struct is in memory.
- The input text was read up to a terminator with no limit and no memory
  check, and the output was written through an unchecked pointer every
  Update. Both are bounded and checked now.
- Converting a string to UTF-8 checked for room before each character, then
  wrote up to three bytes and a terminator, overflowing a 2048-byte stack
  buffer on long non-ASCII text (both conversions did).
- An output buffer of length 0 made FieldMaxLength wrap around, and the
  keyboard preview then indexed the text at -1.
- The native input box's callbacks captured the dialog and could write into
  it after it was deleted, and its status was read and written without the
  lock. They now share a small state object instead, a new one per start
  and per state load (unless a box is still open, which answers into the
  loaded state).
- Savestates keep the current keyboard and the Korean combining state. With
  older ones, it picks a keyboard the field allows, as Init does.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 12:50:41 -06:00
Henrik Rydgård 80b09aa478 Remove unnecessary c_str(), minor cleanup 2025-01-04 13:15:55 +01:00
Henrik Rydgård 1b73f68a44 Make PSPOskConstants.cpp not binary anymore 2025-01-04 11:35:54 +01:00
Henrik Rydgård eccd7f3767 More const/static-ification 2024-09-17 15:22:37 +02:00
Henrik Rydgård 4a2a9830a6 PSPOskDialog: Add sanity check.
Also shrinks some arrays.

Fixes #17313

(We really should somehow get rid of marking this file as binary in
.gitattributes).
2023-04-21 09:12:06 +02:00
Unknown W. Brackets f44852bb18 Global: Cleanup virtual/override specifiers.
Also missing virtual destructors, hidden non-overrides, etc.
2022-12-10 21:13:36 -08:00
Henrik Rydgård 70b9dcc9a3 Initialize a bunch of Dialog structs 2022-08-18 16:46:22 +02:00
Unknown W. Brackets 88fe2e9863 Dialog: Use dialog type header more consistently. 2021-02-27 13:43:12 -08:00
Unknown W. Brackets aa13f5afb7 Dialog: Track type id on dialog class. 2021-02-27 12:01:52 -08:00
Henrik Rydgård 75cdc11fdb Text input: Clearly use 16-bit chars like the PSP, don't rely on wchar_t. 2020-03-22 16:44:19 +01:00
Unknown W. Brackets 998f95786a Android: Enable native keyboard for OSK.
And make Windows/Qt follow the same async behavior for input boxes.
2020-03-09 18:59:53 -07:00
Henrik Rydgård a71fbccfbc Warning fixes for new LLVM on mac (warns on inconsistent usage of override) 2015-09-17 20:29:37 +02:00
Chin 37f50a3792 Change to pass some arguments by reference 2015-03-01 16:49:00 +01:00
Lioncash cac632424c Core: Add missing override specifiers 2014-12-08 15:20:31 -05:00
The Dax 87c6260860 OSK: Let square serve as a spacebar. 2014-03-13 10:49:38 -04:00
lioncash b9886942a7 Fix some vertical alignments in misc Core source files. 2014-03-03 11:16:53 -05:00
Unknown W. Brackets 1f5639a489 Add a delay for status changes to the OSK.
I cut down the init delay because it's really annoyingly long.
2014-02-08 17:44:13 -08:00
Unknown W. Brackets 7add81fbd2 Use USING_WIN_UI instead of _WIN32 for differences.
Just makes the code clearer and probably helps other UIs work on Windows
more easily.
2014-02-08 16:38:45 -08:00
Sacha 108edd4093 Buildfix for Windows Qt. Enable PSP model SLIM on Symbian (works fine due to lack of mmap). 2013-12-10 18:49:25 +10:00
Henrik Rydgard 1ec0a977e4 Fix too-slow fade in/out of save dialogs and others in 30hz games. 2013-10-16 18:54:40 +02:00
The Dax a7a416fa88 Pull language names from langregion.ini. 2013-09-25 17:17:17 -04:00
The Dax 546a506c62 Be consistent with braces. 2013-09-25 16:52:18 -04:00
The Dax 7b6414e78d Overhaul the OSK. Select now acts as a shift button(swaps between upper/lower case; in the case of Korean, it does nothing. In the case of Japanese, it swaps Katakana/Hiragana). R Trigger now acts as a language selector, cycling through the 5 keyboard languages(English, English full-width, Japanese, Korean, Russian). 2013-09-25 16:18:07 -04:00
The Dax 90c21a370c Add Full-width Latin keyboard(upper and lower cases), and allow OSK to input characters as long as it's <= FieldMaxLength. This should allow Valkyria Chronicles II to have correct password entry on all platforms. 2013-09-25 13:50:50 -04:00
The Dax d549337080 Tidy up some newlines. 2013-08-06 19:40:59 -04:00
The Dax 78ab002fde ifdef away NativeKeyboard for non Win32 platforms, for now. 2013-08-05 21:50:21 -04:00
The Dax 80953ac56d Win32: Enable user to change emulated PSP nickname from the menu screens by popping a dialog box.
Win32: Enable user to bypass the in-game OSK by using the same dialog box. It doesn't support non-Roman characters yet.
2013-08-05 21:39:06 -04:00
Unknown W. Brackets 0b5bdeb1d3 Fix some compile failures under big endian. 2013-07-28 21:04:17 -07:00
Unknown W. Brackets 777074cfe1 Switch to _le memory layout specs in dialogs. 2013-07-27 15:30:18 -07:00
aquanull b5440ecb65 Unify some common elements of dialogs. 2013-06-10 21:24:49 +08:00
Unknown W. Brackets fc51cf2e5e Fix OSK on Android, wchar_t is not always 16 bits.
Fixes #2073.
2013-06-04 22:39:42 -07:00
Unknown W. Brackets 9eea30c52d Fix some small warnings in OSK code. 2013-06-02 15:09:17 -07:00
Unknown W. Brackets 9eb2238704 Use a PSPPointer in OSK to simplify things. 2013-06-02 15:03:15 -07:00
Sacha c2ef287f51 Buildfix for Symbian/Meego and other platforms. 2013-06-01 17:10:22 +10:00
mgaver 58a3218f54 Update PSPOskDialog.h 2013-04-24 18:00:47 +09:00
mgaver 2dd7c17009 Update PSPOskDialog.h
Add function "CombinationKorean"
2013-04-24 08:33:06 +09:00
mgaver 1525bc696f Update PSPOskDialog.h
Add Korean keyboard and Russian keyboard.
2013-04-23 23:24:42 +09:00
mgaver e22f8d516e Update Japanese On Screen Keyboard 2013-04-22 18:02:52 +09:00
Unknown W. Brackets 7baf27bbc3 Toggle keyboards for uppercase, as users expect.
Also should make l10n here easier.
2013-04-20 15:05:18 -07:00
Unknown W. Brackets 75d8eca76f Prefill the OSK when requested to. 2013-04-20 15:03:33 -07:00
Unknown W. Brackets 27cf72afb6 Add more error checks for OSK, fix field length. 2013-04-20 15:03:32 -07:00
Unknown W. Brackets f8d726c5ea Validate OSK struct size and don't do copying.
The PSP itself only allows the correct size struct.
2013-04-20 15:03:32 -07:00
Unknown W. Brackets 0cceca05a1 Convert the OSK params to utf-8, not ASCII. 2013-04-17 22:51:06 -07:00
lioncash 19984031f6 These two variables should be unsigned. It doesn't make sense for them to be signed.
I'm pretty sure having a negative maximum allowable text output limit wouldn't happen.
Also, I'm pretty sure an output length won't be negative.

These also get rid of some typecasts.
2013-01-29 09:03:22 -05:00
Unknown W. Brackets fd2f609367 Save the savedata and other dialog state.
Although, hopefully it wouldn't be running anyway.
2012-12-28 13:55:31 -08:00
Unknown W. Brackets f8f581794f Make sure sceUtility funcs all return error codes.
Right now, everything is 0, but before it wasn't returning anything.
Returning 0 actually made some games start working right.
2012-12-25 01:07:04 -08:00
Unknown W. Brackets f2cb19d7ba Switch OSK to using a std::string buffer.
Back as a class member, hurray.
2012-12-23 08:52:51 -08:00
Unknown W. Brackets 4bc06562d6 Move OSK inputChars to global, fixes release crash.
Also, assorted potential crash fixes / etc.
2012-12-22 22:41:51 -08:00
TMaul 8586bb30b6 Make some vars class members 2012-12-22 19:58:47 +00:00