Commit graph

865 commits

Author SHA1 Message Date
kalaposfos13
1cc9e0d37f
Initial implementation of controller color config (#2411) 2025-02-14 12:30:49 +02:00
georgemoralis
57bdb6cac2 hotfix: another typo.. 2025-02-14 10:24:12 +02:00
georgemoralis
1dca54c165 hotfix: typo 2025-02-14 10:12:43 +02:00
georgemoralis
67a74a9357 hotfix: removed questionable setjmp 2025-02-14 10:03:57 +02:00
kalaposfos13
7db30d12cb
Libraries: Update libcInternal (#2265)
* Added all stubs + logging

* Added back memory and math functions from the original code + added some more math functions

* More string functions, snprintf, memmove and setjmp

* Add longjmp + clang

* gmtime, __cxa_atexit and log what functions some games use

* Add Mspace unreachable

* Renaming

* Take out mspace functions to their own file

* Factor out io to a new file

* Empty str and memory files

* Overloaded functions be like:

* str

* memory + math +clang

* clang...

* adjustments :D

* longjmp is questionable

---------

Co-authored-by: georgemoralis <giorgosmrls@gmail.com>
2025-02-14 09:58:38 +02:00
DanielSvoboda
4dfe05db24
language fix (#2421) 2025-02-13 20:01:35 +02:00
Stephen Miller
455b23c6f1
Update video_out.cpp (#2416) 2025-02-13 16:29:26 +02:00
squidbus
ebe2aadb4c
gnmdriver: Implement sceGnmUpdateHsShader (#2412) 2025-02-12 19:45:42 -08:00
squidbus
7624e9482c
memory: Log for sceKernelMapNamedDirectMemory in more cases. (#2404) 2025-02-12 19:04:58 +02:00
Stephen Miller
b51c767296
Better bounds checks for sceKernelDlsym (#2394)
Unity, being the awful game engine it is, checks for a return value of zero to determine if sceKernelLoadStartModule failed. This results in it throwing an error code into sceKernelDlsym's handle parameter when the module it's searching for doesn't exist.
2025-02-09 19:31:07 -08:00
Stephen Miller
22357f70c2
Improve parameter checks for posix_pthread_rename_np (#2391) 2025-02-09 13:50:59 -08:00
squidbus
0e238c87cb
cpu_patches: Lower extrq/insertq log to trace. (#2386) 2025-02-09 18:58:48 +02:00
squidbus
214eab2c52
gnmdriver: Fill in functions stubbed on real firmware. (#2379) 2025-02-09 18:57:10 +02:00
psucien
8f2883a388
video_out: HDR support (#2381)
* Initial HDR support

* fix for crashes when debug tools used
2025-02-09 15:54:54 +01:00
Vladislav Mikhalin
fb0871dbc8
ajm: mark empty batches as finished immediately (#2385) 2025-02-09 16:11:24 +03:00
squidbus
9dc3e39fc2
address_space: Split macOS reserved memory region. (#2372) 2025-02-08 13:21:32 -08:00
Stephen Miller
ecfc940381
libSceHmd Stubs (#2355)
* Add generated libSceHmd stubs

* Implement ReprojectionQuery functions

These constant returns come from decompiling libSceHmd.

* Clang

* Clang
2025-02-05 17:24:53 +02:00
Stephen Miller
e757063d31
Improved error handling in sceKernelAllocateDirectMemory (#2037)
* Handle errors in sceKernelAllocateDirectMemory

* Improve accuracy of error cases

Some of our existing cases are normally EAGAIN returns.

* Improve logging on errors

* Clang

* TEMPORARY HACK FOR NBA TESTS

This will be removed before this PR is marked as ready, and is only here to make sure the other NBA games (and perhaps DOA3) work if some missing init behavior is handled.

* Revert "TEMPORARY HACK FOR NBA TESTS"

This reverts commit a0e27b0229.

* Change error message
2025-02-05 17:21:05 +02:00
georgemoralis
e4598e8821
sceVideoOutDeleteFlipEvent (#2339) 2025-02-03 23:27:48 -08:00
Stephen Miller
8ad650582a
Fix VideoOut events (#2330)
* Fix event data for VideoOut events

Fix is based on some decompilation work shared by red_prig.

* Cleanup

* Oops

* Style fixes

* Clang

* Fix libSceVideoOut event idents

Based on some decompilation work, events coming from libSceVideoOut use a separate set of values for identifiers. These values are only converted to OrbisVideoOutEventId values during calls to sceVideoOutGetEventId.
For convenience, I've placed all relevant identifiers into a enum called OrbisVideoOutInternalEventId.
Thanks to @red_prig for the tips.

* Fix?

Seems like `static_cast<u32>(hint) & 0xFF == event.ident` here, and doing those right shifts on the event.ident winds up breaking stuff.
Without this change, the if always fails because event_id was getting set to 0 instead.

* Clang
2025-02-03 17:37:28 +02:00
hspir404
c5cd4bc5cf
Remove log line that was consuming as much as 0.6ms frame time (#2335) 2025-02-03 02:37:11 -08:00
squidbus
e1550c9091
audioout: Add error returns when not initialized. (#2309) 2025-02-01 10:52:40 +02:00
kalaposfos13
c4bfaa6031
Added keyboard and mouse input remapping, mouse movement to joystick logic, GUI and more (#1356)
* added support for loading keyboard config from file

* final minor update before pull request

* fix messing up the merge

* fix waitEvent to correctly handle mouse inputs

* add license

* Applied coding style fixes

* clang-format fucked up the .ini file

* actually fix clang changing ini syntax
use relative path for the ini file

* remove big commented out code blocks,
and fixed platform-dependent code

* fix windows hating me

* added mouse config option

* added toggle for mouse movement input (f7)

* fix license and style

* add numpad support i accidentally left out

* added support for mouse wheel (to buttons only)

* if keyboard config doesn't exist, autogenerate it

* added keybinds for "walk mode"

* Mouse movement input is now off by default

* code cleanup and misc fixes

* delete config file since it is now autogenerated

* F6 = F7 + F9

* added better mouse handling with config options

* Added capslock support

* fix clang-format

* Added support for mod key toggle key

* F6 and F7 are removed, F9 captures and enables the mouse

* Encapsulated globals and new classes in a new namespace

* Added mouse side button support

* Added per-game config

* relocated input parser to the new namespace

* changed parser parameters to make it possible to use it from the gui

* added home, end, pgup and pgdown

* Resolved merge conflict and refactored code

* Updated default keybindings

* Changed input handling to be single-threaded

* General code cleanup

* Start working on new backend

* Mouse polling, CMakeLists, and basic framework

* Output update handling, and reworked file creating, reading and parsing

* Parsing works now

* Single key button inputs work now

* Axis outputs work now

* Wheel works now (for me), l2/r2 handling improvements, and misc bugfixes

* Downgraded prints to log_debug, and implemented input hierarchy

* Implemented key toggle

* Added mouse parameter parsing

* clang-format

* Fixed clang and added a const keyword for mac

* Fix input hierarchy

* Fixed joysick halfmodes, and possibly the last update on input hierarchy

* clang-format

* Rewrote the default config to reflect new changes

* clang

* Update code style

* Updated sorting to accomodate for that one specific edge case

* Fix default config and the latest bug with input hiearchy

* Fix typo

* Temporarily added my GUI

* Update cmakelists

* Possible fix for Gravity Rush

* Update Help text, default config, and clang

* Updated README with the new keybind info

* okay so maybe the gravity rush fix might have slightly broken the joystick halfmode and key toggle

* Fixed mistakenly overwriting the last opened config with the default one if the GUI is opened multiple times in a session

* Updated Help descriptions and fixed mouse movement default parameters

* Fix crash if the Help dialog was opened a second time
If it's closed with the top right close button instead of clicking the Help button again, a required flag wasn't reset, making the next click on Help try to close a nonexistent window and segfault

* Added closing the config also closing the Help window, and fixed more segfaults due to mismatched flags

* Initial controller support

* clang and debug print cleanup

* Initial axis-to-button logic

* Updated Help text

* Added 'Reset to Default' button in GUI

* Minor text and description updates + fixed an issue with Help text box rendering

* Fix button-to-touchpad logic and l2/r2 handling, as they are both axes and buttons
The touchpad's button state was correctly handled, so games that use that were fine, but the touchDown flag was always set to true, so games that use this flag had problems, like Gravity Rush

* Fix merge conflict

* Clang

* Added back back button to touchpad binding

* Added touchpad button handling

* Added end-of-line comments and fixed some crashes happening with the VS debugger

* Apply recent changes from kbm-only

* Deadzone + initial directional axis-to-button mapping

* Added that one missing space in the README. Are you all happy now?

* Fixups from making everything use SDL

* Revert directional joystick code and fix a memory leak

* Change config directory name again to conform to project standards

* Clang

* Revert the old deeadzone code and properly add the new one

* Clang
2025-01-31 16:36:14 +02:00
georgemoralis
8aea0fc7ee
Revert "libkernel: handle special case in path for load module (#2269)" (#2298)
This reverts commit ec0cf25097.
2025-01-31 12:54:16 +02:00
panzone91
ec0cf25097
libkernel: handle special case in path for load module (#2269)
* libkernel: handle special case for load module

* fix linting
2025-01-31 10:51:03 +02:00
squidbus
c89c7e8fed
cpu_patches: Always use AVX for certain patches. (#2274) 2025-01-30 18:17:03 +01:00
Vinicius Rangel
0358271b93
Savefixes vii (#2279)
* savedata: rewrite save memory functions to handle slot id & better backup management

* savedata: auto-restore backup if needed

* safe save backup shutdown

replaced exit by quick_exit
2025-01-30 09:45:48 +02:00
squidbus
9bad66b24d hotfix: Raise videodec memory back up to 16MB.
Found a game that needs more, still should be low enough compared to before to fix some games.
2025-01-29 01:32:12 -08:00
squidbus
a78f8afe58
libraries: Implement libSceZlib. (#2256)
* libraries: add zlib hle skeleton/stub

* libraries: Implement libSceZlib.

* zlib: Make variables static.

---------

Co-authored-by: Nenkai <Nenkai@users.noreply.github.com>
2025-01-28 18:48:19 +02:00
squidbus
8379922f8a hotfix: Reduce requested videodec memory block sizes.
This really needs a more accurate implementation, but for the stub lowering the value helps games that run out of memory space if it is too large.
2025-01-28 02:33:17 -08:00
panzone91
2837d848ed
linker: handle relocation for exported modules (#2247) 2025-01-27 22:40:58 +02:00
squidbus
3960283a67 hotfix: Fix missing embedded PS shader address bits.
If the emulator code is above a 40-bit address, the embedded shaders need to use address-hi to work. Embedded VS shader already supplies it, PS shader should as well.
2025-01-26 01:02:55 -08:00
Ian Carpenter
564dbc7b94
system_service: Add simple event queue and push an EntitlementUpdate event to it when app content is initialized (#2238) 2025-01-25 11:00:52 +02:00
squidbus
e433f3116d hotfix 2: clang format 2025-01-24 19:57:09 -08:00
squidbus
73b7d34460 hotfix: Drop scePadSetLightBar log to debug level.
Some games like to spam this a lot, and we already handle it.
2025-01-24 19:56:05 -08:00
hspir404
7072dfc99f
Fix stale heap read in UnmapMemoryImpl (#2232) 2025-01-24 23:56:21 +02:00
poly
b3c573f798
libraries/fiber: print fiber ctx size on stack overflow 2025-01-24 19:37:34 +01:00
georgemoralis
a4eba8e827
stubbed webbrowserdialog,npparty (#2234)
* stubbed webbrowserdialog,npparty

* added poly's suggestions
2025-01-24 19:22:06 +02:00
kalaposfos13
4f426b723f
Rebase of "Handle munmap over multiple VMAs" (#2233)
* Unmap memory in chunks if spanning over multiple VMAs

* clang

* Merge fixups

* Minor code style changes

* Update function declarations

---------

Co-authored-by: Marcin Mikołajczyk <marcinmikolajcz@gmail.com>
2025-01-24 15:30:55 +02:00
DanielSvoboda
cc2e13873f
Fix showing debug menu bar / Devtools (#2214)
* Fix showing debug menu bar / Devtools

* Fix
2025-01-22 22:21:41 -03:00
Vinicius Rangel
b3bce086b3
devtools: fix ReleaseKeyboard assert being triggered if many shader editor windows exist (#2205) 2025-01-22 12:08:49 -03:00
Stephen Miller
2968cf5a99
sceKernelVirtualQuery Fixes (#2204) 2025-01-22 16:06:27 +01:00
f3d209
adbff4056f
Added ability to change save data path (#2199)
* added ability to change save data path

* get default save data path from fs

* add copyright

* formatting
2025-01-22 12:10:35 +02:00
Stephen Miller
78ae9613c5
Fix for address_space initialization on Windows (#2202)
Should fix some `Region coalescing failed: Attempt to access invalid address.` crashes.

Co-authored-by: TheTurtle <47210458+raphaelthegreat@users.noreply.github.com>
2025-01-22 12:07:43 +02:00
polyproxy
5c62a00134
clang-format (again) 2025-01-21 21:14:05 +01:00
polyproxy
41b3942833
clang-format 2025-01-21 19:34:05 +01:00
polyproxy
84a341dce5
remove BADF return 2025-01-21 19:30:34 +01:00
polyproxy
3563b88d8c
hotfix: use logger device on stdin 2025-01-21 19:28:39 +01:00
Stephen Miller
4fa501c8d5
Additional libSceNpManager functions and cleanup (#2195)
* Error return on sceNpGetAccountIdA

Confirmed through hardware testing, this returns ORBIS_NP_ERROR_SIGNED_OUT on a signed out console.

Parameters are based on fpPS4 code.

* Fix compile

* Move errors to separate file

* Cleanup function headers

Swaps user_ids to use our OrbisUserServiceUserId type, and fixes parameter names to align with our coding standards.

* Add proper parameter checks

* Implement sceNpGetAccountId

This function takes an online_id, uses an NpManager function to get the user_id, then uses that user_id to perform the same internal functions as sceNpGetAccountIdA.

* Implement sceNpHasSignedUp

* Fix sceNpGetAccountId

Further hardware testing shows that these always write 0 to account_id when failing.

* Update np_manager.cpp
2025-01-19 19:12:42 -08:00
DanielSvoboda
c8bbecda26
Devtools: Close Button ( X ) (#2187) 2025-01-19 17:45:24 +02:00