* Revert "shader_recompiler: Pad number of TES passthrough outputs to fragment inputs if needed"
This reverts commit 6436063025.
* Revert "shader_recompiler: Only forward declared number of vertex inputs. (#4293)"
This reverts commit 47f5cc1437.
* sigaddset, sigdelset, sigismember
* Some define fixups
Based on decomp, PS4 sigset is defined as a u32[4]. This doesn't change any behavior, but makes my decomp-based sigaddset and sigdelset implementations function appropriately.
Additionally, define handler and sigaction functions as PS4_SYSV_ABI.
* Fix returns
* Implement signal, export _sigintr
In libkernel, signal just uses sigaction. No harm in implementing it, since we've got our own implementations for everything except sigaction (and sigaction is implemented for Unix platforms).
* Fix and cleanup posix_select defines
Swaps use of defines for just having static functions, and fixes the pd_set_posix struct to match FreeBSD/Orbis properly (sizeof(long) == 4 on Windows, which does not match Orbis).
* Fix siginfo struct
Again, sizeof(long) differs on different platforms. Need to use our proper typedef to ensure accuracy.
* Clang, the bane of my existance.
* Oops
* move np_score to /np_score folder
* added more logging to np functions
* using common np_error file
* moved web_api to dedicated folder
* implemented some context creations for np_score so logging would be more productive
* implement sceAudio3dPortCreate and closer implementation to sceAudio3dPortOpen
* clang format and forgot to remove some lines
* refactor port creation, small cleanups and openal
* rename parameter arguments
* idk might be correct
* floor size_this to closest multiple of 8
* Fix flip status on close
* Store equeues by handle instead of pointer
As is, a game could call sceKernelDeleteEqueue on the equeue registered for flip/vblank events, and terminate the equeue while our VideoOut driver retains a valid pointer to it.
Changing to storing the equeue handle means we can check if the equeue still exists and prevent this.
* Remove flip and vblank events on sceVideoOutClose
* Don't forget to clear vectors
* Oops
Intended to erase the memset on FlipStatus, not VblankStatus.
* 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
* more uri work based on decompile and tests
* fix includes
* fix loader stubs
* cleanups
* sceHttpParseStatusLine matches decompile and tests
* sceHttpParseResponseHeader implemenation and tests
* try fixing no-internet path in sendrequest
* minimal state machine to support proper erroring of no-internet available
* more improvements
* more implementation based on stephen's comments
* some more fixes based on decompile
* add parameters and logging
* added sceHttpUriBuild , fixes to sceHttpUriEscape ,sceHttpUriParse
* return an error to statuscode , this should be enough for no-connection
* Core: Add user state callback management and improve user login/logout handling
* Core: Implement handle key lookup and special handle checks in pad library
---------
Co-authored-by: w1naenator <valdis.bogdans@hotmail.com>
Use template <auto f> for HostCallWrapperImpl and OrbisWrapperImpl instead of passing the function type and value separately.
This keeps the wrapper behavior the same while matching the form MinGW-w64 GCC accepts.
* Export empty environment
Media Player tries to read from environ before doing some rather freaky stuff, without anything exported it will just crash from dereferencing an invalid pointer.
* Set program name
Wasn't sure what the best way would be to do this
* Just stub to eboot.bin
Accurate enough, hopefully.
* 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