* VectorFpRound64 decode table
Also fixed definition for V_TRUNC_F64, though I doubt that would change anything important.
* V_FLOOR_F64 implementation
Used by Just Cause 4
* Oops
Never forget your 64s
* Some mprotect fixes
The biggest thing here is preventing mprotect on memory that isn't mapped in address space. This would cause exceptions before, but succeeds on real hardware.
I've also included a couple other minor fixes, mostly based around some tests I recently performed.
Note: All changes to memory pools in this PR are assumed. I have not yet tested memory pools with any of this logic, but I do at least want to prevent mprotect on pool reserved memory to avoid crashes.
* Update memory.cpp
* clang
* Avoid storing the Tcb pointer on the stack
* Just return the already stored pointer in GetTcbBase
* Replace uses of GetTcbBase with g_curthread->tcb
* copyright 2025
* sir clang offnir, the all-formatting
The bitfield in the struct is padded, which produces uninitialized memory on initialization.
To avoid modifying the struct while making our GraphicsPipelineKey struct properly hashable, set values directly instead of re-initializing.
This fixes pipeline compile spam, and the subsequent poor performance, on certain setups.
* Earlier initialization of elf info.
Everything used for elf info initialization comes from the param.sfo, so we can initialize this earlier to have this information accessible during memory init.
* Extract compiled SDK version from pubtoolinfo string
Up until now, we've been using the game's reported "firmware version" as our compiled SDK version. This behavior is inaccurate, and is something that has come up in my hardware tests before.
For the actual compiled SDK version, we should use the SDK version in the PUBTOOLINFO string of the param.sfo, only falling back on the firmware version when that the sdk_ver component isn't present.
* Store compiled SDK version in ElfInfo
* Limit address space for compiled SDK version at or above FW 3
Sony placed a hard cap at 0xfc00000000, with a slight extension for stack mappings. For now, though stack mappings aren't implemented, there's no harm in keeping a slightly extended address space (since this cap is lower than our old user max).
Limiting the max through address space is necessary for Windows due to performance issues, in the future I plan to properly implement checks in memory manager code to properly handle this behavior for all platforms.
* Use compiled SDK version for sceKernelGetCompiledSdkVersion
I think this is pretty self explanatory.
* Log SDK version
Since this value is what most internal firmware version checks are against, logging the value will help with debugging.
* Update address_space.cpp
* Update emulator.cpp
* Backwards compatible logging
Because that's apparently an issue now
* Define latest released firmware version, use that for sceKernelGetSystemSwVersion
I feel this is less hacky and error-prone than just returning the game firmware.
* sceKernelGetAllowedSdkVersionOnSystem
* sceKernelHasNeoMode
* sceKernelGetAppInfo stub
* sceKernelGetCurrentCpu
* fixups
* sceKernelGetMainSocId
Used by libSceAvPlayer to determine if console is a pro or not.
* Update process.cpp
* Set has_param_sfo to true
* Clang
* Swap write access mode for read write
Opening with access mode w will erase the opened file. We do not want this.
* Create mode
Opening with write access was previously the only way to create a file through open, so add a separate FileAccessMode that uses the write access mode to create files.
* Update file_system.cpp
Remove a hack added to posix_rename to bypass the file clearing behaviors of FileAccessMode::Write
* Check access mode in read functions
Write-only files cause the EBADF return on the various read functions. Now that we're opening files differently, properly handling this is necessary.
* Separate appends into proper modes
Fixes a potential regression from one of my prior PRs, and ensures the Write | Append flag combo also behaves properly in read-related functions.
* Move IsWriteOnly check after device/socket reads
file->f is only valid for files, so checking this before checking for sockets/devices will cause access violations.
* Fix issues
Now that Write is identical to ReadWrite, internal uses of Write need to be swapped to my new Create mode
* Fix remaining uses of FileAccessMode write to create files
Missed these before.
* Fix rebase
* Add stubbed get_authinfo (#3722)
* mostly stubbed get_authinfo
* Return value observed on console if get_authinfo was called for the current thread, esrch otherwise
---------
Co-authored-by: kalaposfos13 <153381648+kalaposfos13@users.noreply.github.com>
Co-authored-by: georgemoralis <giorgosmrls@gmail.com>
These are used by LLE libSceVideodec.
From decompiling the two GnmDriver libraries, it seems like sceGnmDrawInitToDefaultContextStateInternalCommand inlines a call to sceGnmDrawInitToDefaultContextState, so I've replaced that with an actual call to the function for readability.
sceGnmDrawInitToDefaultContextStateInternalSize is one to one with decomp.
* buffer_cache: smaller regions
this was a change back between v0.9.0 to v0.10.0
9f37ede336
reverting the TRACKER_HIGHER_PAGE_BITS from 24 to 22 gives a notable increase to performance.
* Update region_definitions.h
updated copyright