Commit graph

154 commits

Author SHA1 Message Date
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
Megamouse c89e30b3d9 cellMsgDialog: only abort dialogs that were actually spawned by cellMsgDialog 2024-09-20 20:43:57 +02:00
Megamouse 2f53d58cd9 fix some warnings 2024-04-15 19:28:28 +02:00
Megamouse 08837d2cd0 cellGame: add some more error checks 2024-04-05 23:36:37 +02:00
Megamouse 9e7b759236 cellGame: Enable disc insert/eject based on disc mount state 2024-04-05 14:45:10 +02:00
Eladash 40adf4b944 HLE: clear lower bits of Free Disk Space value 2024-03-14 11:10:45 +01:00
Eladash f40602cc59 cellGame: Fix PPU deadlocks on concurrent execution 2024-03-06 09:45:37 +02:00
Megamouse d3298c422b sys/cellGame: Fix hdd game dir name
Some games are installed with other dir names than title_id
2023-12-29 18:10:00 +01:00
Eladash c3f1d39563 Improve vfs::host::rename 2023-10-03 15:50:46 +03:00
Eladash 4462b7be5c cellGame: Make cellGameDataCheck slower
* Turns out cellGameBootCheck is actually quite fast.
* cellGameDataCheck is incredibly slow, slower for DISC type.
* Set 0 sizeKB for when RET_NONE is about to be returned.
2023-08-23 10:14:29 +03:00
Eladash 730badd378 cellAudio: Move and partially fix _mxr000 hack 2023-08-18 11:37:29 +03:00
Eladash 0989f62256 cellGame: Add some LV2 sleep
Those functions are supposed to take a really long time, and in this time the caller PPU waits for VSH.
2023-08-07 10:56:15 +03:00
Eladash 27cad422b9 cellGame: Truncate excess of characters in TITLE_ID
In cellGameDataCheckCreate
2023-02-07 18:21:18 +03:00
Megamouse 5dbadccd7f Log PSF path on error 2022-11-27 22:07:15 +01:00
Nekotekina 7c15001042 Implement read_from_ptr<>() util
Doing std::bit_cast on a "span".
Should be usable in constexpr.
2022-11-26 09:30:11 +03:00
Nekotekina 6ff6a4989a Implement at32() util
Works like .at() but uses source location for "exception".
2022-09-26 18:04:15 +03:00
Nekotekina b49a1f27eb Warning fixes 2022-09-17 16:35:02 +03:00
Eladash eb4131e1c7 cellGame: Minor revert
I think there are many more bugs here..
2022-09-07 20:42:23 +03:00
Eladash 72a6696f5c cellGame Fix PS3 disc insert 2022-09-07 17:05:51 +03:00
Megamouse 87762a9b17 cellGame: implement disc change callbacks 2022-06-24 17:34:21 +02:00
Megamouse 8e667e69f6 initial cellGameThemeInstall and cellGameThemeInstallFromBuffer 2022-06-07 07:37:30 +02:00
Elad Ashkenazi 248809ca1f cellGame: Revert cellGameDataCheckCreate2 change for now 2022-06-06 13:41:20 +02:00
Eladash f1b03b36f7 cellGame: Make stats storage non-temporary, fix cbSet->setParam initial value 2022-06-05 20:47:49 +02:00
Megamouse 72e1e242a3 cellAudio: use format instead of downmix 2022-06-02 13:12:04 +02:00
Megamouse 8acb62f6ee HLE: simplify some error formats 2022-04-22 20:56:21 +02:00
Megamouse 1d6fbf1c35 cellGameGetParamString: fix patch mode 2022-04-22 20:56:21 +02:00
Megamouse e9af0bb72b cellGameGetParamString: check_mode for category 2022-04-21 20:56:11 +02:00
Eladash 1d51f3af0c RSX-Debugger: Implement backwards scrolling
* Use 2 points of known true RSX code roots and follow them in order to peek at the current section of valid RSX code:
These roots are: current RSX instruction address and the last targeted address by a branch instruction.
2022-04-15 22:34:51 +03:00
Eladash c35da0085f PARAM.SFO loader improvement 2022-04-10 14:31:13 +02:00
kd-11 d874ca5d8c cellGame: Fall back to VERSION field if APP_VER is missing from PARAM.SFO 2022-01-10 12:27:30 +03:00
Megamouse cc21d1b3cf cellSaveData: prevent some potential crashes due to corrupt files 2021-12-14 20:30:47 +01:00
Eladash 1f3b1e1c99 Implement Emulator::GetFakeCat()
I still have nightmares about that cat.
2021-09-17 22:15:48 +02:00
Megamouse e75de44907 cellGame: treat media apps as CELL_GAME_GAMETYPE_HDD
This is kinda hacky but it fixes some errors in PlayTv
2021-07-08 22:06:48 +02:00
Megamouse 161fa95066 cellGame: improve logging 2021-07-08 22:06:48 +02:00
Ani a49446c9e9
Replace gsl::span for std::span (c++20) (#7531)
* Replace gsl::span for std::span (c++20)
* Replace gsl::byte with std::byte

Co-authored-by: Bevan Weiss <bevan.weiss@gmail.com>
2021-05-30 17:10:46 +03:00
Megamouse 1caf81811a Move unspecific Emulator code out of System.cpp 2021-04-24 11:21:22 +03:00
Megamouse a16d8ba3ea More random changes 2021-04-11 14:01:51 +03:00
Nekotekina 3107f37864 Fix psf::load error for error::stream 2021-04-10 00:43:08 +03:00
Eladash a8d5a8734a Loader/cellGame: Do not crash on invalid PSF files 2021-04-09 20:58:30 +03:00
Eladash 1213708b72
Replace some log errors (#9980) 2021-03-17 17:19:35 +03:00
Nekotekina c22e1e71f0 Continue fixing strict aliasing warnings 2021-03-13 18:02:37 +03:00
Nekotekina ea5e837bd6 fixed_typemap.hpp: return reference 2021-03-02 16:08:14 +03:00
Eladash 932f31e37b Atomic PARAM.SFO writes 2021-02-23 11:29:23 +03:00
Nekotekina b382d3b3e9 Remove ASSUME macro
It's dangerous and sometimes bluntly misused feature.
Its optimization potential is near-zero.
2020-12-10 14:08:02 +03:00
Nekotekina e055d16b2c Replace verify() with ensure() with auto src location.
Expression ensure(x) returns x.
Using comma operator removed.
2020-12-09 15:43:38 +03:00
RipleyTom af8c661a64 Remove BOM markers 2020-12-06 15:30:12 +03:00
Eladash 992a372fc7 cellGame fixes 2020-11-17 09:04:35 +01:00
Megamouse 2cee26c3e7 Cleanup some includes 2020-10-31 11:53:46 +01:00
RipleyTom 6f5bbf550a Revert part of CellHddGameCheck 2020-10-28 20:44:38 +03:00
Megamouse 27643cb715 HLE: improve cellHddGameCheck 2020-10-24 00:26:41 +03:00