Compare commits

..

282 Commits

Author SHA1 Message Date
Sanjay Govind 1b595318e7 libusb: support hotplug 2025-01-23 11:16:52 +13:00
Megamouse 1cff5b35d4 input: add vibration multiplier 2025-01-21 08:44:38 +01:00
MSuih 9c5584956e Update minimum pugixml version to 1.15 2025-01-20 17:18:09 +01:00
kd-11 2af497efbb rsx: Fix texcoord transformation bug caused by incorrect BFE usage 2025-01-19 19:31:59 +03:00
kd-11 58a09e6838 vk: Use common pipeline layout in interpreter
- Avoids the layouts going out of sync every time something changes
2025-01-19 19:31:59 +03:00
kd-11 b5b93e962b vk: Factor out common pipeline layout generator into reusable parts 2025-01-19 19:31:59 +03:00
Emma 10e0fb2b54 sys_prx: implement get_module_id_by_name, module_info_v2 (#16573) 2025-01-18 15:16:38 +02:00
Megamouse 0a6f9ed967 windows: Ignore OneDrive in PATH. It leads to false positives 2025-01-17 00:32:54 +01:00
Megamouse a7edfa221e windows: move logs to log dir 2025-01-16 21:33:33 +01:00
Megamouse 451e953d26 windows: move config.yml and games.yml to /config/ 2025-01-16 21:33:33 +01:00
Megamouse 5c2c4a6649 input: issue basic mouse move event on window leave
This may help with moving the mouse to the screen borders in windowed mode
2025-01-16 18:27:16 +01:00
kd-11 09580594e6 rsx: Fix shader cache loading 2025-01-16 02:43:33 +03:00
kd-11 efc9ae98ed vk: Fix out-of-bounds write when emitting MSAA unresolve clear command for NVIDIA fallback 2025-01-15 11:27:04 +03:00
kd-11 7da0822419 rsx/shaders: Fix MSAA coords wrapping when input is negative 2025-01-15 11:27:04 +03:00
kd-11 e1c6df0df3 rsx: Fix dynamic constants patching when draw call is skipped
- Also adds an optimization to skip reuploads when patch occurs outside our critical range.
2025-01-15 11:27:04 +03:00
kd-11 7965a0313c rsx: Improved shader interpreter support when hw instancing is active 2025-01-15 11:27:04 +03:00
Megamouse 0cc61d0ef0 windows: check for OneDrive paths 2025-01-14 23:32:02 +01:00
Megamouse 1966171838 Use string_view in rXml 2025-01-14 21:35:57 +01:00
Megamouse 2643fbdea4 Update pugixml to 1.15 2025-01-14 21:35:57 +01:00
Megamouse 82bbb0cc05 Update libpng to 1.6.45 2025-01-14 21:35:57 +01:00
Megamouse d91927ee97 Qt/input: allow keypresses in raw mouse handler 2025-01-14 15:52:46 +01:00
capriots ae670c35f7 cellAtracXdec: use lv2 mutexes + conds 2025-01-14 11:32:32 +02:00
Megamouse d1ccadbac2 cellGem: ignore intercepted input 2025-01-14 08:53:36 +01:00
Megamouse 78a661db79 input: simplify raw mouse button press handling 2025-01-14 00:00:50 +01:00
Megamouse b65f977c54 Qt/input: fix raw mouse button assignment 2025-01-14 00:00:50 +01:00
Megamouse 1b87e186c4 cellGem: fix initial tracker done state 2025-01-10 21:53:37 +01:00
Megamouse 3eb1e6303c cellGem: Use wait_on, fix fake/mouse move tracker wait 2025-01-10 21:53:37 +01:00
Megamouse 3b8efecc52 cellGem: Use atomic wait instead of wait_for 2025-01-10 21:53:37 +01:00
Megamouse 6716d555ff cellGem: Update controllers at 10 Hz in separate thread
Some games don't use cellGemGetInfo.
Which means we had to reboot the game if the controller wasn't
connected on boot.
Updating controllers outside of the cell functions fixes this problem.
2025-01-10 21:53:37 +01:00
kd-11 27c56cde22 rsx/shaders: Track active MRT count per shader
- Also use more robust hashing to avoid collisions
2025-01-10 04:34:28 +03:00
kd-11 a635e24fc2 rsx: Default initialize vertex program fields
- Fixes a crash when RSXVertexProgram is default-initialized. This
  probably also fixes a whole class of crashes that occur when
  shader interpreter is in use since that pipeline uses a
  default-initialized stub.
2025-01-10 04:34:28 +03:00
kd-11 dce0abc8b9 rsx/fp: Re-design register write tracking
- Always collapse register writes when exporting FS outputs
2025-01-10 04:34:28 +03:00
kd-11 88e13d8326 rsx: Don't crash when invalid buffer is allocated for a shader 2025-01-10 04:34:28 +03:00
Megamouse 061be74cdb Qt: add mouse config legend to mouse move dialog 2025-01-10 00:50:02 +01:00
Megamouse d6f2f66f2b Qt/Input: use empty string for pad_button_max_enum
Also shorten translated mouse button strings
2025-01-10 00:50:02 +01:00
Megamouse b8d0396f71 Fix self assignment warning 2025-01-10 00:50:02 +01:00
Megamouse a0df1e09a6 ps move: allow to configure mouse move handler buttons 2025-01-10 00:50:02 +01:00
Megamouse 7e03828f35 input: Allow mapping keys to basic mouse buttons 2025-01-09 21:59:01 +01:00
Megamouse 9407974c10 cellGem: Add more camera image conversions 2025-01-09 09:38:36 +01:00
Megamouse 3381a884d0 Fix some warnings 2025-01-08 20:02:33 +01:00
Megamouse 415c2d0795 fake move: add gyro support 2025-01-08 20:02:33 +01:00
Megamouse 92d0707291 Decrease mouse move assignment distance 2025-01-07 21:11:46 +01:00
Elad c6f3737c2a PPU LLVM: Fixup patches enlisting in analyzer 2025-01-07 20:42:45 +02:00
Antonino Di Guardo ec77f2ab92 Minor cleanup (#16519)
* Minor cleanup
2025-01-07 19:46:13 +03:00
Elad 0b784ff2c1 PPU LLVM: Function table dependent resolver hashing 2025-01-07 15:43:41 +02:00
Megamouse c443326fb1 Do not re-use the old game window if the renderer changed 2025-01-06 15:49:09 +01:00
Megamouse 2ac171a30f move error_report to ErrorCodes.cpp 2025-01-06 15:49:09 +01:00
Megamouse 7369169331 Disable continuous mode if a savestate is not possible 2025-01-06 15:49:09 +01:00
Megamouse d5470d92ec Keep game window open when loading the last savestate 2025-01-06 15:49:09 +01:00
Megamouse cc7e7300ce Clean up old game window in case of unexpected errors 2025-01-06 15:49:09 +01:00
Megamouse 3ce4c95e61 Show message while creating savestate in continuous mode 2025-01-06 15:49:09 +01:00
Megamouse 1ab3a0bd73 RSX/Qt: Reuse gs_frame if possible 2025-01-06 15:49:09 +01:00
Megamouse 99f1f4c22a cheats: add float32 gui support 2025-01-06 10:48:00 +01:00
oltolm 41a4dd4c1c cmake: fix wolfssl 2025-01-05 23:03:00 +01:00
oltolm 1080969b51 cmake: remove "--no-quick" from windeployqt 2025-01-05 23:03:00 +01:00
Elad 6165c2d8b3 Thread.h: Fix a bug by adding thread_state::destroying_context 2025-01-05 10:01:35 +02:00
Elad 036693a14d Fix sys_config_unregister_service 2025-01-05 10:01:35 +02:00
Aleksey Komarov c9d39ce7ae vk: Support panvk, allow creating device without textureCompressionBC
panvk supports BC1-BC3 which is all RPCS3 require, support is reported as
false since not all formats are supported
2025-01-04 20:22:05 +02:00
Aleksey Komarov da84326bd0 vk: Add driver vendor PANVK (Mali GPU on Mesa) 2025-01-04 20:22:05 +02:00
Megamouse f255392a75 patches: create patch path on update 2025-01-04 15:45:22 +01:00
Megamouse af3154a0d4 Qt: delete settings_dialog 2025-01-04 15:45:22 +01:00
Megamouse d2b96636db Qt: delete batch progress dialog after user closed it (as originally intended) 2025-01-04 11:31:25 +01:00
Megamouse 635eac7704 Qt: fix batch compilation after a game was already running
Batch compilation wasn't working if g_system_progress_canceled wasn't reset
2025-01-04 11:31:25 +01:00
Megamouse 51417cc8c3 Qt: stop batch compilation immediately on cancel 2025-01-04 11:31:25 +01:00
Elad 2614450e4b Fix IDM image serialization 2025-01-04 09:29:09 +02:00
Megamouse 8ea27b0aca Qt: workaround for crash in long accepted slot 2025-01-03 20:21:56 +01:00
Megamouse 4f76aec6b3 VS: Fix compilation with new wolfssl version 2025-01-03 20:21:56 +01:00
Megamouse dfdb33befb Update xxHash to 0.8.3 2025-01-03 20:21:56 +01:00
Megamouse e76bd11f53 Update Wolfssl to 5.7.6 2025-01-03 20:21:56 +01:00
Megamouse 4b4399f63f Update FAudio to 25.01 2025-01-03 20:21:56 +01:00
Megamouse 796189ce68 Update SDL to 2.30.11 2025-01-03 20:21:56 +01:00
Elad a8f80ebfe9 sys_time.cpp: Anti TSC measures 2025-01-03 16:26:21 +02:00
Andrew Griffiths cb3662cc4d MacOS: fix for crash in SDL_Quit w/ gamepad input 2025-01-02 18:58:24 +01:00
Megamouse fb237dd568 Audio: Add mute/unmute and volume shortcuts
Also add auto repeat to volume shortcuts
2025-01-02 09:34:47 +01:00
Aleksey Komarov 799cb79612 qt6: QT_MIN_VER should be 6.7 because of QCheckBox::checkStateChanged
Check: https://doc.qt.io/qt-6/qcheckbox.html
2025-01-01 23:04:56 +01:00
Megamouse 1c22cc2f52 overlays: add trophy list dialog 2025-01-01 13:42:21 +01:00
kd-11 0bb2f72ee2 rsx: Flush MM queue before memory is unmapped 2024-12-31 01:52:58 +03:00
schm1dtmac b16d267f9d Fix types 2 2024-12-30 07:29:31 +02:00
schm1dtmac 9ffa923da6 Use corresponding SI/IEC units 2024-12-30 07:29:31 +02:00
schm1dtmac 8feccffec0 Fix types 2024-12-30 07:29:31 +02:00
schm1dtmac 3a16b2e92c Report filesizes on macOS as decimal multiples
i.e. multiples of 1000
2024-12-30 07:29:31 +02:00
Elad a8bfa6a16c SPU: Operating system LR memory signals 2024-12-29 21:01:17 +02:00
kd-11 e135012acd rsx: Properly track changes in instancing state 2024-12-29 20:53:05 +03:00
kd-11 9de6a38e13 rsx: Test vertex program flags on each draw 2024-12-29 20:53:05 +03:00
kd-11 0baf873534 Cosmetic improvements 2024-12-29 20:53:05 +03:00
kd-11 35a66fe776 rsx: Do not use global registers object in logical "firmware" units 2024-12-29 20:53:05 +03:00
kd-11 0be8a5f9f4 rsx: Handle dangling execution barriers 2024-12-29 20:53:05 +03:00
kd-11 01fe39fbb9 rsx: Fix rare crash in vertex program decompiler
- This whole decompiler mess needs a rewrite
2024-12-29 20:53:05 +03:00
kd-11 cfc124fabf rsx: Fix instancing bug when indexed addressing is used to read constants 2024-12-29 20:53:05 +03:00
kd-11 15961b353a vk: Add support for hardware instanced draws 2024-12-29 20:53:05 +03:00
kd-11 d4573e233a rsx: Fix vertex program compiler crash 2024-12-29 20:53:05 +03:00
kd-11 9307abe7f5 rsx: Move more functions from rsx thread to the draw command processor 2024-12-29 20:53:05 +03:00
kd-11 05bab8ec4c rsx: Move draw call related functions to their own class 2024-12-29 20:53:05 +03:00
kd-11 9e9ae54455 rsx: Add GLSL support for instanced rendering 2024-12-29 20:53:05 +03:00
kd-11 e696d9b324 rsx: Add code to detect instanced draw commands 2024-12-29 20:53:05 +03:00
kd-11 43e04f3fc7 Revert "rsx/vk: Implement hardware instancing (#16466)"
This reverts commit 62701154f1.
2024-12-29 20:53:05 +03:00
kd-11 62701154f1 rsx/vk: Implement hardware instancing (#16466)
* rsx: Add code to detect instanced draw commands

* rsx: Add GLSL support for instanced rendering

* rsx: Move draw call related functions to their own class

* rsx: Move more functions from rsx thread to the draw command processor

* rsx: Fix vertex program compiler crash

* vk: Add support for hardware instanced draws

* rsx: Fix instancing bug when indexed addressing is used to read constants

* rsx: Fix rare crash in vertex program decompiler

- This whole decompiler mess needs a rewrite

* rsx: Handle dangling execution barriers

* rsx: Do not use global registers object in logical "firmware" units

* Cosmetic improvements

* rsx: Test vertex program flags on each draw

* rsx: Properly track changes in instancing state
2024-12-29 17:39:47 +02:00
Megamouse 15f29eedee Fix atomic_ptr value constructing overloads (#16473)
* Fix idm remove

idm::remove calls shared_ptr::exchange with a null_ptr.
This calls the stored object's constructor with null args.

---------

Co-authored-by: Elad <18193363+elad335@users.noreply.github.com>
2024-12-29 14:53:04 +02:00
Elad 439d665096 CELL: Fix reservation notifications 2024-12-29 11:06:44 +02:00
Megamouse 418a99a62b VS: add some missing files to solution filters 2024-12-28 23:09:51 +01:00
Megamouse 1eac13b6bf Windows: log command line args in utf8 2024-12-28 23:09:51 +01:00
Darkhost1999 e58bd419f6 Add empty hdd tmp to UI (#16462)
This option is need for those using sprx mods and amongst other homebrew reasons such as apollo savedata.
2024-12-28 22:20:22 +01:00
Megamouse 5e176a390f MacOS: silence some warnings 2024-12-28 19:58:59 +01:00
Megamouse a49cfc5a91 Simplify some ternaries 2024-12-28 19:58:59 +01:00
Megamouse d3fedffa6a VS: Add sysinfo_darwin.mm to filters 2024-12-28 19:58:59 +01:00
Megamouse 33c3e3fb0f fix some warning 2024-12-28 18:10:06 +01:00
Megamouse 1d23be8429 Qt: Add Operating system category 2024-12-28 18:10:06 +01:00
Elad 7a4e88c146 Savestates: Fix main_ppu_module definition 2024-12-27 22:08:28 +02:00
Elad cfeb022340 shared_ptr.hpp: Rewrite shared_ptr to single_ptr conversion
Logic felt non-intuitive and this method should be very explicit.
2024-12-27 22:08:28 +02:00
Elad 0cc655074d serialzation.hpp: Fix add_padding 2024-12-27 22:08:28 +02:00
Elad a5ba96e991 Fixup lv2_socket 2024-12-27 22:08:28 +02:00
kd-11 b2949f114b vk: Wrap device fault handler in SEH2 2024-12-25 01:41:23 +03:00
kd-11 e3df7bccac vk: Selectively enable extended device fault features in logical device creation step 2024-12-25 01:41:23 +03:00
kd-11 2c45438422 vk: Minor improvements to extended fault output 2024-12-25 01:41:23 +03:00
kd-11 4ef1d48c0c vk: Properly initialize device fault counts structure 2024-12-25 01:41:23 +03:00
kd-11 7b6a672c64 vk: Fix device fault extension loading 2024-12-25 01:41:23 +03:00
kd-11 883529eaf3 vk: Add support for spec-compliant query scopes 2024-12-25 01:41:23 +03:00
kd-11 afc10ea112 vk: Workaround for older SDK header versions 2024-12-25 01:41:23 +03:00
kd-11 488e5d9eb5 vk: Register honeykrisp as known driver in RTT quirks check 2024-12-25 01:41:23 +03:00
kd-11 6d976b5d90 vk: Fix build 2024-12-25 01:41:23 +03:00
kd-11 b44e2d3b30 vk: Add basic support for honeykrisp driver 2024-12-25 01:41:23 +03:00
kd-11 a196bbcbcd vk: Remove unnecessary workaround for older SDK versions 2024-12-25 01:41:23 +03:00
kd-11 6000e3a47d vk: Add support for extended device fault information 2024-12-25 01:41:23 +03:00
Elad 623f5822b3 Fix Emulator::Pause() segfault 2024-12-24 21:31:57 +02:00
Elad c6dadc537b Add some FXO init checks 2024-12-24 21:31:57 +02:00
Elad 98a0c76a08 StrFmt.cpp: Make function printing shorter 2024-12-24 21:31:57 +02:00
Elad a2d5b5a0e2 Fixup GDB 2024-12-24 21:31:57 +02:00
Elad d376ba5994 Remove lv2_socket_native destructor 2024-12-24 21:31:57 +02:00
Elad 6a4b9430c0 Thread.h: Add a few noexcept 2024-12-24 21:31:57 +02:00
Elad 3bf735161f sys_config: Move cleanup to IDM abort 2024-12-24 21:31:57 +02:00
Elad 4d0c835df3 util/shared_ptr.hpp: STX pointers library fixes 2024-12-24 21:31:57 +02:00
Elad 6eb4138595 Fixup sys_process 2024-12-24 21:31:57 +02:00
Megamouse 53817dcc90 Fix fs::file log formatting 2024-12-23 11:29:13 +01:00
Megamouse 99044ce6c6 Qt: allow to skip further automatic update notifications for a single version 2024-12-23 01:56:39 +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
Whatcookie 385710672f SPU LLVM: Recognize ROTYQBYI and ROTQBI rotation pattern (#16409)
Co-authored-by: Elad <18193363+elad335@users.noreply.github.com>
2024-12-22 10:29:15 +02:00
Megamouse beb3565001 ps move tracker: draw sphere size range into live image 2024-12-21 14:36:24 +01:00
Megamouse ec7f50d925 ps move tracker: set max of radii to 50%
It makes no sense to have a larger radius than half of the image size
2024-12-21 14:36:24 +01:00
Megamouse 1a479e9bda ps move tracker: fix min and max radius labels 2024-12-21 14:36:24 +01:00
Megamouse 19cc363b09 ps move tracker: fix some data types 2024-12-21 14:36:24 +01:00
kd-11 760b49bc6c Cleanup 2024-12-21 15:24:15 +03:00
kd-11 70eca8cb24 vk: Fix border color swizzling behavior 2024-12-21 15:24:15 +03:00
Megamouse ff0249d662 ps move: ignore second half frame in ZCM1
These values have high noise on my model and make it unusable.
2024-12-21 03:24:32 +01:00
Megamouse d450a5ee95 cellGem: add magnetometer support 2024-12-21 03:24:32 +01:00
Megamouse 1cf927aef9 cellGem: request orientation reset during calibration 2024-12-21 00:48:52 +01:00
Megamouse 8678402c25 cellGem: fix some data types 2024-12-20 17:30:25 +01:00
Megamouse ee2ea0cb02 cellGem: invalidate hue and tracking in cellGemInvalidateCalibration
This fixes the cursor color in OVERKILL
2024-12-20 17:30:25 +01:00
Megamouse cf0b4d4ed4 cellGem: split status_flags into calibration flags and runtime flags 2024-12-20 17:30:25 +01:00
Megamouse cc50049bca cellGem: implement cellGemSetRumble 2024-12-20 17:30:25 +01:00
Megamouse c6a76eb9af cellGem: add setting to let the game actually set the device hues
This is not very useful at the moment since the tracker can't really
handle random hues yet.
2024-12-20 17:30:25 +01:00
Megamouse 67e8e373a7 cellGem: set sphere RGB when a hue is set and vice versa 2024-12-20 17:30:25 +01:00
Megamouse 304964ba71 cellGem: add debug setting for painting spheres into the live image 2024-12-20 17:30:25 +01:00
Megamouse d2c58765cd cellGem: fix some data types 2024-12-20 17:30:25 +01:00
Megamouse 385d21e6dc Fix some warnings 2024-12-20 17:30:25 +01:00
Megamouse 0fd6956bb0 cellPhotoDecode: allow dev_bdvd paths 2024-12-19 18:01:10 +01:00
Megamouse 5073477415 cellGem: Split horizontal and vertical mouse rotation cone setting 2024-12-19 16:55:39 +01:00
Megamouse c56147e04b Qt: fix settings_dialog opening on wrong tab
The dialog now uses open instead of exec, so we have to override open.
2024-12-19 13:49:43 +01:00
Megamouse 79fc366f23 Qt: fix flow_layout segfault 2024-12-19 13:49:43 +01:00
capriots 9d4ff13c2b cellAdec implementation part 2: LPCM decoder (#16381)
* cellAdec: savestate fixup

* simd.hpp: add some intrinsics

* cellAdec implementation part 2: LPCM decoder

* cellAdec: set to HLE by default

* cellAdec: review fixes

---------

Co-authored-by: Elad <18193363+elad335@users.noreply.github.com>
2024-12-18 20:21:56 +02:00
Megamouse e18ae5abd6 cellGem: expose rotation cone to settings 2024-12-18 09:14:04 +01:00
Megamouse f3ef4f3658 cellCamera: try to fix internal state on stop
When stopping, the camera is supposed to be open still.
Add an expected state to check the camera signal does what it should.
2024-12-18 03:54:25 +01:00
Megamouse 73a62b4bf6 Update SDL to 2.30.10 2024-12-17 22:44:46 +01:00
Megamouse cd47113ed8 Update curl to 8.11.1 2024-12-17 22:44:46 +01:00
Megamouse 8793e6ded7 Update 7zip to 24.09 2024-12-17 22:44:46 +01:00
Megamouse 29a3c36e26 Update OpenAL to 1.24.1 2024-12-17 22:44:46 +01:00
Megamouse 141ac0d09f Update FAudio to 24.12 2024-12-17 22:44:46 +01:00
Megamouse 657ab4261c Fix some static analysis warnings 2024-12-17 20:46:07 +01:00
Megamouse 5491fbee5b Fix warning 2024-12-17 20:46:07 +01:00
RipleyTom 18f82f0006 Fix unused p2p socket closing 2024-12-17 15:09:59 +02:00
kd-11 30ca2370ab rsx: Improve MM synchronization 2024-12-16 19:00:08 +03:00
kd-11 21eaee0e23 rsx: Revert bounds optimization on RO texture load 2024-12-16 19:00:08 +03:00
kd-11 cd7e1e1e2b rsx: Improve performance even more when async MM is active 2024-12-16 19:00:08 +03:00
kd-11 4b30e82aee rsx: Restore previous (incorrect) low-precision format handling 2024-12-16 19:00:08 +03:00
kd-11 83c0212b59 rsx/qt: Add option to disable async host MM to GUI 2024-12-16 19:00:08 +03:00
kd-11 4eb0ee23db Fix linux build 2024-12-16 19:00:08 +03:00
kd-11 b4a72b6223 rsx: Fix texture renormalization flag and fix windows build 2024-12-16 19:00:08 +03:00
kd-11 c9a7abdd09 rsx: Fix OpenGL deadlock 2024-12-16 19:00:08 +03:00
kd-11 49d11b2e36 rsx: Make the deferred mm flush option usable with OpenGL 2024-12-16 19:00:08 +03:00
kd-11 83764fbbb4 rsx/vk: Implement asynchronous host memory management. 2024-12-16 19:00:08 +03:00
schm1dtmac 64ec19f018 Fixup Intel macOS builds
oops
2024-12-15 15:04:46 +01:00
schm1dtmac 692c88f0e9 Revert Qt to 6.7.3 for macOS 2024-12-14 00:01:17 +01:00
Megamouse 8dbe88782c cellGem: Improve mouse handler orientation
This also makes it easily configurable with the CONE setting in the future
2024-12-13 08:55:52 +01:00
Megamouse b08829817f PS Move: fix calibration logging 2024-12-13 08:55:52 +01:00
Megamouse 585f47c2d9 PS Move: Disable Fusion gain (no more drift) 2024-12-13 08:55:52 +01:00
Megamouse 56a254ba9c move tracker: ignore sporadic shape and position changes
The tracker may get a random result for a couple of frames occasionally.
Just report the last known position and shape instead.
2024-12-12 16:52:47 +01:00
Megamouse 55ead61ea8 move tracker: ignore sporadic invalid results
The tracker may fail for a couple of frames occasionally.
Just report the last known position instead.
2024-12-12 16:52:47 +01:00
Megamouse f96cfe08f4 cellGem: lock tracker mutex in get_info
This may reduce the possibility of unexpected tracking results
2024-12-12 16:52:47 +01:00
Megamouse 49081d0d82 Qt 6.8.1 2024-12-12 02:20:01 +01:00
Megamouse a31ebc248e cellGem: implement quaternion transformation 2024-12-11 18:56:53 +01:00
Megamouse 3d11b6efa3 cellGem: try to map accelerometer and gyro 2024-12-11 18:56:53 +01:00
Megamouse 13cd461a1f sys_rsx_context_attribute: Improve errors 2024-12-11 18:56:53 +01:00
Antonino Di Guardo 68b7e5971d Welcome Dialog: Reject users that reject our TOS
* Improved welcome dialog

* "show at startup" checkbox always changeable
2024-12-07 20:56:05 +02:00
Antonino Di Guardo 24655fd975 fix dark theme switching on initial welcome dialog (#16373) 2024-12-06 20:14:35 +01:00
Darkhost1999 05d12f68ad Test
Works on my machine
2024-12-05 12:55:23 +02:00
Elad d84fe592c8 PRX: Do not check exported function code address 2024-12-03 19:01:17 +02:00
Elad b4505600c7 PPU: Notify SPUs while waiting for its own state 2024-11-30 18:06:34 +02:00
Elad a4ea71d18f CELL: Rewrite reservation notification postponing 2024-11-30 18:06:34 +02:00
Megamouse 729826ec40 cellGem: fix HUE_NOT_SET 2024-11-29 05:39:11 +01:00
Megamouse a8b0c0be07 cellGem: calculate distance from sphere to camera 2024-11-29 05:39:11 +01:00
Elad 926de68a79 Debugger: Dump related thread information on crash 2024-11-28 13:32:52 +02:00
Elad cf850598eb System.cpp: Do not hold on fs::dir handle 2024-11-28 05:47:40 +02:00
Elad 2b9f076024 fs: Minor fix of fs::dir::open
Did not close previous handle on fs::dir::open like on fs::file
2024-11-28 05:47:40 +02:00
Elad d63e643081 Emu: Fixup 2024-11-28 05:47:40 +02:00
Elad 9a2bcd2508 System.cpp: Fix Kill() on bad app startup 2024-11-27 16:00:40 +02:00
Elad f3b9d64df7 Add some asserts for g_fxo->init<> 2024-11-27 16:00:40 +02:00
Elad 68c58281e5 System.cpp: Add system_state::loading 2024-11-27 16:00:40 +02:00
Elad 07df91d4e8 Fix Emulation boot recursion 2024-11-27 16:00:40 +02:00
Elad 378a69ea85 Qt: Deprecate processEvents() part 2 2024-11-27 16:00:40 +02:00
Elad 191e132c6c util/types.hpp: Rewrite narrow<> 2024-11-27 16:00:40 +02:00
Elad fce07bbeab Qt: Deprecate proccessEvents() usage 2024-11-26 03:33:24 +02:00
kd-11 3e427c57f0 rsx: Use strict bounds testing when replacing memory via blit engine 2024-11-25 22:21:07 +03:00
kd-11 9afebfdd72 rsx/texture-cache: Rework invalidation cause object to have more granular controls 2024-11-25 22:21:07 +03:00
kd-11 109b841d8d rsx/util: Change the filter function to an in-place erase-if operation 2024-11-25 22:21:07 +03:00
Darkhost1999 b94ddb0cd3 Migrate Savestates Home Menu (#16340) 2024-11-23 21:29:07 +02:00
Elad b073d08a52 LLVM: Implement Recursive Intrinsics 2024-11-23 20:22:58 +02:00
capriots fcf0b74c79 VS: add quotes around paths
Fixes use with paths that contain spaces.
2024-11-23 18:10:29 +02:00
capriots e7fd4224ad cellDmuxPamf: add module + stubs 2024-11-23 17:01:25 +02:00
capriots 8778e69f9d cellAdec: make AdecContext and AdecFrame trivial classes 2024-11-23 17:01:25 +02:00
capriots 108247dccc Invalidate savestates 2024-11-23 17:01:25 +02:00
capriots 9b3b9562c0 cellAdec: review + warning fixes 2024-11-23 17:01:25 +02:00
capriots e7f1a34fe1 cellAdec implementation part 1: abstraction layer 2024-11-23 17:01:25 +02:00
capriots 0a29ca2946 Fix HLE PPU callback stack arguments 2024-11-23 17:01:25 +02:00
RipleyTom 0e8f1a9bf9 sys_net: Remove lingering ppu_to_awake from queue on timeout 2024-11-22 18:44:01 +02:00
Megamouse a9f6b012b8 Qt 6.8.0 2024-11-22 15:48:16 +01:00
Megamouse 4ba4bddb09 Fix some warnings 2024-11-22 15:48:16 +01:00
Megamouse 3b51368be2 Qt: Use inplace image mirroring in video sink 2024-11-22 15:48:16 +01:00
FlexBy420 0111fd0d0e Make error message for temporary and archive translatable (#16331) 2024-11-20 16:54:31 +02:00
Elad cc86e01df9 lockless.h: Fox 2024-11-18 18:45:34 +02:00
Elad 1dfee5fbfa lockless.h: Fixup addressing 2024-11-18 18:45:34 +02:00
Elad 21f65f087d lockless.h: Fixup lf_array assert 2024-11-18 18:45:34 +02:00
Elad ac849b958f Progress: Dialog: Fixup memory management 2024-11-18 18:45:34 +02:00
Megamouse 806a1202c5 VS: ignore opencv debug build guard (fix debug build) 2024-11-16 23:31:54 +01:00
Megamouse 2ee1770383 ci: Don't fetch opencv submodule unless on windows 2024-11-16 17:36:56 +01:00
digant 21da04364d gitignore cleanup
These files and folders are all deprecated
2024-11-16 17:36:56 +01:00
digant73 a66ba27791 added missing -p option 2024-11-16 17:36:56 +01:00
digant73 3fa3298a31 fixed CI for building on windows 2024-11-16 17:36:56 +01:00
digant eccb3f6d0b Improve and fix sln solution 2024-11-16 17:36:56 +01:00
Megamouse 29901d65ed More constexpr 2024-11-16 15:10:20 +01:00
Megamouse 0bb83ed5e9 Fix warning 2024-11-16 15:10:20 +01:00
Megamouse 2d14742a05 Add opencv to cmake 2024-11-16 15:10:20 +01:00
Megamouse 6eaaadec71 Move opencv submodule to subdirectoty 2024-11-16 15:10:20 +01:00
Megamouse b89f7515fd Qt: show warning if ps move tracking is not supported 2024-11-16 15:10:20 +01:00
Elad 05096854bc Update vm_native.cpp 2024-11-16 13:53:25 +02:00
Elad 68d74bc28a Progress Dialog: Fix recursion and concurrency use of text updates 2024-11-16 12:22:23 +02:00
Elad 1475625705 Implement lf_array::for_each 2024-11-16 12:22:23 +02:00
Elad 935e83a490 Utilities\lockless.h: Flatten recusrion in lf_array
Add assert for sane index access.
2024-11-16 12:22:23 +02:00
Megamouse 4df58494a0 Fix compilation 2024-11-16 09:45:31 +01:00
Megamouse f16dfd8ca2 Add HAVE_OPENCV preprocessor flag 2024-11-16 09:45:31 +01:00
Megamouse 72dc5b3489 Windows: Add and deploy opencv files 2024-11-16 09:45:31 +01:00
Megamouse b89cc9b973 cellGem: implement real ps move handler 2024-11-16 09:45:31 +01:00
Elad e7faec6b0e util/vm_native.cpp: Fix memory leak 2024-11-15 14:00:30 +02:00
Megamouse 7866dc2e34 overlays: localize RPCS3 progress dialog 2024-11-15 09:48:12 +01:00
Megamouse 070add461f overlays: get localized values in home menu settings 2024-11-15 09:48:12 +01:00
Megamouse 1211acd59c Qt: Add std::string GetSettingOptions
This has the potential for some minor optimizations
2024-11-15 09:48:12 +01:00
Megamouse d78c39b3ab overlays: add more overlay hint option to home menu settings 2024-11-14 23:23:36 +01:00
Megamouse 81bb4b5951 overlays: remove unnecessary text logging 2024-11-14 23:23:36 +01:00
Megamouse 9461294ffc overlays: add input debug overlay to home menu settings 2024-11-14 23:23:36 +01:00
Megamouse 7087582a36 overlays: translate home menu settings
Also fix potential lambda text capture issue
2024-11-14 23:23:36 +01:00
overwriter 201be08a85 fix: cannot copy OpenAl32.dll with CMake 2024-11-14 21:44:59 +01:00
Megamouse c3729d06d0 Qt: Replace some instances of QMap, QPair and QList 2024-11-14 20:50:33 +01:00
Megamouse e8f730e61f Update curl to 8.11.0 2024-11-14 20:50:33 +01:00
Elad c5bbee7a0a SPU: Fixup code comparison 2024-11-14 13:43:01 +02:00
Elad 8c00842614 Fixup std::vector to std::span 2024-11-14 13:43:01 +02:00
Elad 72437b50b4 LV2: Fix thread notifications regression 2024-11-12 15:00:35 +02:00
Elad e9b24eba85 SPU Analyzer: Fix programs code caching 2024-11-12 11:11:37 +02:00
oltolm 2b0f786b2d Fix std::basic_string warnings (#16261) 2024-11-11 21:54:44 +02:00
Megamouse 2262ac1684 Qt: Replace QMap with std::map
This should reduce the amount of string conversions during list refreshes
2024-11-06 09:34:32 +01:00
RipleyTom c68f42e0ee Fix sceNpScoreGetRankingByNpId when no score is registered 2024-11-05 20:48:05 +01:00
Joshua de Reeper 73cee9a43d sys_usbd: Better Dimensions Move Handling 2024-11-05 18:17:05 +01:00
NicknineTheEagle 6d766ccbb5 cellSaveData: Add autosave indicator (#15720) 2024-11-04 21:53:34 +01:00
Elad bcf581dc82 Fixup Emulator::GetBackgroundPicturePath() 2024-11-04 14:59:21 +02:00
Elad c782b45b97 High-Resolution Game Background for loading 2024-11-04 10:59:45 +02:00
Megamouse 7858053bb9 Update SDL to 2.30.9 2024-11-04 08:31:03 +01:00
Megamouse 2d0d4119f4 Update FAudio to 24.11 2024-11-04 08:31:03 +01:00
Megamouse d2d76bb560 Update wolfssl to 5.7.4 2024-11-03 17:05:11 +01:00
Elad Ashkenazi bc22df8ba8 SPU: Optimize cellSpurs reservations 2024-11-03 11:13:54 +02:00
Elad b053b1e200 Another attempt to fix fs::pending_file for hardlinks 2024-11-02 21:43:35 +02:00
Elad d3c0ec5651 Print last system error on fs::error::unknown 2024-11-02 21:43:35 +02:00
Elad 695799c39a GUI: Fix welcome_dialog dereference 2024-11-02 21:43:35 +02:00
Elad 85d1649696 utils/atomic.hpp: Make atomic_op reject non-non-const lvalue 2024-11-02 21:43:35 +02:00
Elad 1417f9b7de utils/atomic.cpp: Fixup utils::get_unique_tsc()
It was reading s_min_tsc again inside the atomic operation.
Also optimize it a bit.
2024-11-02 21:43:35 +02:00
Elad 0e31aafc09 Fixup GCM unmap event sending 2024-11-02 21:43:35 +02:00
506 changed files with 19953 additions and 7018 deletions
+3 -2
View File
@@ -1,9 +1,9 @@
#!/bin/sh -ex
# Pull all the submodules except llvm
# Pull all the submodules except llvm and opencv
# Note: Tried to use git submodule status, but it takes over 20 seconds
# shellcheck disable=SC2046
git submodule -q update --init --depth 1 $(awk '/path/ && !/llvm/ { print $3 }' .gitmodules)
git submodule -q update --init --depth 1 $(awk '/path/ && !/llvm/ && !/opencv/ { print $3 }' .gitmodules)
# Prefer newer Clang than in base system (see also .ci/install-freebsd.sh)
# libc++ isn't in llvm* packages, so download manually
@@ -27,6 +27,7 @@ CONFIGURE_ARGS="
-DUSE_SYSTEM_FFMPEG=ON
-DUSE_SYSTEM_CURL=ON
-DUSE_SYSTEM_LIBPNG=ON
-DUSE_SYSTEM_OPENCV=ON
"
# shellcheck disable=SC2086
+3 -2
View File
@@ -6,9 +6,9 @@ fi
git config --global --add safe.directory '*'
# Pull all the submodules except llvm
# Pull all the submodules except llvm and opencv
# shellcheck disable=SC2046
git submodule -q update --init $(awk '/path/ && !/llvm/ { print $3 }' .gitmodules)
git submodule -q update --init $(awk '/path/ && !/llvm/ && !/opencv/ { print $3 }' .gitmodules)
mkdir build && cd build || exit 1
@@ -25,6 +25,7 @@ cmake .. \
-DUSE_SDL=ON \
-DUSE_SYSTEM_SDL=ON \
-DUSE_SYSTEM_FFMPEG=OFF \
-DUSE_SYSTEM_OPENCV=ON \
-DUSE_DISCORD_RPC=ON \
-DOpenGL_GL_PREFERENCE=LEGACY \
-DLLVM_DIR=/opt/llvm/lib/cmake/llvm \
+3 -2
View File
@@ -6,10 +6,10 @@ fi
git config --global --add safe.directory '*'
# Pull all the submodules except llvm
# Pull all the submodules except llvm and opencv
# Note: Tried to use git submodule status, but it takes over 20 seconds
# shellcheck disable=SC2046
git submodule -q update --init $(awk '/path/ && !/llvm/ { print $3 }' .gitmodules)
git submodule -q update --init $(awk '/path/ && !/llvm/ && !/opencv/ { print $3 }' .gitmodules)
mkdir build && cd build || exit 1
@@ -44,6 +44,7 @@ cmake .. \
-DUSE_SDL=ON \
-DUSE_SYSTEM_SDL=ON \
-DUSE_SYSTEM_FFMPEG=OFF \
-DUSE_SYSTEM_OPENCV=ON \
-DUSE_DISCORD_RPC=ON \
-DOpenGL_GL_PREFERENCE=LEGACY \
-DLLVM_DIR=/opt/llvm/lib/cmake/llvm \
+6 -1
View File
@@ -71,10 +71,14 @@ if [ ! -d "/tmp/Qt/$QT_VER" ]; then
git clone https://github.com/engnr/qt-downloader.git
cd qt-downloader
git checkout f52efee0f18668c6d6de2dec0234b8c4bc54c597
# nested Qt 6.8.1 URL workaround
# sed -i '' "s/'qt{0}_{0}{1}{2}'.format(major, minor, patch)]))/'qt{0}_{0}{1}{2}'.format(major, minor, patch), 'qt{0}_{0}{1}{2}'.format(major, minor, patch)]))/g" qt-downloader
# sed -i '' "s/'{}\/{}\/qt{}_{}\/'/'{0}\/{1}\/qt{2}_{3}\/qt{2}_{3}\/'/g" qt-downloader
cd "/tmp/Qt"
"$BREW_X64_PATH/bin/pipenv" run pip3 install py7zr requests semantic_version lxml
mkdir -p "$QT_VER/macos" ; ln -s "macos" "$QT_VER/clang_64"
"$BREW_X64_PATH/bin/pipenv" run "$WORKDIR/qt-downloader/qt-downloader" macos desktop "$QT_VER" clang_64 --opensource --addons qtmultimedia qtimageformats
# sed -i '' 's/args\.version \/ derive_toolchain_dir(args) \/ //g' "$WORKDIR/qt-downloader/qt-downloader" # Qt 6.8.1 workaround
"$BREW_X64_PATH/bin/pipenv" run "$WORKDIR/qt-downloader/qt-downloader" macos desktop "$QT_VER" clang_64 --opensource --addons qtmultimedia qtimageformats # -o "$QT_VER/clang_64"
fi
cd "$WORKDIR"
@@ -131,6 +135,7 @@ export MACOSX_DEPLOYMENT_TARGET=13.0
-DUSE_SYSTEM_MVK=ON \
-DUSE_SYSTEM_FAUDIO=OFF \
-DUSE_SYSTEM_SDL=ON \
-DUSE_SYSTEM_OPENCV=ON \
$CMAKE_EXTRA_OPTS \
-DLLVM_TARGET_ARCH=arm64 \
-DCMAKE_OSX_ARCHITECTURES=arm64 \
+8 -3
View File
@@ -39,10 +39,14 @@ if [ ! -d "/tmp/Qt/$QT_VER" ]; then
git clone https://github.com/engnr/qt-downloader.git
cd qt-downloader
git checkout f52efee0f18668c6d6de2dec0234b8c4bc54c597
# nested Qt 6.8.1 URL workaround
# sed -i '' "s/'qt{0}_{0}{1}{2}'.format(major, minor, patch)]))/'qt{0}_{0}{1}{2}'.format(major, minor, patch), 'qt{0}_{0}{1}{2}'.format(major, minor, patch)]))/g" qt-downloader
# sed -i '' "s/'{}\/{}\/qt{}_{}\/'/'{0}\/{1}\/qt{2}_{3}\/qt{2}_{3}\/'/g" qt-downloader
cd "/tmp/Qt"
"$BREW_X64_PATH/bin/pipenv" run pip3 install py7zr requests semantic_version lxml
mkdir -p "$QT_VER/macos" ; ln -s "macos" "$QT_VER/clang_64"
"$BREW_X64_PATH/bin/pipenv" run "$WORKDIR/qt-downloader/qt-downloader" macos desktop "$QT_VER" clang_64 --opensource --addons qtmultimedia qtimageformats
# sed -i '' 's/args\.version \/ derive_toolchain_dir(args) \/ //g' "$WORKDIR/qt-downloader/qt-downloader" # Qt 6.8.1 workaround
"$BREW_X64_PATH/bin/pipenv" run "$WORKDIR/qt-downloader/qt-downloader" macos desktop "$QT_VER" clang_64 --opensource --addons qtmultimedia qtimageformats # -o "$QT_VER/clang_64"
fi
cd "$WORKDIR"
@@ -65,9 +69,9 @@ export VK_ICD_FILENAMES="$VULKAN_SDK/share/vulkan/icd.d/MoltenVK_icd.json"
export LLVM_DIR
LLVM_DIR="BREW_X64_PATH/opt/llvm@$LLVM_COMPILER_VER"
# exclude ffmpeg, LLVM, and sdl from submodule update
# exclude ffmpeg, LLVM, opencv, and sdl from submodule update
# shellcheck disable=SC2046
git submodule -q update --init --depth=1 --jobs=8 $(awk '/path/ && !/ffmpeg/ && !/llvm/ && !/SDL/ { print $3 }' .gitmodules)
git submodule -q update --init --depth=1 --jobs=8 $(awk '/path/ && !/ffmpeg/ && !/llvm/ && !/opencv/ && !/SDL/ { print $3 }' .gitmodules)
# 3rdparty fixes
sed -i '' "s/extern const double NSAppKitVersionNumber;/const double NSAppKitVersionNumber = 1343;/g" 3rdparty/hidapi/hidapi/mac/hid.c
@@ -98,6 +102,7 @@ export MACOSX_DEPLOYMENT_TARGET=13.0
-DUSE_SYSTEM_MVK=ON \
-DUSE_SYSTEM_FAUDIO=OFF \
-DUSE_SYSTEM_SDL=ON \
-DUSE_SYSTEM_OPENCV=ON \
$CMAKE_EXTRA_OPTS \
-DLLVM_TARGET_ARCH=X86_64 \
-DCMAKE_OSX_ARCHITECTURES=x86_64 \
+6 -6
View File
@@ -11,9 +11,9 @@ PR_NUMBER="$SYSTEM_PULLREQUEST_PULLREQUESTID"
QT_HOST="http://qt.mirror.constant.com/"
QT_URL_VER=$(echo "$QT_VER" | sed "s/\.//g")
QT_VER_MSVC_UP=$(echo "${QT_VER_MSVC}" | tr '[:lower:]' '[:upper:]')
QT_PREFIX="online/qtsdkrepository/windows_x86/desktop/qt${QT_VER_MAIN}_${QT_URL_VER}/qt.qt${QT_VER_MAIN}.${QT_URL_VER}."
QT_PREFIX="online/qtsdkrepository/windows_x86/desktop/qt${QT_VER_MAIN}_${QT_URL_VER}/qt${QT_VER_MAIN}_${QT_URL_VER}/qt.qt${QT_VER_MAIN}.${QT_URL_VER}."
QT_PREFIX_2="win64_${QT_VER_MSVC}_64/${QT_VER}-0-${QT_DATE}"
QT_SUFFIX="-Windows-Windows_10_22H2-${QT_VER_MSVC_UP}-Windows-Windows_10_22H2-X86_64.7z"
QT_SUFFIX="-Windows-Windows_11_23H2-${QT_VER_MSVC_UP}-Windows-Windows_11_23H2-X86_64.7z"
QT_BASE_URL="${QT_HOST}${QT_PREFIX}${QT_PREFIX_2}qtbase${QT_SUFFIX}"
QT_DECL_URL="${QT_HOST}${QT_PREFIX}${QT_PREFIX_2}qtdeclarative${QT_SUFFIX}"
QT_TOOL_URL="${QT_HOST}${QT_PREFIX}${QT_PREFIX_2}qttools${QT_SUFFIX}"
@@ -68,7 +68,7 @@ download_and_verify()
}
# Some dependencies install here
[ -d "./lib" ] || mkdir "./lib"
[ -d "./build/lib_ext/Release-x64" ] || mkdir -p "./build/lib_ext/Release-x64"
for url in $DEP_URLS; do
# Get the filename from the URL and remove query strings (?arg=something).
@@ -77,9 +77,9 @@ for url in $DEP_URLS; do
# shellcheck disable=SC1003
case "$url" in
*qt*) checksum=$(curl -fL "${url}.sha1"); algo="sha1"; outDir='C:\Qt\' ;;
*llvm*) checksum=$(curl -fL "${url}.sha256"); algo="sha256"; outDir="./3rdparty/llvm" ;;
*glslang*) checksum=$(curl -fL "${url}.sha256"); algo="sha256"; outDir="./lib/Release-x64" ;;
*qt*) checksum=$(curl -fL "${url}.sha1"); algo="sha1"; outDir="$QTDIR/" ;;
*llvm*) checksum=$(curl -fL "${url}.sha256"); algo="sha256"; outDir="./build/lib_ext/Release-x64" ;;
*glslang*) checksum=$(curl -fL "${url}.sha256"); algo="sha256"; outDir="./build/lib_ext/Release-x64" ;;
*Vulkan*)
# Vulkan setup needs to be run in batch environment
# Need to subshell this or else it doesn't wait
+4 -4
View File
@@ -7,7 +7,7 @@ env:
BUILD_SOURCEBRANCHNAME: $CIRRUS_BRANCH
RPCS3_TOKEN: ENCRYPTED[100ebb8e3552bf2021d0ef55dccda3e58d27be5b6cab0b0b92843ef490195d3c4edaefa087e4a3b425caa6392300b9b1]
QT_VER_MAIN: '6'
QT_VER: '6.7.3'
QT_VER: '6.8.1'
# windows_task:
# matrix:
@@ -20,8 +20,8 @@ env:
# CIRRUS_SHELL: "bash"
# COMPILER: msvc
# BUILD_ARTIFACTSTAGINGDIRECTORY: ${CIRRUS_WORKING_DIR}\artifacts\
# QT_VER_MSVC: 'msvc2019'
# QT_DATE: '202409200836'
# QT_VER_MSVC: 'msvc2022'
# QT_DATE: '202411221531'
# QTDIR: C:\Qt\${QT_VER}\${QT_VER_MSVC}_64
# VULKAN_VER: '1.3.268.0'
# VULKAN_SDK_SHA: '8459ef49bd06b697115ddd3d97c9aec729e849cd775f5be70897718a9b3b9db5'
@@ -56,7 +56,7 @@ env:
# linux_task:
# container:
# image: rpcs3/rpcs3-ci-focal:1.7
# image: rpcs3/rpcs3-ci-focal:1.9
# cpu: 4
# memory: 16G
# env:
-19
View File
@@ -120,25 +120,6 @@ CMakeLists.txt.user
# yaml-cpp
yaml-cpp.pc
# libusb
/3rdparty/libusb_cmake/config.h
/3rdparty/libusb_cmake/libusb-1.0.pc
# miniupnp
/3rdparty/miniupnp/x64/*
# opencv
/3rdparty/opencv/*
# llvm
/3rdparty/llvm/llvm_build
# legacy llvm
/llvm_build
# ssl certificate
cacert.pem
_ReSharper.*/
CMakeUserPresets.json
+8
View File
@@ -96,3 +96,11 @@
path = 3rdparty/stblib/stb
url = ../../nothings/stb.git
ignore = dirty
[submodule "3rdparty/opencv/opencv"]
path = 3rdparty/opencv/opencv
url = ../../Megamouse/opencv_minimal.git
ignore = dirty
[submodule "3rdparty/fusion/fusion"]
path = 3rdparty/fusion/fusion
url = ../../xioTechnologies/Fusion.git
ignore = dirty
+2 -2
View File
@@ -179,8 +179,8 @@
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<OutDir>$(SolutionDir)lib/$(Configuration)-$(Platform)/</OutDir>
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)/</IntDir>
<OutDir>$(SolutionDir)build\lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
+9 -1
View File
@@ -44,7 +44,7 @@ add_subdirectory(libpng EXCLUDE_FROM_ALL)
# pugixml
if (USE_SYSTEM_PUGIXML)
pkg_check_modules(PUGIXML REQUIRED IMPORTED_TARGET pugixml>=1.11)
pkg_check_modules(PUGIXML REQUIRED IMPORTED_TARGET pugixml>=1.15)
add_library(pugixml INTERFACE)
target_link_libraries(pugixml INTERFACE PkgConfig::PUGIXML)
else()
@@ -343,6 +343,12 @@ add_subdirectory(miniupnp EXCLUDE_FROM_ALL)
# RTMIDI
add_subdirectory(rtmidi EXCLUDE_FROM_ALL)
# OPENCV
add_subdirectory(opencv EXCLUDE_FROM_ALL)
# FUSION
add_subdirectory(fusion EXCLUDE_FROM_ALL)
# add nice ALIAS targets for ease of use
if(USE_SYSTEM_LIBUSB)
add_library(3rdparty::libusb ALIAS usb-1.0-shared)
@@ -373,3 +379,5 @@ add_library(3rdparty::soundtouch ALIAS soundtouch)
add_library(3rdparty::sdl2 ALIAS ${SDL2_TARGET})
add_library(3rdparty::miniupnpc ALIAS libminiupnpc-static)
add_library(3rdparty::rtmidi ALIAS rtmidi)
add_library(3rdparty::opencv ALIAS ${OPENCV_TARGET})
add_library(3rdparty::fusion ALIAS Fusion)
+13 -9
View File
@@ -1,13 +1,17 @@
# OpenAL
if(USE_SYSTEM_OPENAL)
find_package(OpenAL REQUIRED)
add_library(3rdparty_openal INTERFACE)
target_include_directories(3rdparty_openal INTERFACE ${OPENAL_INCLUDE_DIR})
target_link_libraries(3rdparty_openal INTERFACE ${OPENAL_LIBRARY})
if(WIN32)
find_package(OpenAL CONFIG REQUIRED)
else()
find_package(OpenAL REQUIRED)
endif()
add_library(3rdparty_openal INTERFACE)
target_link_libraries(3rdparty_openal INTERFACE OpenAL::OpenAL)
set_target_properties(OpenAL::OpenAL PROPERTIES IMPORTED_GLOBAL ON)
else()
option(ALSOFT_UTILS "Build utility programs" OFF)
option(ALSOFT_EXAMPLES "Build example programs" OFF)
add_subdirectory(openal-soft EXCLUDE_FROM_ALL)
add_library(3rdparty_openal INTERFACE)
target_link_libraries(3rdparty_openal INTERFACE OpenAL::OpenAL)
option(ALSOFT_UTILS "Build utility programs" OFF)
option(ALSOFT_EXAMPLES "Build example programs" OFF)
add_subdirectory(openal-soft EXCLUDE_FROM_ALL)
add_library(3rdparty_openal INTERFACE)
target_link_libraries(3rdparty_openal INTERFACE OpenAL::OpenAL)
endif()
+34 -14
View File
@@ -48,34 +48,54 @@
</ImportGroup>
<PropertyGroup Label="UserMacros">
<CmakeReleaseCLI>call vsdevcmd.bat -arch=amd64
cd ./openal-soft/build
cmake -G Ninja -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_INSTALL_PREFIX="./Release" -DCMAKE_SYSTEM_VERSION=6.1 -DLIBTYPE=STATIC -DFORCE_STATIC_VCRT=true -DALSOFT_UTILS=false -DALSOFT_EXAMPLES=false -DALSOFT_INSTALL=false -DALSOFT_INSTALL_CONFIG=false -DALSOFT_INSTALL_HRTF_DATA=false -DALSOFT_INSTALL_AMBDEC_PRESETS=false -DALSOFT_INSTALL_EXAMPLES=false -DALSOFT_INSTALL_UTILS=false ..</CmakeReleaseCLI>
cd "$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)"
cmake -G Ninja -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_INSTALL_PREFIX="./Release" -DCMAKE_SYSTEM_VERSION=6.1 -DLIBTYPE=STATIC -DFORCE_STATIC_VCRT=true -DALSOFT_UTILS=false -DALSOFT_EXAMPLES=false -DALSOFT_INSTALL=false -DALSOFT_INSTALL_CONFIG=false -DALSOFT_INSTALL_HRTF_DATA=false -DALSOFT_INSTALL_AMBDEC_PRESETS=false -DALSOFT_INSTALL_EXAMPLES=false -DALSOFT_INSTALL_UTILS=false "$(SolutionDir)3rdparty\OpenAL\openal-soft"
</CmakeReleaseCLI>
<CmakeDebugCLI>call vsdevcmd.bat -arch=amd64
cd ./openal-soft/build
cmake -G Ninja -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_INSTALL_PREFIX="./Debug" -DCMAKE_SYSTEM_VERSION=6.1 -DLIBTYPE=STATIC -DALSOFT_UTILS=false -DALSOFT_EXAMPLES=false -DALSOFT_INSTALL=false -DALSOFT_INSTALL_CONFIG=false -DALSOFT_INSTALL_HRTF_DATA=false -DALSOFT_INSTALL_AMBDEC_PRESETS=false -DALSOFT_INSTALL_EXAMPLES=false -DALSOFT_INSTALL_UTILS=false ..</CmakeDebugCLI>
<CmakeCleanCLI>echo Cleaning..
cd ./openal-soft/build
cd "$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)"
cmake -G Ninja -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_INSTALL_PREFIX="./Debug" -DCMAKE_SYSTEM_VERSION=6.1 -DLIBTYPE=STATIC -DALSOFT_UTILS=false -DALSOFT_EXAMPLES=false -DALSOFT_INSTALL=false -DALSOFT_INSTALL_CONFIG=false -DALSOFT_INSTALL_HRTF_DATA=false -DALSOFT_INSTALL_AMBDEC_PRESETS=false -DALSOFT_INSTALL_EXAMPLES=false -DALSOFT_INSTALL_UTILS=false "$(SolutionDir)3rdparty\OpenAL\openal-soft"
</CmakeDebugCLI>
<CmakeCopyCLI>
echo Copying..
copy "$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)\OpenAL32.lib" "$(SolutionDir)build\lib\$(Configuration)-$(Platform)"
</CmakeCopyCLI>
<CmakeCleanCLI>
echo Cleaning..
del "$(SolutionDir)build\lib\$(Configuration)-$(Platform)\OpenAL32.lib"
rmdir /s /q "$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)"
</CmakeCleanCLI>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<NMakeBuildCommandLine>$(CmakeDebugCLI)
ninja
</NMakeBuildCommandLine>
<NMakeReBuildCommandLine>del CMakeCache.txt
<OutDir>$(SolutionDir)build\lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
<NMakeBuildCommandLine>
$(CmakeDebugCLI)
ninja
$(CmakeCopyCLI)
</NMakeBuildCommandLine>
<NMakeReBuildCommandLine>
$(CmakeCleanCLI)
$(CmakeDebugCLI)
ninja
$(CmakeCopyCLI)
</NMakeReBuildCommandLine>
<NMakeCleanCommandLine>
$(CmakeCleanCLI)
</NMakeCleanCommandLine>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<NMakeBuildCommandLine>$(CmakeReleaseCLI)
ninja
</NMakeBuildCommandLine>
<NMakeReBuildCommandLine>del CMakeCache.txt
<OutDir>$(SolutionDir)build\lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
<NMakeBuildCommandLine>
$(CmakeReleaseCLI)
ninja
$(CmakeCopyCLI)
</NMakeBuildCommandLine>
<NMakeReBuildCommandLine>
$(CmakeCleanCLI)
$(CmakeReleaseCLI)
ninja
$(CmakeCopyCLI)
</NMakeReBuildCommandLine>
<NMakeCleanCommandLine>
$(CmakeCleanCLI)
+8
View File
@@ -179,6 +179,14 @@
<PropertyGroup>
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>$(SolutionDir)build\lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(SolutionDir)build\lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
</PropertyGroup>
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets">
+8
View File
@@ -73,6 +73,14 @@
<Import Project="$(SolutionDir)\buildfiles\msvc\rpcs3_release.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>$(SolutionDir)build\lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(SolutionDir)build\lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<WarningLevel>TurnOffAllWarnings</WarningLevel>
+4 -4
View File
@@ -33,8 +33,8 @@
</ImportGroup>
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
<OutDir>$(SolutionDir)build\lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup>
<Midl>
@@ -87,7 +87,6 @@
<ClCompile Include="curl\lib\curl_memrchr.c" />
<ClCompile Include="curl\lib\curl_multibyte.c" />
<ClCompile Include="curl\lib\curl_ntlm_core.c" />
<ClCompile Include="curl\lib\curl_path.c" />
<ClCompile Include="curl\lib\curl_range.c" />
<ClCompile Include="curl\lib\curl_rtmp.c" />
<ClCompile Include="curl\lib\curl_sasl.c" />
@@ -209,6 +208,7 @@
<ClCompile Include="curl\lib\vauth\spnego_sspi.c" />
<ClCompile Include="curl\lib\vauth\vauth.c" />
<ClCompile Include="curl\lib\vquic\vquic.c" />
<ClCompile Include="curl\lib\vssh\curl_path.c" />
<ClCompile Include="curl\lib\vssh\libssh.c" />
<ClCompile Include="curl\lib\vssh\libssh2.c" />
<ClCompile Include="curl\lib\vssh\wolfssh.c" />
@@ -279,7 +279,6 @@
<ClInclude Include="curl\lib\curl_memrchr.h" />
<ClInclude Include="curl\lib\curl_multibyte.h" />
<ClInclude Include="curl\lib\curl_ntlm_core.h" />
<ClInclude Include="curl\lib\curl_path.h" />
<ClInclude Include="curl\lib\curl_printf.h" />
<ClInclude Include="curl\lib\curl_range.h" />
<ClInclude Include="curl\lib\curl_rtmp.h" />
@@ -388,6 +387,7 @@
<ClInclude Include="curl\lib\vauth\ntlm.h" />
<ClInclude Include="curl\lib\vauth\vauth.h" />
<ClInclude Include="curl\lib\vquic\vquic.h" />
<ClInclude Include="curl\lib\vssh\curl_path.h" />
<ClInclude Include="curl\lib\vssh\ssh.h" />
<ClInclude Include="curl\lib\vtls\bearssl.h" />
<ClInclude Include="curl\lib\vtls\gtls.h" />
+6 -6
View File
@@ -75,9 +75,6 @@
<ClCompile Include="curl\lib\curl_ntlm_core.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\curl_path.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\curl_range.c">
<Filter>Source Files</Filter>
</ClCompile>
@@ -363,6 +360,9 @@
<ClCompile Include="curl\lib\vauth\vauth.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vssh\curl_path.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vssh\libssh.c">
<Filter>Source Files</Filter>
</ClCompile>
@@ -644,9 +644,6 @@
<ClInclude Include="curl\lib\curl_ntlm_core.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\curl_path.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\curl_printf.h">
<Filter>Header Files</Filter>
</ClInclude>
@@ -887,6 +884,9 @@
<ClInclude Include="curl\lib\vauth\vauth.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\vssh\curl_path.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\vssh\ssh.h">
<Filter>Header Files</Filter>
</ClInclude>
+1
View File
@@ -0,0 +1 @@
add_subdirectory(fusion EXCLUDE_FROM_ALL)
Vendored Submodule
+1
Submodule 3rdparty/fusion/fusion added at fecf2f0af3
+75
View File
@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClInclude Include="fusion\Fusion\Fusion.h" />
<ClInclude Include="fusion\Fusion\FusionAhrs.h" />
<ClInclude Include="fusion\Fusion\FusionAxes.h" />
<ClInclude Include="fusion\Fusion\FusionCalibration.h" />
<ClInclude Include="fusion\Fusion\FusionCompass.h" />
<ClInclude Include="fusion\Fusion\FusionConvention.h" />
<ClInclude Include="fusion\Fusion\FusionMath.h" />
<ClInclude Include="fusion\Fusion\FusionOffset.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="fusion\Fusion\FusionAhrs.c" />
<ClCompile Include="fusion\Fusion\FusionCompass.c" />
<ClCompile Include="fusion\Fusion\FusionOffset.c" />
</ItemGroup>
<PropertyGroup Label="Globals">
<RootNamespace>Fusion</RootNamespace>
<ProjectGuid>{3C67A2FF-4710-402A-BE3E-31B0CB0576DF}</ProjectGuid>
</PropertyGroup>
<Import Project="$(SolutionDir)\buildfiles\msvc\common_default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(SolutionDir)\buildfiles\msvc\common_default_macros.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<PropertyGroup>
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>$(SolutionDir)build\lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(SolutionDir)build\lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
</PropertyGroup>
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(SolutionDir)\buildfiles\msvc\rpcs3_default.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(SolutionDir)\buildfiles\msvc\rpcs3_debug.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(SolutionDir)\buildfiles\msvc\rpcs3_release.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup>
<ClCompile>
<ExceptionHandling>Sync</ExceptionHandling>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
</ClCompile>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
+29
View File
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="fusion\Fusion\Fusion.h" />
<ClInclude Include="fusion\Fusion\FusionAhrs.h" />
<ClInclude Include="fusion\Fusion\FusionAxes.h" />
<ClInclude Include="fusion\Fusion\FusionCalibration.h" />
<ClInclude Include="fusion\Fusion\FusionCompass.h" />
<ClInclude Include="fusion\Fusion\FusionConvention.h" />
<ClInclude Include="fusion\Fusion\FusionMath.h" />
<ClInclude Include="fusion\Fusion\FusionOffset.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="fusion\Fusion\FusionAhrs.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="fusion\Fusion\FusionCompass.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="fusion\Fusion\FusionOffset.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
+48 -16
View File
@@ -39,31 +39,63 @@
<PropertyGroup Label="UserMacros">
<CmakeGenerator>"Visual Studio $(VisualStudioVersion.Substring(0,2))"</CmakeGenerator>
<CmakeReleaseCLI>call vsdevcmd.bat -arch=amd64
cmake -G $(CmakeGenerator) -A x64 -DCMAKE_BUILD_TYPE="Release" -DLLVM_USE_CRT_DEBUG=MDd -DLLVM_USE_CRT_RELEASE=MT -DENABLE_OPT=OFF -S glslang -B build</CmakeReleaseCLI>
cmake -G $(CmakeGenerator) -A x64 -DCMAKE_BUILD_TYPE="Release" -DLLVM_USE_CRT_DEBUG=MDd -DLLVM_USE_CRT_RELEASE=MT -DENABLE_OPT=OFF -S glslang -B "$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)"
</CmakeReleaseCLI>
<CmakeDebugCLI>call vsdevcmd.bat -arch=amd64
cmake -G $(CmakeGenerator) -A x64 -DCMAKE_BUILD_TYPE="Debug" -DLLVM_USE_CRT_DEBUG=MDd -DLLVM_USE_CRT_RELEASE=MT -DENABLE_OPT=OFF -S glslang -B build</CmakeDebugCLI>
cmake -G $(CmakeGenerator) -A x64 -DCMAKE_BUILD_TYPE="Debug" -DLLVM_USE_CRT_DEBUG=MDd -DLLVM_USE_CRT_RELEASE=MT -DENABLE_OPT=OFF -S glslang -B "$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)"
</CmakeDebugCLI>
<CmakeCopyCLI>
echo Copying..
mkdir "$(SolutionDir)build\lib\$(Configuration)-$(Platform)\$(ProjectName)"
copy "$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)\hlsl\$(CONFIGURATION)\*.lib" "$(SolutionDir)build\lib\$(Configuration)-$(Platform)\$(ProjectName)"
copy "$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)\SPIRV\$(CONFIGURATION)\*.lib" "$(SolutionDir)build\lib\$(Configuration)-$(Platform)\$(ProjectName)"
copy "$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)\OGLCompilersDLL\$(CONFIGURATION)\*.lib" "$(SolutionDir)build\lib\$(Configuration)-$(Platform)\$(ProjectName)"
copy "$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)\glslang\OSDependent\Windows\$(CONFIGURATION)\*.lib" "$(SolutionDir)build\lib\$(Configuration)-$(Platform)\$(ProjectName)"
copy "$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)\glslang\$(CONFIGURATION)\*.lib" "$(SolutionDir)build\lib\$(Configuration)-$(Platform)\$(ProjectName)"
</CmakeCopyCLI>
<CmakeCleanCLI>
echo Cleaning..
rmdir /s /q "$(SolutionDir)build\lib\$(Configuration)-$(Platform)\$(ProjectName)"
rmdir /s /q "$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)"
</CmakeCleanCLI>
<PropsAbsPath>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\..\buildfiles\msvc\common_default.props'))</PropsAbsPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<NMakeBuildCommandLine>$(CmakeReleaseCLI)
msbuild.exe build\ALL_BUILD.vcxproj /t:build /p:Configuration=Release /p:ForceImportBeforeCppTargets="$(PropsAbsPath)" /m</NMakeBuildCommandLine>
<NMakeReBuildCommandLine>$(CmakeReleaseCLI)
msbuild.exe build\ALL_BUILD.vcxproj /t:rebuild /p:Configuration=Release /p:ForceImportBeforeCppTargets="$(PropsAbsPath)" /m</NMakeReBuildCommandLine>
<NMakeCleanCommandLine>$(CmakeReleaseCLI)
msbuild.exe build\ALL_BUILD.vcxproj /t:clean /p:Configuration=Release /p:ForceImportBeforeCppTargets="$(PropsAbsPath)" /m
rmdir /s /q build
<OutDir>$(SolutionDir)build\lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
<NMakeBuildCommandLine>
$(CmakeReleaseCLI)
msbuild.exe "$(IntDir)\ALL_BUILD.vcxproj" /t:build /p:Configuration=Release /p:ForceImportBeforeCppTargets="$(PropsAbsPath)" /m
$(CmakeCopyCLI)
</NMakeBuildCommandLine>
<NMakeReBuildCommandLine>
$(CmakeReleaseCLI)
msbuild.exe "$(IntDir)\ALL_BUILD.vcxproj" /t:rebuild /p:Configuration=Release /p:ForceImportBeforeCppTargets="$(PropsAbsPath)" /m
$(CmakeCopyCLI)
</NMakeReBuildCommandLine>
<NMakeCleanCommandLine>
$(CmakeReleaseCLI)
msbuild.exe "$(IntDir)\ALL_BUILD.vcxproj" /t:clean /p:Configuration=Release /p:ForceImportBeforeCppTargets="$(PropsAbsPath)" /m
$(CmakeCleanCLI)
</NMakeCleanCommandLine>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<NMakeBuildCommandLine>$(CmakeDebugCLI)
msbuild.exe build\ALL_BUILD.vcxproj /t:build /p:Configuration=Debug /p:ForceImportBeforeCppTargets="$(PropsAbsPath)" /m
<OutDir>$(SolutionDir)build\lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
<NMakeBuildCommandLine>
$(CmakeDebugCLI)
msbuild.exe "$(IntDir)\ALL_BUILD.vcxproj" /t:build /p:Configuration=Debug /p:ForceImportBeforeCppTargets="$(PropsAbsPath)" /m
$(CmakeCopyCLI)
</NMakeBuildCommandLine>
<NMakeReBuildCommandLine>$(CmakeDebugCLI)
msbuild.exe build\ALL_BUILD.vcxproj /t:rebuild /p:Configuration=Debug /p:ForceImportBeforeCppTargets="$(PropsAbsPath)" /m
<NMakeReBuildCommandLine>
$(CmakeDebugCLI)
msbuild.exe "$(IntDir)\ALL_BUILD.vcxproj" /t:rebuild /p:Configuration=Debug /p:ForceImportBeforeCppTargets="$(PropsAbsPath)" /m
$(CmakeCopyCLI)
</NMakeReBuildCommandLine>
<NMakeCleanCommandLine>$(CmakeDebugCLI)
msbuild.exe build\ALL_BUILD.vcxproj /t:clean /p:Configuration=Debug /p:ForceImportBeforeCppTargets="$(PropsAbsPath)" /m
rmdir /s /q build
<NMakeCleanCommandLine>
$(CmakeDebugCLI)
msbuild.exe "$(IntDir)\ALL_BUILD.vcxproj" /t:clean /p:Configuration=Debug /p:ForceImportBeforeCppTargets="$(PropsAbsPath)" /m
$(CmakeCleanCLI)
</NMakeCleanCommandLine>
</PropertyGroup>
<ItemDefinitionGroup>
+4 -4
View File
@@ -44,13 +44,13 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)/</OutDir>
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)/</IntDir>
<OutDir>$(SolutionDir)build\lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)/</OutDir>
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)/</IntDir>
<OutDir>$(SolutionDir)build\lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
+4 -4
View File
@@ -44,15 +44,15 @@
<LinkIncremental>false</LinkIncremental>
<CustomBuildBeforeTargets />
<TargetName>$(ProjectName)16</TargetName>
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)/</OutDir>
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)/</IntDir>
<OutDir>$(SolutionDir)build\lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<CustomBuildBeforeTargets />
<TargetName>$(ProjectName)16</TargetName>
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)/</OutDir>
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)/</IntDir>
<OutDir>$(SolutionDir)build\lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
+2 -1
View File
@@ -32,7 +32,8 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<CustomBuildBeforeTargets>Build</CustomBuildBeforeTargets>
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
<OutDir>$(SolutionDir)build\lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
+2 -2
View File
@@ -35,8 +35,8 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)/</OutDir>
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)/</IntDir>
<OutDir>$(SolutionDir)build\lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
<TargetName>libusb-1.0</TargetName>
</PropertyGroup>
<ItemDefinitionGroup>
@@ -11,10 +11,10 @@
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{A37E4273-85DB-4217-B775-CE971B87D9DF}</ProjectGuid>
<ProjectGuid>{8BC303AB-25BE-4276-8E57-73F171B2D672}</ProjectGuid>
<Keyword>MakeFileProj</Keyword>
</PropertyGroup>
<Import Project="$(SolutionDir)\buildfiles\msvc\common_default_clang_cl.props" />
<Import Project="$(SolutionDir)\buildfiles\msvc\common_default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(SolutionDir)\buildfiles\msvc\common_default_macros.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
@@ -39,10 +39,17 @@
</ImportGroup>
<PropertyGroup Label="UserMacros">
<CmakeReleaseCLI>call vsdevcmd.bat -arch=amd64
cmake -G Ninja -DCMAKE_CXX_COMPILER="clang-cl.exe" -DCMAKE_C_COMPILER="clang-cl.exe" -DCMAKE_BUILD_TYPE="Release" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_DEFAULT_TARGET_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_HOST_TRIPLE:STRING=x86_64-pc-windows-msvc -DCMAKE_INSTALL_PREFIX="./Release" -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_BENCHMARKS=OFF -DLLVM_INCLUDE_UTILS=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=$(WindowsTargetPlatformVersion) -DLLVM_USE_CRT_DEBUG=MDd -DLLVM_USE_CRT_RELEASE=MT -DLLVM_USE_INTEL_JITEVENTS=ON ../llvm/llvm</CmakeReleaseCLI>
cd "$(SolutionDir)build\tmp\llvm_build-$(Configuration)-$(Platform)"
cmake -G Ninja -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_INSTALL_PREFIX="$(SolutionDir)build\lib\$(Configuration)-$(Platform)\llvm_build" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_DEFAULT_TARGET_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_HOST_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_BENCHMARKS=OFF -DLLVM_INCLUDE_UTILS=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=$(WindowsTargetPlatformVersion) -DLLVM_USE_CRT_DEBUG=MDd -DLLVM_USE_CRT_RELEASE=MT -DLLVM_USE_INTEL_JITEVENTS=ON "$(SolutionDir)3rdparty\llvm\llvm\llvm"
</CmakeReleaseCLI>
<CmakeDebugCLI>call vsdevcmd.bat -arch=amd64
cmake -G Ninja -DCMAKE_CXX_COMPILER="clang-cl.exe" -DCMAKE_C_COMPILER="clang-cl.exe" -DCMAKE_BUILD_TYPE="Debug" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_DEFAULT_TARGET_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_HOST_TRIPLE:STRING=x86_64-pc-windows-msvc -DCMAKE_INSTALL_PREFIX="./Debug" -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_BENCHMARKS=OFF -DLLVM_INCLUDE_UTILS=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=$(WindowsTargetPlatformVersion) -DLLVM_USE_CRT_DEBUG=MDd -DLLVM_USE_CRT_RELEASE=MT -DLLVM_USE_INTEL_JITEVENTS=ON ../llvm/llvm</CmakeDebugCLI>
<CmakeCleanCLI>echo Cleaning..
cd "$(SolutionDir)build\tmp\llvm_build-$(Configuration)-$(Platform)"
cmake -G Ninja -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_INSTALL_PREFIX="$(SolutionDir)build\lib\$(Configuration)-$(Platform)\llvm_build" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_DEFAULT_TARGET_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_HOST_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_BENCHMARKS=OFF -DLLVM_INCLUDE_UTILS=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=$(WindowsTargetPlatformVersion) -DLLVM_USE_CRT_DEBUG=MDd -DLLVM_USE_CRT_RELEASE=MT -DLLVM_USE_INTEL_JITEVENTS=ON "$(SolutionDir)3rdparty\llvm\llvm\llvm"
</CmakeDebugCLI>
<CmakeCleanCLI>
echo Cleaning..
rmdir /s /q "$(SolutionDir)build\lib\$(Configuration)-$(Platform)\llvm_build"
cd "$(SolutionDir)build\tmp\llvm_build-$(Configuration)-$(Platform)"
for /F "delims= eol=|" %%f in ('
dir /b ^| findstr /V "[^.]*\build[^.]*\.vcxproj"') do (
echo Deleting .\%%f
@@ -57,11 +64,15 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<NMakePreprocessorDefinitions>
</NMakePreprocessorDefinitions>
<NMakeBuildCommandLine>$(CmakeDebugCLI)
<OutDir>$(SolutionDir)build\lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
<NMakeBuildCommandLine>
$(CmakeDebugCLI)
ninja
ninja install
</NMakeBuildCommandLine>
<NMakeReBuildCommandLine>del CMakeCache.txt
<NMakeReBuildCommandLine>
$(CmakeCleanCLI)
$(CmakeDebugCLI)
ninja
ninja install
@@ -71,12 +82,17 @@
</NMakeCleanCommandLine>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<NMakePreprocessorDefinitions />
<NMakeBuildCommandLine>$(CmakeReleaseCLI)
<NMakePreprocessorDefinitions>
</NMakePreprocessorDefinitions>
<OutDir>$(SolutionDir)build\lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
<NMakeBuildCommandLine>
$(CmakeReleaseCLI)
ninja
ninja install
</NMakeBuildCommandLine>
<NMakeReBuildCommandLine>del CMakeCache.txt
<NMakeReBuildCommandLine>
$(CmakeCleanCLI)
$(CmakeReleaseCLI)
ninja
ninja install
@@ -11,10 +11,10 @@
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{8BC303AB-25BE-4276-8E57-73F171B2D672}</ProjectGuid>
<ProjectGuid>{A37E4273-85DB-4217-B775-CE971B87D9DF}</ProjectGuid>
<Keyword>MakeFileProj</Keyword>
</PropertyGroup>
<Import Project="$(SolutionDir)\buildfiles\msvc\common_default.props" />
<Import Project="$(SolutionDir)\buildfiles\msvc\common_default_clang_cl.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(SolutionDir)\buildfiles\msvc\common_default_macros.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
@@ -39,10 +39,17 @@
</ImportGroup>
<PropertyGroup Label="UserMacros">
<CmakeReleaseCLI>call vsdevcmd.bat -arch=amd64
cmake -G Ninja -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_INSTALL_PREFIX="./Release" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_DEFAULT_TARGET_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_HOST_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_BENCHMARKS=OFF -DLLVM_INCLUDE_UTILS=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=$(WindowsTargetPlatformVersion) -DLLVM_USE_CRT_DEBUG=MDd -DLLVM_USE_CRT_RELEASE=MT -DLLVM_USE_INTEL_JITEVENTS=ON ../llvm/llvm</CmakeReleaseCLI>
cd "$(SolutionDir)build\tmp\llvm_build-$(Configuration)-$(Platform)"
cmake -G Ninja -DCMAKE_CXX_COMPILER="clang-cl.exe" -DCMAKE_C_COMPILER="clang-cl.exe" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_INSTALL_PREFIX="$(SolutionDir)build\lib\$(Configuration)-$(Platform)\llvm_build" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_DEFAULT_TARGET_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_HOST_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_BENCHMARKS=OFF -DLLVM_INCLUDE_UTILS=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=$(WindowsTargetPlatformVersion) -DLLVM_USE_CRT_DEBUG=MDd -DLLVM_USE_CRT_RELEASE=MT -DLLVM_USE_INTEL_JITEVENTS=ON "$(SolutionDir)3rdparty\llvm\llvm\llvm"
</CmakeReleaseCLI>
<CmakeDebugCLI>call vsdevcmd.bat -arch=amd64
cmake -G Ninja -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_INSTALL_PREFIX="./Debug" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_DEFAULT_TARGET_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_HOST_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_BENCHMARKS=OFF -DLLVM_INCLUDE_UTILS=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=$(WindowsTargetPlatformVersion) -DLLVM_USE_CRT_DEBUG=MDd -DLLVM_USE_CRT_RELEASE=MT -DLLVM_USE_INTEL_JITEVENTS=ON ../llvm/llvm</CmakeDebugCLI>
<CmakeCleanCLI>echo Cleaning..
cd "$(SolutionDir)build\tmp\llvm_build-$(Configuration)-$(Platform)"
cmake -G Ninja -DCMAKE_CXX_COMPILER="clang-cl.exe" -DCMAKE_C_COMPILER="clang-cl.exe" -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_INSTALL_PREFIX="$(SolutionDir)build\lib\$(Configuration)-$(Platform)\llvm_build" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_DEFAULT_TARGET_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_HOST_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_BENCHMARKS=OFF -DLLVM_INCLUDE_UTILS=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=$(WindowsTargetPlatformVersion) -DLLVM_USE_CRT_DEBUG=MDd -DLLVM_USE_CRT_RELEASE=MT -DLLVM_USE_INTEL_JITEVENTS=ON "$(SolutionDir)3rdparty\llvm\llvm\llvm"
</CmakeDebugCLI>
<CmakeCleanCLI>
echo Cleaning..
rmdir /s /q "$(SolutionDir)build\lib\$(Configuration)-$(Platform)\llvm_build"
cd "$(SolutionDir)build\tmp\llvm_build-$(Configuration)-$(Platform)"
for /F "delims= eol=|" %%f in ('
dir /b ^| findstr /V "[^.]*\build[^.]*\.vcxproj"') do (
echo Deleting .\%%f
@@ -57,11 +64,15 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<NMakePreprocessorDefinitions>
</NMakePreprocessorDefinitions>
<NMakeBuildCommandLine>$(CmakeDebugCLI)
<OutDir>$(SolutionDir)build\lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
<NMakeBuildCommandLine>
$(CmakeDebugCLI)
ninja
ninja install
</NMakeBuildCommandLine>
<NMakeReBuildCommandLine>del CMakeCache.txt
<NMakeReBuildCommandLine>
$(CmakeCleanCLI)
$(CmakeDebugCLI)
ninja
ninja install
@@ -71,12 +82,17 @@
</NMakeCleanCommandLine>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<NMakePreprocessorDefinitions />
<NMakeBuildCommandLine>$(CmakeReleaseCLI)
<NMakePreprocessorDefinitions>
</NMakePreprocessorDefinitions>
<OutDir>$(SolutionDir)build\lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
<NMakeBuildCommandLine>
$(CmakeReleaseCLI)
ninja
ninja install
</NMakeBuildCommandLine>
<NMakeReBuildCommandLine>del CMakeCache.txt
<NMakeReBuildCommandLine>
$(CmakeCleanCLI)
$(CmakeReleaseCLI)
ninja
ninja install
+4 -2
View File
@@ -43,11 +43,13 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)\</OutDir>
<OutDir>$(SolutionDir)build\lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)\</OutDir>
<OutDir>$(SolutionDir)build\lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
+21
View File
@@ -0,0 +1,21 @@
# OpenCV
set(OPENCV_TARGET 3rdparty_dummy_lib PARENT_SCOPE)
if (USE_SYSTEM_OPENCV)
message(STATUS "RPCS3: using system OpenCV")
find_package(OpenCV)
if(OPENCV_FOUND)
message(STATUS "RPCS3: found system OpenCV")
include_directories(${OpenCV_INCLUDE_DIRS})
add_library(3rdparty_opencv INTERFACE)
target_link_libraries(3rdparty_opencv INTERFACE ${OpenCV_LIBS})
target_compile_definitions(3rdparty_opencv INTERFACE -DHAVE_OPENCV)
set(OPENCV_TARGET 3rdparty_opencv PARENT_SCOPE)
else()
message(WARNING "RPCS3: OpenCV not found. Building without OpenCV support")
endif()
else()
message(WARNING "RPCS3: Building without OpenCV support")
endif()
Vendored Submodule
+1
Submodule 3rdparty/opencv/opencv added at f76628fb5b
+1 -1
View File
@@ -1,6 +1,6 @@
add_library(3rdparty_qt6 INTERFACE)
set(QT_MIN_VER 6.4.0)
set(QT_MIN_VER 6.7.0)
find_package(Qt6 ${QT_MIN_VER} CONFIG COMPONENTS Widgets Concurrent Multimedia MultimediaWidgets Svg SvgWidgets)
if(WIN32)
+1 -1
View File
@@ -58,4 +58,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
+1 -2
View File
@@ -22,6 +22,5 @@ else()
add_subdirectory(wolfssl EXCLUDE_FROM_ALL)
target_compile_definitions(wolfssl PUBLIC WOLFSSL_DES_ECB HAVE_WRITE_DUP)
target_compile_definitions(wolfssl PUBLIC FP_MAX_BITS=8192)
target_compile_definitions(wolfssl PUBLIC WOLFSSL_DES_ECB HAVE_WRITE_DUP FP_MAX_BITS=8192 WOLFSSL_NO_OPTIONS_H)
endif()
+93 -2
View File
@@ -41,8 +41,8 @@
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
<OutDir>$(SolutionDir)build\lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
@@ -139,6 +139,94 @@
<ItemGroup>
<ClInclude Include="extra\win32\user_settings.h" />
<ClInclude Include="wolfssl\resource.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\aes.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\arc4.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\asn.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\asn_public.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\blake2-impl.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\blake2-int.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\blake2.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\camellia.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\chacha.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\chacha20_poly1305.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\cmac.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\coding.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\compress.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\cpuid.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\cryptocb.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\curve25519.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\curve448.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\des3.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\dh.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\dilithium.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\dsa.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\ecc.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\eccsi.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\ed25519.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\ed448.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\error-crypt.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\ext_kyber.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\ext_lms.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\ext_xmss.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\falcon.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\fe_448.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\fe_operations.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\fips_test.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\ge_448.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\ge_operations.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\hash.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\hmac.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\hpke.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\integer.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\kdf.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\kyber.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\lms.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\logging.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\md2.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\md4.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\md5.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\memory.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\mem_track.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\misc.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\mpi_class.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\mpi_superclass.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\pkcs11.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\pkcs12.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\pkcs7.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\poly1305.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\pwdbased.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\random.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\rc2.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\ripemd.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\rsa.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\sakke.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\selftest.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\settings.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\sha.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\sha256.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\sha3.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\sha512.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\signature.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\siphash.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\sm2.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\sm3.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\sm4.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\sp.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\sphincs.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\sp_int.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\srp.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\tfm.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\types.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\visibility.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\wc_encrypt.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\wc_kyber.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\wc_lms.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\wc_pkcs11.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\wc_port.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\wc_xmss.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\wolfevent.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\wolfmath.h" />
<ClInclude Include="wolfssl\wolfssl\wolfcrypt\xmss.h" />
<CustomBuild Include="wolfssl\wolfcrypt\src\aes_asm.asm">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DLL Debug|x64'">false</ExcludedFromBuild>
@@ -160,6 +248,9 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<None Include="wolfssl\wolfssl\wolfcrypt\include.am" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
+8
View File
@@ -25,6 +25,14 @@
<PropertyGroup>
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>$(SolutionDir)build\lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(SolutionDir)build\lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
</PropertyGroup>
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
+4 -4
View File
@@ -70,13 +70,13 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
<OutDir>$(SolutionDir)build\lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
<OutDir>$(SolutionDir)build\lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
+2 -2
View File
@@ -106,8 +106,8 @@
<Keyword>Win32Proj</Keyword>
<ProjectName>zstd</ProjectName>
<RootNamespace>zstd</RootNamespace>
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
<OutDir>$(SolutionDir)build\lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
<InstructionSet>NotSet</InstructionSet>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
+19 -13
View File
@@ -8,7 +8,7 @@ Other instructions may be found [here](https://wiki.rpcs3.net/index.php?title=Bu
### Windows 10 or later
The following tools are required to build RPCS3 on Windows 10 or later:
- [Visual Studio 2022](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community) (or at least Visual Studio 2019 16.11.xx+ as C++20 is not included in previous versions)
- [Visual Studio 2022](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community)
- **Optional** - [CMake 3.28.0+](https://www.cmake.org/download/) (add to PATH)
**NOTES:**
@@ -19,26 +19,26 @@ The following tools are required to build RPCS3 on Windows 10 or later:
with standalone **CMake** tool.
- [Python 3.6+](https://www.python.org/downloads/) (add to PATH)
- [Qt 6.7.3](https://www.qt.io/download-qt-installer) In case you can't download from the official installer, you can use [Another Qt installer](https://github.com/miurahr/aqtinstall) (In that case you will need to manually add the "qtmultimedia" module when installing Qt)
- [Qt 6.8.1](https://www.qt.io/download-qt-installer) In case you can't download from the official installer, you can use [Another Qt installer](https://github.com/miurahr/aqtinstall) (In that case you will need to manually add the "qtmultimedia" module when installing Qt)
- [Vulkan SDK 1.3.268.0](https://vulkan.lunarg.com/sdk/home) (see "Install the SDK" [here](https://vulkan.lunarg.com/doc/sdk/latest/windows/getting_started.html)) for now future SDKs don't work. You need precisely 1.3.268.0.
The `sln` solution available only on **Visual Studio** is the preferred building solution. It easily allows to build the **RPCS3** application in `Release` and `Debug` mode.
In order to build **RPCS3** with the `sln` solution (with **Visual Studio**), **Qt** libs need to be detected. To detect the libs:
- add and set the `QTDIR` environment variable, e.g. `<QtInstallFolder>\6.7.3\msvc2019_64\`
- or use the [Visual Studio Qt Plugin](https://marketplace.visualstudio.com/items?itemName=TheQtCompany.QtVisualStudioTools2019)
- add and set the `QTDIR` environment variable, e.g. `<QtInstallFolder>\6.8.1\msvc2022_64\`
- or use the [Visual Studio Qt Plugin](https://marketplace.visualstudio.com/items?itemName=TheQtCompany.QtVisualStudioTools2022)
**NOTE:** If you have issues with the **Visual Studio Qt Plugin**, you may want to uninstall it and install the [Legacy Qt Plugin](https://marketplace.visualstudio.com/items?itemName=TheQtCompany.LEGACYQtVisualStudioTools2019) instead.
**NOTE:** If you have issues with the **Visual Studio Qt Plugin**, you may want to uninstall it and install the [Legacy Qt Plugin](https://marketplace.visualstudio.com/items?itemName=TheQtCompany.LEGACYQtVisualStudioTools2022) instead.
In order to build **RPCS3** with the `CMake` solution (with both **Visual Studio** and standalone **CMake** tool):
- add and set the `CMAKE_PREFIX_PATH` environment variable to the **Qt** libs path, e.g. `<QtInstallFolder>\6.7.3\msvc2019_64\`
- add and set the `CMAKE_PREFIX_PATH` environment variable to the **Qt** libs path, e.g. `<QtInstallFolder>\6.8.1\msvc2022_64\`
### Linux
These are the essentials tools to build RPCS3 on Linux. Some of them can be installed through your favorite package manager:
- Clang 17+ or GCC 13+
- [CMake 3.28.0+](https://www.cmake.org/download/)
- [Qt 6.7.3](https://www.qt.io/download-qt-installer)
- [Qt 6.8.1](https://www.qt.io/download-qt-installer)
- [Vulkan SDK 1.3.268.0](https://vulkan.lunarg.com/sdk/home) (See "Install the SDK" [here](https://vulkan.lunarg.com/doc/sdk/latest/linux/getting_started.html)) for now future SDKs don't work. You need precisely 1.3.268.0.
- [SDL2](https://github.com/libsdl-org/SDL/releases) (for the FAudio backend)
@@ -119,7 +119,7 @@ Start **Visual Studio**, click on `Open a project or solution` and select the `r
##### Configuring the Qt Plugin (if used)
1) go to `Extensions->Qt VS Tools->Qt Versions`
2) add the path to your Qt installation with compiler e.g. `<QtInstallFolder>\6.7.3\msvc2019_64`, version will fill in automatically
2) add the path to your Qt installation with compiler e.g. `<QtInstallFolder>\6.8.1\msvc2022_64`, version will fill in automatically
3) go to `Extensions->Qt VS Tools->Options->Legacy Project Format`. (Only available in the **Legacy Qt Plugin**)
4) set `Build: Run pre-build setup` to `true`. (Only available in the **Legacy Qt Plugin**)
@@ -127,17 +127,23 @@ Start **Visual Studio**, click on `Open a project or solution` and select the `r
**NOTE:** The recommended build configuration is `Release`. (On older revisions: `Release - LLVM`)
You may want to download the precompiled [LLVM libs](https://github.com/RPCS3/llvm-mirror/releases/download/custom-build-win-16.0.1/llvmlibs_mt.7z) and extract them to `3rdparty\llvm\`,
as well as download and extract the [additional libs](https://github.com/RPCS3/glslang/releases/latest/download/glslanglibs_mt.7z) to `lib\%CONFIGURATION%-x64\` to speed up compilation
time (unoptimised/debug libs are currently not available precompiled).
To speed up the compilation time, you may want to download and extract to `<rpcs3_root>\build\lib_ext\<$(Configuration)>-x64` (e.g. `c:\rpcs3\build\lib_ext\Release-x64`; the path needs to be created) some of the following precompiled libs:
- [LLVM libs](https://github.com/RPCS3/llvm-mirror/releases/download/custom-build-win-16.0.1/llvmlibs_mt.7z)
- [additional libs](https://github.com/RPCS3/glslang/releases/latest/download/glslanglibs_mt.7z)
**NOTES:**
- `<$(Configuration)>` can assume values `Release` or `Debug`.
- Unoptimised/debug libs are currently not available precompiled for both **LLVM** and **glslang**. Trying to use them when building the **RPCS3** application in `Debug` mode will provide a `cannot open file` error.
If you're not using the precompiled libs, those dependency libs need to be compiled first. From the `Solution Explorer` panel:
1) expand `__BUILD_BEFORE`
2) from the `Solution Configurations` drop-down menu, select `Release` (select `Debug` if you want to build in `Debug` mode)
3) one after another, right-click on the following projects and then click on `Build` to build the selected lib:
- `glslang`
- either `llvm_build`
- or `llvm_build_clang_cl` (if you installed **clang** on VS)
- `llvm_build`
- or `llvm_build_clang_cl` (if you have also the **clang** compiler installed on VS)
**NOTE:** Compiled dependency libs have priority over precompiled libs, if installed. It means that they will always be referenced and linked in case the precompiled libs are also available.
In order to build the **RPCS3** application:
1) from the `Solution Configurations` drop-down menu, select `Release` (select `Debug` if you want to build in `Debug` mode)
+1
View File
@@ -29,6 +29,7 @@ option(USE_SYSTEM_SDL "Prefer system SDL instead of the builtin one" ON)
option(USE_SYSTEM_FFMPEG "Prefer system ffmpeg instead of the prebuild one" OFF)
option(USE_SYSTEM_OPENAL "Prefer system OpenAL instead of the prebuild one" ON)
option(USE_SYSTEM_CURL "Prefer system Curl instead of the prebuild one" ON)
option(USE_SYSTEM_OPENCV "Prefer system OpenCV instead of the builtin one" ON)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/buildfiles/cmake")
+3
View File
@@ -13,6 +13,7 @@
"USE_SYSTEM_CURL": "OFF",
"USE_SYSTEM_ZLIB": "OFF",
"USE_SYSTEM_LIBPNG": "OFF",
"USE_SYSTEM_OPENCV": "ON",
"BUILD_LLVM": "OFF",
"STATIC_LINK_LLVM": "ON"
}
@@ -29,6 +30,7 @@
"USE_SYSTEM_CURL": "OFF",
"USE_SYSTEM_ZLIB": "OFF",
"USE_SYSTEM_LIBPNG": "OFF",
"USE_SYSTEM_OPENCV": "ON",
"LLVM_ENABLE_LIBCXX": "ON",
"BUILD_LLVM": "OFF",
"STATIC_LINK_LLVM": "ON"
@@ -56,6 +58,7 @@
"USE_SYSTEM_CURL": "OFF",
"USE_SYSTEM_ZLIB": "OFF",
"USE_SYSTEM_OPENAL": "OFF",
"USE_SYSTEM_OPENCV": "OFF",
"BUILD_LLVM": "ON",
"STATIC_LINK_LLVM": "ON"
},
+4 -2
View File
@@ -15,8 +15,10 @@ void fmt_class_string<cfg::node>::format(std::string& out, u64 arg)
namespace cfg
{
u32 _base::id_counter = 0;
_base::_base(type _type)
: m_type(_type)
: m_type(_type), m_id(id_counter++)
{
if (_type != type::node)
{
@@ -25,7 +27,7 @@ namespace cfg
}
_base::_base(type _type, node* owner, std::string name, bool dynamic)
: m_type(_type), m_dynamic(dynamic), m_name(std::move(name))
: m_type(_type), m_parent(owner), m_dynamic(dynamic), m_name(std::move(name)), m_id(id_counter++)
{
for (const auto& node : owner->m_nodes)
{
+11
View File
@@ -51,9 +51,13 @@ namespace cfg
const type m_type{};
protected:
_base* m_parent = nullptr;
bool m_dynamic = true;
const std::string m_name{};
static u32 id_counter;
u32 m_id = 0;
// Ownerless entry constructor
_base(type _type);
@@ -67,9 +71,16 @@ namespace cfg
virtual ~_base() = default;
// Get unique ID
u32 get_id() const { return m_id; }
// Get parent
_base* get_parent() const { return m_parent; }
// Get type
type get_type() const { return m_type; }
// Get name
const std::string& get_name() const { return m_name; }
// Get dynamic property for reloading configs during games
+81 -11
View File
@@ -4,6 +4,7 @@
#include "StrUtil.h"
#include "Crypto/sha1.h"
#include <span>
#include <unordered_map>
#include <algorithm>
#include <cstring>
@@ -20,7 +21,7 @@ using namespace std::literals::string_literals;
#include <cwchar>
#include <Windows.h>
static std::unique_ptr<wchar_t[]> to_wchar(const std::string& source)
static std::unique_ptr<wchar_t[]> to_wchar(std::string_view source)
{
// String size + null terminator
const usz buf_size = source.size() + 1;
@@ -43,7 +44,7 @@ static std::unique_ptr<wchar_t[]> to_wchar(const std::string& source)
std::memcpy(buffer.get() + 32768 + 4, L"UNC\\", 4 * sizeof(wchar_t));
}
ensure(MultiByteToWideChar(CP_UTF8, 0, source.c_str(), size, buffer.get() + 32768 + (unc ? 8 : 4), size)); // "to_wchar"
ensure(MultiByteToWideChar(CP_UTF8, 0, source.data(), size, buffer.get() + 32768 + (unc ? 8 : 4), size)); // "to_wchar"
// Canonicalize wide path (replace '/', ".", "..", \\ repetitions, etc)
ensure(GetFullPathNameW(buffer.get() + 32768, 32768, buffer.get(), nullptr) - 1 < 32768 - 1); // "to_wchar"
@@ -293,7 +294,7 @@ namespace fs
struct id_view
{
std::string_view type_view;
std::basic_string_view<u8> data_view;
std::span<const u8> data_view;
};
id_view _rhs{rhs.type, {rhs.data.data(), rhs.data.size()}};
@@ -311,7 +312,7 @@ namespace fs
}
// Remove offsets data
id.data_view.remove_suffix(sizeof(u64) * offset_count);
id.data_view = id.data_view.subspan(sizeof(u64) * offset_count);
// Get last category identifier
if (usz sep = id.type_view.rfind(": "); sep != umax)
@@ -329,7 +330,7 @@ namespace fs
return false;
}
return _rhs.type_view == _lhs.type_view && _rhs.data_view == _lhs.data_view;
return _rhs.type_view == _lhs.type_view && std::equal(_rhs.data_view.begin(), _rhs.data_view.end(), _lhs.data_view.begin(), _lhs.data_view.end());
}
dir_base::~dir_base()
@@ -1788,6 +1789,8 @@ fs::file_id fs::file::get_id() const
bool fs::dir::open(const std::string& path)
{
m_dir.reset();
if (path.empty())
{
// Don't allow opening empty path (TODO)
@@ -2018,7 +2021,7 @@ std::string fs::get_executable_dir()
return s_exe_dir;
}
const std::string& fs::get_config_dir()
const std::string& fs::get_config_dir([[maybe_unused]] bool get_config_subdirectory)
{
// Use magic static
static const std::string s_dir = []
@@ -2100,6 +2103,14 @@ const std::string& fs::get_config_dir()
return dir;
}();
#ifdef _WIN32
if (get_config_subdirectory)
{
static const std::string subdir = s_dir + "config/";
return subdir;
}
#endif
return s_dir;
}
@@ -2141,6 +2152,16 @@ const std::string& fs::get_cache_dir()
return s_dir;
}
const std::string& fs::get_log_dir()
{
#ifdef _WIN32
static const std::string s_dir = fs::get_config_dir() + "log/";
return s_dir;
#else
return fs::get_cache_dir();
#endif
}
const std::string& fs::get_temp_dir()
{
static const std::string s_dir = []
@@ -2412,6 +2433,13 @@ fs::file fs::make_gather(std::vector<fs::file> files)
return result;
}
std::string fs::generate_neighboring_path(std::string_view source, [[maybe_unused]] u64 seed)
{
// Seed is currently not used
return fmt::format(u8"%s/%s.%s.tmp", get_parent_dir(source), source.substr(source.find_last_of(fs::delim) + 1), fmt::base57(utils::get_unique_tsc()));
}
bool fs::pending_file::open(std::string_view path)
{
file.close();
@@ -2430,7 +2458,7 @@ bool fs::pending_file::open(std::string_view path)
do
{
m_path = fmt::format(u8"%s/%s.%s.tmp", get_parent_dir(path), path.substr(path.find_last_of(fs::delim) + 1), fmt::base57(utils::get_unique_tsc()));
m_path = fs::generate_neighboring_path(path, 0);
if (file.open(m_path, fs::create + fs::write + fs::read + fs::excl))
{
@@ -2563,21 +2591,52 @@ bool fs::pending_file::commit(bool overwrite)
file.close();
#ifdef _WIN32
const auto ws2 = to_wchar(m_dest);
const auto wdest = to_wchar(m_dest);
bool ok = false;
if (hardlink_paths.empty())
{
ok = MoveFileExW(ws1.get(), ws2.get(), overwrite ? MOVEFILE_REPLACE_EXISTING | MOVEFILE_WRITE_THROUGH : MOVEFILE_WRITE_THROUGH);
ok = MoveFileExW(ws1.get(), wdest.get(), overwrite ? MOVEFILE_REPLACE_EXISTING | MOVEFILE_WRITE_THROUGH : MOVEFILE_WRITE_THROUGH);
}
else
{
ok = ReplaceFileW(ws1.get(), ws2.get(), nullptr, 0, nullptr, nullptr);
ok = ReplaceFileW(ws1.get(), wdest.get(), nullptr, 0, nullptr, nullptr);
}
if (ok)
{
for (const std::wstring& link_name : hardlink_paths)
{
std::unique_ptr<wchar_t[]> write_temp_path;
do
{
write_temp_path = to_wchar(fs::generate_neighboring_path(m_dest, 0));
// Generate a temporary hard linke
if (CreateHardLinkW(wdest.get(), write_temp_path.get(), nullptr))
{
if (MoveFileExW(write_temp_path.get(), link_name.data(), MOVEFILE_REPLACE_EXISTING))
{
// Success
write_temp_path.reset();
break;
}
break;
}
}
while (fs::g_tls_error == fs::error::exist); // Only retry if failed due to existing file
if (write_temp_path)
{
// Failure
g_tls_error = to_error(GetLastError());
return false;
}
}
// Disable the destructor
m_path.clear();
return true;
@@ -2596,7 +2655,7 @@ bool fs::pending_file::commit(bool overwrite)
return false;
}
stx::generator<fs::dir_entry&> fs::list_dir_recursively(std::string path)
stx::generator<fs::dir_entry&> fs::list_dir_recursively(const std::string& path)
{
for (auto& entry : fs::dir(path))
{
@@ -2639,6 +2698,17 @@ void fmt_class_string<fs::seek_mode>::format(std::string& out, u64 arg)
template<>
void fmt_class_string<fs::error>::format(std::string& out, u64 arg)
{
if (arg == static_cast<u64>(fs::error::unknown))
{
// Note: may not be the correct error code because it only prints the last
#ifdef _WIN32
fmt::append(out, "Unknown error [errno=%d]", GetLastError());
#else
fmt::append(out, "Unknown error [errno=%d]", errno);
#endif
return;
}
format_enum(out, arg, [](auto arg)
{
switch (arg)
+18 -6
View File
@@ -475,7 +475,7 @@ namespace fs
dir() = default;
// Open dir handle
explicit dir(const std::string& path)
explicit dir(const std::string& path) noexcept
{
open(path);
}
@@ -484,7 +484,7 @@ namespace fs
bool open(const std::string& path);
// Check whether the handle is valid (opened directory)
explicit operator bool() const
explicit operator bool() const noexcept
{
return m_dir.operator bool();
}
@@ -531,7 +531,7 @@ namespace fs
from_current
};
iterator(const dir* parent, mode mode_ = mode::from_first)
iterator(const dir* parent, mode mode_ = mode::from_first) noexcept
: m_parent(parent)
{
if (!m_parent)
@@ -569,6 +569,13 @@ namespace fs
return *this;
}
iterator operator++(int)
{
iterator old = *this;
*this = {m_parent, mode::from_current};
return old;
}
bool operator !=(const iterator& rhs) const
{
return m_parent != rhs.m_parent;
@@ -592,15 +599,20 @@ namespace fs
// Get executable containing directory
std::string get_executable_dir();
// Get configuration directory
const std::string& get_config_dir();
// Get configuration directory. Set get_config_subdirectory to true to get the nested config dir on windows.
const std::string& get_config_dir(bool get_config_subdirectory = false);
// Get common cache directory
const std::string& get_cache_dir();
// Get common log directory
const std::string& get_log_dir();
// Temporary directory
const std::string& get_temp_dir();
std::string generate_neighboring_path(std::string_view source, u64 seed);
// Unique pending file creation destined to be renamed to the destination file
struct pending_file
{
@@ -835,5 +847,5 @@ namespace fs
file make_gather(std::vector<file>);
stx::generator<dir_entry&> list_dir_recursively(std::string path);
stx::generator<dir_entry&> list_dir_recursively(const std::string& path);
}
+35 -3
View File
@@ -566,9 +566,41 @@ void fmt_class_string<std::source_location>::format(std::string& out, u64 arg)
fmt::append(out, "\n(in file %s", loc.file_name());
}
if (auto func = loc.function_name(); func && func[0])
if (std::string_view full_func{loc.function_name() ? loc.function_name() : ""}; !full_func.empty())
{
fmt::append(out, ", in function %s)", func);
// Remove useless disambiguators
std::string func = fmt::replace_all(std::string(full_func), {
{"struct ", ""},
{"class ", ""},
{"enum ", ""},
{"typename ", ""},
#ifdef _MSC_VER
{"__cdecl ", ""},
#endif
{"unsigned long long", "ullong"},
//{"unsigned long", "ulong"}, // ullong
{"unsigned int", "uint"},
{"unsigned short", "ushort"},
{"unsigned char", "uchar"}});
// Remove function argument signature for long names
for (usz index = func.find_first_of('('); index != umax && func.size() >= 100u; index = func.find_first_of('(', index))
{
// Operator() function
if (func.compare(0, 3, "()("sv) == 0 || func.compare(0, 3, "() "sv))
{
if (usz not_space = func.find_first_not_of(' ', index + 2); not_space != umax && func[not_space] == '(')
{
index += 2;
continue;
}
}
func = func.substr(0, index) + "()";
break;
}
fmt::append(out, ", in function '%s')", func);
}
else
{
@@ -689,7 +721,7 @@ struct fmt::cfmt_src
TYPE(llong);
TYPE(schar);
TYPE(short);
if (std::is_signed_v<char>) TYPE(char);
if constexpr (std::is_signed_v<char>) TYPE(char);
TYPE(long);
TYPE(s128);
+9 -7
View File
@@ -109,13 +109,15 @@ extern thread_local std::string(*g_tls_log_prefix)();
// Report error and call std::abort(), defined in main.cpp
[[noreturn]] void report_fatal_error(std::string_view text, bool is_html = false, bool include_help_text = true);
enum cpu_threads_emulation_info_dump_t : u32 {};
std::string dump_useful_thread_info()
{
std::string result;
if (auto cpu = get_current_cpu_thread())
{
cpu->dump_all(result);
fmt::append(result, "%s", cpu_threads_emulation_info_dump_t{cpu->id});
}
return result;
@@ -1358,7 +1360,7 @@ bool handle_access_violation(u32 addr, bool is_writing, ucontext_t* context) noe
// check if address is RawSPU MMIO register
do if (addr - RAW_SPU_BASE_ADDR < (6 * RAW_SPU_OFFSET) && (addr % RAW_SPU_OFFSET) >= RAW_SPU_PROB_OFFSET)
{
auto thread = idm::get<named_thread<spu_thread>>(spu_thread::find_raw_spu((addr - RAW_SPU_BASE_ADDR) / RAW_SPU_OFFSET));
auto thread = idm::get_unlocked<named_thread<spu_thread>>(spu_thread::find_raw_spu((addr - RAW_SPU_BASE_ADDR) / RAW_SPU_OFFSET));
if (!thread)
{
@@ -1546,7 +1548,7 @@ bool handle_access_violation(u32 addr, bool is_writing, ucontext_t* context) noe
}
}
if (auto pf_port = idm::get<lv2_obj, lv2_event_port>(pf_port_id); pf_port && pf_port->queue)
if (auto pf_port = idm::get_unlocked<lv2_obj, lv2_event_port>(pf_port_id); pf_port && pf_port->queue)
{
// We notify the game that a page fault occurred so it can rectify it.
// Note, for data3, were the memory readable AND we got a page fault, it must be due to a write violation since reads are allowed.
@@ -2553,13 +2555,13 @@ std::string thread_ctrl::get_name_cached()
return *name_cache;
}
thread_base::thread_base(native_entry entry, std::string name)
thread_base::thread_base(native_entry entry, std::string name) noexcept
: entry_point(entry)
, m_tname(make_single_value(std::move(name)))
{
}
thread_base::~thread_base()
thread_base::~thread_base() noexcept
{
// Cleanup abandoned tasks: initialize default results and signal
this->exec();
@@ -2600,7 +2602,7 @@ bool thread_base::join(bool dtor) const
if (i >= 16 && !(i & (i - 1)) && timeout != atomic_wait_timeout::inf)
{
sig_log.error(u8"Thread [%s] is too sleepy. Waiting for it %.3fµs already!", *m_tname.load(), (utils::get_tsc() - stamp0) / (utils::get_tsc_freq() / 1000000.));
sig_log.error("Thread [%s] is too sleepy. Waiting for it %.3fus already!", *m_tname.load(), (utils::get_tsc() - stamp0) / (utils::get_tsc_freq() / 1000000.));
}
}
@@ -2731,7 +2733,7 @@ void thread_base::exec()
[[noreturn]] void thread_ctrl::emergency_exit(std::string_view reason)
{
if (std::string info = dump_useful_thread_info(); !info.empty())
if (const std::string info = dump_useful_thread_info(); !info.empty())
{
sys_log.notice("\n%s", info);
}
+24 -15
View File
@@ -33,7 +33,8 @@ enum class thread_state : u32
aborting = 1, // The thread has been joined in the destructor or explicitly aborted
errored = 2, // Set after the emergency_exit call
finished = 3, // Final state, always set at the end of thread execution
mask = 3
mask = 3,
destroying_context = 7, // Special value assigned to destroy data explicitly before the destructor
};
template <class Context>
@@ -172,9 +173,9 @@ private:
friend class named_thread;
protected:
thread_base(native_entry, std::string name);
thread_base(native_entry, std::string name) noexcept;
~thread_base();
~thread_base() noexcept;
public:
// Get CPU cycles since last time this function was called. First call returns 0.
@@ -351,7 +352,7 @@ public:
// Sets the native thread priority and returns it to zero at destructor
struct scoped_priority
{
explicit scoped_priority(int prio)
explicit scoped_priority(int prio) noexcept
{
set_native_priority(prio);
}
@@ -360,7 +361,7 @@ public:
scoped_priority& operator=(const scoped_priority&) = delete;
~scoped_priority()
~scoped_priority() noexcept
{
set_native_priority(0);
}
@@ -388,7 +389,7 @@ class thread_future_t : public thread_future, result_storage<Ctx, std::condition
using future = thread_future_t;
public:
thread_future_t(Ctx&& func, Args&&... args)
thread_future_t(Ctx&& func, Args&&... args) noexcept
: m_args(std::forward<Args>(args)...)
, m_func(std::forward<Ctx>(func))
{
@@ -417,7 +418,7 @@ public:
};
}
~thread_future_t()
~thread_future_t() noexcept
{
if constexpr (!future::empty && !Discard)
{
@@ -570,7 +571,7 @@ public:
named_thread& operator=(const named_thread&) = delete;
// Wait for the completion and access result (if not void)
[[nodiscard]] decltype(auto) operator()()
[[nodiscard]] decltype(auto) operator()() noexcept
{
thread::join();
@@ -581,7 +582,7 @@ public:
}
// Wait for the completion and access result (if not void)
[[nodiscard]] decltype(auto) operator()() const
[[nodiscard]] decltype(auto) operator()() const noexcept
{
thread::join();
@@ -593,7 +594,7 @@ public:
// Send command to the thread to invoke directly (references should be passed via std::ref())
template <bool Discard = true, typename Arg, typename... Args>
auto operator()(Arg&& arg, Args&&... args)
auto operator()(Arg&& arg, Args&&... args) noexcept
{
// Overloaded operator() of the Context.
constexpr bool v1 = std::is_invocable_v<Context, Arg&&, Args&&...>;
@@ -667,12 +668,12 @@ public:
}
// Access thread state
operator thread_state() const
operator thread_state() const noexcept
{
return static_cast<thread_state>(thread::m_sync.load() & 3);
}
named_thread& operator=(thread_state s)
named_thread& operator=(thread_state s) noexcept
{
if (s == thread_state::created)
{
@@ -693,7 +694,7 @@ public:
if constexpr (std::is_assignable_v<Context&, thread_state>)
{
static_cast<Context&>(*this) = s;
static_cast<Context&>(*this) = thread_state::aborting;
}
if (notify_sync)
@@ -702,17 +703,25 @@ public:
thread::m_sync.notify_all();
}
if (s == thread_state::finished)
if (s == thread_state::finished || s == thread_state::destroying_context)
{
// This participates in emulation stopping, use destruction-alike semantics
thread::join(true);
}
if (s == thread_state::destroying_context)
{
if constexpr (std::is_assignable_v<Context&, thread_state>)
{
static_cast<Context&>(*this) = thread_state::destroying_context;
}
}
return *this;
}
// Context type doesn't need virtual destructor
~named_thread()
~named_thread() noexcept
{
// Assign aborting state forcefully and join thread
operator=(thread_state::finished);
+11 -13
View File
@@ -9,11 +9,11 @@
#include "Emu/VFS.h"
#include "util/types.hpp"
#include "util/endian.hpp"
#include "util/asm.hpp"
#include <charconv>
#include <regex>
#include <vector>
LOG_CHANNEL(patch_log, "PAT");
@@ -125,19 +125,15 @@ patch_engine::patch_engine()
std::string patch_engine::get_patch_config_path()
{
#ifdef _WIN32
const std::string config_dir = fs::get_config_dir() + "config/";
const std::string config_dir = fs::get_config_dir(true);
const std::string patch_path = config_dir + "patch_config.yml";
#ifdef _WIN32
if (!fs::create_path(config_dir))
{
patch_log.error("Could not create path: %s (%s)", patch_path, fs::g_tls_error);
}
return patch_path;
#else
return fs::get_config_dir() + "patch_config.yml";
#endif
return patch_path;
}
std::string patch_engine::get_patches_path()
@@ -907,7 +903,7 @@ void unmap_vm_area(std::shared_ptr<vm::block_t>& ptr)
}
// Returns old 'applied' size
static usz apply_modification(std::basic_string<u32>& applied, patch_engine::patch_info& patch, std::function<u8*(u32, u32)> mem_translate, u32 filesz, u32 min_addr)
static usz apply_modification(std::vector<u32>& applied, patch_engine::patch_info& patch, std::function<u8*(u32, u32)> mem_translate, u32 filesz, u32 min_addr)
{
const usz old_applied_size = applied.size();
@@ -1447,14 +1443,15 @@ static usz apply_modification(std::basic_string<u32>& applied, patch_engine::pat
return old_applied_size;
}
std::basic_string<u32> patch_engine::apply(const std::string& name, std::function<u8*(u32, u32)> mem_translate, u32 filesz, u32 min_addr)
void patch_engine::apply(std::vector<u32>& applied_total, const std::string& name, std::function<u8*(u32, u32)> mem_translate, u32 filesz, u32 min_addr)
{
// applied_total may be non-empty, do not clear it
if (!m_map.contains(name))
{
return {};
return;
}
std::basic_string<u32> applied_total;
const patch_container& container = ::at32(m_map, name);
const std::string& serial = Emu.GetTitleID();
const std::string& app_version = Emu.GetAppVersion();
@@ -1599,7 +1596,8 @@ std::basic_string<u32> patch_engine::apply(const std::string& name, std::functio
}
}
return applied_total;
// Ensure consistent order
std::sort(applied_total.begin(), applied_total.end());
}
void patch_engine::unload(const std::string& name)
+1 -1
View File
@@ -215,7 +215,7 @@ public:
void append_title_patches(std::string_view title_id);
// Apply patch (returns the number of entries applied)
std::basic_string<u32> apply(const std::string& name, std::function<u8*(u32, u32)> mem_translate, u32 filesz = -1, u32 min_addr = 0);
void apply(std::vector<u32>& applied_total, const std::string& name, std::function<u8*(u32, u32)> mem_translate, u32 filesz = -1, u32 min_addr = 0);
// Deallocate memory used by patches
void unload(const std::string& name);
+1
View File
@@ -14,6 +14,7 @@ enum class cheat_type : u8
signed_16_cheat,
signed_32_cheat,
signed_64_cheat,
float_32_cheat,
max
};
+99 -20
View File
@@ -4,12 +4,13 @@
#include "util/atomic.hpp"
#include "util/bless.hpp"
//! Simple unshrinkable array base for concurrent access. Only growths automatically.
//! There is no way to know the current size. The smaller index is, the faster it's accessed.
//!
//! T is the type of elements. Currently, default constructor of T shall be constexpr.
//! N is initial element count, available without any memory allocation and only stored contiguously.
template <typename T, usz N>
// Simple unshrinkable array base for concurrent access. Only growths automatically.
// There is no way to know the current size. The smaller index is, the faster it's accessed.
//
// T is the type of elements. Currently, default constructor of T shall be constexpr.
// N is initial element count, available without any memory allocation and only stored contiguously.
// Let's have around 256 bytes or less worth of preallocated elements
template <typename T, usz N = std::max<usz>(256 / sizeof(T), 1)>
class lf_array
{
// Data (default-initialized)
@@ -31,22 +32,100 @@ public:
T& operator [](usz index)
{
if (index < N) [[likely]]
lf_array* _this = this;
T* result{};
bool installed = false;
for (usz i = 0;; i += N)
{
return m_data[index];
}
else if (!m_next) [[unlikely]]
{
// Create new array block. It's not a full-fledged once-synchronization, unlikely needed.
for (auto _new = new lf_array, ptr = this; ptr;)
if (index - i < N)
{
// Install the pointer. If failed, go deeper.
ptr = ptr->m_next.compare_and_swap(nullptr, _new);
result = std::addressof(_this->m_data[index - i]);
break;
}
lf_array* next = _this->m_next;
if (!next)
{
// Do not allow access beyond many element more at a time
ensure(!installed && index - i < N * 2);
installed = true;
for (auto _new = new lf_array, ptr = _this; ptr;)
{
// Install the pointer. If failed, go deeper.
ptr = ptr->m_next.compare_and_swap(nullptr, _new);
if (!next)
{
// Determine the next pointer (if null then the new memory has been installed)
next = ptr ? ptr : _new;
}
}
}
_this = next;
}
// Access recursively
return (*m_next)[index - N];
return *result;
}
template <typename F> requires (std::is_invocable_v<F, T&>)
auto for_each(F&& func, bool is_finite = true)
{
lf_array* _this = this;
using return_t = std::invoke_result_t<F, T&>;
while (_this)
{
for (usz j = 0; j < N; j++)
{
if constexpr (std::is_void_v<return_t>)
{
std::invoke(func, _this->m_data[j]);
}
else
{
auto ret = std::invoke(func, _this->m_data[j]);
if (ret)
{
return std::make_pair(std::addressof(_this->m_data[j]), std::move(ret));
}
}
}
lf_array* next = _this->m_next;
if constexpr (!std::is_void_v<return_t>)
{
if (!next && !is_finite)
{
for (auto _new = new lf_array, ptr = _this; ptr;)
{
// Install the pointer. If failed, go deeper.
ptr = ptr->m_next.compare_and_swap(nullptr, _new);
if (!next)
{
// Determine the next pointer (if null then the new memory has been installed)
next = ptr ? ptr : _new;
}
}
}
}
_this = next;
}
if constexpr (!std::is_void_v<return_t>)
{
return std::make_pair(std::add_pointer_t<T>{}, return_t());
}
}
u64 size() const
@@ -62,9 +141,9 @@ public:
}
};
//! Simple lock-free FIFO queue base. Based on lf_array<T, N> itself. Currently uses 32-bit counters.
//! There is no "push_end" or "pop_begin" provided, the queue element must signal its state on its own.
template<typename T, usz N>
// Simple lock-free FIFO queue base. Based on lf_array<T, N> itself. Currently uses 32-bit counters.
// There is no "push_end" or "pop_begin" provided, the queue element must signal its state on its own.
template<typename T, usz N = std::max<usz>(256 / sizeof(T), 1)>
class lf_fifo : public lf_array<T, N>
{
// LSB 32-bit: push, MSB 32-bit: pop
+1 -1
View File
@@ -121,7 +121,7 @@ public:
void unlock_hle()
{
const u32 value = atomic_storage<u32>::fetch_add_hle_rel(m_value.raw(), 0u - c_one);
const u32 value = atomic_storage<u32>::fetch_add_hle_rel(m_value.raw(), ~c_one + 1);
if (value != c_one) [[unlikely]]
{
+3 -4
View File
@@ -49,12 +49,11 @@ std::string rXmlNode::GetName()
return {};
}
std::string rXmlNode::GetAttribute(const std::string& name)
std::string rXmlNode::GetAttribute(std::string_view name)
{
if (handle)
{
const auto pred = [&name](const pugi::xml_attribute& attr) { return (name == attr.name()); };
if (const pugi::xml_attribute attr = handle.find_attribute(pred))
if (const pugi::xml_attribute attr = handle.attribute(name))
{
if (const pugi::char_t* value = attr.value())
{
@@ -86,7 +85,7 @@ rXmlDocument::rXmlDocument()
{
}
pugi::xml_parse_result rXmlDocument::Read(const std::string& data)
pugi::xml_parse_result rXmlDocument::Read(std::string_view data)
{
if (handle)
{
+2 -2
View File
@@ -23,7 +23,7 @@ struct rXmlNode
std::shared_ptr<rXmlNode> GetChildren();
std::shared_ptr<rXmlNode> GetNext();
std::string GetName();
std::string GetAttribute(const std::string& name);
std::string GetAttribute(std::string_view name);
std::string GetNodeContent();
pugi::xml_node handle{};
@@ -34,7 +34,7 @@ struct rXmlDocument
rXmlDocument();
rXmlDocument(const rXmlDocument& other) = delete;
rXmlDocument &operator=(const rXmlDocument& other) = delete;
pugi::xml_parse_result Read(const std::string& data);
pugi::xml_parse_result Read(std::string_view data);
virtual std::shared_ptr<rXmlNode> GetRoot();
pugi::xml_document handle{};
+3 -3
View File
@@ -69,9 +69,9 @@ jobs:
variables:
COMPILER: msvc
QT_VER_MAIN: '6'
QT_VER: '6.7.3'
QT_VER_MSVC: 'msvc2019'
QT_DATE: '202409200836'
QT_VER: '6.8.1'
QT_VER_MSVC: 'msvc2022'
QT_DATE: '202411221531'
QTDIR: C:\Qt\$(QT_VER)\$(QT_VER_MSVC)_64
VULKAN_VER: '1.3.268.0'
VULKAN_SDK_SHA: '8459ef49bd06b697115ddd3d97c9aec729e849cd775f5be70897718a9b3b9db5'
+1 -1
View File
@@ -14,7 +14,7 @@
<PreprocessorDefinitions>LLVM_AVAILABLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<AdditionalLibraryDirectories Condition="'$(Configuration)'=='Debug'">%(AdditionalLibraryDirectories);..\3rdparty\llvm\llvm_build\Debug\lib</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories Condition="'$(Configuration)'=='Debug'">%(AdditionalLibraryDirectories);$(SolutionDir)build\lib\$(Configuration)-$(Platform)\llvm_build\lib;$(SolutionDir)build\lib_ext\$(Configuration)-$(Platform)\llvm_build\$(Configuration)\lib</AdditionalLibraryDirectories>
<AdditionalDependencies>%(AdditionalDependencies);
LLVMAggressiveInstCombine.lib;
LLVMAnalysis.lib;
+3 -3
View File
@@ -4,9 +4,9 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<IncludePath>.\;..\;..\3rdparty\asmjit\asmjit\src;..\..\3rdparty\yaml-cpp\yaml-cpp\include;..\3rdparty\ffmpeg\include;$(VC_IncludePath);$(WindowsSDK_IncludePath);$(UniversalCRT_IncludePath);..\3rdparty\libpng\libpng;..\3rdparty\GL;..\3rdparty\stblib\stb;..\3rdparty\openal\openal-soft\include\AL;..\3rdparty\pugixml\src;..\3rdparty\hidapi\hidapi;..\3rdparty\Optional;..\3rdparty\xxhash</IncludePath>
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)\</OutDir>
<LibraryPath>$(SolutionDir)lib\$(Configuration)-$(Platform)\;$(UniversalCRT_LibraryPath_x64);$(LibraryPath)</LibraryPath>
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
<OutDir>$(SolutionDir)build\lib\$(Configuration)-$(Platform)\</OutDir>
<LibraryPath>$(SolutionDir)build\lib\$(Configuration)-$(Platform)\;$(UniversalCRT_LibraryPath_x64);$(LibraryPath)</LibraryPath>
<IntDir>$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup>
<Lib>
+1 -1
View File
@@ -15,7 +15,7 @@
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories Condition="'$(Configuration)'=='Release'">%(AdditionalLibraryDirectories);..\3rdparty\llvm\llvm_build\Release\lib</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories Condition="'$(Configuration)'=='Release'">%(AdditionalLibraryDirectories);$(SolutionDir)build\lib\$(Configuration)-$(Platform)\llvm_build\lib;$(SolutionDir)build\lib_ext\$(Configuration)-$(Platform)\llvm_build\$(Configuration)\lib</AdditionalLibraryDirectories>
<AdditionalDependencies>%(AdditionalDependencies);
LLVMAggressiveInstCombine.lib;
LLVMAnalysis.lib;
+2
View File
@@ -1,5 +1,7 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wold-style-cast"
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#pragma GCC diagnostic ignored "-Wmissing-declarations"
#import <Foundation/Foundation.h>
#pragma GCC diagnostic pop
+11 -2
View File
@@ -7,12 +7,13 @@ EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "emucore", "rpcs3\emucore.vcxproj", "{C4A10229-4712-4BD2-B63E-50D93C67A038}"
ProjectSection(ProjectDependencies) = postProject
{2C902C67-985C-4BE0-94A3-E0FE2EB929A3} = {2C902C67-985C-4BE0-94A3-E0FE2EB929A3}
{3C67A2FF-4710-402A-BE3E-31B0CB0576DF} = {3C67A2FF-4710-402A-BE3E-31B0CB0576DF}
{5228F863-E0DD-4DE7-AA7B-5C52B14CD4D0} = {5228F863-E0DD-4DE7-AA7B-5C52B14CD4D0}
{8846A9AA-5539-4C91-8301-F54260E1A07A} = {8846A9AA-5539-4C91-8301-F54260E1A07A}
{939FE206-1182-ABC3-1234-FEAB88E98404} = {939FE206-1182-ABC3-1234-FEAB88E98404}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm_build", "3rdparty\llvm\llvm_build\llvm_build.vcxproj", "{8BC303AB-25BE-4276-8E57-73F171B2D672}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm_build", "3rdparty\llvm\llvm_build.vcxproj", "{8BC303AB-25BE-4276-8E57-73F171B2D672}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GLGSRender", "rpcs3\GLGSRender.vcxproj", "{3384223A-6D97-4799-9862-359F85312892}"
EndProject
@@ -46,6 +47,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rpcs3", "rpcs3\rpcs3.vcxpro
{2C902C67-985C-4BE0-94A3-E0FE2EB929A3} = {2C902C67-985C-4BE0-94A3-E0FE2EB929A3}
{3384223A-6D97-4799-9862-359F85312892} = {3384223A-6D97-4799-9862-359F85312892}
{349EE8F9-7D25-4909-AAF5-FF3FADE72187} = {349EE8F9-7D25-4909-AAF5-FF3FADE72187}
{3C67A2FF-4710-402A-BE3E-31B0CB0576DF} = {3C67A2FF-4710-402A-BE3E-31B0CB0576DF}
{3EE5F075-B546-42C4-B6A8-E3CCEF38B78D} = {3EE5F075-B546-42C4-B6A8-E3CCEF38B78D}
{508C291A-3D18-49F5-B25D-F7C8DB92CB21} = {508C291A-3D18-49F5-B25D-F7C8DB92CB21}
{5B146DEA-9ACE-4D32-A7FD-3F42464DD69C} = {5B146DEA-9ACE-4D32-A7FD-3F42464DD69C}
@@ -78,7 +80,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcurl", "3rdparty\curl\li
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "3rdParty", "3rdParty", "{6C3B64A0-8F8A-4DC4-8C0B-D71EBEED7FA8}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm_build_clang_cl", "3rdparty\llvm\llvm_build\llvm_build_clang_cl.vcxproj", "{A37E4273-85DB-4217-B775-CE971B87D9DF}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm_build_clang_cl", "3rdparty\llvm\llvm_build_clang_cl.vcxproj", "{A37E4273-85DB-4217-B775-CE971B87D9DF}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Cubeb", "rpcs3\Cubeb.vcxproj", "{9610627D-20FE-4B07-8CE3-9FF68A5F1EC2}"
EndProject
@@ -103,6 +105,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "7zip", "3rdparty\7zip\7zip.
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openal-soft", "3rdparty\openal\openal-soft.vcxproj", "{8846A9AA-5539-4C91-8301-F54260E1A07A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fusion", "3rdparty\fusion\fusion.vcxproj", "{3C67A2FF-4710-402A-BE3E-31B0CB0576DF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
@@ -211,6 +215,10 @@ Global
{8846A9AA-5539-4C91-8301-F54260E1A07A}.Debug|x64.Build.0 = Debug|x64
{8846A9AA-5539-4C91-8301-F54260E1A07A}.Release|x64.ActiveCfg = Release|x64
{8846A9AA-5539-4C91-8301-F54260E1A07A}.Release|x64.Build.0 = Release|x64
{3C67A2FF-4710-402A-BE3E-31B0CB0576DF}.Debug|x64.ActiveCfg = Debug|x64
{3C67A2FF-4710-402A-BE3E-31B0CB0576DF}.Debug|x64.Build.0 = Debug|x64
{3C67A2FF-4710-402A-BE3E-31B0CB0576DF}.Release|x64.ActiveCfg = Release|x64
{3C67A2FF-4710-402A-BE3E-31B0CB0576DF}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -243,6 +251,7 @@ Global
{4E52A41A-F33B-4C7A-8C36-A1A6B4F4277C} = {6C3B64A0-8F8A-4DC4-8C0B-D71EBEED7FA8}
{5B146DEA-9ACE-4D32-A7FD-3F42464DD69C} = {6C3B64A0-8F8A-4DC4-8C0B-D71EBEED7FA8}
{8846A9AA-5539-4C91-8301-F54260E1A07A} = {6C3B64A0-8F8A-4DC4-8C0B-D71EBEED7FA8}
{3C67A2FF-4710-402A-BE3E-31B0CB0576DF} = {6C3B64A0-8F8A-4DC4-8C0B-D71EBEED7FA8}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {06CC7920-E085-4B81-9582-8DE8AAD42510}
+20 -8
View File
@@ -82,6 +82,10 @@ target_sources(rpcs3
Input/mm_joystick_handler.cpp
Input/pad_thread.cpp
Input/product_info.cpp
Input/ps_move_calibration.cpp
Input/ps_move_config.cpp
Input/ps_move_handler.cpp
Input/ps_move_tracker.cpp
Input/raw_mouse_config.cpp
Input/raw_mouse_handler.cpp
Input/sdl_pad_handler.cpp
@@ -95,9 +99,20 @@ set_target_properties(rpcs3
AUTOMOC ON
AUTOUIC ON)
target_link_libraries(rpcs3 PRIVATE rpcs3_emu rpcs3_ui)
target_link_libraries(rpcs3 PRIVATE 3rdparty::discordRPC 3rdparty::qt6 3rdparty::hidapi 3rdparty::libusb 3rdparty::wolfssl 3rdparty::libcurl 3rdparty::zlib)
target_link_libraries(rpcs3 PRIVATE ${ADDITIONAL_LIBS})
target_link_libraries(rpcs3
PRIVATE
rpcs3_emu
rpcs3_ui
3rdparty::discordRPC
3rdparty::qt6
3rdparty::hidapi
3rdparty::libusb
3rdparty::wolfssl
3rdparty::libcurl
3rdparty::zlib
3rdparty::opencv
3rdparty::fusion
${ADDITIONAL_LIBS})
# Unix display manager
if(X11_FOUND)
@@ -143,16 +158,13 @@ elseif(UNIX)
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/bin/GuiConfigs $<TARGET_FILE_DIR:rpcs3>/GuiConfigs
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/bin/git $<TARGET_FILE_DIR:rpcs3>/git)
elseif(WIN32)
if(MSVC)
add_custom_command(TARGET rpcs3 POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/3rdparty/OpenAL/openal-soft/$<CONFIG>/OpenAL32.dll $<TARGET_FILE_DIR:rpcs3>)
endif()
add_custom_command(TARGET rpcs3 POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:OpenAL::OpenAL> $<TARGET_FILE_DIR:rpcs3>
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/bin/Icons $<TARGET_FILE_DIR:rpcs3>/Icons
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/bin/GuiConfigs $<TARGET_FILE_DIR:rpcs3>/GuiConfigs
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/bin/git $<TARGET_FILE_DIR:rpcs3>/git
COMMAND "${WINDEPLOYQT_EXECUTABLE}" --no-compiler-runtime --no-opengl-sw --no-patchqt
--no-translations --no-quick --no-system-d3d-compiler --no-quick-import
--no-translations --no-system-d3d-compiler --no-quick-import
--plugindir "$<IF:$<CXX_COMPILER_ID:MSVC>,$<TARGET_FILE_DIR:rpcs3>/plugins,$<TARGET_FILE_DIR:rpcs3>/share/qt6/plugins>"
--verbose 0 "$<TARGET_FILE:rpcs3>")
endif()
+2 -2
View File
@@ -11,7 +11,7 @@
LOG_CHANNEL(dec_log, "DECRYPT");
usz decrypt_binaries_t::decrypt(std::string klic_input)
usz decrypt_binaries_t::decrypt(std::string_view klic_input)
{
if (m_index >= m_modules.size())
{
@@ -41,7 +41,7 @@ usz decrypt_binaries_t::decrypt(std::string klic_input)
m_klics.insert(m_klics.end(), Emu.klic.begin(), Emu.klic.end());
}
if (std::string_view text = std::string_view{klic_input}.substr(klic_input.find_first_of('x') + 1); text.size() == 32)
if (std::string_view text = klic_input.substr(klic_input.find_first_of('x') + 1); text.size() == 32)
{
// Allowed to fail (would simply repeat the operation if fails again)
u64 lo = 0;
+1 -1
View File
@@ -12,7 +12,7 @@ public:
{
}
usz decrypt(std::string klic_input = {});
usz decrypt(std::string_view klic_input = {});
bool done() const
{
+6 -4
View File
@@ -5,11 +5,11 @@
#include "lz.h"
#include "ec.h"
#include "Utilities/mutex.h"
#include "Emu/system_utils.hpp"
#include <cmath>
#include "util/asm.hpp"
#include <algorithm>
#include <span>
LOG_CHANNEL(edat_log, "EDAT");
@@ -614,9 +614,11 @@ bool validate_npd_hashes(std::string_view file_name, const u8* klicensee, NPD_HE
std::memcpy(buf_lower.get(), buf.get(), buf_len);
std::memcpy(buf_upper.get(), buf.get(), buf_len);
for (usz i = std::basic_string_view<u8>(buf.get() + 0x30, file_name.size()).find_last_of('.'); i < buf_len; i++)
const auto buf_span = std::span(buf.get(), buf.get() + buf_len);
const auto it = std::find(buf_span.rbegin(), buf_span.rend() - 0x30, '.');
for (usz i = std::distance(it, buf_span.rend()) - 1; i < buf_len; ++i)
{
const u8 c = static_cast<u8>(buf[i]);
const u8 c = buf[i];
buf_upper[i] = std::toupper(c);
buf_lower[i] = std::tolower(c);
}
+39
View File
@@ -0,0 +1,39 @@
#include "stdafx.h"
#include "audio_utils.h"
#include "Emu/system_config.h"
#include "Emu/System.h"
#include "Emu/IdManager.h"
#include "Emu/RSX/Overlays/overlay_message.h"
namespace audio
{
f32 get_volume()
{
return g_fxo->get<audio_fxo>().audio_muted ? 0.0f : g_cfg.audio.volume / 100.0f;
}
void toggle_mute()
{
audio_fxo& fxo = g_fxo->get<audio_fxo>();
fxo.audio_muted = !fxo.audio_muted;
Emu.GetCallbacks().update_emu_settings();
rsx::overlays::queue_message(fxo.audio_muted ? localized_string_id::AUDIO_MUTED : localized_string_id::AUDIO_UNMUTED, 3'000'000);
}
void change_volume(s32 delta)
{
// Ignore if muted
if (g_fxo->get<audio_fxo>().audio_muted) return;
const s32 old_volume = g_cfg.audio.volume;
const s32 new_volume = old_volume + delta;
if (old_volume == new_volume) return;
g_cfg.audio.volume.set(std::clamp<s32>(new_volume, g_cfg.audio.volume.min, g_cfg.audio.volume.max));
Emu.GetCallbacks().update_emu_settings();
rsx::overlays::queue_message(get_localized_string(localized_string_id::AUDIO_CHANGED, fmt::format("%d%%", g_cfg.audio.volume.get()).c_str()), 3'000'000);
}
}
+14
View File
@@ -0,0 +1,14 @@
#pragma once
namespace audio
{
struct audio_fxo
{
atomic_t<bool> audio_muted {false};
};
f32 get_volume();
void toggle_mute();
void change_volume(s32 delta);
}
+10
View File
@@ -4,6 +4,7 @@ add_library(rpcs3_emu STATIC
IdManager.cpp
localized_string.cpp
savestate_utils.cpp
scoped_progress_dialog.cpp
System.cpp
system_config.cpp
system_config_types.cpp
@@ -124,6 +125,7 @@ target_sources(rpcs3_emu PRIVATE
# Audio
target_sources(rpcs3_emu PRIVATE
Audio/audio_resampler.cpp
Audio/audio_utils.cpp
Audio/AudioDumper.cpp
Audio/AudioBackend.cpp
Audio/Cubeb/CubebBackend.cpp
@@ -170,6 +172,7 @@ target_link_libraries(rpcs3_emu
# Cell
target_sources(rpcs3_emu PRIVATE
Cell/ErrorCodes.cpp
Cell/MFC.cpp
Cell/PPUAnalyser.cpp
Cell/PPUDisAsm.cpp
@@ -251,6 +254,7 @@ target_sources(rpcs3_emu PRIVATE
Cell/Modules/cellCrossController.cpp
Cell/Modules/cellDaisy.cpp
Cell/Modules/cellDmux.cpp
Cell/Modules/cellDmuxPamf.cpp
Cell/Modules/cellDtcpIpUtility.cpp
Cell/Modules/cellFiber.cpp
Cell/Modules/cellFont.cpp
@@ -474,6 +478,7 @@ target_sources(rpcs3_emu PRIVATE
RSX/Common/TextureUtils.cpp
RSX/Common/texture_cache.cpp
RSX/Core/RSXContext.cpp
RSX/Core/RSXDrawCommands.cpp
RSX/gcm_enums.cpp
RSX/gcm_printing.cpp
RSX/GL/GLCommonDecompiler.cpp
@@ -504,6 +509,7 @@ target_sources(rpcs3_emu PRIVATE
RSX/GL/OpenGL.cpp
RSX/GL/upscalers/fsr1/fsr_pass.cpp
RSX/GSRender.cpp
RSX/Host/MM.cpp
RSX/Host/RSXDMAWriter.cpp
RSX/Null/NullGSRender.cpp
RSX/NV47/FW/draw_call.cpp
@@ -521,8 +527,10 @@ target_sources(rpcs3_emu PRIVATE
RSX/Overlays/HomeMenu/overlay_home_menu_message_box.cpp
RSX/Overlays/HomeMenu/overlay_home_menu_page.cpp
RSX/Overlays/HomeMenu/overlay_home_menu_settings.cpp
RSX/Overlays/HomeMenu/overlay_home_menu_savestate.cpp
RSX/Overlays/Network/overlay_recvmessage_dialog.cpp
RSX/Overlays/Network/overlay_sendmessage_dialog.cpp
RSX/Overlays/Trophies/overlay_trophy_list_dialog.cpp
RSX/Overlays/overlays.cpp
RSX/Overlays/overlay_animated_icon.cpp
RSX/Overlays/overlay_animation.cpp
@@ -550,6 +558,7 @@ target_sources(rpcs3_emu PRIVATE
RSX/Program/CgBinaryFragmentProgram.cpp
RSX/Program/CgBinaryVertexProgram.cpp
RSX/Program/FragmentProgramDecompiler.cpp
RSX/Program/FragmentProgramRegister.cpp
RSX/Program/GLSLCommon.cpp
RSX/Program/ProgramStateCache.cpp
RSX/Program/program_util.cpp
@@ -586,6 +595,7 @@ if(TARGET 3rdparty_vulkan)
RSX/VK/VKAsyncScheduler.cpp
RSX/VK/VKCommandStream.cpp
RSX/VK/VKCommonDecompiler.cpp
RSX/VK/VKCommonPipelineLayout.cpp
RSX/VK/VKCompute.cpp
RSX/VK/VKDMA.cpp
RSX/VK/VKDraw.cpp
+3 -2
View File
@@ -1,6 +1,7 @@
#pragma once
#include <string>
#include "Emu/CPU/CPUThread.h"
#include "Utilities/StrFmt.h"
enum class cpu_disasm_mode
@@ -22,7 +23,7 @@ protected:
const u8* m_offset{};
const u32 m_start_pc;
std::add_pointer_t<const cpu_thread> m_cpu{};
std::shared_ptr<cpu_thread> m_cpu_handle;
shared_ptr<cpu_thread> m_cpu_handle;
u32 m_op = 0;
void format_by_mode()
@@ -81,7 +82,7 @@ public:
return const_cast<cpu_thread*>(m_cpu);
}
void set_cpu_handle(std::shared_ptr<cpu_thread> cpu)
void set_cpu_handle(shared_ptr<cpu_thread> cpu)
{
m_cpu_handle = std::move(cpu);
+94 -11
View File
@@ -8,6 +8,7 @@
#include "Emu/Memory/vm_reservation.h"
#include "Emu/IdManager.h"
#include "Emu/GDB.h"
#include "Emu/Cell/lv2/sys_spu.h"
#include "Emu/Cell/PPUThread.h"
#include "Emu/Cell/SPUThread.h"
#include "Emu/RSX/RSXThread.h"
@@ -17,6 +18,7 @@
#include <thread>
#include <unordered_map>
#include <map>
#include <shared_mutex>
#if defined(ARCH_X64)
#include <emmintrin.h>
@@ -75,6 +77,87 @@ void fmt_class_string<bs_t<cpu_flag>>::format(std::string& out, u64 arg)
format_bitset(out, arg, "[", "|", "]", &fmt_class_string<cpu_flag>::format);
}
enum cpu_threads_emulation_info_dump_t : u32 {};
template<>
void fmt_class_string<cpu_threads_emulation_info_dump_t>::format(std::string& out, u64 arg)
{
// Do not dump all threads, only select few
// Aided by thread ID for filtering
const u32 must_have_cpu_id = static_cast<u32>(arg);
// Dump main_thread
const auto main_ppu = idm::get_unlocked<named_thread<ppu_thread>>(ppu_thread::id_base);
if (main_ppu)
{
fmt::append(out, "\n%s's thread context:\n", main_ppu->get_name());
main_ppu->dump_all(out);
}
if (must_have_cpu_id >> 24 == ppu_thread::id_base >> 24)
{
if (must_have_cpu_id != ppu_thread::id_base)
{
const auto selected_ppu = idm::get_unlocked<named_thread<ppu_thread>>(must_have_cpu_id);
if (selected_ppu)
{
fmt::append(out, "\n%s's thread context:\n", selected_ppu->get_name());
selected_ppu->dump_all(out);
}
}
}
else if (must_have_cpu_id >> 24 == spu_thread::id_base >> 24)
{
const auto selected_spu = idm::get_unlocked<named_thread<spu_thread>>(must_have_cpu_id);
if (selected_spu)
{
if (selected_spu->get_type() == spu_type::threaded && selected_spu->group->max_num > 1u)
{
// Dump the information of the entire group
// Do not block because it is a potentially sensitive context
std::shared_lock rlock(selected_spu->group->mutex, std::defer_lock);
for (u32 i = 0; !rlock.try_lock() && i < 100; i++)
{
busy_wait();
}
if (rlock)
{
for (const auto& spu : selected_spu->group->threads)
{
if (spu && spu != selected_spu)
{
fmt::append(out, "\n%s's thread context:\n", spu->get_name());
spu->dump_all(out);
}
}
}
else
{
fmt::append(out, "\nFailed to dump SPU thread group's thread's information!");
}
// Print the specified SPU thread last
}
fmt::append(out, "\n%s's thread context:\n", selected_spu->get_name());
selected_spu->dump_all(out);
}
}
else if (must_have_cpu_id >> 24 == rsx::thread::id_base >> 24)
{
if (auto rsx = rsx::get_current_renderer())
{
fmt::append(out, "\n%s's thread context:\n", rsx->get_name());
rsx->dump_all(out);
}
}
}
// CPU profiler thread
struct cpu_prof
{
@@ -153,7 +236,7 @@ struct cpu_prof
}
// Print info
void print(const std::shared_ptr<cpu_thread>& ptr)
void print(const shared_ptr<cpu_thread>& ptr)
{
if (new_samples < min_print_samples || samples == idle)
{
@@ -180,7 +263,7 @@ struct cpu_prof
new_samples = 0;
}
static void print_all(std::unordered_map<std::shared_ptr<cpu_thread>, sample_info>& threads, sample_info& all_info)
static void print_all(std::unordered_map<shared_ptr<cpu_thread>, sample_info>& threads, sample_info& all_info)
{
u64 new_samples = 0;
@@ -236,7 +319,7 @@ struct cpu_prof
void operator()()
{
std::unordered_map<std::shared_ptr<cpu_thread>, sample_info> threads;
std::unordered_map<shared_ptr<cpu_thread>, sample_info> threads;
while (thread_ctrl::state() != thread_state::aborting)
{
@@ -252,15 +335,15 @@ struct cpu_prof
continue;
}
std::shared_ptr<cpu_thread> ptr;
shared_ptr<cpu_thread> ptr;
if (id >> 24 == 1)
{
ptr = idm::get<named_thread<ppu_thread>>(id);
ptr = idm::get_unlocked<named_thread<ppu_thread>>(id);
}
else if (id >> 24 == 2)
{
ptr = idm::get<named_thread<spu_thread>>(id);
ptr = idm::get_unlocked<named_thread<spu_thread>>(id);
}
else
{
@@ -354,7 +437,7 @@ struct cpu_prof
continue;
}
// Wait, roughly for 20µs
// Wait, roughly for 20us
thread_ctrl::wait_for(20, false);
}
@@ -1219,7 +1302,7 @@ cpu_thread* cpu_thread::get_next_cpu()
return nullptr;
}
std::shared_ptr<CPUDisAsm> make_disasm(const cpu_thread* cpu, std::shared_ptr<cpu_thread> handle);
std::shared_ptr<CPUDisAsm> make_disasm(const cpu_thread* cpu, shared_ptr<cpu_thread> handle);
void cpu_thread::dump_all(std::string& ret) const
{
@@ -1235,7 +1318,7 @@ void cpu_thread::dump_all(std::string& ret) const
if (u32 cur_pc = get_pc(); cur_pc != umax)
{
// Dump a snippet of currently executed code (may be unreliable with non-static-interpreter decoders)
auto disasm = make_disasm(this, nullptr);
auto disasm = make_disasm(this, null_ptr);
const auto rsx = try_get<rsx::thread>();
@@ -1475,14 +1558,14 @@ u32 CPUDisAsm::DisAsmBranchTarget(s32 /*imm*/)
return 0;
}
extern bool try_lock_spu_threads_in_a_state_compatible_with_savestates(bool revert_lock, std::vector<std::pair<std::shared_ptr<named_thread<spu_thread>>, u32>>* out_list)
extern bool try_lock_spu_threads_in_a_state_compatible_with_savestates(bool revert_lock, std::vector<std::pair<shared_ptr<named_thread<spu_thread>>, u32>>* out_list)
{
if (out_list)
{
out_list->clear();
}
auto get_spus = [old_counter = u64{umax}, spu_list = std::vector<std::shared_ptr<named_thread<spu_thread>>>()](bool can_collect, bool force_collect) mutable
auto get_spus = [old_counter = u64{umax}, spu_list = std::vector<shared_ptr<named_thread<spu_thread>>>()](bool can_collect, bool force_collect) mutable
{
const u64 new_counter = cpu_thread::g_threads_created + cpu_thread::g_threads_deleted;
+75 -12
View File
@@ -4,6 +4,9 @@
#include "util/v128.hpp"
#include "util/simd.hpp"
#include "util/logs.hpp"
LOG_CHANNEL(llvm_log, "LLVM");
llvm::LLVMContext g_llvm_ctx;
@@ -369,25 +372,85 @@ llvm::Constant* cpu_translator::make_const_vector<v128>(v128 v, llvm::Type* t, u
void cpu_translator::replace_intrinsics(llvm::Function& f)
{
for (auto& bb : f)
for (llvm::BasicBlock& bb : f)
{
for (auto bit = bb.begin(); bit != bb.end();)
std::set<std::string, std::less<>> names;
using InstListType = llvm::BasicBlock::InstListType;
std::function<InstListType::iterator(InstListType::iterator)> fix_funcs;
fix_funcs = [&](InstListType::iterator inst_bit)
{
if (auto ci = llvm::dyn_cast<llvm::CallInst>(&*bit))
auto ci = llvm::dyn_cast<llvm::CallInst>(&*inst_bit);
if (!ci)
{
if (auto cf = ci->getCalledFunction())
return std::next(inst_bit);
}
const auto cf = ci->getCalledFunction();
if (!cf)
{
return std::next(inst_bit);
}
std::string_view func_name{cf->getName().data(), cf->getName().size()};
const auto it = m_intrinsics.find(func_name);
if (it == m_intrinsics.end())
{
return std::next(inst_bit);
}
if (!names.empty())
{
llvm_log.trace("cpu_translator::replace_intrinsics(): function '%s' names_size=%d, names[0]=%s", func_name, names.size(), *names.begin());
}
if (names.contains(func_name))
{
fmt::throw_exception("cpu_translator::replace_intrinsics(): Recursion detected at function '%s'!", func_name);
}
names.emplace(std::string(func_name));
// Set insert point after call instruction
// In order to obtain a clear range of the inserted instructions
if (llvm::Instruction* next = ci->getNextNode())
{
m_ir->SetInsertPoint(next);
}
else
{
m_ir->SetInsertPoint(std::addressof(bb));
}
ci->replaceAllUsesWith(it->second(ci));
InstListType::iterator end = m_ir->GetInsertPoint();
for (InstListType::iterator next_it = ci->eraseFromParent(), inner = next_it; inner != end;)
{
if (llvm::isa<llvm::CallInst>(&*inner))
{
if (auto it = m_intrinsics.find(std::string_view(cf->getName().data(), cf->getName().size())); it != m_intrinsics.end())
{
m_ir->SetInsertPoint(ci);
ci->replaceAllUsesWith(it->second(ci));
bit = ci->eraseFromParent();
continue;
}
inner = fix_funcs(inner);
}
else
{
inner++;
}
}
++bit;
// TODO: Simplify in C++23 with 'names.erase(func_name);'
names.erase(ensure(names.find(func_name), FN(x != names.end())));
return end;
};
for (auto bit = bb.begin(); bit != bb.end(); bit = fix_funcs(bit))
{
}
}
}
+91
View File
@@ -0,0 +1,91 @@
#include "stdafx.h"
#include "ErrorCodes.h"
#include "PPUThread.h"
#include "SPUThread.h"
LOG_CHANNEL(sys_log, "SYS");
bool g_log_all_errors = false;
s32 error_code::error_report(s32 result, const logs::message* channel, const char* fmt, const fmt_type_info* sup, const u64* args)
{
static thread_local std::string g_tls_error_str;
static thread_local std::unordered_map<std::string, usz> g_tls_error_stats;
if (!channel)
{
channel = &sys_log.error;
}
if (!sup && !args)
{
if (!fmt)
{
// Report and clean error state
for (auto&& pair : g_tls_error_stats)
{
if (pair.second > 3)
{
channel->operator()("Stat: %s [x%u]", pair.first, pair.second);
}
}
g_tls_error_stats.clear();
return 0;
}
}
ensure(fmt);
const char* func = "Unknown function";
if (auto ppu = get_current_cpu_thread<ppu_thread>())
{
if (auto current = ppu->current_function)
{
func = current;
}
}
else if (auto spu = get_current_cpu_thread<spu_thread>())
{
if (auto current = spu->current_func; current && spu->start_time)
{
func = current;
}
}
// Format log message (use preallocated buffer)
g_tls_error_str.clear();
fmt::append(g_tls_error_str, "'%s' failed with 0x%08x", func, result);
// Add spacer between error and fmt if necessary
if (fmt[0] != ' ')
g_tls_error_str += " : ";
fmt::raw_append(g_tls_error_str, fmt, sup, args);
// Update stats and check log threshold
if (g_log_all_errors) [[unlikely]]
{
if (!g_tls_error_stats.empty())
{
// Report and clean error state
error_report(0, nullptr, nullptr, nullptr, nullptr);
}
channel->operator()("%s", g_tls_error_str);
}
else
{
const auto stat = ++g_tls_error_stats[g_tls_error_str];
if (stat <= 3)
{
channel->operator()("%s [%u]", g_tls_error_str, stat);
}
}
return result;
}
File diff suppressed because it is too large Load Diff
+452 -149
View File
@@ -1,6 +1,8 @@
#pragma once
#include "Emu/Memory/vm_ptr.h"
#include "cellPamf.h" // CellCodecTimeStamp
#include "../lv2/sys_mutex.h"
#include "../lv2/sys_cond.h"
// Error Codes
enum CellAdecError : u32
@@ -222,14 +224,6 @@ enum AudioCodecType : s32
CELL_ADEC_TYPE_ATRAC3MULTI,
};
inline bool adecIsAtracX(s32 type)
{
return type == CELL_ADEC_TYPE_ATRACX
|| type == CELL_ADEC_TYPE_ATRACX_2CH
|| type == CELL_ADEC_TYPE_ATRACX_6CH
|| type == CELL_ADEC_TYPE_ATRACX_8CH;
}
// Output Channel Number
enum CellAdecChannel : s32
{
@@ -259,7 +253,7 @@ enum CellAdecSampleRate : s32
CELL_ADEC_FS_8kHz,
};
enum CellAdecBitLength : s32
enum CellAdecBitLength : u32
{
CELL_ADEC_BIT_LENGTH_RESERVED1,
CELL_ADEC_BIT_LENGTH_16,
@@ -295,14 +289,14 @@ struct CellAdecResourceEx
be_t<u32> ppuThreadPriority;
be_t<u32> ppuThreadStackSize;
be_t<u32> spurs_addr;
u8 priority[8];
be_t<u64, 1> priority;
be_t<u32> maxContention;
};
struct CellAdecResourceSpurs
{
be_t<u32> spurs_addr; // CellSpurs*
u8 priority[8];
be_t<u64, 1> priority;
be_t<u32> maxContention;
};
@@ -315,7 +309,7 @@ enum CellAdecMsgType : s32
CELL_ADEC_MSG_TYPE_SEQDONE,
};
using CellAdecCbMsg = s32(u32 handle, CellAdecMsgType msgType, s32 msgData, u32 cbArg);
using CellAdecCbMsg = s32(vm::ptr<void> handle, CellAdecMsgType msgType, s32 msgData, vm::ptr<void> cbArg);
// Used for internal callbacks as well
template <typename F>
@@ -339,14 +333,14 @@ struct CellAdecAuInfo
// BSI Info
struct CellAdecPcmAttr
{
be_t<u32> bsiInfo_addr;
vm::bptr<void> bsiInfo;
};
struct CellAdecPcmItem
{
be_t<u32> pcmHandle;
be_t<s32> pcmHandle;
be_t<u32> status;
be_t<u32> startAddr;
vm::bcptr<void> startAddr;
be_t<u32> size;
CellAdecPcmAttr pcmAttr;
CellAdecAuInfo auInfo;
@@ -358,41 +352,36 @@ enum AdecCorrectPtsValueType : s8
ADEC_CORRECT_PTS_VALUE_TYPE_UNSPECIFIED = -1,
// Adds a fixed amount
ADEC_CORRECT_PTS_VALUE_TYPE_LPCM = 0,
// 1
ADEC_CORRECT_PTS_VALUE_TYPE_LPCM_HDMV = 0,
ADEC_CORRECT_PTS_VALUE_TYPE_LPCM_DVD = 1, // Unused for some reason, the DVD player probably takes care of timestamps itself
ADEC_CORRECT_PTS_VALUE_TYPE_ATRACX_48000Hz = 2,
ADEC_CORRECT_PTS_VALUE_TYPE_ATRACX_44100Hz = 3,
ADEC_CORRECT_PTS_VALUE_TYPE_ATRACX_32000Hz = 4,
// 5: Dolby Digital
// 6: ATRAC3
// 7: MP3
// 8: MP3
// 9: MP3
// 39: ATRAC3 multi-track
ADEC_CORRECT_PTS_VALUE_TYPE_AC3 = 5,
ADEC_CORRECT_PTS_VALUE_TYPE_ATRAC3 = 6,
ADEC_CORRECT_PTS_VALUE_TYPE_MP3_48000Hz = 7,
ADEC_CORRECT_PTS_VALUE_TYPE_MP3_44100Hz = 8,
ADEC_CORRECT_PTS_VALUE_TYPE_MP3_32000Hz = 9,
ADEC_CORRECT_PTS_VALUE_TYPE_ATRAC3MULTI = 39,
// Calls a decoder function (_SceAdecCorrectPtsValue_codec())
// 17: Dolby Digital Plus
// 18
// 19
// 20
// 21: DTS HD
// 22
// 23
// 24: CELP
// 25: MPEG-2 AAC
// 26: MPEG-2 BC
// 27: Dolby TrueHD
// 28: DTS
// 29: MPEG-4 AAC
// 30: Windows Media Audio
// 31: DTS Express
// 32: MP1
// 33: MP3 Surround
// 34: CELP8
// 35: Windows Media Audio Professional
// 36: Windows Media Audio Lossless
// 37: DTS HD Core
// 38: DTS HD Core
ADEC_CORRECT_PTS_VALUE_TYPE_EAC3 = 17,
ADEC_CORRECT_PTS_VALUE_TYPE_DTSHD = 21,
ADEC_CORRECT_PTS_VALUE_TYPE_CELP = 24,
ADEC_CORRECT_PTS_VALUE_TYPE_M2AAC = 25,
ADEC_CORRECT_PTS_VALUE_TYPE_MPEG_L2 = 26,
ADEC_CORRECT_PTS_VALUE_TYPE_TRUEHD = 27,
ADEC_CORRECT_PTS_VALUE_TYPE_DTS = 28,
ADEC_CORRECT_PTS_VALUE_TYPE_M4AAC = 29,
ADEC_CORRECT_PTS_VALUE_TYPE_WMA = 30,
ADEC_CORRECT_PTS_VALUE_TYPE_DTSLBR = 31,
ADEC_CORRECT_PTS_VALUE_TYPE_MPEG_L1 = 32,
ADEC_CORRECT_PTS_VALUE_TYPE_MP3S = 33,
ADEC_CORRECT_PTS_VALUE_TYPE_CELP8 = 34,
ADEC_CORRECT_PTS_VALUE_TYPE_WMAPRO = 35,
ADEC_CORRECT_PTS_VALUE_TYPE_WMALSL = 36,
ADEC_CORRECT_PTS_VALUE_TYPE_DTSHDCORE_UNK1 = 37,
ADEC_CORRECT_PTS_VALUE_TYPE_DTSHDCORE_UNK2 = 38,
};
// Internal callbacks
@@ -471,6 +460,213 @@ struct AdecCmdQueue
bool full() const { return size >= 4; }
};
struct AdecFrame
{
b8 in_use; // True after issuing a decode command until the frame is consumed
be_t<s32> this_index; // Set when initialized in cellAdecOpen(), unused afterward
// Set when the corresponding callback is received, unused afterward
b8 au_done;
b8 unk1;
b8 pcm_out;
b8 unk2;
CellAdecAuInfo au_info;
CellAdecPcmItem pcm_item;
u32 reserved1;
u32 reserved2;
// Frames that are ready to be consumed form a linked list. However, this list is not used (AdecOutputQueue is used instead)
be_t<s32> next; // Index of the next frame that can be consumed
be_t<s32> prev; // Index of the previous frame that can be consumed
};
CHECK_SIZE(AdecFrame, 0x68);
class AdecOutputQueue
{
struct entry
{
be_t<s32> this_index; // Unused
be_t<s32> state; // 0xff = empty, 0x10 = filled
vm::bptr<CellAdecPcmItem> pcm_item;
be_t<s32> pcm_handle;
}
entries[4];
be_t<s32> front;
be_t<s32> back;
be_t<s32> size;
be_t<u32> mutex; // sys_mutex_t
be_t<u32> cond; // sys_cond_t, unused
public:
void init(ppu_thread& ppu, vm::ptr<AdecOutputQueue> _this)
{
this->front = 0;
this->back = 0;
this->size = 0;
const vm::var<sys_mutex_attribute_t> mutex_attr = {{ SYS_SYNC_PRIORITY, SYS_SYNC_NOT_RECURSIVE, SYS_SYNC_NOT_PROCESS_SHARED, SYS_SYNC_NOT_ADAPTIVE, 0, 0, 0, { "_adem07"_u64 } }};
ensure(sys_mutex_create(ppu, _this.ptr(&AdecOutputQueue::mutex), mutex_attr) == CELL_OK); // Error code isn't checked on LLE
const vm::var<sys_cond_attribute_t> cond_attr = {{ SYS_SYNC_NOT_PROCESS_SHARED, 0, 0, { "_adec05"_u64 } }};
ensure(sys_cond_create(ppu, _this.ptr(&AdecOutputQueue::cond), mutex, cond_attr) == CELL_OK); // Error code isn't checked on LLE
for (s32 i = 0; i < 4; i++)
{
entries[i] = { i, 0xff, vm::null, -1 };
}
}
error_code finalize(ppu_thread& ppu) const
{
if (error_code ret = sys_cond_destroy(ppu, cond); ret != CELL_OK)
{
return ret;
}
if (error_code ret = sys_mutex_destroy(ppu, mutex); ret != CELL_OK)
{
return ret;
}
return CELL_OK;
}
error_code push(ppu_thread& ppu, vm::ptr<CellAdecPcmItem> pcm_item, s32 pcm_handle)
{
ensure(sys_mutex_lock(ppu, mutex, 0) == CELL_OK); // Error code isn't checked on LLE
if (entries[back].state != 0xff)
{
ensure(sys_mutex_unlock(ppu, mutex) == CELL_OK); // Error code isn't checked on LLE
return true; // LLE returns the result of the comparison above
}
entries[back].state = 0x10;
entries[back].pcm_item = pcm_item;
entries[back].pcm_handle = pcm_handle;
back = (back + 1) & 3;
size++;
ensure(sys_mutex_unlock(ppu, mutex) == CELL_OK); // Error code isn't checked on LLE
return CELL_OK;
}
const entry* pop(ppu_thread& ppu)
{
ensure(sys_mutex_lock(ppu, mutex, 0) == CELL_OK); // Error code isn't checked on LLE
if (ppu.state & cpu_flag::again) // Savestate was created while waiting on the mutex
{
return {};
}
if (entries[front].state == 0xff)
{
ensure(sys_mutex_unlock(ppu, mutex) == CELL_OK); // Error code isn't checked on LLE
return nullptr;
}
const entry* const ret = &entries[front];
entries[front].state = 0xff;
entries[front].pcm_handle = -1;
front = (front + 1) & 3;
size--;
ensure(sys_mutex_unlock(ppu, mutex) == CELL_OK); // Error code isn't checked on LLE
return ret;
}
const entry& peek(ppu_thread& ppu) const
{
ensure(sys_mutex_lock(ppu, mutex, 0) == CELL_OK); // Error code isn't checked on LLE
const entry& ret = entries[front];
ensure(sys_mutex_unlock(ppu, mutex) == CELL_OK); // Error code isn't checked on LLE
return ret;
}
};
CHECK_SIZE(AdecOutputQueue, 0x54);
enum class AdecSequenceState : u32
{
dormant = 0x100,
ready = 0x200,
closed = 0xa00,
};
struct AdecContext // CellAdecHandle = AdecContext*
{
vm::bptr<AdecContext> _this;
be_t<u32> this_size; // Size of this struct + AdecFrames + bitstream info structs
u32 unk; // Unused
be_t<AdecSequenceState> sequence_state;
CellAdecType type;
CellAdecResource res;
CellAdecCb callback;
vm::bptr<void> core_handle;
vm::bcptr<CellAdecCoreOps> core_ops;
CellCodecTimeStamp previous_pts;
be_t<s32> frames_num;
u32 reserved1;
be_t<s32> frames_head; // Index of the oldest frame that can be consumed
be_t<s32> frames_tail; // Index of the most recent frame that can be consumed
vm::bptr<AdecFrame> frames; // Array of AdecFrames, number of elements is return value of CellAdecCoreOps::getPcmHandleNum
be_t<u32> bitstream_info_size;
sys_mutex_attribute_t mutex_attribute;
be_t<u32> mutex; // sys_mutex_t
AdecOutputQueue pcm_queue; // Output queue for cellAdecGetPcm()
AdecOutputQueue pcm_item_queue; // Output queue for cellAdecGetPcmItem()
u8 reserved2[1028];
[[nodiscard]] error_code get_new_pcm_handle(vm::ptr<CellAdecAuInfo> au_info) const;
error_code verify_pcm_handle(s32 pcm_handle) const;
vm::ptr<CellAdecAuInfo> get_au_info(s32 pcm_handle) const;
void set_state(s32 pcm_handle, u32 state) const;
error_code get_pcm_item(s32 pcm_handle, vm::ptr<CellAdecPcmItem>& pcm_item) const;
error_code set_pcm_item(s32 pcm_handle, vm::ptr<void> pcm_addr, u32 pcm_size, vm::cpptr<void> bitstream_info) const;
error_code link_frame(ppu_thread& ppu, s32 pcm_handle);
error_code unlink_frame(ppu_thread& ppu, s32 pcm_handle);
void reset_frame(s32 pcm_handle) const;
error_code correct_pts_value(ppu_thread& ppu, s32 pcm_handle, s8 correct_pts_type);
};
static_assert(std::is_standard_layout_v<AdecContext> && std::is_trivial_v<AdecContext>);
CHECK_SIZE_ALIGN(AdecContext, 0x530, 8);
enum : u32
{
CELL_ADEC_LPCM_DVD_CH_RESERVED1,
CELL_ADEC_LPCM_DVD_CH_MONO,
CELL_ADEC_LPCM_DVD_CH_RESERVED2,
CELL_ADEC_LPCM_DVD_CH_STEREO,
CELL_ADEC_LPCM_DVD_CH_UNK1, // Either 3 front or 2 front + 1 surround
CELL_ADEC_LPCM_DVD_CH_UNK2, // Either 3 front + 1 surround or 2 front + 2 surround
CELL_ADEC_LPCM_DVD_CH_3_2,
CELL_ADEC_LPCM_DVD_CH_3_2_LFE,
CELL_ADEC_LPCM_DVD_CH_3_4,
CELL_ADEC_LPCM_DVD_CH_3_4_LFE,
};
struct CellAdecParamLpcm
{
be_t<u32> channelNumber;
@@ -487,6 +683,216 @@ struct CellAdecLpcmInfo
be_t<u32> outputDataSize;
};
// HLE exclusive, for savestates
enum class lpcm_dec_state : u8
{
waiting_for_cmd_mutex_lock,
waiting_for_cmd_cond_wait,
waiting_for_output_mutex_lock,
waiting_for_output_cond_wait,
queue_mutex_lock,
executing_cmd
};
class LpcmDecSemaphore
{
be_t<u32> value;
be_t<u32> mutex; // sys_mutex_t
be_t<u32> cond; // sys_cond_t
public:
error_code init(ppu_thread& ppu, vm::ptr<LpcmDecSemaphore> _this, u32 initial_value)
{
value = initial_value;
const vm::var<sys_mutex_attribute_t> mutex_attr{{ SYS_SYNC_PRIORITY, SYS_SYNC_NOT_RECURSIVE, SYS_SYNC_NOT_PROCESS_SHARED, SYS_SYNC_NOT_ADAPTIVE, 0, 0, 0, { "_adem01"_u64 } }};
const vm::var<sys_cond_attribute_t> cond_attr{{ SYS_SYNC_NOT_PROCESS_SHARED, 0, 0, { "_adec01"_u64 } }};
if (error_code ret = sys_mutex_create(ppu, _this.ptr(&LpcmDecSemaphore::mutex), mutex_attr); ret != CELL_OK)
{
return ret;
}
return sys_cond_create(ppu, _this.ptr(&LpcmDecSemaphore::cond), mutex, cond_attr);
}
error_code finalize(ppu_thread& ppu) const
{
if (error_code ret = sys_cond_destroy(ppu, cond); ret != CELL_OK)
{
return ret;
}
return sys_mutex_destroy(ppu, mutex);
}
error_code release(ppu_thread& ppu)
{
if (error_code ret = sys_mutex_lock(ppu, mutex, 0); ret != CELL_OK)
{
return ret;
}
value++;
if (error_code ret = sys_cond_signal(ppu, cond); ret != CELL_OK)
{
return ret; // LLE doesn't unlock the mutex
}
return sys_mutex_unlock(ppu, mutex);
}
error_code acquire(ppu_thread& ppu, lpcm_dec_state& savestate)
{
if (savestate == lpcm_dec_state::waiting_for_cmd_cond_wait)
{
goto cond_wait;
}
savestate = lpcm_dec_state::waiting_for_cmd_mutex_lock;
if (error_code ret = sys_mutex_lock(ppu, mutex, 0); ret != CELL_OK)
{
return ret;
}
if (ppu.state & cpu_flag::again)
{
return {};
}
if (value == 0u)
{
savestate = lpcm_dec_state::waiting_for_cmd_cond_wait;
cond_wait:
if (error_code ret = sys_cond_wait(ppu, cond, 0); ret != CELL_OK)
{
return ret; // LLE doesn't unlock the mutex
}
if (ppu.state & cpu_flag::again)
{
return {};
}
}
value--;
return sys_mutex_unlock(ppu, mutex);
}
};
CHECK_SIZE(LpcmDecSemaphore, 0xc);
enum class LpcmDecCmdType : u32
{
start_seq,
end_seq,
decode_au,
close
};
struct LpcmDecCmd
{
be_t<s32> pcm_handle;
vm::bcptr<void> au_start_addr;
be_t<u32> au_size;
u32 reserved1[2];
CellAdecParamLpcm lpcm_param;
be_t<LpcmDecCmdType> type;
u32 reserved2;
LpcmDecCmd() = default; // cellAdecOpen()
LpcmDecCmd(LpcmDecCmdType&& type) // End sequence
: type(type)
{
}
LpcmDecCmd(LpcmDecCmdType&& type, const CellAdecParamLpcm& lpcm_param) // Start sequence
: lpcm_param(lpcm_param), type(type)
{
}
LpcmDecCmd(LpcmDecCmdType&& type, const s32& pcm_handle, const CellAdecAuInfo& au_info) // Decode au
: pcm_handle(pcm_handle), au_start_addr(au_info.startAddr), au_size(au_info.size), type(type)
{
}
};
CHECK_SIZE(LpcmDecCmd, 0x2c);
struct LpcmDecContext
{
AdecCmdQueue<LpcmDecCmd> cmd_queue;
be_t<u64> thread_id; // sys_ppu_thread_t
be_t<u32> queue_size_mutex; // sys_mutex_t
be_t<u32> queue_size_cond; // sys_cond_t, unused
be_t<u32> unk_mutex; // sys_mutex_t, unused
be_t<u32> unk_cond; // sys_cond_t, unused
be_t<u32> run_thread;
AdecCb<AdecNotifyAuDone> notify_au_done;
AdecCb<AdecNotifyPcmOut> notify_pcm_out;
AdecCb<AdecNotifyError> notify_error;
AdecCb<AdecNotifySeqDone> notify_seq_done;
be_t<u32> output_locked;
vm::bptr<f32> output;
vm::bptr<CellAdecParamLpcm> lpcm_param;
vm::bcptr<void> spurs_cmd_data;
// HLE exclusive
lpcm_dec_state savestate;
u64 cmd_counter; // For debugging
u8 reserved1[24]; // 36 bytes on LLE
be_t<u32> output_mutex; // sys_mutex_t
be_t<u32> output_consumed; // sys_cond_t
LpcmDecSemaphore cmd_available;
LpcmDecSemaphore reserved2; // Unused
be_t<u32> queue_mutex; // sys_mutex_t
be_t<u32> error_occurred;
u8 spurs_stuff[32];
be_t<u32> spurs_queue_pop_mutex;
be_t<u32> spurs_queue_push_mutex;
be_t<u32> using_existing_spurs_instance;
be_t<u32> dvd_packing;
be_t<u32> output_size;
LpcmDecCmd cmd; // HLE exclusive, name of Spurs taskset (32 bytes) + CellSpursTaskLsPattern on LLE
u8 more_spurs_stuff[10]; // 52 bytes on LLE
void exec(ppu_thread& ppu);
template <LpcmDecCmdType type>
error_code send_command(ppu_thread& ppu, auto&&... args);
inline error_code release_output(ppu_thread& ppu);
};
static_assert(std::is_standard_layout_v<LpcmDecContext>);
CHECK_SIZE_ALIGN(LpcmDecContext, 0x1c8, 8);
constexpr s32 LPCM_DEC_OUTPUT_BUFFER_SIZE = 0x40000;
// CELP Excitation Mode
enum CELP_ExcitationMode : s32
{
@@ -1024,106 +1430,3 @@ struct CellAdecMpmcInfo
be_t<u32> lfePresent;
be_t<u32> channelCoufiguration;
};
/* Audio Decoder Thread Classes */
enum AdecJobType : u32
{
adecStartSeq,
adecEndSeq,
adecDecodeAu,
adecClose,
};
struct AdecTask
{
AdecJobType type;
union
{
struct
{
u32 auInfo_addr;
u32 addr;
u32 size;
u64 pts;
u64 userdata;
} au;
struct
{
s32 sample_rate;
s32 channel_config;
s32 channels;
s32 frame_size;
std::array<u8, 4> extra_config;
s32 output;
u8 downmix;
u8 ats_header;
} at3p;
};
AdecTask(AdecJobType type)
: type(type)
{
}
AdecTask()
{
}
};
struct AdecFrame
{
struct AVFrame* data;
u64 pts;
u64 userdata;
u32 auAddr;
u32 auSize;
u32 size;
};
int adecRead(void* opaque, u8* buf, int buf_size);
static const u32 at3freq[8] = { 32000, 44100, 48000, 88200, 96000, 0, 0, 0 };
struct OMAHeader // OMA Header
{
u32 magic; // 0x01334145
u16 size; // 96 << 8
u16 unk0; // 0xffff
u64 unk1; // 0x00500f0100000000ULL
u64 unk2; // 0xcef5000000000400ULL
u64 unk3; // 0x1c458024329192d2ULL
u8 codecId; // 1 for ATRAC3P
u8 code0; // 0
u8 code1;
u8 code2;
u32 reserved[15]; // 0
OMAHeader(u8 codec_id, u32 freq, u8 channel_count, u32 frame_size)
: magic(0x01334145)
, size(96 << 8)
, unk0(0xffff)
, unk1(0x00500f0100000000ULL)
, unk2(0xcef5000000000400ULL)
, unk3(0x1c458024329192d2ULL)
, codecId(codec_id)
, code0(0)
{
memset(reserved, 0, sizeof(reserved));
u8 freq_code;
for (freq_code = 0; freq_code < 5; freq_code++)
{
if (at3freq[freq_code] == freq)
{
break;
}
}
u32 prepared_frame_size = (frame_size - 8) / 8;
code1 = ((prepared_frame_size >> 8) & 0x3) | ((channel_count & 0x7) << 2) | (freq_code << 5);
code2 = prepared_frame_size & 0xff;
}
};
CHECK_SIZE(OMAHeader, 96);
+172 -55
View File
@@ -270,35 +270,75 @@ void AtracXdecContext::exec(ppu_thread& ppu)
decoder.init_avcodec();
}
switch (savestate)
{
case atracxdec_state::initial: break;
case atracxdec_state::waiting_for_cmd: goto label1_wait_for_cmd_state;
case atracxdec_state::checking_run_thread_1: goto label2_check_run_thread_1_state;
case atracxdec_state::executing_cmd: goto label3_execute_cmd_state;
case atracxdec_state::waiting_for_output: goto label4_wait_for_output_state;
case atracxdec_state::checking_run_thread_2: goto label5_check_run_thread_2_state;
case atracxdec_state::decoding: goto label6_decode_state;
}
for (;;cmd_counter++)
{
cellAtracXdec.trace("Command counter: %llu, waiting for next command...", cmd_counter);
if (!skip_getting_command)
for (;;)
{
lv2_obj::sleep(ppu);
std::lock_guard lock{queue_mutex};
savestate = atracxdec_state::initial;
while (cmd_queue.empty() && !ppu.is_stopped())
{
lv2_obj::sleep(ppu);
queue_not_empty.wait(queue_mutex, 20000);
}
ensure(sys_mutex_lock(ppu, queue_mutex, 0) == CELL_OK);
if (ppu.is_stopped())
{
ppu.state += cpu_flag::again;
return;
}
cmd_queue.pop(cmd);
if (!run_thread)
if (ppu.state & cpu_flag::again)
{
return;
}
if (!cmd_queue.empty())
{
break;
}
savestate = atracxdec_state::waiting_for_cmd;
label1_wait_for_cmd_state:
ensure(sys_cond_wait(ppu, queue_not_empty, 0) == CELL_OK);
if (ppu.state & cpu_flag::again)
{
return;
}
ensure(sys_mutex_unlock(ppu, queue_mutex) == CELL_OK);
}
cmd_queue.pop(cmd);
ensure(sys_mutex_unlock(ppu, queue_mutex) == CELL_OK);
savestate = atracxdec_state::checking_run_thread_1;
label2_check_run_thread_1_state:
ensure(sys_mutex_lock(ppu, run_thread_mutex, 0) == CELL_OK);
if (ppu.state & cpu_flag::again)
{
return;
}
if (!run_thread)
{
ensure(sys_mutex_unlock(ppu, run_thread_mutex) == CELL_OK);
return;
}
ensure(sys_mutex_unlock(ppu, run_thread_mutex) == CELL_OK);
savestate = atracxdec_state::executing_cmd;
label3_execute_cmd_state:
cellAtracXdec.trace("Command type: %d", static_cast<u32>(cmd.type.get()));
switch (cmd.type)
@@ -327,8 +367,6 @@ void AtracXdecContext::exec(ppu_thread& ppu)
}
case AtracXdecCmdType::end_seq:
{
skip_getting_command = true;
// Block savestate creation during callbacks
std::unique_lock savestate_lock{g_fxo->get<hle_locks_t>(), std::try_to_lock};
@@ -338,41 +376,59 @@ void AtracXdecContext::exec(ppu_thread& ppu)
return;
}
skip_getting_command = false;
// Doesn't do anything else
notify_seq_done.cbFunc(ppu, notify_seq_done.cbArg);
break;
}
case AtracXdecCmdType::decode_au:
{
skip_getting_command = true;
ensure(!!cmd.au_start_addr); // Not checked on LLE
cellAtracXdec.trace("Waiting for output to be consumed...");
lv2_obj::sleep(ppu);
std::unique_lock output_mutex_lock{output_mutex};
ensure(sys_mutex_lock(ppu, output_mutex, 0) == CELL_OK);
while (output_locked && !ppu.is_stopped())
if (ppu.state & cpu_flag::again)
{
lv2_obj::sleep(ppu);
output_consumed.wait(output_mutex, 20000);
return;
}
if (ppu.is_stopped())
while (output_locked)
{
savestate = atracxdec_state::waiting_for_output;
label4_wait_for_output_state:
ensure(sys_cond_wait(ppu, output_consumed, 0) == CELL_OK);
if (ppu.state & cpu_flag::again)
{
return;
}
}
cellAtracXdec.trace("Output consumed");
savestate = atracxdec_state::checking_run_thread_2;
label5_check_run_thread_2_state:
ensure(sys_mutex_lock(ppu, run_thread_mutex, 0) == CELL_OK);
if (ppu.state & cpu_flag::again)
{
ppu.state += cpu_flag::again;
return;
}
if (!run_thread)
{
ensure(sys_mutex_unlock(ppu, run_thread_mutex) == CELL_OK);
ensure(sys_mutex_unlock(ppu, output_mutex) == CELL_OK);
return;
}
cellAtracXdec.trace("Output consumed");
ensure(sys_mutex_unlock(ppu, run_thread_mutex) == CELL_OK);
savestate = atracxdec_state::decoding;
label6_decode_state:
u32 error = CELL_OK;
@@ -578,14 +634,12 @@ void AtracXdecContext::exec(ppu_thread& ppu)
return;
}
skip_getting_command = false;
// au_done and pcm_out callbacks are always called after a decode command, even if an error occurred
// The output always has to be consumed as well
notify_au_done.cbFunc(ppu, cmd.pcm_handle, notify_au_done.cbArg);
output_locked = true;
output_mutex_lock.unlock();
ensure(sys_mutex_unlock(ppu, output_mutex) == CELL_OK);
const u32 output_size = decoded_samples_num * (decoder.bw_pcm & 0x7fu) * decoder.nch_out;
@@ -614,29 +668,46 @@ void AtracXdecContext::exec(ppu_thread& ppu)
template <AtracXdecCmdType type>
error_code AtracXdecContext::send_command(ppu_thread& ppu, auto&&... args)
{
ppu.state += cpu_flag::wait;
auto& savestate = *ppu.optional_savestate_state;
const bool signal = savestate.try_read<bool>().second;
savestate.clear();
if (!signal)
{
std::lock_guard lock{queue_mutex};
ensure(sys_mutex_lock(ppu, queue_mutex, 0) == CELL_OK);
if (ppu.state & cpu_flag::again)
{
return {};
}
if constexpr (type == AtracXdecCmdType::close)
{
// Close command is only sent if the queue is empty on LLE
if (!cmd_queue.empty())
{
ensure(sys_mutex_unlock(ppu, queue_mutex) == CELL_OK);
return {};
}
}
if (cmd_queue.full())
{
ensure(sys_mutex_unlock(ppu, queue_mutex) == CELL_OK);
return CELL_ADEC_ERROR_ATX_BUSY;
}
cmd_queue.emplace(std::forward<AtracXdecCmdType>(type), std::forward<decltype(args)>(args)...);
ensure(sys_mutex_unlock(ppu, queue_mutex) == CELL_OK);
}
queue_not_empty.notify_one();
ensure(sys_cond_signal(ppu, queue_not_empty) == CELL_OK);
if (ppu.state & cpu_flag::again)
{
savestate(true);
}
return CELL_OK;
}
@@ -699,6 +770,29 @@ error_code _CellAdecCoreOpOpenExt_atracx(ppu_thread& ppu, vm::ptr<AtracXdecConte
write_to_ptr(handle.get_ptr(), AtracXdecContext(notifyAuDone, notifyAuDoneArg, notifyPcmOut, notifyPcmOutArg, notifyError, notifyErrorArg, notifySeqDone, notifySeqDoneArg,
vm::bptr<u8>::make(handle.addr() + utils::align(static_cast<u32>(sizeof(AtracXdecContext)), 0x80) + ATXDEC_SPURS_STRUCTS_SIZE)));
const vm::var<sys_mutex_attribute_t> mutex_attr{{ SYS_SYNC_PRIORITY, SYS_SYNC_NOT_RECURSIVE, SYS_SYNC_NOT_PROCESS_SHARED, SYS_SYNC_NOT_ADAPTIVE, 0, 0, 0, { "_atd001"_u64 } }};
const vm::var<sys_cond_attribute_t> cond_attr{{ SYS_SYNC_NOT_PROCESS_SHARED, 0, 0, { "_atd002"_u64 } }};
ensure(sys_mutex_create(ppu, handle.ptr(&AtracXdecContext::queue_mutex), mutex_attr) == CELL_OK);
ensure(sys_cond_create(ppu, handle.ptr(&AtracXdecContext::queue_not_empty), handle->queue_mutex, cond_attr) == CELL_OK);
mutex_attr->name_u64 = "_atd003"_u64;
cond_attr->name_u64 = "_atd004"_u64;
ensure(sys_mutex_create(ppu, handle.ptr(&AtracXdecContext::run_thread_mutex), mutex_attr) == CELL_OK);
ensure(sys_cond_create(ppu, handle.ptr(&AtracXdecContext::run_thread_cond), handle->run_thread_mutex, cond_attr) == CELL_OK);
mutex_attr->name_u64 = "_atd005"_u64;
cond_attr->name_u64 = "_atd006"_u64;
ensure(sys_mutex_create(ppu, handle.ptr(&AtracXdecContext::output_mutex), mutex_attr) == CELL_OK);
ensure(sys_cond_create(ppu, handle.ptr(&AtracXdecContext::output_consumed), handle->output_mutex, cond_attr) == CELL_OK);
ensure(sys_mutex_lock(ppu, handle->output_mutex, 0) == CELL_OK);
handle->output_locked = false;
ensure(sys_cond_signal(ppu, handle->output_consumed) == CELL_OK);
ensure(sys_mutex_unlock(ppu, handle->output_mutex) == CELL_OK);
const vm::var<char[]> _name = vm::make_str("HLE ATRAC3plus decoder");
const auto entry = g_fxo->get<ppu_function_manager>().func_addr(FIND_FUNC(atracXdecEntry));
ppu_execute<&sys_ppu_thread_create>(ppu, handle.ptr(&AtracXdecContext::thread_id), entry, handle.addr(), +res->ppuThreadPriority, +res->ppuThreadStackSize, SYS_PPU_THREAD_CREATE_JOINABLE, +_name);
@@ -725,29 +819,32 @@ error_code _CellAdecCoreOpClose_atracx(ppu_thread& ppu, vm::ptr<AtracXdecContext
return {};
}
ppu.state += cpu_flag::wait;
cellAtracXdec.notice("_CellAdecCoreOpClose_atracx(handle=*0x%x)", handle);
ensure(!!handle); // Not checked on LLE
ensure(sys_mutex_lock(ppu, handle->run_thread_mutex, 0) == CELL_OK);
handle->run_thread = false;
ensure(sys_mutex_unlock(ppu, handle->run_thread_mutex) == CELL_OK);
handle->send_command<AtracXdecCmdType::close>(ppu);
{
std::lock_guard lock{handle->output_mutex};
handle->output_locked = false;
}
ensure(sys_mutex_lock(ppu, handle->output_mutex, 0) == CELL_OK);
handle->output_locked = false;
ensure(sys_mutex_unlock(ppu, handle->output_mutex) == CELL_OK);
ensure(sys_cond_signal(ppu, handle->output_consumed) == CELL_OK);
handle->output_consumed.notify_one();
vm::var<u64> thread_ret;
ensure(sys_ppu_thread_join(ppu, static_cast<u32>(handle->thread_id), +thread_ret) == CELL_OK);
if (vm::var<u64> ret; sys_ppu_thread_join(ppu, static_cast<u32>(handle->thread_id), +ret) != CELL_OK)
{
// Other thread already closed the decoder
return CELL_ADEC_ERROR_FATAL;
}
error_code ret = sys_cond_destroy(ppu, handle->queue_not_empty);
ret = ret ? ret : sys_cond_destroy(ppu, handle->run_thread_cond);
ret = ret ? ret : sys_cond_destroy(ppu, handle->output_consumed);
ret = ret ? ret : sys_mutex_destroy(ppu, handle->queue_mutex);
ret = ret ? ret : sys_mutex_destroy(ppu, handle->run_thread_mutex);
ret = ret ? ret : sys_mutex_destroy(ppu, handle->output_mutex);
return CELL_OK;
return ret != CELL_OK ? static_cast<error_code>(CELL_ADEC_ERROR_FATAL) : CELL_OK;
}
error_code _CellAdecCoreOpStartSeq_atracx(ppu_thread& ppu, vm::ptr<AtracXdecContext> handle, vm::cptr<CellAdecParamAtracX> atracxParam)
@@ -808,15 +905,35 @@ error_code _CellAdecCoreOpRealign_atracx(vm::ptr<AtracXdecContext> handle, vm::p
error_code _CellAdecCoreOpReleasePcm_atracx(ppu_thread& ppu, vm::ptr<AtracXdecContext> handle, s32 pcmHandle, vm::cptr<void> outBuffer)
{
ppu.state += cpu_flag::wait;
cellAtracXdec.trace("_CellAdecCoreOpReleasePcm_atracx(handle=*0x%x, pcmHandle=%d, outBuffer=*0x%x)", handle, pcmHandle, outBuffer);
ensure(!!handle); // Not checked on LLE
std::lock_guard lock{handle->output_mutex};
handle->output_locked = false;
handle->output_consumed.notify_one();
auto& savestate = *ppu.optional_savestate_state;
const bool signal = savestate.try_read<bool>().second;
savestate.clear();
if (!signal)
{
ensure(sys_mutex_lock(ppu, handle->output_mutex, 0) == CELL_OK);
if (ppu.state & cpu_flag::again)
{
return {};
}
handle->output_locked = false;
}
ensure(sys_cond_signal(ppu, handle->output_consumed) == CELL_OK);
if (ppu.state & cpu_flag::again)
{
savestate(true);
return {};
}
ensure(sys_mutex_unlock(ppu, handle->output_mutex) == CELL_OK);
return CELL_OK;
}
+20 -9
View File
@@ -20,7 +20,6 @@ constexpr int averror_eof = AVERROR_EOF; // Workaround for old-style-cast error
#pragma GCC diagnostic pop
#endif
#include "Utilities/cond.h"
#include "cellPamf.h"
#include "cellAdec.h"
@@ -215,16 +214,28 @@ struct AtracXdecDecoder
CHECK_SIZE(AtracXdecDecoder, 0xa8);
// HLE exclusive, for savestates
enum class atracxdec_state : u8
{
initial,
waiting_for_cmd,
checking_run_thread_1,
executing_cmd,
waiting_for_output,
checking_run_thread_2,
decoding
};
struct AtracXdecContext
{
be_t<u64> thread_id; // sys_ppu_thread_t
shared_mutex queue_mutex; // sys_mutex_t
cond_variable queue_not_empty; // sys_cond_t
be_t<u32> queue_mutex; // sys_mutex_t
be_t<u32> queue_not_empty; // sys_cond_t
AdecCmdQueue<AtracXdecCmd> cmd_queue;
shared_mutex output_mutex; // sys_mutex_t
cond_variable output_consumed; // sys_cond_t
be_t<u32> output_mutex; // sys_mutex_t
be_t<u32> output_consumed; // sys_cond_t
be_t<u32> output_locked = false;
be_t<u32> run_thread_mutex; // sys_mutex_t
@@ -239,10 +250,10 @@ struct AtracXdecContext
const vm::bptr<u8> work_mem;
// HLE exclusive
u64 cmd_counter = 0; // For debugging
AtracXdecCmd cmd; // For savestates; if savestate was created while processing a decode command, we need to save the current command
b8 skip_getting_command = false; // For savestates; skips getting a new command from the queue
b8 skip_next_frame; // Needed to emulate behavior of LLE SPU program, it doesn't output the first frame after a sequence reset or error
u64 cmd_counter = 0; // For debugging
AtracXdecCmd cmd; // For savestates; if savestate was created while processing a decode command, we need to save the current command
atracxdec_state savestate{}; // For savestates
b8 skip_next_frame; // Needed to emulate behavior of LLE SPU program, it doesn't output the first frame after a sequence reset or error
u8 spurs_stuff[58]; // 120 bytes on LLE, pointers to CellSpurs, CellSpursTaskset, etc.
+3 -2
View File
@@ -1,6 +1,7 @@
#include "stdafx.h"
#include "Emu/System.h"
#include "Emu/system_config.h"
#include "Emu/Audio/audio_utils.h"
#include "Emu/Cell/PPUModule.h"
#include "Emu/Cell/lv2/sys_process.h"
#include "Emu/Cell/lv2/sys_event.h"
@@ -556,7 +557,7 @@ void cell_audio_thread::advance(u64 timestamp)
m_dynamic_period = 0;
// send aftermix event (normal audio event)
std::array<std::shared_ptr<lv2_event_queue>, MAX_AUDIO_EVENT_QUEUES> queues;
std::array<shared_ptr<lv2_event_queue>, MAX_AUDIO_EVENT_QUEUES> queues;
u32 queue_count = 0;
event_period++;
@@ -1041,7 +1042,7 @@ void cell_audio_thread::mix(float* out_buffer, s32 offset)
constexpr u32 out_channels = static_cast<u32>(channels);
constexpr u32 out_buffer_sz = out_channels * AUDIO_BUFFER_SAMPLES;
const float master_volume = g_cfg.audio.volume / 100.0f;
const float master_volume = audio::get_volume();
// Reset out_buffer
std::memset(out_buffer, 0, out_buffer_sz * sizeof(float));
+1 -1
View File
@@ -400,7 +400,7 @@ public:
u32 flags = 0; // iFlags
u64 source = 0; // Event source
u64 ack_timestamp = 0; // timestamp of last call of cellAudioSendAck
std::shared_ptr<lv2_event_queue> port{}; // Underlying event port
shared_ptr<lv2_event_queue> port{}; // Underlying event port
};
std::vector<key_info> keys{};
+7 -7
View File
@@ -784,26 +784,26 @@ s32 cellCameraIsAttached(s32 dev_num)
if (g_cfg.io.camera == camera_handler::null)
{
return false;
return 0;
}
auto& g_camera = g_fxo->get<camera_thread>();
if (!g_camera.init)
{
return false;
return 0;
}
if (!check_dev_num(dev_num))
{
return false;
return 0;
}
vm::var<s32> type;
if (cellCameraGetType(dev_num, type) != CELL_OK)
{
return false;
return 0;
}
std::lock_guard lock(g_camera.mutex);
@@ -821,12 +821,12 @@ s32 cellCameraIsAttached(s32 dev_num)
}
}
return is_attached;
return is_attached ? 1 : 0;
}
s32 cellCameraIsOpen(s32 dev_num)
{
cellCamera.notice("cellCameraIsOpen(dev_num=%d)", dev_num);
cellCamera.trace("cellCameraIsOpen(dev_num=%d)", dev_num);
if (g_cfg.io.camera == camera_handler::null)
{
@@ -852,7 +852,7 @@ s32 cellCameraIsOpen(s32 dev_num)
s32 cellCameraIsStarted(s32 dev_num)
{
cellCamera.notice("cellCameraIsStarted(dev_num=%d)", dev_num);
cellCamera.trace("cellCameraIsStarted(dev_num=%d)", dev_num);
if (g_cfg.io.camera == camera_handler::null)
{
+14 -16
View File
@@ -1031,7 +1031,7 @@ error_code cellDmuxClose(u32 handle)
{
cellDmux.warning("cellDmuxClose(handle=0x%x)", handle);
const auto dmux = idm::get<Demuxer>(handle);
const auto dmux = idm::get_unlocked<Demuxer>(handle);
if (!dmux)
{
@@ -1060,7 +1060,7 @@ error_code cellDmuxSetStream(u32 handle, u32 streamAddress, u32 streamSize, b8 d
{
cellDmux.trace("cellDmuxSetStream(handle=0x%x, streamAddress=0x%x, streamSize=%d, discontinuity=%d, userData=0x%llx)", handle, streamAddress, streamSize, discontinuity, userData);
const auto dmux = idm::get<Demuxer>(handle);
const auto dmux = idm::get_unlocked<Demuxer>(handle);
if (!dmux)
{
@@ -1088,7 +1088,7 @@ error_code cellDmuxResetStream(u32 handle)
{
cellDmux.warning("cellDmuxResetStream(handle=0x%x)", handle);
const auto dmux = idm::get<Demuxer>(handle);
const auto dmux = idm::get_unlocked<Demuxer>(handle);
if (!dmux)
{
@@ -1103,7 +1103,7 @@ error_code cellDmuxResetStreamAndWaitDone(u32 handle)
{
cellDmux.warning("cellDmuxResetStreamAndWaitDone(handle=0x%x)", handle);
const auto dmux = idm::get<Demuxer>(handle);
const auto dmux = idm::get_unlocked<Demuxer>(handle);
if (!dmux)
{
@@ -1164,7 +1164,7 @@ error_code cellDmuxEnableEs(u32 handle, vm::cptr<CellCodecEsFilterId> esFilterId
{
cellDmux.warning("cellDmuxEnableEs(handle=0x%x, esFilterId=*0x%x, esResourceInfo=*0x%x, esCb=*0x%x, esSpecificInfo=*0x%x, esHandle=*0x%x)", handle, esFilterId, esResourceInfo, esCb, esSpecificInfo, esHandle);
const auto dmux = idm::get<Demuxer>(handle);
const auto dmux = idm::get_unlocked<Demuxer>(handle);
if (!dmux)
{
@@ -1175,7 +1175,7 @@ error_code cellDmuxEnableEs(u32 handle, vm::cptr<CellCodecEsFilterId> esFilterId
const auto es = idm::make_ptr<ElementaryStream>(dmux.get(), esResourceInfo->memAddr, esResourceInfo->memSize,
esFilterId->filterIdMajor, esFilterId->filterIdMinor, esFilterId->supplementalInfo1, esFilterId->supplementalInfo2,
esCb->cbEsMsgFunc, esCb->cbArg, esSpecificInfo);
esCb->cbFunc, esCb->cbArg, esSpecificInfo);
*esHandle = es->id;
@@ -1194,7 +1194,7 @@ error_code cellDmuxDisableEs(u32 esHandle)
{
cellDmux.warning("cellDmuxDisableEs(esHandle=0x%x)", esHandle);
const auto es = idm::get<ElementaryStream>(esHandle);
const auto es = idm::get_unlocked<ElementaryStream>(esHandle);
if (!es)
{
@@ -1213,7 +1213,7 @@ error_code cellDmuxResetEs(u32 esHandle)
{
cellDmux.trace("cellDmuxResetEs(esHandle=0x%x)", esHandle);
const auto es = idm::get<ElementaryStream>(esHandle);
const auto es = idm::get_unlocked<ElementaryStream>(esHandle);
if (!es)
{
@@ -1232,7 +1232,7 @@ error_code cellDmuxGetAu(u32 esHandle, vm::ptr<u32> auInfo, vm::ptr<u32> auSpeci
{
cellDmux.trace("cellDmuxGetAu(esHandle=0x%x, auInfo=**0x%x, auSpecificInfo=**0x%x)", esHandle, auInfo, auSpecificInfo);
const auto es = idm::get<ElementaryStream>(esHandle);
const auto es = idm::get_unlocked<ElementaryStream>(esHandle);
if (!es)
{
@@ -1255,7 +1255,7 @@ error_code cellDmuxPeekAu(u32 esHandle, vm::ptr<u32> auInfo, vm::ptr<u32> auSpec
{
cellDmux.trace("cellDmuxPeekAu(esHandle=0x%x, auInfo=**0x%x, auSpecificInfo=**0x%x)", esHandle, auInfo, auSpecificInfo);
const auto es = idm::get<ElementaryStream>(esHandle);
const auto es = idm::get_unlocked<ElementaryStream>(esHandle);
if (!es)
{
@@ -1278,7 +1278,7 @@ error_code cellDmuxGetAuEx(u32 esHandle, vm::ptr<u32> auInfoEx, vm::ptr<u32> auS
{
cellDmux.trace("cellDmuxGetAuEx(esHandle=0x%x, auInfoEx=**0x%x, auSpecificInfo=**0x%x)", esHandle, auInfoEx, auSpecificInfo);
const auto es = idm::get<ElementaryStream>(esHandle);
const auto es = idm::get_unlocked<ElementaryStream>(esHandle);
if (!es)
{
@@ -1301,7 +1301,7 @@ error_code cellDmuxPeekAuEx(u32 esHandle, vm::ptr<u32> auInfoEx, vm::ptr<u32> au
{
cellDmux.trace("cellDmuxPeekAuEx(esHandle=0x%x, auInfoEx=**0x%x, auSpecificInfo=**0x%x)", esHandle, auInfoEx, auSpecificInfo);
const auto es = idm::get<ElementaryStream>(esHandle);
const auto es = idm::get_unlocked<ElementaryStream>(esHandle);
if (!es)
{
@@ -1324,7 +1324,7 @@ error_code cellDmuxReleaseAu(u32 esHandle)
{
cellDmux.trace("cellDmuxReleaseAu(esHandle=0x%x)", esHandle);
const auto es = idm::get<ElementaryStream>(esHandle);
const auto es = idm::get_unlocked<ElementaryStream>(esHandle);
if (!es)
{
@@ -1342,7 +1342,7 @@ error_code cellDmuxFlushEs(u32 esHandle)
{
cellDmux.warning("cellDmuxFlushEs(esHandle=0x%x)", esHandle);
const auto es = idm::get<ElementaryStream>(esHandle);
const auto es = idm::get_unlocked<ElementaryStream>(esHandle);
if (!es)
{
@@ -1359,8 +1359,6 @@ error_code cellDmuxFlushEs(u32 esHandle)
DECLARE(ppu_module_manager::cellDmux)("cellDmux", []()
{
static ppu_static_module cellDmuxPamf("cellDmuxPamf");
REG_FUNC(cellDmux, cellDmuxQueryAttr);
REG_FUNC(cellDmux, cellDmuxQueryAttr2);
REG_FUNC(cellDmux, cellDmuxOpen);
+58 -8
View File
@@ -195,6 +195,13 @@ struct CellDmuxResourceEx
be_t<u32> maxContention;
};
struct CellDmuxResourceSpurs
{
vm::bptr<void> spurs; // CellSpurs*
be_t<u64, 1> priority;
be_t<u32> maxContention;
};
/*
struct CellDmuxResource2Ex
{
@@ -221,20 +228,20 @@ struct CellDmuxResource2
using CellDmuxCbMsg = u32(u32 demuxerHandle, vm::ptr<CellDmuxMsg> demuxerMsg, u32 cbArg);
struct CellDmuxCb
{
vm::bptr<CellDmuxCbMsg> cbMsgFunc;
be_t<u32> cbArg;
};
using CellDmuxCbEsMsg = u32(u32 demuxerHandle, u32 esHandle, vm::ptr<CellDmuxEsMsg> esMsg, u32 cbArg);
struct CellDmuxEsCb
// Used for internal callbacks as well
template <typename F>
struct DmuxCb
{
vm::bptr<CellDmuxCbEsMsg> cbEsMsgFunc;
vm::bptr<F> cbFunc;
be_t<u32> cbArg;
};
using CellDmuxCb = DmuxCb<CellDmuxCbMsg>;
using CellDmuxEsCb = DmuxCb<CellDmuxCbEsMsg>;
struct CellDmuxAttr
{
be_t<u32> memSize;
@@ -275,3 +282,46 @@ struct CellDmuxAuInfoEx
CellCodecTimeStamp pts;
CellCodecTimeStamp dts;
};
struct CellDmuxPamfAttr;
struct CellDmuxPamfEsAttr;
using DmuxNotifyDemuxDone = error_code(vm::ptr<void>, u32, vm::ptr<void>);
using DmuxNotifyFatalErr = error_code(vm::ptr<void>, u32, vm::ptr<void>);
using DmuxNotifyProgEndCode = error_code(vm::ptr<void>, vm::ptr<void>);
using DmuxEsNotifyAuFound = error_code(vm::ptr<void>, vm::cptr<void>, vm::ptr<void>);
using DmuxEsNotifyFlushDone = error_code(vm::ptr<void>, vm::ptr<void>);
using CellDmuxCoreOpQueryAttr = error_code(vm::cptr<void>, vm::ptr<CellDmuxPamfAttr>);
using CellDmuxCoreOpOpen = error_code(vm::cptr<void>, vm::cptr<CellDmuxResource>, vm::cptr<CellDmuxResourceSpurs>, vm::cptr<DmuxCb<DmuxNotifyDemuxDone>>, vm::cptr<DmuxCb<DmuxNotifyProgEndCode>>, vm::cptr<DmuxCb<DmuxNotifyFatalErr>>, vm::pptr<void>);
using CellDmuxCoreOpClose = error_code(vm::ptr<void>);
using CellDmuxCoreOpResetStream = error_code(vm::ptr<void>);
using CellDmuxCoreOpCreateThread = error_code(vm::ptr<void>);
using CellDmuxCoreOpJoinThread = error_code(vm::ptr<void>);
using CellDmuxCoreOpSetStream = error_code(vm::ptr<void>, vm::cptr<void>, u32, b8, u64);
using CellDmuxCoreOpFreeMemory = error_code(vm::ptr<void>, vm::ptr<void>, u32);
using CellDmuxCoreOpQueryEsAttr = error_code(vm::cptr<void>, vm::cptr<void>, vm::ptr<CellDmuxPamfEsAttr>);
using CellDmuxCoreOpEnableEs = error_code(vm::ptr<void>, vm::cptr<void>, vm::cptr<CellDmuxEsResource>, vm::cptr<DmuxCb<DmuxEsNotifyAuFound>>, vm::cptr<DmuxCb<DmuxEsNotifyFlushDone>>, vm::cptr<void>, vm::pptr<void>);
using CellDmuxCoreOpDisableEs = u32(vm::ptr<void>);
using CellDmuxCoreOpFlushEs = u32(vm::ptr<void>);
using CellDmuxCoreOpResetEs = u32(vm::ptr<void>);
using CellDmuxCoreOpResetStreamAndWaitDone = u32(vm::ptr<void>);
struct CellDmuxCoreOps
{
vm::bptr<CellDmuxCoreOpQueryAttr> queryAttr;
vm::bptr<CellDmuxCoreOpOpen> open;
vm::bptr<CellDmuxCoreOpClose> close;
vm::bptr<CellDmuxCoreOpResetStream> resetStream;
vm::bptr<CellDmuxCoreOpCreateThread> createThread;
vm::bptr<CellDmuxCoreOpJoinThread> joinThread;
vm::bptr<CellDmuxCoreOpSetStream> setStream;
vm::bptr<CellDmuxCoreOpFreeMemory> freeMemory;
vm::bptr<CellDmuxCoreOpQueryEsAttr> queryEsAttr;
vm::bptr<CellDmuxCoreOpEnableEs> enableEs;
vm::bptr<CellDmuxCoreOpDisableEs> disableEs;
vm::bptr<CellDmuxCoreOpFlushEs> flushEs;
vm::bptr<CellDmuxCoreOpResetEs> resetEs;
vm::bptr<CellDmuxCoreOpResetStreamAndWaitDone> resetStreamAndWaitDone;
};
+170
View File
@@ -0,0 +1,170 @@
#include "stdafx.h"
#include "Emu/Cell/PPUModule.h"
#include "Emu/IdManager.h"
#include "cellPamf.h"
#include "cellDmux.h"
#include "cellDmuxPamf.h"
vm::gvar<CellDmuxCoreOps> g_cell_dmux_core_ops_pamf;
vm::gvar<CellDmuxCoreOps> g_cell_dmux_core_ops_raw_es;
LOG_CHANNEL(cellDmuxPamf)
error_code _CellDmuxCoreOpQueryAttr(vm::cptr<CellDmuxPamfSpecificInfo> pamfSpecificInfo, vm::ptr<CellDmuxPamfAttr> pamfAttr)
{
cellDmuxPamf.todo("_CellDmuxCoreOpQueryAttr(pamfSpecificInfo=*0x%x, pamfAttr=*0x%x)", pamfSpecificInfo, pamfAttr);
return CELL_OK;
}
error_code _CellDmuxCoreOpOpen(vm::cptr<CellDmuxPamfSpecificInfo> pamfSpecificInfo, vm::cptr<CellDmuxResource> demuxerResource, vm::cptr<CellDmuxResourceSpurs> demuxerResourceSpurs, vm::cptr<DmuxCb<DmuxNotifyDemuxDone>> notifyDemuxDone,
vm::cptr<DmuxCb<DmuxNotifyProgEndCode>> notifyProgEndCode, vm::cptr<DmuxCb<DmuxNotifyFatalErr>> notifyFatalErr, vm::pptr<void> handle)
{
cellDmuxPamf.todo("_CellDmuxCoreOpOpen(pamfSpecificInfo=*0x%x, demuxerResource=*0x%x, demuxerResourceSpurs=*0x%x, notifyDemuxDone=*0x%x, notifyProgEndCode=*0x%x, notifyFatalErr=*0x%x, handle=**0x%x)",
pamfSpecificInfo, demuxerResource, demuxerResourceSpurs, notifyDemuxDone, notifyProgEndCode, notifyFatalErr, handle);
return CELL_OK;
}
error_code _CellDmuxCoreOpClose(vm::ptr<void> handle)
{
cellDmuxPamf.todo("_CellDmuxCoreOpClose(handle=*0x%x)", handle);
return CELL_OK;
}
error_code _CellDmuxCoreOpResetStream(vm::ptr<void> handle)
{
cellDmuxPamf.todo("_CellDmuxCoreOpResetStream(handle=*0x%x)", handle);
return CELL_OK;
}
error_code _CellDmuxCoreOpCreateThread(vm::ptr<void> handle)
{
cellDmuxPamf.todo("_CellDmuxCoreOpCreateThread(handle=*0x%x)", handle);
return CELL_OK;
}
error_code _CellDmuxCoreOpJoinThread(vm::ptr<void> handle)
{
cellDmuxPamf.todo("_CellDmuxCoreOpJoinThread(handle=*0x%x)", handle);
return CELL_OK;
}
template <bool raw_es>
error_code _CellDmuxCoreOpSetStream(vm::ptr<void> handle, vm::cptr<void> streamAddress, u32 streamSize, b8 discontinuity, u64 userData)
{
cellDmuxPamf.todo("_CellDmuxCoreOpSetStream<raw_es=%d>(handle=*0x%x, streamAddress=*0x%x, streamSize=0x%x, discontinuity=%d, userData=0x%llx)", raw_es, handle, streamAddress, streamSize, +discontinuity, userData);
return CELL_OK;
}
error_code _CellDmuxCoreOpFreeMemory(vm::ptr<void> esHandle, vm::ptr<void> memAddr, u32 memSize)
{
cellDmuxPamf.todo("_CellDmuxCoreOpFreeMemory(esHandle=*0x%x, memAddr=*0x%x, memSize=0x%x)", esHandle, memAddr, memSize);
return CELL_OK;
}
template <bool raw_es>
error_code _CellDmuxCoreOpQueryEsAttr(vm::cptr<void> esFilterId, vm::cptr<void> esSpecificInfo, vm::ptr<CellDmuxPamfEsAttr> attr)
{
cellDmuxPamf.todo("_CellDmuxCoreOpQueryEsAttr<raw_es=%d>(esFilterId=*0x%x, esSpecificInfo=*0x%x, attr=*0x%x)", raw_es, esFilterId, esSpecificInfo, attr);
return CELL_OK;
}
template <bool raw_es>
error_code _CellDmuxCoreOpEnableEs(vm::ptr<void> handle, vm::cptr<void> esFilterId, vm::cptr<CellDmuxEsResource> esResource, vm::cptr<DmuxCb<DmuxEsNotifyAuFound>> notifyAuFound,
vm::cptr<DmuxCb<DmuxEsNotifyFlushDone>> notifyFlushDone, vm::cptr<void> esSpecificInfo, vm::pptr<void> esHandle)
{
cellDmuxPamf.todo("_CellDmuxCoreOpEnableEs<raw_es=%d>(handle=*0x%x, esFilterId=*0x%x, esResource=*0x%x, notifyAuFound=*0x%x, notifyFlushDone=*0x%x, esSpecificInfo=*0x%x, esHandle)",
raw_es, handle, esFilterId, esResource, notifyAuFound, notifyFlushDone, esSpecificInfo, esHandle);
return CELL_OK;
}
error_code _CellDmuxCoreOpDisableEs(vm::ptr<void> esHandle)
{
cellDmuxPamf.todo("_CellDmuxCoreOpDisableEs(esHandle=*0x%x)", esHandle);
return CELL_OK;
}
error_code _CellDmuxCoreOpFlushEs(vm::ptr<void> esHandle)
{
cellDmuxPamf.todo("_CellDmuxCoreOpFlushEs(esHandle=*0x%x)", esHandle);
return CELL_OK;
}
error_code _CellDmuxCoreOpResetEs(vm::ptr<void> esHandle)
{
cellDmuxPamf.todo("_CellDmuxCoreOpResetEs(esHandle=*0x%x)", esHandle);
return CELL_OK;
}
error_code _CellDmuxCoreOpResetStreamAndWaitDone(vm::ptr<void> handle)
{
cellDmuxPamf.todo("_CellDmuxCoreOpResetStreamAndWaitDone(handle=*0x%x)", handle);
return CELL_OK;
}
static void init_gvar(const vm::gvar<CellDmuxCoreOps>& var)
{
var->queryAttr.set(g_fxo->get<ppu_function_manager>().func_addr(FIND_FUNC(_CellDmuxCoreOpQueryAttr)));
var->open.set(g_fxo->get<ppu_function_manager>().func_addr(FIND_FUNC(_CellDmuxCoreOpOpen)));
var->close.set(g_fxo->get<ppu_function_manager>().func_addr(FIND_FUNC(_CellDmuxCoreOpClose)));
var->resetStream.set(g_fxo->get<ppu_function_manager>().func_addr(FIND_FUNC(_CellDmuxCoreOpResetStream)));
var->createThread.set(g_fxo->get<ppu_function_manager>().func_addr(FIND_FUNC(_CellDmuxCoreOpCreateThread)));
var->joinThread.set(g_fxo->get<ppu_function_manager>().func_addr(FIND_FUNC(_CellDmuxCoreOpJoinThread)));
var->freeMemory.set(g_fxo->get<ppu_function_manager>().func_addr(FIND_FUNC(_CellDmuxCoreOpFreeMemory)));
var->disableEs.set(g_fxo->get<ppu_function_manager>().func_addr(FIND_FUNC(_CellDmuxCoreOpDisableEs)));
var->flushEs.set(g_fxo->get<ppu_function_manager>().func_addr(FIND_FUNC(_CellDmuxCoreOpFlushEs)));
var->resetEs.set(g_fxo->get<ppu_function_manager>().func_addr(FIND_FUNC(_CellDmuxCoreOpResetEs)));
var->resetStreamAndWaitDone.set(g_fxo->get<ppu_function_manager>().func_addr(FIND_FUNC(_CellDmuxCoreOpResetStreamAndWaitDone)));
}
DECLARE(ppu_module_manager::cellDmuxPamf)("cellDmuxPamf", []
{
REG_VNID(cellDmuxPamf, 0x28b2b7b2, g_cell_dmux_core_ops_pamf).init = []
{
g_cell_dmux_core_ops_pamf->setStream.set(g_fxo->get<ppu_function_manager>().func_addr(FIND_FUNC(_CellDmuxCoreOpSetStream<false>)));
g_cell_dmux_core_ops_pamf->queryEsAttr.set(g_fxo->get<ppu_function_manager>().func_addr(FIND_FUNC(_CellDmuxCoreOpQueryEsAttr<false>)));
g_cell_dmux_core_ops_pamf->enableEs.set(g_fxo->get<ppu_function_manager>().func_addr(FIND_FUNC(_CellDmuxCoreOpEnableEs<false>)));
init_gvar(g_cell_dmux_core_ops_pamf);
};
REG_VNID(cellDmuxPamf, 0x9728a0e9, g_cell_dmux_core_ops_raw_es).init = []
{
g_cell_dmux_core_ops_raw_es->setStream.set(g_fxo->get<ppu_function_manager>().func_addr(FIND_FUNC(_CellDmuxCoreOpSetStream<true>)));
g_cell_dmux_core_ops_raw_es->queryEsAttr.set(g_fxo->get<ppu_function_manager>().func_addr(FIND_FUNC(_CellDmuxCoreOpQueryEsAttr<true>)));
g_cell_dmux_core_ops_raw_es->enableEs.set(g_fxo->get<ppu_function_manager>().func_addr(FIND_FUNC(_CellDmuxCoreOpEnableEs<true>)));
init_gvar(g_cell_dmux_core_ops_raw_es);
};
REG_HIDDEN_FUNC(_CellDmuxCoreOpQueryAttr);
REG_HIDDEN_FUNC(_CellDmuxCoreOpOpen);
REG_HIDDEN_FUNC(_CellDmuxCoreOpClose);
REG_HIDDEN_FUNC(_CellDmuxCoreOpResetStream);
REG_HIDDEN_FUNC(_CellDmuxCoreOpCreateThread);
REG_HIDDEN_FUNC(_CellDmuxCoreOpJoinThread);
REG_HIDDEN_FUNC(_CellDmuxCoreOpSetStream<false>);
REG_HIDDEN_FUNC(_CellDmuxCoreOpSetStream<true>);
REG_HIDDEN_FUNC(_CellDmuxCoreOpFreeMemory);
REG_HIDDEN_FUNC(_CellDmuxCoreOpQueryEsAttr<false>);
REG_HIDDEN_FUNC(_CellDmuxCoreOpQueryEsAttr<true>);
REG_HIDDEN_FUNC(_CellDmuxCoreOpEnableEs<false>);
REG_HIDDEN_FUNC(_CellDmuxCoreOpEnableEs<true>);
REG_HIDDEN_FUNC(_CellDmuxCoreOpDisableEs);
REG_HIDDEN_FUNC(_CellDmuxCoreOpFlushEs);
REG_HIDDEN_FUNC(_CellDmuxCoreOpResetEs);
REG_HIDDEN_FUNC(_CellDmuxCoreOpResetStreamAndWaitDone);
});
+15
View File
@@ -0,0 +1,15 @@
#pragma once
struct CellDmuxPamfAttr
{
be_t<u32> maxEnabledEsNum;
be_t<u32> version;
be_t<u32> memSize;
};
struct CellDmuxPamfEsAttr
{
be_t<u32> auQueueMaxSize;
be_t<u32> memSize;
be_t<u32> specificInfoSize;
};
+14 -14
View File
@@ -598,7 +598,7 @@ error_code cellFsSetIoBufferFromDefaultContainer(u32 fd, u32 buffer_size, u32 pa
{
cellFs.todo("cellFsSetIoBufferFromDefaultContainer(fd=%d, buffer_size=%d, page_type=%d)", fd, buffer_size, page_type);
const auto file = idm::get<lv2_fs_object, lv2_file>(fd);
const auto file = idm::get_unlocked<lv2_fs_object, lv2_file>(fd);
if (!file)
{
@@ -695,7 +695,7 @@ s32 cellFsStReadInit(u32 fd, vm::cptr<CellFsRingBuffer> ringbuf)
return CELL_EINVAL;
}
const auto file = idm::get<lv2_fs_object, lv2_file>(fd);
const auto file = idm::get_unlocked<lv2_fs_object, lv2_file>(fd);
if (!file)
{
@@ -716,7 +716,7 @@ s32 cellFsStReadFinish(u32 fd)
{
cellFs.todo("cellFsStReadFinish(fd=%d)", fd);
const auto file = idm::get<lv2_fs_object, lv2_file>(fd);
const auto file = idm::get_unlocked<lv2_fs_object, lv2_file>(fd);
if (!file)
{
@@ -732,7 +732,7 @@ s32 cellFsStReadGetRingBuf(u32 fd, vm::ptr<CellFsRingBuffer> ringbuf)
{
cellFs.todo("cellFsStReadGetRingBuf(fd=%d, ringbuf=*0x%x)", fd, ringbuf);
const auto file = idm::get<lv2_fs_object, lv2_file>(fd);
const auto file = idm::get_unlocked<lv2_fs_object, lv2_file>(fd);
if (!file)
{
@@ -748,7 +748,7 @@ s32 cellFsStReadGetStatus(u32 fd, vm::ptr<u64> status)
{
cellFs.todo("cellFsStReadGetRingBuf(fd=%d, status=*0x%x)", fd, status);
const auto file = idm::get<lv2_fs_object, lv2_file>(fd);
const auto file = idm::get_unlocked<lv2_fs_object, lv2_file>(fd);
if (!file)
{
@@ -764,7 +764,7 @@ s32 cellFsStReadGetRegid(u32 fd, vm::ptr<u64> regid)
{
cellFs.todo("cellFsStReadGetRingBuf(fd=%d, regid=*0x%x)", fd, regid);
const auto file = idm::get<lv2_fs_object, lv2_file>(fd);
const auto file = idm::get_unlocked<lv2_fs_object, lv2_file>(fd);
if (!file)
{
@@ -780,7 +780,7 @@ s32 cellFsStReadStart(u32 fd, u64 offset, u64 size)
{
cellFs.todo("cellFsStReadStart(fd=%d, offset=0x%llx, size=0x%llx)", fd, offset, size);
const auto file = idm::get<lv2_fs_object, lv2_file>(fd);
const auto file = idm::get_unlocked<lv2_fs_object, lv2_file>(fd);
if (!file)
{
@@ -796,7 +796,7 @@ s32 cellFsStReadStop(u32 fd)
{
cellFs.todo("cellFsStReadStop(fd=%d)", fd);
const auto file = idm::get<lv2_fs_object, lv2_file>(fd);
const auto file = idm::get_unlocked<lv2_fs_object, lv2_file>(fd);
if (!file)
{
@@ -812,7 +812,7 @@ s32 cellFsStRead(u32 fd, vm::ptr<u8> buf, u64 size, vm::ptr<u64> rsize)
{
cellFs.todo("cellFsStRead(fd=%d, buf=*0x%x, size=0x%llx, rsize=*0x%x)", fd, buf, size, rsize);
const auto file = idm::get<lv2_fs_object, lv2_file>(fd);
const auto file = idm::get_unlocked<lv2_fs_object, lv2_file>(fd);
if (!file)
{
@@ -828,7 +828,7 @@ s32 cellFsStReadGetCurrentAddr(u32 fd, vm::ptr<u32> addr, vm::ptr<u64> size)
{
cellFs.todo("cellFsStReadGetCurrentAddr(fd=%d, addr=*0x%x, size=*0x%x)", fd, addr, size);
const auto file = idm::get<lv2_fs_object, lv2_file>(fd);
const auto file = idm::get_unlocked<lv2_fs_object, lv2_file>(fd);
if (!file)
{
@@ -844,7 +844,7 @@ s32 cellFsStReadPutCurrentAddr(u32 fd, vm::ptr<u8> addr, u64 size)
{
cellFs.todo("cellFsStReadPutCurrentAddr(fd=%d, addr=*0x%x, size=0x%llx)", fd, addr, size);
const auto file = idm::get<lv2_fs_object, lv2_file>(fd);
const auto file = idm::get_unlocked<lv2_fs_object, lv2_file>(fd);
if (!file)
{
@@ -860,7 +860,7 @@ s32 cellFsStReadWait(u32 fd, u64 size)
{
cellFs.todo("cellFsStReadWait(fd=%d, size=0x%llx)", fd, size);
const auto file = idm::get<lv2_fs_object, lv2_file>(fd);
const auto file = idm::get_unlocked<lv2_fs_object, lv2_file>(fd);
if (!file)
{
@@ -876,7 +876,7 @@ s32 cellFsStReadWaitCallback(u32 fd, u64 size, vm::ptr<void(s32 xfd, u64 xsize)>
{
cellFs.todo("cellFsStReadWaitCallback(fd=%d, size=0x%llx, func=*0x%x)", fd, size, func);
const auto file = idm::get<lv2_fs_object, lv2_file>(fd);
const auto file = idm::get_unlocked<lv2_fs_object, lv2_file>(fd);
if (!file)
{
@@ -908,7 +908,7 @@ struct fs_aio_thread : ppu_thread
s32 error = CELL_EBADF;
u64 result = 0;
const auto file = idm::get<lv2_fs_object, lv2_file>(aio->fd);
const auto file = idm::get_unlocked<lv2_fs_object, lv2_file>(aio->fd);
if (!file || (type == 1 && file->flags & CELL_FS_O_WRONLY) || (type == 2 && !(file->flags & CELL_FS_O_ACCMODE)))
{
+1 -1
View File
@@ -961,7 +961,7 @@ error_code cellGameContentPermit(ppu_thread& ppu, vm::ptr<char[CELL_GAME_PATH_MA
if (!perm.temp.empty())
{
std::vector<std::shared_ptr<lv2_file>> lv2_files;
std::vector<shared_ptr<lv2_file>> lv2_files;
const std::string real_dir = vfs::get(dir) + "/";
+1 -1
View File
@@ -455,7 +455,7 @@ error_code _cellGcmInitBody(ppu_thread& ppu, vm::pptr<CellGcmContextData> contex
vm::var<u64> _tid;
vm::var<char[]> _name = vm::make_str("_gcm_intr_thread");
ppu_execute<&sys_ppu_thread_create>(ppu, +_tid, 0x10000, 0, 1, 0x4000, SYS_PPU_THREAD_CREATE_INTERRUPT, +_name);
render->intr_thread = idm::get<named_thread<ppu_thread>>(static_cast<u32>(*_tid));
render->intr_thread = idm::get_unlocked<named_thread<ppu_thread>>(static_cast<u32>(*_tid));
render->intr_thread->state -= cpu_flag::stop;
thread_ctrl::notify(*render->intr_thread);
File diff suppressed because it is too large Load Diff
+2 -1
View File
@@ -161,7 +161,8 @@ enum CellGemVideoConvertFormatEnum : s32
// External device IDs (types)
enum
{
SHARP_SHOOTER_DEVICE_ID = 0x8081
SHARP_SHOOTER_DEVICE_ID = 0x8081,
RACING_WHEEL_DEVICE_ID = 0x8101
};
struct CellGemAttribute
+8 -10
View File
@@ -273,7 +273,7 @@ error_code cellGifDecReadHeader(vm::ptr<GifDecoder> mainHandle, vm::ptr<GifStrea
return CELL_GIFDEC_ERROR_ARG;
}
const u32& fd = subHandle->fd;
const u32 fd = subHandle->fd;
CellGifDecInfo& current_info = subHandle->info;
// Write the header to buffer
@@ -288,7 +288,7 @@ error_code cellGifDecReadHeader(vm::ptr<GifDecoder> mainHandle, vm::ptr<GifStrea
}
case CELL_GIFDEC_FILE:
{
auto file = idm::get<lv2_fs_object, lv2_file>(fd);
auto file = idm::get_unlocked<lv2_fs_object, lv2_file>(fd);
file->file.seek(0);
file->file.read(buffer, sizeof(buffer));
break;
@@ -302,7 +302,7 @@ error_code cellGifDecReadHeader(vm::ptr<GifDecoder> mainHandle, vm::ptr<GifStrea
return CELL_GIFDEC_ERROR_STREAM_FORMAT; // Surprisingly there is no error code related with headerss
}
u8 packedField = buffer[10];
const u8 packedField = buffer[10];
current_info.SWidth = buffer[6] + buffer[7] * 0x100;
current_info.SHeight = buffer[8] + buffer[9] * 0x100;
current_info.SGlobalColorTableFlag = packedField >> 7;
@@ -500,7 +500,7 @@ error_code cellGifDecDecodeData(vm::ptr<GifDecoder> mainHandle, vm::cptr<GifStre
case CELL_GIFDEC_FILE:
{
auto file = idm::get<lv2_fs_object, lv2_file>(fd);
auto file = idm::get_unlocked<lv2_fs_object, lv2_file>(fd);
file->file.seek(0);
file->file.read(gif.get(), fileSize);
break;
@@ -520,8 +520,8 @@ error_code cellGifDecDecodeData(vm::ptr<GifDecoder> mainHandle, vm::cptr<GifStre
return CELL_GIFDEC_ERROR_STREAM_FORMAT;
const int bytesPerLine = static_cast<int>(dataCtrlParam->outputBytesPerLine);
const char nComponents = 4;
uint image_size = width * height * nComponents;
constexpr char nComponents = 4;
const u32 image_size = width * height * nComponents;
switch(current_outParam.outputColorSpace)
{
@@ -541,9 +541,8 @@ error_code cellGifDecDecodeData(vm::ptr<GifDecoder> mainHandle, vm::cptr<GifStre
{
memcpy(data.get_ptr(), image.get(), image_size);
}
break;
}
break;
case CELL_GIFDEC_ARGB:
{
if (bytesPerLine > width * nComponents) // Check if we need padding
@@ -579,9 +578,8 @@ error_code cellGifDecDecodeData(vm::ptr<GifDecoder> mainHandle, vm::cptr<GifStre
}
std::memcpy(data.get_ptr(), img.get(), image_size);
}
break;
}
break;
default:
return CELL_GIFDEC_ERROR_ARG;
}

Some files were not shown because too many files have changed in this diff Show More