Commit graph

115 commits

Author SHA1 Message Date
Megamouse 1c22cc2f52 overlays: add trophy list dialog 2025-01-01 13:42:21 +01:00
Elad 575a245f8d
IDM: Implement lock-free smart pointers (#16403)
Replaces `std::shared_pointer` with `stx::atomic_ptr` and `stx::shared_ptr`.

Notes to programmers:

* This pr kills the use of `dynamic_cast`, `std::dynamic_pointer_cast` and `std::weak_ptr` on IDM objects, possible replacement is to save the object ID on the base object, then use idm::check/get_unlocked to the destination type via the saved ID which may be null. Null pointer check is how you can tell type mismatch (as dynamic cast) or object destruction (as weak_ptr locking).
* Double-inheritance on IDM objects should be used with care, `stx::shared_ptr` does not support constant-evaluated pointer offsetting to parent/child type.
* `idm::check/get_unlocked` can now be used anywhere.

Misc fixes:
* Fixes some segfaults with RPCN with interaction with IDM.
* Fix deadlocks in access violation handler due locking recursion.
* Fixes race condition in process exit-spawn on memory containers read.
* Fix bug that theoretically can prevent RPCS3 from booting - fix `id_manager::typeinfo` comparison to compare members instead of `memcmp` which can fail spuriously on padding bytes.
* Ensure all IDM inherited types of base, either has `id_base` or `id_type` defined locally, this allows to make getters such as `idm::get_unlocked<lv2_socket, lv2_socket_raw>()` which were broken before. (requires save-states invalidation)
* Removes broken operator[] overload of `stx::shared_ptr` and `stx::single_ptr` for non-array types.
2024-12-22 20:59:48 +02:00
oltolm 2b0f786b2d
Fix std::basic_string warnings (#16261) 2024-11-11 21:54:44 +02:00
Megamouse c89e30b3d9 cellMsgDialog: only abort dialogs that were actually spawned by cellMsgDialog 2024-09-20 20:43:57 +02:00
capriots 2556f84752 cellRtc: replace vm::check_addr() with sys_memory_get_page_attribute() 2024-04-27 13:33:09 +02:00
Megamouse 47fcb9562f Trophy Manager: allow to lock/unlock trophies 2023-12-15 00:31:49 +01:00
Eladash f60bdbaece Savestates: Compressed state files 2023-11-27 12:36:17 +02:00
Elad Ashkenazi 106f31db6a sceNpTrophy: Minor UB fixup
id.data[9] is char while isprint should accept u8.
2023-07-26 17:56:44 +03:00
Megamouse 94bb75fb7c sceNpTrophy: Check if a trophy configuration file exists before starting the install process 2023-07-25 22:00:19 +02:00
Eladash 7d84d0f83e sceNpTrophy: Initial commSign checking of CreateContext 2023-07-25 21:40:35 +03:00
Megamouse f96a0ce9d2 Trophies: Add more sanity checks to pugixml backend 2023-05-30 19:11:57 +02:00
Megamouse 1ae3b37fbe sceNpTrophy: set timestamps 2023-05-23 08:22:13 +02:00
Megamouse cd9ff08235 Decrease some include madness 2023-04-26 21:37:44 +02:00
Megamouse 4c8630d29f sceNpTrophyRegisterContext: log tls error 2022-10-22 22:30:23 +02:00
Megamouse 5b66fe47db sceNpTrophyCreateContext: do not log nul characters 2022-10-22 22:30:23 +02:00
Elad Ashkenazi fcd297ffb2
Savestates Support For PS3 Emulation (#10478) 2022-07-04 16:02:17 +03:00
Megamouse e5a75cfd1c sceNpTrophyGetTrophyUnlockState: handle read_only 2022-05-07 13:58:05 +02:00
Megamouse 1f745c4588 sceNpTrophyRegisterContext: add read_only check 2022-05-07 13:58:05 +02:00
Megamouse 6c7f49d563 sceNpTrophy: don't use TROPHY.TRP in CreateContext 2022-05-07 13:58:05 +02:00
Megamouse dae51a4a2b sceNpTrophy: remove confirmed comment 2022-05-07 13:58:05 +02:00
Megamouse d113324a90 sceNpTrophyRegisterContext: handle SHOW_ERROR_EXIT 2022-05-07 13:58:05 +02:00
Megamouse ee98f577e2 sceNpTrophyGetTrophyIcon: SCE_NP_TROPHY_ERROR_HIDDEN
And prevent some possible segfaults
2022-03-31 23:02:35 +02:00
Eladash 1e9afdc289 Formatting Library: Implement byte arrays formatting 2021-07-17 18:10:43 +02:00
Eladash 48870f3e8b TROPUSR: Loader Improvements
* Replace invalid TROPUSR.DAT with empty new ones. (+report an error)
* Fix return code of Load whenever TROPUSR.DAT hadn't existed before.
* Add header magic test.
* sceNpTrophyRegisterContext will abort if TROPUSR.DAT generation failed.
2021-05-21 16:43:34 +03:00
Megamouse a16d8ba3ea More random changes 2021-04-11 14:01:51 +03:00
Eladash 1d7fbd6a9a Fix sceNpTrophyGet(Trophy/Game)Icon 2021-03-17 22:31:57 +03:00
Eladash 1213708b72
Replace some log errors (#9980) 2021-03-17 17:19:35 +03:00
Nekotekina ea5e837bd6 fixed_typemap.hpp: return reference 2021-03-02 16:08:14 +03:00
Eladash f43260bd58
Atomic waiting refactoring (#9208)
* 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")
2021-02-13 17:50:07 +03:00
Nekotekina f944573b3c Fix old warnings: remove strncpy
Use strcpy_trunc instead.
Change some sce structs.
2021-01-20 12:26:09 +03:00
Eladash e1f95ceb54
sceNpTrophy: Fix sceNpTrophyRegisterContext for handler abortion (#9586)
* 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.
2021-01-12 19:14:51 +03:00
Nekotekina 41ee792f95 MSVC: remove MemLeak build support
There are better memleak detection tools.
1) Requires to guard placement new and external libs
2) Doesn't work thoroughly
2020-12-22 14:32:30 +03:00
Nekotekina eec11bfba9 Move align helpers to util/asm.hpp
Also add some files:
GLTextureCache.cpp
VKTextureCache.cpp
2020-12-18 18:07:42 +03:00
Nekotekina fb29933d3d Add usz alias for std::size_t 2020-12-18 12:23:53 +03:00
Nekotekina eb66302907 atomic.hpp: replace std::atomic with atomic_t
Dual dependency is nothing good.
2020-12-07 17:13:12 +03:00
RipleyTom af8c661a64 Remove BOM markers 2020-12-06 15:30:12 +03:00
Nekotekina 34fa010601 Improve cond_var notifiers
But nobody uses it anyway, so clean up includes.
2020-11-06 00:10:16 +03:00
Megamouse 2cee26c3e7 Cleanup some includes 2020-10-31 11:53:46 +01:00
Eladash 418968d974 sceNpTrophy: Add logging of commSign 2020-09-22 19:46:52 +03:00
Eladash 89905bc1c4 sceNpTrophyRegisterContext: Implement SCE_NP_TROPHY_STATUS_NOT_INSTALLED 2020-09-22 19:46:52 +03:00
Megamouse 0b42cf06f8 sceNpTrophyCreateContext: improve commId logging 2020-09-21 15:32:02 +02:00
Megamouse 4c4be331f5 HLE: Fix sceNpTrophyCreateContext
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"
2020-09-21 15:32:02 +02:00
Eladash f0d526411c IDM: Implement idm::clear<typename> 2020-06-12 22:12:36 +03:00
Nekotekina Aux1 250736ece5 Fix warnings in emucore 2020-03-04 21:23:34 +03:00
Nekotekina 92e3eaf3ff Fix signed-unsigned comparisons and mark warning as error (part 2). 2020-02-19 22:54:58 +03:00
Megamouse fe75311be2 move config structs to own files and clean up some headers 2020-02-17 15:08:17 +03:00
Eladash c1bdaccd8c sceNpTrophyRegisterContext: Fix off by one progress callbacks count 2020-02-15 23:32:29 +01:00
Eladash 4421831c8b sceNpTrophyRegisterContext: Fix values passed to first callback 2020-02-15 23:32:29 +01:00
Eladash d03804b523 Fix sceNpTrophyGetTrophyInfo
* Only writeback data on success.
* Fix a typo on error code of invalid trophy ID.
2020-02-15 23:32:29 +01:00
Eladash 04e0bf2eff Whitespace fix after #7087
Was this close to enter programmers' hell.
2020-02-15 11:37:13 +03:00