Commit graph

99 commits

Author SHA1 Message Date
Pedro Montes Alcalde
4a14d546ba
Tick Tick Tick, thats the sound of 2024 flying by (#3503) 2025-01-19 18:51:43 -03:00
bookmist
d2c6c4ac4f kernel: more correct thread local storage emulation, also stub ThreadVfpException functions
used mostly for lle libkernel
2024-11-05 00:06:59 +03:00
oltolm
c61895e6f4
vita3k: Add support for mingw-w64 (#3406)
* make the code compile on mingw-w64

* make compile with Clang 19

* make compile with GCC
2024-10-26 23:41:51 +02:00
Saturnsky
97764c04cf
modules/SceKernel: Implement sceKernelGetEventPattern (#3397) 2024-10-05 18:42:51 +02:00
bookmist
1fda880a94 vita3k: big code cleanup
Improvements
* lang: a bit more verbose error on wrong lang xml

Bugfixes
* kernel/sync_primitives: fix theoretically possible AV
* modules/SceAudio: a bit more correct sceAudioOutSetConfig
* fix wrong objects initialisation ({0} -> {})

Warning fixes
* clang warning: Macro argument should be enclosed in parentheses
[bugprone-macro-parentheses]
* modules: set unsigned type for Sce*ErrorCode enums
* clang warning: variable might be not be initialized
* clang warning: Function returns by const value. Consider returning by non-const value instead.
* clang warning: Prefer transparent functors [modernize-use-transparent-functors]

Refactoring
* io/device: move functions implementation from .h to .cpp file
* vita3k: fix fs::path usage
* clang warning: 'if' statement is unnecessary; deleting null pointer has no effect
* vita3k: use structured bindings and references in for-each-loops
* vita3k: simplify container operations, extract frequent operations to utility functions
* clang⚠️ 'contains' member function can be used
* kernel/sync_primitives: refactoring. drop unused parameter of handle_timeout
* vita3k: drop unused function parameters

* vita3k: fix typecasts
use static_cast instead of reinterpret casts if possible
use correct constants (1/1.0/1.0f)
correct variable types to minimise typecasts
use explicit typecasts (not everywhere)
replace c-style typecasts to c++ style typecasts (not everywhere)
* clang warning: remove redundant typecasts
* clang warning: Cast drops const qualifier

Optimisation
* vita3k: remove unused includes
* clang warning: Constness of returning variable prevents automatic move
[performance-no-automatic-move]
* clang warning: String concatenation results in allocation of unnecessary temporary strings
[performance-inefficient-string-concatenation]
* vita3k: use std::move
* vita3k: optimization. push_back -> emplace_back
* vita3k: fix datatypes to avoid unnesessary conversions
* clang warning: remove unneeded string->c_str->string conversion
* clang warning: The parameter is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
* clang warning: 'find' called with a string literal consisting of a single character
[performance-faster-string-find]
* clang warning: Result of a postfix operator is discarded, consider replacing it with a prefix operator
* clang warning: Pass value parameters by const reference

Code cleanup
* io/io: remove once used variables
* net/posixsocket: remove struct keyword
* vita3k: use raw string literals to avoid excessive escaping
* vita3k: refactoring. replace Ptr<> to pointer in Sce functions
* vita3k: drop unused variables and incorrect comments
* clang warning: readability-inconsistent-declaration-parameter-name
* clang warning: Extra ';' after member function definition
* clang warning: Possible misuse of comma operator (, is used instead of ;)
* clang warning: Algorithm accepting an iterator and a count can be used
* clang warning: Declaration and assignment can be joined
* clang warning: Type trait can be simplified using a template alias or a variable template

* vita3k: cleanup class methods
remove unimplemented (and obviously not used) methods
move deleted methods to public
change empty body to =default
remove auto constructors
set member default values
2024-03-18 15:44:56 +03:00
Macdu
e3a201d485
kernel: Add support for module unloading/reloading (#3246) 2024-03-15 10:07:25 +01:00
bookmist
6ce9b6598e vita3k: some minor bugfixes
kernel/thread: fix possible crash in log_stack_traceback
modules/SceLibKernel: more correct sceClibSnprintf
kernel/load_self: fix possible crash on incorrect library modules. load process params from first loaded module (eboot.bin) only
modules/SceGxm: fix crash if display_thread not found
kernel/debugger: remove direct access to mem.memory to support memory mapping more complete
vita3k: remove direct access to kernel.threads (it's not thread-safe)
vita3k: implement and fix virtual destructors for class hierarchies to prevent memory leaks (except screen_filters)
clang-tidy warning: Constructing string from nullptr is undefined behaviour
clang warning: use after std::move
2024-02-12 20:21:40 +03:00
bookmist
d3f3038aee vita3k: set fs::path type for string paths and refactoring
avoid not need conversion string->wstring->string for linux and macos
native logging of fs::path
more correct conversion from std path to boost path
refactor pathes for shaders compiler, shorten parameters lists
crypto::hex_string: remove not needed null character as last character in string
2024-01-24 11:33:30 +03:00
Pedro Montes Alcalde
34565e3ef4
Vita2024K: Happy 2024 2024-01-01 12:36:32 -03:00
redpolline
1fe42cdc4f io: Support emuenv changes
kernel: Support emuenv changes
modules: Support emuenv changes
packages: Support emuenv changes
2023-10-17 13:31:19 +02:00
Zangetsu38
b79d7d282d vita3K: fix format. 2023-09-13 22:48:49 +02:00
Macdu
e64fa370c7 modules: cleanup 2023-09-10 23:35:12 +02:00
Pedro Montes Alcalde
5c9eec9914
kernel: Implement sceClibMemcpy_safe (#2833)
Co-authored-by: Macdu <Macdu@users.noreply.github.com>
2023-08-17 14:10:34 -03:00
Macdu
b4249a67f4 kernel: Implement sceKernelRegisterThreadEventHandler 2023-07-24 19:53:09 +02:00
bookmist
7d3608808d modules: Describe and partial implement SceRtabi module
used by driver_us.suprx
2023-07-16 21:41:58 +03:00
Macdu
91d43d122d kernel: Implement timer events 2023-07-11 21:57:44 +02:00
Zangetsu38
3ebf0627f7 modules/SceLibKernel: implement SceIoRename. 2023-07-01 15:32:05 +02:00
bookmist
6893276ac0 modules/SceLibKernel: implement sceClibVprintf 2023-06-22 18:06:23 +03:00
bookmist
470bdd7b95 modules: implement sceFiberGetInfo, sceGxmShaderPatcherGetUserData, sceKernelCheckThreadStack 2023-06-08 10:59:01 +03:00
bookmist
04b356173b modules/SceLibKernel: stubbed sceKernelGetRWLockInfo, sceKernelTrySendMsgPipe 2023-05-27 20:45:58 +03:00
bookmist
4ba2e086cc Vita3K: code cleanup and optimisations 2023-05-10 15:31:55 +03:00
Macdu
e36332b343 nids: Add missing lwmutex nids 2023-05-07 13:35:58 +02:00
Pedro Montes Alcalde
a3dbe83469
modules/kernel: Better logging on stack corruption 2023-04-28 17:32:59 -03:00
bookmist
dd603f3417 modules: implement some functions:
modules/SceThreadmgr: implement _sceKernelGetMutexInfo, sceKernelSetTimerTimeWide
refactor _sceKernelGetLwMutexInfoById
_sceKernelGetSemaInfo - fix returning data
_sceKernelGetThreadInfo - also return thread exit status
sceKernelChangeThreadVfpException, sceIoIoctl - describe parameters

modules/SceGxm: implement sceGxmProgramGetOutputRegisterFormat, sceGxmDepthStencilSurfaceGetFormat

modules/SceRtcUser: implement sceRtcCompareTick, sceRtcGetDosTime, sceRtcGetWin32FileTime

modules/SceKernelModulemgr: sceKernelGetModuleInfo change assert to error code

modules/SceLibKernel: sceKernelCreateMutex: add stub if priority ceiling feature is used

config/state: add forgotten module (SceNetInternal) into tracy modules list
2023-03-01 23:30:26 +01:00
bookmist
d28f780b42 modules/SceThreadmgr: implement sceKernelCancelSema, _sceKernelCancelSema
kernel/sync_primitives: fix error code in semaphore_signal
modules/SceThreadmgr: describe some functions, fix an assert, drop unused header
2023-01-19 13:35:30 +03:00
bookmist
0a419822ce modules/SceLibKernel: export module variables __stack_chk_guard, __sce_libcparam
Not really needed, just to hide errors when importing almost all modules
Also add logs to error handling functions
2023-01-19 13:35:30 +03:00
bookmist
43a62f4438 modules/SceKernelThreadMgr: implemented ksceKernelGetThreadCurrentPriority 2023-01-19 13:35:30 +03:00
EXtremeExploit
41a17e79c7 Planet Earth Season 2023 2023-01-02 10:46:20 +01:00
bookmist
34712b947b modules/SceKernelForMono: Reduce cpu consumption and fix strange crash in (STAY) 2022-11-22 13:07:08 +03:00
bookmist
8edd333400 Fix compiler warnings 2022-11-16 21:39:55 +03:00
bookmist
f03c257a33 modules: Add Tracy to all implemented functions in implemented modules.
modules/tracy: module name macro
Remove unused hack from SceMp4, mark ScePgf/sceFontNewLib unimplemented
2022-10-29 20:35:17 +03:00
Pedro Montes Alcalde
ec8bbf84b8
NID: Add __stack_chk_guard (#2028) 2022-08-23 09:40:38 -03:00
Pedro Montes Alcalde
af72b0e265
libkernel: Fix crash on SceIoDevctl (#2016) 2022-08-12 18:56:47 -03:00
Pedro Montes Alcalde
da2461725b
kernel: Partially implement command for sceIoDevctl (#1964) 2022-08-01 12:12:32 -03:00
Pedro Montes Alcalde
ccca711294
vita3k: Use correct KB/KiB functions (#1971) 2022-07-31 21:10:24 -03:00
Macdu
2eefc9751e vita3k: Remove unnecessary dependencies between librairies and files 2022-07-28 12:24:06 +02:00
hobyst
2233966ab2 Build: Change name of package lib to "packages"
"package" is a reserved CMake target name when CPack is used. Since
OpenSSL enables CPack in their project and it will be implemented in the
emulator in the future, this commit changes its name to "packages" to
avoid conflicts with CPack.
2022-07-11 12:25:35 +02:00
Macdu
d4bb55a414 kernel: Implement sceKernelCancelEventFlag 2022-07-04 19:08:10 +02:00
hobyst
1169da50bc host: Rename host to emuenv
This commit renames the host library as emuenv (emulated PS Vita
environment) to avoid confusion with the future host OS abstraction
layer
2022-07-03 14:31:24 +02:00
hobyst
0f65fac20d host, package: Decouple package code from host
Since most code inside host library doesn't really have to do with the
emulated PS Vita environment but rather with handling the different
package formats used in the console, this commit moves the code from
the host library into its own dedicated library. In summary:
- Moved package code into its own library and edited function calls
to accomodate the change
- Edited some function interfaces in order not to cause a dependency
hell due to cross-referenced types in headers that depended in
one another and edited function calls and resource access to accomodate
the change
- copy_directories() and copy_path() from `vita3k/interface.cpp` have
been modified and moved to io library due to being used in package
library and others. Keeping them as they were before causes dependency
hell
- All functions whose interface has been changed now have a Doxygen
comment block explaining the new interface
- host has been declared as an INTERFACE CMake library to fix linking
issues on Windows due to the fact that it doesn't compile C++ source
files anymore
2022-07-03 14:31:24 +02:00
Zangetsu38
d2e9994587 modules/SceLibKernel: fix 3 compile warning. 2022-06-09 15:52:24 +02:00
Zangetsu38
1dd24ba741 modules/SceLibKernel: add sceKernelWaitSignalCB. 2022-06-08 15:58:12 +02:00
Zangetsu38
5221d68c89 modules/SceLibKernel: add process callbacks on cb function. 2022-06-08 13:17:38 +02:00
Macdu
bb84106cc2 kernel: Implement simple events 2022-06-04 14:37:52 +02:00
Macdu
9889c472a9 kernel: better handling of thread priority and mask affinity 2022-05-25 15:23:21 +03:00
Macdu
8cf0baa7d4 modules/sceLibKernel: remove wrong assert in sceKernelCreateTimer 2022-05-19 00:46:59 +02:00
Macdu
3c221fdc5b kernel: Implement RWLock 2022-05-16 20:23:05 +02:00
Zangetsu38
9c224e3358 modules/SceThreadmgr: using callback of sceKernelWaitSemaCB. 2022-05-02 21:41:05 +02:00
pent0
53a25ea938 kernel: add mutex lock guard on mspace func.
- fix crash on mp4 lle.
2022-05-01 21:22:21 +02:00
bookmist
56c7717557 modules/SceLibKernel: fix sceIoLseek for 4Gb+ files 2022-03-17 06:16:05 +01:00