mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-30 12:25:49 +00:00
AppKit, which SDL uses for windows, Metal surfaces, event pumping and game controllers, works only on the main thread, and a guest never hands its thread back. The macOS relinker emits a call to Aps5StartGuest as the entry of a relinked executable; no library provided it. - Aps5StartGuest runs the guest entry on a new thread with the stack size of the main thread (at least 8 MiB) and serves the main dispatch queue from the run loop of the main thread. The guest ends the process with exit; a guest entry that returns aborts. - Aps5RunOnMainThread runs a function on the main thread and waits for it, or in place where the main thread is the caller or Aps5StartGuest was never called. - libSceVideoOut sends its SDL calls through OnMainThread, which carries the exceptions back to the caller: the initialisation and shutdown of the video and game controller subsystems, the window, its Vulkan surface and drawable size, the event polling and the pad, mouse and keyboard input, which are created and destroyed there. On the other platforms the functions run in place. - The flip test starts its tests through Aps5StartGuest on macOS, as a relinked guest does. Co-authored-by: mugurc <[email protected]>