Commit Graph

1390 Commits

Author SHA1 Message Date
kalaposfos13
1409b26e50
Fix scePadResetLightBar and scePadResetOrientation being called with the wrong handle (#4391) 2026-05-10 17:23:29 -07:00
Sam Kenny
b48d917e29
Fixes regressions and issues causing PSP emulated games to not run. (#4389)
* Fixes PSP emulation with the following changes:

1. Reserved Memory cannot be mapped, this seems to be incorrect and the
   PSP emulation relies on reserving then mapping memory at startup.
   From other logs, this may affect PS2 emulation as well.

2. Temp directory output may have garbase and the API is not null
   terminating the output, resulting in failures when the file
   path is not valid.

3. Fix misaligned images when viewport is sized for PSP.
   This fixes garbage in movies on the PSP emulator, making the
   movies viewable, scaled correctly for the screen.

4. Some PSP moves render incorrectly without sceVideodec2GetAvcPictureInfo

5. Fix dirty hash size calculation and RGB4444 mapping to fix textures

 These changes combined allow Jean d'Arc, LocoRoco and Patapon to run
 decently.

* fix formatting

* null terminate the temp path rather than using memset

* fix memory mapping in a more correct way

* revert RGB4444 changes as it breaks other games color mapping
2026-05-10 17:22:41 -07:00
kalaposfos13
6e675c32f2
Do not crash on encountering an unknown option in PosixSocket::SetSocketOptions (#4346)
* what's one more hacky bypass on this pile of already existing hacky bypasses amirite

* Stub only that one option vue needs
2026-05-10 14:18:39 +01:00
kalaposfos13
66112bc90a
Refactor pad handles (#4386)
* Set up [userid, type, index] -> pad_handle mapping and hook up currently existing GameControllers backend to it

* just use basic oop principles why are we even shoving callee responsibility in caller logic

* support special pads

* random edge case I thought of

* return error if handle is already opened, redirect scePadOpenExt to scePadOpen

* scePadClose

* error out if trying to close an unopened handle

* oof

* logging
2026-05-10 11:04:20 +03:00
Stephen Miller
d3597c7f18
Kernel.Vmm: Fix protection check for file mappings (#4388) 2026-05-09 16:09:51 -07:00
Valdis Bogdāns
05df651cd8
Add IME keyboard layout and panel metrics support (#3973)
* 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>
2026-05-09 23:41:14 +03:00
Stephen Miller
8bcc19248e
Core: Fix argv[0] value (#4378)
* Fix executable path

* Remove args.empty() check

Emulator::Run adds the guest executable path, so arguments will never be empty.
2026-05-09 11:13:47 +03:00
Hog
7132795b7a
Refactor memory size handling to better handle vdec titles (#4373)
* Refactor memory size constants and calculations

Updated memory size handling in video decoder functions.

* Refactor video decoder frame size calculations

Updated frame size computation to use worst-case dimensions and adjusted alignment values.

* Refactor alignment logic to use Common::AlignUp
2026-05-08 09:28:44 -05:00
Stephen Miller
d85a5013ec
Kernel.Fs: Stub fstat on random devices (#4368) 2026-05-06 15:40:41 -07:00
Stephen Miller
b10c3c7697
Stub an actual code for sceNpAuthGetAuthorizationCode functions (#4369)
I've had exactly one game specifically complain about the auth code being empty. Provide some code so relevant titles work a little better.
2026-05-06 15:40:14 -07:00
Stephen Miller
6623489d3d
Libs: Proper names for some functions (#4366)
* Add new ulobjmgr names

* libScePad function

* Clang
2026-05-06 23:31:32 +03:00
Stephen Miller
4ee33c6636
Core: Fix trophy extraction for games with separated updates (#4355) 2026-05-05 14:22:26 -07:00
squidbus
8175194bba
misc: Fix initializer order warnings (#4358) 2026-05-05 14:21:21 -07:00
Niram7777
6633d7252c
Log read setting from old toml outside the [Log] section (#4342) 2026-05-05 02:21:28 +03:00
Kravickas
ea8bed1c94
Implement sceGnmInsertDingDongMarker (#4340) 2026-04-30 22:03:28 -07:00
Stephen Miller
1956b791d4
Properly clear handle data on close (#4339) 2026-04-30 16:55:04 -07:00
TheThunderTurner
6d0318a840
Fix assertion condition for request_id limit (#4334) 2026-04-29 10:02:19 -05:00
georgemoralis
cf238acea9
fixed truncate of request_id data (#4330) 2026-04-28 19:06:43 +03:00
Matías Buzzo
f98f1aac5a
file_sys: apply case-insensitive search to mods_path on GNU/Linux and macOS (#4312)
The case-insensitive fallback search() in GetHostPath is only
invoked for patch_path and host_path, so mods whose file or folder
capitalization does not exactly match the guest path are silently
bypassed even when the files are present. Mirror the existing
search(patch_path) pass for mods_path, placed first to preserve
mod > patch > base precedence.
2026-04-27 11:00:31 +03:00
Stephen Miller
2c9eee1eb5
Reduce address space size for FreeBSD (#4318) 2026-04-25 09:14:34 +03:00
georgemoralis
737d23b28b
Save fixes VIIIIX (#4315)
* fix issue with concurrent writes , this fix racing with permission denied

* optimize

* fixup
2026-04-24 15:16:15 -05:00
georgemoralis
f710074500
return proper error if user is invalid (#4317) 2026-04-24 23:06:34 +03:00
Stephen Miller
da7b673704
Fix our workaround for missing trophy key. (#4306) 2026-04-23 15:10:19 +03:00
Lander Gallastegi
c68a8baa94
chroe: fix building on fedora 44 / clang 22 (#4303)
* add includes to fix building

* update documentation
2026-04-22 09:34:53 +03:00
TheTurtle
526c346f90
renderer_vulkan: Renderer microoptimizations (#4290)
* renderer_vulkan: Microoptimizations from profiling

* buffer_cache: Only use streaming path on cpu modified memory

If the pages arent cpu modified, then a gpu buffer with valid data exists that can be used instead

* clang format

* fix max num_layers
2026-04-20 09:20:07 +03:00
squidbus
90b75eadec
address_space: Fix order of operations (#4288) 2026-04-19 14:26:14 -07:00
Stephen Miller
3400bdf4b1
Core: Fix issues with #4273 (#4287)
* Assert on failed mappings, ignore segment prot

* Re-add segment prot conversion

* Disable backing for execute mappings

Macs don't allow this apparently.

* Add assert for file execute permissions
2026-04-19 14:20:42 -07:00
Stephen Miller
9af4aa2e25
Kernel.Vmm: Proper address checking in QueryProtection (#4286) 2026-04-19 14:20:14 -07:00
Stephen Miller
67edac4c9e
Fix compiler directives in stack.S
Was hidden before because the file was .s (lowercase). When turtle fixed that, this issue became noticeable.
2026-04-19 11:24:00 -05:00
TheTurtle
1a234a566d
kernel: Rename stack file for proper preprocessor support 2026-04-19 18:04:35 +03:00
Stephen Miller
92cd61fbf5
Core: Proper module memory mappings (#4273)
* Early memory regions setup

Needed to enable flexible allocations before mapping the eboot

* Improved accuracy of module mappings

To keep our current logic intact, reserve the full memory space, then perform fixed mappings for trampoline and segments. Segment mappings use type flexible, so they properly count toward flexible usage, while trampoline mappings use type code to bypass this.

* Asserts for failed offset finding

Always check before you leap.

* Hex logging for segment sizes

* Only map game modules to flex mem.

* Revert "Asserts for failed offset finding"

This reverts commit 38083f8cbb.

* Revert "Early memory regions setup"

This reverts commit da1552d4ac.

* Initialize memory regions in MemoryManager constructor

Much simpler approach to enabling the necessary flexible mappings on startup.
2026-04-19 12:45:02 +03:00
kalaposfos13
26c5963481
temp fix (#4276) 2026-04-19 12:30:51 +03:00
Vladislav Mikhalin
9ec75c32ad
threads: remove low level threads on windows (#4277) 2026-04-19 12:00:49 +03:00
Vladislav Mikhalin
9141c19302 align stack to 16 2026-04-19 09:37:55 +03:00
Niram7777
854b291c63
Spdlog migration (#4069)
* spdlog migration

* gitmodule instead of cmake
2026-04-19 00:57:05 +03:00
Vladislav Mikhalin
beba435a09
separate thread init and run stacks (#4274)
* separate thread init and run stacks

* copyrights

* remove TEB setting

* revert fibers

* fix linux

* remove unused variables
2026-04-18 16:17:48 +03:00
Stephen Miller
2d559a4f77
Remove scePadOpen errors for special pad (#4265)
This has caused issues since the moment they were added, and other devs have mentioned they're inaccurate before
2026-04-16 23:29:53 +03:00
georgemoralis
95ba5918dd
Shadnet preparations (#4269)
* replace psn_signed_in settings with shad_net_enabled and added shadnet_server setting

* improved user manager to update new fields and add new variables

* clang

* better message :D
2026-04-16 20:55:55 +03:00
Stephen Miller
830c5ba435
Core: Fix Debug Dump (#4266)
* Fix

* Clang
2026-04-16 09:20:33 +03:00
rainmakerv2
be224a4556
Big Picture: add settings configuration (#4255)
* prototype settings look

* put categories on top instead of on the side, plays nicer with input system

* added profiles + saving and loading framework

* add helper functions

* fix autofocusing

* add code for using embedded image files

* put settings in different files

* clang

* remove sdl_image submodule, unify functions when possible

* Always display selected profile in settings content areas

* Fix focusing, logs, highlight profile text

* persist highlight on focused buttons, add all categories placeholders

* All settings added

* navigate tabs with l1/r1
2026-04-15 18:19:22 +03:00
georgemoralis
7759f4eb2e
Revert "avplayer/videodec fixup (#4225)" (#4264)
This reverts commit f242655fbb.
2026-04-15 18:02:53 +03:00
rainmakerv2
72f514f350
Trophy: Replace sdl mixer library with minimp3 header for playing trophy sounds (#4261)
* Replace sdl mixer library with minimp3 header

* clang

* set spec before putting in audiostream

* respect main audio output device setting

* fixup

* replace file with submodule

* cleanup

* capitalize functions like the others

* move buffer to heap

* use vector for pcm buffer instead
2026-04-15 10:48:55 +03:00
Kravickas
f242655fbb
avplayer/videodec fixup (#4225)
* avplayer NV12 frame copy

* videodec NV12 frame copy
2026-04-15 10:28:49 +03:00
georgemoralis
c395897fbe
Fixed scePthreadSemTimedwait absolute timespec (#4238)
* The usec parameter is a relative timeout, but posix_sem_timedwait expects an absolute timespec

* posix_sem_post , concurrent fix
2026-04-15 08:57:02 +03:00
rainmakerv2
b12ca606c8
fix real-time volume adjustment with game-specific configs (#4259) 2026-04-14 15:57:08 +03:00
rainmakerv2
cead66d3c6
Big Picture Mode (#4250)
* imguitest

* button tests

* fix gamepad nav

* placeholder hardcoded eboot path

* set focus correctly, move to own files

* get installed game information

* dynamically adjust rows

* use slider for ui scale

* launch big picture with CLI arg

* Use emulator settings for UI scale and window size

* center scrolling on focused item

* fix item focus on scrolling when navigating with keyboard or pad

* minor fixups and comments

* fix performance degradation

* adjust fonts to show TM symbol and higher overscale

* reuse and clang

* add exists check before iterator

* flatten navigation (gamepad navigation crosses child window container)

* cleanup and comments

* simplify update checker a bit

---------

Co-authored-by: georgemoralis <giorgosmrls@gmail.com>
2026-04-13 01:40:11 +03:00
georgemoralis
1c8ace6619
fixed trophy extraction (#4254)
* fixed trophy extraction

* opps

* fixing indexing in np_trophy

* fix
2026-04-13 01:23:00 +03:00
georgemoralis
cfa5838a13
used default addcont folder if not set (#4253) 2026-04-12 15:45:28 +03:00
kalaposfos13
3c390f9889
Implement reserved attribute of OrbisPadTouchData for LLE libSceSystemGesture (#4245) 2026-04-09 14:26:47 -05:00
kalaposfos13
daa7b5c04b
Fix scePadResetLightBar for TV remotes (#4244) 2026-04-09 21:43:27 +03:00