* initial shadnet client (based on my previous prs)
* some np_handler work mostly based on our previous pr
* improved login/logout event of shadnet
* added np_score support from previous pr
* friends and notifications ui
* clang is not my friend
* clang fix again
* added webapi support for shadnet
* applied metrik's fix
* clang
* fixed some wrong LOG_ERRORS
* updated emulator settings
* trying to fix npcommid bugs
* fixed npcommid
* improved NPcommid detection so it won't write null values to database
* metrik's suggestion
* removed one line
* more command types
* fixed duplicated log print
* fixed compile
* improved reconnection retries
* simplify error code
* stephen suggestion
* made friends hotkey
* fixup
* more proper handling of reconnecting
* fixed return code
* libSceMouse HLE v1
* fix getting event device id, init lib, logging
* rest of the mouse events
* lol how did it take me this long to notice this
* stop the hidden mouse from clicking on random shit
* yet another mouse state bug
* Implement merged mode
* Move RingBufferQueue to common/
* sir clang offnir, the all-formatting
* config option for this
* review comments
* NP Part 1: NPSignaling
PR Split 1 of X, adds the NPSignaling Library and some of the dependencies. Any stubs are highlighted by the stubs files and will be resolved upon other PRs. (Dependencies are to shadnet and further PR's to Matching2)
* PR Corrections
* PR Corrections 2
* PR Corrections 3
* clang fix
* Move to folder per request
* Reset controller colours on emulator shutdown
* bruh moment
* Don't use the destructor for this
* clang, formatter of night
* forgot to stage this file
* ffs
* fix tests
* fixed tests?
* gcn tests fixed?
* now?
* possible fixed
---------
Co-authored-by: georgemoralis <giorgosmrls@gmail.com>
* Only initialize logging once
* Swap LOG macros for std::cerr and std::cout use.
* Add quick exit when trying to log before logger init
* Revert "Swap LOG macros for std::cerr and std::cout use."
This reverts commit a14d46d383.
* Use fmt's functions instead of cerr
Makes the commits a tad cleaner.
* Revert macro change
If I remember right, the if check here was to make sure we didn't throw exceptions after terminating the logger, which can happen due to a race involving some debug libSceVideoOut logs.
* Oops
This code has been an absolute mess since the trophy rework. This eliminates several redundant loops through game trophy files, and separates the logic into it's own function.
* Remove old config backend
Trophy key migration now uses the toml library directly, like our config transfer code.
* Don't retrieve user_dir in main
No longer needed.
* Add proper SDK checks for language values
Fixes some crashes caused by otherwise valid languages in older titles.
* Rename firmware constants
Makes more sense this way, and works better in case we find an SDK check added in a more minor update.
Instead of 1.00 being 10, 1.50 being 15, and so on, this commit changes 1.00 to 100, 1.50 to 150, and so on.
* Claaaaang
* Fix for SignalTo behavior
Should run FindThread to make sure thread input is valid.
* Missing mutex-related exports
* Oops
* All missing cond exports
We have these implemented, so we might as well export them.
I also organized them a bit.
* Implement pthread_attr_getscope, pthread_attr_setcreatesuspend_np, pthread_attr_setscope
Also export all of our pthread_attr functions.
* Oops
* Fix SchedPolicy::Fifo definition
Some tricks FreeBSD source performs breaks with this incorrectly set.
Specifically, stuff like setting priorities breaks because we do array accesses with priority - 1 like FreeBSD, but Fifo being 0 makes that an oob read.
* Fix error checks in pthread_attr_setschedparam
* Fix and run thread destructors
_sceKernelSetThreadDtors receives the function itself, not a pointer to the function.
* Oops
* Rewrite pthread_rename_np for accuracy
There's a couple details the initial implementation missed that decomp shows. We weren't locking, we weren't doing the reference add or delete ops, and we were erroneously skipping null names when real hardware actually seems to allow it (the only thing real hardware skips for null name is naming the thread stack).
* Avoid changing common code by using the converted thread name instead
Slightly cleaner code
* Oops
* Flip priority defines
This better matches with FreeBSD's defines, and fixes the returns of sched_get_priority_min and sched_get_priority_max
* Fix args and return for sched_get_priority_max and sched_get_priority_min
Behavior is based on my own kernel decomp (though what I'm seeing matches what red_prig's done for fpPS4 too).
* Better comment
why not
* Fix error behavior of scePthreadGetPrio
Can error from invalid thread input, which the function hardcodes as an ORBIS_KERNEL_ERROR_ESRCH.
* Fix pthread_setprio
This should use the RefAdd and RefDelete functions on non-curthread threads, not FindThread.
* Remove pthread_set_name_np
Decomp shows it's identical to pthread_rename_np.
* Bring back pthread_set_name_np
What I didn't realize was that it was a void method. Behavior is the same as pthread_rename_np though, so call it instead of doing the direct common setname call.
* Move pthread_set_name_np
Needs to be under pthread_rename_np so I can actually call it.
* Better implementation of pthread_getname_np
* rwlock types
Some Sony extension to rwlocks, paired with a proper SDK check specific to rwlock init. I've implemented both pthread_rwlockattr_gettype_np and pthread_rwlockattr_settype_np, and added the relevant SDK check for rwlockattr type.
* Missing thread unlock in SignalTo
SignalTo specifically runs FindThread, then unlocks before running pretty much the same code as Signal.
* Fix comment
* sceKernelGetProcessType
* sceCoredumpRegisterCoredumpHandler stub
* Better stub for sceCoredumpRegisterCoredumpHandler, stub sceCoredumpUnregisterCoredumpHandler
* sceNpSetNpTitleId stub
* sceNpSetContentRestriction stub
* sceKernelMlock stub
* posix_sigfillset
* posix_sigprocmask stub
Just logs the how parameter
* posix_msync stub
Just logging for now
* libSceContentExport stubs
* Clang
* sceVideoRecordingSetInfo stub
* sceKernelTitleWorkaroundIsEnabled
* Provide title workaround bits
Just grabbed them from fpPS4 code, I have a feeling actually applying these is gonna be a bit of a pain though.
* fpPS4 has a 0x39 bit, I guess that was probably added after 12.52 though.
* Bump to error
It's not going to work without proper sceKernelGetAppInfo workaround data
* Clang
* Clang2
* Add IME keyboard layout and panel metrics support
- Introduced new header and implementation files for IME keyboard layout handling.
- Added structures for viewport metrics, keyboard grid layout, and drawing parameters.
- Implemented functions to compute viewport and panel metrics for the IME dialog.
- Enhanced the IME dialog UI to utilize the new keyboard layout and metrics.
- Updated input handling to support new keyboard interactions and layout adjustments.
- Added caret management and text normalization features in the IME dialog state.
- Improved window positioning logic to accommodate different screen resolutions.
* fix for Maxos Linux builds
* Align IME behavior with real PS4 libSceIme/Dialog flow
Features:
- Add validation helpers for IME option/language/extended-option masks
- Implement `sceImeGetPanelSize` sizing logic
- Replace `sceImeSetTextGeometry` no-op path with real state/argument validation
- Align panel sizing/validation paths closer to PS4 IME behavior
- Improve panel text/caret handling reliability during UI updates
- Add IME panel movement via controller right stick
- Support mouse drag repositioning for the panel
- Respect `FIXED_POSITION` by disabling movement when locked
Updates:
- Tighten `sceImeOpen` checks (user/type/input method, handler, work alignment, reserved, overlap)
- Validate initial/runtime text rules (`\n`/`\r` and surrogate rejection) in open/set-text paths
- Enforce caret bounds and null-caret behavior in `sceImeSetCaret`
- Update `sceImeUpdate` to return `NOT_OPENED` in invalid states and respect handler matching
- Harden `ImeHandler` against null state/callback execution paths
- Optimize keyboard grid rendering by reusing per-frame buffers
- Reduce input callback allocations with fixed-size buffers
- Harden panel update paths for invalid handler/open-state cases
- Clamp panel position to visible screen bounds
- Apply stick deadzone/speed scaling for stable movement
- Keep panel coordinates consistent with IME coordinate mode
* 🤦♂️
* Enhance IME UI and Input Handling
- Introduced BrightenColor function to adjust color brightness for UI elements.
- Improved UTF-16 character handling with new functions to count UTF-16 units and reject input based on UTF-16 limits.
- Added functionality to clamp input buffer to UTF-16 limits, ensuring text input does not exceed specified limits.
- Refactored virtual pad input handling to encapsulate left stick directions and panel movement.
- Enhanced IME UI drawing logic to incorporate new input handling and navigation features.
- Updated keyboard layout handling to support dynamic configurations and improved navigation shortcuts.
- Integrated additional font ranges for better language support in the IME, including Chinese, Arabic, and Thai.
- Improved overall code structure and readability by utilizing modern C++ features such as std::vector and std::array.
* Remove non existing Roboto Medium font from IME initialization
* Enhance IME Dialog and UI with Improved Gamepad Navigation and Key Mapping
- Added support for disabling gamepad input through OrbisImeDisableDevice in ImeDialogState.
- Updated ImeKbLayout to modify key mappings for better character input, including changes to punctuation keys.
- Implemented enhanced left stick navigation with repeat functionality in ImeUi, allowing for smoother input handling.
- Introduced new constants for stick navigation delays and repeat intervals to improve responsiveness.
- Refactored input handling logic to accommodate both virtual and gamepad inputs, ensuring consistent behavior across devices.
- Added functionality to clear all text in the input field with a specific shortcut, aligning with expected user behavior.
* clang
* Enhance IME functionality with improved gamepad navigation and layout handling
* ime: fix specials/accent layout mapping and dynamic panel resize handling
- Expand specials/accent keyboard layouts to a 7-row model and move function keys to fixed bottom rows.
- Add variable row-height support to the keyboard grid (`fixed_bottom_rows`, `bottom_row_h`) and compute row offsets/span heights from layout config.
- Preserve function-row height in `ime_ui` and `ime_dialog_ui` while distributing remaining height across typing rows.
- Make mode-switch focus layout-driven by resolving `SymbolsMode`/`SpecialsMode` action keys in the active layout instead of relying on implicit row assumptions.
- Track panel layout anchor deltas in `ime_dialog_ui` and use press-offset dragging so cursor remains on the originally pressed point when panel dimensions/position change.
* Add IME UI enhancements and shared utilities
- Introduced new states for panel navigation and selector fade in `ime_ui.h`.
- Added a new header file `ime_ui_shared.h` containing utility functions and structures for virtual pad input handling, including deadzone application and stick navigation direction resolution.
- Updated `font_stack.cpp` to include additional Unicode ranges for general punctuation in the font atlas.
* Refactor IME settings: remove deprecated accessibility options and update references to use new settings structure
* Refactor IME UI Navigation and Activation Logic
- Introduced a new mechanism for handling virtual button repeat actions, improving responsiveness for gamepad navigation.
- Added support for stick navigation with adjustable repeat rates and initial delays, enhancing user experience during input.
- Removed the ImeSelectorFadeState structure and related logic to streamline the IME keyboard layout drawing process.
- Simplified the activation logic for menus, ensuring that menu activation is more intuitive and responsive to user input.
- Adjusted the navigation threshold for stick inputs to improve sensitivity and control.
- Cleaned up the code by removing unused variables and consolidating repeated logic into reusable functions.
* Refactor IME UI shared header: streamline code and improve structure
- Removed unused includes and redundant structures.
- Consolidated virtual pad snapshot handling and input state management.
- Introduced new structures for OSK pad input and navigation handling.
- Updated function signatures for clarity and consistency.
- Enhanced keyboard parameter application for OSK shortcuts.
- Improved overall readability and maintainability of the code.
* Refactor OskShortcutActionResult to simplify triangle button press handling
* Enhance IME Keyboard Layout and UI Functionality
- Added new key glyphs for Shift and Caps Lock in ime_kb_layout.h.
- Improved keyboard navigation logic to skip non-action keys.
- Introduced new constants for selector IDs in ime_ui.cpp for better readability.
- Refactored keyboard row and column clamping logic for clarity.
- Enhanced selector drawing logic with fade and pulse effects for better user feedback.
- Implemented functions for cycling keyboard case states and toggling keyboard family modes.
- Added functionality to focus on keyboard action keys based on their actions.
- Improved edit menu handling with new templated functions for better code reuse.
- Updated caret blinking logic to improve text input experience.
- Expanded symbol ranges in font_stack.cpp to include keyboard symbols.
---------
Co-authored-by: w1naenator <valdis.bogdans@hotmail.com>
* cmake: apply sirit unused-command-line-argument flag only with Clang
* shader_recompiler: move Opcode magic_enum range customization to opcodes.h
Define the magic_enum range for Shader::Gcn::Opcode as a proper enum_range specialization in opcodes.h instead of relying on translation-unit macros in translate.cpp.
This makes the customization visible where the enum is used and avoids the GCC linkage/build issue.
* thread: use Windows thread naming path for MinGW-w64
Switch the thread naming guard from _MSC_VER to _WIN32 so MinGW-w64 builds use the Windows SetThreadDescription implementation instead of falling through the POSIX branch.
This matches the platform rather than the compiler and avoids the MinGW-w64 build issue.
* Restore old log filter behavior
Not sure exactly why this hadn't happened yet.
* Suggested change
* Update documentation to include changes
* Remove mention of debug log class
Debug is both a valid class and level, kinda confusing to use it as an example in my opinion.
* Error instead of assert
* Missing include
* fixed Unsynchronized free_threads.size()` Read in ThreadState::Free
* fixed data race in posix_pthread_key_create , allocated and seqno are atomic now
* fixed playtime thread
* argv array size fix
* destroy mutex on object deletion with pthread_mutex_destroy
* fixed object_pool
* used atomics for thread safety
* equeue: Save filter/ident before std:move since we access them out of the locked loop
* fixed kqueues memory leak
* clean storage objects effectively
* fixed memory leak
* fix some races
* fixed race condition
* Log filters cleanup
* Clearer dialog options for config update
* Smaller button labels
These don't auto-resize, and I don't want to read SDL's docs for something so small.
* using new emulator_settings
* the default user is now just player one
* transfer install, addon dirs
* fix load custom config issue
---------
Co-authored-by: kalaposfos13 <153381648+kalaposfos13@users.noreply.github.com>
* Replace sysmodule enums with table
Dumped this from the 12.52 module, using a script I created.
* Better documentation
* Separate from system libraries
That system folder is going to be getting quite large if I left all the sysmodule stuff in there.
* More arrays from library
* Found another preload list
Ghidra really hates decompiling libSceSysmodule, so I didn't notice this one at first.
Also documented specific versions tied to each preload list.
* Start work on implementation
* Some basic implementations
* Initial stub for module loading
Just enough to see if the logic functions appropriately.
* Clang
* sceSysmoduleLoadModule
Now I need to get sceSysmodulePreloadModuleForLibkernel done so that we don't have bugs from not loading internal LLEs.
* sceSysmoduleLoadModuleInternal
* sceSysmodulePreloadModuleForLibkernel
I have successfully broken quite literally everything.
I shall debug this tomorrow.
* Slight fix
* Maybe fix?
* Change log
Enjoy the log spam 😄
* Increased defined stub count
Now that libc and libSceLibcInternal loads later, all the auto stubs are getting consumed by it.
* sceSysmoduleUnloadModule stub
Also a couple fixes. Sysmodule does pass argc and argv to game modules, but only after loading them once to check binaries.
Shouldn't matter for the most part.
* Clang
* Less stubs
2 thousand is seemingly enough.
* sceSysmoduleLoadModuleInternalWithArg
Doesn't hurt to have, since Apex Legends calls it.
* Oops
* Oops 2
* Rename isModuleLoaded to getModuleHandle
Review comment
* Remove debug game module loads
These cases only trigger when specific sceRegMgr key values are set, and for our purposes, we can treat that case as false.
* Allow preloading to fail
For kalaposfos
* Clang
* Ignore enabled flag on critical log entries
This ensures critical errors (asserts and unreachables) are logged when the log file exceeds 100MB, or when logging is disabled.
* I apparently need sleep