Compare commits

...

587 Commits

Author SHA1 Message Date
Ani 33558d14e5 rpcs3_version: Bump to 0.0.28 2023-06-02 19:54:07 +02:00
Eladash c37fc73a02 PPU LLVM: Invalidate cache for testers 2023-06-02 08:54:46 +03:00
Eladash d152537e50 sys_lwcond/cond/ppu_thread: Respect scheduler in various syscalls 2023-06-02 08:54:46 +03:00
Eladash 5d4e87373f LV2: Make _sys_lwcond_destroy wait for lwmutex lock 2023-06-02 08:54:46 +03:00
Eladash 1c36156594 PPU LLVM: Fix LWSYNC according to cellSpursWakeup 2023-06-02 08:54:46 +03:00
Eladash 300701a06b Make page faults entry enqueue and event atomic 2023-06-02 08:54:46 +03:00
Eladash a776f15557 SPU: fix event count with ACK and mask write 2023-06-02 08:54:46 +03:00
Eladash 1c89f8a855 LV2/Timer: Fix ENOTCONN check of start timer 2023-06-02 08:54:46 +03:00
Eladash 81e4d9c2ee LV2/TImer: Fix notification discard 2023-06-02 08:54:46 +03:00
Eladash 49be6be8f4 LV2/Timer: Make timers consistent 2023-06-02 08:54:46 +03:00
Eladash b861a9c5d0 LV2: Implement set-priority thread requeue 2023-06-02 08:54:46 +03:00
Eladash 9828e6cafc LV2: Push other-than-this thread to the back on priority set 2023-06-02 08:54:46 +03:00
Eladash 3d8d9ef61c Threads.cpp: Fix infinite looping 2023-06-02 08:54:46 +03:00
Eladash 5d13978bbf sys_lwcond: Implement TIMEOUT on lwmutex lock 2023-06-02 08:54:46 +03:00
Eladash b844aecb9e sys_lwmutex/mutex: Fix race on lock timeout 2023-06-02 08:54:46 +03:00
Eladash f57c8c1c35 LV2: Unconditional Timer Synchronization Fix 2023-06-02 08:54:46 +03:00
kd-11 bbbc5f6e6c rsx: Write a warning to the log if we decide to collapse surfaces to reduce VRAM usage. 2023-06-01 19:25:50 +03:00
kd-11 ac0c60b740 vk: Rename gc_wrapper_t to gc_callback_t which is more relevant 2023-06-01 19:25:50 +03:00
kd-11 f2f95a20a3 vk: Minor improvement to descriptor and garbage collector interaction 2023-06-01 19:25:50 +03:00
kd-11 12f213ffad rsx: Trim the number of in-flight invalidated resources (temp cache)
- This drastically improves memory allocation behavior.
  Holding too many invalidated resources can lead to a cascading overallocation error as old resources hold refs to even older resources and nothing gets deleted.
2023-06-01 19:25:50 +03:00
Megamouse 66e1cf96e2 Qt/Loader: Let users choose which packages to install 2023-06-01 16:34:23 +02:00
Elad Ashkenazi c3b7229fbb Extra PS3_EXTRA fix 2023-06-01 06:43:33 +02:00
Megamouse f96a0ce9d2 Trophies: Add more sanity checks to pugixml backend 2023-05-30 19:11:57 +02:00
Megamouse ba592070f7 Qt: fix random initial game selection in trophy dir 2023-05-30 19:11:57 +02:00
kd-11 6a2ea62f82 vk: Minor cleanup 2023-05-30 16:50:08 +03:00
kd-11 6cfd817b5a vk: Fix descriptor-related crashes 2023-05-30 16:50:08 +03:00
kd-11 c99ef4b09f vk: Refactor descriptor handling 2023-05-30 16:50:08 +03:00
kd-11 7e131f8fb6 rsx/util: Add some c++ guards around simple_array class 2023-05-30 16:50:08 +03:00
kd-11 10171c19c3 vk: Unify descriptor allocation
- Pool management should be a backend implementation detail.
2023-05-30 16:50:08 +03:00
Elad Ashkenazi e0853095e3 Fixup debugger_frame double events 2023-05-30 13:11:03 +02:00
Eladash 5a365506f7 Qt/Debugger: Add Ctrl+F (find thread), Ctrl+C (copy) 2023-05-28 13:53:35 +02:00
Megamouse 4aee1b378a overlays: fix media list dialog pad interception 2023-05-28 11:56:49 +02:00
Elad Ashkenazi 9f5e3ecb8c rsx/overlays: Fix crash on stop 2023-05-26 07:42:29 +02:00
Megamouse 7b9614fcf3 Hid: add some logging for initial send_output_report 2023-05-25 23:02:22 +02:00
Megamouse 8e62a0e22d input: remove some outdated comments 2023-05-25 23:02:22 +02:00
Megamouse f89d3d5077 cellCamera: don't switch to main thread unless really necessary 2023-05-25 21:30:27 +02:00
Megamouse 145e059cdf input: allow to remap emulated pads dynamically 2023-05-25 20:37:15 +02:00
Megamouse 22916a7e8d Qt/input: limit some usb device configs to 2 players 2023-05-25 20:37:15 +02:00
Megamouse 07f458f991 Qt: rename emulated pads menu to usb devices 2023-05-25 20:37:15 +02:00
Megamouse 6180a58d7a Qt: disable emulated pad settings during emulation 2023-05-25 20:37:15 +02:00
Megamouse 5cc2a7c09e input: fix emulated pad stick y axis 2023-05-25 20:37:15 +02:00
Megamouse e584653b72 input: move emulated pad handling to config class 2023-05-25 20:37:15 +02:00
Megamouse f4b346a6f8 input: fix emulated button map accessors 2023-05-25 20:37:15 +02:00
Megamouse cb1b71bc57 Qt: fix emulated button reset 2023-05-25 20:37:15 +02:00
Megamouse 95060efb7d input: add support for multi-assignment in emulated pads 2023-05-25 20:37:15 +02:00
Megamouse b82dd61a0c input: add emulated axis configs 2023-05-25 20:37:15 +02:00
Megamouse c84d10686f Qt: change wording on fake PS Move config 2023-05-25 20:37:15 +02:00
Megamouse d652a81078 Qt/input: add emulated pads settings dialogs 2023-05-25 20:37:15 +02:00
Megamouse fc76d2df38 input: list actual nodes instead of button ids 2023-05-25 20:37:15 +02:00
Megamouse 1a98682ea0 input: add enum count for enumeration 2023-05-25 20:37:15 +02:00
Megamouse 64437a531b input: use global configs 2023-05-25 20:37:15 +02:00
Megamouse 4d26170bd6 input: add emulated_pad_config template class 2023-05-25 20:37:15 +02:00
Megamouse 36831a3d6a input: add gem ds3 config file
No sticks yet
2023-05-25 20:37:15 +02:00
Megamouse e7c0df4eac input: add usio config file
No sticks yet
2023-05-25 20:37:15 +02:00
Megamouse a296c19633 input: add ghltar config file
No sticks yet
2023-05-25 20:37:15 +02:00
Megamouse 8b5f7a0770 input: add turntable config file
No sticks yet
2023-05-25 20:37:15 +02:00
Megamouse 7b9a36be7d input: add buzz config file
Adds a buzz.yml and implements a generic way to save actual DS3 mapping independent of pad handlers
2023-05-25 20:37:15 +02:00
shinra-electric cbe1628cf2 remove deprecated VK_MVK_moltenvk and replace with mvk_config.h
VK_MVK_moltenvk extension has been removed. 

Will try with `mvk_config.h`, but it this doesn't work `mvk_deprecated_api.h` should work instead.
2023-05-25 08:54:44 +02:00
shinra-electric d482c078bc Update MVK to 1.2.4 for Vulkan SDK 1.3.250 2023-05-25 08:54:44 +02:00
Megamouse 38f9332905 overlays: Fix width of graph labels 2023-05-25 06:37:31 +02:00
Megamouse 96f1f9e45e overlays: fix missing sound autorepeat fence.
The other instances aren't realistically autorepeating
2023-05-25 06:37:31 +02:00
Eladash f031cd9b42 Take advantage of WIN10 Thread Name API 2023-05-24 20:39:51 +02:00
Megamouse 3aa15c8a23 Update hidapi from 0.13.1 to 0.14.0 2023-05-23 22:23:44 +02:00
Megamouse a3cc3aa8b8 Update curl from 8.0.1 to 8.1.1 2023-05-23 22:23:44 +02:00
Megamouse 29f67448e9 pine: fix some warnings (#13904) 2023-05-23 18:01:14 +02:00
kd-11 976a3ed3bf Formatting fixes 2023-05-23 14:37:13 +03:00
kd-11 98c0944419 vk: Fix some sampler load crashes 2023-05-23 14:37:13 +03:00
kd-11 bf78b197a3 vk: Reimplement sampler disposal using the new pool mechanism 2023-05-23 14:37:13 +03:00
kd-11 427960fee8 vk: Fix compiler warning 2023-05-23 14:37:13 +03:00
kd-11 75da7d80dc vk: Reimplement sampler caching to take border color into account 2023-05-23 14:37:13 +03:00
kd-11 7eb730ee03 vk: Integrate custom border colors when supported 2023-05-23 14:37:13 +03:00
kd-11 4b9fa7a417 vk: Require customBorderColorWithoutFormat feature 2023-05-23 14:37:13 +03:00
kd-11 6163acc8c5 vk: Add border color extension detection 2023-05-23 14:37:13 +03:00
kd-11 4add5b6bf0 vk: Minor refactoring of optional features 2023-05-23 14:37:13 +03:00
Megamouse 1ae3b37fbe sceNpTrophy: set timestamps 2023-05-23 08:22:13 +02:00
Elad Ashkenazi 23c710cf53 CPUThread.cpp: Fix an emulator crash on game exit 2023-05-22 20:04:49 +03:00
Eladash e29b81c444 Debug Fixes 2023-05-22 20:04:49 +03:00
Megamouse 73dba6d6e0 overlays: do not play sounds on fast auto repeat
Currently there's a nasty sound stakkato going on if you keep the dpad pressed to the left in the home menu for example.
2023-05-20 18:27:26 +02:00
Megamouse 09e845a539 input: add sanity checks for buf_size
also improve log spam
2023-05-20 13:24:43 +02:00
Eladash e1744ceab2 Debugger: Implement key-scrolling through threads 2023-05-19 23:15:40 +02:00
RipleyTom cbb1b1f28e Fix spu_fm 2023-05-19 18:26:42 +03:00
Elad Ashkenazi 59f9938849 cellSpurs: Fix ready count 2023-05-19 14:18:51 +03:00
Megamouse 8db318094f Qt: fix memory leak on midi error 2023-05-18 22:11:35 +02:00
Megamouse 5a4206e05d Qt: Don't refresh mic and midi list in constructor 2023-05-18 22:11:35 +02:00
Megamouse 6794ae35a1 mac arm: try to fix compilation 2023-05-18 18:52:25 +02:00
Megamouse 8676913e73 input: use enum class for pad connection 2023-05-18 18:52:25 +02:00
Megamouse 2ef120fdcd input: add option to keep pads connected 2023-05-18 18:52:25 +02:00
kd-11 08c1a14b13 Fix init order for gpu_debug_marker 2023-05-18 18:10:46 +03:00
kd-11 4a138aa918 Fix init order 2023-05-18 18:10:46 +03:00
kd-11 793a21a825 rsx: Fix build after variable rename 2023-05-18 18:10:46 +03:00
kd-11 6fd76054b4 vk: Rename the debug marker to something more appropriate 2023-05-18 18:10:46 +03:00
kd-11 c80be9e54b Fixup - command buffer wrapping 2023-05-18 18:10:46 +03:00
kd-11 56ebae773c vk: C++-ify the debug marker sync object member names 2023-05-18 18:10:46 +03:00
kd-11 fad6647255 vk: Do not use raw GPU command buffer handles for any wrapped API calls
- There is no reason to do so and we seriously hamper debugging efforts
2023-05-18 18:10:46 +03:00
kd-11 edb2b60f2f rsx: Perform region clipping in a normalized coordinate space
- Depending on what the caller wants to do, the scaling will be different for src vs dst calculations.
  We cannot reliably handle this in the callee
2023-05-18 18:10:46 +03:00
kd-11 d894ccb4ea vk: Preliminary support for debug markers 2023-05-18 18:10:46 +03:00
Megamouse bd09dc8ea8 Qt: allow hiding trophy table columns 2023-05-18 15:26:05 +02:00
Megamouse a1e19e1cf8 VS: set more O2 2023-05-18 12:41:22 +02:00
Megamouse 799dbfc2c5 MSVC: Ignore base address warning 2023-05-18 12:41:22 +02:00
Megamouse 54e6cf95d7 Fix some warnings 2023-05-18 12:41:22 +02:00
Megamouse 3ea0e391db Updates 2023-05-18 12:41:22 +02:00
Megamouse 4fd21f7764 Windows Use vector for performance counter data allocation 2023-05-18 09:15:49 +02:00
Megamouse f8009451a9 rpcn: fix some msvc warnings 2023-05-18 09:15:49 +02:00
Megamouse f5c48a00b4 Fix log message 2023-05-18 09:15:49 +02:00
Elad Ashkenazi c70338a9a9 Logs/Debugger: Go-To-Address signal from log text 2023-05-18 08:43:39 +02:00
Megamouse e83540d80c Qt: don't refresh game grid after emu stop
It is not necessary to refresh the game grid after stopping a game.
2023-05-17 23:39:48 +02:00
Dark 24dde5d42b Implement support for emulating Rock Band 3's MIDI Pro Adapter
Co-authored-by: Megamouse <studienricky89@googlemail.com>
2023-05-17 22:59:44 +02:00
Joshua de Reeper 8e15afb2c4 sys_usbd: Emulate Disney Infinity Base 2023-05-17 21:26:58 +02:00
Megamouse 911cd678ff cli: add ability to log ffmpeg codecs 2023-05-17 00:23:47 +02:00
RipleyTom f11770b88b Better accuracy for FREST/FRSQEST (#13863) 2023-05-15 17:20:47 +01:00
Eladash 514ef9a9c5 SPU Executable Code Dumping Tool 2023-05-15 14:11:13 +03:00
kd-11 57070aa8ff vk: Minor refactor in OOM handler to skip scans if we already found a match 2023-05-15 12:28:19 +03:00
kd-11 e06c6b5ac8 vk: Refactor memory allocators to easily inspect device properties 2023-05-15 12:28:19 +03:00
kd-11 a6dada6c36 vk: Use gc to clean up stale surface cache resources instead of fudging with frame counters.
- This whole surface cache garbage management needs to be merged with gc
2023-05-15 12:28:19 +03:00
kd-11 a058cf2ff0 vk: Rewrite draw call setup sequence to avoid OOM situations introducing stale descriptors 2023-05-15 12:28:19 +03:00
kd-11 142d25c0d7 vk: Don't erase texture cache images directly. Use gc instead. 2023-05-15 12:28:19 +03:00
kd-11 4e6231a321 vk: Implement max VRAM override in config 2023-05-15 12:28:19 +03:00
kd-11 29d87a3743 vk: Refactor the vram exhausted handler
- Mostly a de-uglify pass
2023-05-15 12:28:19 +03:00
kd-11 9a2b06f35f vk: Refactor vram exhausted handler to minimize risk of UAF hazards
1. A hard sync before starting the routines on fatal will release some memory going in improving chances of a successful eviction elsewhere.
2. A hard sync on exit cleans up, ensuring no UAF (with caveats)
2023-05-15 12:28:19 +03:00
kd-11 4e2f3a289c vk: Tune resource quotas
- Tuned for 1G. The system requires about 128M for scratch and system data.
2023-05-15 12:28:19 +03:00
kd-11 db70cd058a vk: Improve spill robustness
- Removes some incorrect checks that asserted incorrectly
- Make the collapsible check recursive
2023-05-15 12:28:19 +03:00
kd-11 b6cdf18165 vk: Lower scratch dimension alignment to 256 to minimize wastage 2023-05-15 12:28:19 +03:00
kd-11 7d710cbf8c rsx: Do not allow 'compatible' check to pass if the size does not match
- It's not worth it. We end up with a mish-mash of internal configuration parameters that don't match the surface.
  Maybe with more abstraction it can work, but there is little benefit.
2023-05-15 12:28:19 +03:00
Elad Ashkenazi 654c4e3c06 Logs: fix Stack Cell Errors setting reading 2023-05-14 19:51:18 +02:00
Elad Ashkenazi a3271b08b7 System.cpp: Make boot of disc updates more strict 2023-05-14 17:47:56 +02:00
oltolm b0de5970ce Get the font directory from Windows (#13825) 2023-05-13 20:58:59 +02:00
Elad Ashkenazi db7f84f9f8 SPU/PPU/Debugger: Ensure ascending stack frames (#13833)
* PPU/Debugger: Ensure ascending stack frames

* SPU/Debugger: Ensure descending stack frame pointers
2023-05-10 11:23:09 +03:00
Megamouse 58140e1d3a Fix some warnings 2023-05-09 07:55:46 +02:00
Megamouse 315d9c308b Qt: fix game list event filter
Fixes a regression caused by copy pasting the list construction to its
own constructor.
2023-05-08 23:05:12 +02:00
Eladash d13c0ee393 SPU/Debugger: Detect stack-less functions 2023-05-08 19:27:21 +03:00
Zion Nimchuk 7740cac6dd Add linuxdeploy-plugin-checkrt for compatibility with older distros 2023-05-08 08:45:41 +02:00
Elad Ashkenazi ead8e5e0c3 PPU LLVM: Unbreak function linkage 2023-05-07 14:11:37 +03:00
RipleyTom 195de818b6 Fix rpcn config reset 2023-05-06 19:48:40 +02:00
RipleyTom 5c0113ce59 Deterministic FREST and FRSQEST 2023-05-06 12:59:34 +03:00
oltolm db2341c842 fix ASAN error: make overlay_pass destructor virtual 2023-05-06 10:17:58 +02:00
oltolm b7b87096d8 fix: make ASAN work on Windows 2023-05-06 10:17:58 +02:00
brian218 6a41b22a1b sys_fs: Further implemented cellFsArcadeHddSerialNumber (0xc0000007) 2023-05-06 10:26:37 +03:00
brian218 5696065727 sys_fs: Improved sys_fs_fcntl(0xc0000015 and 0xc000001c) by integrating duplicate code 2023-05-06 10:26:37 +03:00
brian218 e9281843bf sys_fs: Implemented mount_info_map to keep proper track of mounted devices 2023-05-06 10:26:37 +03:00
brian218 43184a271f sys_fs: Improved lv2_fs_object constructor 2023-05-06 10:26:37 +03:00
brian218 a7e1bc34de sys_fs: Improved the functionality of lv2_fs_object::get_mp() and the efficiency of mount&newfs syscalls 2023-05-06 10:26:37 +03:00
brian218 98c46f7eb0 sys_game: Fixed potential bugs in sys_game_get_system_sw_version()
sys_game: Implemented sys_game_set_system_sw_version()
2023-05-06 10:26:37 +03:00
Megamouse 3de0f042c6 Qt: filter for rpcs3_*.qm files when enumerating languages 2023-05-06 09:16:24 +02:00
Megamouse f115032095 Qt: implement flow layout game grid
This will allow us to properly style the grid and also remove the need to refresh the whole grid on a window resize
2023-05-06 06:31:58 +02:00
Megamouse 0b628cb50e cellPamf: Add missing error code 2023-05-06 06:31:58 +02:00
Ștefan Talpalaru 751775a04c CI: -DUSE_SDL=ON (on Linux) 2023-05-05 21:40:09 +03:00
Ștefan Talpalaru 177bb3c569 build: fix USE_SYSTEM_SDL 2023-05-05 21:40:09 +03:00
Ivan Chikish 3cf8c629fa X86 SigHandler: Add support for BEXTR instruction
BEXTR is emitted for znver CPUs in recent LLVM.
2023-05-05 18:03:50 +03:00
kd-11 3947250daa Whitespace fix 2023-05-05 16:59:06 +03:00
kd-11 96be211c88 gl: Fix typeless casts 2023-05-05 16:59:06 +03:00
kd-11 b00b8ae71b rsx: Allow swizzle flag to propagate as an override to surface properties 2023-05-03 01:26:14 +03:00
kd-11 45f416c4f1 rsx: Apply swizzle flag on data source as well
- The fact that the attribute is tacked on to the dest is a semantic error.
  It's the context that is swz\ln, not the source or dest. They both are one or the other.
2023-05-03 01:26:14 +03:00
kd-11 c58149f5b6 vk: Propagate swizzle flag in hw blit engine 2023-05-03 01:26:14 +03:00
kd-11 579a6c9311 rsx: Add a comment explaining the barycentric interpolation change 2023-05-02 20:46:39 +03:00
kd-11 08e7a23121 vk: Improved attribute interpolation for NVIDIA 2023-05-02 20:46:39 +03:00
RipleyTom bf190fd3d8 Fix deadlock in games_config 2023-05-02 07:51:22 +02:00
Megamouse ea3a73b598 Qt: fix invisible first game list icon on tiny icon sizes 2023-05-01 20:09:18 +02:00
RipleyTom 9989fb4bbc Force STATIC_LINK_LLVM on with BUILD_LLVM=ON 2023-05-01 17:27:09 +03:00
Megamouse 0524f4a540 MacOs: remove git dir from dmg 2023-04-30 18:26:19 +02:00
Megamouse 43febd392c Linux: remove git dir from AppImage 2023-04-30 18:26:19 +02:00
Megamouse dea894161a Windows: don't ship git folder 2023-04-30 18:26:19 +02:00
Megamouse 710f07049d VS: disable warnings of external dependencies (mainly silences Qt warning spam) 2023-04-30 18:26:19 +02:00
Megamouse fe977c4288 fix some warnings 2023-04-30 18:26:19 +02:00
Eladash f5b9d86e42 Qt/Utilities: Merge memory viewer with searcher 2023-04-30 12:41:55 +02:00
Ani 9ab4802d07 gl: Fix blur_intensity GL_INVALID_OPERATION error
blur_intensity is a float, so the cast needs to be f32 instead of s32
2023-04-30 12:02:14 +03:00
Zion Nimchuk f0828ebbc0 Use seperately bundled LLVM library 2023-04-30 04:40:35 +02:00
Zion Nimchuk 84b1624b23 Bring back removing the wayland-client lib 2023-04-30 04:17:26 +02:00
Zion Nimchuk 47da39a2ff Change AppImage packaging to actively maintained system
The previous system is basically unmaintained, this new AppImage
packager has proper support for Qt6, and active support from the
AppImage team.
In addition, I'm removing a bunch of our old lib hacks and the old ugly
C++ library check system.
2023-04-29 20:40:04 +02:00
Megamouse 7bec3b30b7 Qt: Allow parsing games.yml during gameplay
There is no need to restrict this anymore
2023-04-28 17:16:04 +02:00
Megamouse ad5a62b62d Loader: split add_only into own function
The new code does not require any modifications apart from loading vfs
2023-04-28 17:16:04 +02:00
Megamouse f080798000 Qt: clear game items before clearing the game list 2023-04-28 16:06:22 +02:00
Megamouse 6af81d649f VS: remove non-existent moc files from filter 2023-04-28 16:06:22 +02:00
Megamouse 5f3f8eeec6 Qt: fix squished icon column when opening rpcs3 after closing with an empty list 2023-04-28 16:06:22 +02:00
Megamouse 9b4302bc2f Qt: fix invalid pointer in IconReady slot 2023-04-28 16:06:22 +02:00
Megamouse fa618a2bf7 Qt: use shared_mutex in movie_item 2023-04-28 16:06:22 +02:00
Megamouse 6915025c7e Qt: don't mount dev_hdd0 in screenshot manager 2023-04-28 16:06:22 +02:00
Elad Ashkenazi 5cf80c05a5 savestates:/sys_spu: Fix join saving 2023-04-28 16:13:15 +03:00
Megamouse 711afeb688 Qt: only do a hard refresh when new games may have been added 2023-04-27 09:23:27 +02:00
Megamouse 96165cd21d Qt: keep game list data when toggling between list and grid layouts
There is no need to do a full hard refresh anymore.
2023-04-27 09:23:27 +02:00
Megamouse 1a07f40c4b Qt: fix futurewatcher cancel 2023-04-27 08:42:28 +02:00
Megamouse eb5ea82bb1 Qt: Fix data race and undefined behaviour in games_config 2023-04-27 08:42:28 +02:00
Megamouse cd9ff08235 Decrease some include madness 2023-04-26 21:37:44 +02:00
Megamouse 957713015a screenshot manager: use flow layout
This whole screenshot thing was really janky, as I added it in half a day or so. But this commit should make everything smooth.
Sadly there is no real lazy loading yet (icons are loaded async, but indiscriminately).
2023-04-26 18:07:16 +02:00
Megamouse a639772dfe Qt: async game list parsing 2023-04-26 18:07:16 +02:00
Megamouse 6c85d97d6c Qt: move experimental build warning to gui_application 2023-04-26 18:07:16 +02:00
kd-11 7feb13671a rsx: Fix up the framebuffer width if the pitch fits scissor but not the clip width 2023-04-25 13:07:12 +03:00
Megamouse 3f066cca4a Qt: fix adding vsh to gamelist 2023-04-25 04:49:41 +02:00
Megamouse c86d221ba5 Qt: lazy load save data icons 2023-04-25 00:58:57 +02:00
Megamouse 5870dad639 Qt: fix savedata dialog exception 2023-04-23 20:00:45 +02:00
Megamouse 53a70c6e77 Qt: lazy load trophy icons 2023-04-23 19:30:23 +02:00
Ivan Chikish 45fecf0059 SPU LLVM: disable AVX2 shift intrinsics
Was incorrectly checked.
2023-04-23 18:36:45 +03:00
Megamouse a6e4b77273 Qt: fix table item delegate usage 2023-04-23 09:25:27 +02:00
Megamouse f932cc4073 VS: fix filters 2023-04-23 09:25:27 +02:00
Eladash 6bf77166e1 Game List: Make Ctrl+f Focus On The Search Bar 2023-04-22 16:13:17 +02:00
Eladash 6b9d0d5df5 UI: Ignore trademark as a fallback when searching games
Also colons and hyphen.
2023-04-22 16:13:17 +02:00
Eladash 9778322d99 UI: Focus to game searchbar on load
Make return key press focus to game list's first entry.
2023-04-22 16:13:17 +02:00
Megamouse 6ff04ec91b Qt: Set icon size function properly 2023-04-22 15:45:54 +02:00
Megamouse c7700fcd72 Update FAudio to v 23.04 2023-04-22 15:00:02 +02:00
Megamouse 027b1d5cab Update SDL to v 2.26.5
This apparently contains some fixes for DS4 and DS5
2023-04-22 15:00:02 +02:00
Megamouse ce65a1c2a7 Update miniupnp to v 2.3.3 2023-04-22 15:00:02 +02:00
Megamouse 650b0c7c30 Qt: properly invalidate item pointer in grid mode 2023-04-22 14:28:23 +02:00
Megamouse 823b23f800 Qt: Lazy load game grid icons and optimize paint method for invisible items 2023-04-22 14:28:23 +02:00
Megamouse b47db88ded Qt: Remove unused list layout handling of repaint watcher 2023-04-22 14:28:23 +02:00
Megamouse 20b92f50d9 Qt: don't calculate sizes in grid mode 2023-04-22 14:28:23 +02:00
Megamouse b401ad85d1 Qt: lazy load game list icons and dir size 2023-04-22 14:28:23 +02:00
Megamouse e9df63119b Qt: multithreaded file testing during refresh 2023-04-22 14:28:23 +02:00
Megamouse caa6c9b471 Qt: Minor optimization during list refresh 2023-04-22 14:28:23 +02:00
Ivan Chikish bb8e43f16c SPU LLVM: fixup custom LICM pass 2023-04-22 03:07:06 +03:00
Megamouse 2c71d08ea2 Emu: Cache games.yml and only save when necessary 2023-04-21 20:18:24 +02:00
Megamouse 500f7901ac unself: rename SCEVersionInfo to version_header 2023-04-21 17:56:25 +02:00
Megamouse 5fb716fc21 unself: rename SectionInfo to segment_ext_header 2023-04-21 17:56:25 +02:00
Megamouse 31ef970f23 unself: some more documentation 2023-04-21 17:56:25 +02:00
Megamouse a770eaf500 unself: rename AppInfo to program_identification_header 2023-04-21 17:56:25 +02:00
Megamouse e171f3af41 unself: rename SelfHeader to ext_hdr 2023-04-21 17:56:25 +02:00
Ivan Chikish 1041284384 SPU LLVM: sink stores deeper in custom LICM pass 2023-04-21 18:11:59 +03:00
Megamouse 6555de6ef5 fix warnings 2023-04-21 16:41:06 +02:00
Eladash b81e77cffa Remove add_only from main_window::Boot args 2023-04-21 12:14:44 +02:00
Eladash a1741f21cc Optimize AddGamesFromDir a bit 2023-04-21 12:14:44 +02:00
Eladash 76a36f45bf Reduce IO With Game Library Loading 2023-04-21 12:14:44 +02:00
Luiz a767beec60 Path to LLVM library fixed in Debug 2023-04-20 12:10:34 +03:00
Ivan Chikish 183bea3b98 SPU LLVM: upgrade custom DSE pass 2023-04-20 11:12:31 +03:00
kd-11 6981cbb985 formatting 2023-04-19 14:21:15 +03:00
kd-11 fdfcc6c5ea gl: Refactor attachment clear logic
- Make the whole thing a standalone command to avoid unnecessary state meddling.
2023-04-19 14:21:15 +03:00
Megamouse b86ecf7441 Keep preceding 0 in firmware strings 2023-04-19 08:06:30 +02:00
Megamouse 5107d1b69b Keep second 0 in firmware strings 2023-04-19 08:06:30 +02:00
Megamouse e133c8c2c3 Qt: add option to reset time played 2023-04-19 00:36:35 +02:00
Megamouse 450ab7c289 Qt: add grid filters 2023-04-18 23:46:02 +02:00
Megamouse 32bfb808ae Qt: add checkbox to restart dialog 2023-04-18 20:08:21 +02:00
Ivan Chikish 1f19804cab BufferUtils: fix SSE2 path for byteswaps 2023-04-18 16:46:18 +03:00
kd-11 9ff6003dfc rsx: Add Ultra shader precision setting for costly accuracy settings 2023-04-18 16:25:16 +03:00
kd-11 f725ea7d0d vk: Promote barycentric interpolation to 64-bit 2023-04-18 16:25:16 +03:00
Ivan Chikish 39d17a94c6 SPU LLVM: make savestates unsavable inside the code 2023-04-18 12:19:15 +03:00
Ivan Chikish 8153e5338f SPU LLVM: optimize register stores
Custom implementation of DSE+LICM
2023-04-18 12:19:15 +03:00
RipleyTom 999caea021 Implement sceNpManagerGetCachedInfo 2023-04-17 21:13:44 +02:00
shockdude b70665865f Invert the DJ Hero Turntable crossfader axis bind.
On Xbox 360 turntables, Crossfade Left is Y Down, Crossfade Right is Y Up.
Also simplify turntable/left stick input.
2023-04-16 13:21:57 +02:00
shockdude 6a9e0c52c3 Round squircled axis values to nearest whole number 2023-04-16 10:41:44 +02:00
Ivan Chikish 44b3709d1d SPU LLVM: use volatile stores for PC update 2023-04-15 12:40:59 +03:00
kd-11 b060165817 jit: Fix vec_cmp_eq<u32>
- Emit pcmpeqd instead of the incorrect pcmpeqw
2023-04-15 12:16:15 +03:00
RipleyTom 98fc073f89 Fix tmp path in updater 2023-04-14 19:16:27 +02:00
Ivan Chikish ba29f0ccd1 SPU LLVM: use atomic loads in read channel count 2023-04-14 13:36:04 +03:00
Ivan Chikish 3473e19508 SPU LLVM: fix savestate safety guards
Volatile was removed since it prevented optimizations.
2023-04-14 07:26:30 +03:00
Ivan Chikish 22bd7dcc42 PPU LLVM: disable DSE pass and use volatile store/loads 2023-04-14 07:26:30 +03:00
Eladash 79d09d02ed Add savestate buttons to home menu 2023-04-13 20:46:37 +02:00
Megamouse a6313fa46c cellMic: fix mic type regression 2023-04-13 20:00:05 +02:00
Megamouse 2a7431bd61 cellMic: fallback to proper sampling rate if necessary 2023-04-13 20:00:05 +02:00
Megamouse 90851459c8 cellMic: change some log levels 2023-04-13 20:00:05 +02:00
Megamouse 27c9bf137c cellMic: fallback to 4,2,1 channels by default 2023-04-13 20:00:05 +02:00
Megamouse 2205790dd4 cellMic: add some error checks 2023-04-13 20:00:05 +02:00
Megamouse 0115c2f70a cellMic: minor format changes for readability 2023-04-13 20:00:05 +02:00
Elad Ashkenazi 7bce99d77b Debugger: Fix step over (#13649) 2023-04-12 20:55:07 +02:00
kd-11 47b65868f4 Try even lower 2023-04-12 18:47:14 +03:00
kd-11 8735a06f3c vk: GTX970 workaround 2023-04-12 18:47:14 +03:00
RipleyTom d35fecbeea Forces deterministic FP operations when online 2023-04-12 15:31:36 +03:00
Eladash 0e388639cc Loader: Make executable analyzation not halt UI when launching games 2023-04-12 15:18:50 +03:00
RipleyTom 17e6ad1fe8 Fix deref in cellSaveData log 2023-04-12 11:58:24 +02:00
nastys a3f077c783 Update build-mac.sh 2023-04-12 11:04:30 +02:00
Joshua de Reeper 86b3229746 Skylander Portal: Trap Team Audio Transfers 2023-04-11 20:04:51 +02:00
Ivan Chikish 06b0e35fb9 Update to LLVM 16.0.1
Fix Zen4+ AVX-512 detection
2023-04-11 12:13:09 +03:00
oltolm 6fbca1acfd remove unnecessary pointer bitcasts 2023-04-09 12:45:18 +03:00
brian218 f0e36c6365 Updated BUILDING.md according to the changes made by #13622 2023-04-08 08:36:25 +02:00
RipleyTom e9cb7000cc Fix BUILD_LLVM option 2023-04-08 08:05:13 +02:00
RipleyTom 0e8b0e414a Improve cellMic and sys_usbd thread scheduling 2023-04-07 23:36:32 +02:00
headassbtw ec3114d6d8 Add alternate 3D display modes (#13582) 2023-04-07 20:08:07 +02:00
Megamouse 60fc51ed22 cellGcm: add more enums 2023-04-07 19:40:21 +02:00
Megamouse 603b775f4a llvm: fix submodule path
- Use official llvm repo
- Move llvm to 3rdparty
- Ignore SPIRV submodules in CI
2023-04-07 18:25:59 +02:00
kd-11 964ce3d6aa rsx: Add a clip_width workaround for some buggy games 2023-04-07 12:39:23 +03:00
Ivan Chikish fb88e1c1c9 Update to LLVM 16.0.0, switch to upstream LLVM 2023-04-06 10:19:31 +03:00
Megamouse 7081b89e97 Update dependencies
Update wolfssl to v.5.6.0-stable
Update curl to v8.0.1
Update SDL to v2.26.4
2023-04-05 22:54:53 +02:00
Elad Ashkenazi c6ab1aa227 Fix emulator crash when stopping emulation after being paused (#13530) 2023-04-05 21:53:01 +02:00
brian218 8a509afc20 sys_fs: Implemented CELL_FS_PATH path-as-device support 2023-04-05 18:08:55 +02:00
brian218 6a95e0877b sys_fs: Fix warning C6262 2023-04-05 18:08:55 +02:00
brian218 28c37ab465 sys_fs & VFS: Misc bug fixes 2023-04-05 18:08:55 +02:00
Elad Ashkenazi 842edbcbe7 Add Qt Creator .autosave files to .gitignore (#13597) 2023-03-31 17:05:51 +03:00
Megamouse 3e556c710b cellMusicExport: first implementation 2023-03-31 15:25:21 +02:00
Megamouse 4289ffef1c cellPhotoExport: add funcFinish check 2023-03-31 15:25:21 +02:00
RipleyTom 0c051a83a7 Fix mic thread usage 2023-03-30 08:14:28 +02:00
kd-11 82dedb1fbb vk: Fix vendor detection for apple 2023-03-29 17:31:06 +03:00
kd-11 04c0f309be vk: Obey safe/unsafe hint for D16F emulation 2023-03-29 17:31:06 +03:00
RipleyTom 8408d51359 Increase delay for GHL and TT int transfers 2023-03-29 11:25:18 +02:00
Megamouse a8ada492b2 cellMic: fix registration index 2023-03-28 20:26:04 +02:00
Megamouse 55d6ee65ae cellAudio: silence cellAudioSendAck and add pseudo code for it 2023-03-28 20:26:04 +02:00
Megamouse 69ecf8aea7 cellAudio: re-use event_sources array 2023-03-28 20:26:04 +02:00
Megamouse f2b51668b4 cellMic: use fixed index for devices 2023-03-28 20:26:04 +02:00
Megamouse c2527c9e1b cellMic: wait for registration of multiple input devices 2023-03-28 20:26:04 +02:00
Megamouse 0bcd45c1d4 cellMic: add some additional error check and silence log spam 2023-03-28 20:26:04 +02:00
Megamouse ecf0022fd1 cellMicGetSignalState: fake some more values
Maybe this improves the mic signal even more
2023-03-28 20:26:04 +02:00
shinra-electric 4d4a70ad0e Update MoltenVK to 1.2.3 (Vulkan SDK 1.3.243) 2023-03-25 09:34:18 +01:00
RipleyTom 0f45a8c180 Fix inaccuracies pointed out by PVS-Studio 2023-03-25 08:45:30 +01:00
kd-11 ad3e740c09 vk: Separate vertex and fragment stage push constant updates for overlays 2023-03-23 21:14:23 +03:00
Elad Ashkenazi 7e6cc02e09 Fix an emulator crash in Emulator::SaveSettings (#13567) 2023-03-21 10:12:39 +01:00
RipleyTom 7000ef4471 Fix timeout spam from signaling 2023-03-19 22:31:50 +01:00
Eladash 0beda6fa89 Savestates: Fix deadlock on savestate load 2023-03-18 12:07:17 +03:00
Eladash a41d2e43fd cellFsReaddir: Fix termination sequence 2023-03-18 12:07:17 +03:00
RipleyTom c98158b460 Add buf_to_hexstring 2023-03-18 01:51:35 +01:00
RipleyTom 02a53c582c Invite changes 2023-03-18 01:51:35 +01:00
RipleyTom 192f4825a2 Fix recvn high cpu usage 2023-03-17 23:50:40 +01:00
RipleyTom bcce3acd5f Signaling: report status inactive on unknown connection 2023-03-17 17:58:56 +01:00
RipleyTom 8cd6b9275a Fix timestamps in signaling_handler 2023-03-17 17:07:25 +01:00
Megamouse 5fa9dfac6a Trophies: log more specific errors on install failure 2023-03-17 15:50:05 +01:00
RipleyTom fe51c7b960 Use relative urls in .gitmodules 2023-03-17 15:17:18 +03:00
oltolm cf5346c263 use new LLVM API in SPURecompiler 2023-03-12 10:11:06 +03:00
Ivan Chikish 776b3b5efa SPU LLVM: fix regression from #13500
Fixes #13526
2023-03-11 19:48:55 +03:00
oltolm 520524285a llvm: update code to new API (#13500)
* llvm: update code to new API

* llvm: remove OLDLLVM define
2023-03-11 01:57:21 +03:00
RipleyTom ec8cb1668c Fix hid_pad_handler 2023-03-10 15:23:55 +01:00
RipleyTom 1b7b59466d Add missing spinning icon from resources 2023-03-09 22:34:23 +01:00
Elad Ashkenazi e45e9c20dd PPU: Do not break on unexpected TOC (#13490) 2023-03-09 16:53:44 +03:00
RipleyTom 450cb1771c Add better error handling for RequestSignalingInfos 2023-03-08 18:25:26 +01:00
RipleyTom f7a3d45c2c Use NBIO for RPCN 2023-03-08 13:11:33 +01:00
Eladash 65eb625843 cellSaveData: Slow save completion 2023-03-07 13:01:21 +01:00
Megamouse c06b957a8a hid: try to fix linux 2023-03-06 14:36:14 +01:00
Megamouse 05064dfaf4 cellVdec: revert RGBA alignment change 2023-03-05 22:49:49 +01:00
Megamouse 425610b98a Use win_error for WSAGetLastError 2023-03-05 22:49:49 +01:00
Megamouse 0d34b97948 overlays: apply message fade in during lifetime extension if necessary 2023-03-05 02:55:59 +01:00
Megamouse c6426245e4 overlays: refresh existing compile message expiration 2023-03-05 02:55:59 +01:00
Megamouse 6fe41870ab overlays: properly remove outdated messages from the queue.
Fixes zombie item glitch if a newer message has shorter duration than the older message
2023-03-05 02:55:59 +01:00
Megamouse 2d4e02f277 overlays: add ppu compile message if the progress dialog is unavailable 2023-03-05 02:55:59 +01:00
Megamouse 6d7d3fff6d Improve some decryption log messages 2023-03-05 02:55:59 +01:00
Megamouse cc145eaf2e patches: fix move_file/hide_file error 2023-03-04 19:18:36 +01:00
Megamouse da6d1d359c hid/ds4: add logging for PID and VID 2023-03-04 19:18:36 +01:00
Megamouse 92ae57c9ee Windows: log more descriptive errors 2023-03-04 18:34:56 +01:00
Megamouse 8409979dc5 Qt: Disable some network settings in global config. Re-enable RPCN in global config. 2023-03-04 18:34:56 +01:00
Elad Ashkenazi 8bc92a2cbb VFS: Fix mounting non-existant paths (#13488) 2023-03-04 17:12:45 +01:00
RipleyTom 2de4c03faa Fix wolfssl connect 2023-03-03 22:51:01 +01:00
Eladash 382a7c94a2 Patches: Virtual move/remove game files patches 2023-03-03 20:56:11 +01:00
Megamouse 1d7a00666e rpcn: throw exception when using rpcn features without a proper config 2023-03-03 11:30:39 +01:00
Megamouse 14c0289542 Qt: disable psn setting in global settings
Also move some common code to helper functions
2023-03-03 09:05:30 +01:00
Megamouse 69ebdfd689 cellMic: random improvements 2023-03-03 08:27:42 +01:00
Megamouse fc21ece784 pkg install: return correct error if possible. Add more early outs and skip workers on error, 2023-03-02 23:27:20 +01:00
kd-11 a3ededdcf1 rsx: Implement deferred buffer allocations for GPU write 2023-03-02 12:48:58 +03:00
Ani 0178b20983 rpcs3_version: Bump to 0.0.27 2023-03-01 21:56:02 +00:00
JoãoPaulo f9142a1c56 Update FW 4.90 Latest Version
Updates the latest FW version according to: https://www.playstation.com/en-us/support/hardware/ps3/system-software/
List of changes:
This system software update improves system performance.
2023-03-01 20:25:24 +01:00
oltolm b19209c45c [3rdparty] update cubeb 2023-03-01 18:03:55 +01:00
Megamouse 73b5b9d7b7 cellRtc: fix out of bounds write
Turns out you should listen to warnings once in a while...
sprint actually wrote more than 3 characters into the microDigits buffer !!!
2023-03-01 10:15:21 +01:00
kd-11 0a9d646bd7 rsx: Workaround for clang build 2023-03-01 01:10:06 +03:00
kd-11 24edfe2190 rsx: Use simple_array for basic array of integers
- Some methods are getting spammed every draw call
2023-03-01 01:10:06 +03:00
kd-11 0bb8127372 rsx: Use emplace when constructing in-place.
- Unexpectedly high gains for msvc builds. GCC doesn't care, clang shits itself.
2023-03-01 01:10:06 +03:00
kd-11 1b8a69154f rsx: Use non-owning container to ellide a derpy allocation with msvc 2023-03-01 01:10:06 +03:00
illusion0001 f2155b49e2 Debugger: show CIA in register view (#13462) 2023-02-28 00:30:23 +01:00
Eladash 62c9b99e72 Update SPUThread.cpp 2023-02-27 14:17:05 +01:00
Elad Ashkenazi 2a344e1d87 cellMsgDialog: fix use-after-free 2023-02-27 14:17:05 +01:00
Megamouse ae14aa991d overlays: hotfix for return_code lifetime 2023-02-27 12:04:10 +01:00
Megamouse 2885c8a4ab cellSaveData: get rid of g_last_user_response 2023-02-27 10:24:06 +01:00
Megamouse 3d411431c6 input: disable ldd home menu for now 2023-02-26 22:17:55 +01:00
oltolm 1800faf0dd cellVdec.cpp: use lock_unlock instead of lock_guard 2023-02-26 22:20:07 +03:00
oltolm 19ded3809f fix out-of-bounds in VKGSRenderTypes.hpp 2023-02-26 22:20:07 +03:00
oltolm 40cd255051 fix: back() called an empty string in PPUThread.cpp 2023-02-26 22:20:07 +03:00
oltolm ad4677a67c fix use after move in cellVdec.cpp 2023-02-26 22:20:07 +03:00
RipleyTom d9e0d016c6 Fix for Windows ENOTCONN on connecting socket
Fixes Windows returns ENOTCONN when using recvfrom/sendto on connecting socket instead of the expected EAGAIN.
2023-02-26 10:35:20 +01:00
kd-11 c570fd03d1 rsx/overlays: Handle corner case where thread signal happens just before pop_all is called. 2023-02-26 02:30:16 +03:00
kd-11 1e0565f17b rsx/overlays: Fix emu close 2023-02-26 02:30:16 +03:00
Megamouse 3ff464641a Fix Visual Studio 17.5.0 compilation
For some reason there's an internal compiler error related to atomic wait.
I could work around this issue when I commented "mask = default_mask<X>;".
So after playing around a bit I had the suspicion that the VS parser can't handle some of the templatization.
Giving the decltype its own alias seems to fix this issue (and makes the code a bit more readable anyway in my opinion).
2023-02-25 19:20:55 +03:00
Megamouse 7cb3d305d4 main: set locale to C before doing anything else 2023-02-25 11:23:07 +01:00
Megamouse e46dba43ad config: try to fix float locale issues 2023-02-25 11:23:07 +01:00
Megamouse afad96a52a Qt: try to fix QString::toDouble locale nonsense 2023-02-25 11:23:07 +01:00
RipleyTom 1a00341e6b Forces local IP to bind address if set 2023-02-25 10:38:19 +01:00
kd-11 3388c8ed09 overlays/manager: Explicit ctor for the input context 2023-02-24 00:46:53 +03:00
kd-11 6d4967ffef [overlays] Implement input suspend+resume
- Tested with OSK + home menu. Requires hacks to enable this setup so it's mostly an academic achievement.
2023-02-24 00:46:53 +03:00
kd-11 b27366e1e6 rsx/overlays: Enable input hijacking 2023-02-24 00:46:53 +03:00
kd-11 95a29b5d1d rsx/overlays: Fix clang/msvc build 2023-02-24 00:46:53 +03:00
kd-11 d320867569 rsx/overlays: Add a name to the input thread context 2023-02-24 00:46:53 +03:00
kd-11 aabd388070 rsx/overlays: Remove some unused thread declarations 2023-02-24 00:46:53 +03:00
kd-11 7db6594358 rsx/overlays: Use lf_queue for a lock-free stack implementation 2023-02-24 00:46:53 +03:00
kd-11 388ca1c645 rsx/overlays: Fix build 2023-02-24 00:46:53 +03:00
kd-11 7c04b00e2b rsx/vk: Remove stale include 2023-02-24 00:46:53 +03:00
kd-11 dac0644f07 rsx/overlays: Fill in the user response when message dialog input loop exits and we're in blocking mode
- Avoids a race condition caused by the "blocking" call only updating results on cleanup/close
2023-02-24 00:46:53 +03:00
kd-11 7d103fe0f0 rsx/overlays: Fix crash 2023-02-24 00:46:53 +03:00
kd-11 901d9f3f6e rsx/overlays: Simplify attach-thread-input API
- Restructure the inputs to encourage shorter input signature.
2023-02-24 00:46:53 +03:00
kd-11 ddc9e74aa8 rsx/overlays: Putting it all together
- Migrate dialogs with input-only threads to use the unified input
  system
2023-02-24 00:46:53 +03:00
kd-11 12690de9de rsx/overlays: Refactor and implement callbacks for input token 2023-02-24 00:46:53 +03:00
Megamouse 6b30cdac09 Use u64 for system_time_t, as s64 doesn't make much sense in a microsecond context. 2023-02-22 23:57:20 +01:00
Megamouse ccb7528a59 fix some warnings 2023-02-22 23:57:20 +01:00
Ivan Chikish 01ed8a07af fixed_typemap.hpp: static allocation for m_init
This allows to safely call is_init<T>() at any time.
2023-02-23 00:54:35 +03:00
Megamouse a9f399d6cc patch_manager: fix focus loss during config value editing 2023-02-22 01:17:36 +01:00
Megamouse a527a485f8 patch_manager: add more decimal places to spinbox 2023-02-22 01:17:36 +01:00
Megamouse f0c8f6d47b patch_manager: check config values before applying them 2023-02-22 01:17:36 +01:00
Megamouse a29dc3893f patch_manager: change wording 2023-02-22 01:17:36 +01:00
Megamouse c6f392bf6c patch_manager: allow multiple dynamic values 2023-02-22 01:17:36 +01:00
Megamouse f2ded2fdb7 patch_manager: Add dropdown labels 2023-02-22 01:17:36 +01:00
Megamouse 080737fd1f patch_manager: add more dynamic to dynamic patches 2023-02-22 01:17:36 +01:00
Megamouse 1040757556 patch_manager: add ability to add dynamic patches 2023-02-22 01:17:36 +01:00
Megamouse 38d612e5ba fix some warnings 2023-02-22 00:15:11 +01:00
Megamouse c20aa2ad5f VS: fix miniupnp dependency 2023-02-22 00:15:11 +01:00
Megamouse a7c3753c5a cellMsgDialog: Improve some logging and localization 2023-02-21 23:35:13 +01:00
Megamouse ebf72eb126 overlays: add internal lock for progress bar texts 2023-02-21 23:35:13 +01:00
Megamouse be49a80bc7 overlays: use array for progress bars 2023-02-21 23:35:13 +01:00
brian218 23da770364 sys_game: LV2 board storage minor fixups 2023-02-21 22:57:37 +01:00
RipleyTom 6186ac0245 rpcn: signaling handler improvements & upnp
Simplify signaling by making Matching2 a layer over normal signaling.
Implements UPNP port forwarding
Implement sceNpMatching2AbortRequest
Fix reported bw in sceNpUtil
Hack for Fat Princess binding udp on 3658
Reenable CB for sceNpBasicAddPlayersHistoryAsync
Misc fixes
2023-02-21 15:41:41 +01:00
Megamouse 364c33060b Fix boot by RPCS3_GAMEID constants 2023-02-20 22:53:22 +01:00
Elad Ashkenazi 3922f76ab5 PINE: Fix crash on exit (#13409) 2023-02-20 09:59:40 +01:00
Megamouse bb2c9196f5 cellVdec: align RGBA/ARGB strides 2023-02-18 22:43:22 +01:00
Megamouse 1c8d3e0dca cellVdec: fix au_count race condition 2023-02-18 15:31:21 +01:00
Megamouse 6b556a5206 PINE: fix error format function 2023-02-17 19:33:58 +01:00
oltolm bbd308a908 fix order of static initialization: add comment 2023-02-17 11:58:40 +03:00
oltolm b5b8f7c35a fix order of static initialization 2023-02-17 11:58:40 +03:00
Megamouse de592267fe Create TEST12345/USRDIR for test elfs 2023-02-16 20:51:57 +01:00
Margen67 5bb89328d0 Remove whitespace 2023-02-15 08:58:02 +01:00
Megamouse 75fbb3d551 Qt: save last gs_frame screen and re-use it in no-gui mode 2023-02-14 08:03:26 +01:00
Megamouse eb0fb2fef7 Qt/CLI: Add option to select a screen for the game window 2023-02-14 08:03:26 +01:00
Megamouse b1b92e95ab Qt: move fullscreen cli arg from global to gs_frame 2023-02-14 08:03:26 +01:00
Megamouse 3a68b7ac0d Fix C00 boot from external HG games 2023-02-13 07:31:58 +01:00
Eladash 3976018980 Debugger: Print error codes stored in GPR 2023-02-12 23:10:20 +01:00
Megamouse 1dac708323 cellPad: move CellPadData to pad_types for convenience 2023-02-12 17:04:31 +01:00
Megamouse d4187242b9 cellPad/vsh: fix PS button recognition 2023-02-12 17:04:31 +01:00
Megamouse 61c0d81667 cellPad/vsh: fix sixaxis interaction
This allows you to influence the particles in the XMB
2023-02-12 17:04:31 +01:00
Megamouse c3e4b6da46 cellPad: allow opening the home menu with ldd pads
Speculative
2023-02-12 17:04:31 +01:00
Megamouse 38c7cf474d cellPad: add sanity check for indices in cellPadLdd functions 2023-02-12 17:04:31 +01:00
Megamouse ec4cbe5380 cellPad: simplify some code 2023-02-12 17:04:31 +01:00
Vestral 465ca97531 Fix displaying of audio device when it's disconnected 2023-02-10 04:19:20 +01:00
Megamouse 2f7a2d5134 Update hidapi from 0.13.0 to 0.13.1 2023-02-09 23:34:07 +01:00
Megamouse c1b5af21f0 Update SDL from 2.26.2 to 2.26.3 2023-02-09 23:34:07 +01:00
Megamouse cfb788941c overlays: review fixes 2023-02-09 20:36:35 +01:00
Megamouse 69435dd951 overlays: Fix linux compilation 2023-02-09 20:36:35 +01:00
Megamouse 3b09a39576 overlays: fix home menu date format 2023-02-09 20:36:35 +01:00
Megamouse 53f81ce9c7 overlays: fix home menu entry center alignment 2023-02-09 20:36:35 +01:00
Megamouse e064380a7d overlays: add message box to home menu 2023-02-09 20:36:35 +01:00
Megamouse 9375e255e1 overlays: add pages to home menu 2023-02-09 20:36:35 +01:00
Megamouse a56fc57a83 evdev: allow more buttons on sony guitar 2023-02-09 18:09:07 +01:00
Megamouse 4f75dc06b9 evdev: optimize get_next_button_press pad id check 2023-02-09 18:09:07 +01:00
Megamouse d3b7a5146c rsx_debugger: replace malloc with buffer cache
This also fixes a memory leak.
2023-02-09 00:02:43 +01:00
Megamouse bc487f43f7 cli: Add option to boot a game with a specific pad profile 2023-02-08 21:54:51 +01:00
Megamouse 088ac71930 cli: allow to start games in fullscreen
Technically this can be done through configs, but since it is easy to do, let's just add the cli option.
2023-02-08 21:54:51 +01:00
Eladash 27cad422b9 cellGame: Truncate excess of characters in TITLE_ID
In cellGameDataCheckCreate
2023-02-07 18:21:18 +03:00
Megamouse 5a63271f0e Fix openGl overlay colors 2023-02-07 13:40:47 +01:00
kd-11 9a35684507 rsx: Don't accept garbage shader input 2023-02-07 13:51:26 +03:00
RipleyTom 0d2714a1d9 FAudio cmake fix 2023-02-07 08:54:41 +01:00
Megamouse 553e4b28bf Disable 3rdparty FAudio if the SDL version is not available 2023-02-06 21:41:20 +01:00
Megamouse b579e45ed7 Update SDL download link 2023-02-06 21:41:20 +01:00
Megamouse 1662bcfae4 Qt: add copy context menu entry to log viewer 2023-02-06 20:43:53 +01:00
Elad Ashkenazi 8652b7d358 cellVdec: Fix AU decode count on callback (#13342) 2023-02-05 13:02:51 +01:00
Megamouse 1cf8aacc11 CLI: add option to boot rsx capture 2023-02-05 11:47:08 +01:00
Megamouse 13ef4c1236 Clarify unknown type log message 2023-02-05 09:36:56 +01:00
Megamouse 68dd25a4a5 Replace std::filesystem::u8path with TODO 2023-02-05 09:36:56 +01:00
Megamouse bcb1c6c080 Fix package installation exit condition after error occured 2023-02-05 09:36:56 +01:00
Megamouse 2372116acc Improve logging during package installations 2023-02-05 09:36:56 +01:00
kd-11 508dd2b509 rsx: Formatting change 2023-02-05 01:30:20 +03:00
kd-11 61b69eeed2 rsx/overlays: Force disable rounded rectangles on macOS 2023-02-05 01:30:20 +03:00
kd-11 dc8652806e rsx/overlays: Support disabling vertex-snap on a per-draw-call basis 2023-02-05 01:30:20 +03:00
kd-11 af6db7d895 rsx/overlays: Remove workaround no longer required 2023-02-05 01:30:20 +03:00
kd-11 64ec99be33 rsx: Unify UI rendering shaders 2023-02-05 01:30:20 +03:00
brian218 53e906d0f3 sys_game: Implemented sys_game_board_storage_write() & Made it modifiable 2023-02-04 22:19:59 +01:00
Elad Ashkenazi 780a6a7b40 sys_prx: Fix PRX module filename reading (#13339) 2023-02-04 21:24:24 +01:00
RipleyTom 737fbf661a Add more disconnected limitations in sys_net 2023-02-04 20:33:21 +01:00
kd-11 c0243a92d0 rsx/overlays: Re-export spinner
Fixes some incorrect black pixels
2023-02-04 17:36:09 +01:00
Megamouse 3a8fcd1b0b Update wolfssl from 5.5.0 to 5.5.4 2023-02-04 16:57:22 +01:00
Megamouse 04d9693b51 Update FAudio from 22.08 to 23.02 2023-02-04 16:57:22 +01:00
Nicolas Adenis-Lamarre 0023716053 - fix analog_t required for some games
- changing mapping to better fit to games (for example, select is rarely used)

Signed-off-by: Nicolas Adenis-Lamarre <nicolas.adenis.lamarre@gmail.com>
2023-02-04 16:10:40 +01:00
kd-11 37b46df738 rsx/overlays/message-queue: Do not fade albedo, only alpha 2023-02-04 16:08:20 +03:00
illusion0001 ba06198012 GUI: Remove ANSI color code from TTY 2023-02-04 10:51:19 +01:00
Elad Ashkenazi acf9caa4ae Game list: Use the latest game icon instead of 1.00's (#13340) 2023-02-04 07:41:30 +01:00
Megamouse d69e345bc0 SDL: Fix button presses
SDL currently always returns 1 if a button is pressed
2023-02-03 18:24:54 +01:00
Megamouse c5b25fa132 Remove obsolete shader compilation hint settings 2023-02-03 09:27:04 +01:00
kd-11 262ecda2bf rsx/overlays: Cache the loading animated icon
Smooths out some frametime spikes when showing the notification message
2023-02-03 09:13:27 +03:00
kd-11 f243539362 rsx/overlays: Make animation caching possible 2023-02-03 09:13:27 +03:00
kd-11 ec33891f6f rsx/overlays: Work around some commitee grandstanding shenanigans
ffs: https://bugs.launchpad.net/ubuntu/+source/gcc-8/+bug/1831385
2023-02-03 09:13:27 +03:00
kd-11 f007188fa0 rsx/overlays: Minor fixups 2023-02-03 09:13:27 +03:00
kd-11 170fd813f0 rsx/overlays: Ellide redundant clock read 2023-02-03 09:13:27 +03:00
kd-11 4c59359cf7 rsx/overlays: Add time unit to some measured variables 2023-02-03 09:13:27 +03:00
kd-11 ddf25b7869 rsx/overlays: Shorten notification fadeout 2023-02-03 09:13:27 +03:00
kd-11 4914f3b2c3 rsx/overlays: Fix msvc project files 2023-02-03 09:13:27 +03:00
kd-11 08faed7d86 rsx/overlays: Naming sense 2023-02-03 09:13:27 +03:00
kd-11 989e0f28d6 rsx/overlays: Remove redundant resize 2023-02-03 09:13:27 +03:00
kd-11 54f41095e9 rsx/overlay: Some cleanup in animated icon class 2023-02-03 09:13:27 +03:00
kd-11 faaa72d398 rsx: Reverse declaration order for animated icon 2023-02-03 09:13:27 +03:00
kd-11 97b36eb53c cmake: Add shader compile notification to build system 2023-02-03 09:13:27 +03:00
kd-11 2503525016 rsx/overlays: Move shader compiling notification to a separate cpp file 2023-02-03 09:13:27 +03:00
kd-11 e96fedfefe rsx/overlays: Darken background a bit 2023-02-03 09:13:27 +03:00
kd-11 f279d8d6d1 rsx: Lower shader notification duration to 5 seconds 2023-02-03 09:13:27 +03:00
kd-11 4bfba20877 rsx: Remove unnecessary debug pragma 2023-02-03 09:13:27 +03:00
kd-11 504bd93007 rsx: Implement overlay message queue stacking 2023-02-03 09:13:27 +03:00
kd-11 2f2fe72808 ui: Add 24x24 loading animation 2023-02-03 09:13:27 +03:00
kd-11 5babf47e70 build: Fix linux build 2023-02-03 09:13:27 +03:00
kd-11 78a588cacb rsx: Use animated icon and message queue for shader compiler notifications 2023-02-03 09:13:27 +03:00
kd-11 205f8a6479 rsx: Fix message queue order and positioning 2023-02-03 09:13:27 +03:00
kd-11 34c1e1a9ad rsx: Add support for rounded rectangles 2023-02-03 09:13:27 +03:00
kd-11 0885884839 rsx: Implement notification queue 2023-02-03 09:13:27 +03:00
Elad Ashkenazi c471120a80 System.cpp: Do not create VFS directories outside of RPCS3 dir (#13311) 2023-01-29 11:29:26 +01:00
Megamouse 3202cc7021 overlays/osk: fix y offset direction facepalm 2023-01-28 23:13:51 +01:00
Megamouse fc34b3f144 cellOskDialog: improve kb event hook callback 2023-01-28 21:51:36 +01:00
Megamouse fb974a4551 overlays/osk: clear on enter 2023-01-28 21:51:36 +01:00
Megamouse 3d99fea575 overlays/osk: Do not render preview background in separate windows mode 2023-01-28 21:51:36 +01:00
Megamouse feb04c64a8 overlays/osk: show dialog on key input 2023-01-28 21:51:36 +01:00
Megamouse d3dbf9e83f overlays/osk: Clear text properly in continuous mode 2023-01-28 21:51:36 +01:00
Megamouse 9b6d7a5275 cellOskDialog: don't wait for osk event_hook_callback 2023-01-28 21:51:36 +01:00
Megamouse 754fd03750 overlays/osk: hide title in separate window mode 2023-01-28 21:51:36 +01:00
Megamouse adfa5d63bb overlays/osk: fix dialog positioning 2023-01-28 21:51:36 +01:00
Megamouse 81ff956a48 cellOskDialog: use getter instead of weak_ptr 2023-01-28 21:51:36 +01:00
Megamouse daefe27fec overlays: allow keyboard input if pads are intercepted 2023-01-28 21:51:36 +01:00
Megamouse 6106ff8b31 overlays/osk: fix cellOskDialogExtInputDeviceLock 2023-01-28 21:51:36 +01:00
Megamouse 1e6c180690 overlays: don't flip if the overlay is invisible 2023-01-28 21:51:36 +01:00
Megamouse d1a950d59f overlays/osk: keep dialog open in continuous mode 2023-01-28 21:51:36 +01:00
Megamouse 641fadc1fb overlays/osk: handle input device change 2023-01-28 21:51:36 +01:00
Megamouse 5299061282 overlays/osk: visualize separate windows 2023-01-28 21:51:36 +01:00
kd-11 d0c029c83e rsx: Ignore bad face mode configuration 2023-01-28 21:11:32 +03:00
Eladash 5aced2e44b Print LV2 Syscall Usage only if increased since last print 2023-01-28 17:21:45 +01:00
Ani 18ab42dc83 readme: Remove Azure, rename Cirrus CI badges 2023-01-28 14:43:54 +01:00
Jan Beich a748508bc9 evdev_gun: enable udev code on BSDs
libudev is supported on DragonFly and FreeBSD, similar to libevdev.
NetBSD and OpenBSD can simply disable both via -DUSE_LIBEVDEV=OFF.

This reverts commit 337ee77a99.
2023-01-28 12:35:42 +00:00
shinra-electric 8b453e6a3b Update MoltenVK to 1.2.2 (VK 1.3.239) 2023-01-28 11:52:11 +00:00
Jan Beich 3196ada481 vk: Drop deprecated (239) and removed (240) header
In file included from rpcs3/Emu/System.cpp:55:
rpcs3/Emu/RSX/VK/VulkanAPI.h:17:10: fatal error: 'vulkan/vk_sdk_platform.h' file not found
 #include <vulkan/vk_sdk_platform.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~
2023-01-28 01:26:12 +01:00
RipleyTom 7c4734c24d Fix SDL CMake warnings 2023-01-27 17:02:13 +01:00
Malcolm Jestadt 813f7b50c1 SPU LLVM: Minor SUMB AVX-512 path optimization
- Tweak shuffle to allow LLVM to emit a cheap blend instruction instead of the expensive VPERMI2W instruction
2023-01-27 13:06:48 +03:00
Megamouse 6532d2b650 input: fix dynamic pad handler mode reset 2023-01-27 00:13:20 +01:00
Megamouse e0baad417a perfoverlay: fix minimal graph min/max calculation 2023-01-27 00:13:20 +01:00
Megamouse f6759de1e9 Qt: fix vfs dialog usb tab cast 2023-01-26 21:33:39 +01:00
brian218 7648171fe2 sys_usbd: Improved usb_handler_thread timing 2023-01-26 15:52:45 +01:00
brian218 71c3264ea7 USIO: Always resize the response vector to the given size 2023-01-26 15:52:45 +01:00
brian218 49455965c0 sys_game: Implemented sys_game_get_rtc_status() & Updated sys_game_board_storage_read() 2023-01-26 15:52:45 +01:00
kd-11 5f0467b084 rsx: Remove framebuffer_status_valid flag and move to state 2023-01-26 11:42:39 +03:00
kd-11 6adcabda29 rsx: Fix graphics state foot-gun 2023-01-26 11:42:39 +03:00
Anton Kourganov 52b67b46fc Allow unbinding pad buttons by right clicking (#13283) 2023-01-23 22:00:08 +01:00
MSuih a700e3b39e Whitelist EA Active 2 accessories 2023-01-23 17:02:51 +01:00
Egor Romanovskiy 4fbbdf8732 sys_usbd: fix usb handler deinitialization 2023-01-23 12:32:09 +01:00
Elad Ashkenazi 9a91fef337 Deprecate HDD0/disc, make RPCS3/games movable (#13265) 2023-01-23 08:00:46 +01:00
nastys 53cc067c17 macOS CI: move to AArch64 VM (x64 builds) (#13155) 2023-01-21 21:21:41 +01:00
Megamouse d3183708e8 overlays: do not open home menu in VSH 2023-01-21 09:11:53 +01:00
Megamouse 44771150b7 overlays: add simple home menu 2023-01-21 09:11:53 +01:00
Megamouse ac2b2d82d2 overlays/osk: move pointer variables to fxo 2023-01-20 23:41:56 +01:00
Megamouse 11c42eb8d4 overlays/osk: add analog movement if CELL_OSKDIALOG_NO_INPUT_ANALOG is unset 2023-01-20 23:41:56 +01:00
Megamouse dc0230c476 overlays/osk: Fix layout and positioning 2023-01-20 23:41:56 +01:00
Megamouse 0a8c343e6e cellOskDialog: cellOskDialogSetSeparateWindowOption 2023-01-20 23:41:56 +01:00
Megamouse afdbef1a81 cellOskDialog: improve dictionary functions 2023-01-20 23:41:56 +01:00
Megamouse f659338e5e overlays/osk: implement first osk pointer 2023-01-20 23:41:56 +01:00
Megamouse 4a82d81efe overlays/osk: implement scaling 2023-01-20 23:41:56 +01:00
Megamouse 6b4208be9b overlays/osk: align osk position 2023-01-20 23:41:56 +01:00
Megamouse 3d78c7f43a cellOskDialog: fix error check and improve initialKeyLayout logic 2023-01-20 23:41:56 +01:00
Megamouse 34df4509af overlays/osk: implement "support languages"
Some languages/panels in the osk need to be activated by the developer.
They are not available otherwise.
So let's check if they were pre-configured and only add the panels if they are supported.
2023-01-20 23:41:56 +01:00
brian218 6c3b2b938a Fix emucore.vcxproj.filters 2023-01-20 13:05:33 +03:00
Egor Romanovskiy 59588b12c8 Fix BUILDING.md Vulkan SDK Version 2023-01-19 23:35:00 +01:00
Jan Beich 3eaa29e7c2 Thread: silence -Wsign-compare on FreeBSD aarch64
Utilities/Thread.cpp:1805:48: error: comparison of integers of different signs: 'uptr' (aka 'unsigned long') and '__register_t' (aka 'long') [-Werror,-Wsign-compare]
        const bool is_executing = uptr(info->si_addr) == RIP(context);
                                  ~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~
2023-01-19 18:49:06 +03:00
brian218 c3c2bb7ad8 USIO: Do not crash simply due to invalid commands 2023-01-18 08:09:35 +01:00
brian218 0e64c74a78 sys_usbd: Added buffer null check for sys_usbd_transfer_data() 2023-01-18 08:09:35 +01:00
brian218 d2dc57585c sys_fs: Improved sys_fs_fcntl(0xc0000015&0xc000001c) 2023-01-18 08:09:35 +01:00
brian218 e0fe7989e9 USB: Added VFS USB mass storage devices to the USB device list 2023-01-18 08:09:35 +01:00
Megamouse 709305df0e overlays: fix indentation 2023-01-18 00:24:00 +01:00
Megamouse 24445123fc Recording: Fix possible encoder segfault 2023-01-18 00:24:00 +01:00
Megamouse 450a64b58b cellUserInfo: fix potentially locked user dialogs 2023-01-18 00:24:00 +01:00
Megamouse b3a9c8d83f input: move config getters to base class 2023-01-17 02:01:03 +01:00
Megamouse 35c92723c7 input: fix ds4 led/rumble in pad settings 2023-01-17 01:07:57 +01:00
kd-11 719e7a9d56 rsx: Fix inadvertent signal override for MSAA 2023-01-17 02:24:21 +03:00
kd-11 eed9e56bf4 rsx: Allow vertex fetch from uninitialized register 2023-01-17 02:24:21 +03:00
Megamouse 1d214ed26a Qt: add system cmd dialog 2023-01-16 17:26:05 +01:00
Megamouse 2d9d92b7d7 Qt: Remove CELL_SYSUTIL_SYSTEM_MENU_CLOSE menu option
This never made any sense
2023-01-16 17:26:05 +01:00
xperia64 240cb2d627 Add output scaling filtering options, migrate FSR checkbox to these options 2023-01-16 13:52:51 +01:00
kd-11 bd69466e94 rsx: Fix some pipe state signal propagation routines 2023-01-16 15:20:53 +03:00
Elad Ashkenazi e6a7597444 PRX/savestates/VSH: Associate PRX with library, fix VSH browser (#13221)
* PRX/savestate:s Associate PRX with library

* VFS/Savestates: Fix host_root resolving

* Savestates: Fix segfault in ppu_initialize

* SPU: Avoid some log spam

* VSH/sys_vm: Fix limit on root processes
2023-01-15 23:12:54 +03:00
Megamouse 1852b370d7 Qt: Allow users to create shortcuts for existing bootable entries even after canceling the installation 2023-01-11 19:26:13 +01:00
Megamouse 12fa7c41f6 Qt: more package install fixes
- Clean directories if fill_path fails
- Fix check_target_app_version when installing multiple packages (compromise: no more optimized singular file installs for now)
2023-01-11 19:26:13 +01:00
Megamouse fc85ed8730 Qt: fix some package install cancellation issues
- Abort installation if any thread has errors
- Only clean the directories of packages that actually had errors
- Additionally clean the directories of packages that were cancelled before they could finish
- Clear boot path in case of error or cancelation
- Propagate result to caller
- Skip success message if the installation was canceled
2023-01-11 19:26:13 +01:00
Megamouse 65f10ff840 package_reader: fix some warnings 2023-01-11 19:26:13 +01:00
kd-11 6809d84a00 vk: Bump max number of suppported inline draw calls to 32k
- Surprisingly some games actually exhaust the entire 16k pool causing slowdown
2023-01-11 16:48:53 +03:00
kd-11 2752cd1390 rsx/vk: Fix some problems with dynamic state updates 2023-01-11 16:48:53 +03:00
kd-11 10b56415e8 vk: Avoid loading the whole dynamic state properties if only the shader changed
- Handles a common case where a game engine switches materials but uses the same configuration
  e.g rendering two types of wall or ground may need different shaders but similar state properties
2023-01-11 16:48:53 +03:00
kd-11 bd87c80943 rsx: Simplify the debug overlay print text routines.
- Greatly simplifies adding text
2023-01-11 16:48:53 +03:00
kd-11 f71e7ef1cc vk: Switch programs if the primitive type changed
- This will change when EXT_dynamic_state is integrated
2023-01-11 16:48:53 +03:00
kd-11 756ad17c2c Fix GCC11 compilation 2023-01-11 16:48:53 +03:00
kd-11 29c1b20b41 Fix compilation 2023-01-11 16:48:53 +03:00
kd-11 aa5097e0d4 glsl: Update fog enums in shaders 2023-01-11 16:48:53 +03:00
kd-11 2ccfee2e45 rsx: Propagate decode failures up the chain.
- Dumping invalid data should not crash
2023-01-11 16:48:53 +03:00
kd-11 bf1311b902 Fix GCC compilation 2023-01-11 16:48:53 +03:00
kd-11 71efb3bc84 rsx: Use gcm cast to handle input enum validation 2023-01-11 16:48:53 +03:00
kd-11 439bdde849 rsx: Fix printing of expected values 2023-01-11 16:48:53 +03:00
kd-11 c7fed20f3c vk: Short-circuit program load if state did not change
- TODO: Incorporate VK_EXT_extended_dynamic_state
2023-01-11 16:48:53 +03:00
kd-11 3dd6e5664c rsx: Do not call a dynamic function to simply test-and-set. Do it inline. 2023-01-11 16:48:53 +03:00
kd-11 d4ee308ffd vk: Fix rare crash when handling mixed depth format types 2023-01-11 16:48:53 +03:00
kd-11 a272f3e3b9 rsx: Improve performance by using an integral type to indicate error 2023-01-11 16:48:53 +03:00
kd-11 f6027719d2 rsx: Fix vertex decode 2023-01-11 16:48:53 +03:00
kd-11 38402e78c0 rsx: Fixup vertex enums in shaders 2023-01-11 16:48:53 +03:00
kd-11 eae1ac6558 refactor: Fix build 2023-01-11 16:48:53 +03:00
kd-11 0b019401bd Refactor gcm enums 2023-01-11 16:48:53 +03:00
kd-11 73cda2324a rsx/lv2: Refactor DMA control stuff after VSH work 2023-01-11 16:48:53 +03:00
kd-11 3dba894369 rsx: Minor refactoring RSXThread
- Part 1 of many
2023-01-11 16:48:53 +03:00
brian218 659ee81e80 USIO: Backup file fixup 2023-01-11 09:10:09 +01:00
Megamouse 99c307a68e Qt: move progress indication to own handler 2023-01-11 05:43:34 +01:00
Megamouse d28eea342a Qt: use play_sound callback instead of QSound 2023-01-10 20:57:32 +01:00
Megamouse 29078bc428 cellMouse: decrease some log levels 2023-01-10 20:57:32 +01:00
Megamouse 6bcb5ae66b Fix some includes and warnings 2023-01-10 20:57:32 +01:00
brian218 cf1e68fb0e USIO: Emulation Performance Optimization 2023-01-10 21:35:12 +03:00
Megamouse 43288a6760 Qt: add shortcut manager 2023-01-10 19:28:26 +01:00
UltraHDR 9ee7d04560 Set LSApplicationCategoryType to games
https://developer.apple.com/documentation/bundleresources/information_property_list/lsapplicationcategorytype
This makes it show up in the macOS Launchpad Games folder
2023-01-10 20:53:43 +03:00
Megamouse 16bf215d8a pine: fix some warnings 2023-01-10 19:51:25 +03:00
Megamouse 99ed77da8c pine: simplify writing strings 2023-01-10 19:51:25 +03:00
Megamouse b9f733c401 pine: replace goto with lambda 2023-01-10 19:51:25 +03:00
Megamouse 18966d424c Input: ignore F11 in keyboard pad handler (starts/stops recordings) 2023-01-09 21:06:51 +01:00
Megamouse c725b886e1 Qt: Disable ESC to exit fullscreen if kb shortcuts are disabled 2023-01-09 21:06:51 +01:00
Megamouse 9b7eaf5117 Improve error logging 2023-01-09 21:06:51 +01:00
Elad Ashkenazi 36a55660bf Unbreak BSD 2023-01-09 20:20:13 +01:00
Elad Ashkenazi 0946e5945f VSH Improvements (#13172)
* sys_prx: Implement PRX LIB register syscall

* VSH: partial log spam fix

* sys_process reboot fix

* Implement sys_memory_container_destroy_parent_with_childs

* sys_net: Implement SO_RCVTIMEO/SO_SENDTIMEO

* VSH: Implement sys_rsx_context_free

* PPU LLVM: distinguish PPU cache exec also by address

Fixes referencing multiple PRX.

* UI: Do not report size of apps inside /dev_flash
2023-01-09 20:03:01 +03:00
Ani 8ec1a5627d AppImage: Do not bundle libgmodule-2.0 and libglib-2.0 2023-01-09 08:19:53 +01:00
612 changed files with 32549 additions and 13920 deletions
+4 -4
View File
@@ -3,13 +3,13 @@
# Pull all the submodules except llvm
# 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/ && !/SPIRV/ { 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
fetch https://github.com/llvm/llvm-project/releases/download/llvmorg-15.0.6/llvm-project-15.0.6.src.tar.xz
fetch https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.1/llvm-project-16.0.1.src.tar.xz
tar xf llvm*.tar.xz
export CC=clang15 CXX=clang++15
export CC=clang16 CXX=clang++16
cmake -B libcxx_build -G Ninja -S llvm*/libcxx \
-DLLVM_CCACHE_BUILD=ON \
-DLIBCXX_INCLUDE_BENCHMARKS=OFF \
@@ -20,7 +20,7 @@ export CXXFLAGS="$CXXFLAGS -nostdinc++ -isystem$PWD/libcxx_prefix/include/c++/v1
export LDFLAGS="$LDFLAGS -nostdlib++ -L$PWD/libcxx_prefix/lib -l:libc++.a -lcxxrt"
CONFIGURE_ARGS="
-DWITH_LLVM=OFF
-DWITH_LLVM=ON
-DUSE_SDL=OFF
-DUSE_PRECOMPILED_HEADERS=OFF
-DUSE_NATIVE_INSTRUCTIONS=OFF
+5 -10
View File
@@ -9,15 +9,10 @@ if [ -z "$CIRRUS_CI" ]; then
cd rpcs3 || exit 1
fi
# Pull all the submodules except llvm, since it is built separately and we just download that build
# Pull all the submodules except llvm
# 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)
# Download pre-compiled llvm libs
curl -sLO https://github.com/RPCS3/llvm-mirror/releases/download/custom-build/llvmlibs-linux.tar.gz
mkdir llvmlibs
tar -xzf ./llvmlibs-linux.tar.gz -C llvmlibs
git submodule -q update --init $(awk '/path/ && !/llvm/ && !/SPIRV/ { print $3 }' .gitmodules)
mkdir build && cd build || exit 1
@@ -42,8 +37,6 @@ export CFLAGS="$CFLAGS -fuse-ld=${LINKER}"
cmake .. \
-DCMAKE_INSTALL_PREFIX=/usr \
-DBUILD_LLVM_SUBMODULE=OFF \
-DLLVM_DIR=llvmlibs/lib/cmake/llvm/ \
-DUSE_NATIVE_INSTRUCTIONS=OFF \
-DUSE_PRECOMPILED_HEADERS=OFF \
-DCMAKE_C_FLAGS="$CFLAGS" \
@@ -51,8 +44,10 @@ cmake .. \
-DCMAKE_AR="$AR" \
-DCMAKE_RANLIB="$RANLIB" \
-DUSE_SYSTEM_CURL=ON \
-DUSE_SDL=OFF \
-DUSE_SDL=ON \
-DOpenGL_GL_PREFERENCE=LEGACY \
-DLLVM_DIR=/opt/llvm/lib/cmake/llvm \
-DSTATIC_LINK_LLVM=ON \
-G Ninja
ninja; build_status=$?;
+42 -11
View File
@@ -1,15 +1,44 @@
#!/bin/sh -ex
brew update
brew install llvm@13 sdl2 nasm qt@5 ninja cmake glew git p7zip create-dmg ccache
brew install -f --overwrite nasm ninja git p7zip create-dmg ccache pipenv
export MACOSX_DEPLOYMENT_TARGET=11.6
#/usr/sbin/softwareupdate --install-rosetta --agree-to-license
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
arch -x86_64 /usr/local/homebrew/bin/brew update
arch -x86_64 /usr/local/homebrew/bin/brew install -f --overwrite llvm@16 sdl2 glew cmake
arch -x86_64 /usr/local/homebrew/bin/brew link -f llvm@16
#export MACOSX_DEPLOYMENT_TARGET=12.0
export CXX=clang++
export CC=clang
export Qt5_DIR="/usr/local/opt/qt@5/lib/cmake/Qt5"
export PATH="/usr/local/opt/llvm@13/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Apple/usr/bin"
export LDFLAGS="-L/usr/local/opt/llvm@13/lib -Wl,-rpath,/usr/local/opt/llvm@13/lib"
export CPPFLAGS="-I/usr/local/opt/llvm@13/include -msse -msse2 -mcx16 -no-pie"
export BREW_PATH;
BREW_PATH="$(brew --prefix)"
export BREW_X64_PATH;
BREW_X64_PATH="$("/usr/local/homebrew/bin/brew" --prefix)"
export BREW_BIN="/usr/local/bin"
export BREW_SBIN="/usr/local/sbin"
export CMAKE_EXTRA_OPTS='-DLLVM_TARGETS_TO_BUILD=X86'
export WORKDIR;
WORKDIR="$(pwd)"
# Get Qt
git clone https://github.com/engnr/qt-downloader.git
cd qt-downloader
git checkout f52efee0f18668c6d6de2dec0234b8c4bc54c597
"/opt/homebrew/bin/pipenv" run pip3 install py7zr requests semantic_version lxml
"/opt/homebrew/bin/pipenv" run ./qt-downloader macos desktop 5.15.2 clang_64 --opensource
cd ..
export Qt5_DIR="$WORKDIR/qt-downloader/5.15.2/clang_64/lib/cmake/Qt5"
export SDL2_DIR="$BREW_X64_PATH/opt/sdl2/lib/cmake/SDL2"
export PATH="$BREW_X64_PATH/opt/llvm@16/bin:$WORKDIR/qt-downloader/5.15.2/clang_64/bin:$BREW_BIN:$BREW_SBIN:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Apple/usr/bin:$PATH"
export LDFLAGS="-L$BREW_X64_PATH/lib -Wl,-rpath,$BREW_X64_PATH/lib"
export CPPFLAGS="-I$BREW_X64_PATH/include -msse -msse2 -mcx16 -no-pie"
export LIBRARY_PATH="$BREW_X64_PATH/lib"
export LD_LIBRARY_PATH="$BREW_X64_PATH/lib"
git submodule update --init --recursive --depth 1
@@ -18,16 +47,18 @@ sed -i '' "s/extern const double NSAppKitVersionNumber;/const double NSAppKitVer
mkdir build && cd build || exit 1
cmake .. \
"$BREW_X64_PATH/bin/cmake" .. \
-DUSE_SDL=ON -DUSE_DISCORD_RPC=OFF -DUSE_VULKAN=ON -DUSE_ALSA=OFF -DUSE_PULSE=OFF -DUSE_AUDIOUNIT=ON \
-DLLVM_CCACHE_BUILD=OFF -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF \
-DLLVM_CCACHE_BUILD=OFF -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF \
-DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_TOOLS=OFF \
-DLLVM_INCLUDE_UTILS=OFF -DLLVM_USE_PERF=OFF -DLLVM_ENABLE_Z3_SOLVER=OFF \
-DUSE_NATIVE_INSTRUCTIONS=OFF \
-DUSE_SYSTEM_MVK=OFF \
$CMAKE_EXTRA_OPTS \
-DLLVM_TARGET_ARCH=X86_64 -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_IGNORE_PATH="$BREW_PATH/lib" \
-G Ninja
ninja; build_status=$?;
"$BREW_PATH/bin/ninja"; build_status=$?;
cd ..
@@ -36,4 +67,4 @@ cd ..
if [ "$build_status" -eq 0 ] && [ "$SHOULD_DEPLOY" = "true" ]; then
.ci/deploy-mac.sh
fi
fi
+15 -37
View File
@@ -3,44 +3,27 @@
cd build || exit 1
if [ "$DEPLOY_APPIMAGE" = "true" ]; then
DESTDIR=appdir ninja install
QT_APPIMAGE="linuxdeployqt.AppImage"
DESTDIR=AppDir ninja install
curl -sL "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" > "$QT_APPIMAGE"
chmod a+x "$QT_APPIMAGE"
"./$QT_APPIMAGE" --appimage-extract
./squashfs-root/AppRun ./appdir/usr/share/applications/*.desktop -bundle-non-qt-libs
ls ./appdir/usr/lib/
rm -r ./appdir/usr/share/doc
cp "$(readlink -f /lib/x86_64-linux-gnu/libnsl.so.1)" ./appdir/usr/lib/libnsl.so.1
export PATH=/rpcs3/build/squashfs-root/usr/bin/:"${PATH}"
curl -sL -o /usr/bin/linuxdeploy https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
chmod +x /usr/bin/linuxdeploy
curl -sL -o /usr/bin/linuxdeploy-plugin-qt https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage
chmod +x /usr/bin/linuxdeploy-plugin-qt
curl -sL -o linuxdeploy-plugin-checkrt.sh https://github.com/linuxdeploy/linuxdeploy-plugin-checkrt/releases/download/continuous/linuxdeploy-plugin-checkrt-x86_64.sh
chmod +x ./linuxdeploy-plugin-checkrt.sh
EXTRA_QT_PLUGINS="svg;" APPIMAGE_EXTRACT_AND_RUN=1 linuxdeploy --appdir AppDir --plugin qt
# Embed newer libstdc++ for distros that don't come with it (ubuntu 16.04)
mkdir -p appdir/usr/optional/ ; mkdir -p appdir/usr/optional/libstdc++/
cp /usr/lib/x86_64-linux-gnu/libstdc++.so.6 ./appdir/usr/optional/libstdc++/
# Remove libwayland-client because it has platform-dependent exports and breaks other OSes
rm -f ./appdir/usr/lib/libwayland-client.so*
# Install latest appimage runner
rm ./appdir/AppRun
curl -sL https://github.com/RPCS3/AppImageKit-checkrt/releases/download/continuous2/AppRun-patched-x86_64 -o ./appdir/AppRun
chmod a+x ./appdir/AppRun
curl -sL https://github.com/RPCS3/AppImageKit-checkrt/releases/download/continuous2/exec-x86_64.so -o ./appdir/usr/optional/exec.so
rm -f ./AppDir/usr/lib/libwayland-client.so*
# Compile checker binary for AppImageKit-checkrt
# Remove git directory containing local commit history file
rm -rf ./AppDir/usr/share/rpcs3/git
# This may need updating if you update the compiler or rpcs3 uses newer c++ features
# See https://github.com/gcc-mirror/gcc/blob/master/libstdc%2B%2B-v3/config/abi/pre/gnu.ver
# for which definitions correlate to which CXXABI version.
# Currently we target a minimum of GLIBCXX_3.4.29 and CXXABI_1.3.11
printf "#include <sstream>\n#include <exception>\n#include <memory_resource>\nint main(){auto x = std::stringbuf();x.get_allocator();std::make_exception_ptr(0);std::pmr::get_default_resource();}" \
| $CXX -x c++ -std=c++2a -o ./appdir/usr/optional/checker -
./linuxdeploy-plugin-checkrt.sh --appdir AppDir
# Package it up and send it off
./squashfs-root/usr/bin/appimagetool "$APPDIR"
ls
linuxdeploy --appimage-extract
./squashfs-root/plugins/linuxdeploy-plugin-appimage/usr/bin/appimagetool AppDir -g
COMM_TAG=$(awk '/version{.*}/ { printf("%d.%d.%d", $5, $6, $7) }' ../rpcs3/rpcs3_version.cpp)
COMM_COUNT="$(git rev-list --count HEAD)"
@@ -57,9 +40,4 @@ if [ "$DEPLOY_APPIMAGE" = "true" ]; then
FILESIZE=$(stat -c %s ./rpcs3*.AppImage)
SHA256SUM=$(sha256sum ./rpcs3*.AppImage | awk '{ print $1 }')
echo "${SHA256SUM};${FILESIZE}B" > "$RELEASE_MESSAGE"
fi
if [ "$DEPLOY_PPA" = "true" ]; then
export DEBFULLNAME="RPCS3 Build Bot"
fi
+7 -4
View File
@@ -14,14 +14,17 @@ echo "AVVER=$AVVER" >> ../.ci/ci-vars.env
cd bin
mkdir "rpcs3.app/Contents/lib/"
cp "/usr/local/opt/llvm@13/lib/c++/libc++abi.1.0.dylib" "rpcs3.app/Contents/lib/libc++abi.1.dylib"
cp "/usr/local/Homebrew/opt/llvm@16/lib/c++/libc++abi.1.0.dylib" "rpcs3.app/Contents/lib/libc++abi.1.dylib"
rm -rf "rpcs3.app/Contents/Frameworks/QtPdf.framework" \
"rpcs3.app/Contents/Frameworks/QtQml.framework" \
"rpcs3.app/Contents/Frameworks/QtQmlModels.framework" \
"rpcs3.app/Contents/Frameworks/QtQuick.framework" \
"rpcs3.app/Contents/Frameworks/QtVirtualKeyboard.framework" \
"rpcs3.app/Contents/Plugins/platforminputcontexts" \
"rpcs3.app/Contents/Plugins/virtualkeyboard"
"rpcs3.app/Contents/Plugins/virtualkeyboard" \
"rpcs3.app/Contents/Resources/git"
# Need to do this rename hack due to case insensitive filesystem
mv rpcs3.app RPCS3_.app
@@ -33,7 +36,7 @@ echo "IconIndex=0" >> Quickstart.url
DMG_FILEPATH="$BUILD_ARTIFACTSTAGINGDIRECTORY/rpcs3-v${COMM_TAG}-${COMM_COUNT}-${COMM_HASH}_macos.dmg"
create-dmg --volname RPCS3 \
/opt/homebrew/bin/create-dmg --volname RPCS3 \
--window-size 800 400 \
--icon-size 100 \
--icon rpcs3.app 200 190 \
@@ -45,7 +48,7 @@ create-dmg --volname RPCS3 \
"$DMG_FILEPATH" \
RPCS3.app
7z a -mx9 rpcs3-v"${COMM_TAG}"-"${COMM_COUNT}"-"${COMM_HASH}"_macos.7z RPCS3.app
/opt/homebrew/bin/7z a -mx9 rpcs3-v"${COMM_TAG}"-"${COMM_COUNT}"-"${COMM_HASH}"_macos.7z RPCS3.app
FILESIZE=$(stat -f %z "$DMG_FILEPATH")
SHA256SUM=$(shasum -a 256 "$DMG_FILEPATH" | awk '{ print $1 }')
+1
View File
@@ -5,6 +5,7 @@ ARTIFACT_DIR="$BUILD_ARTIFACTSTAGINGDIRECTORY"
# Remove unecessary files
rm -f ./bin/rpcs3.exp ./bin/rpcs3.lib ./bin/rpcs3.pdb ./bin/vc_redist.x64.exe
rm -rf ./bin/git
# Prepare compatibility database for packaging, as well as
# certificate for ssl (auto-updater)
+1 -1
View File
@@ -1,4 +1,4 @@
#!/bin/sh -ex
curl -L -o "./llvm.lock" "https://github.com/RPCS3/llvm-mirror/releases/download/custom-build-win/llvmlibs_mt.7z.sha256"
curl -L -o "./llvm.lock" "https://github.com/RPCS3/llvm-mirror/releases/download/custom-build-win-16.0.1/llvmlibs_mt.7z.sha256"
curl -L -o "./glslang.lock" "https://github.com/RPCS3/glslang/releases/download/custom-build-win/glslanglibs_mt.7z.sha256"
+1 -1
View File
@@ -9,7 +9,7 @@ export ASSUME_ALWAYS_YES=true
pkg info # debug
# Prefer newer Clang than in base system (see also .ci/build-freebsd.sh)
pkg install llvm15
pkg install llvm16
# Mandatory dependencies (qt5-dbus and qt5-gui are pulled via qt5-widgets)
pkg install git ccache cmake ninja qt5-qmake qt5-buildtools qt5-widgets qt5-concurrent qt5-multimedia qt5-svg glew openal-soft ffmpeg
+3 -3
View File
@@ -19,7 +19,7 @@ QT_DECL_URL="${QT_HOST}${QT_PREFIX}qtdeclarative${QT_SUFFIX}"
QT_TOOL_URL="${QT_HOST}${QT_PREFIX}qttools${QT_SUFFIX}"
QT_MM_URL="${QT_HOST}${QT_PREFIX}qtmultimedia${QT_SUFFIX}"
QT_SVG_URL="${QT_HOST}${QT_PREFIX}qtsvg${QT_SUFFIX}"
LLVMLIBS_URL='https://github.com/RPCS3/llvm-mirror/releases/download/custom-build-win/llvmlibs_mt.7z'
LLVMLIBS_URL='https://github.com/RPCS3/llvm-mirror/releases/download/custom-build-win-16.0.1/llvmlibs_mt.7z'
GLSLANG_URL='https://github.com/RPCS3/glslang/releases/download/custom-build-win/glslanglibs_mt.7z'
VULKAN_SDK_URL="https://www.dropbox.com/s/cs77c3iv5mbo0bt/VulkanSDK-${VULKAN_VER}-Installer.exe"
@@ -40,7 +40,7 @@ DEP_URLS=" \
# Pull all the submodules except llvm, since it is built separately and we just download that build
# Note: Tried to use git submodule status, but it takes over 20 seconds
# shellcheck disable=SC2046
git submodule -q update --init --depth=1 --jobs=8 $(awk '/path/ && !/llvm/ { print $3 }' .gitmodules)
git submodule -q update --init --depth=1 --jobs=8 $(awk '/path/ && !/llvm/ && !/SPIRV/ { print $3 }' .gitmodules)
# Git bash doesn't have rev, so here it is
rev()
@@ -79,7 +79,7 @@ for url in $DEP_URLS; do
# shellcheck disable=SC1003
case "$url" in
*qt*) checksum=$(curl -L "${url}.sha1"); algo="sha1"; outDir='C:\Qt\' ;;
*llvm*) checksum=$(curl -L "${url}.sha256"); algo="sha256"; outDir="." ;;
*llvm*) checksum=$(curl -L "${url}.sha256"); algo="sha256"; outDir="./3rdparty/llvm" ;;
*glslang*) checksum=$(curl -L "${url}.sha256"); algo="sha256"; outDir="./lib/Release-x64" ;;
*Vulkan*)
# Vulkan setup needs to be run in batch environment
+7 -5
View File
@@ -61,7 +61,7 @@ windows_task:
linux_task:
container:
image: rpcs3/rpcs3-ci-bionic:1.6
image: rpcs3/rpcs3-ci-bionic:1.8
cpu: 4
memory: 16G
env:
@@ -120,15 +120,17 @@ freebsd_task:
script: "./.ci/build-freebsd.sh"
macos_task:
timeout_in: 120m
timeout_in: 12000m
ccache_cache:
folder: /tmp/ccache_dir
matrix:
- name: Cirrus macOS
osx_instance:
image: monterey-xcode-13.3
macos_instance:
image: ghcr.io/cirruslabs/macos-monterey-xcode:14
mac_script:
- mkdir artifacts
- chmod +x ".ci/build-mac.sh"
- chmod +x ".ci/deploy-mac.sh"
- ".ci/build-mac.sh"
env:
BUILD_ARTIFACTSTAGINGDIRECTORY: ${CIRRUS_WORKING_DIR}/artifacts
@@ -141,7 +143,7 @@ macos_task:
RELEASE_MESSAGE: "../GitHubReleaseMessage.txt"
artifacts:
name: Artifact
path: "artifacts/rpcs3-*_macos.*"
path: "artifacts/*"
push_script: |
if [ "$CIRRUS_REPO_OWNER" = "RPCS3" ] && [ -z "$CIRRUS_PR" ] && [ "$CIRRUS_BRANCH" = "master" ]; then
source './.ci/export-cirrus-vars.sh'
@@ -29,8 +29,8 @@ body:
Please provide the _exact_ build (or commit) information that introduced the regression you're reporting.
* Please see [How to find the build that caused a regression](https://wiki.rpcs3.net/index.php?title=Help:Using_different_versions_of_RPCS3#How_to_find_the_build_that_caused_a_regression.3F) in our wiki.
* You can find [History of RPCS3 builds](https://rpcs3.net/compatibility?b) here.
Make sure you're running with settings as close to default as possible
Make sure you're running with settings as close to default as possible
* **Do NOT enable any emulator game patches when reporting issues**
* Only change settings that are required for the game to work
- type: input
@@ -48,7 +48,7 @@ body:
Obtaining the log file:
* Run the game until you find the regression.
* Completely close RPCS3 and locate the log file.
RPCS3's Log file will be ```RPCS3.log.gz``` (sometimes shows as RPCS3.log with zip icon) or ```RPCS3.log``` (sometimes shows as RPCS3 wtih notepad icon).
* On Windows it will be in the RPCS3 directory near the executable
* On Linux it will be in ```~/.cache/rpcs3/```
@@ -70,21 +70,21 @@ body:
* To create an RSX capture, use _Create_ _RSX_ _Capture_ under _Utilities_.
* Captures will be stored in RPCS3 folder → captures.
* To create a RenderDoc capture, please refer to [RenderDoc's documentation](https://renderdoc.org/docs/how/how_capture_frame.html).
- type: textarea
- type: textarea
id: captures
attributes:
label: Attach capture files for visual issues
description: Compress your capture with 7z, Rar etc. and attach it here, or upload it to the cloud (Dropbox, Mega etc) and add a link to it.
validations:
required: false
- type: textarea
- type: textarea
id: system-info
attributes:
label: System configuration
description: Provide information about your system, such as operating system, CPU and GPU model, GPU driver version and other information that describes your system configuration.
validations:
required: false
- type: textarea
- type: textarea
id: other-details
attributes:
label: Other details
+6 -6
View File
@@ -28,13 +28,13 @@ body:
attributes:
value: |
# Log files
Provide a log file that includes the bug you're reporting.
Obtaining the log file:
* Run the game until you find the regression.
* Completely close RPCS3 and locate the log file.
RPCS3's Log file will be ```RPCS3.log.gz``` (sometimes shows as RPCS3.log with zip icon) or ```RPCS3.log``` (sometimes shows as RPCS3 wtih notepad icon).
* On Windows it will be in the RPCS3 directory near the executable
* On Linux it will be in ```~/.cache/rpcs3/```
@@ -55,21 +55,21 @@ body:
* To create an RSX capture, use _Create_ _RSX_ _Capture_ under _Utilities_.
* Captures will be stored in RPCS3 folder → captures.
* To create a RenderDoc capture, please refer to [RenderDoc's documentation](https://renderdoc.org/docs/how/how_capture_frame.html).
- type: textarea
- type: textarea
id: captures
attributes:
label: Attach capture files for visual issues
description: Compress your capture with 7z, Rar etc. and attach it here, or upload it to the cloud (Dropbox, Mega etc) and add a link to it.
validations:
required: false
- type: textarea
- type: textarea
id: system-info
attributes:
label: System configuration
description: Provide information about your system, such as operating system, CPU and GPU model, GPU driver version and other information that describes your system configuration.
validations:
required: false
- type: textarea
- type: textarea
id: other-details
attributes:
label: Other details
+1 -1
View File
@@ -29,7 +29,7 @@ body:
* Why your feature is important to RPCS3.
* If the feature is implemented in other projects, attach screenshots.
* If this feature is something that a game is trying to use, upload a log file for it.
RPCS3's Log file will be ```RPCS3.log.gz``` (sometimes shows as RPCS3.log with zip icon) or ```RPCS3.log``` (sometimes shows as RPCS3 wtih notepad icon).
* On Windows it will be in the RPCS3 directory near the executable
* On Linux it will be in ```~/.cache/rpcs3/```
+10 -1
View File
@@ -36,7 +36,6 @@
/ipch
/rpcs3/Debug
/rpcs3/Release
/llvm_build
!/bin
/bin/*
@@ -104,6 +103,7 @@ rpcs3/rpcs3_autogen/*
# QtCreator
CMakeLists.txt.user
*.autosave
# CLion
/.idea/*
@@ -122,6 +122,15 @@ yaml-cpp.pc
/3rdparty/libusb_cmake/config.h
/3rdparty/libusb_cmake/libusb-1.0.pc
# miniupnp
/3rdparty/miniupnp/x64/*
# llvm
/3rdparty/llvm/llvm_build
# legacy llvm
/llvm_build
# ssl certificate
cacert.pem
+11 -4
View File
@@ -7,9 +7,9 @@
url = ../../RPCS3/asmjit.git
branch = aarch64
ignore = dirty
[submodule "llvm"]
path = llvm
url = ../../RPCS3/llvm-mirror.git
[submodule "3rdparty/llvm/llvm"]
path = 3rdparty/llvm/llvm
url = ../../llvm/llvm-project.git
ignore = dirty
[submodule "3rdparty/glslang"]
path = 3rdparty/glslang/glslang
@@ -78,5 +78,12 @@
ignore = dirty
[submodule "3rdparty/libsdl-org/SDL"]
path = 3rdparty/libsdl-org/SDL
url = https://github.com/libsdl-org/SDL.git
url = ../../libsdl-org/SDL.git
ignore = dirty
[submodule "3rdparty/miniupnp/miniupnp"]
path = 3rdparty/miniupnp/miniupnp
url = ../../miniupnp/miniupnp.git
ignore = dirty
[submodule "3rdparty/rtmidi/rtmidi"]
path = 3rdparty/rtmidi/rtmidi
url = ../../thestk/rtmidi
+29 -12
View File
@@ -78,7 +78,7 @@ add_subdirectory(hidapi)
# Vulkan
add_subdirectory(glslang EXCLUDE_FROM_ALL)
add_subdirectory(SPIRV EXCLUDE_FROM_ALL)
#add_subdirectory(SPIRV EXCLUDE_FROM_ALL)
# yaml-cpp
@@ -142,7 +142,7 @@ add_subdirectory(SoundTouch EXCLUDE_FROM_ALL)
# libevdev
set(LIBEVDEV_TARGET 3rdparty_dummy_lib)
if(USE_LIBEVDEV)
pkg_check_modules(LIBEVDEV libevdev)
pkg_check_modules(LIBEVDEV libevdev libudev)
if(LIBEVDEV_FOUND)
add_library(3rdparty_libevdev INTERFACE)
target_compile_definitions(3rdparty_libevdev INTERFACE -DHAVE_LIBEVDEV)
@@ -189,7 +189,7 @@ if(USE_VULKAN)
if(VULKAN_FOUND)
add_library(3rdparty_vulkan INTERFACE)
target_compile_definitions(3rdparty_vulkan INTERFACE -DHAVE_VULKAN)
target_link_libraries(3rdparty_vulkan INTERFACE SPIRV SPIRV-Tools-opt Vulkan::Vulkan)
target_link_libraries(3rdparty_vulkan INTERFACE SPIRV Vulkan::Vulkan)
if(UNIX AND NOT APPLE)
find_package(Wayland)
@@ -222,21 +222,28 @@ set(FAUDIO_TARGET 3rdparty_dummy_lib)
if(USE_FAUDIO)
# FAudio depends on SDL2
find_package(SDL2)
if (NOT SDL2_FOUND OR SDL2_VERSION VERSION_LESS 2.0.12)
message(WARNING
"-- RPCS3: FAudio requires SDL 2.0.9 or newer. Please note, this warning"
"can also be displayed with SDL2 versions between 2.0.9-2.0.12, as the"
"CMake config files are not correctly installed. Since a valid SDL2"
">=2.0.9 version cannot be found, building with FAudio will be skipped.")
set(USE_FAUDIO False)
else()
if (USE_SYSTEM_FAUDIO)
if (USE_SYSTEM_FAUDIO)
if (NOT SDL2_FOUND OR SDL2_VERSION VERSION_LESS 2.0.12)
message(WARNING
"-- RPCS3: System FAudio requires SDL 2.0.9 or newer. Please note, this warning"
"can also be displayed with SDL2 versions between 2.0.9-2.0.12, as the"
"CMake config files are not correctly installed. Since a valid SDL2"
">=2.0.9 version cannot be found, building with FAudio will be skipped.")
set(USE_FAUDIO OFF CACHE BOOL "Disabled using system FAudio with SDL < 2.0.12" FORCE)
else()
message(STATUS "RPCS3: Using system FAudio")
find_package(FAudio REQUIRED CONFIGS FAudioConfig.cmake FAudio-config.cmake)
add_library(3rdparty_FAudio INTERFACE)
target_link_libraries(3rdparty_FAudio INTERFACE FAudio)
target_compile_definitions(3rdparty_FAudio INTERFACE -DHAVE_FAUDIO)
set(FAUDIO_TARGET 3rdparty_FAudio)
endif()
else()
if (NOT SDL2_FOUND OR SDL2_VERSION VERSION_LESS 2.24.0)
message(WARNING
"-- RPCS3: 3rdparty FAudio requires SDL 2.24.0 or newer. Since a valid SDL2"
">=2.24.0 version cannot be found, building with FAudio will be skipped.")
set(USE_FAUDIO OFF CACHE BOOL "Disabled FAudio with SDL < 2.24.0" FORCE)
else()
message(STATUS "RPCS3: Using builtin FAudio")
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared library")
@@ -338,6 +345,8 @@ if(USE_SDL)
message(STATUS "Using system SDL2")
add_library(3rdparty_sdl2 INTERFACE)
target_compile_definitions(3rdparty_sdl2 INTERFACE -DHAVE_SDL2=1)
target_include_directories(3rdparty_sdl2 INTERFACE ${SDL2_INCLUDE_DIRS})
target_link_libraries(3rdparty_sdl2 INTERFACE ${SDL2_LIBRARIES})
set(SDL2_TARGET 3rdparty_sdl2)
else()
message(FATAL_ERROR "SDL2 is not available on this system")
@@ -351,6 +360,12 @@ if(USE_SDL)
endif()
endif()
# MINIUPNP
add_subdirectory(miniupnp EXCLUDE_FROM_ALL)
# RTMIDI
add_subdirectory(rtmidi EXCLUDE_FROM_ALL)
# add nice ALIAS targets for ease of use
if(USE_SYSTEM_LIBUSB)
add_library(3rdparty::libusb ALIAS usb-1.0-shared)
@@ -378,3 +393,5 @@ add_library(3rdparty::wolfssl ALIAS wolfssl)
add_library(3rdparty::libcurl ALIAS libcurl)
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)
+1 -1
View File
@@ -4,7 +4,7 @@ include(ExternalProject)
ExternalProject_Add(moltenvk
GIT_REPOSITORY https://github.com/KhronosGroup/MoltenVK.git
GIT_TAG a307b24
GIT_TAG 4c6bfbe
BUILD_IN_SOURCE 1
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/MoltenVK
CONFIGURE_COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/MoltenVK/fetchDependencies" --macos
+1
View File
@@ -70,6 +70,7 @@
<PreprocessorDefinitions>SOUNDTOUCH_ALLOW_SSE;ST_NO_EXCEPTION_HANDLING;USE_MULTICH_ALWAYS;SOUNDTOUCH_FLOAT_SAMPLES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>./soundtouch/source/SoundTouch;./soundtouch/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DebugInformationFormat Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">ProgramDatabase</DebugInformationFormat>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
</ClCompile>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+1
View File
@@ -187,6 +187,7 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PreprocessorDefinitions>ASMJIT_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release'">MaxSpeed</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
</ClCompile>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+1
View File
@@ -79,6 +79,7 @@
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>OUTSIDE_SPEEX;RANDOM_PREFIX=speex;FLOATING_POINT;_USE_SSE;_USE_SSE2;EXPORT=;USE_WASAPI;USE_WINMM;CUBEB_WASAPI_USE_IAUDIOSTREAMVOLUME;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>./cubeb/subprojects/;./extra/;./cubeb/src/;./cubeb/include/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
</ClCompile>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+25 -9
View File
@@ -64,8 +64,14 @@
<ClCompile Include="curl\lib\asyn-ares.c" />
<ClCompile Include="curl\lib\asyn-thread.c" />
<ClCompile Include="curl\lib\base64.c" />
<ClCompile Include="curl\lib\bufq.c" />
<ClCompile Include="curl\lib\bufref.c" />
<ClCompile Include="curl\lib\c-hyper.c" />
<ClCompile Include="curl\lib\cf-h1-proxy.c" />
<ClCompile Include="curl\lib\cf-h2-proxy.c" />
<ClCompile Include="curl\lib\cf-haproxy.c" />
<ClCompile Include="curl\lib\cf-https-connect.c" />
<ClCompile Include="curl\lib\cf-socket.c" />
<ClCompile Include="curl\lib\cfilters.c" />
<ClCompile Include="curl\lib\conncache.c" />
<ClCompile Include="curl\lib\connect.c" />
@@ -78,6 +84,7 @@
<ClCompile Include="curl\lib\curl_gethostname.c" />
<ClCompile Include="curl\lib\curl_get_line.c" />
<ClCompile Include="curl\lib\curl_gssapi.c" />
<ClCompile Include="curl\lib\curl_log.c" />
<ClCompile Include="curl\lib\curl_memrchr.c" />
<ClCompile Include="curl\lib\curl_multibyte.c" />
<ClCompile Include="curl\lib\curl_ntlm_core.c" />
@@ -91,6 +98,7 @@
<ClCompile Include="curl\lib\dict.c" />
<ClCompile Include="curl\lib\doh.c" />
<ClCompile Include="curl\lib\dynbuf.c" />
<ClCompile Include="curl\lib\dynhds.c" />
<ClCompile Include="curl\lib\easy.c" />
<ClCompile Include="curl\lib\easygetopt.c" />
<ClCompile Include="curl\lib\easyoptions.c" />
@@ -104,7 +112,6 @@
<ClCompile Include="curl\lib\getenv.c" />
<ClCompile Include="curl\lib\getinfo.c" />
<ClCompile Include="curl\lib\gopher.c" />
<ClCompile Include="curl\lib\h2h3.c" />
<ClCompile Include="curl\lib\hash.c" />
<ClCompile Include="curl\lib\headers.c" />
<ClCompile Include="curl\lib\hmac.c" />
@@ -115,6 +122,7 @@
<ClCompile Include="curl\lib\hostsyn.c" />
<ClCompile Include="curl\lib\hsts.c" />
<ClCompile Include="curl\lib\http.c" />
<ClCompile Include="curl\lib\http1.c" />
<ClCompile Include="curl\lib\http2.c" />
<ClCompile Include="curl\lib\http_aws_sigv4.c" />
<ClCompile Include="curl\lib\http_chunks.c" />
@@ -179,11 +187,13 @@
<ClCompile Include="curl\lib\vauth\gsasl.c" />
<ClCompile Include="curl\lib\version.c" />
<ClCompile Include="curl\lib\version_win32.c" />
<ClCompile Include="curl\lib\vquic\curl_msh3.c" />
<ClCompile Include="curl\lib\vquic\curl_ngtcp2.c" />
<ClCompile Include="curl\lib\vquic\curl_quiche.c" />
<ClCompile Include="curl\lib\vtls\hostcheck.c" />
<ClCompile Include="curl\lib\vtls\rustls.c" />
<ClCompile Include="curl\lib\vtls\x509asn1.c" />
<ClCompile Include="curl\lib\warnless.c" />
<ClCompile Include="curl\lib\wildcard.c" />
<ClCompile Include="curl\lib\vauth\cleartext.c" />
<ClCompile Include="curl\lib\vauth\cram.c" />
<ClCompile Include="curl\lib\vauth\digest.c" />
@@ -196,8 +206,6 @@
<ClCompile Include="curl\lib\vauth\spnego_gssapi.c" />
<ClCompile Include="curl\lib\vauth\spnego_sspi.c" />
<ClCompile Include="curl\lib\vauth\vauth.c" />
<ClCompile Include="curl\lib\vquic\ngtcp2.c" />
<ClCompile Include="curl\lib\vquic\quiche.c" />
<ClCompile Include="curl\lib\vquic\vquic.c" />
<ClCompile Include="curl\lib\vssh\libssh.c" />
<ClCompile Include="curl\lib\vssh\libssh2.c" />
@@ -231,8 +239,14 @@
<ClInclude Include="curl\lib\amigaos.h" />
<ClInclude Include="curl\lib\arpa_telnet.h" />
<ClInclude Include="curl\lib\asyn.h" />
<ClInclude Include="curl\lib\bufq.h" />
<ClInclude Include="curl\lib\bufref.h" />
<ClInclude Include="curl\lib\c-hyper.h" />
<ClInclude Include="curl\lib\cf-h1-proxy.h" />
<ClInclude Include="curl\lib\cf-h2-proxy.h" />
<ClInclude Include="curl\lib\cf-haproxy.h" />
<ClInclude Include="curl\lib\cf-https-connect.h" />
<ClInclude Include="curl\lib\cf-socket.h" />
<ClInclude Include="curl\lib\cfilters.h" />
<ClInclude Include="curl\lib\config-amigaos.h" />
<ClInclude Include="curl\lib\config-dos.h" />
@@ -259,6 +273,7 @@
<ClInclude Include="curl\lib\curl_hmac.h" />
<ClInclude Include="curl\lib\curl_krb5.h" />
<ClInclude Include="curl\lib\curl_ldap.h" />
<ClInclude Include="curl\lib\curl_log.h" />
<ClInclude Include="curl\lib\curl_md4.h" />
<ClInclude Include="curl\lib\curl_md5.h" />
<ClInclude Include="curl\lib\curl_memory.h" />
@@ -280,6 +295,7 @@
<ClInclude Include="curl\lib\doh.h" />
<ClInclude Include="curl\lib\dotdot.h" />
<ClInclude Include="curl\lib\dynbuf.h" />
<ClInclude Include="curl\lib\dynhds.h" />
<ClInclude Include="curl\lib\easyif.h" />
<ClInclude Include="curl\lib\easyoptions.h" />
<ClInclude Include="curl\lib\easy_lock.h" />
@@ -293,12 +309,12 @@
<ClInclude Include="curl\lib\functypes.h" />
<ClInclude Include="curl\lib\getinfo.h" />
<ClInclude Include="curl\lib\gopher.h" />
<ClInclude Include="curl\lib\h2h3.h" />
<ClInclude Include="curl\lib\hash.h" />
<ClInclude Include="curl\lib\headers.h" />
<ClInclude Include="curl\lib\hostip.h" />
<ClInclude Include="curl\lib\hsts.h" />
<ClInclude Include="curl\lib\http.h" />
<ClInclude Include="curl\lib\http1.h" />
<ClInclude Include="curl\lib\http2.h" />
<ClInclude Include="curl\lib\http_aws_sigv4.h" />
<ClInclude Include="curl\lib\http_chunks.h" />
@@ -325,7 +341,6 @@
<ClInclude Include="curl\lib\pop3.h" />
<ClInclude Include="curl\lib\progress.h" />
<ClInclude Include="curl\lib\psl.h" />
<ClInclude Include="curl\lib\quic.h" />
<ClInclude Include="curl\lib\rand.h" />
<ClInclude Include="curl\lib\rename.h" />
<ClInclude Include="curl\lib\rtsp.h" />
@@ -360,16 +375,17 @@
<ClInclude Include="curl\lib\urlapi-int.h" />
<ClInclude Include="curl\lib\urldata.h" />
<ClInclude Include="curl\lib\version_win32.h" />
<ClInclude Include="curl\lib\vquic\curl_msh3.h" />
<ClInclude Include="curl\lib\vquic\curl_ngtcp2.h" />
<ClInclude Include="curl\lib\vquic\curl_quiche.h" />
<ClInclude Include="curl\lib\vquic\vquic_int.h" />
<ClInclude Include="curl\lib\vtls\hostcheck.h" />
<ClInclude Include="curl\lib\vtls\rustls.h" />
<ClInclude Include="curl\lib\vtls\x509asn1.h" />
<ClInclude Include="curl\lib\warnless.h" />
<ClInclude Include="curl\lib\wildcard.h" />
<ClInclude Include="curl\lib\vauth\digest.h" />
<ClInclude Include="curl\lib\vauth\ntlm.h" />
<ClInclude Include="curl\lib\vauth\vauth.h" />
<ClInclude Include="curl\lib\vquic\ngtcp2.h" />
<ClInclude Include="curl\lib\vquic\quiche.h" />
<ClInclude Include="curl\lib\vquic\vquic.h" />
<ClInclude Include="curl\lib\vssh\ssh.h" />
<ClInclude Include="curl\lib\vssh\wolfssh.h" />
+75 -27
View File
@@ -330,9 +330,6 @@
<ClCompile Include="curl\lib\warnless.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\wildcard.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vauth\cleartext.c">
<Filter>Source Files</Filter>
</ClCompile>
@@ -369,12 +366,6 @@
<ClCompile Include="curl\lib\vauth\vauth.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vquic\ngtcp2.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vquic\quiche.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vssh\libssh.c">
<Filter>Source Files</Filter>
</ClCompile>
@@ -456,9 +447,6 @@
<ClCompile Include="curl\lib\vauth\gsasl.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\h2h3.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vtls\hostcheck.c">
<Filter>Source Files</Filter>
</ClCompile>
@@ -486,6 +474,42 @@
<ClCompile Include="curl\lib\idn.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\curl_log.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\cf-https-connect.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\cf-socket.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vquic\curl_msh3.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vquic\curl_ngtcp2.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vquic\curl_quiche.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\http1.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\dynhds.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\bufq.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\cf-h1-proxy.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\cf-h2-proxy.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\cf-haproxy.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="curl\include\curl\curl.h">
@@ -764,9 +788,6 @@
<ClInclude Include="curl\lib\psl.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\quic.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\rand.h">
<Filter>Header Files</Filter>
</ClInclude>
@@ -863,9 +884,6 @@
<ClInclude Include="curl\lib\warnless.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\wildcard.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\vauth\digest.h">
<Filter>Header Files</Filter>
</ClInclude>
@@ -875,12 +893,6 @@
<ClInclude Include="curl\lib\vauth\vauth.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\vquic\ngtcp2.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\vquic\quiche.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\vssh\ssh.h">
<Filter>Header Files</Filter>
</ClInclude>
@@ -956,9 +968,6 @@
<ClInclude Include="curl\lib\vtls\rustls.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\h2h3.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\vtls\hostcheck.h">
<Filter>Header Files</Filter>
</ClInclude>
@@ -992,6 +1001,45 @@
<ClInclude Include="curl\lib\idn.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\curl_log.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\cf-https-connect.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\cf-socket.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\vquic\curl_msh3.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\vquic\curl_ngtcp2.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\vquic\curl_quiche.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\vquic\vquic_int.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\http1.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\dynhds.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\bufq.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\cf-h1-proxy.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\cf-h2-proxy.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\cf-haproxy.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="curl\lib\libcurl.rc">
+3 -3
View File
@@ -1,11 +1,11 @@
option(SDL2_DISABLE_SDL2MAIN "" ON)
option(SDL2_DISABLE_INSTALL "" ON)
option(SDL2_DISABLE_UNINSTALL "" ON)
set(SDL_SHARED OFF)
option(SDL_SHARED OFF)
set(SDL_SHARED_ENABLED_BY_DEFAULT OFF)
set(SDL_STATIC ON)
option(SDL_STATIC ON)
set(SDL_STATIC_ENABLED_BY_DEFAULT ON)
set(SDL_TEST OFF)
option(SDL_TEST OFF)
set(SDL_TEST_ENABLED_BY_DEFAULT OFF)
set(OPT_DEF_LIBC ON)
add_subdirectory(SDL EXCLUDE_FROM_ALL)
+1
View File
@@ -453,6 +453,7 @@
<SDLCheck>false</SDLCheck>
<AdditionalIncludeDirectories>SDL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DebugInformationFormat Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">ProgramDatabase</DebugInformationFormat>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
</ClCompile>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+35 -28
View File
@@ -2,10 +2,10 @@ if(WITH_LLVM)
CHECK_CXX_COMPILER_FLAG("-msse -msse2 -mcx16" COMPILER_X86)
CHECK_CXX_COMPILER_FLAG("-march=armv8-a+lse" COMPILER_ARM)
if(BUILD_LLVM_SUBMODULE)
if(BUILD_LLVM)
message(STATUS "LLVM will be built from the submodule.")
set(LLVM_TARGETS_TO_BUILD "AArch64;X86")
set(LLVM_TARGETS_TO_BUILD "AArch64;X86" CACHE STRING "Semicolon-separated list of targets to build, or \"all\".")
option(LLVM_BUILD_RUNTIME OFF)
option(LLVM_BUILD_TOOLS OFF)
option(LLVM_INCLUDE_BENCHMARKS OFF)
@@ -32,54 +32,61 @@ if(WITH_LLVM)
endif()
# LLVM needs to be built out-of-tree
add_subdirectory(${CMAKE_SOURCE_DIR}/llvm ${CMAKE_CURRENT_BINARY_DIR}/llvm_build EXCLUDE_FROM_ALL)
set(LLVM_DIR "${CMAKE_CURRENT_BINARY_DIR}/llvm_build/lib/cmake/llvm/")
add_subdirectory(${CMAKE_SOURCE_DIR}/3rdparty/llvm/llvm/llvm ${CMAKE_BINARY_DIR}/3rdparty/llvm/llvm_build EXCLUDE_FROM_ALL)
set(LLVM_DIR "${CMAKE_BINARY_DIR}/3rdparty/llvm/llvm_build/lib/cmake/llvm/")
set(CMAKE_CXX_FLAGS ${CXX_FLAGS_OLD})
set(STATIC_LINK_LLVM ON CACHE BOOL "Link against LLVM statically. This will get set to ON if you build LLVM from the submodule." FORCE)
# now tries to find LLVM again
find_package(LLVM 13.0 CONFIG)
find_package(LLVM 16.0 CONFIG)
if(NOT LLVM_FOUND)
message(FATAL_ERROR "Couldn't build LLVM from the submodule. You might need to run `git submodule update --init`")
endif()
else()
message(STATUS "Using prebuilt LLVM")
message(STATUS "Using prebuilt or system LLVM")
if (LLVM_DIR AND NOT IS_ABSOLUTE "${LLVM_DIR}")
# change relative LLVM_DIR to be relative to the source dir
set(LLVM_DIR ${CMAKE_SOURCE_DIR}/${LLVM_DIR})
endif()
find_package(LLVM 13.0 CONFIG)
find_package(LLVM 16.0 CONFIG)
if (NOT LLVM_FOUND)
if (LLVM_VERSION AND LLVM_VERSION_MAJOR LESS 11)
message(FATAL_ERROR "Found LLVM version ${LLVM_VERSION}. Required version 11.0. \
Enable BUILD_LLVM_SUBMODULE option to build LLVM from included as a git submodule.")
if (LLVM_VERSION AND LLVM_VERSION_MAJOR LESS 16)
message(FATAL_ERROR "Found LLVM version ${LLVM_VERSION}. Required version 16. \
Enable BUILD_LLVM option to build LLVM from included as a git submodule.")
endif()
message(FATAL_ERROR "Can't find LLVM libraries from the CMAKE_PREFIX_PATH path or LLVM_DIR. \
Enable BUILD_LLVM_SUBMODULE option to build LLVM from included as a git submodule.")
Enable BUILD_LLVM option to build LLVM from included as a git submodule.")
endif()
endif()
set(LLVM_LIBS LLVMMCJIT)
if(COMPILER_X86)
set(LLVM_LIBS ${LLVM_LIBS} LLVMX86CodeGen LLVMX86AsmParser)
endif()
if(COMPILER_ARM)
set(LLVM_LIBS ${LLVM_LIBS} LLVMX86CodeGen LLVMX86AsmParser LLVMAArch64CodeGen LLVMAArch64AsmParser)
endif()
if(WIN32 OR CMAKE_SYSTEM MATCHES "Linux")
set(LLVM_LIBS ${LLVM_LIBS} LLVMIntelJITEvents)
endif()
if(CMAKE_SYSTEM MATCHES "Linux")
set(LLVM_LIBS ${LLVM_LIBS} LLVMPerfJITEvents)
if (STATIC_LINK_LLVM)
if (NOT DEFINED LLVM_TARGETS_TO_BUILD)
if(COMPILER_ARM)
set(LLVM_TARGETS_TO_BUILD "AArch64;X86" CACHE STRING "Semicolon-separated list of targets to build, or \"all\".")
else()
set(LLVM_TARGETS_TO_BUILD "X86" CACHE STRING "Semicolon-separated list of targets to build, or \"all\".")
endif()
endif()
if(WIN32 OR CMAKE_SYSTEM MATCHES "Linux")
set (LLVM_ADDITIONAL_LIBS ${LLVM_ADDITIONAL_LIBS} IntelJITEvents)
endif()
if(CMAKE_SYSTEM MATCHES "Linux")
set (LLVM_ADDITIONAL_LIBS ${LLVM_ADDITIONAL_LIBS} PerfJITEvents)
endif()
llvm_map_components_to_libnames(LLVM_LIBS
${LLVM_TARGETS_TO_BUILD}
${LLVM_ADDITIONAL_LIBS}
Core
ExecutionEngine
MCJIT
)
else()
set(LLVM_LIBS LLVM)
endif()
add_library(3rdparty_llvm INTERFACE)
Vendored Submodule
+1
Submodule 3rdparty/llvm/llvm added at cd89023f79
@@ -14,9 +14,9 @@
<ProjectGuid>{8BC303AB-25BE-4276-8E57-73F171B2D672}</ProjectGuid>
<Keyword>MakeFileProj</Keyword>
</PropertyGroup>
<Import Project="..\buildfiles\msvc\common_default.props" />
<Import Project="$(SolutionDir)\buildfiles\msvc\common_default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="..\buildfiles\msvc\common_default_macros.props" />
<Import Project="$(SolutionDir)\buildfiles\msvc\common_default_macros.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Makefile</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
@@ -39,9 +39,9 @@
</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_TOOLS=OFF -DLLVM_INCLUDE_UTILS=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=$(WindowsTargetPlatformVersion) -DLLVM_USE_CRT_DEBUG=MTd -DLLVM_USE_CRT_RELEASE=MT -DLLVM_USE_INTEL_JITEVENTS=ON ../llvm</CmakeReleaseCLI>
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=MTd -DLLVM_USE_CRT_RELEASE=MT -DLLVM_USE_INTEL_JITEVENTS=ON ../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_TOOLS=OFF -DLLVM_INCLUDE_UTILS=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=$(WindowsTargetPlatformVersion) -DLLVM_USE_CRT_DEBUG=MTd -DLLVM_USE_CRT_RELEASE=MT -DLLVM_USE_INTEL_JITEVENTS=ON ../llvm</CmakeDebugCLI>
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=MTd -DLLVM_USE_CRT_RELEASE=MT -DLLVM_USE_INTEL_JITEVENTS=ON ../llvm/llvm</CmakeDebugCLI>
<CmakeCleanCLI>echo Cleaning..
for /F "delims= eol=|" %%f in ('
dir /b ^| findstr /V "[^.]*\build[^.]*\.vcxproj"') do (
@@ -14,9 +14,9 @@
<ProjectGuid>{A37E4273-85DB-4217-B775-CE971B87D9DF}</ProjectGuid>
<Keyword>MakeFileProj</Keyword>
</PropertyGroup>
<Import Project="..\buildfiles\msvc\common_default_clang_cl.props" />
<Import Project="$(SolutionDir)\buildfiles\msvc\common_default_clang_cl.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="..\buildfiles\msvc\common_default_macros.props" />
<Import Project="$(SolutionDir)\buildfiles\msvc\common_default_macros.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Makefile</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
@@ -39,9 +39,9 @@
</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_TOOLS=OFF -DLLVM_INCLUDE_UTILS=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=$(WindowsTargetPlatformVersion) -DLLVM_USE_CRT_DEBUG=MTd -DLLVM_USE_CRT_RELEASE=MT -DLLVM_USE_INTEL_JITEVENTS=ON ../llvm</CmakeReleaseCLI>
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=MTd -DLLVM_USE_CRT_RELEASE=MT -DLLVM_USE_INTEL_JITEVENTS=ON ../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_TOOLS=OFF -DLLVM_INCLUDE_UTILS=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=$(WindowsTargetPlatformVersion) -DLLVM_USE_CRT_DEBUG=MTd -DLLVM_USE_CRT_RELEASE=MT -DLLVM_USE_INTEL_JITEVENTS=ON ../llvm</CmakeDebugCLI>
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=MTd -DLLVM_USE_CRT_RELEASE=MT -DLLVM_USE_INTEL_JITEVENTS=ON ../llvm/llvm</CmakeDebugCLI>
<CmakeCleanCLI>echo Cleaning..
for /F "delims= eol=|" %%f in ('
dir /b ^| findstr /V "[^.]*\build[^.]*\.vcxproj"') do (
+8
View File
@@ -0,0 +1,8 @@
option (UPNPC_BUILD_STATIC "Build static library" TRUE)
option (UPNPC_BUILD_SHARED "Build shared library" FALSE)
option (UPNPC_BUILD_TESTS "Build test executables" FALSE)
option (UPNPC_BUILD_SAMPLE "Build sample executables" FALSE)
option (NO_GETADDRINFO "Define NO_GETADDRINFO" FALSE)
option (UPNPC_NO_INSTALL "Disable installation" TRUE)
add_subdirectory(miniupnp/miniupnpc EXCLUDE_FROM_ALL)
Vendored Submodule
+1
+138
View File
@@ -0,0 +1,138 @@
<?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>
<PropertyGroup Label="Globals">
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{5228f863-e0dd-4de7-aa7b-5c52b14cd4d0}</ProjectGuid>
<RootNamespace>miniupnpcstatic</RootNamespace>
</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 Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_WINSOCK_DEPRECATED_NO_WARNINGS; _CRT_SECURE_NO_WARNINGS;MINIUPNP_STATICLIB;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<AdditionalIncludeDirectories>generated;miniupnp\miniupnpc;miniupnp\miniupnpc\include</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
</Link>
<PreBuildEvent>
<Command>cd $(ProjectDir)miniupnp\miniupnpc\msvc
cscript genminiupnpcstrings.vbs</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_WINSOCK_DEPRECATED_NO_WARNINGS; _CRT_SECURE_NO_WARNINGS;MINIUPNP_STATICLIB;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<AdditionalIncludeDirectories>generated;miniupnp\miniupnpc;miniupnp\miniupnpc\include</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>
</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PreBuildEvent>
<Command>cd $(ProjectDir)miniupnp\miniupnpc\msvc
cscript genminiupnpcstrings.vbs</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="miniupnp\miniupnpc\src\addr_is_reserved.c" />
<ClCompile Include="miniupnp\miniupnpc\src\connecthostport.c" />
<ClCompile Include="miniupnp\miniupnpc\src\igd_desc_parse.c" />
<ClCompile Include="miniupnp\miniupnpc\src\minisoap.c" />
<ClCompile Include="miniupnp\miniupnpc\src\minissdpc.c" />
<ClCompile Include="miniupnp\miniupnpc\src\miniupnpc.c" />
<ClCompile Include="miniupnp\miniupnpc\src\miniwget.c" />
<ClCompile Include="miniupnp\miniupnpc\src\minixml.c" />
<ClCompile Include="miniupnp\miniupnpc\src\portlistingparse.c" />
<ClCompile Include="miniupnp\miniupnpc\src\receivedata.c" />
<ClCompile Include="miniupnp\miniupnpc\src\upnpcommands.c" />
<ClCompile Include="miniupnp\miniupnpc\src\upnpdev.c" />
<ClCompile Include="miniupnp\miniupnpc\src\upnperrors.c" />
<ClCompile Include="miniupnp\miniupnpc\src\upnpreplyparse.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="miniupnp\miniupnpc\src\addr_is_reserved.h" />
<ClInclude Include="miniupnp\miniupnpc\src\connecthostport.h" />
<ClInclude Include="miniupnp\miniupnpc\include\igd_desc_parse.h" />
<ClInclude Include="miniupnp\miniupnpc\src\minisoap.h" />
<ClInclude Include="miniupnp\miniupnpc\src\minissdpc.h" />
<ClInclude Include="miniupnp\miniupnpc\include\miniupnpc.h" />
<ClInclude Include="miniupnp\miniupnpc\miniupnpcstrings.h" />
<ClInclude Include="miniupnp\miniupnpc\include\miniupnpctypes.h" />
<ClInclude Include="miniupnp\miniupnpc\include\miniupnpc_declspec.h" />
<ClInclude Include="miniupnp\miniupnpc\include\miniwget.h" />
<ClInclude Include="miniupnp\miniupnpc\src\miniwget_private.h" />
<ClInclude Include="miniupnp\miniupnpc\src\minixml.h" />
<ClInclude Include="miniupnp\miniupnpc\include\portlistingparse.h" />
<ClInclude Include="miniupnp\miniupnpc\src\receivedata.h" />
<ClInclude Include="miniupnp\miniupnpc\include\upnpcommands.h" />
<ClInclude Include="miniupnp\miniupnpc\include\upnpdev.h" />
<ClInclude Include="miniupnp\miniupnpc\include\upnperrors.h" />
<ClInclude Include="miniupnp\miniupnpc\include\upnpreplyparse.h" />
<ClInclude Include="miniupnp\miniupnpc\src\win32_snprintf.h" />
<ClInclude Include="miniupnp\miniupnpc\rc_version.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
+102 -103
View File
@@ -12,18 +12,21 @@
#include <thread>
#include <sys/types.h>
#if _WIN32
#define read_portable(a, b, c) (recv(a, b, c, 0))
#define write_portable(a, b, c) (send(a, b, c, 0))
#define read_portable(a, b, c) (recv(a, b, ::narrow<int>(c), 0))
#define write_portable(a, b, c) (send(a, b, ::narrow<int>(c), 0))
#define close_portable(a) (closesocket(a))
#define bzero(b, len) (memset((b), '\0', (len)), (void)0)
#include <WinSock2.h>
#include <windows.h>
#include <ws2tcpip.h>
#else
#define read_portable(a, b, c) (read(a, b, c))
#define write_portable(a, b, c) (write(a, b, c))
#define close_portable(a) (close(a))
#include <sys/socket.h>
#include <sys/un.h>
#include <arpa/inet.h>
#include <poll.h>
#if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
#include <unistd.h>
#endif
@@ -79,13 +82,13 @@ namespace pine
* A preallocated buffer used to store all IPC replies.
* to the size of 50.000 MsgWrite64 IPC calls.
*/
char* m_ret_buffer;
std::vector<char> m_ret_buffer;
/**
* IPC messages buffer.
* A preallocated buffer used to store all IPC messages.
*/
char* m_ipc_buffer;
std::vector<char> m_ipc_buffer;
/**
* IPC Command messages opcodes.
@@ -118,8 +121,8 @@ namespace pine
*/
struct IPCBuffer
{
int size; /**< Size of the buffer. */
char* buffer; /**< Buffer. */
usz size{}; /**< Size of the buffer. */
char* buffer{}; /**< Buffer. */
};
/**
@@ -144,13 +147,30 @@ namespace pine
*/
IPCBuffer ParseCommand(char* buf, char* ret_buffer, u32 buf_size)
{
u32 ret_cnt = 5;
u32 buf_cnt = 0;
usz ret_cnt = 5;
usz buf_cnt = 0;
const auto error = [&]()
{
return IPCBuffer{ 5, MakeFailIPC(ret_buffer) };
};
const auto write_string = [&](const std::string& str)
{
if (!SafetyChecks(buf_cnt, 0, ret_cnt, str.size() + 1 + sizeof(u32), buf_size))
return false;
ToArray(ret_buffer, ::narrow<u32>(str.size() + 1), ret_cnt);
ret_cnt += sizeof(u32);
memcpy(&ret_buffer[ret_cnt], str.data(), str.size());
ret_cnt += str.size();
ret_buffer[ret_cnt++] = '\0';
return true;
};
while (buf_cnt < buf_size)
{
if (!SafetyChecks(buf_cnt, 1, ret_cnt, 0, buf_size))
return IPCBuffer{ 5, MakeFailIPC(ret_buffer) };
return error();
buf_cnt++;
// example IPC messages: MsgRead/Write
// refer to the client doc for more info on the format
@@ -169,10 +189,10 @@ namespace pine
case MsgRead8:
{
if (!SafetyChecks(buf_cnt, 4, ret_cnt, 1, buf_size))
goto error;
return error();
const u32 a = FromArray<u32>(&buf[buf_cnt], 0);
if (!Impl::template check_addr(a))
goto error;
return error();
const u8 res = Impl::read8(a);
ToArray(ret_buffer, res, ret_cnt);
ret_cnt += 1;
@@ -182,10 +202,10 @@ namespace pine
case MsgRead16:
{
if (!SafetyChecks(buf_cnt, 4, ret_cnt, 2, buf_size))
goto error;
return error();
const u32 a = FromArray<u32>(&buf[buf_cnt], 0);
if (!Impl::template check_addr<2>(a))
goto error;
return error();
const u16 res = Impl::read16(a);
ToArray(ret_buffer, res, ret_cnt);
ret_cnt += 2;
@@ -195,10 +215,10 @@ namespace pine
case MsgRead32:
{
if (!SafetyChecks(buf_cnt, 4, ret_cnt, 4, buf_size))
goto error;
return error();
const u32 a = FromArray<u32>(&buf[buf_cnt], 0);
if (!Impl::template check_addr<4>(a))
goto error;
return error();
const u32 res = Impl::read32(a);
ToArray(ret_buffer, res, ret_cnt);
ret_cnt += 4;
@@ -208,10 +228,10 @@ namespace pine
case MsgRead64:
{
if (!SafetyChecks(buf_cnt, 4, ret_cnt, 8, buf_size))
goto error;
return error();
const u32 a = FromArray<u32>(&buf[buf_cnt], 0);
if (!Impl::template check_addr<8>(a))
goto error;
return error();
u64 res = Impl::read64(a);
ToArray(ret_buffer, res, ret_cnt);
ret_cnt += 8;
@@ -221,10 +241,10 @@ namespace pine
case MsgWrite8:
{
if (!SafetyChecks(buf_cnt, 1 + 4, ret_cnt, 0, buf_size))
goto error;
return error();
const u32 a = FromArray<u32>(&buf[buf_cnt], 0);
if (!Impl::template check_addr(a, vm::page_writable))
goto error;
return error();
Impl::write8(a, FromArray<u8>(&buf[buf_cnt], 4));
buf_cnt += 5;
break;
@@ -232,10 +252,10 @@ namespace pine
case MsgWrite16:
{
if (!SafetyChecks(buf_cnt, 2 + 4, ret_cnt, 0, buf_size))
goto error;
return error();
const u32 a = FromArray<u32>(&buf[buf_cnt], 0);
if (!Impl::template check_addr<2>(a, vm::page_writable))
goto error;
return error();
Impl::write16(a, FromArray<u16>(&buf[buf_cnt], 4));
buf_cnt += 6;
break;
@@ -243,10 +263,10 @@ namespace pine
case MsgWrite32:
{
if (!SafetyChecks(buf_cnt, 4 + 4, ret_cnt, 0, buf_size))
goto error;
return error();
const u32 a = FromArray<u32>(&buf[buf_cnt], 0);
if (!Impl::template check_addr<4>(a, vm::page_writable))
goto error;
return error();
Impl::write32(a, FromArray<u32>(&buf[buf_cnt], 4));
buf_cnt += 8;
break;
@@ -254,31 +274,24 @@ namespace pine
case MsgWrite64:
{
if (!SafetyChecks(buf_cnt, 8 + 4, ret_cnt, 0, buf_size))
goto error;
return error();
const u32 a = FromArray<u32>(&buf[buf_cnt], 0);
if (!Impl::template check_addr<8>(a, vm::page_writable))
goto error;
return error();
Impl::write64(a, FromArray<u64>(&buf[buf_cnt], 4));
buf_cnt += 12;
break;
}
case MsgVersion:
{
char version[256] = {};
snprintf(version, sizeof(version), "RPCS3 %s", Impl::get_version_and_branch().c_str());
const u32 size = strlen(version) + 1;
if (!SafetyChecks(buf_cnt, 0, ret_cnt, size + 4, buf_size))
goto error;
ToArray(ret_buffer, size, ret_cnt);
ret_cnt += 4;
memcpy(&ret_buffer[ret_cnt], version, size);
ret_cnt += size;
if (!write_string("RPCS3 " + Impl::get_version_and_branch()))
return error();
break;
}
case MsgStatus:
{
if (!SafetyChecks(buf_cnt, 0, ret_cnt, 4, buf_size))
goto error;
return error();
EmuStatus status = Impl::get_status();
ToArray(ret_buffer, status, ret_cnt);
ret_cnt += 4;
@@ -287,72 +300,35 @@ namespace pine
}
case MsgTitle:
{
const auto title_string = Impl::get_title();
const auto size = title_string.size() + 1;
char* title = new char[size];
snprintf(title, size, "%s", title_string.c_str());
if (!SafetyChecks(buf_cnt, 0, ret_cnt, size + 4, buf_size))
goto error;
ToArray(ret_buffer, size, ret_cnt);
ret_cnt += 4;
memcpy(&ret_buffer[ret_cnt], title, size);
ret_cnt += size;
delete[] title;
if (!write_string(Impl::get_title()))
return error();
break;
}
case MsgID:
{
const auto title_id_string = Impl::get_title_ID();
const auto size = title_id_string.size() + 1;
char* title_id = new char[size];
snprintf(title_id, size, "%s", title_id_string.c_str());
if (!SafetyChecks(buf_cnt, 0, ret_cnt, size + 4, buf_size))
goto error;
ToArray(ret_buffer, size, ret_cnt);
ret_cnt += 4;
memcpy(&ret_buffer[ret_cnt], title_id, size);
ret_cnt += size;
delete[] title_id;
if (!write_string(Impl::get_title_ID()))
return error();
break;
}
case MsgUUID:
{
const auto hash_string = Impl::get_executable_hash();
const auto size = hash_string.size() + 1;
char* hash = new char[size];
snprintf(hash, size, "%s", hash_string.c_str());
if (!SafetyChecks(buf_cnt, 0, ret_cnt, size + 4, buf_size))
goto error;
ToArray(ret_buffer, size, ret_cnt);
ret_cnt += 4;
memcpy(&ret_buffer[ret_cnt], hash, size);
ret_cnt += size;
delete[] hash;
if (!write_string(Impl::get_executable_hash()))
return error();
break;
}
case MsgGameVersion:
{
const auto game_version_string = Impl::get_app_version();
const auto size = game_version_string.size() + 1;
char* game_version = new char[size];
snprintf(game_version, size, "%s", game_version_string.c_str());
if (!SafetyChecks(buf_cnt, 0, ret_cnt, size, buf_size))
goto error;
ToArray(ret_buffer, size, ret_cnt);
ret_cnt += 4;
memcpy(&ret_buffer[ret_cnt], game_version, size);
ret_cnt += size;
delete[] game_version;
if (!write_string(Impl::get_app_version()))
return error();
break;
}
default:
{
error:
return IPCBuffer{ 5, MakeFailIPC(ret_buffer) };
return error();
}
}
}
return IPCBuffer{ static_cast<int>(ret_cnt), MakeOkIPC(ret_buffer, ret_cnt) };
return IPCBuffer{ ret_cnt, MakeOkIPC(ret_buffer, ret_cnt) };
}
/**
@@ -361,26 +337,48 @@ namespace pine
* size: size of the IPC buffer.
* return value: buffer containing the status code allocated of size
*/
static inline char* MakeOkIPC(char* ret_buffer, uint32_t size = 5)
static inline char* MakeOkIPC(char* ret_buffer, usz size = 5)
{
ToArray<uint32_t>(ret_buffer, size, 0);
ToArray(ret_buffer, ::narrow<u32>(size), 0);
ret_buffer[4] = IPC_OK;
return ret_buffer;
}
static inline char* MakeFailIPC(char* ret_buffer, uint32_t size = 5)
static inline char* MakeFailIPC(char* ret_buffer, usz size = 5)
{
ToArray<uint32_t>(ret_buffer, size, 0);
ToArray(ret_buffer, ::narrow<u32>(size), 0);
ret_buffer[4] = IPC_FAIL;
return ret_buffer;
}
/**
* Initializes an open socket for IPC communication.
* return value: -1 if a fatal failure happened, 0 otherwise.
* return value: false if a fatal failure happened, true otherwise.
*/
int StartSocket()
bool StartSocket()
{
::pollfd poll_fd{};
for (int pending_connection = 0; pending_connection != 1;)
{
if (thread_ctrl::state() == thread_state::aborting)
{
return false;
}
std::memset(&poll_fd, 0, sizeof(poll_fd));
poll_fd.events = POLLIN;
poll_fd.revents = 0;
poll_fd.fd = m_sock;
#ifdef _WIN32
// Try to wait for an incoming connection
pending_connection = ::WSAPoll(&poll_fd, 1, 10);
#else
pending_connection = ::poll(&poll_fd, 1, 10);
#endif
}
m_msgsock = accept(m_sock, 0, 0);
if (m_msgsock == -1)
@@ -398,10 +396,10 @@ namespace pine
{
#endif
Impl::error("IPC: An unrecoverable error happened! Shutting down...");
return -1;
return false;
}
}
return 0;
return true;
}
// Thread used to relay IPC commands.
@@ -409,10 +407,10 @@ namespace pine
{
// we allocate once buffers to not have to do mallocs for each IPC
// request, as malloc is expansive when we optimize for µs.
m_ret_buffer = new char[MAX_IPC_RETURN_SIZE];
m_ipc_buffer = new char[MAX_IPC_SIZE];
m_ret_buffer.resize(MAX_IPC_RETURN_SIZE);
m_ipc_buffer.resize(MAX_IPC_SIZE);
if (StartSocket() < 0)
if (!StartSocket())
return;
while (thread_ctrl::state() != thread_state::aborting)
@@ -432,7 +430,7 @@ namespace pine
if (tmp_length <= 0)
{
receive_length = 0;
if (StartSocket() < 0)
if (!StartSocket())
return;
break;
}
@@ -442,7 +440,7 @@ namespace pine
// if we got at least the final size then update
if (end_length == 4 && receive_length >= 4)
{
end_length = FromArray<u32>(m_ipc_buffer, 0);
end_length = FromArray<u32>(m_ipc_buffer.data(), 0);
// we'd like to avoid a client trying to do OOB
if (end_length > MAX_IPC_SIZE || end_length < 4)
{
@@ -459,12 +457,12 @@ namespace pine
// disconnects
if (receive_length != 0)
{
pine_server::IPCBuffer res = ParseCommand(&m_ipc_buffer[4], m_ret_buffer, static_cast<u32>(end_length) - 4);
pine_server::IPCBuffer res = ParseCommand(&m_ipc_buffer[4], m_ret_buffer.data(), static_cast<u32>(end_length) - 4);
// if we cannot send back our answer restart the socket
if (write_portable(m_msgsock, res.buffer, res.size) < 0)
{
if (StartSocket() < 0)
if (!StartSocket())
return;
}
}
@@ -480,9 +478,9 @@ namespace pine
* NB: implicitely inlined
*/
template <typename T>
static char* ToArray(char* res_array, T res, int i)
static char* ToArray(char* res_array, T res, usz i)
{
memcpy((res_array + i), reinterpret_cast<char*>(&res), sizeof(T));
memcpy(res_array + i, reinterpret_cast<char*>(&res), sizeof(T));
return res_array;
}
@@ -503,7 +501,7 @@ namespace pine
* Ensures an IPC message isn't too big.
* return value: false if checks failed, true otherwise.
*/
static inline bool SafetyChecks(u32 command_len, int command_size, u32 reply_len, int reply_size = 0, u32 buf_size = MAX_IPC_SIZE - 1)
static inline bool SafetyChecks(usz command_len, usz command_size, usz reply_len, usz reply_size = 0, usz buf_size = MAX_IPC_SIZE - 1)
{
bool res = ((command_len + command_size) > buf_size ||
(reply_len + reply_size) >= MAX_IPC_RETURN_SIZE);
@@ -537,7 +535,10 @@ namespace pine
// yes very good windows s/sun/sin/g sure is fine
server.sin_family = AF_INET;
// localhost only
server.sin_addr.s_addr = inet_addr("127.0.0.1");
if (!inet_pton(server.sin_family, "127.0.0.1", &server.sin_addr.s_addr))
{
fmt::throw_exception("IPC: Failed to convert localhost");
}
server.sin_port = htons(Impl::get_port());
if (bind(m_sock, (struct sockaddr*)&server, sizeof(server)) == SOCKET_ERROR)
@@ -609,8 +610,6 @@ namespace pine
~pine_server()
{
Cleanup();
delete[] m_ret_buffer;
delete[] m_ipc_buffer;
}
}; // class pine_server
+1
View File
@@ -0,0 +1 @@
add_subdirectory(rtmidi EXCLUDE_FROM_ALL)
Vendored Submodule
+1
Submodule 3rdparty/rtmidi/rtmidi added at 84a99422a3
+61
View File
@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" 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="rtmidi\RtMidi.h" />
<ClInclude Include="rtmidi\rtmidi_c.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="rtmidi\RtMidi.cpp" />
<ClCompile Include="rtmidi\rtmidi_c.cpp" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{2C902C67-985C-4BE0-94A3-E0FE2EB929A3}</ProjectGuid>
<RootNamespace>rtmidi</RootNamespace>
</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>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</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>
<WarningLevel>TurnOffAllWarnings</WarningLevel>
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>__WINDOWS_MM__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>./rtmidi/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DebugInformationFormat Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">ProgramDatabase</DebugInformationFormat>
</ClCompile>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
+4 -4
View File
@@ -11,7 +11,7 @@ Other instructions may be found [here](https://wiki.rpcs3.net/index.php?title=Bu
* [Python 3.6+](https://www.python.org/downloads/) (add to PATH)
* [Qt 5.15.2](https://www.qt.io/download-qt-installer)
* [Visual Studio 2019](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community)
* [Vulkan SDK 1.2.224+](https://vulkan.lunarg.com/sdk/home) (See "Install the SDK" [here](https://vulkan.lunarg.com/doc/sdk/latest/windows/getting_started.html))
* [Vulkan SDK 1.3.224+](https://vulkan.lunarg.com/sdk/home) (See "Install the SDK" [here](https://vulkan.lunarg.com/doc/sdk/latest/windows/getting_started.html))
**Either add the** `QTDIR` **environment variable, e.g.** `<QtInstallFolder>\5.15.2\msvc2019_64\` **, or use the [Visual Studio Qt Plugin](https://marketplace.visualstudio.com/items?itemName=TheQtCompany.QtVisualStudioTools2019)**
@@ -22,8 +22,8 @@ These are the essentials tools to build RPCS3 on Linux. Some of them can be inst
* Clang 12+ or GCC 11+
* [CMake 3.16.9+](https://www.cmake.org/download/)
* [Qt 5.15.2](https://www.qt.io/download-qt-installer)
* [Vulkan SDK 1.2.224+](https://vulkan.lunarg.com/sdk/home) (See "Install the SDK" [here](https://vulkan.lunarg.com/doc/sdk/latest/linux/getting_started.html))
* [SDL2](https://www.libsdl.org/download-2.0.php) (for the FAudio backend)
* [Vulkan SDK 1.3.224+](https://vulkan.lunarg.com/sdk/home) (See "Install the SDK" [here](https://vulkan.lunarg.com/doc/sdk/latest/linux/getting_started.html))
* [SDL2](https://github.com/libsdl-org/SDL/releases) (for the FAudio backend)
**If you have an NVIDIA GPU, you may need to install the libglvnd package.**
@@ -111,7 +111,7 @@ git submodule update --init
Open `rpcs3.sln`. 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/llvmlibs_mt.7z) and extract them to the root rpcs3 folder (which contains `rpcs3.sln`), as well as download and extract the [additional libs](https://github.com/RPCS3/glslang/releases/download/custom-build-win/glslanglibs_mt.7z) to `lib\%CONFIGURATION%-x64\` to speed up compilation time (unoptimised/debug libs are currently not available precompiled).
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/download/custom-build-win/glslanglibs_mt.7z) to `lib\%CONFIGURATION%-x64\` to speed up compilation time (unoptimised/debug libs are currently not available precompiled).
If you're not using the precompiled libs, build the following projects in *__BUILD_BEFORE* folder by right-clicking on a project > *Build*.:
* glslang
+2 -1
View File
@@ -14,7 +14,8 @@ endif()
option(USE_NATIVE_INSTRUCTIONS "USE_NATIVE_INSTRUCTIONS makes rpcs3 compile with -march=native, which is useful for local builds, but not good for packages." ON)
option(WITH_LLVM "Enable usage of LLVM library" ON)
option(BUILD_LLVM_SUBMODULE "Build LLVM from git submodule" ON)
option(BUILD_LLVM "Build LLVM from git submodule" OFF)
option(STATIC_LINK_LLVM "Link against LLVM statically. This will get set to ON if you build LLVM from the submodule." OFF)
option(USE_FAUDIO "FAudio audio backend" ON)
option(USE_LIBEVDEV "libevdev-based joystick support" ON)
option(USE_DISCORD_RPC "Discord rich presence integration" OFF)
+2 -3
View File
@@ -1,9 +1,8 @@
RPCS3
=====
[![Azure Build Status](https://dev.azure.com/nekotekina/nekotekina/_apis/build/status/RPCS3.rpcs3?branchName=master)](https://dev.azure.com/nekotekina/nekotekina/_build?definitionId=4&branchName=master)
[![Cirrus CI - Base Branch Build Status](https://img.shields.io/cirrus/github/RPCS3/rpcs3?label=Cirrus%20CI%20(FreeBSD)&logo=cirrus-ci)](https://cirrus-ci.com/github/RPCS3/rpcs3)
[![RPCS3 discord server](https://img.shields.io/discord/272035812277878785?color=5865F2&label=RPCS3%20Discord&logo=discord&logoColor=white)](https://discord.me/rpcs3)
[![Cirrus CI - Base Branch Build Status](https://img.shields.io/cirrus/github/RPCS3/rpcs3?label=Cirrus%20CI&logo=cirrus-ci)](https://cirrus-ci.com/github/RPCS3/rpcs3)
[![RPCS3 Discord Server](https://img.shields.io/discord/272035812277878785?color=5865F2&label=RPCS3%20Discord&logo=discord&logoColor=white)](https://discord.me/rpcs3)
The world's first free and open-source PlayStation 3 emulator/debugger, written in C++ for Windows, Linux, macOS and FreeBSD.
+40 -8
View File
@@ -1,7 +1,6 @@
#include "stdafx.h"
#include "Config.h"
#include "util/types.hpp"
#include "util/yaml.hpp"
#include <charconv>
@@ -24,9 +23,9 @@ namespace cfg
{
for (const auto& node : owner->m_nodes)
{
if (node->get_name() == name)
if (node->get_name() == m_name)
{
cfg_log.fatal("Node already exists: %s", name);
cfg_log.fatal("Node already exists: %s", m_name);
}
}
@@ -62,7 +61,7 @@ bool try_to_int64(s64* out, std::string_view value, s64 min, s64 max)
{
if (value.empty())
{
if (out) cfg_log.error("cfg::try_to_uint64(): called with an empty string");
if (out) cfg_log.error("cfg::try_to_int64(): called with an empty string");
return false;
}
@@ -97,7 +96,7 @@ bool try_to_int64(s64* out, std::string_view value, s64 min, s64 max)
if (result < min || result > max)
{
if (out) cfg_log.error("cfg::try_to_int64('%s'): out of bounds (%d..%d)", value, min, max);
if (out) cfg_log.error("cfg::try_to_int64('%s'): out of bounds (val=%d, min=%d, max=%d)", value, result, min, max);
return false;
}
@@ -140,7 +139,7 @@ bool try_to_uint64(u64* out, std::string_view value, u64 min, u64 max)
if (result < min || result > max)
{
if (out) cfg_log.error("cfg::try_to_uint64('%s'): out of bounds (%u..%u)", value, min, max);
if (out) cfg_log.error("cfg::try_to_uint64('%s'): out of bounds (val=%u, min=%u, max=%u)", value, result, min, max);
return false;
}
@@ -176,7 +175,7 @@ bool try_to_float(f64* out, std::string_view value, f64 min, f64 max)
if (result < min || result > max)
{
if (out) cfg_log.error("cfg::try_to_float('%s'): out of bounds (%f..%f)", value, min, max);
if (out) cfg_log.error("cfg::try_to_float('%s'): out of bounds (val=%f, min=%f, max=%f)", value, result, min, max);
return false;
}
@@ -184,6 +183,27 @@ bool try_to_float(f64* out, std::string_view value, f64 min, f64 max)
return true;
}
bool try_to_string(std::string* out, const f64& value)
{
#ifdef __APPLE__
if (out) *out = std::to_string(value);
return true;
#else
std::array<char, 32> str{};
if (auto [ptr, ec] = std::to_chars(str.data(), str.data() + str.size(), value, std::chars_format::fixed); ec == std::errc())
{
if (out) *out = std::string(str.data(), ptr);
return true;
}
else
{
if (out) cfg_log.error("cfg::try_to_string(): could not convert value '%f' to string. error='%s'", value, std::make_error_code(ec).message());
return false;
}
#endif
}
bool cfg::try_to_enum_value(u64* out, decltype(&fmt_class_string<int>::format) func, std::string_view value)
{
u64 max = umax;
@@ -231,7 +251,7 @@ bool cfg::try_to_enum_value(u64* out, decltype(&fmt_class_string<int>::format) f
if (result > max)
{
if (out) cfg_log.error("cfg::try_to_enum_value('%s'): out of bounds(0..%u)", value, max);
if (out) cfg_log.error("cfg::try_to_enum_value('%s'): out of bounds(val=%u, min=0, max=%u)", value, result, max);
return false;
}
@@ -559,6 +579,18 @@ void cfg::log_entry::from_default()
set_map({});
}
std::pair<u16, u16> cfg::device_info::get_usb_ids() const
{
auto string_to_hex = [](const std::string& str) -> u16
{
u16 value = 0x0000;
if (!str.empty() && std::from_chars(str.data(), str.data() + str.size(), value, 16).ec != std::errc{})
cfg_log.error("Failed to parse hex from string \"%s\"", str);
return value;
};
return {string_to_hex(vid), string_to_hex(pid)};
}
void cfg::device_entry::set_map(map_of_type<device_info>&& map)
{
m_map = std::move(map);
+27 -6
View File
@@ -226,6 +226,11 @@ namespace cfg
return m_value;
}
T get_default() const
{
return def;
}
void set(T value)
{
m_value = value;
@@ -285,8 +290,8 @@ namespace cfg
int_type def;
// Expose range
static const s64 max = Max;
static const s64 min = Min;
static constexpr s64 max = Max;
static constexpr s64 min = Min;
_int(node* owner, const std::string& name, int_type def = std::min<int_type>(Max, std::max<int_type>(Min, 0)), bool dynamic = false)
: _base(type::_int, owner, name, dynamic)
@@ -334,6 +339,7 @@ namespace cfg
void set(const s64& value)
{
ensure(value >= Min && value <= Max);
m_value = static_cast<int_type>(value);
}
@@ -383,12 +389,24 @@ namespace cfg
std::string to_string() const override
{
return std::to_string(m_value);
std::string result;
if (try_to_string(&result, m_value))
{
return result;
}
return "0.0";
}
std::string def_to_string() const override
{
return std::to_string(def);
std::string result;
if (try_to_string(&result, def))
{
return result;
}
return "0.0";
}
bool from_string(std::string_view value, bool /*dynamic*/ = false) override
@@ -405,6 +423,7 @@ namespace cfg
void set(const f64& value)
{
ensure(value >= Min && value <= Max);
m_value = static_cast<float_type>(value);
}
@@ -435,8 +454,8 @@ namespace cfg
int_type def;
// Expose range
static const u64 max = Max;
static const u64 min = Min;
static constexpr u64 max = Max;
static constexpr u64 min = Min;
uint(node* owner, const std::string& name, int_type def = std::max<int_type>(Min, 0), bool dynamic = false)
: _base(type::uint, owner, name, dynamic)
@@ -484,6 +503,7 @@ namespace cfg
void set(const u64& value)
{
ensure(value >= Min && value <= Max);
m_value = static_cast<int_type>(value);
}
@@ -644,6 +664,7 @@ namespace cfg
std::string serial;
std::string vid;
std::string pid;
std::pair<u16, u16> get_usb_ids() const;
};
class device_entry final : public _base
+2 -2
View File
@@ -1783,7 +1783,7 @@ const std::string& fs::get_config_dir()
if (GetEnvironmentVariable(L"RPCS3_CONFIG_DIR", buf, size) - 1 >= size - 1 &&
GetModuleFileName(nullptr, buf, size) - 1 >= size - 1)
{
MessageBoxA(nullptr, fmt::format("GetModuleFileName() failed: error %u.", GetLastError()).c_str(), "fs::get_config_dir()", MB_ICONERROR);
MessageBoxA(nullptr, fmt::format("GetModuleFileName() failed: error: %s", fmt::win_error{GetLastError(), nullptr}).c_str(), "fs::get_config_dir()", MB_ICONERROR);
return dir; // empty
}
@@ -1868,7 +1868,7 @@ const std::string& fs::get_temp_dir()
wchar_t buf[MAX_PATH + 2]{};
if (GetTempPathW(MAX_PATH + 1, buf) - 1 > MAX_PATH)
{
MessageBoxA(nullptr, fmt::format("GetTempPath() failed: error %u.", GetLastError()).c_str(), "fs::get_temp_dir()", MB_ICONERROR);
MessageBoxA(nullptr, fmt::format("GetTempPath() failed: error: %s", fmt::win_error{GetLastError(), nullptr}).c_str(), "fs::get_temp_dir()", MB_ICONERROR);
return dir; // empty
}
+66 -22
View File
@@ -198,6 +198,9 @@ static u8* add_jit_memory(usz size, uint align)
});
}
ensure(pointer + pos >= get_jit_memory() + Off);
ensure(pointer + pos < get_jit_memory() + Off + 0x40000000);
return pointer + pos;
}
@@ -795,7 +798,7 @@ void asmjit::simd_builder::vec_cmp_eq(u32 esize, const Operand& dst, const Opera
}
else
{
_vec_binary_op(kIdPcmpeqw, kIdVpcmpeqw, kIdNone, dst, lhs, rhs);
_vec_binary_op(kIdPcmpeqd, kIdVpcmpeqd, kIdNone, dst, lhs, rhs);
}
}
else
@@ -1304,7 +1307,7 @@ std::string jit_compiler::cpu(const std::string& _cpu)
if (m_cpu.empty())
{
m_cpu = llvm::sys::getHostCPUName().operator std::string();
m_cpu = llvm::sys::getHostCPUName().str();
if (m_cpu == "sandybridge" ||
m_cpu == "ivybridge" ||
@@ -1319,7 +1322,10 @@ std::string jit_compiler::cpu(const std::string& _cpu)
m_cpu == "icelake-client" ||
m_cpu == "icelake-server" ||
m_cpu == "tigerlake" ||
m_cpu == "rocketlake")
m_cpu == "rocketlake" ||
m_cpu == "alderlake" ||
m_cpu == "raptorlake" ||
m_cpu == "meteorlake")
{
// Downgrade if AVX is not supported by some chips
if (!utils::has_avx())
@@ -1350,11 +1356,51 @@ std::string jit_compiler::cpu(const std::string& _cpu)
// Upgrade
m_cpu = "znver2";
}
if ((m_cpu == "znver3" || m_cpu == "goldmont" || m_cpu == "alderlake" || m_cpu == "raptorlake" || m_cpu == "meteorlake") && utils::has_avx512_icl())
{
// Upgrade
m_cpu = "icelake-client";
}
if (m_cpu == "goldmont" && utils::has_avx2())
{
// Upgrade
m_cpu = "alderlake";
}
}
return m_cpu;
}
std::string jit_compiler::triple1()
{
#if defined(_WIN32)
return llvm::Triple::normalize(llvm::sys::getProcessTriple());
#elif defined(__APPLE__) && defined(ARCH_X64)
return llvm::Triple::normalize("x86_64-unknown-linux-gnu");
#elif defined(__APPLE__) && defined(ARCH_ARM64)
return llvm::Triple::normalize("aarch64-unknown-linux-gnu");
#else
return llvm::Triple::normalize(llvm::sys::getProcessTriple());
#endif
}
std::string jit_compiler::triple2()
{
#if defined(_WIN32) && defined(ARCH_X64)
return llvm::Triple::normalize("x86_64-unknown-linux-gnu");
#elif defined(_WIN32) && defined(ARCH_ARM64)
return llvm::Triple::normalize("aarch64-unknown-linux-gnu");
#elif defined(__APPLE__) && defined(ARCH_X64)
return llvm::Triple::normalize("x86_64-unknown-linux-gnu");
#elif defined(__APPLE__) && defined(ARCH_ARM64)
return llvm::Triple::normalize("aarch64-unknown-linux-gnu");
#else
return llvm::Triple::normalize(llvm::sys::getProcessTriple());
#endif
}
jit_compiler::jit_compiler(const std::unordered_map<std::string, u64>& _link, const std::string& _cpu, u32 flags)
: m_context(new llvm::LLVMContext)
, m_cpu(cpu(_cpu))
@@ -1362,15 +1408,13 @@ jit_compiler::jit_compiler(const std::unordered_map<std::string, u64>& _link, co
std::string result;
auto null_mod = std::make_unique<llvm::Module> ("null_", *m_context);
#if defined(__APPLE__) && defined(ARCH_ARM64)
// Force override triple on Apple arm64 or we'll get linking errors.
null_mod->setTargetTriple(llvm::Triple::normalize(utils::c_llvm_default_triple));
#endif
null_mod->setTargetTriple(jit_compiler::triple1());
std::unique_ptr<llvm::RTDyldMemoryManager> mem;
if (_link.empty())
{
std::unique_ptr<llvm::RTDyldMemoryManager> mem;
// Auxiliary JIT (does not use custom memory manager, only writes the objects)
if (flags & 0x1)
{
mem = std::make_unique<MemoryManager1>();
@@ -1378,31 +1422,31 @@ jit_compiler::jit_compiler(const std::unordered_map<std::string, u64>& _link, co
else
{
mem = std::make_unique<MemoryManager2>();
null_mod->setTargetTriple(llvm::Triple::normalize(utils::c_llvm_default_triple));
null_mod->setTargetTriple(jit_compiler::triple2());
}
}
else
{
mem = std::make_unique<MemoryManager1>();
}
// Auxiliary JIT (does not use custom memory manager, only writes the objects)
{
m_engine.reset(llvm::EngineBuilder(std::move(null_mod))
.setErrorStr(&result)
.setEngineKind(llvm::EngineKind::JIT)
.setMCJITMemoryManager(std::move(mem))
.setOptLevel(llvm::CodeGenOpt::Aggressive)
.setCodeModel(flags & 0x2 ? llvm::CodeModel::Large : llvm::CodeModel::Small)
#ifdef __APPLE__
//.setCodeModel(llvm::CodeModel::Large)
#endif
.setRelocationModel(llvm::Reloc::Model::PIC_)
.setMCPU(m_cpu)
.create());
}
else
{
// Primary JIT
m_engine.reset(llvm::EngineBuilder(std::move(null_mod))
.setErrorStr(&result)
.setEngineKind(llvm::EngineKind::JIT)
.setMCJITMemoryManager(std::make_unique<MemoryManager1>())
.setOptLevel(llvm::CodeGenOpt::Aggressive)
.setCodeModel(flags & 0x2 ? llvm::CodeModel::Large : llvm::CodeModel::Small)
.setMCPU(m_cpu)
.create());
if (!_link.empty())
{
for (auto&& [name, addr] : _link)
{
m_engine->updateGlobalMapping(name, addr);
+6
View File
@@ -546,6 +546,12 @@ public:
// Get CPU info
static std::string cpu(const std::string& _cpu);
// Get system triple (PPU)
static std::string triple1();
// Get system triple (SPU)
static std::string triple2();
};
#endif
+39 -2
View File
@@ -37,6 +37,12 @@ std::string utf16_to_utf8(std::u16string_view src)
return converter.to_bytes(src.data());
}
std::u16string utf8_to_utf16(std::string_view src)
{
std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> converter{};
return converter.from_bytes(src.data());
}
std::wstring utf8_to_wchar(std::string_view src)
{
#ifdef _WIN32
@@ -73,6 +79,17 @@ std::string fmt::win_error_to_string(unsigned long error, void* module_handle)
return message;
}
std::string fmt::win_error_to_string(const fmt::win_error& error)
{
return fmt::win_error_to_string(error.error, error.module_handle);
}
template <>
void fmt_class_string<fmt::win_error>::format(std::string& out, u64 arg)
{
fmt::append(out, "%s", fmt::win_error_to_string(get_object(arg)));
}
#endif
template <>
@@ -197,6 +214,26 @@ void fmt_class_string<std::vector<char8_t>>::format(std::string& out, u64 arg)
out.append(obj.cbegin(), obj.cend());
}
template <>
void fmt_class_string<fmt::buf_to_hexstring>::format(std::string& out, u64 arg)
{
const auto& _arg = get_object(arg);
const std::vector<u8> buf(_arg.buf, _arg.buf + _arg.len);
out.reserve(out.size() + (buf.size() * 3));
static constexpr char hex[16] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
for (usz index = 0; index < buf.size(); index++)
{
out += hex[buf[index] >> 4];
out += hex[buf[index] & 15];
if (((index + 1) % 16) == 0)
out += '\n';
else
out += ' ';
}
}
void format_byte_array(std::string& out, const uchar* data, usz size)
{
if (!size)
@@ -562,7 +599,7 @@ std::string fmt::trim(const std::string& source, const std::string& values)
return source.substr(begin, source.find_last_not_of(values) + 1);
}
std::string fmt::to_upper(const std::string& string)
std::string fmt::to_upper(std::string_view string)
{
std::string result;
result.resize(string.size());
@@ -570,7 +607,7 @@ std::string fmt::to_upper(const std::string& string)
return result;
}
std::string fmt::to_lower(const std::string& string)
std::string fmt::to_lower(std::string_view string)
{
std::string result;
result.resize(string.size());
+30
View File
@@ -10,8 +10,15 @@ namespace fmt
static std::string format(const CharT(&)[N], const Args&...);
#ifdef _WIN32
struct win_error
{
unsigned long error{};
void* module_handle{};
};
// Get a string for a windows error (DWORD). Optionally a module HANDLE can be passed.
std::string win_error_to_string(unsigned long error, void* module_handle = nullptr);
std::string win_error_to_string(const win_error& error);
#endif
}
@@ -237,6 +244,29 @@ struct fmt_class_string<wchar_t*, void> : fmt_class_string<const wchar_t*>
{
};
namespace fmt
{
template <typename T>
concept StringConvertible = requires (T & t)
{
{ t.to_string() } -> std::convertible_to<std::string>;
};
}
template <fmt::StringConvertible T>
struct fmt_class_string<T, void>
{
static FORCE_INLINE SAFE_BUFFERS(const T&) get_object(u64 arg)
{
return *reinterpret_cast<const T*>(static_cast<uptr>(arg));
}
static void format(std::string& out, u64 arg)
{
out += get_object(arg).to_string();
}
};
namespace fmt
{
// Both uchar and std::byte are allowed
+16 -3
View File
@@ -11,10 +11,11 @@
std::wstring utf8_to_wchar(std::string_view src);
std::string wchar_to_utf8(std::wstring_view src);
std::string utf16_to_utf8(std::u16string_view src);
std::u16string utf8_to_utf16(std::string_view src);
// Copy null-terminated string from a std::string or a char array to a char array with truncation
template <typename D, typename T>
inline void strcpy_trunc(D& dst, const T& src)
inline void strcpy_trunc(D&& dst, const T& src)
{
const usz count = std::size(src) >= std::size(dst) ? std::max<usz>(std::size(dst), 1) - 1 : std::size(src);
std::memcpy(std::data(dst), std::data(src), count);
@@ -30,6 +31,9 @@ bool try_to_uint64(u64* out, std::string_view value, u64 min, u64 max);
// Convert string to float
bool try_to_float(f64* out, std::string_view value, f64 min, f64 max);
// Convert float to string locale independent
bool try_to_string(std::string* out, const f64& value);
// Get the file extension of a file path ("png", "jpg", etc.)
std::string get_file_extension(const std::string& file_path);
@@ -169,8 +173,17 @@ namespace fmt
return result;
}
std::string to_upper(const std::string& string);
std::string to_lower(const std::string& string);
std::string to_upper(std::string_view string);
std::string to_lower(std::string_view string);
bool match(const std::string& source, const std::string& mask);
struct buf_to_hexstring
{
buf_to_hexstring(const u8* buf, usz len)
: buf(buf), len(len) {}
const u8* buf;
usz len;
};
}
+111 -38
View File
@@ -4,6 +4,7 @@
#include "Emu/Cell/PPUThread.h"
#include "Emu/Cell/lv2/sys_mmapper.h"
#include "Emu/Cell/lv2/sys_event.h"
#include "Emu/Cell/lv2/sys_process.h"
#include "Emu/RSX/RSXThread.h"
#include "Thread.h"
#include "Utilities/JIT.h"
@@ -15,6 +16,11 @@
#include <Psapi.h>
#include <process.h>
#include <sysinfoapi.h>
#include "util/dyn_lib.hpp"
DYNAMIC_IMPORT_RENAME("Kernel32.dll", SetThreadDescriptionImport, "SetThreadDescription", HRESULT(HANDLE hThread, PCWSTR lpThreadDescription));
#else
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
@@ -277,8 +283,11 @@ enum x64_op_t : u32
X64OP_ADC, // lock adc [mem], ...
X64OP_SUB, // lock sub [mem], ...
X64OP_SBB, // lock sbb [mem], ...
X64OP_BEXTR,
};
static thread_local x64_reg_t s_tls_reg3{};
void decode_x64_reg_op(const u8* code, x64_op_t& out_op, x64_reg_t& out_reg, usz& out_size, usz& out_length)
{
// simple analysis of x64 code allows to reinterpret MOV or other instructions in any desired way
@@ -739,10 +748,12 @@ void decode_x64_reg_op(const u8* code, x64_op_t& out_op, x64_reg_t& out_reg, usz
const u8 vopm = op1 == 0xc5 ? 1 : op2 & 0x1f;
const u8 vop1 = op1 == 0xc5 ? op3 : code[2];
const u8 vlen = (opx & 0x4) ? 32 : 16;
//const u8 vreg = (~opx >> 3) & 0xf;
const u8 vreg = (~opx >> 3) & 0xf;
out_length += op1 == 0xc5 ? 2 : 3;
code += op1 == 0xc5 ? 2 : 3;
s_tls_reg3 = x64_reg_t{vreg};
if (vopm == 0x1) switch (vop1) // Implied leading byte 0x0F
{
case 0x11:
@@ -772,6 +783,22 @@ void decode_x64_reg_op(const u8* code, x64_op_t& out_op, x64_reg_t& out_reg, usz
}
}
if (vopm == 0x2) switch (vop1) // Implied leading bytes 0x0F 0x38
{
case 0xf7:
{
if (!repe && !repne && vlen == 16) // BEXTR r32,mem,r32
{
out_op = X64OP_BEXTR;
out_reg = get_modRM_reg_xmm(code, rex);
out_size = opx & 0x80 ? 8 : 4;
out_length += get_modRM_size(code);
return;
}
break;
}
}
break;
}
case 0xc6:
@@ -1367,6 +1394,37 @@ bool handle_access_violation(u32 addr, bool is_writing, ucontext_t* context) noe
break;
}
case X64OP_BEXTR:
{
u32 value;
if (is_writing || !thread->read_reg(addr, value))
{
return false;
}
value = stx::se_storage<u32>::swap(value);
u64 ctrl;
if (!get_x64_reg_value(context, s_tls_reg3, d_size, i_size, ctrl))
{
return false;
}
u8 start = ctrl & 0xff;
u8 _len = (ctrl & 0xff00) >> 8;
if (_len > 32)
_len = 32;
if (start > 32)
start = 32;
value = (u64{value} >> start) & ~(u64{umax} << _len);
if (!put_x64_reg_value(context, reg, d_size, value) || !set_x64_cmp_flags(context, d_size, value, 0))
{
return false;
}
break;
}
case X64OP_STORE:
case X64OP_STORE_BE:
{
@@ -1457,7 +1515,7 @@ bool handle_access_violation(u32 addr, bool is_writing, ucontext_t* context) noe
}
}
if (pf_port_id)
if (auto pf_port = idm::get<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.
@@ -1495,21 +1553,34 @@ bool handle_access_violation(u32 addr, bool is_writing, ucontext_t* context) noe
}
}
// Deschedule
if (cpu->id_type() == 1)
{
lv2_obj::sleep(*cpu);
}
// Now, place the page fault event onto table so that other functions [sys_mmapper_free_address and pagefault recovery funcs etc]
// know that this thread is page faulted and where.
auto& pf_events = g_fxo->get<page_fault_event_entries>();
// De-schedule
if (cpu->id_type() == 1)
{
std::lock_guard pf_lock(pf_events.pf_mutex);
pf_events.events.emplace(cpu, addr);
cpu->state -= cpu_flag::signal; // Cannot use check_state here and signal must be removed if exists
lv2_obj::sleep(*cpu);
}
auto send_event = [&]() -> error_code
{
lv2_obj::notify_all_t notify_later{};
std::lock_guard pf_lock(pf_events.pf_mutex);
if (auto error = pf_port->queue->send(pf_port->name ? pf_port->name : ((u64{process_getpid() + 0u} << 32) | u64{pf_port_id}), data1, data2, data3))
{
return error;
}
pf_events.events.emplace(cpu, addr);
return {};
};
sig_log.warning("Page_fault %s location 0x%x because of %s memory", is_writing ? "writing" : "reading",
addr, data3 == SYS_MEMORY_PAGE_FAULT_CAUSE_READ_ONLY ? "writing read-only" : "using unmapped");
@@ -1521,13 +1592,12 @@ bool handle_access_violation(u32 addr, bool is_writing, ucontext_t* context) noe
}
}
error_code sending_error = sys_event_port_send(pf_port_id, data1, data2, data3);
error_code sending_error = not_an_error(CELL_EBUSY);
// If we fail due to being busy, wait a bit and try again.
while (static_cast<u32>(sending_error) == CELL_EBUSY)
for (; static_cast<u32>(sending_error) == CELL_EBUSY; thread_ctrl::wait_for(1000))
{
thread_ctrl::wait_for(1000);
sending_error = sys_event_port_send(pf_port_id, data1, data2, data3);
sending_error = send_event();
if (cpu->is_stopped())
{
@@ -1761,7 +1831,11 @@ static LONG exception_filter(PEXCEPTION_POINTERS pExp) noexcept
const bool s_exception_handler_set = []() -> bool
{
#ifdef USE_ASAN
if (!AddVectoredExceptionHandler(FALSE, (PVECTORED_EXCEPTION_HANDLER)exception_handler))
#else
if (!AddVectoredExceptionHandler(1, (PVECTORED_EXCEPTION_HANDLER)exception_handler))
#endif
{
report_fatal_error("AddVectoredExceptionHandler() failed.");
}
@@ -1796,7 +1870,7 @@ static void signal_handler(int /*sig*/, siginfo_t* info, void* uct) noexcept
const bool is_executing = err & 0x10;
const bool is_writing = err & 0x2;
#elif defined(ARCH_ARM64)
const bool is_executing = uptr(info->si_addr) == RIP(context);
const bool is_executing = uptr(info->si_addr) == uptr(RIP(context));
const u32 insn = is_executing ? 0 : *reinterpret_cast<u32*>(RIP(context));
const bool is_writing = (insn & 0xbfff0000) == 0x0c000000
|| (insn & 0xbfe00000) == 0x0c800000
@@ -2018,6 +2092,13 @@ void thread_base::initialize(void (*error_cb)())
void thread_base::set_name(std::string name)
{
#ifdef _WIN32
if (SetThreadDescriptionImport)
{
SetThreadDescriptionImport(GetCurrentThread(), utf8_to_wchar(name).c_str());
}
#endif
#ifdef _MSC_VER
struct THREADNAME_INFO
{
@@ -2351,10 +2432,9 @@ void thread_ctrl::wait_for(u64 usec, [[maybe_unused]] bool alert /* true */)
{
struct itimerspec timeout;
u64 missed;
u64 nsec = usec * 1000ull;
timeout.it_value.tv_nsec = (nsec % 1000000000ull);
timeout.it_value.tv_sec = nsec / 1000000000ull;
timeout.it_value.tv_nsec = usec * 1'000ull;
timeout.it_value.tv_sec = 0;
timeout.it_interval.tv_sec = 0;
timeout.it_interval.tv_nsec = 0;
timerfd_settime(fd_timer, 0, &timeout, NULL);
@@ -2580,26 +2660,24 @@ void thread_base::exec()
while (shared_ptr<thread_future> head = m_taskq.exchange(null_ptr))
{
// TODO: check if adapting reverse algorithm is feasible here
shared_ptr<thread_future>* prev{};
thread_future* prev_head{head.get()};
for (auto ptr = head.get(); ptr; ptr = ptr->next.get())
for (thread_future* prev{};;)
{
utils::prefetch_exec(ptr->exec.load());
utils::prefetch_exec(prev_head->exec.load());
ptr->prev = prev;
if (ptr->next)
if (auto next = prev_head->next.get())
{
prev = &ptr->next;
prev = std::exchange(prev_head, next);
prev_head->prev = prev;
}
else
{
break;
}
}
if (!prev)
{
prev = &head;
}
for (auto ptr = prev->get(); ptr; ptr = ptr->prev->get())
for (auto ptr = prev_head; ptr; ptr = ptr->prev)
{
if (auto task = ptr->exec.load()) [[likely]]
{
@@ -2623,11 +2701,6 @@ void thread_base::exec()
// Partial cleanup
ptr->next.reset();
}
if (!ptr->prev)
{
break;
}
}
if (!m_taskq) [[likely]]
@@ -2710,7 +2783,7 @@ void thread_ctrl::detect_cpu_layout()
if (!GetLogicalProcessorInformationEx(relationship,
reinterpret_cast<SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *>(buffer.data()), &buffer_size))
{
sig_log.error("GetLogicalProcessorInformationEx failed (size=%u, error=%u)", buffer_size, GetLastError());
sig_log.error("GetLogicalProcessorInformationEx failed (size=%u, error=%s)", buffer_size, fmt::win_error{GetLastError(), nullptr});
}
else
{
@@ -2957,7 +3030,7 @@ void thread_ctrl::set_native_priority(int priority)
if (!SetThreadPriority(_this_thread, native_priority))
{
sig_log.error("SetThreadPriority() failed: 0x%x", GetLastError());
sig_log.error("SetThreadPriority() failed: %s", fmt::win_error{GetLastError(), nullptr});
}
#else
int policy;
@@ -3009,7 +3082,7 @@ void thread_ctrl::set_thread_affinity_mask(u64 mask)
HANDLE _this_thread = GetCurrentThread();
if (!SetThreadAffinityMask(_this_thread, !mask ? process_affinity_mask : mask))
{
sig_log.error("Failed to set thread affinity 0x%x: error 0x%x.", mask, GetLastError());
sig_log.error("Failed to set thread affinity 0x%x: error: %s", mask, fmt::win_error{GetLastError(), nullptr});
}
#elif __APPLE__
// Supports only one core
+1 -1
View File
@@ -95,7 +95,7 @@ class thread_future
shared_ptr<thread_future> next{};
shared_ptr<thread_future>* prev{};
thread_future* prev{};
protected:
atomic_t<void(*)(thread_base*, thread_future*)> exec{};
+522 -121
View File
File diff suppressed because it is too large Load Diff
+59 -1
View File
@@ -18,6 +18,13 @@ namespace patch_key
static const std::string patch = "Patch";
static const std::string patch_version = "Patch Version";
static const std::string version = "Version";
static const std::string enabled = "Enabled";
static const std::string config_values = "Configurable Values";
static const std::string value = "Value";
static const std::string type = "Type";
static const std::string min = "Min";
static const std::string max = "Max";
static const std::string allowed_values = "Allowed Values";
}
inline static const std::string patch_engine_version = "1.2";
@@ -45,6 +52,21 @@ enum class patch_type
bef32,
bef64,
utf8, // Text of string (not null-terminated automatically)
move_file, // Move file
hide_file, // Hide file
};
static constexpr bool patch_type_uses_hex_offset(patch_type type)
{
return type >= patch_type::alloc && type <= patch_type::utf8;
}
enum class patch_configurable_type
{
double_range,
double_enum,
long_range,
long_enum
};
class patch_engine
@@ -54,6 +76,7 @@ public:
{
patch_type type = patch_type::load;
u32 offset = 0;
std::string original_offset{}; // Used for specifying paths
std::string original_value{}; // Used for import consistency (avoid rounding etc.)
union
{
@@ -63,7 +86,40 @@ public:
mutable u32 alloc_addr = 0; // Used to save optional allocation address (if occured)
};
using patch_app_versions = std::unordered_map<std::string /*app_version*/, bool /*enabled*/>;
struct patch_allowed_value
{
std::string label;
f64 value{};
bool operator==(const patch_allowed_value& other) const
{
return value == other.value && label == other.label;
}
};
struct patch_config_value
{
f64 value{};
f64 min{};
f64 max{};
patch_configurable_type type{};
std::vector<patch_allowed_value> allowed_values;
bool operator==(const patch_config_value& other) const
{
return value == other.value && min == other.min && max == other.max && type == other.type && allowed_values == other.allowed_values;
}
void set_and_check_value(f64 new_value, const std::string& name);
};
struct patch_config_values
{
bool enabled{};
std::map<std::string, patch_config_value> config_values;
};
using patch_app_versions = std::unordered_map<std::string /*app_version*/, patch_config_values>;
using patch_serials = std::unordered_map<std::string /*serial*/, patch_app_versions>;
using patch_titles = std::unordered_map<std::string /*serial*/, patch_serials>;
@@ -78,10 +134,12 @@ public:
std::string author{};
std::string notes{};
std::string source_path{};
std::map<std::string, patch_config_value> default_config_values;
// Redundant information for accessibility (see patch_container)
std::string hash{};
std::string version{};
std::map<std::string, patch_config_value> actual_config_values;
};
struct patch_container
+7 -5
View File
@@ -42,6 +42,8 @@ public:
// Underlying type
using under = std::underlying_type_t<T>;
ENABLE_BITWISE_SERIALIZATION;
private:
// Underlying value
under m_data;
@@ -49,7 +51,7 @@ private:
friend class atomic_bs_t<T>;
// Value constructor
constexpr explicit bs_t(int, under data)
constexpr explicit bs_t(int, under data) noexcept
: m_data(data)
{
}
@@ -71,19 +73,19 @@ public:
bs_t() = default;
// Construct from a single bit
constexpr bs_t(T bit)
constexpr bs_t(T bit) noexcept
: m_data(shift(bit))
{
}
// Test for empty bitset
constexpr explicit operator bool() const
constexpr explicit operator bool() const noexcept
{
return m_data != 0;
}
// Extract underlying data
constexpr explicit operator under() const
constexpr explicit operator under() const noexcept
{
return m_data;
}
@@ -138,7 +140,7 @@ public:
return bs_t(0, lhs.m_data ^ rhs.m_data);
}
constexpr bool operator ==(bs_t rhs) const
constexpr bool operator ==(bs_t rhs) const noexcept
{
return m_data == rhs.m_data;
}
+3 -3
View File
@@ -777,9 +777,9 @@ struct color4_base
};
constexpr color4_base()
: x{}
, y{}
, z{}
: x{ T{0} }
, y{ T{0} }
, z{ T{0} }
, w{ T(1) }
{
}
+8
View File
@@ -359,6 +359,14 @@ public:
return result;
}
// Withdraw the list in reverse order (LIFO/FILO)
lf_queue_slice<T> pop_all_reversed()
{
lf_queue_slice<T> result;
result.m_head = m_head.exchange(nullptr);
return result;
}
// Apply func(data) to each element, return the total length
template <typename F>
usz apply(F func)
+63 -26
View File
@@ -5,54 +5,81 @@ rXmlNode::rXmlNode()
{
}
rXmlNode::rXmlNode(const pugi::xml_node &node)
rXmlNode::rXmlNode(const pugi::xml_node& node)
{
handle = node;
}
std::shared_ptr<rXmlNode> rXmlNode::GetChildren()
{
// it.begin() returns node_iterator*, *it.begin() return node*.
pugi::xml_object_range<pugi::xml_node_iterator> it = handle.children();
pugi::xml_node begin = *it.begin();
if (handle)
{
if (const pugi::xml_node child = handle.first_child())
{
return std::make_shared<rXmlNode>(child);
}
}
if (begin)
{
return std::make_shared<rXmlNode>(begin);
}
else
{
return nullptr;
}
return nullptr;
}
std::shared_ptr<rXmlNode> rXmlNode::GetNext()
{
pugi::xml_node result = handle.next_sibling();
if (result)
if (handle)
{
return std::make_shared<rXmlNode>(result);
}
else
{
return nullptr;
if (const pugi::xml_node result = handle.next_sibling())
{
return std::make_shared<rXmlNode>(result);
}
}
return nullptr;
}
std::string rXmlNode::GetName()
{
return handle.name();
if (handle)
{
if (const pugi::char_t* name = handle.name())
{
return name;
}
}
return {};
}
std::string rXmlNode::GetAttribute(const std::string &name)
std::string rXmlNode::GetAttribute(const std::string& name)
{
auto pred = [&name](pugi::xml_attribute attr) { return (name == attr.name()); };
return handle.find_attribute(pred).value();
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::char_t* value = attr.value())
{
return value;
}
}
}
return {};
}
std::string rXmlNode::GetNodeContent()
{
return handle.text().get();
if (handle)
{
if (const pugi::xml_text text = handle.text())
{
if (const pugi::char_t* value = text.get())
{
return value;
}
}
}
return {};
}
rXmlDocument::rXmlDocument()
@@ -61,10 +88,20 @@ rXmlDocument::rXmlDocument()
pugi::xml_parse_result rXmlDocument::Read(const std::string& data)
{
return handle.load_buffer(data.data(), data.size());
if (handle)
{
return handle.load_buffer(data.data(), data.size());
}
return {};
}
std::shared_ptr<rXmlNode> rXmlDocument::GetRoot()
{
return std::make_shared<rXmlNode>(handle.root());
if (const pugi::xml_node root = handle.root())
{
return std::make_shared<rXmlNode>(root);
}
return nullptr;
}
+2 -2
View File
@@ -19,11 +19,11 @@
struct rXmlNode
{
rXmlNode();
rXmlNode(const pugi::xml_node &);
rXmlNode(const pugi::xml_node& node);
std::shared_ptr<rXmlNode> GetChildren();
std::shared_ptr<rXmlNode> GetNext();
std::string GetName();
std::string GetAttribute(const std::string &name);
std::string GetAttribute(const std::string& name);
std::string GetNodeContent();
pugi::xml_node handle{};
+30 -14
View File
@@ -43,20 +43,6 @@ QLabel#gamelist_icon_background_color {
color: rgba(209,209,209,255);
}
/* game grid stylesheet */
QTableWidget#game_grid {
font-weight:600;
font-size:8pt;
font-family:Lucida Grande;
color: rgba(51,51,51,255);
}
QTableWidget#game_grid::item:selected:active {
selection-background-color: #0078D7;
}
QTableWidget#game_grid::item:selected:!active {
selection-background-color: #008cff;
}
/* log stylesheet */
QTextEdit#tty_frame {
background-color:#ffffff;
@@ -131,3 +117,33 @@ QLabel#rsx_debugger_display_buffer {
QLabel#l_controller {
color:#434343;
}
/* Game Grid */
#game_list_grid_item[selected="true"] {
background: #0078D7;
}
#game_list_grid_item:hover {
background: #008cff;
}
#game_list_grid_item:focus {
background: #0078D7;
}
/* Game Grid Font */
#game_list_grid_item #game_list_grid_item_title_label {
font-weight: 600;
font-size: 8pt;
font-family: Lucida Grande;
color: rgba(51,51,51,255);
}
/* Game Grid hover and focus: we need to handle properties differently when using descendants */
#game_list_grid_item[selected="true"] #game_list_grid_item_title_label {
color: #fff;
}
#game_list_grid_item[hover="true"] #game_list_grid_item_title_label {
color: #fff;
}
#game_list_grid_item[focus="true"] #game_list_grid_item_title_label {
color: #fff;
}
+46 -27
View File
@@ -1,5 +1,5 @@
/*
TheMitoSan Dark-Theme for RPCS3
/*
TheMitoSan Dark-Theme for RPCS3
Based on Kuroi (Dark) by Ani
by themitosan @ twitter.com/themitosan
Ani @ https://github.com/AniLeo
@@ -135,7 +135,7 @@ QPushButton::disabled {
}
QPushButton::pressed {
background-color: #333;
background-color: #333;
}
/* Log and Debugger borders */
@@ -193,21 +193,10 @@ QListWidget::item:hover {
}
/* Pad Settings: Controller Image */
QLabel#l_controller {
QLabel#l_controller {
color: #FFF;
}
/* Game Grid Font */
QTableWidget#game_grid {
font-weight: 600;
font-size: 8pt;
font-family: Lucida Grande;
color: #FFF;
}
QTableWidget#game_grid::item:selected:!active {
selection-background-color: #313f4e;
}
/* Slider on toolbar */
QWidget#sizeSliderContainer {
background: transparent;
@@ -230,8 +219,8 @@ QLabel#color_button {
}
/* Search bar on main toolbar */
QLineEdit#mw_searchbar {
margin-left: 0.7em;
QLineEdit#mw_searchbar {
margin-left: 0.7em;
color: #ecf0f1;
}
@@ -344,24 +333,54 @@ QLabel#debugger_frame_pc {
/* Tree view changes*/
QTreeView::branch:has-children:!has-siblings:closed,
QTreeView::branch:closed:has-children:has-siblings {
border-image: none;
image: url("GuiConfigs/list_arrow_white.png");
border-image: none;
image: url("GuiConfigs/list_arrow_white.png");
}
QTreeView::branch:open:has-children:!has-siblings,
QTreeView::branch:open:has-children:has-siblings {
border-image: none;
image: url("GuiConfigs/list_arrow_down_white.png");
QTreeView::branch:open:has-children:has-siblings {
border-image: none;
image: url("GuiConfigs/list_arrow_down_white.png");
}
QTreeView::branch:has-children:!has-siblings:closed:hover,
QTreeView::branch:closed:has-children:has-siblings:hover {
border-image: none;
image: url("GuiConfigs/list_arrow_blue.png");
border-image: none;
image: url("GuiConfigs/list_arrow_blue.png");
}
QTreeView::branch:open:has-children:!has-siblings:hover,
QTreeView::branch:open:has-children:has-siblings:hover {
border-image: none;
image: url("GuiConfigs/list_arrow_down_blue.png");
QTreeView::branch:open:has-children:has-siblings:hover {
border-image: none;
image: url("GuiConfigs/list_arrow_down_blue.png");
}
/* Game Grid */
#game_list_grid_item[selected="true"] {
background: #313f4e;
}
#game_list_grid_item:hover {
background: #313f4e;
}
#game_list_grid_item:focus {
background: #0078D7;
}
/* Game Grid Font */
#game_list_grid_item #game_list_grid_item_title_label {
font-weight: 600;
font-size: 8pt;
font-family: Lucida Grande;
color: #FFF;
}
/* Game Grid hover and focus: we need to handle properties differently when using descendants */
#game_list_grid_item[selected="true"] #game_list_grid_item_title_label {
background-color: #313f4e;
}
#game_list_grid_item[hover="true"] #game_list_grid_item_title_label {
background-color: #313f4e;
}
#game_list_grid_item[focus="true"] #game_list_grid_item_title_label {
background-color: #0078D7;
}
+40 -22
View File
@@ -1,4 +1,4 @@
/*
/*
Envy theme for RPCS3 by drysalter (https://github.com/drysalter)
03/04/2019
*/
@@ -19,7 +19,7 @@ Candy Red: #ff007a
Yellow: #f2d571
Fuchsia: #ff00ff
Orange: #ff6000
Cyan: #3498d8
Cyan: #3498d8
*/
@@ -209,7 +209,7 @@ QRadioButton::indicator:unchecked {
}
QRadioButton::indicator:disabled {
background-color: #4d5058;
background-color: #4d5058;
}
/* Combo Boxes */
@@ -272,7 +272,7 @@ QSlider::handle:horizontal {
border: 1px solid #5c5c5c;
border-radius: 0.1em;
width: 18px;
margin: -2px 2;
margin: -2px 2;
}
QSlider::handle:horizontal:hover {
@@ -335,7 +335,7 @@ QPushButton:disabled {
}
QPushButton::pressed {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #2d3038, stop: 1 #2d3038);
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #2d3038, stop: 1 #2d3038);
}
/* Spinboxes */
@@ -454,7 +454,7 @@ QListWidget::item:selected {
}
QListWidget::item:hover {
background-color: #30333a;
background-color: #30333a;
color: #8cf944;
border-radius: 0.25em;
}
@@ -479,7 +479,7 @@ QListWidget::indicator:disabled {
}
/* Pad Settings: Controller Image */
QLabel#l_controller {
QLabel#l_controller {
color: #8cf944;
}
@@ -505,7 +505,7 @@ QLabel#color_button {
}
/* Search bar on main toolbar */
QLineEdit#mw_searchbar {
QLineEdit#mw_searchbar {
color: #ecf0f1;
background-color: #2d3038;
border: 1px solid #f8f8f8;
@@ -513,14 +513,14 @@ QLineEdit#mw_searchbar {
padding-left: 5px;
}
QLineEdit#mw_searchbar:hover {
QLineEdit#mw_searchbar:hover {
color: #ecf0f1;
background-color: #2d3038;
border: 1px solid #8cf944;
margin: 15px;
}
QLineEdit#mw_searchbar:focus {
QLineEdit#mw_searchbar:focus {
border: 1px solid #8cf944;
}
@@ -565,8 +565,8 @@ QTableView {
}
QTableView::item:hover {
color: #8cf944;
}
color: #8cf944;
}
/* Game Icon Background */
QLabel#gamelist_icon_background_color {
@@ -641,24 +641,42 @@ QLabel#debugger_frame_pc {
/* Tree view changes*/
QTreeView::branch:has-children:!has-siblings:closed,
QTreeView::branch:closed:has-children:has-siblings {
border-image: none;
image: url("GuiConfigs/list_arrow_white.png");
border-image: none;
image: url("GuiConfigs/list_arrow_white.png");
}
QTreeView::branch:open:has-children:!has-siblings,
QTreeView::branch:open:has-children:has-siblings {
border-image: none;
image: url("GuiConfigs/list_arrow_down_white.png");
QTreeView::branch:open:has-children:has-siblings {
border-image: none;
image: url("GuiConfigs/list_arrow_down_white.png");
}
QTreeView::branch:has-children:!has-siblings:closed:hover,
QTreeView::branch:closed:has-children:has-siblings:hover {
border-image: none;
image: url("GuiConfigs/list_arrow_green.png");
border-image: none;
image: url("GuiConfigs/list_arrow_green.png");
}
QTreeView::branch:open:has-children:!has-siblings:hover,
QTreeView::branch:open:has-children:has-siblings:hover {
border-image: none;
image: url("GuiConfigs/list_arrow_down_green.png");
QTreeView::branch:open:has-children:has-siblings:hover {
border-image: none;
image: url("GuiConfigs/list_arrow_down_green.png");
}
/* Game Grid */
#game_list_grid_item[selected="true"] {
background: #2d3038;
}
#game_list_grid_item:focus {
background: #2d3038;
}
/* Game Grid hover and focus: we need to handle properties differently when using descendants */
#game_list_grid_item[selected="true"] #game_list_grid_item_title_label {
background-color: #2d3038;
color: #8cf944;
}
#game_list_grid_item[focus="true"] #game_list_grid_item_title_label {
background-color: #2d3038;
color: #8cf944;
}
+40 -24
View File
@@ -249,20 +249,6 @@ QWidget#trophy_notification_frame {
color: #e6e6e6;
}
/* Game Grid Font */
QTableWidget#game_grid {
font-weight: 600;
font-size: 8pt;
font-family: Lucida Grande;
selection-color: #e6e6e6;
}
QTableWidget#game_grid::item:selected:active {
selection-background-color: #4c4b4b;
}
QTableWidget#game_grid::item:selected:!active {
selection-background-color: #3d3d3d;
}
/* Set Toolbar Slider Size */
QSlider#sizeSlider::groove:horizontal {
border: 0em solid transparent;
@@ -347,24 +333,54 @@ QLabel#tty_text {
/* Tree view changes*/
QTreeView::branch:has-children:!has-siblings:closed,
QTreeView::branch:closed:has-children:has-siblings {
border-image: none;
image: url("GuiConfigs/list_arrow_white.png");
border-image: none;
image: url("GuiConfigs/list_arrow_white.png");
}
QTreeView::branch:open:has-children:!has-siblings,
QTreeView::branch:open:has-children:has-siblings {
border-image: none;
image: url("GuiConfigs/list_arrow_down_white.png");
QTreeView::branch:open:has-children:has-siblings {
border-image: none;
image: url("GuiConfigs/list_arrow_down_white.png");
}
QTreeView::branch:has-children:!has-siblings:closed:hover,
QTreeView::branch:closed:has-children:has-siblings:hover {
border-image: none;
image: url("GuiConfigs/list_arrow_blue.png");
border-image: none;
image: url("GuiConfigs/list_arrow_blue.png");
}
QTreeView::branch:open:has-children:!has-siblings:hover,
QTreeView::branch:open:has-children:has-siblings:hover {
border-image: none;
image: url("GuiConfigs/list_arrow_down_blue.png");
QTreeView::branch:open:has-children:has-siblings:hover {
border-image: none;
image: url("GuiConfigs/list_arrow_down_blue.png");
}
/* Game Grid */
#game_list_grid_item[selected="true"] {
background: #3d3d3d;
}
#game_list_grid_item:hover {
background: #3d3d3d;
}
#game_list_grid_item:focus {
background: #4c4b4b;
}
/* Game Grid Font */
#game_list_grid_item #game_list_grid_item_title_label {
font-weight: 600;
font-size: 8pt;
font-family: Lucida Grande;
}
/* Game Grid hover and focus: we need to handle properties differently when using descendants */
#game_list_grid_item[selected="true"] #game_list_grid_item_title_label {
background-color: #3d3d3d;
}
#game_list_grid_item[hover="true"] #game_list_grid_item_title_label {
background-color: #3d3d3d;
}
#game_list_grid_item[focus="true"] #game_list_grid_item_title_label {
color: #e6e6e6;
background-color: #4c4b4b;
}
@@ -1,5 +1,5 @@
/*
ModernBlue Theme for RPCS3
/*
ModernBlue Theme for RPCS3
by themitosan @ twitter.com/themitosan
(2017.12.12)
*/
@@ -124,7 +124,7 @@ QGroupBox::title {
/* Buttons */
QPushButton {
background-color: #46598b;
color: #fff;
color: #fff;
}
QPushButton::disabled {
@@ -133,7 +133,7 @@ QPushButton::disabled {
}
QPushButton::pressed {
background-color: #172038;
background-color: #172038;
}
/* Log and Debugger borders */
@@ -190,21 +190,10 @@ QListWidget::item:hover {
}
/* Pad Settings: Controller Image */
QLabel#l_controller {
QLabel#l_controller {
color: #fff;
}
/* Game Grid Font */
QTableWidget#game_grid {
font-weight: 600;
font-size: 8pt;
font-family: Lucida Grande;
color: #fff;
}
QTableWidget#game_grid::item:selected:!active {
selection-background-color: #354454;
}
/* Slider on toolbar */
QWidget#sizeSliderContainer {
background: transparent;
@@ -227,8 +216,8 @@ QLabel#color_button {
}
/* Search bar on main toolbar */
QLineEdit#mw_searchbar {
margin-left: 0.7em;
QLineEdit#mw_searchbar {
margin-left: 0.7em;
color: #ecf0f1;
}
@@ -341,24 +330,54 @@ QLabel#debugger_frame_pc {
/* Tree view changes*/
QTreeView::branch:has-children:!has-siblings:closed,
QTreeView::branch:closed:has-children:has-siblings {
border-image: none;
image: url("GuiConfigs/list_arrow_white.png");
border-image: none;
image: url("GuiConfigs/list_arrow_white.png");
}
QTreeView::branch:open:has-children:!has-siblings,
QTreeView::branch:open:has-children:has-siblings {
border-image: none;
image: url("GuiConfigs/list_arrow_down_white.png");
QTreeView::branch:open:has-children:has-siblings {
border-image: none;
image: url("GuiConfigs/list_arrow_down_white.png");
}
QTreeView::branch:has-children:!has-siblings:closed:hover,
QTreeView::branch:closed:has-children:has-siblings:hover {
border-image: none;
image: url("GuiConfigs/list_arrow_blue.png");
border-image: none;
image: url("GuiConfigs/list_arrow_blue.png");
}
QTreeView::branch:open:has-children:!has-siblings:hover,
QTreeView::branch:open:has-children:has-siblings:hover {
border-image: none;
image: url("GuiConfigs/list_arrow_down_blue.png");
QTreeView::branch:open:has-children:has-siblings:hover {
border-image: none;
image: url("GuiConfigs/list_arrow_down_blue.png");
}
/* Game Grid */
#game_list_grid_item[selected="true"] {
background: #354454;
}
#game_list_grid_item:hover {
background: #354454;
}
#game_list_grid_item:focus {
background: #0078D7;
}
/* Game Grid Font */
#game_list_grid_item #game_list_grid_item_title_label {
font-weight: 600;
font-size: 8pt;
font-family: Lucida Grande;
color: #FFF;
}
/* Game Grid hover and focus: we need to handle properties differently when using descendants */
#game_list_grid_item[selected="true"] #game_list_grid_item_title_label {
background-color: #354454;
}
#game_list_grid_item[hover="true"] #game_list_grid_item_title_label {
background-color: #354454;
}
#game_list_grid_item[focus="true"] #game_list_grid_item_title_label {
background-color: #0078D7;
}
+30 -15
View File
@@ -367,21 +367,6 @@ QLabel#l_controller {
}
/* Game Grid Font */
QTableWidget#game_grid {
font-weight: 600;
color: #ffd785;
text-transform: uppercase;
selection-color: #ffd785;
}
QTableWidget#game_grid::item:selected:active {
selection-background-color: #4d4940;
}
QTableWidget#game_grid::item:selected:!active {
selection-background-color: #615c51;
}
/* Debug UI Settings buttons */
QLabel#color_button {
background: transparent;
@@ -489,3 +474,33 @@ QWidget#trophy_notification_frame {
background-color: #b3ac98;
color: #4d4940;
}
/* Game Grid */
#game_list_grid_item[selected="true"] {
background: #615c51;
}
#game_list_grid_item:hover {
background: #615c51;
}
#game_list_grid_item:focus {
background: #4d4940;
}
/* Game Grid Font */
#game_list_grid_item #game_list_grid_item_title_label {
font-weight: 600;
text-transform: uppercase;
color: #ffd785;
}
/* Game Grid hover and focus: we need to handle properties differently when using descendants */
#game_list_grid_item[selected="true"] #game_list_grid_item_title_label {
background-color: #615c51;
}
#game_list_grid_item[hover="true"] #game_list_grid_item_title_label {
background-color: #615c51;
}
#game_list_grid_item[focus="true"] #game_list_grid_item_title_label {
background-color: #4d4940;
color: #ffd785;
}
+54 -18
View File
@@ -105,7 +105,7 @@ QToolButton:hover {
}
/* Search bar in Main Toolbar */
QLineEdit#mw_searchbar {
QLineEdit#mw_searchbar {
color: #455971;
background-color: #FFFFFF;
border: 1px solid #999999;
@@ -113,15 +113,15 @@ QLineEdit#mw_searchbar {
padding-left: 5px;
}
QLineEdit#mw_searchbar:hover {
margin-left: 0.7em;
QLineEdit#mw_searchbar:hover {
margin-left: 0.7em;
color: #0074e7;
background-color: #FFFFFF;
border: 1px solid #0071ec;
margin: 15px;
}
QLineEdit#mw_searchbar:focus {
QLineEdit#mw_searchbar:focus {
border: 1px solid #0074e7;
}
@@ -148,7 +148,7 @@ QSlider::handle:horizontal {
border: 1px solid #5c5c5c;
border-radius: 0.1em;
width: 18px;
margin: -2px 2;
margin: -2px 2;
}
QSlider::handle:horizontal:hover {
@@ -220,6 +220,17 @@ QScrollBar::up-arrow, QScrollBar::down-arrow, QScrollBar::up-button:vertical, QS
border: none;
}
#game_list_grid QScrollBar {
width: 10px;
height: 3px;
}
#game_list_grid QScrollBar::handle {
background: #1c273d;
}
#game_list_grid QScrollBar::handle:hover, QScrollBar::handle:pressed {
background: #0074e7;
}
/* Radio Buttons */
QRadioButton::indicator {
border: 0.0625em solid #455971;
@@ -242,7 +253,7 @@ QRadioButton::indicator:unchecked {
}
QRadioButton::indicator:disabled {
background-color: #455971;
background-color: #455971;
}
/* Checkboxes */
@@ -533,7 +544,7 @@ QProgressBar::chunk {
}
/* Pad Settings: Controller Image */
QLabel#l_controller {
QLabel#l_controller {
color: #0074e7;
}
@@ -554,7 +565,7 @@ QHeaderView::section {
background-color: #111525;
color: #FFFFFF;
padding-top: 3px;
padding-left: 3px;
padding-left: 3px;
height: 20px;
border: none;
}
@@ -663,24 +674,49 @@ QLabel#debugger_frame_pc {
/* Tree view changes*/
QTreeView::branch:has-children:!has-siblings:closed,
QTreeView::branch:closed:has-children:has-siblings {
border-image: none;
image: url("GuiConfigs/list_arrow_white.png");
border-image: none;
image: url("GuiConfigs/list_arrow_white.png");
}
QTreeView::branch:open:has-children:!has-siblings,
QTreeView::branch:open:has-children:has-siblings {
border-image: none;
image: url("GuiConfigs/list_arrow_down_white.png");
QTreeView::branch:open:has-children:has-siblings {
border-image: none;
image: url("GuiConfigs/list_arrow_down_white.png");
}
QTreeView::branch:has-children:!has-siblings:closed:hover,
QTreeView::branch:closed:has-children:has-siblings:hover {
border-image: none;
image: url("GuiConfigs/list_arrow_blue.png");
border-image: none;
image: url("GuiConfigs/list_arrow_blue.png");
}
QTreeView::branch:open:has-children:!has-siblings:hover,
QTreeView::branch:open:has-children:has-siblings:hover {
border-image: none;
image: url("GuiConfigs/list_arrow_down_blue.png");
QTreeView::branch:open:has-children:has-siblings:hover {
border-image: none;
image: url("GuiConfigs/list_arrow_down_blue.png");
}
/* Game Grid */
#game_list_grid_item[selected="true"] {
background: #0f1d36;
}
#game_list_grid_item:focus {
background: #0f1d36;
}
#game_list_grid_item #game_list_grid_item_title_label {
color: #FFFFFF;
}
/* Game Grid hover and focus: we need to handle properties differently when using descendants */
#game_list_grid_item[selected="true"] #game_list_grid_item_title_label {
background-color: #0f1d36;
color: #2397ff;
}
#game_list_grid_item[hover="true"] #game_list_grid_item_title_label {
color: #2397ff;
}
#game_list_grid_item[focus="true"] #game_list_grid_item_title_label {
background-color: #0f1d36;
color: #2397ff;
}
+29 -8
View File
@@ -105,7 +105,7 @@ QToolButton:hover {
}
/* Search bar in Main Toolbar */
QLineEdit#mw_searchbar {
QLineEdit#mw_searchbar {
color: #455971;
background-color: #FFFFFF;
border: 1px solid #999999;
@@ -113,15 +113,15 @@ QLineEdit#mw_searchbar {
padding-left: 5px;
}
QLineEdit#mw_searchbar:hover {
margin-left: 0.7em;
QLineEdit#mw_searchbar:hover {
margin-left: 0.7em;
color: #455971;
background-color: #FFFFFF;
border: 1px solid #0071ec;
margin: 15px;
}
QLineEdit#mw_searchbar:focus {
QLineEdit#mw_searchbar:focus {
border: 1px solid #0071ec;
}
@@ -148,7 +148,7 @@ QSlider::handle:horizontal {
border: 1px solid #5c5c5c;
border-radius: 0.1em;
width: 18px;
margin: -2px 2;
margin: -2px 2;
}
QSlider::handle:horizontal:disabled {
@@ -254,7 +254,7 @@ QRadioButton::indicator:unchecked {
}
QRadioButton::indicator:disabled {
background-color: #455971;
background-color: #455971;
}
/* Checkboxes */
@@ -552,7 +552,7 @@ QProgressBar::chunk {
}
/* Pad Settings: Controller Image */
QLabel#l_controller {
QLabel#l_controller {
color: #4343c1;
}
@@ -573,7 +573,7 @@ QHeaderView::section {
background-color: #FFFFFF;
color: #455971;
padding-top: 3px;
padding-left: 3px;
padding-left: 3px;
height: 20px;
border: none;
}
@@ -678,3 +678,24 @@ QLabel#debugger_frame_pc {
color: #000; /* Font Color: Black */
background-color: #00ff00; /* Green */
}
/* Game Grid */
#game_list_grid_item[selected="true"] {
background: #4343c1;
}
#game_list_grid_item:focus {
background: #4343c1;
}
/* Game Grid hover and focus: we need to handle properties differently when using descendants */
#game_list_grid_item[selected="true"] #game_list_grid_item_title_label {
background-color: #4343c1;
color: #FFF;
}
#game_list_grid_item[hover="true"] #game_list_grid_item_title_label {
color: #4343c1;
}
#game_list_grid_item[focus="true"] #game_list_grid_item_title_label {
background-color: #4343c1;
color: #FFF;
}
+25 -10
View File
@@ -358,14 +358,6 @@ QLabel#l_controller {
color: #4d4940;
}
/* Game Grid Font */
QTableWidget#game_grid {
font-weight: 600;
color: #4d4940;
text-transform: uppercase;
selection-color: #aea993;
}
/* Debug UI Settings buttons */
QLabel#color_button {
background: transparent;
@@ -456,10 +448,33 @@ QSlider#sizeSlider::groove:horizontal {
height: 1.5em;
}
/*
/*
On Patch Creator, it's the patch validation label
since we can't avoid repainting color, let's bold it instead
*/
QLabel#validLabel {
font-weight: 600;
}
}
/* Game Grid */
#game_list_grid_item[selected="true"] {
background: #4d4940;
}
#game_list_grid_item:focus {
background: #4d4940;
}
/* Game Grid Font */
#game_list_grid_item #game_list_grid_item_title_label {
font-weight: 600;
color: #4d4940;
text-transform: uppercase;
}
/* Game Grid hover and focus: we need to handle properties differently when using descendants */
#game_list_grid_item[selected="true"] #game_list_grid_item_title_label {
color: #aea993;
}
#game_list_grid_item[focus="true"] #game_list_grid_item_title_label {
color: #aea993;
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

+2 -2
View File
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Common default props for defining properties with macros. Import right after Microsoft.Cpp.Default.props -->
<ImportGroup Label="PropertySheets" />
@@ -8,4 +8,4 @@
</PropertyGroup>
<ItemDefinitionGroup />
<ItemGroup />
</Project>
</Project>
+91 -48
View File
@@ -14,56 +14,99 @@
<PreprocessorDefinitions>LLVM_AVAILABLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<AdditionalLibraryDirectories Condition="'$(Configuration)'=='Debug'">%(AdditionalLibraryDirectories);..\llvm_build\Debug\lib</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories Condition="'$(Configuration)'=='Debug'">%(AdditionalLibraryDirectories);..\3rdparty\llvm\llvm_build\Debug\lib</AdditionalLibraryDirectories>
<AdditionalDependencies>%(AdditionalDependencies);
LLVMProfileData.lib;
LLVMDebugInfoCodeView.lib;
LLVMDebugInfoMSF.lib;
LLVMInstrumentation.lib;
LLVMMCJIT.lib;
LLVMRuntimeDyld.lib;
LLVMVectorize.lib;
LLVMX86CodeGen.lib;
LLVMGlobalISel.lib;
LLVMX86Disassembler.lib;
LLVMExecutionEngine.lib;
LLVMAsmPrinter.lib;
LLVMSelectionDAG.lib;
LLVMCodeGen.lib;
LLVMScalarOpts.lib;
LLVMInstCombine.lib;
LLVMTransformUtils.lib;
LLVMAnalysis.lib;
LLVMTarget.lib;
LLVMX86Desc.lib;
LLVMObject.lib;
LLVMMCParser.lib;
LLVMBitReader.lib;
LLVMCore.lib;
LLVMMC.lib;
LLVMX86Info.lib;
LLVMSupport.lib;
LLVMMCDisassembler.lib;
LLVMipo.lib;
LLVMBinaryFormat.lib;
LLVMPasses.lib;
LLVMIRReader.lib;
LLVMLinker.lib;
LLVMAsmParser.lib;
LLVMX86AsmParser.lib;
LLVMDemangle.lib;
LLVMDebugInfoDWARF.lib;
LLVMRemarks.lib;
LLVMBitstreamReader.lib;
LLVMTextAPI.lib;
LLVMCFGuard.lib;
LLVMAggressiveInstCombine.lib;
LLVMBitWriter.lib;
LLVMCoroutines.lib;
LLVMObjCARCOpts.lib;
LLVMIntelJITEvents.lib;
LLVMAggressiveInstCombine.lib;
LLVMAnalysis.lib;
LLVMAsmParser.lib;
LLVMAsmPrinter.lib;
LLVMBinaryFormat.lib;
LLVMBitReader.lib;
LLVMBitstreamReader.lib;
LLVMBitWriter.lib;
LLVMCFGuard.lib;
LLVMCFIVerify.lib;
LLVMCodeGen.lib;
LLVMCore.lib;
LLVMCoroutines.lib;
LLVMCoverage.lib;
LLVMDebugInfoCodeView.lib;
LLVMDebuginfod.lib;
LLVMDebugInfoDWARF.lib;
LLVMDebugInfoGSYM.lib;
LLVMDebugInfoLogicalView.lib;
LLVMDebugInfoMSF.lib;
LLVMDebugInfoPDB.lib;
LLVMDemangle.lib;
LLVMDiff.lib;
LLVMDlltoolDriver.lib;
LLVMDWARFLinker.lib;
LLVMDWARFLinkerParallel.lib;
LLVMDWP.lib;
LLVMExecutionEngine.lib;
LLVMExegesis.lib;
LLVMExegesisX86.lib;
LLVMExtensions.lib;
LLVMFileCheck.lib;
LLVMFrontendHLSL.lib;
LLVMFrontendOpenACC.lib;
LLVMFrontendOpenMP.lib;
LLVMFuzzerCLI.lib;
LLVMFuzzMutate.lib;
LLVMGlobalISel.lib;
LLVMInstCombine.lib;
LLVMInstrumentation.lib;
LLVMIntelJITEvents.lib;
LLVMInterfaceStub.lib;
LLVMInterpreter.lib;
LLVMipo.lib;
LLVMIRPrinter.lib;
LLVMIRReader.lib;
LLVMJITLink.lib;
LLVMLibDriver.lib;
LLVMLineEditor.lib;
LLVMLinker.lib;
LLVMLTO.lib;
LLVMMCA.lib;
LLVMMCDisassembler.lib;
LLVMMCJIT.lib;
LLVMMC.lib;
LLVMMCParser.lib;
LLVMMIRParser.lib;
LLVMObjCARCOpts.lib;
LLVMObjCopy.lib;
LLVMObject.lib;
LLVMObjectYAML.lib;
LLVMOption.lib;
LLVMOrcJIT.lib;
LLVMOrcShared.lib;
LLVMOrcTargetProcess.lib;
LLVMPasses.lib;
LLVMProfileData.lib;
LLVMRemarks.lib;
LLVMRuntimeDyld.lib;
LLVMScalarOpts.lib;
LLVMSelectionDAG.lib;
LLVMSupport.lib;
LLVMSymbolize.lib;
LLVMTableGenGlobalISel.lib;
LLVMTableGen.lib;
LLVMTarget.lib;
LLVMTargetParser.lib;
LLVMTextAPI.lib;
LLVMTransformUtils.lib;
LLVMVectorize.lib;
LLVMWindowsDriver.lib;
LLVMWindowsManifest.lib;
LLVMX86AsmParser.lib;
LLVMX86CodeGen.lib;
LLVMX86Desc.lib;
LLVMX86Disassembler.lib;
LLVMX86Info.lib;
LLVMX86TargetMCA.lib;
LLVMXRay.lib;
</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup />
</Project>
</Project>
+91 -48
View File
@@ -15,56 +15,99 @@
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories Condition="'$(Configuration)'=='Release'">%(AdditionalLibraryDirectories);..\llvm_build\Release\lib</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories Condition="'$(Configuration)'=='Release'">%(AdditionalLibraryDirectories);..\3rdparty\llvm\llvm_build\Release\lib</AdditionalLibraryDirectories>
<AdditionalDependencies>%(AdditionalDependencies);
LLVMProfileData.lib;
LLVMDebugInfoCodeView.lib;
LLVMDebugInfoMSF.lib;
LLVMInstrumentation.lib;
LLVMMCJIT.lib;
LLVMRuntimeDyld.lib;
LLVMVectorize.lib;
LLVMX86CodeGen.lib;
LLVMGlobalISel.lib;
LLVMX86Disassembler.lib;
LLVMExecutionEngine.lib;
LLVMAsmPrinter.lib;
LLVMSelectionDAG.lib;
LLVMCodeGen.lib;
LLVMScalarOpts.lib;
LLVMInstCombine.lib;
LLVMTransformUtils.lib;
LLVMAnalysis.lib;
LLVMTarget.lib;
LLVMX86Desc.lib;
LLVMObject.lib;
LLVMMCParser.lib;
LLVMBitReader.lib;
LLVMCore.lib;
LLVMMC.lib;
LLVMX86Info.lib;
LLVMSupport.lib;
LLVMMCDisassembler.lib;
LLVMipo.lib;
LLVMBinaryFormat.lib;
LLVMPasses.lib;
LLVMIRReader.lib;
LLVMLinker.lib;
LLVMAsmParser.lib;
LLVMX86AsmParser.lib;
LLVMDemangle.lib;
LLVMDebugInfoDWARF.lib;
LLVMRemarks.lib;
LLVMBitstreamReader.lib;
LLVMTextAPI.lib;
LLVMCFGuard.lib;
LLVMAggressiveInstCombine.lib;
LLVMBitWriter.lib;
LLVMCoroutines.lib;
LLVMObjCARCOpts.lib;
LLVMIntelJITEvents.lib;
LLVMAggressiveInstCombine.lib;
LLVMAnalysis.lib;
LLVMAsmParser.lib;
LLVMAsmPrinter.lib;
LLVMBinaryFormat.lib;
LLVMBitReader.lib;
LLVMBitstreamReader.lib;
LLVMBitWriter.lib;
LLVMCFGuard.lib;
LLVMCFIVerify.lib;
LLVMCodeGen.lib;
LLVMCore.lib;
LLVMCoroutines.lib;
LLVMCoverage.lib;
LLVMDebugInfoCodeView.lib;
LLVMDebuginfod.lib;
LLVMDebugInfoDWARF.lib;
LLVMDebugInfoGSYM.lib;
LLVMDebugInfoLogicalView.lib;
LLVMDebugInfoMSF.lib;
LLVMDebugInfoPDB.lib;
LLVMDemangle.lib;
LLVMDiff.lib;
LLVMDlltoolDriver.lib;
LLVMDWARFLinker.lib;
LLVMDWARFLinkerParallel.lib;
LLVMDWP.lib;
LLVMExecutionEngine.lib;
LLVMExegesis.lib;
LLVMExegesisX86.lib;
LLVMExtensions.lib;
LLVMFileCheck.lib;
LLVMFrontendHLSL.lib;
LLVMFrontendOpenACC.lib;
LLVMFrontendOpenMP.lib;
LLVMFuzzerCLI.lib;
LLVMFuzzMutate.lib;
LLVMGlobalISel.lib;
LLVMInstCombine.lib;
LLVMInstrumentation.lib;
LLVMIntelJITEvents.lib;
LLVMInterfaceStub.lib;
LLVMInterpreter.lib;
LLVMipo.lib;
LLVMIRPrinter.lib;
LLVMIRReader.lib;
LLVMJITLink.lib;
LLVMLibDriver.lib;
LLVMLineEditor.lib;
LLVMLinker.lib;
LLVMLTO.lib;
LLVMMCA.lib;
LLVMMCDisassembler.lib;
LLVMMCJIT.lib;
LLVMMC.lib;
LLVMMCParser.lib;
LLVMMIRParser.lib;
LLVMObjCARCOpts.lib;
LLVMObjCopy.lib;
LLVMObject.lib;
LLVMObjectYAML.lib;
LLVMOption.lib;
LLVMOrcJIT.lib;
LLVMOrcShared.lib;
LLVMOrcTargetProcess.lib;
LLVMPasses.lib;
LLVMProfileData.lib;
LLVMRemarks.lib;
LLVMRuntimeDyld.lib;
LLVMScalarOpts.lib;
LLVMSelectionDAG.lib;
LLVMSupport.lib;
LLVMSymbolize.lib;
LLVMTableGenGlobalISel.lib;
LLVMTableGen.lib;
LLVMTarget.lib;
LLVMTargetParser.lib;
LLVMTextAPI.lib;
LLVMTransformUtils.lib;
LLVMVectorize.lib;
LLVMWindowsDriver.lib;
LLVMWindowsManifest.lib;
LLVMX86AsmParser.lib;
LLVMX86CodeGen.lib;
LLVMX86Desc.lib;
LLVMX86Disassembler.lib;
LLVMX86Info.lib;
LLVMX86TargetMCA.lib;
LLVMXRay.lib;
</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup />
</Project>
</Project>
Submodule llvm deleted from 9b52b6c39a
+20 -3
View File
@@ -6,10 +6,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asmjit", "3rdparty\asmjit\a
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}
{5228F863-E0DD-4DE7-AA7B-5C52B14CD4D0} = {5228F863-E0DD-4DE7-AA7B-5C52B14CD4D0}
{939FE206-1182-ABC3-1234-FEAB88E98404} = {939FE206-1182-ABC3-1234-FEAB88E98404}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm_build", "llvm_build\llvm_build.vcxproj", "{8BC303AB-25BE-4276-8E57-73F171B2D672}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm_build", "3rdparty\llvm\llvm_build\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
@@ -40,6 +42,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "yaml-cpp", "3rdparty\yaml-c
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rpcs3", "rpcs3\rpcs3.vcxproj", "{70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12}"
ProjectSection(ProjectDependencies) = postProject
{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}
{3EE5F075-B546-42C4-B6A8-E3CCEF38B78D} = {3EE5F075-B546-42C4-B6A8-E3CCEF38B78D}
@@ -74,11 +77,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcurl", "3rdparty\curl\li
{73973223-5EE8-41CA-8E88-1D60E89A237B} = {73973223-5EE8-41CA-8E88-1D60E89A237B}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SPIRV", "3rdparty\SPIRV\spirv.vcxproj", "{4CBD3DDD-5555-49A4-A44D-DD3D8CB516A1}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "spirv", "3rdparty\SPIRV\spirv.vcxproj", "{4CBD3DDD-5555-49A4-A44D-DD3D8CB516A1}"
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", "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\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
@@ -93,6 +96,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "pine", "pine", "{A55DA1B5-C
3rdparty\pine\pine_server.h = 3rdparty\pine\pine_server.h
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "miniupnpc_static", "3rdparty\miniupnp\miniupnpc_static.vcxproj", "{5228F863-E0DD-4DE7-AA7B-5C52B14CD4D0}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rtmidi", "3rdparty\rtmidi\rtmidi.vcxproj", "{2C902C67-985C-4BE0-94A3-E0FE2EB929A3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
@@ -187,6 +194,14 @@ Global
{8DC244EE-A0BD-4038-BAF7-CFAFA5EB2BAA}.Debug|x64.Build.0 = Debug|x64
{8DC244EE-A0BD-4038-BAF7-CFAFA5EB2BAA}.Release|x64.ActiveCfg = Release|x64
{8DC244EE-A0BD-4038-BAF7-CFAFA5EB2BAA}.Release|x64.Build.0 = Release|x64
{5228F863-E0DD-4DE7-AA7B-5C52B14CD4D0}.Debug|x64.ActiveCfg = Debug|x64
{5228F863-E0DD-4DE7-AA7B-5C52B14CD4D0}.Debug|x64.Build.0 = Debug|x64
{5228F863-E0DD-4DE7-AA7B-5C52B14CD4D0}.Release|x64.ActiveCfg = Release|x64
{5228F863-E0DD-4DE7-AA7B-5C52B14CD4D0}.Release|x64.Build.0 = Release|x64
{2C902C67-985C-4BE0-94A3-E0FE2EB929A3}.Debug|x64.ActiveCfg = Debug|x64
{2C902C67-985C-4BE0-94A3-E0FE2EB929A3}.Debug|x64.Build.0 = Debug|x64
{2C902C67-985C-4BE0-94A3-E0FE2EB929A3}.Release|x64.ActiveCfg = Release|x64
{2C902C67-985C-4BE0-94A3-E0FE2EB929A3}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -216,6 +231,8 @@ Global
{508C291A-3D18-49F5-B25D-F7C8DB92CB21} = {6C3B64A0-8F8A-4DC4-8C0B-D71EBEED7FA8}
{8DC244EE-A0BD-4038-BAF7-CFAFA5EB2BAA} = {6C3B64A0-8F8A-4DC4-8C0B-D71EBEED7FA8}
{A55DA1B5-CC17-4525-BE7F-1659CE17BB56} = {6C3B64A0-8F8A-4DC4-8C0B-D71EBEED7FA8}
{5228F863-E0DD-4DE7-AA7B-5C52B14CD4D0} = {6C3B64A0-8F8A-4DC4-8C0B-D71EBEED7FA8}
{2C902C67-985C-4BE0-94A3-E0FE2EB929A3} = {6C3B64A0-8F8A-4DC4-8C0B-D71EBEED7FA8}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {06CC7920-E085-4B81-9582-8DE8AAD42510}
+2 -2
View File
@@ -187,13 +187,13 @@ elseif(WIN32)
# If Qt5 is installed from vcpkg
list(APPEND _QT5_TOOLS_PATHS "${Qt5_DIR}/../../../tools/qt5$<$<CONFIG:Debug>:/debug>/bin/")
add_custom_command(TARGET rpcs3 POST_BUILD
COMMAND set PATH=${_QT5_TOOLS_PATHS}$<SEMICOLON>%PATH%
COMMAND "${CMAKE_COMMAND}" -E copy_directory "${CMAKE_SOURCE_DIR}/bin" "$<TARGET_FILE_DIR:rpcs3>"
# If Qt5 is installed from vcpkg, add binary path to PATH
# otherwise windeployqt tool won't be able to locate necessary dlls
COMMAND set PATH=${Qt5_DIR}/../../../$<$<CONFIG:Debug>:debug/>bin/$<SEMICOLON>%PATH%
COMMAND set PATH=${Qt5_DIR}/../../../$<$<CONFIG:Debug>:debug/>bin/$<SEMICOLON>%PATH%
COMMAND "${_WINDEPLOYQT}" --no-angle --no-compiler-runtime --no-opengl-sw --no-patchqt --no-translations --no-quick --plugindir "$<TARGET_FILE_DIR:rpcs3>/qt/plugins" $<$<CONFIG:Debug>:--debug> $<$<CONFIG:Release>:--release> "$<TARGET_FILE:rpcs3>")
endif()
+1 -1
View File
@@ -124,7 +124,7 @@ int aes_crypt_cbc( aes_context *ctx,
* both encryption and decryption. So a context initialized with
* aes_setkey_enc() for both AES_ENCRYPT and AES_DECRYPT.
*
* both
* both
* \param ctx AES context
* \param mode AES_ENCRYPT or AES_DECRYPT
* \param length length of the input data
+1 -1
View File
@@ -245,7 +245,7 @@ constexpr s64 PAID_30 = 0x1070000023000001L; // spu_token_processor.self; CoreOS
constexpr s64 PAID_31 = 0x1070000024000001L; // sv_iso_spu_module.self; CoreOS; same for CEX DEX DECR
constexpr s64 PAID_32 = 0x1070000025000001L; // aim_spu_module.self; CoreOS; same for CEX DEX DECR
constexpr s64 PAID_33 = 0x1070000026000001L; // ss_sc_init.self; [2.43 JIG PUP]
constexpr s64 PAID_34 = 0x1070000027000001L; // dispatcher.fself; lv1;
constexpr s64 PAID_34 = 0x1070000027000001L; // dispatcher.fself; lv1;
constexpr s64 PAID_35 = 0x1070000028000001L; // factory_data_mngr_server.fself; JIG lv1 proc
constexpr s64 PAID_36 = 0x1070000029000001L; // fdm_spu_module.self; [2.43 JIG PUP]
constexpr s64 PAID_37 = 0x107000002A000001L;
+193 -69
View File
@@ -66,6 +66,7 @@ bool package_reader::read_header()
return false;
}
pkg_log.notice("Path: '%s'", m_path);
pkg_log.notice("Header: pkg_magic = 0x%x = \"%s\"", +m_header.pkg_magic, std::string(reinterpret_cast<const char*>(&m_header.pkg_magic), 4));
pkg_log.notice("Header: pkg_type = 0x%x = %d", m_header.pkg_type, m_header.pkg_type);
pkg_log.notice("Header: pkg_platform = 0x%x = %d", m_header.pkg_platform, m_header.pkg_platform);
@@ -515,7 +516,7 @@ bool package_reader::read_param_sfo()
std::memcpy(entries.data(), m_bufs.back().get(), entries.size() * sizeof(PKGEntry));
for (const auto& entry : entries)
for (const PKGEntry& entry : entries)
{
if (entry.name_size > 256)
{
@@ -567,11 +568,9 @@ bool package_reader::read_param_sfo()
return true;
}
else
{
pkg_log.error("Failed to create temporary PARAM.SFO file");
return false;
}
pkg_log.error("Failed to create temporary PARAM.SFO file");
return false;
}
return false;
@@ -621,7 +620,7 @@ package_error package_reader::check_target_app_version() const
if (!target_app_ver.empty())
{
// We are unable to compare anything with the target app version
pkg_log.error("A target app version is required (%s), but no PARAM.SFO was found for %s", target_app_ver, title_id);
pkg_log.error("A target app version is required (%s), but no PARAM.SFO was found for %s. (path='%s', error=%s)", target_app_ver, title_id, sfo_path, fs::g_tls_error);
return package_error::app_version;
}
@@ -691,20 +690,16 @@ package_error package_reader::check_target_app_version() const
return package_error::app_version;
}
bool package_reader::fill_data(std::map<std::string, install_entry*>& all_install_entries)
bool package_reader::set_install_path()
{
if (!m_is_valid)
{
return false;
}
m_install_entries.clear();
m_install_path.clear();
m_bootable_file_path.clear();
m_entry_indexer = 0;
m_written_bytes = 0;
// Get full path and create the directory
// Get full path
std::string dir = rpcs3::utils::get_hdd0_dir();
// Based on https://www.psdevwiki.com/ps3/PKG_files#ContentType
@@ -741,13 +736,27 @@ bool package_reader::fill_data(std::map<std::string, install_entry*>& all_instal
// If false, an existing directory is being overwritten: cannot cancel the operation
m_was_null = !fs::is_dir(dir);
if (!fs::create_path(dir))
m_install_path = dir;
return true;
}
bool package_reader::fill_data(std::map<std::string, install_entry*>& all_install_entries)
{
if (!m_is_valid)
{
pkg_log.error("Could not create the installation directory %s", dir);
return false;
}
m_install_path = dir;
if (!fs::create_path(m_install_path))
{
pkg_log.error("Could not create the installation directory %s (error=%s)", m_install_path, fs::g_tls_error);
return false;
}
m_install_entries.clear();
m_bootable_file_path.clear();
m_entry_indexer = 0;
m_written_bytes = 0;
if (!decrypt_data())
{
@@ -774,13 +783,20 @@ bool package_reader::fill_data(std::map<std::string, install_entry*>& all_instal
decrypt(entry.name_offset, entry.name_size, is_psp ? PKG_AES_KEY2 : m_dec_key.data());
const std::string name{reinterpret_cast<char*>(m_bufs.back().get()), entry.name_size};
std::string path = dir + vfs::escape(name);
std::string path = m_install_path + vfs::escape(name);
const bool log_error = entry.pad || (entry.type & ~PKG_FILE_ENTRY_KNOWN_BITS);
if (entry.pad || (entry.type & ~PKG_FILE_ENTRY_KNOWN_BITS))
{
pkg_log.todo("Entry with unknown type or padding: type=0x%08x, pad=0x%x, name='%s'", entry.type, entry.pad, name);
}
else
{
pkg_log.notice("Entry: type=0x%08x, name='%s'", entry.type, name);
}
(log_error ? pkg_log.error : pkg_log.notice)("Entry 0x%08x: %s (pad=0x%x)", entry.type, name, entry.pad);
const u8 entry_type = entry.type & 0xff;
switch (const u8 entry_type = entry.type & 0xff)
switch (entry_type)
{
case PKG_FILE_ENTRY_FOLDER:
case 0x12:
@@ -804,10 +820,25 @@ bool package_reader::fill_data(std::map<std::string, install_entry*>& all_instal
}
default:
{
const std::string true_path = std::filesystem::weakly_canonical(std::filesystem::u8path(path)).string();
// TODO: check for valid utf8 characters
const std::string true_path = std::filesystem::weakly_canonical(path).string();
if (true_path.empty())
{
num_failures++;
pkg_log.error("Failed to get weakly_canonical path for '%s'", path);
break;
}
auto map_ptr = &*all_install_entries.try_emplace(true_path).first;
m_install_entries.push_back({ map_ptr, name, entry.file_offset, entry.file_size, entry.type, entry.pad });
m_install_entries.push_back({
.weak_reference = map_ptr,
.name = name,
.file_offset = entry.file_offset,
.file_size = entry.file_size,
.type = entry.type,
.pad = entry.pad
});
if (map_ptr->second && !(entry.type & PKG_FILE_ENTRY_OVERWRITE))
{
@@ -824,7 +855,7 @@ bool package_reader::fill_data(std::map<std::string, install_entry*>& all_instal
if (num_failures != 0)
{
pkg_log.error("Package installation failed: %s", dir);
pkg_log.error("Package installation failed: %s", m_install_path);
return false;
}
@@ -833,20 +864,28 @@ bool package_reader::fill_data(std::map<std::string, install_entry*>& all_instal
fs::file DecryptEDAT(const fs::file& input, const std::string& input_file_name, int mode, u8 *custom_klic, bool verbose = false);
usz package_reader::extract_worker(thread_key thread_data_key, std::map<std::string, install_entry*>& all_install_entries)
void package_reader::extract_worker(thread_key thread_data_key)
{
usz num_failures = 0;
while (true)
while (m_num_failures == 0 && !m_aborted)
{
const usz maybe_index = m_entry_indexer++;
// Make sure m_entry_indexer does not exceed m_install_entries
const usz index = m_entry_indexer.fetch_op([this](usz& v)
{
if (v < m_install_entries.size())
{
v++;
return true;
}
if (maybe_index >= m_install_entries.size())
return false;
}).first;
if (index >= m_install_entries.size())
{
break;
}
const install_entry& entry = ::at32(m_install_entries, maybe_index);
const install_entry& entry = ::at32(m_install_entries, index);
if (!entry.is_dominating())
{
@@ -860,8 +899,14 @@ usz package_reader::extract_worker(thread_key thread_data_key, std::map<std::str
const std::string& path = entry.weak_reference->first;
const std::string& name = entry.name;
const bool log_error = entry.pad || (entry.type & ~PKG_FILE_ENTRY_KNOWN_BITS);
(log_error ? pkg_log.error : pkg_log.notice)("Entry 0x%08x: %s (pad=0x%x)", entry.type, name, entry.pad);
if (entry.pad || (entry.type & ~PKG_FILE_ENTRY_KNOWN_BITS))
{
pkg_log.todo("Entry with unknown type or padding: type=0x%08x, pad=0x%x, name='%s'", entry.type, entry.pad, name);
}
else
{
pkg_log.notice("Entry: type=0x%08x, name='%s'", entry.type, name);
}
switch (const u8 entry_type = entry.type & 0xff)
{
@@ -908,14 +953,14 @@ usz package_reader::extract_worker(thread_key thread_data_key, std::map<std::str
if (data_span.size() != block_size)
{
extract_success = false;
pkg_log.error("Failed to extract file %s", path);
pkg_log.error("Failed to extract file %s (data_span.size=%d, block_size=%d)", path, data_span.size(), block_size);
break;
}
if (out.write(data_span.data(), block_size) != block_size)
{
extract_success = false;
pkg_log.error("Failed to write file %s", path);
pkg_log.error("Failed to write file %s (error=%s)", path, fs::g_tls_error);
break;
}
@@ -927,8 +972,8 @@ usz package_reader::extract_worker(thread_key thread_data_key, std::map<std::str
out = DecryptEDAT(out, name, 1, reinterpret_cast<u8*>(&m_header.klicensee), true);
if (!out || !fs::write_file(path, fs::rewrite, static_cast<fs::container_stream<std::vector<u8>>*>(out.release().get())->obj))
{
num_failures++;
pkg_log.error("Failed to create file %s", path);
m_num_failures++;
pkg_log.error("Failed to create file %s (error=%s)", path, fs::g_tls_error);
break;
}
}
@@ -952,71 +997,133 @@ usz package_reader::extract_worker(thread_key thread_data_key, std::map<std::str
}
else
{
num_failures++;
m_num_failures++;
}
}
else
{
num_failures++;
pkg_log.error("Failed to create file %s", path);
m_num_failures++;
pkg_log.error("Failed to create file %s (is_buffered=%d, did_overwrite=%d, error=%s)", path, is_buffered, did_overwrite, fs::g_tls_error);
}
break;
}
default:
{
num_failures++;
m_num_failures++;
pkg_log.error("Unknown PKG entry type (0x%x) %s", entry.type, name);
break;
}
}
}
return num_failures;
}
bool package_reader::extract_data(std::deque<package_reader>& readers, std::deque<std::string>& bootable_paths)
package_error package_reader::extract_data(std::deque<package_reader>& readers, std::deque<std::string>& bootable_paths)
{
std::map<std::string, install_entry*> all_install_entries;
package_error error = package_error::no_error;
usz num_failures = 0;
for (auto& reader : readers)
// Set paths first in order to know if the install dir was empty before starting any installations.
// This will also allow us to remove all the new packages in one path at once if any of them fail.
for (package_reader& reader : readers)
{
if (!reader.fill_data(all_install_entries))
reader.m_result = result::not_started;
if (!reader.set_install_path())
{
return false;
error = package_error::other;
reader.m_result = result::error; // We don't know if it's dirty yet.
return error;
}
}
usz num_failures = 0;
for (auto& reader : readers)
for (package_reader& reader : readers)
{
reader.m_bufs.resize(std::min<usz>(utils::get_thread_count(), reader.m_install_entries.size()));
// Use a seperate map for each reader. We need to check if the target app version exists for each package in sequence.
std::map<std::string, install_entry*> all_install_entries;
atomic_t<usz> thread_indexer = 0;
named_thread_group workers("PKG Installer "sv, std::max<usz>(reader.m_bufs.size(), 1) - 1, [&]()
if (error != package_error::no_error || num_failures > 0)
{
num_failures += reader.extract_worker(thread_key{thread_indexer++}, all_install_entries);
});
ensure(reader.m_result == result::error || reader.m_result == result::error_dirty);
return error;
}
num_failures += reader.extract_worker(thread_key{thread_indexer++}, all_install_entries);
workers.join();
// Check if this package is allowed to be installed on top of the existing data
error = reader.check_target_app_version();
reader.m_bufs.clear();
reader.m_bufs.shrink_to_fit();
if (num_failures)
if (error != package_error::no_error)
{
if (reader.m_was_null)
reader.m_result = result::error; // We don't know if it's dirty yet.
return error;
}
reader.m_result = result::started;
// Parse the files to be installed and create all paths.
if (!reader.fill_data(all_install_entries))
{
error = package_error::other;
// Do not return yet. We may need to clean up down below.
}
reader.m_num_failures = error == package_error::no_error ? 0 : 1;
if (reader.m_num_failures == 0)
{
reader.m_bufs.resize(std::min<usz>(utils::get_thread_count(), reader.m_install_entries.size()));
atomic_t<usz> thread_indexer = 0;
named_thread_group workers("PKG Installer "sv, std::max<u32>(::narrow<u32>(reader.m_bufs.size()), 1) - 1, [&]()
{
fs::remove_all(reader.m_install_path, true);
reader.extract_worker(thread_key{thread_indexer++});
});
reader.extract_worker(thread_key{thread_indexer++});
workers.join();
reader.m_bufs.clear();
reader.m_bufs.shrink_to_fit();
}
num_failures += reader.m_num_failures;
// We don't count this package as aborted if all entries were processed.
if (reader.m_num_failures || (reader.m_aborted && reader.m_entry_indexer < reader.m_install_entries.size()))
{
// Clear boot path. We don't want to propagate potentially broken paths to the caller.
reader.m_bootable_file_path.clear();
bool cleaned = reader.m_was_null;
if (reader.m_was_null && fs::is_dir(reader.m_install_path))
{
pkg_log.notice("Removing partial installation ('%s')", reader.m_install_path);
if (!fs::remove_all(reader.m_install_path, true))
{
pkg_log.notice("Failed to remove partial installation ('%s') (error=%s)", reader.m_install_path, fs::g_tls_error);
cleaned = false;
}
}
if (reader.m_num_failures)
{
pkg_log.error("Package failed to install ('%s')", reader.m_install_path);
reader.m_result = cleaned ? result::error : result::error_dirty;
}
else
{
pkg_log.warning("Package installation aborted ('%s')", reader.m_install_path);
reader.m_result = cleaned ? result::aborted : result::aborted_dirty;
}
pkg_log.success("Package failed to install ('%s')", reader.m_install_path);
break;
}
else if (reader.get_progress(1) != 1)
reader.m_result = result::success;
if (reader.get_progress(1) != 1)
{
pkg_log.warning("Missing %d bytes from PKG total files size.", reader.m_header.data_size - reader.m_written_bytes);
reader.m_written_bytes = reader.m_header.data_size; // Mark as completed anyway
@@ -1026,13 +1133,18 @@ bool package_reader::extract_data(std::deque<package_reader>& readers, std::dequ
bootable_paths.emplace_back(std::move(reader.m_bootable_file_path));
}
return num_failures == 0;
if (error == package_error::no_error && num_failures > 0)
{
error = package_error::other;
}
return error;
}
void package_reader::archive_seek(const s64 new_offset, const fs::seek_mode damode)
{
if (m_file) m_file.seek(new_offset, damode);
};
}
u64 package_reader::archive_read(void* data_ptr, const u64 num_bytes)
{
@@ -1128,4 +1240,16 @@ std::span<const char> package_reader::decrypt(u64 offset, u64 size, const uchar*
// Return the amount of data written in buf
return data_span;
};
}
int package_reader::get_progress(int maximum) const
{
const usz wr = m_written_bytes;
return wr >= m_header.data_size ? maximum : ::narrow<int>(wr * maximum / m_header.data_size);
}
void package_reader::abort_extract()
{
m_aborted = true;
}
+20 -21
View File
@@ -332,31 +332,26 @@ public:
package_reader(const std::string& path);
~package_reader();
enum result
{
not_started,
started,
success,
aborted,
aborted_dirty,
error,
error_dirty
};
bool is_valid() const { return m_is_valid; }
package_error check_target_app_version() const;
static bool extract_data(std::deque<package_reader>& readers, std::deque<std::string>& bootable_paths);
static package_error extract_data(std::deque<package_reader>& readers, std::deque<std::string>& bootable_paths);
psf::registry get_psf() const { return m_psf; }
result get_result() const { return m_result; };
int get_progress(int maximum = 100) const
{
const usz wr = m_written_bytes;
int get_progress(int maximum = 100) const;
return wr >= m_header.data_size ? maximum : ::narrow<int>(wr * maximum / m_header.data_size);
}
void abort_extract()
{
m_entry_indexer.fetch_op([this](usz& v)
{
if (v < m_install_entries.size())
{
v = m_install_entries.size();
return true;
}
return false;
});
}
void abort_extract();
private:
bool read_header();
@@ -365,13 +360,16 @@ private:
bool decrypt_data();
void archive_seek(s64 new_offset, const fs::seek_mode damode = fs::seek_set);
u64 archive_read(void* data_ptr, u64 num_bytes);
bool set_install_path();
bool fill_data(std::map<std::string, install_entry*>& all_install_entries);
std::span<const char> archive_read_block(u64 offset, void* data_ptr, u64 num_bytes);
std::span<const char> decrypt(u64 offset, u64 size, const uchar* key, thread_key thread_data_key = {0});
usz extract_worker(thread_key thread_data_key, std::map<std::string, install_entry*>& all_install_entries);
void extract_worker(thread_key thread_data_key);
std::deque<install_entry> m_install_entries;
std::string m_install_path;
atomic_t<bool> m_aborted = false;
atomic_t<usz> m_num_failures = 0;
atomic_t<usz> m_entry_indexer = 0;
atomic_t<usz> m_written_bytes = 0;
bool m_was_null = false;
@@ -379,6 +377,7 @@ private:
static constexpr usz BUF_SIZE = 8192 * 1024; // 8 MB
bool m_is_valid = false;
result m_result = result::not_started;
std::string m_path{};
std::string m_install_dir{};
+121 -123
View File
@@ -192,60 +192,58 @@ void WriteShdr(const fs::file& f, Elf32_Shdr& shdr)
}
void AppInfo::Load(const fs::file& f)
void program_identification_header::Load(const fs::file& f)
{
authid = Read64(f);
vendor_id = Read32(f);
self_type = Read32(f);
version = Read64(f);
padding = Read64(f);
program_authority_id = Read64(f);
program_vendor_id = Read32(f);
program_type = Read32(f);
program_sceversion = Read64(f);
padding = Read64(f);
}
void AppInfo::Show() const
void program_identification_header::Show() const
{
self_log.notice("AuthID: 0x%llx", authid);
self_log.notice("VendorID: 0x%08x", vendor_id);
self_log.notice("SELF type: 0x%08x", self_type);
self_log.notice("Version: 0x%llx", version);
self_log.notice("AuthID: 0x%llx", program_authority_id);
self_log.notice("VendorID: 0x%08x", program_vendor_id);
self_log.notice("SELF type: 0x%08x", program_type);
self_log.notice("Version: 0x%llx", program_sceversion);
}
void SectionInfo::Load(const fs::file& f)
void segment_ext_header::Load(const fs::file& f)
{
offset = Read64(f);
size = Read64(f);
compressed = Read32(f);
unknown1 = Read32(f);
unknown2 = Read32(f);
encrypted = Read32(f);
offset = Read64(f);
size = Read64(f);
compression = Read32(f);
unknown = Read32(f);
encryption = Read64(f);
}
void SectionInfo::Show() const
void segment_ext_header::Show() const
{
self_log.notice("Offset: 0x%llx", offset);
self_log.notice("Size: 0x%llx", size);
self_log.notice("Compressed: 0x%08x", compressed);
self_log.notice("Unknown1: 0x%08x", unknown1);
self_log.notice("Unknown2: 0x%08x", unknown2);
self_log.notice("Encrypted: 0x%08x", encrypted);
self_log.notice("Compression: 0x%08x", compression);
self_log.notice("Unknown: 0x%08x", unknown);
self_log.notice("Encryption: 0x%08x", encryption);
}
void SCEVersionInfo::Load(const fs::file& f)
void version_header::Load(const fs::file& f)
{
subheader_type = Read32(f);
present = Read32(f);
size = Read32(f);
unknown = Read32(f);
unknown4 = Read32(f);
}
void SCEVersionInfo::Show() const
void version_header::Show() const
{
self_log.notice("Sub-header type: 0x%08x", subheader_type);
self_log.notice("Present: 0x%08x", present);
self_log.notice("Size: 0x%08x", size);
self_log.notice("Unknown: 0x%08x", unknown);
self_log.notice("Unknown: 0x%08x", unknown4);
}
void ControlInfo::Load(const fs::file& f)
void supplemental_header::Load(const fs::file& f)
{
type = Read32(f);
size = Read32(f);
@@ -253,45 +251,45 @@ void ControlInfo::Load(const fs::file& f)
if (type == 1)
{
control_flags.ctrl_flag1 = Read32(f);
control_flags.unknown1 = Read32(f);
control_flags.unknown2 = Read32(f);
control_flags.unknown3 = Read32(f);
control_flags.unknown4 = Read32(f);
control_flags.unknown5 = Read32(f);
control_flags.unknown6 = Read32(f);
control_flags.unknown7 = Read32(f);
PS3_plaintext_capability_header.ctrl_flag1 = Read32(f);
PS3_plaintext_capability_header.unknown1 = Read32(f);
PS3_plaintext_capability_header.unknown2 = Read32(f);
PS3_plaintext_capability_header.unknown3 = Read32(f);
PS3_plaintext_capability_header.unknown4 = Read32(f);
PS3_plaintext_capability_header.unknown5 = Read32(f);
PS3_plaintext_capability_header.unknown6 = Read32(f);
PS3_plaintext_capability_header.unknown7 = Read32(f);
}
else if (type == 2)
{
if (size == 0x30)
{
f.read(file_digest_30.digest, 20);
file_digest_30.unknown = Read64(f);
f.read(PS3_elf_digest_header_30.constant_or_elf_digest, sizeof(PS3_elf_digest_header_30.constant_or_elf_digest));
f.read(PS3_elf_digest_header_30.padding, sizeof(PS3_elf_digest_header_30.padding));
}
else if (size == 0x40)
{
f.read(file_digest_40.digest1, 20);
f.read(file_digest_40.digest2, 20);
file_digest_40.unknown = Read64(f);
f.read(PS3_elf_digest_header_40.constant, sizeof(PS3_elf_digest_header_40.constant));
f.read(PS3_elf_digest_header_40.elf_digest, sizeof(PS3_elf_digest_header_40.elf_digest));
PS3_elf_digest_header_40.required_system_version = Read64(f);
}
}
else if (type == 3)
{
npdrm.magic = Read32(f);
npdrm.version = Read32(f);
npdrm.license = Read32(f);
npdrm.type = Read32(f);
f.read(npdrm.content_id, 48);
f.read(npdrm.digest, 16);
f.read(npdrm.title_hash, 16);
f.read(npdrm.dev_hash, 16);
npdrm.activate_time = Read64(f);
npdrm.expire_time = Read64(f);
PS3_npdrm_header.npd.magic = Read32(f);
PS3_npdrm_header.npd.version = Read32(f);
PS3_npdrm_header.npd.license = Read32(f);
PS3_npdrm_header.npd.type = Read32(f);
f.read(PS3_npdrm_header.npd.content_id, 48);
f.read(PS3_npdrm_header.npd.digest, 16);
f.read(PS3_npdrm_header.npd.title_hash, 16);
f.read(PS3_npdrm_header.npd.dev_hash, 16);
PS3_npdrm_header.npd.activate_time = Read64(f);
PS3_npdrm_header.npd.expire_time = Read64(f);
}
}
void ControlInfo::Show() const
void supplemental_header::Show() const
{
self_log.notice("Type: 0x%08x", type);
self_log.notice("Size: 0x%08x", size);
@@ -299,41 +297,41 @@ void ControlInfo::Show() const
if (type == 1)
{
self_log.notice("Control flag 1: 0x%08x", control_flags.ctrl_flag1);
self_log.notice("Unknown1: 0x%08x", control_flags.unknown1);
self_log.notice("Unknown2: 0x%08x", control_flags.unknown2);
self_log.notice("Unknown3: 0x%08x", control_flags.unknown3);
self_log.notice("Unknown4: 0x%08x", control_flags.unknown4);
self_log.notice("Unknown5: 0x%08x", control_flags.unknown5);
self_log.notice("Unknown6: 0x%08x", control_flags.unknown6);
self_log.notice("Unknown7: 0x%08x", control_flags.unknown7);
self_log.notice("Control flag 1: 0x%08x", PS3_plaintext_capability_header.ctrl_flag1);
self_log.notice("Unknown1: 0x%08x", PS3_plaintext_capability_header.unknown1);
self_log.notice("Unknown2: 0x%08x", PS3_plaintext_capability_header.unknown2);
self_log.notice("Unknown3: 0x%08x", PS3_plaintext_capability_header.unknown3);
self_log.notice("Unknown4: 0x%08x", PS3_plaintext_capability_header.unknown4);
self_log.notice("Unknown5: 0x%08x", PS3_plaintext_capability_header.unknown5);
self_log.notice("Unknown6: 0x%08x", PS3_plaintext_capability_header.unknown6);
self_log.notice("Unknown7: 0x%08x", PS3_plaintext_capability_header.unknown7);
}
else if (type == 2)
{
if (size == 0x30)
{
self_log.notice("Digest: %s", file_digest_30.digest);
self_log.notice("Unknown: 0x%llx", file_digest_30.unknown);
self_log.notice("Digest: %s", PS3_elf_digest_header_30.constant_or_elf_digest);
self_log.notice("Unknown: 0x%llx", PS3_elf_digest_header_30.padding);
}
else if (size == 0x40)
{
self_log.notice("Digest1: %s", file_digest_40.digest1);
self_log.notice("Digest2: %s", file_digest_40.digest2);
self_log.notice("Unknown: 0x%llx", file_digest_40.unknown);
self_log.notice("Digest1: %s", PS3_elf_digest_header_40.constant);
self_log.notice("Digest2: %s", PS3_elf_digest_header_40.elf_digest);
self_log.notice("Unknown: 0x%llx", PS3_elf_digest_header_40.required_system_version);
}
}
else if (type == 3)
{
self_log.notice("Magic: 0x%08x", npdrm.magic);
self_log.notice("Version: 0x%08x", npdrm.version);
self_log.notice("License: 0x%08x", npdrm.license);
self_log.notice("Type: 0x%08x", npdrm.type);
self_log.notice("ContentID: %s", npdrm.content_id);
self_log.notice("Digest: %s", npdrm.digest);
self_log.notice("Inverse digest: %s", npdrm.title_hash);
self_log.notice("XOR digest: %s", npdrm.dev_hash);
self_log.notice("Activation time: 0x%llx", npdrm.activate_time);
self_log.notice("Expiration time: 0x%llx", npdrm.expire_time);
self_log.notice("Magic: 0x%08x", PS3_npdrm_header.npd.magic);
self_log.notice("Version: 0x%08x", PS3_npdrm_header.npd.version);
self_log.notice("License: 0x%08x", PS3_npdrm_header.npd.license);
self_log.notice("Type: 0x%08x", PS3_npdrm_header.npd.type);
self_log.notice("ContentID: %s", PS3_npdrm_header.npd.content_id);
self_log.notice("Digest: %s", PS3_npdrm_header.npd.digest);
self_log.notice("Inverse digest: %s", PS3_npdrm_header.npd.title_hash);
self_log.notice("XOR digest: %s", PS3_npdrm_header.npd.dev_hash);
self_log.notice("Activation time: 0x%llx", PS3_npdrm_header.npd.activate_time);
self_log.notice("Expiration time: 0x%llx", PS3_npdrm_header.npd.expire_time);
}
}
@@ -610,18 +608,18 @@ void SceHeader::Load(const fs::file& f)
se_esize = Read64(f);
}
void SelfHeader::Load(const fs::file& f)
void ext_hdr::Load(const fs::file& f)
{
se_htype = Read64(f);
se_appinfooff = Read64(f);
se_elfoff = Read64(f);
se_phdroff = Read64(f);
se_shdroff = Read64(f);
se_secinfoff = Read64(f);
se_sceveroff = Read64(f);
se_controloff = Read64(f);
se_controlsize = Read64(f);
pad = Read64(f);
ext_hdr_version = Read64(f);
program_identification_hdr_offset = Read64(f);
ehdr_offset = Read64(f);
phdr_offset = Read64(f);
shdr_offset = Read64(f);
segment_ext_hdr_offset = Read64(f);
version_hdr_offset = Read64(f);
supplemental_hdr_offset = Read64(f);
supplemental_hdr_size = Read64(f);
padding = Read64(f);
}
SCEDecrypter::SCEDecrypter(const fs::file& s)
@@ -683,7 +681,7 @@ bool SCEDecrypter::LoadMetadata(const u8 erk[32], const u8 riv[16])
if ((meta_info.key_pad[0] != 0x00) ||
(meta_info.iv_pad[0] != 0x00))
{
self_log.error("Failed to decrypt metadata info!");
self_log.error("Failed to decrypt SCE metadata info!");
return false;
}
@@ -884,19 +882,19 @@ bool SELFDecrypter::LoadHeaders(bool isElf32, SelfAdditionalInfo* out_info)
}
// Read SELF header.
self_hdr.Load(self_f);
m_ext_hdr.Load(self_f);
// Read the APP INFO.
self_f.seek(self_hdr.se_appinfooff);
app_info.Load(self_f);
self_f.seek(m_ext_hdr.program_identification_hdr_offset);
m_prog_id_hdr.Load(self_f);
if (out_info)
{
out_info->app_info = app_info;
out_info->prog_id_hdr = m_prog_id_hdr;
}
// Read ELF header.
self_f.seek(self_hdr.se_elfoff);
self_f.seek(m_ext_hdr.ehdr_offset);
if (isElf32)
elf32_hdr.Load(self_f);
@@ -912,7 +910,7 @@ bool SELFDecrypter::LoadHeaders(bool isElf32, SelfAdditionalInfo* out_info)
self_log.error("ELF program header offset is null!");
return false;
}
self_f.seek(self_hdr.se_phdroff);
self_f.seek(m_ext_hdr.phdr_offset);
for(u32 i = 0; i < elf32_hdr.e_phnum; ++i)
{
phdr32_arr.emplace_back();
@@ -929,7 +927,7 @@ bool SELFDecrypter::LoadHeaders(bool isElf32, SelfAdditionalInfo* out_info)
return false;
}
self_f.seek(self_hdr.se_phdroff);
self_f.seek(m_ext_hdr.phdr_offset);
for (u32 i = 0; i < elf64_hdr.e_phnum; ++i)
{
@@ -940,34 +938,34 @@ bool SELFDecrypter::LoadHeaders(bool isElf32, SelfAdditionalInfo* out_info)
// Read section info.
secinfo_arr.clear();
self_f.seek(self_hdr.se_secinfoff);
m_seg_ext_hdr.clear();
self_f.seek(m_ext_hdr.segment_ext_hdr_offset);
for(u32 i = 0; i < ((isElf32) ? elf32_hdr.e_phnum : elf64_hdr.e_phnum); ++i)
{
secinfo_arr.emplace_back();
secinfo_arr.back().Load(self_f);
m_seg_ext_hdr.emplace_back();
m_seg_ext_hdr.back().Load(self_f);
}
// Read SCE version info.
self_f.seek(self_hdr.se_sceveroff);
scev_info.Load(self_f);
self_f.seek(m_ext_hdr.version_hdr_offset);
m_version_hdr.Load(self_f);
// Read control info.
ctrlinfo_arr.clear();
self_f.seek(self_hdr.se_controloff);
m_supplemental_hdr_arr.clear();
self_f.seek(m_ext_hdr.supplemental_hdr_offset);
for (u64 i = 0; i < self_hdr.se_controlsize;)
for (u64 i = 0; i < m_ext_hdr.supplemental_hdr_size;)
{
ctrlinfo_arr.emplace_back();
ControlInfo &cinfo = ctrlinfo_arr.back();
m_supplemental_hdr_arr.emplace_back();
supplemental_header& cinfo = m_supplemental_hdr_arr.back();
cinfo.Load(self_f);
i += cinfo.size;
}
if (out_info)
{
out_info->ctrl_info = ctrlinfo_arr;
out_info->supplemental_hdr = m_supplemental_hdr_arr;
}
// Read ELF section headers.
@@ -981,7 +979,7 @@ bool SELFDecrypter::LoadHeaders(bool isElf32, SelfAdditionalInfo* out_info)
return true;
}
self_f.seek(self_hdr.se_shdroff);
self_f.seek(m_ext_hdr.shdr_offset);
for(u32 i = 0; i < elf32_hdr.e_shnum; ++i)
{
@@ -998,7 +996,7 @@ bool SELFDecrypter::LoadHeaders(bool isElf32, SelfAdditionalInfo* out_info)
return true;
}
self_f.seek(self_hdr.se_shdroff);
self_f.seek(m_ext_hdr.shdr_offset);
for(u32 i = 0; i < elf64_hdr.e_shnum; ++i)
{
@@ -1023,11 +1021,11 @@ void SELFDecrypter::ShowHeaders(bool isElf32)
self_log.notice("----------------------------------------------------");
self_log.notice("SELF header");
self_log.notice("----------------------------------------------------");
self_hdr.Show();
m_ext_hdr.Show();
self_log.notice("----------------------------------------------------");
self_log.notice("APP INFO");
self_log.notice("----------------------------------------------------");
app_info.Show();
m_prog_id_hdr.Show();
self_log.notice("----------------------------------------------------");
self_log.notice("ELF header");
self_log.notice("----------------------------------------------------");
@@ -1040,17 +1038,17 @@ void SELFDecrypter::ShowHeaders(bool isElf32)
self_log.notice("----------------------------------------------------");
self_log.notice("Section info");
self_log.notice("----------------------------------------------------");
for(unsigned int i = 0; i < secinfo_arr.size(); i++)
secinfo_arr[i].Show();
for(unsigned int i = 0; i < m_seg_ext_hdr.size(); i++)
m_seg_ext_hdr[i].Show();
self_log.notice("----------------------------------------------------");
self_log.notice("SCE version info");
self_log.notice("----------------------------------------------------");
scev_info.Show();
m_version_hdr.Show();
self_log.notice("----------------------------------------------------");
self_log.notice("Control info");
self_log.notice("----------------------------------------------------");
for(unsigned int i = 0; i < ctrlinfo_arr.size(); i++)
ctrlinfo_arr[i].Show();
for(unsigned int i = 0; i < m_supplemental_hdr_arr.size(); i++)
m_supplemental_hdr_arr[i].Show();
self_log.notice("----------------------------------------------------");
self_log.notice("ELF section headers");
self_log.notice("----------------------------------------------------");
@@ -1095,7 +1093,7 @@ bool SELFDecrypter::DecryptNPDRM(u8 *metadata, u32 metadata_size)
else if (npd->license == 3) // Free license.
{
// Use klicensee if available.
if (key_v.GetKlicenseeKey() != nullptr)
if (key_v.GetKlicenseeKey())
memcpy(npdrm_key, key_v.GetKlicenseeKey(), 0x10);
else
memcpy(npdrm_key, NP_KLIC_FREE, 0x10);
@@ -1123,11 +1121,11 @@ bool SELFDecrypter::DecryptNPDRM(u8 *metadata, u32 metadata_size)
const NPD_HEADER* SELFDecrypter::GetNPDHeader() const
{
// Parse the control info structures to find the NPDRM control info.
for (const ControlInfo& info : ctrlinfo_arr)
for (const supplemental_header& info : m_supplemental_hdr_arr)
{
if (info.type == 3)
{
return &info.npdrm;
return &info.PS3_npdrm_header.npd;
}
}
@@ -1150,7 +1148,7 @@ bool SELFDecrypter::LoadMetadata(u8* klic_key)
self_f.read(metadata_headers.get(), metadata_headers_size);
// Find the right keyset from the key vault.
SELF_KEY keyset = key_v.FindSelfKey(app_info.self_type, sce_hdr.se_flags, app_info.version);
SELF_KEY keyset = key_v.FindSelfKey(m_prog_id_hdr.program_type, sce_hdr.se_flags, m_prog_id_hdr.program_sceversion);
// Set klic if given
if (klic_key)
@@ -1182,7 +1180,7 @@ bool SELFDecrypter::LoadMetadata(u8* klic_key)
if ((meta_info.key_pad[0] != 0x00) ||
(meta_info.iv_pad[0] != 0x00))
{
self_log.error("Failed to decrypt metadata info!");
self_log.error("Failed to decrypt SELF metadata info!");
return false;
}
@@ -1333,15 +1331,15 @@ static bool IsSelfElf32(const fs::file& f)
f.seek(0);
SceHeader hdr;
SelfHeader sh;
SceHeader hdr{};
ext_hdr sh{};
hdr.Load(f);
sh.Load(f);
// Locate the class byte and check it.
u8 elf_class[0x8];
f.seek(sh.se_elfoff);
f.seek(sh.ehdr_offset);
f.read(elf_class, 0x8);
return (elf_class[4] == 1);
+184 -121
View File
@@ -11,52 +11,113 @@
LOG_CHANNEL(self_log, "SELF");
struct AppInfo
// SCE-specific definitions for e_type:
enum
{
u64 authid;
u32 vendor_id;
u32 self_type;
u64 version;
ET_SCE_EXEC = 0xFE00, // SCE Executable - PRX2
ET_SCE_RELEXEC = 0xFE04, // SCE Relocatable Executable - PRX2
ET_SCE_STUBLIB = 0xFE0C, // SCE SDK Stubs
ET_SCE_DYNEXEC = 0xFE10, // SCE EXEC_ASLR (PS4 Executable with ASLR)
ET_SCE_DYNAMIC = 0xFE18, // ?
ET_SCE_IOPRELEXEC = 0xFF80, // SCE IOP Relocatable Executable
ET_SCE_IOPRELEXEC2 = 0xFF81, // SCE IOP Relocatable Executable Version 2
ET_SCE_EERELEXEC = 0xFF90, // SCE EE Relocatable Executable
ET_SCE_EERELEXEC2 = 0xFF91, // SCE EE Relocatable Executable Version 2
ET_SCE_PSPRELEXEC = 0xFFA0, // SCE PSP Relocatable Executable
ET_SCE_PPURELEXEC = 0xFFA4, // SCE PPU Relocatable Executable
ET_SCE_ARMRELEXEC = 0xFFA5, // ?SCE ARM Relocatable Executable (PS Vita System Software earlier or equal 0.931.010)
ET_SCE_PSPOVERLAY = 0xFFA8, // ?
};
enum
{
ELFOSABI_CELL_LV2 = 102 // CELL LV2
};
enum
{
PT_SCE_RELA = 0x60000000,
PT_SCE_LICINFO_1 = 0x60000001,
PT_SCE_LICINFO_2 = 0x60000002,
PT_SCE_DYNLIBDATA = 0x61000000,
PT_SCE_PROCPARAM = 0x61000001,
PT_SCE_UNK_61000010 = 0x61000010,
PT_SCE_COMMENT = 0x6FFFFF00,
PT_SCE_LIBVERSION = 0x6FFFFF01,
PT_SCE_UNK_70000001 = 0x70000001,
PT_SCE_IOPMOD = 0x70000080,
PT_SCE_EEMOD = 0x70000090,
PT_SCE_PSPRELA = 0x700000A0,
PT_SCE_PSPRELA2 = 0x700000A1,
PT_SCE_PPURELA = 0x700000A4,
PT_SCE_SEGSYM = 0x700000A8,
};
enum
{
PF_SPU_X = 0x00100000,
PF_SPU_W = 0x00200000,
PF_SPU_R = 0x00400000,
PF_RSX_X = 0x01000000,
PF_RSX_W = 0x02000000,
PF_RSX_R = 0x04000000,
};
enum
{
SHT_SCE_RELA = 0x60000000,
SHT_SCE_NID = 0x61000001,
SHT_SCE_IOPMOD = 0x70000080,
SHT_SCE_EEMOD = 0x70000090,
SHT_SCE_PSPRELA = 0x700000A0,
SHT_SCE_PPURELA = 0x700000A4,
};
struct program_identification_header
{
u64 program_authority_id;
u32 program_vendor_id;
u32 program_type;
u64 program_sceversion;
u64 padding;
void Load(const fs::file& f);
void Show() const;
};
struct SectionInfo
struct segment_ext_header
{
u64 offset;
u64 size;
u32 compressed;
u32 unknown1;
u32 unknown2;
u32 encrypted;
u64 offset; // Offset to data
u64 size; // Size of data
u32 compression; // 1 = plain, 2 = zlib
u32 unknown; // Always 0, as far as I know.
u64 encryption; // 0 = unrequested, 1 = completed, 2 = requested
void Load(const fs::file& f);
void Show() const;
};
struct SCEVersionInfo
struct version_header
{
u32 subheader_type;
u32 present;
u32 size;
u32 unknown;
u32 subheader_type; // 1 - sceversion
u32 present; // 0 = false, 1 = true
u32 size; // usually 0x10
u32 unknown4;
void Load(const fs::file& f);
void Show() const;
};
struct ControlInfo
struct supplemental_header
{
u32 type;
u32 type; // 1=PS3 plaintext_capability; 2=PS3 ELF digest; 3=PS3 NPDRM, 4=PS Vita ELF digest; 5=PS Vita NPDRM; 6=PS Vita boot param; 7=PS Vita shared secret
u32 size;
u64 next;
u64 next; // 1 if another Supplemental Header element follows else 0
union
{
// type 1 0x30 bytes
struct
// type 1, 0x30 bytes
struct // 0x20 bytes of data
{
u32 ctrl_flag1;
u32 unknown1;
@@ -66,28 +127,28 @@ struct ControlInfo
u32 unknown5;
u32 unknown6;
u32 unknown7;
} PS3_plaintext_capability_header;
} control_flags;
// type 2 0x30 bytes
struct
// type 2, 0x40 bytes
struct // 0x30 bytes of data
{
u8 digest[20];
u64 unknown;
u8 constant[0x14]; // same for every PS3/PS Vita SELF, hardcoded in make_fself.exe: 627CB1808AB938E32C8C091708726A579E2586E4
u8 elf_digest[0x14]; // SHA-1. Hash F2C552BF716ED24759CBE8A0A9A6DB9965F3811C is blacklisted by appldr
u64 required_system_version; // filled on Sony authentication server, contains decimal PS3_SYSTEM_VER value from PARAM.SFO
} PS3_elf_digest_header_40;
} file_digest_30;
// type 2 0x40 bytes
struct
// type 2, 0x30 bytes
struct // 0x20 bytes of data
{
u8 digest1[20];
u8 digest2[20];
u64 unknown;
u8 constant_or_elf_digest[0x14];
u8 padding[0xC];
} PS3_elf_digest_header_30;
} file_digest_40;
// type 3 0x90 bytes
NPD_HEADER npdrm;
// type 3, 0x90 bytes
struct // 0x80 bytes of data
{
NPD_HEADER npd;
} PS3_npdrm_header;
};
void Load(const fs::file& f);
@@ -172,7 +233,7 @@ struct Signature
struct SelfSection
{
u8 *data;
u8* data;
u64 size;
u64 offset;
@@ -181,25 +242,26 @@ struct SelfSection
struct Elf32_Ehdr
{
//u8 e_ident[16]; // ELF identification
u32 e_magic;
u8 e_class;
u8 e_data;
u8 e_curver;
u8 e_os_abi;
u64 e_abi_ver;
u16 e_type;
u16 e_machine;
u32 e_version;
u32 e_entry;
u32 e_phoff;
u32 e_shoff;
u32 e_flags;
u16 e_ehsize;
u16 e_phentsize;
u16 e_phnum;
u16 e_shentsize;
u16 e_shnum;
u16 e_shstrndx;
u16 e_type; // object file type
u16 e_machine; // machine type
u32 e_version; // object file version
u32 e_entry; // entry point address
u32 e_phoff; // program header offset
u32 e_shoff; // section header offset
u32 e_flags; // processor-specific flags
u16 e_ehsize; // ELF header size
u16 e_phentsize; // size of program header entry
u16 e_phnum; // number of program header entries
u16 e_shentsize; // size of section header entry
u16 e_shnum; // number of section header entries
u16 e_shstrndx; // section name string table index
void Load(const fs::file& f);
static void Show() {}
@@ -210,16 +272,16 @@ struct Elf32_Ehdr
struct Elf32_Shdr
{
u32 sh_name;
u32 sh_type;
u32 sh_flags;
u32 sh_addr;
u32 sh_offset;
u32 sh_size;
u32 sh_link;
u32 sh_info;
u32 sh_addralign;
u32 sh_entsize;
u32 sh_name; // section name
u32 sh_type; // section type
u32 sh_flags; // section attributes
u32 sh_addr; // virtual address in memory
u32 sh_offset; // offset in file
u32 sh_size; // size of section
u32 sh_link; // link to other section
u32 sh_info; // miscellaneous information
u32 sh_addralign; // address alignment boundary
u32 sh_entsize; // size of entries, if section has table
void Load(const fs::file& f);
void LoadLE(const fs::file& f);
@@ -228,14 +290,14 @@ struct Elf32_Shdr
struct Elf32_Phdr
{
u32 p_type;
u32 p_offset;
u32 p_vaddr;
u32 p_paddr;
u32 p_filesz;
u32 p_memsz;
u32 p_flags;
u32 p_align;
u32 p_type; // Segment type
u32 p_offset; // Segment file offset
u32 p_vaddr; // Segment virtual address
u32 p_paddr; // Segment physical address
u32 p_filesz; // Segment size in file
u32 p_memsz; // Segment size in memory
u32 p_flags; // Segment flags
u32 p_align; // Segment alignment
void Load(const fs::file& f);
void LoadLE(const fs::file& f);
@@ -244,25 +306,26 @@ struct Elf32_Phdr
struct Elf64_Ehdr
{
//u8 e_ident[16]; // ELF identification
u32 e_magic;
u8 e_class;
u8 e_data;
u8 e_curver;
u8 e_os_abi;
u64 e_abi_ver;
u16 e_type;
u16 e_machine;
u32 e_version;
u64 e_entry;
u64 e_phoff;
u64 e_shoff;
u32 e_flags;
u16 e_ehsize;
u16 e_phentsize;
u16 e_phnum;
u16 e_shentsize;
u16 e_shnum;
u16 e_shstrndx;
u16 e_type; // object file type
u16 e_machine; // machine type
u32 e_version; // object file version
u64 e_entry; // entry point address
u64 e_phoff; // program header offset
u64 e_shoff; // section header offset
u32 e_flags; // processor-specific flags
u16 e_ehsize; // ELF header size
u16 e_phentsize; // size of program header entry
u16 e_phnum; // number of program header entries
u16 e_shentsize; // size of section header entry
u16 e_shnum; // number of section header entries
u16 e_shstrndx; // section name string table index
void Load(const fs::file& f);
static void Show() {}
@@ -272,16 +335,16 @@ struct Elf64_Ehdr
struct Elf64_Shdr
{
u32 sh_name;
u32 sh_type;
u64 sh_flags;
u64 sh_addr;
u64 sh_offset;
u64 sh_size;
u32 sh_link;
u32 sh_info;
u64 sh_addralign;
u64 sh_entsize;
u32 sh_name; // section name
u32 sh_type; // section type
u64 sh_flags; // section attributes
u64 sh_addr; // virtual address in memory
u64 sh_offset; // offset in file
u64 sh_size; // size of section
u32 sh_link; // link to other section
u32 sh_info; // miscellaneous information
u64 sh_addralign; // address alignment boundary
u64 sh_entsize; // size of entries, if section has table
void Load(const fs::file& f);
static void Show(){}
@@ -289,14 +352,14 @@ struct Elf64_Shdr
struct Elf64_Phdr
{
u32 p_type;
u32 p_flags;
u64 p_offset;
u64 p_vaddr;
u64 p_paddr;
u64 p_filesz;
u64 p_memsz;
u64 p_align;
u32 p_type; // Segment type
u32 p_flags; // Segment flags
u64 p_offset; // Segment file offset
u64 p_vaddr; // Segment virtual address
u64 p_paddr; // Segment physical address
u64 p_filesz; // Segment size in file
u64 p_memsz; // Segment size in memory
u64 p_align; // Segment alignment
void Load(const fs::file& f);
static void Show(){}
@@ -317,18 +380,18 @@ struct SceHeader
bool CheckMagic() const { return se_magic == 0x53434500; }
};
struct SelfHeader
struct ext_hdr
{
u64 se_htype;
u64 se_appinfooff;
u64 se_elfoff;
u64 se_phdroff;
u64 se_shdroff;
u64 se_secinfoff;
u64 se_sceveroff;
u64 se_controloff;
u64 se_controlsize;
u64 pad;
u64 ext_hdr_version;
u64 program_identification_hdr_offset;
u64 ehdr_offset;
u64 phdr_offset;
u64 shdr_offset;
u64 segment_ext_hdr_offset;
u64 version_hdr_offset;
u64 supplemental_hdr_offset;
u64 supplemental_hdr_size;
u64 padding;
void Load(const fs::file& f);
static void Show(){}
@@ -337,8 +400,8 @@ struct SelfHeader
struct SelfAdditionalInfo
{
bool valid = false;
std::vector<ControlInfo> ctrl_info;
AppInfo app_info;
std::vector<supplemental_header> supplemental_hdr;
program_identification_header prog_id_hdr;
};
class SCEDecrypter
@@ -376,8 +439,8 @@ class SELFDecrypter
// SCE, SELF and APP headers.
SceHeader sce_hdr{};
SelfHeader self_hdr{};
AppInfo app_info{};
ext_hdr m_ext_hdr{};
program_identification_header m_prog_id_hdr{};
// ELF64 header and program header/section header arrays.
Elf64_Ehdr elf64_hdr{};
@@ -390,9 +453,9 @@ class SELFDecrypter
std::vector<Elf32_Phdr> phdr32_arr{};
// Decryption info structs.
std::vector<SectionInfo> secinfo_arr{};
SCEVersionInfo scev_info{};
std::vector<ControlInfo> ctrlinfo_arr{};
std::vector<segment_ext_header> m_seg_ext_hdr{};
version_header m_version_hdr{};
std::vector<supplemental_header> m_supplemental_hdr_arr{};
// Metadata structs.
MetadataInfo meta_info{};
@@ -484,7 +547,7 @@ private:
}
// Write section headers.
if (self_hdr.se_shdroff != 0)
if (m_ext_hdr.shdr_offset != 0)
{
e.seek(ehdr.e_shoff);
+26 -1
View File
@@ -1,5 +1,6 @@
add_library(rpcs3_emu
cache_utils.cpp
games_config.cpp
IdManager.cpp
localized_string.cpp
savestate_utils.cpp
@@ -159,6 +160,10 @@ target_link_libraries(rpcs3_emu
PUBLIC
3rdparty::soundtouch)
target_link_libraries(rpcs3_emu
PUBLIC
3rdparty::miniupnpc)
# Cell
target_sources(rpcs3_emu PRIVATE
Cell/MFC.cpp
@@ -388,14 +393,24 @@ target_sources(rpcs3_emu PRIVATE
Io/pad_config.cpp
Io/pad_config_types.cpp
Io/PadHandler.cpp
Io/pad_types.cpp
Io/usb_device.cpp
Io/usb_vfs.cpp
Io/Infinity.cpp
Io/Skylander.cpp
Io/GHLtar.cpp
Io/midi_config_types.cpp
Io/RB3MidiKeyboard.cpp
Io/RB3MidiGuitar.cpp
Io/Buzz.cpp
Io/Turntable.cpp
Io/usio.cpp
)
target_link_libraries(rpcs3_emu PRIVATE
3rdparty::rtmidi
)
# Np
target_sources(rpcs3_emu PRIVATE
NP/fb_helpers.cpp
@@ -410,6 +425,8 @@ target_sources(rpcs3_emu PRIVATE
NP/np_structs_extra.cpp
NP/rpcn_client.cpp
NP/rpcn_config.cpp
NP/upnp_config.cpp
NP/upnp_handler.cpp
)
# Memory
@@ -436,12 +453,20 @@ target_sources(rpcs3_emu PRIVATE
RSX/Common/TextureUtils.cpp
RSX/Common/texture_cache.cpp
RSX/Null/NullGSRender.cpp
RSX/Overlays/HomeMenu/overlay_home_menu.cpp
RSX/Overlays/HomeMenu/overlay_home_menu_components.cpp
RSX/Overlays/HomeMenu/overlay_home_menu_main_menu.cpp
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/overlay_animated_icon.cpp
RSX/Overlays/overlay_animation.cpp
RSX/Overlays/overlay_controls.cpp
RSX/Overlays/overlay_cursor.cpp
RSX/Overlays/overlay_edit_text.cpp
RSX/Overlays/overlay_fonts.cpp
RSX/Overlays/overlay_list_view.cpp
RSX/Overlays/overlay_manager.cpp
RSX/Overlays/overlay_media_list_dialog.cpp
RSX/Overlays/overlay_message.cpp
RSX/Overlays/overlay_message_dialog.cpp
@@ -450,10 +475,10 @@ target_sources(rpcs3_emu PRIVATE
RSX/Overlays/overlay_perf_metrics.cpp
RSX/Overlays/overlay_progress_bar.cpp
RSX/Overlays/overlay_save_dialog.cpp
RSX/Overlays/overlay_compile_notification.cpp
RSX/Overlays/overlay_user_list_dialog.cpp
RSX/Overlays/overlay_utils.cpp
RSX/Overlays/overlays.cpp
RSX/Overlays/overlay_shader_compile_notification.cpp
RSX/Overlays/overlay_trophy_notification.cpp
RSX/Overlays/Shaders/shader_loading_dialog.cpp
RSX/Overlays/Shaders/shader_loading_dialog_native.cpp
+7
View File
@@ -35,6 +35,7 @@ static thread_local u32 s_tls_thread_slot = -1;
static thread_local u64 s_tls_sctr = -1;
extern thread_local void(*g_tls_log_control)(const char* fmt, u64 progress);
extern thread_local std::string(*g_tls_log_prefix)();
template <>
void fmt_class_string<cpu_flag>::format(std::string& out, u64 arg)
@@ -478,6 +479,8 @@ namespace cpu_counter
void cpu_thread::operator()()
{
const auto old_prefix = g_tls_log_prefix;
g_tls_this_thread = this;
if (g_cfg.core.thread_scheduler != thread_scheduler_mode::os)
@@ -545,6 +548,7 @@ void cpu_thread::operator()()
{
cpu_thread* _this = nullptr;
std::string name;
std::string(*log_prefix)() = nullptr;
void cleanup()
{
@@ -571,6 +575,8 @@ void cpu_thread::operator()()
s_cpu_counter--;
g_tls_log_prefix = log_prefix;
g_tls_this_thread = nullptr;
g_threads_deleted++;
@@ -590,6 +596,7 @@ void cpu_thread::operator()()
cleanup._this = this;
cleanup.name = thread_ctrl::get_name();
cleanup.log_prefix = old_prefix;
// Check thread status
while (!(state & cpu_flag::exit) && thread_ctrl::state() != thread_state::aborting)
+25 -10
View File
@@ -75,6 +75,14 @@ cpu_translator::cpu_translator(llvm::Module* _module, bool is_be)
return result;
}
});
register_intrinsic("any_select_by_bit4", [&](llvm::CallInst* ci) -> llvm::Value*
{
const auto s = bitcast<s8[16]>(m_ir->CreateShl(bitcast<u64[2]>(ci->getOperand(0)), 3));;
const auto a = bitcast<u8[16]>(ci->getOperand(1));
const auto b = bitcast<u8[16]>(ci->getOperand(2));
return m_ir->CreateSelect(m_ir->CreateICmpSLT(s, llvm::ConstantAggregateZero::get(get_type<s8[16]>())), b, a);
});
}
void cpu_translator::initialize(llvm::LLVMContext& context, llvm::ExecutionEngine& engine)
@@ -112,10 +120,14 @@ void cpu_translator::initialize(llvm::LLVMContext& context, llvm::ExecutionEngin
cpu == "broadwell" ||
cpu == "skylake" ||
cpu == "alderlake" ||
cpu == "raptorlake" ||
cpu == "meteorlake" ||
cpu == "bdver2" ||
cpu == "bdver3" ||
cpu == "bdver4" ||
cpu.startswith("znver"))
cpu == "znver1" ||
cpu == "znver2" ||
cpu == "znver3")
{
m_use_fma = true;
m_use_avx = true;
@@ -135,7 +147,9 @@ void cpu_translator::initialize(llvm::LLVMContext& context, llvm::ExecutionEngin
// Test VNNI feature (TODO)
if (cpu == "cascadelake" ||
cpu == "cooperlake" ||
cpu == "alderlake")
cpu == "alderlake" ||
cpu == "raptorlake" ||
cpu == "meteorlake")
{
m_use_vnni = true;
}
@@ -146,7 +160,8 @@ void cpu_translator::initialize(llvm::LLVMContext& context, llvm::ExecutionEngin
cpu == "icelake-server" ||
cpu == "tigerlake" ||
cpu == "rocketlake" ||
cpu == "sapphirerapids")
cpu == "sapphirerapids" ||
(cpu.startswith("znver") && cpu != "znver1" && cpu != "znver2" && cpu != "znver3"))
{
m_use_avx = true;
m_use_fma = true;
@@ -299,7 +314,7 @@ llvm::Constant* cpu_translator::make_const_vector<v128>(v128 v, llvm::Type* t, u
{
if (const auto ct = llvm::dyn_cast<llvm::IntegerType>(t); ct && ct->getBitWidth() == 128)
{
return llvm::ConstantInt::get(t, llvm::APInt(128, llvm::makeArrayRef(reinterpret_cast<const u64*>(v._bytes), 2)));
return llvm::ConstantInt::get(t, llvm::APInt(128, llvm::ArrayRef(reinterpret_cast<const u64*>(v._bytes), 2)));
}
ensure(t->isVectorTy());
@@ -309,27 +324,27 @@ llvm::Constant* cpu_translator::make_const_vector<v128>(v128 v, llvm::Type* t, u
if (sct->isIntegerTy(8))
{
return llvm::ConstantDataVector::get(m_context, llvm::makeArrayRef(reinterpret_cast<const u8*>(v._bytes), 16));
return llvm::ConstantDataVector::get(m_context, llvm::ArrayRef(reinterpret_cast<const u8*>(v._bytes), 16));
}
if (sct->isIntegerTy(16))
{
return llvm::ConstantDataVector::get(m_context, llvm::makeArrayRef(reinterpret_cast<const u16*>(v._bytes), 8));
return llvm::ConstantDataVector::get(m_context, llvm::ArrayRef(reinterpret_cast<const u16*>(v._bytes), 8));
}
if (sct->isIntegerTy(32))
{
return llvm::ConstantDataVector::get(m_context, llvm::makeArrayRef(reinterpret_cast<const u32*>(v._bytes), 4));
return llvm::ConstantDataVector::get(m_context, llvm::ArrayRef(reinterpret_cast<const u32*>(v._bytes), 4));
}
if (sct->isIntegerTy(64))
{
return llvm::ConstantDataVector::get(m_context, llvm::makeArrayRef(reinterpret_cast<const u64*>(v._bytes), 2));
return llvm::ConstantDataVector::get(m_context, llvm::ArrayRef(reinterpret_cast<const u64*>(v._bytes), 2));
}
if (sct->isFloatTy())
{
return llvm::ConstantDataVector::get(m_context, llvm::makeArrayRef(reinterpret_cast<const f32*>(v._bytes), 4));
return llvm::ConstantDataVector::get(m_context, llvm::ArrayRef(reinterpret_cast<const f32*>(v._bytes), 4));
}
if (sct->isDoubleTy())
{
return llvm::ConstantDataVector::get(m_context, llvm::makeArrayRef(reinterpret_cast<const f64*>(v._bytes), 2));
return llvm::ConstantDataVector::get(m_context, llvm::ArrayRef(reinterpret_cast<const f64*>(v._bytes), 2));
}
fmt::throw_exception("[line %u] No supported constant type", _line);
+92 -12
View File
@@ -13,13 +13,17 @@
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wmissing-noreturn"
#pragma GCC diagnostic ignored "-Wredundant-decls"
#endif
#include "llvm/IR/LLVMContext.h"
#include "llvm/ExecutionEngine/ExecutionEngine.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Module.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Support/KnownBits.h"
#include "llvm/Support/ModRef.h"
#include "llvm/Analysis/ConstantFolding.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/IntrinsicsX86.h"
#include "llvm/IR/IntrinsicsAArch64.h"
@@ -59,6 +63,62 @@ concept DSLValue = requires (T& v)
{ v.eval(std::declval<llvm::IRBuilder<>*>()) } -> LLVMValue;
};
template <usz N>
struct get_int_bits
{
};
template <>
struct get_int_bits<1>
{
using utype = bool;
};
template <>
struct get_int_bits<2>
{
using utype = i2;
};
template <>
struct get_int_bits<4>
{
using utype = i4;
};
template <>
struct get_int_bits<8>
{
using utype = u8;
};
template <>
struct get_int_bits<16>
{
using utype = u16;
};
template <>
struct get_int_bits<32>
{
using utype = u32;
};
template <>
struct get_int_bits<64>
{
using utype = u64;
};
template <>
struct get_int_bits<128>
{
using utype = u128;
};
template <usz Bits>
using get_int_vt = typename get_int_bits<Bits>::utype;
template <typename T = void>
struct llvm_value_t
{
@@ -2992,7 +3052,7 @@ public:
}
template <typename RT, DSLValue... Args>
auto call(llvm::Function* func, Args&&... args)
auto callf(llvm::Function* func, Args&&... args)
{
llvm_value_t<RT> r;
r.value = m_ir->CreateCall(func, {std::forward<Args>(args).eval(m_ir)...});
@@ -3292,7 +3352,7 @@ public:
// Infinite-precision shift left
template <typename T, typename U, typename CT = llvm_common_t<T, U>>
static auto inf_shl(T&& a, U&& b)
auto inf_shl(T&& a, U&& b)
{
static constexpr u32 esz = llvm_value_t<CT>::esize;
@@ -3318,7 +3378,7 @@ public:
// Infinite-precision logical shift right (unsigned)
template <typename T, typename U, typename CT = llvm_common_t<T, U>>
static auto inf_lshr(T&& a, U&& b)
auto inf_lshr(T&& a, U&& b)
{
static constexpr u32 esz = llvm_value_t<CT>::esize;
@@ -3344,7 +3404,7 @@ public:
// Infinite-precision arithmetic shift right (signed)
template <typename T, typename U, typename CT = llvm_common_t<T, U>>
static auto inf_ashr(T&& a, U&& b)
auto inf_ashr(T&& a, U&& b)
{
static constexpr u32 esz = llvm_value_t<CT>::esize;
@@ -3429,7 +3489,7 @@ public:
if (cv || llvm::isa<llvm::ConstantAggregateZero>(c))
{
result.value = llvm::ConstantDataVector::get(m_context, llvm::makeArrayRef(reinterpret_cast<const u8*>(&mask), 16));
result.value = llvm::ConstantDataVector::get(m_context, llvm::ArrayRef(reinterpret_cast<const u8*>(&mask), 16));
result.value = m_ir->CreateZExt(result.value, get_type<u32[16]>());
result.value = m_ir->CreateShuffleVector(data0, zeros, result.value);
return result;
@@ -3472,7 +3532,7 @@ public:
if (cv || llvm::isa<llvm::ConstantAggregateZero>(c))
{
result.value = llvm::ConstantDataVector::get(m_context, llvm::makeArrayRef(reinterpret_cast<const u8*>(&mask), 16));
result.value = llvm::ConstantDataVector::get(m_context, llvm::ArrayRef(reinterpret_cast<const u8*>(&mask), 16));
result.value = m_ir->CreateZExt(result.value, get_type<u32[16]>());
result.value = m_ir->CreateShuffleVector(data0, data1, result.value);
return result;
@@ -3512,7 +3572,7 @@ public:
if (cv || llvm::isa<llvm::ConstantAggregateZero>(c))
{
result.value = llvm::ConstantDataVector::get(m_context, llvm::makeArrayRef(reinterpret_cast<const u8*>(&mask), 16));
result.value = llvm::ConstantDataVector::get(m_context, llvm::ArrayRef(reinterpret_cast<const u8*>(&mask), 16));
result.value = m_ir->CreateZExt(result.value, get_type<u32[16]>());
result.value = m_ir->CreateShuffleVector(data0, data1, result.value);
return result;
@@ -3530,7 +3590,7 @@ public:
u8 mask16[16] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
// insert the second source operand into the same vector as the first source operand and expand to 256 bit width
shuffle.value = llvm::ConstantDataVector::get(m_context, llvm::makeArrayRef(reinterpret_cast<const u8*>(&mask32), 32));
shuffle.value = llvm::ConstantDataVector::get(m_context, llvm::ArrayRef(reinterpret_cast<const u8*>(&mask32), 32));
shuffle.value = m_ir->CreateZExt(shuffle.value, get_type<u32[32]>());
intermediate.value = m_ir->CreateShuffleVector(data0, data1, shuffle.value);
@@ -3541,22 +3601,23 @@ public:
intermediate.value = m_ir->CreateCall(get_intrinsic(llvm::Intrinsic::x86_avx512_permvar_qi_256), {intermediate.value, shuffleindex.value});
// convert the 256 bit vector back to 128 bits
result.value = llvm::ConstantDataVector::get(m_context, llvm::makeArrayRef(reinterpret_cast<const u8*>(&mask16), 16));
result.value = llvm::ConstantDataVector::get(m_context, llvm::ArrayRef(reinterpret_cast<const u8*>(&mask16), 16));
result.value = m_ir->CreateZExt(result.value, get_type<u32[16]>());
result.value = m_ir->CreateShuffleVector(intermediate.value, zeroes32, result.value);
return result;
}
template <typename T>
llvm::Value* load_const(llvm::GlobalVariable* g, llvm::Value* i)
{
return m_ir->CreateLoad(m_ir->CreateGEP(g, {m_ir->getInt64(0), m_ir->CreateZExtOrTrunc(i, get_type<u64>())}));
return m_ir->CreateLoad(get_type<T>(), m_ir->CreateGEP(g->getValueType(), g, {m_ir->getInt64(0), m_ir->CreateZExtOrTrunc(i, get_type<u64>())}));
}
template <typename T, typename I>
value_t<T> load_const(llvm::GlobalVariable* g, I i)
{
value_t<T> result;
result.value = load_const(g, i.eval(m_ir));
result.value = load_const<T>(g, i.eval(m_ir));
return result;
}
@@ -3566,6 +3627,18 @@ public:
template <typename T = v128>
llvm::Constant* make_const_vector(T, llvm::Type*, u32 = __builtin_LINE());
template <typename T>
llvm::KnownBits get_known_bits(T a)
{
return llvm::computeKnownBits(a.eval(m_ir), m_module->getDataLayout());
}
template <typename T>
llvm::KnownBits kbc(T value)
{
return llvm::KnownBits::makeConstant(llvm::APInt(sizeof(T) * 8, u64(value)));
}
private:
// Custom intrinsic table
std::unordered_map<std::string_view, std::function<llvm::Value*(llvm::CallInst*)>> m_intrinsics;
@@ -3635,7 +3708,7 @@ public:
if (cv || llvm::isa<llvm::ConstantAggregateZero>(c))
{
llvm::Value* r = nullptr;
r = llvm::ConstantDataVector::get(ir->getContext(), llvm::makeArrayRef(reinterpret_cast<const u8*>(&mask), 16));
r = llvm::ConstantDataVector::get(ir->getContext(), llvm::ArrayRef(reinterpret_cast<const u8*>(&mask), 16));
r = ir->CreateZExt(r, llvm_value_t<u32[16]>::get_type(ir->getContext()));
r = ir->CreateShuffleVector(args[0], zeros, r);
return r;
@@ -3646,6 +3719,13 @@ public:
});
}
// (m << 3) >= 0 ? a : b
template <typename T, typename U, typename V>
static auto select_by_bit4(T&& m, U&& a, V&& b)
{
return llvm_calli<u8[16], T, U, V>{"any_select_by_bit4", {std::forward<T>(m), std::forward<U>(a), std::forward<V>(b)}};
}
template <typename T, typename = std::enable_if_t<std::is_same_v<llvm_common_t<T>, f32[4]>>>
static auto fre(T&& a)
{
+1 -1
View File
@@ -34,7 +34,7 @@ class error_code
{
}
public:
public:
// Implementation must be provided independently
static s32 error_report(s32 result, const logs::message* channel, const char* fmt, const fmt_type_info* sup, const u64* args);
+1 -1
View File
@@ -8,7 +8,7 @@
#include <thread>
// SONIC THE HEDGEDOG: a fix for a race condition between SPUs and PPUs causing missing graphics (SNR is overriden when non-empty)
// SONIC THE HEDGEDOG: a fix for a race condition between SPUs and PPUs causing missing graphics (SNR is overriden when non-empty)
void WaitForSPUsToEmptySNRs(ppu_thread& ppu, u32 spu_id, u32 snr_mask)
{
ppu.state += cpu_flag::wait;
+59 -24
View File
@@ -1,7 +1,7 @@
#include "stdafx.h"
#include "Emu/System.h"
#include "Emu/system_config.h"
#include "Emu/Cell/PPUModule.h"
#include "Emu/Cell/lv2/sys_process.h"
#include "Emu/Cell/lv2/sys_event.h"
#include "cellAudio.h"
@@ -274,8 +274,8 @@ void audio_ringbuffer::process_resampled_data()
{
if (!cfg.time_stretching_enabled) return;
const auto samples = resampler.get_samples(static_cast<u32>(cb_ringbuf.get_free_size() / (cfg.audio_sample_size * static_cast<u32>(cfg.backend_ch_cnt))));
commit_data(samples.first, samples.second);
const auto [buffer, samples] = resampler.get_samples(static_cast<u32>(cb_ringbuf.get_free_size() / (cfg.audio_sample_size * static_cast<u32>(cfg.backend_ch_cnt))));
commit_data(buffer, samples);
}
void audio_ringbuffer::commit_data(f32* buf, u32 sample_cnt)
@@ -455,7 +455,7 @@ std::tuple<u32, u32, u32, u32> cell_audio_thread::count_port_buffer_tags()
u32 untouched = 0;
u32 incomplete = 0;
for (auto& port : ports)
for (audio_port& port : ports)
{
if (port.state != audio_port_state::started) continue;
active++;
@@ -526,7 +526,7 @@ std::tuple<u32, u32, u32, u32> cell_audio_thread::count_port_buffer_tags()
void cell_audio_thread::reset_ports(s32 offset)
{
// Memset buffer to 0 and tag
for (auto& port : ports)
for (audio_port& port : ports)
{
if (port.state != audio_port_state::started) continue;
@@ -548,7 +548,7 @@ void cell_audio_thread::advance(u64 timestamp)
// update ports
reset_ports(0);
for (auto& port : ports)
for (audio_port& port : ports)
{
if (port.state != audio_port_state::started) continue;
@@ -572,12 +572,11 @@ void cell_audio_thread::advance(u64 timestamp)
// send aftermix event (normal audio event)
std::array<std::shared_ptr<lv2_event_queue>, MAX_AUDIO_EVENT_QUEUES> queues;
std::array<u64, MAX_AUDIO_EVENT_QUEUES> event_sources;
u32 queue_count = 0;
event_period++;
for (const auto& key_inf : keys)
for (const key_info& key_inf : keys)
{
if (key_inf.flags & CELL_AUDIO_EVENTFLAG_NOMIX)
{
@@ -607,6 +606,7 @@ void cell_audio_thread::advance(u64 timestamp)
}
event_sources[queue_count] = key_inf.source;
event_data3[queue_count] = (key_inf.flags & CELL_AUDIO_EVENTFLAG_BEFOREMIX) ? key_inf.source : 0;
queue_count++;
}
}
@@ -616,7 +616,7 @@ void cell_audio_thread::advance(u64 timestamp)
for (u32 i = 0; i < queue_count; i++)
{
lv2_obj::notify_all_t notify;
queues[i]->send(event_sources[i], 0, 0, 0);
queues[i]->send(event_sources[i], CELL_AUDIO_EVENT_MIX, 0, event_data3[i]);
}
}
@@ -648,9 +648,9 @@ namespace audio
if (auto& g_audio = g_fxo->get<cell_audio>(); g_fxo->is_init<cell_audio>())
{
// Only reboot the audio renderer if a relevant setting changed
const auto new_raw = get_raw_config();
const cell_audio_config::raw_config new_raw = get_raw_config();
if (const auto raw = g_audio.cfg.raw;
if (const cell_audio_config::raw_config raw = g_audio.cfg.raw;
force_reset ||
raw.audio_device != new_raw.audio_device ||
raw.desired_buffer_duration != new_raw.desired_buffer_duration ||
@@ -735,7 +735,7 @@ void cell_audio_thread::operator()()
{
loop_count++;
const auto update_req = m_update_configuration.observe();
const audio_backend_update update_req = m_update_configuration.observe();
if (update_req != audio_backend_update::NONE)
{
cellAudio.warning("Updating cell_audio_thread configuration");
@@ -758,7 +758,15 @@ void cell_audio_thread::operator()()
continue;
}
// TODO: send beforemix event (in ~2,6 ms before mixing)
// TODO: (no idea how much of this is already implemented)
// The hardware heartbeat interval of libaudio is ~5.3ms.
// As soon as one interval starts, libaudio waits for ~2.6ms (half of the interval) before it mixes the audio.
// There are 2 different types of games:
// - Normal games:
// Once the audio was mixed, we send the CELL_AUDIO_EVENT_MIX event and the game can process audio.
// - Latency sensitive games:
// If CELL_AUDIO_EVENTFLAG_BEFOREMIX is specified, we immediately send the CELL_AUDIO_EVENT_MIX event and the game can process audio.
// We then have to wait for a maximum of ~2.6ms for cellAudioSendAck and then mix immediately.
const u64 time_since_last_period = timestamp - m_last_period_end;
@@ -1057,7 +1065,7 @@ void cell_audio_thread::mix(float* out_buffer, s32 offset)
std::memset(out_buffer, 0, out_buffer_sz * sizeof(float));
// mixing
for (auto& port : ports)
for (audio_port& port : ports)
{
if (port.state != audio_port_state::started) continue;
@@ -1070,7 +1078,7 @@ void cell_audio_thread::mix(float* out_buffer, s32 offset)
// spread port volume changes over 13ms
auto step_volume = [master_volume, &m](audio_port& port)
{
const auto param = port.level_set.load();
const audio_port::level_set_t param = port.level_set.load();
if (param.inc != 0.0f)
{
@@ -1180,11 +1188,11 @@ void cell_audio_thread::mix(float* out_buffer, s32 offset)
void cell_audio_thread::finish_port_volume_stepping()
{
// part of cellAudioSetPortLevel functionality
for (auto& port : ports)
for (audio_port& port : ports)
{
if (port.state != audio_port_state::started) continue;
const auto param = port.level_set.load();
const audio_port::level_set_t param = port.level_set.load();
port.level = param.value;
port.level_set.compare_and_swap(param, { param.value, 0.0f });
}
@@ -1312,7 +1320,7 @@ error_code cellAudioPortOpen(vm::ptr<CellAudioPortParam> audioParam, vm::ptr<u32
}
// Open audio port
const auto port = g_audio.open_port();
audio_port* port = g_audio.open_port();
if (!port)
{
@@ -1373,7 +1381,7 @@ error_code cellAudioGetPortConfig(u32 portNum, vm::ptr<CellAudioPortConfig> port
portConfig->readIndexAddr = port.index;
switch (auto state = port.state.load())
switch (audio_port_state state = port.state.load())
{
case audio_port_state::closed:
portConfig->status = CELL_AUDIO_STATUS_CLOSE;
@@ -1414,7 +1422,7 @@ error_code cellAudioPortStart(u32 portNum)
return CELL_AUDIO_ERROR_PARAM;
}
switch (auto state = g_audio.ports[portNum].state.compare_and_swap(audio_port_state::opened, audio_port_state::started))
switch (audio_port_state state = g_audio.ports[portNum].state.compare_and_swap(audio_port_state::opened, audio_port_state::started))
{
case audio_port_state::closed: return CELL_AUDIO_ERROR_PORT_NOT_OPEN;
case audio_port_state::started: return CELL_AUDIO_ERROR_PORT_ALREADY_RUN;
@@ -1441,7 +1449,7 @@ error_code cellAudioPortClose(u32 portNum)
return CELL_AUDIO_ERROR_PARAM;
}
switch (auto state = g_audio.ports[portNum].state.exchange(audio_port_state::closed))
switch (audio_port_state state = g_audio.ports[portNum].state.exchange(audio_port_state::closed))
{
case audio_port_state::closed: return CELL_AUDIO_ERROR_PORT_NOT_OPEN;
case audio_port_state::started: return CELL_OK;
@@ -1468,7 +1476,7 @@ error_code cellAudioPortStop(u32 portNum)
return CELL_AUDIO_ERROR_PARAM;
}
switch (auto state = g_audio.ports[portNum].state.compare_and_swap(audio_port_state::started, audio_port_state::opened))
switch (audio_port_state state = g_audio.ports[portNum].state.compare_and_swap(audio_port_state::started, audio_port_state::opened))
{
case audio_port_state::closed: return CELL_AUDIO_ERROR_PORT_NOT_RUN;
case audio_port_state::started: return CELL_OK;
@@ -1679,7 +1687,13 @@ error_code AudioSetNotifyEventQueue(u64 key, u32 iFlags)
}
// Set unique source associated with the key
g_audio.keys.push_back({g_audio.event_period, iFlags, ((process_getpid() + u64{}) << 32) + lv2_event_port::id_base + (g_audio.key_count++ * lv2_event_port::id_step), std::move(q)});
g_audio.keys.push_back({
.start_period = g_audio.event_period,
.flags = iFlags,
.source = ((process_getpid() + u64{}) << 32) + lv2_event_port::id_base + (g_audio.key_count++ * lv2_event_port::id_step),
.ack_timestamp = 0,
.port = std::move(q)
});
g_audio.key_count %= lv2_event_port::id_count;
return CELL_OK;
@@ -1911,7 +1925,28 @@ error_code cellAudioMiscSetAccessoryVolume(u32 devNum, float volume)
error_code cellAudioSendAck(u64 data3)
{
cellAudio.todo("cellAudioSendAck(data3=0x%llx)", data3);
cellAudio.trace("cellAudioSendAck(data3=0x%llx)", data3);
auto& g_audio = g_fxo->get<cell_audio>();
std::unique_lock lock(g_audio.mutex);
if (!g_audio.init)
{
return CELL_AUDIO_ERROR_NOT_INIT;
}
// TODO: error checks
for (cell_audio_thread::key_info& k : g_audio.keys)
{
if (k.source == data3)
{
k.ack_timestamp = get_system_time();
break;
}
}
return CELL_OK;
}
+4 -1
View File
@@ -389,12 +389,15 @@ public:
u32 key_count = 0;
u8 event_period = 0;
std::array<u64, MAX_AUDIO_EVENT_QUEUES> event_sources{};
std::array<u64, MAX_AUDIO_EVENT_QUEUES> event_data3{};
struct key_info
{
u8 start_period = 0; // Starting event_period
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
};
@@ -427,5 +430,5 @@ using cell_audio = named_thread<cell_audio_thread>;
namespace audio
{
cell_audio_config::raw_config get_raw_config();
void configure_audio(bool force_reset = false);
extern void configure_audio(bool force_reset = false);
}
+1
View File
@@ -3,6 +3,7 @@
#include "Emu/Cell/lv2/sys_rsxaudio.h"
#include "Emu/IdManager.h"
#include "Emu/System.h"
#include "Emu/system_config.h"
#include "Loader/PSF.h"
#include "cellAudioOut.h"
+61 -15
View File
@@ -5,10 +5,13 @@
#include "Emu/RSX/rsx_utils.h"
#include "Utilities/StrUtil.h"
#include "cellMic.h"
#include "cellAudioIn.h"
#include "cellAudioOut.h"
#include "cellVideoOut.h"
#include <optional>
LOG_CHANNEL(cellAvconfExt);
template<>
@@ -34,9 +37,12 @@ void fmt_class_string<CellAudioInError>::format(std::string& out, u64 arg)
struct avconf_manager
{
shared_mutex mutex;
std::vector<CellAudioInDeviceInfo> devices;
CellAudioInDeviceMode inDeviceMode = CELL_AUDIO_IN_SINGLE_DEVICE_MODE; // TODO: use somewhere
void copy_device_info(u32 num, vm::ptr<CellAudioInDeviceInfo> info);
void copy_device_info(u32 num, vm::ptr<CellAudioInDeviceInfo> info) const;
std::optional<CellAudioInDeviceInfo> get_device_info(vm::cptr<char> name) const;
avconf_manager();
@@ -49,7 +55,8 @@ avconf_manager::avconf_manager()
{
u32 curindex = 0;
auto mic_list = fmt::split(g_cfg.audio.microphone_devices.to_string(), {"@@@"});
const std::vector<std::string> mic_list = fmt::split(g_cfg.audio.microphone_devices.to_string(), {"@@@"});
if (!mic_list.empty())
{
switch (g_cfg.audio.microphone_type)
@@ -131,20 +138,24 @@ avconf_manager::avconf_manager()
}
}
void avconf_manager::copy_device_info(u32 num, vm::ptr<CellAudioInDeviceInfo> info)
void avconf_manager::copy_device_info(u32 num, vm::ptr<CellAudioInDeviceInfo> info) const
{
memset(info.get_ptr(), 0, sizeof(CellAudioInDeviceInfo));
ensure(num < devices.size());
*info = devices[num];
}
info->portType = devices[num].portType;
info->availableModeCount = devices[num].availableModeCount;
info->state = devices[num].state;
info->deviceId = devices[num].deviceId;
info->type = devices[num].type;
info->availableModes[0].type = devices[num].availableModes[0].type;
info->availableModes[0].channel = devices[num].availableModes[0].channel;
info->availableModes[0].fs = devices[num].availableModes[0].fs;
info->deviceNumber = devices[num].deviceNumber;
strcpy_trunc(info->name, devices[num].name);
std::optional<CellAudioInDeviceInfo> avconf_manager::get_device_info(vm::cptr<char> name) const
{
for (const CellAudioInDeviceInfo& device : devices)
{
if (strncmp(device.name, name.get_ptr(), sizeof(device.name)) == 0)
{
return device;
}
}
return std::nullopt;
}
error_code cellAudioOutUnregisterDevice(u32 deviceNumber)
@@ -199,6 +210,7 @@ error_code cellAudioInGetDeviceInfo(u32 deviceNumber, u32 deviceIndex, vm::ptr<C
}
auto& av_manager = g_fxo->get<avconf_manager>();
std::lock_guard lock(av_manager.mutex);
if (deviceNumber >= av_manager.devices.size())
return CELL_AUDIO_OUT_ERROR_DEVICE_NOT_FOUND;
@@ -273,6 +285,7 @@ error_code cellAudioInGetAvailableDeviceInfo(u32 count, vm::ptr<CellAudioInDevic
}
auto& av_manager = g_fxo->get<avconf_manager>();
std::lock_guard lock(av_manager.mutex);
u32 num_devices_returned = std::min<u32>(count, ::size32(av_manager.devices));
@@ -281,6 +294,15 @@ error_code cellAudioInGetAvailableDeviceInfo(u32 count, vm::ptr<CellAudioInDevic
av_manager.copy_device_info(index, device_info + index);
}
CellAudioInDeviceInfo disconnected_device{};
disconnected_device.state = CELL_AUDIO_OUT_DEVICE_STATE_UNAVAILABLE;
disconnected_device.deviceNumber = 0xff;
for (u32 index = num_devices_returned; index < count; index++)
{
device_info[index] = disconnected_device;
}
return not_an_error(num_devices_returned);
}
@@ -355,6 +377,11 @@ error_code cellAudioInSetDeviceMode(u32 deviceMode)
return CELL_AUDIO_IN_ERROR_ILLEGAL_PARAMETER;
}
auto& av_manager = g_fxo->get<avconf_manager>();
std::lock_guard lock(av_manager.mutex);
av_manager.inDeviceMode = static_cast<CellAudioInDeviceMode>(deviceMode);
return CELL_OK;
}
@@ -368,12 +395,31 @@ error_code cellAudioInRegisterDevice(u64 deviceType, vm::cptr<char> name, vm::pt
return CELL_AUDIO_IN_ERROR_ILLEGAL_PARAMETER;
}
return not_an_error(0); // device number
auto& av_manager = g_fxo->get<avconf_manager>();
const std::lock_guard lock(av_manager.mutex);
std::optional<CellAudioInDeviceInfo> info = av_manager.get_device_info(name);
if (!info || !memchr(info->name, '\0', sizeof(info->name)))
{
// TODO
return CELL_AUDIO_IN_ERROR_DEVICE_NOT_FOUND;
}
auto& mic_thr = g_fxo->get<mic_thread>();
const std::lock_guard mic_lock(mic_thr.mutex);
const u32 device_number = mic_thr.register_device(info->name);
return not_an_error(device_number);
}
error_code cellAudioInUnregisterDevice(u32 deviceNumber)
{
cellAvconfExt.todo("cellAudioInUnregisterDevice(deviceNumber=0x%x)", deviceNumber);
auto& mic_thr = g_fxo->get<mic_thread>();
const std::lock_guard lock(mic_thr.mutex);
mic_thr.unregister_device(deviceNumber);
return CELL_OK;
}
@@ -391,7 +437,7 @@ error_code cellVideoOutGetScreenSize(u32 videoOut, vm::ptr<f32> screenSize)
return CELL_VIDEO_OUT_ERROR_UNSUPPORTED_VIDEO_OUT;
}
if (g_cfg.video.enable_3d)
if (g_cfg.video.stereo_render_mode != stereo_render_mode_options::disabled)
{
// Return Playstation 3D display value
// Some games call this function when 3D is enabled
+31 -34
View File
@@ -2,6 +2,7 @@
#include "cellCamera.h"
#include "Emu/System.h"
#include "Emu/system_config.h"
#include "Emu/Cell/PPUModule.h"
#include "Emu/Cell/lv2/sys_event.h"
#include "Emu/IdManager.h"
@@ -147,7 +148,7 @@ void camera_context::save(utils::serial& ar)
GET_OR_USE_SERIALIZATION_VERSION(ar.is_writing(), cellCamera);
ar(notify_data_map, start_timestamp, read_mode, is_streaming, is_attached, is_open, info, attr, frame_num);
ar(notify_data_map, start_timestamp_us, read_mode, is_streaming, is_attached, is_open, info, attr, frame_num);
}
static bool check_dev_num(s32 dev_num)
@@ -1268,7 +1269,7 @@ error_code cellCameraStart(s32 dev_num)
// TODO: Yet another CELL_CAMERA_ERROR_TIMEOUT
g_camera.start_timestamp = get_guest_system_time();
g_camera.start_timestamp_us = get_guest_system_time();
g_camera.is_streaming = true;
return CELL_OK;
@@ -1372,7 +1373,7 @@ error_code cellCameraReadEx(s32 dev_num, vm::ptr<CellCameraReadEx> read)
return CELL_CAMERA_ERROR_DEVICE_NOT_FOUND;
}
g_camera.bytes_read = bytes_read;
g_camera.bytes_read = ::narrow<u32>(bytes_read);
cellCamera.trace("cellCameraRead: frame_number=%d, width=%d, height=%d. bytes_read=%d (passed to game: frame=%d, bytesread=%d)",
frame_number, width, height, bytes_read, read ? read->frame.get() : 0, read ? read->bytesread.get() : 0);
@@ -1385,18 +1386,18 @@ error_code cellCameraReadEx(s32 dev_num, vm::ptr<CellCameraReadEx> read)
if (has_new_frame)
{
g_camera.frame_timestamp = (get_guest_system_time() - g_camera.start_timestamp);
g_camera.frame_timestamp_us = get_guest_system_time() - g_camera.start_timestamp_us;
}
if (read) // NULL returns CELL_OK
{
read->timestamp = g_camera.frame_timestamp;
read->timestamp = g_camera.frame_timestamp_us;
read->frame = g_camera.frame_num;
read->bytesread = g_camera.bytes_read;
auto& shared_data = g_fxo->get<gem_camera_shared>();
shared_data.frame_timestamp.store(read->timestamp);
shared_data.frame_timestamp_us.store(read->timestamp);
}
return CELL_OK;
@@ -1646,11 +1647,7 @@ void camera_context::operator()()
else
{
std::lock_guard lock(mutex);
Emu.BlockingCallFromMainThread([&]()
{
send_frame_update_event = handler ? on_handler_state(handler->get_state()) : true;
});
send_frame_update_event = !handler || on_handler_state(handler->get_state());
}
}
@@ -1672,7 +1669,7 @@ void camera_context::operator()()
const u64 camera_id = 0;
data2 = image_data_size << 32 | buffer_number << 16 | camera_id;
data3 = get_guest_system_time() - start_timestamp; // timestamp
data3 = get_guest_system_time() - start_timestamp_us; // timestamp
}
else // CELL_CAMERA_READ_FUNCCALL, also default
{
@@ -1714,26 +1711,21 @@ void camera_context::operator()()
bool camera_context::open_camera()
{
bool result = true;
Emu.BlockingCallFromMainThread([&result, this]()
Emu.BlockingCallFromMainThread([this]()
{
handler.reset();
handler = Emu.GetCallbacks().get_camera_handler();
if (handler)
{
handler->open_camera();
result = on_handler_state(handler->get_state());
}
});
return result;
return !handler || on_handler_state(handler->get_state());
}
bool camera_context::start_camera()
{
bool result = true;
if (handler)
{
handler->set_mirrored(!!attr[CELL_CAMERA_MIRRORFLAG].v1);
@@ -1741,29 +1733,25 @@ bool camera_context::start_camera()
handler->set_resolution(info.width, info.height);
handler->set_format(info.format, info.bytesize);
Emu.BlockingCallFromMainThread([&result, this]()
Emu.BlockingCallFromMainThread([this]()
{
handler->start_camera();
result = on_handler_state(handler->get_state());
});
return on_handler_state(handler->get_state());
}
return result;
return true;
}
bool camera_context::get_camera_frame(u8* dst, u32& width, u32& height, u64& frame_number, u64& bytes_read)
{
bool result = true;
if (handler)
{
Emu.BlockingCallFromMainThread([&]()
{
result = on_handler_state(handler->get_image(dst, info.bytesize, width, height, frame_number, bytes_read));
});
return on_handler_state(handler->get_image(dst, info.bytesize, width, height, frame_number, bytes_read));
}
return result;
return true;
}
void camera_context::stop_camera()
@@ -1801,7 +1789,7 @@ void camera_context::reset_state()
pbuf_locked[0] = false;
pbuf_locked[1] = false;
has_new_frame = false;
frame_timestamp = 0;
frame_timestamp_us = 0;
bytes_read = 0;
if (info.buffer)
@@ -1915,13 +1903,19 @@ bool camera_context::on_handler_state(camera_handler_base::camera_handler_state
if (is_streaming)
{
cellCamera.warning("Camera closed or disconnected (state=%d). Trying to start camera...", static_cast<int>(state));
handler->open_camera();
handler->start_camera();
Emu.BlockingCallFromMainThread([&]()
{
handler->open_camera();
handler->start_camera();
});
}
else if (is_open)
{
cellCamera.warning("Camera closed or disconnected (state=%d). Trying to open camera...", static_cast<int>(state));
handler->open_camera();
Emu.BlockingCallFromMainThread([&]()
{
handler->open_camera();
});
}
}
return false;
@@ -1931,7 +1925,10 @@ bool camera_context::on_handler_state(camera_handler_base::camera_handler_state
if (handler && is_streaming)
{
cellCamera.warning("Camera handler not running (state=%d). Trying to start camera...", static_cast<int>(state));
handler->start_camera();
Emu.BlockingCallFromMainThread([&]()
{
handler->start_camera();
});
}
break;
}
+4 -4
View File
@@ -384,7 +384,7 @@ struct CellCameraReadEx
be_t<s32> version;
be_t<u32> frame;
be_t<u32> bytesread;
be_t<s64> timestamp;
be_t<u64> timestamp; // system_time_t (microseconds)
vm::bptr<u8> pbuf;
};
@@ -422,7 +422,7 @@ public:
shared_mutex mutex;
shared_mutex mutex_notify_data_map;
u64 start_timestamp = 0;
u64 start_timestamp_us = 0;
atomic_t<u8> read_mode{CELL_CAMERA_READ_FUNCCALL};
atomic_t<bool> is_streaming{false};
@@ -444,7 +444,7 @@ public:
attr_t attr[500]{};
atomic_t<bool> has_new_frame = false;
atomic_t<u32> frame_num = 0;
atomic_t<u32> frame_timestamp = 0;
atomic_t<u64> frame_timestamp_us = 0;
atomic_t<u32> bytes_read = 0;
atomic_t<u8> init = 0;
@@ -471,7 +471,7 @@ using camera_thread = named_thread<camera_context>;
/// Shared data between cellGem and cellCamera
struct gem_camera_shared
{
atomic_t<s64> frame_timestamp{}; // latest read timestamp from cellCamera (cellCameraRead(Ex))
atomic_t<u64> frame_timestamp_us{}; // latest read timestamp from cellCamera (cellCameraRead(Ex))
atomic_t<s32> width{640};
atomic_t<s32> height{480};
atomic_t<s32> size{0};
+11 -3
View File
@@ -466,7 +466,7 @@ error_code cellHddGameCheck(ppu_thread& ppu, u32 version, vm::cptr<char> dirName
// psf::assign(sfo, "CATEGORY", psf::string(3, "HG"));
// }
// psf::assign(sfo, "TITLE_ID", psf::string(CELL_GAME_SYSP_TITLEID_SIZE, setParam->titleId));
// psf::assign(sfo, "TITLE_ID", psf::string(TITLEID_SFO_ENTRY_SIZE, setParam->titleId));
// psf::assign(sfo, "TITLE", psf::string(CELL_GAME_SYSP_TITLE_SIZE, setParam->title));
// psf::assign(sfo, "VERSION", psf::string(CELL_GAME_SYSP_VERSION_SIZE, setParam->dataVersion));
// psf::assign(sfo, "PARENTAL_LEVEL", +setParam->parentalLevel);
@@ -990,7 +990,7 @@ error_code cellGameDataCheckCreate2(ppu_thread& ppu, u32 version, vm::cptr<char>
psf::assign(sfo, "CATEGORY", psf::string(3, "GD"));
}
psf::assign(sfo, "TITLE_ID", psf::string(CELL_GAME_SYSP_TITLEID_SIZE, setParam->titleId));
psf::assign(sfo, "TITLE_ID", psf::string(TITLEID_SFO_ENTRY_SIZE, setParam->titleId, true));
psf::assign(sfo, "TITLE", psf::string(CELL_GAME_SYSP_TITLE_SIZE, setParam->title));
psf::assign(sfo, "VERSION", psf::string(CELL_GAME_SYSP_VERSION_SIZE, setParam->dataVersion));
psf::assign(sfo, "PARENTAL_LEVEL", +setParam->parentalLevel);
@@ -1005,6 +1005,14 @@ error_code cellGameDataCheckCreate2(ppu_thread& ppu, u32 version, vm::cptr<char>
psf::assign(sfo, fmt::format("TITLE_%02d", i), psf::string(CELL_GAME_SYSP_TITLE_SIZE, setParam->titleLang[i]));
}
if (!psf::check_registry(sfo))
{
// This results in CELL_OK, broken SFO and CELL_GAMEDATA_ERROR_BROKEN on the next load
// Avoid creation for now
cellGame.error("Broken SFO paramters: %s", sfo);
return CELL_OK;
}
fs::pending_file temp(vfs::get(dir + "/PARAM.SFO"));
temp.file.write(psf::save_object(sfo));
ensure(temp.commit());
@@ -1125,7 +1133,7 @@ error_code cellGameCreateGameData(vm::ptr<CellGameSetInitParams> init, vm::ptr<c
perm.sfo =
{
{ "CATEGORY", psf::string(3, "GD") },
{ "TITLE_ID", psf::string(CELL_GAME_SYSP_TITLEID_SIZE, init->titleId) },
{ "TITLE_ID", psf::string(TITLEID_SFO_ENTRY_SIZE, init->titleId) },
{ "TITLE", psf::string(CELL_GAME_SYSP_TITLE_SIZE, init->title) },
{ "VERSION", psf::string(CELL_GAME_SYSP_VERSION_SIZE, init->version) },
};
+5
View File
@@ -216,6 +216,11 @@ enum // old consts
CELL_DISCGAME_SYSP_TITLEID_SIZE=10,
};
enum
{
TITLEID_SFO_ENTRY_SIZE = 16, // This is the true length on PS3 (TODO: Fix in more places)
};
struct CellGameDataSystemFileParam
{
char title[CELL_GAMEDATA_SYSP_TITLE_SIZE];

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