* Use atomic waitables instead instead of global thread wait as often as possible.
* Add ::is_stopped() and and ::is_paued() which can be used in atomic loops and with atomic wait. (constexpr cpu flags test functions)
* Fix notification bug of sys_spu_thread_group_exit/terminate. (old bug, enhanced by #9117)
* Function time statistics at Emu.Stop() restored. (instead of current "X syscall failed with 0x00000000 : 0")
* Implement handler abortion during context registration.
* Fixed recursive calls to sceNpTrophy functions such as by callbacks from registering context.
* Turns out the reader lock for context registeration was incorrect because ctxt->tropusr and trophy directory are being modified. Made it an exclusive lock after callback.
fixes#7431 Soldner-X
Assuming that a SceNpCommunicationId should have a format like "TEST12345", then there is no need to delete termination characters after we already created a truncated string with 9 characters + null terminator.
The current behaviour does not work at all, because in case that we actually have a non-null termination character, deleteTerminateChar will step over the last x chars in the already truncated ID until it forcefully finds a character of its liking. eg. term='2': "TEST12345" => "TEST1" => "TEST1_00"
- Implement sceNpTrophyAbortHandle, if handle is aborted an error code will be returned on its usage.
- Free context & handles in sceNpTrophyTerm.
- Return SCE_NP_TROPHY_ERROR_INVALID_ARGUMENT on invalid context & handles ids.
- Implement id resource shortage error checking.
- Check negative sceNpTrophyGetTrophyInfo trophy id.
- Minor error checking fix for sceNpTrophySetSoundLevel
* Prefer default initializer over std::memset 0 when possible and more readable.
* Use std::format in trophy files name obtaining.
* Use vm::ptr<>::operator bool() instead of comparing vm::ptr to vm::null or using addr().
* Add a few std::memset calls in hle where it matters (or in some places just to document an actual firmware memcpy call).
Round-to-nearest integral based division, optimized for unsigned integral.
Used in sceNpTrophyGetGameProgress.
Do not allow signed values for aligned_div(), align().