Compare commits

..

520 Commits

Author SHA1 Message Date
AniLeo 7df8258551 rpcs3_version: Bump to 0.0.10 2020-04-30 19:40:32 +01:00
Eladash 2b75df22d9 sys_event_queue: Fix ports disconnection after queue destruction 2020-04-30 18:58:42 +03:00
Eladash 37110098c7 cellAudioOut Improvements 2020-04-30 15:45:20 +03:00
Megamouse 8f0af6a6fe rsx/interpreter: merge shader settings
- merge disable_asynchronous_shader_compiler and interpreter_mode
- removes disable_asynchronous_shader_compiler setting
- Adds the resulting settings as radio buttons to the gui tab
2020-04-30 15:02:59 +03:00
kd-11 2281c4f662 Fix build 2020-04-30 15:02:59 +03:00
kd-11 2ed50ba263 rsx/interpreter: Improve instruction accuracy
- Fix DIV instruction
- Add EXP_TEX modifier
- Implement WPOS register read
- Swap 3D and Cubemap enums to match RSX ids
- Adds two extra instruction classes: flow control and packing control
- Implement remaining FP instructions with exception of the rare projected texture lookups
- Fix typo causing output color index > 0 to not work
- Fix KIL instruction
- Implement conditional vertex program writes
2020-04-30 15:02:59 +03:00
kd-11 fc5b4026e1 vk: Implement optimized pipeline cache 2020-04-30 15:02:59 +03:00
kd-11 bc5c4c9205 rsx/gl: Implement variable path interpreter for optimal performance 2020-04-30 15:02:59 +03:00
kd-11 930bc9179d rsx/interpreter: Improve instructions support
- Must statically write the gl_ClipDistance registers else you get uninitialized trash.
  This problem is more readily apparent on NVIDIA technology but even AMD is not completely immune.
2020-04-30 15:02:59 +03:00
kd-11 b4bf48c33b vk: Integrate shader interpreter 2020-04-30 15:02:59 +03:00
kd-11 0072df7f20 rsx/gl: Add basic interpreter support to OGL
- Adds basic interpreter functionality.
- Flow control and other instructions not yet implemented.
2020-04-30 15:02:59 +03:00
kd-11 65e9e568b5 config: Register shader interpreter modes 2020-04-30 15:02:59 +03:00
Nekotekina 19acf260d8 SPU DMA: Fix PUTLLUC (TSX)
Prevent edge case of missing store.
2020-04-29 15:40:41 +03:00
Eladash f4f0fb88b1 kernel explorer: Add more information about SPU/PPU threads 2020-04-29 15:32:16 +03:00
Eladash dd6825a7bd Fix sys_ppu_thread_start error checking, fix rare bug in sys_ppu_thread_create
* Correct error code to EBUSY.
* lv2_obj::awake was called even when EBSUY should be returned.
* Fix sys_ppu_thread_create for a newly created thread with the same id as ppu_thread::id_base. (can happen if main thread exited before its creation)
2020-04-29 08:58:09 +03:00
Eladash c1dc6838fa Fix sys_ppu_thread_get_priority page faults 2020-04-29 07:57:47 +03:00
Eladash 69f82a7311 Make spu_mfc_cmd fmt properly show stalled commands 2020-04-29 07:47:49 +03:00
Eladash 0db91aa56b Fix address_range start_length() constructor
Fixes an underflow when constructing start_length(0, 0).
2020-04-29 06:47:35 +03:00
Eladash 791ec95313 sys_rwlock: Do not allow SYS_SYNC_PRIORITY_INHERIT 2020-04-29 05:56:47 +03:00
Eladash 954e3f6e6c Fixup for cpu_flag::pause state check after #8114 2020-04-29 05:56:47 +03:00
Nekotekina d66bdf1653 TSC calibration improvements
Bind main thread to a single core for calibration.
Issue RDTSC after clock probing, may improve accuracy.
2020-04-29 00:09:40 +03:00
Nekotekina 76294beae1 Implement thread_ctrl::get_thread_affinity_mask() 2020-04-29 00:09:40 +03:00
Nekotekina 689419b0ca Remove test_stopped() check from ppu_load_acquire_reservation
Fixes warning.
2020-04-29 00:09:40 +03:00
Eladash 833ace1190 rsx: Fix zcull time to not time travel to the future 2020-04-28 21:07:15 +03:00
Megamouse e095eaf16e Qt: update playtime every 10 seconds 2020-04-28 19:44:09 +02:00
Eladash a505d87565 Partial revert of 3be687cd18 2020-04-28 20:20:19 +03:00
Nekotekina 98ab5d5ba2 atomic.hpp: modernize inline assembly for lock bts/btr/btc
Use flag output (requires clang 9+).
2020-04-28 18:05:32 +03:00
Nekotekina 790fd9ce14 SPU DMA: implement cmp_rdata_avx
Use technique similar to mov_rdata_avx with inline assembly.
2020-04-28 17:58:26 +03:00
Eladash 7da8ba5c15 Wait for SPU event to be received in sys_spu_thread_group_exit
Also use atomic check for group->run_state outside the mutex,
explicitly forbid group termination while we are waiting for an event to be received.
2020-04-28 14:58:17 +03:00
Eladash a9c18964b6 Add missing cpu state check sys_spu_thread_receive_event 2020-04-28 14:58:17 +03:00
Eladash fe7933b0d2 Make ESTAT consistent in sys_spu_thread_group_terminate 2020-04-28 14:58:17 +03:00
Eladash 9506676223 SPU debugger: dump Stall Stat and SRR0 2020-04-28 14:27:40 +03:00
Eladash 7d7909149f SPU: Detect reservation spinning loop 2020-04-28 14:27:40 +03:00
Eladash 3be687cd18 PPU: Fix LWARX/LDARX on TSX path 2020-04-28 14:27:40 +03:00
Eladash e423128a32 SPU: New GETLLAR technique 2020-04-28 14:27:40 +03:00
Nekotekina 3ec73b651e SPU DMA: more tuning for mov_rdata_avx
Avoid unaligned stores.
Prefer asm path if __AVX2__ is not set.
Don't emit vzeroupper if __AVX__ is set.
2020-04-27 18:05:52 +03:00
Nekotekina 4f71c570bd SPU DMA: disable memcpy path
Due to update of the alternative path (SSE/AVX)
2020-04-26 22:36:55 +03:00
Nekotekina 8ae2554505 Implement mov_rdata_avx 2020-04-26 22:36:45 +03:00
Maxim Kulyk c5d390c979 [llvm_build, msbuild] Minor refactor 2020-04-26 18:28:19 +03:00
Megamouse 8e95c0e44d evdev: add keys used by wii controller driver
I'll probably rework the current system sometime soon so that I don't have to add keys every now and then
(or I'll just add them all XD)
2020-04-25 22:55:08 +02:00
Nekotekina 58ba6d68bb Don't use std::popcount (workaround)
It seems MSVC uses POPCNT instruction when compiling for SSE2.
2020-04-25 18:01:39 +03:00
Megamouse 3788ef3e27 evdev: fixup for relax controller criteria 2020-04-25 16:37:20 +02:00
Megamouse b923eb058a Crypto: read sfo in memory instead of tmp file 2020-04-25 15:17:17 +02:00
Megamouse 773448a8f6 Crypto/Qt: check target app version for packages 2020-04-25 15:17:17 +02:00
Megamouse af854835b2 Qt: Rename some functions in settings_dialog 2020-04-25 15:17:17 +02:00
jacob1218 72ab5f05f4 change minimum audio buffer duration 2020-04-25 15:27:18 +03:00
scribam 1791bb5059 Qt: Remove "#pragma once" in a cpp file 2020-04-25 14:56:47 +03:00
scribam 3fd3bd7ca1 spu: Add some "if constexpr" 2020-04-25 14:56:47 +03:00
Megamouse 3937733182 evdev: relax controller criteria 2020-04-25 10:50:38 +02:00
Megamouse de58f19866 input: add Rock Revolution Drum Controller product info 2020-04-25 10:17:48 +02:00
Megamouse e4cb9ef7cd cellpad: add pclass_profile flags 2020-04-25 10:17:48 +02:00
Megamouse 4e6d95c5b8 Qt/input/cellpad: enable product choice 2020-04-25 10:17:48 +02:00
Eladash 256c74def2 sys_rsx: Fix error code instead of success on invalid context 2020-04-23 14:01:04 +03:00
Eladash c48ccc6f3c sys_rsx: Fix zcull bind error checking regression 2020-04-23 14:01:04 +03:00
Megamouse 18219afbf7 Qt: move rsx capture to Utilities menu 2020-04-22 21:43:03 +02:00
Megamouse 1805cb44e6 Qt: move GetBootConfirmation to gui_settings 2020-04-22 21:43:03 +02:00
Megamouse b4b8c1e4b2 Qt: Add confirmation dialogs on drag and drop 2020-04-22 21:43:03 +02:00
Megamouse 193837298b Qt: enum class drop_type 2020-04-22 21:43:03 +02:00
Megamouse 18e0b83ac9 Qt: some cleanup 2020-04-22 16:58:20 +02:00
Megamouse 1a374126e1 Qt: move GetSettingName to cfg_adapter 2020-04-22 16:58:20 +02:00
Megamouse 2b6afb6916 Qt: Add confirmation dialogs before closing games 2020-04-22 16:58:20 +02:00
Megamouse ebd92a2f2f Qt: Add Firmware Cache options to main window menu 2020-04-22 16:58:20 +02:00
Eladash 8c747bf0a2 sys_rsx: More error checks for ZCULL area binding
And clamp zcull offset to 256MB, it's unknown if only the error check clamps or it is clamped entirely.
2020-04-21 16:18:32 +01:00
Eladash b94e4247cc rsx: More strict zcull stats enabling 2020-04-21 16:18:32 +01:00
Megamouse a203ff677b settings: remove legacy settings 2020-04-20 20:56:07 +02:00
Megamouse c3af19148f settings: fix clocks scale default 2020-04-20 20:56:07 +02:00
Eladash dbce10d0e3 PPU LLVM: Fix rounding regression of FNMADDS, FNMSUBS (#8066)
* PPU LLVM: Fix rounding regression of FNMADDS, FNMSUBS
2020-04-19 20:55:26 +01:00
rxys 5101bc189e Fix FMA copypasta (#8060) 2020-04-19 19:17:19 +01:00
Eladash 5960de2e20 PPUAnalyzer: Check if TOC from OPD is a valid address 2020-04-19 10:56:42 +01:00
Eladash 1cb3bf6dab Minor fixup for unimplemented syscall args dump 2020-04-19 10:56:42 +01:00
Eladash 0bf73ba0bc PPU debugger: report functions on registers display 2020-04-19 10:56:42 +01:00
Eladash 368bd7cf02 PPU debugger: read 32-bit pointer instead of 64-bit
PPU ABI supports only 32-bit pointers in userland, also fix it to use super ptr.
2020-04-19 10:56:42 +01:00
Eladash 83c7f6f149 debugger: Rephrase "Current function" to "In function"
Takes less space which makes actual function name display a bit nicer.
Also the meaning is clearer.
2020-04-19 10:56:42 +01:00
Megamouse 2094e52d7d Crypto: add another file type for PSVita 2020-04-18 19:11:53 +02:00
Megamouse 5657363642 Crypto: move PSVita keys to key vault 2020-04-18 19:11:53 +02:00
Megamouse d35a29bbe4 Crypto: PSVita metadata and missing entry type 2020-04-18 19:11:53 +02:00
Megamouse 22d01e4d05 Crypto: interpret metadata versions 2020-04-18 19:11:53 +02:00
Megamouse 1762324702 Crypto: fix metadata variable names
header_size was just wrong, on PS3 games it just happens to match the meta offset, which is half of data_offset
PS3: meta_offset + meta_size = data_offset
PSP: meta_offset + meta_size = metadata_header_hmac_offset
PSP: metadata_header_hmac_offset + ext_data_size = data_offset
2020-04-18 19:11:53 +02:00
Megamouse e4b6de409a Crypto: fix magical type 2020-04-18 19:11:53 +02:00
Megamouse 3a6bda4d93 Crypto: read and log PSP and PSVita headers 2020-04-18 19:11:53 +02:00
Megamouse 3b9dc29781 Crypto: add log verbosity to pkg installations
also enables installation with one more filetype
2020-04-18 19:11:53 +02:00
Eladash 6210507a37 sys_rsx: Fix tiles on MAIN memory error checking 2020-04-18 10:20:03 +03:00
Megamouse 0df6c41556 Qt: move code from emu_settings to config_adapter 2020-04-17 15:46:46 +02:00
Megamouse 7ba5f1f503 Qt: adjust max llvm thread tooltip 2020-04-17 13:30:10 +02:00
Megamouse 171367fe88 Qt: fix localization in change_microphone_type
Don't rely on localized text at all. Use the setting's index and formatted string instead
2020-04-17 13:30:10 +02:00
Megamouse ec4e8eda04 Qt: implement GetIsDynamicConfig in emu_settings
- unused at this point
2020-04-17 13:30:10 +02:00
Megamouse e361bac945 Qt: minor cleanup 2020-04-17 13:30:10 +02:00
Eladash 06d4505992 sceNp: Override k_licensee for PE game category
Co-Authored-By: AniLeo <ani-leo@outlook.com>
2020-04-17 11:41:50 +01:00
Eladash a3f2dfa232 sys_isolated_spu 2020-04-17 11:41:50 +01:00
Eladash 921b1aadfb lv2: Log all arguments of unimplemented syscalls 2020-04-17 11:41:50 +01:00
rexys 8f3b04cbd6 rsx: Fix is_fifo_idle with hle gcm 2020-04-16 12:59:19 +03:00
Nekotekina 0f6a0d2740 Expand vm::g_addr_lock to 64 bit to support ranges
Optimization.
2020-04-16 02:25:43 +03:00
Nekotekina c7fe8567b8 Experimental squashing of reservation memory area.
Enables trivial synchronization between shared mem.
Reduces memory usage, but potentially degrades performance.
Rename an overload of vm::passive_lock to vm::range_lock.
2020-04-16 02:25:43 +03:00
Eladash 8cb1f4fe26 liblv2 HLE: Fix spu_elf_info loader for SCE SPU images (#8045) 2020-04-15 21:19:46 +01:00
Megamouse cf229a8e9f some more dynamic settings 2020-04-15 18:25:25 +02:00
Nekotekina 074b9f94db Fix regression in SPU ASMJIT
Incorrect arithmetics.
2020-04-15 12:19:15 +03:00
scribam 20f53e65eb cmake: Add support for target_precompiled_headers if available 2020-04-14 23:00:51 +03:00
Nekotekina b1b67a13c6 Revert "Replace rotate utils with std::rotl" (partial)
This reverts commit 4d8bfe328b.
2020-04-14 19:45:53 +03:00
Eladash bc3b70c338 Fix ppu_rotate_mask 2020-04-14 19:10:30 +03:00
Eladash 63be05d5d3 minor ppu fixup
does not affect anything except consistency.
2020-04-14 17:09:58 +03:00
Eladash ec1e82bc9d SPU debugger: Implement blocking functions dumping 2020-04-14 17:09:58 +03:00
scribam 2e397e38a4 Typos 2020-04-14 17:06:58 +03:00
scribam 7e0bc26241 Add missing break in cheat_manager.cpp 2020-04-14 17:06:58 +03:00
scribam f37adc4188 Add fallthrough attribute 2020-04-14 17:06:58 +03:00
Nekotekina 4d8bfe328b Replace rotate utils with std::rotl
More include cleanup.
2020-04-14 16:05:58 +03:00
Nekotekina f72af2973d Replace utils::popcnt32 with std::popcount
Cleanup includes.
2020-04-14 16:05:58 +03:00
Nekotekina 032e7c0491 Replace utils::cntlz{32,64} with std::countl_zero 2020-04-14 16:05:58 +03:00
Nekotekina d0c199d455 Replace utils::cnttz{32,64} with std::countr_{zero,one}
Make #include <bit> mandatory.
2020-04-14 16:05:58 +03:00
JohnHolmesII adfc9d93c3 CI: Auto update LLVM and GLSLANG when those releases change (#8021) 2020-04-14 08:15:05 +01:00
Eladash 2dcc3255b2 Fix sys_net_bnet_sendto (#8026) 2020-04-13 18:49:12 +01:00
JohnHolmesII 167159698d Fix overloaded virtual warning 2020-04-13 14:37:11 +03:00
JohnHolmesII 4838f72e50 Prevent unecessary copy in loop 2020-04-13 14:37:11 +03:00
JohnHolmesII a8a83c9724 cellRtc: Extend before shift, per decompiled output 2020-04-13 14:37:11 +03:00
JohnHolmesII f0b1c8302a Fix order of operations warning 2020-04-13 14:37:11 +03:00
Eladash c8b8cafeec PPU: Merge reservations store functions into one 2020-04-13 14:34:37 +03:00
RipleyTom 791c0da236 Add Disney Portal to passthroughs (#8022) 2020-04-13 11:49:42 +01:00
Eladash b45d836b89 sys_net: Fix sys_net_bnet_bind page faults
+ EINVAL checks
2020-04-13 04:34:10 +01:00
Eladash 492a80f6c5 CPUThread.cpp: Minor indetation fixup 2020-04-13 04:34:10 +01:00
Eladash 8f32d44635 sys_net: Fix sys_net_bnet_sendto 2020-04-13 04:34:10 +01:00
Eladash 9fb30f130a sys_net: Fix sys_net_bnet_getsockopt
+ EINVAL checks
2020-04-13 04:34:10 +01:00
Eladash d91d420981 sys_net: EINVAL check in sys_net_bnet_listen 2020-04-13 04:34:10 +01:00
Eladash 442035c251 sys_net: EINVAL checks in sys_net_bnet_accept 2020-04-13 04:34:10 +01:00
Eladash 063902728b sys_net: EINVAL checks in sys_net_bnet_recvfrom 2020-04-13 04:34:10 +01:00
Eladash 60a63fa4b6 sys_net: Fix sys_net_bnet_getsockname page faults
+ EINVAL checks
2020-04-13 04:34:10 +01:00
Eladash 7399a3f1e9 sys_net: Fix sys_net_bnet_getpeername page faults
+ EINVAL checks
2020-04-13 04:34:10 +01:00
Eladash c4f6968aae sys_net: Fix sys_net_bnet_connect page faults
+ EINVAL checks
2020-04-13 04:34:10 +01:00
Eladash 00957ca4bf sys_net: Fix sys_net_bnet_select page faults 2020-04-13 04:34:10 +01:00
Eladash 179a9b3bf0 sys_net: Fix sys_net_bnet_poll page faults 2020-04-13 04:34:10 +01:00
Eladash 926e0467cf Another ::as_rvalue fixup 2020-04-13 04:34:10 +01:00
sampletext32 c69691f19b Fix various explicitness, laziness, hard codes 2020-04-12 17:29:42 +03:00
Nekotekina 5524cd1e75 Improve TAR loader
Don't overwrite unchanged files.
Print error if failed to overwrite.
This commit affects PS3 firmware installation.
Trying to workaround a bug where some files cannot be overwritten.
2020-04-12 16:56:21 +03:00
Nekotekina 17f3a114be Fat atomics: implement exchange() and compare_exchange()
Also includes compare_and_swap() and compare_and_swap_test().
Also includes fixes for load(), store(), and atomic_op().
2020-04-12 16:56:21 +03:00
Eladash cb14805d78 rsx fp/vp analyzers: Fix strict type aliasing and improve codegen 2020-04-12 16:48:43 +03:00
Eladash ae1ff1e96d ppu exec loader: Log TLS image information 2020-04-12 10:30:38 +01:00
Eladash c3a4e57efe Reduce log level of page fault notifications
Log current hle function.
2020-04-12 10:30:38 +01:00
Eladash bb950cbb3b vm: Fix possible IDM deadlock with Page Fault Notifications (partial) 2020-04-12 10:30:38 +01:00
Whatcookie 6b0f7a8f55 PPU LLVM: Optimize altivec FMA with 0 addend (#8013)
- When VMADDFP and VNMSUBFP are used with a constant addend of 0, they can be simplified into a single floating multiply
2020-04-12 09:52:21 +01:00
Eladash 8e61c65c0d Fixup ::as_rvalue 2020-04-11 22:55:55 +03:00
Eladash 141d62fbf9 Implement ::as_rvalue 2020-04-11 21:58:36 +03:00
Eladash e407018bb5 rsx: Write ref+get atomically
May contribute to better FIFO synchronization in some cases.
2020-04-11 21:21:15 +03:00
Eladash ff74c241c7 rsx: Fix get_optimal_blit_target_properties for local memory 2020-04-11 21:21:15 +03:00
Eladash d69bec8f59 rsx: Fix vblank thread stop regression 2020-04-11 21:21:15 +03:00
Eladash 504ba8d824 rsx: Fix grammer issue (binded -> bound) 2020-04-11 21:21:15 +03:00
Eladash 8228fa1ece sys_rsx: Warn if RSX is not idle during crucial points 2020-04-11 21:21:15 +03:00
Eladash 1f9f455801 sys_rsx: Implement error checks for Zcull/Tiles binding
* Check zcull/tiles offset if bigger than max MAIN/LOCAL size.
* Check memory mapping of offset if location is MAIN.
* Check pitch/size for 0 as coming from hw tests.
* In addition: fix 'bound' check of tiles, seem to rely on the bits location is in.
* Add locks for zcull/tiles/displaybuffer binding.
2020-04-11 21:21:15 +03:00
Eladash 5ba26e247b sys_rsx: Implement LLE cellGcmSysGetLastVBlankTime 2020-04-11 21:21:15 +03:00
Eladash 93b8f3b5db idm: Minor update to use std::static_pointer_cast 2020-04-11 10:58:24 +03:00
RainbowCookie32 11b980c9ac Show state of Accurate LLVM DFMA option in GUI for CPUs that support FMA 2020-04-11 10:48:51 +03:00
illusion df20410cf1 gui: don't allow cpu with fma support disable accurate path 2020-04-09 19:22:04 +03:00
Eladash d451a0b7b7 SPU LLVM: Improve FNMS
Should be more accurate with postive/negative zero inputs according to docs while being more optimized.
TODO: Check SPU precise interptreter.
2020-04-09 17:27:14 +03:00
Eladash 158b24ec25 SPU LLVM: Add accurate double-precision FMA support 2020-04-09 17:27:14 +03:00
Nekotekina 1b68f90e42 Tweak TSC calibration
Round to 3 digits after dot (count in MHz).
2020-04-09 16:23:33 +03:00
clienthax 765b14a8ba Implement cellRtc HLE (#7933) 2020-04-09 15:54:41 +03:00
Eladash 36fd1d0f0d rsx: Optimize transform constants load methods (#7992) 2020-04-09 15:53:43 +03:00
JohnHolmesII e8f9fd5430 CI: Unify spacing for build scripts 2020-04-09 13:02:07 +03:00
JohnHolmesII c4a21438ad CI: Maintenance
- Rename .travis dir to .ci, since it isn't just for Travis
- Convert Linux build scripts to posix sh
- Clean up some scripts per shellcheck
2020-04-09 13:02:07 +03:00
JohnHolmesII c2ae8be3eb CI: Fix facepalm bug in Azure build 2020-04-09 13:02:07 +03:00
JohnHolmesII 6fe671a5e8 CI: Prevent Azure from publishing empty files 2020-04-09 13:02:07 +03:00
Eladash cce946f10e spu: typo fix 2020-04-08 19:23:13 +03:00
Eladash c948c9305c sys_ppu_thread_create: read function descriptor immediately and save it 2020-04-08 19:23:13 +03:00
Megamouse 8c838698af Qt: fix time played 2020-04-08 19:20:41 +03:00
Eladash c0f4fb6e35 SPU debugger: dump reservation address 2020-04-08 14:35:44 +03:00
Eladash cc8f024c6c Fixup ppu/spu_thread::dump_all() 2020-04-08 14:35:44 +03:00
Megamouse 2e18df7223 Qt: fix renderer translation
move render creator to own class
2020-04-08 11:43:48 +02:00
Eladash 995fa63f4c sys_rsx: Fixup after #7978 2020-04-08 11:33:26 +03:00
RipleyTom dce81d4a66 fix AddLddPad when more than one ldd pad 2020-04-08 07:39:54 +03:00
Eladash f7536bbce0 sys_rsx: Fix gcm events spam
In realhw the events are only sent if they are masked in driver_info->handlers as well.
2020-04-07 20:43:28 +03:00
Eladash 3f48450408 sys_rsx: Minor atomicity fixes 2020-04-07 20:43:28 +03:00
Víctor "IlDucci a38d2461c9 Linguistic changes (#7917) 2020-04-07 17:10:04 +02:00
Nekotekina 6c8d844ec5 PPU LLVM: fix crash on damaged cache files 2020-04-07 16:51:35 +03:00
Nekotekina 91d80aa7b9 Implement jit_compiler::check
Instead of checking file existence (because file may be damaged).
2020-04-07 16:09:47 +03:00
Nekotekina 7939160178 Shorten SPU LLVM Worker name to SPUW.#
For debugging.
2020-04-07 15:55:30 +03:00
Nekotekina 3eabec0030 SPU: Fix SPU Precise interpreter 2020-04-07 15:42:27 +03:00
Eladash 8f3ad8b81a Fix cellGameDataCheckCreate2 error broken check (#7976) 2020-04-07 14:03:03 +03:00
Eladash 5834a466cd Fix utils::get_tsc_freq() (#7974)
Use magic static for once-initialization
2020-04-07 11:02:12 +03:00
Megamouse 4ff69dc0cd Qt: fix mic_none and move microphone creator code 2020-04-07 08:10:56 +02:00
Megamouse 4aae9a17c1 Qt: make trophy type translateable 2020-04-07 00:26:30 +02:00
Megamouse 5e6928a182 Qt: add disambiguations for settings translations
This prevents that the Qt linguist omits duplicate strings, which are actually supposed to be individually translateable.
2020-04-07 00:26:30 +02:00
Megamouse cc6a03cbd7 Qt: mic_none and enter_button_assign translations 2020-04-07 00:26:30 +02:00
Nekotekina 3c3ccdbf1e Round TSC calibration result towards speculated CPU base frequency 2020-04-07 00:10:08 +03:00
Nekotekina 15f01a1bf6 Implement TSC calibration
Try to get rough TSC frequency by sampling it.
2020-04-07 00:10:08 +03:00
Dzmitry Malyshau b6e52ad975 Fix CMake path to IOKit 2020-04-06 23:23:11 +03:00
Megamouse 2bd4485082 Qt: make cheat_type combobox translateable 2020-04-06 20:59:58 +02:00
Megamouse 96086d57fa Qt: implement EnhanceRadioButton 2020-04-06 20:59:58 +02:00
Megamouse 078c31c1da Qt: fix lupdate warnings (used for translation) 2020-04-06 20:59:58 +02:00
Megamouse 7a409af0b0 Qt: pad handlers translateable 2020-04-06 20:59:58 +02:00
Megamouse e6a6d7e9bc Qt: fix some translation nitpicks 2020-04-06 20:59:58 +02:00
Megamouse 133e897c8b Qt: make comboboxes in settings dialog translateable 2020-04-06 20:59:58 +02:00
Megamouse b1fdbc7fcc Move some format functions 2020-04-06 20:59:58 +02:00
Megamouse 89f16548f3 Qt: const, const everywhere 2020-04-06 20:59:58 +02:00
Eladash e7d5d17fd8 rsx: Adjust FIFO recovery to be a bit more merciful 2020-04-05 17:40:23 +03:00
Eladash bbbd06dcee Make vm::_test_map aware of overflow
+ remove vm::find_map 1024mb limit.
2020-04-05 17:40:23 +03:00
Silent fd09dde911 cellSearch: Change search state before invoking callbacks 2020-04-05 16:35:56 +03:00
kd-11 0b6e2b26fa rsx: Fix DST instruction
- It's the old-school distance vector, not the more modern distance() function
- There is seemingly no glsl function that maps to it directly.
2020-04-05 16:35:20 +03:00
kd-11 b301fecfd8 gl: Fix async shader compiler
- Removes glFinish hack.
- Adds proper server-side synchronization.
- Adds primary context detection to allow worker threads to be identified.
2020-04-05 16:35:20 +03:00
Eladash dc5cdb3bb4 sys_ppu_thread: reduce global memory stats after thread creation 2020-04-05 15:23:09 +03:00
Eladash 72d1efa383 rsx: Batch transform contants load methods 2020-04-05 15:21:56 +03:00
RipleyTom f36686b1a7 Always launch rpcs3.exe on restart 2020-04-05 14:27:13 +03:00
RipleyTom f33373ca1b Add Lego Dimensions Portal to usb passthroughs 2020-04-05 14:23:54 +03:00
Nekotekina ae140a1ac9 SPU LLVM: improve stack mirror format in Mega mode
Store first instruction for additional validation.
Should fix some problems.
I didn't touch ASMJIT.
2020-04-04 21:40:42 +03:00
Nekotekina 8053d2602a SPU LLVM: implement bisect helper (debugging tool)
Added two new settings: SPU LLVM Lower/Upper Bound
By manipulating values, conditionally avoid compiling programs.
It uses hash of the programs (64-bit start hash of SHA-1).
Programs which aren't compiled run with interpreter.
2020-04-04 21:38:40 +03:00
Nekotekina 18dbd788e6 SPU DisAsm: fix disasm for BINZ and similar instruction 2020-04-04 21:38:40 +03:00
Nekotekina a53d0d50b3 SPU LLVM: add alternative ROTQBY implementation
Used if SSSE3 is not available (exec_rotqby).
2020-04-04 21:38:40 +03:00
Nekotekina 7f9d41ac47 Implement cfg::uint for unsigned integers 2020-04-04 21:38:40 +03:00
Nekotekina f05e24e8e8 SPU LLVM: make LS loads/stores volatile
Fixes PS1 classics and possibly something else.
2020-04-04 21:38:40 +03:00
Megamouse cd64990558 Qt: fix nullptr 2020-04-04 21:38:26 +03:00
Eladash 0b24b09a06 sys_fs: Lock dev_hdd1 mount point at cellSysCacheClear 2020-04-04 19:36:16 +01:00
Eladash a178374052 sys_fs: Limit NPDRM FDs to 16
Co-Authored-By: Silent <cookieplmonster@users.noreply.github.com>
2020-04-04 19:36:16 +01:00
Whatcookie dd8a3eaac5 Util: Add FMA and INVARIANT_TSC detection (#7937) 2020-04-04 19:12:06 +01:00
Eladash 63080c22a3 Fix ppu_thread::dump_callstack() 2020-04-04 00:06:51 +03:00
Eladash 55baaea8e7 liblv2 HLE: Fix sys_lwcond_signal mode 3 2020-04-03 19:42:25 +03:00
Eladash 13820d6802 SPU debugger: Show channels data 2020-04-03 18:37:21 +03:00
Eladash 0beea91d5e Minor debugger fixups 2020-04-03 18:37:21 +03:00
Eladash 3f559cd86e Fix sys_cond_destroy (#7931)
Dereference cond count in sys_cond_destroy
2020-04-03 12:45:59 +03:00
Nekotekina 39796141fc Allow AppImage to spawn its own rpcs3 process for fatal error dialog (Linux) 2020-04-03 12:32:05 +03:00
illusion 7c972c8860 Add accurate PPU FMA to advanced tab (#7915) 2020-04-03 03:20:33 +01:00
Nick Renieris 2fb600e458 Qt/Debugger: Don't move entire list if it's not needed
With 4 buffer spaces at the bottom.
2020-04-03 01:36:35 +01:00
Nick Renieris 6cbb12e5cd PPUThread: String & hex previews for register pointers in register dump 2020-04-03 01:36:35 +01:00
Nick Renieris 2eea18469d Qt/Debugger: Call Stack panel 2020-04-03 01:36:35 +01:00
Nick Renieris 1113221340 Qt/MemoryViewer: Make it vertically resizable 2020-04-03 01:36:35 +01:00
Nick Renieris 9024ba69b4 Qt/Debugger: Split register misc state info to separate panels 2020-04-03 01:36:35 +01:00
Nick Renieris 1231274e0f CPUThread: Split dump() info to separate methods 2020-04-03 01:36:35 +01:00
Eladash 72c0aed4c1 rsx: Reset vertex program/constants at each boot 2020-04-02 20:42:12 +03:00
Eladash c2c5005278 rsx: Fix and improve fp program data invalidation 2020-04-02 20:42:12 +03:00
Eladash 2ed370093e rsx: Get rid of invalid_command_interrupt_raised 2020-04-02 20:42:12 +03:00
Eladash d97e9f7b4a rsx: Batch vertex program load methods 2020-04-02 20:42:12 +03:00
EmulationChannel 85c4321c24 Update FW 4.86 Latest Version
Updates the latest FW version according to: https://www.playstation.com/en-us/support/system-updates/ps3/

    What's New in Version 4.86
* This system software update improves system performance.
2020-03-31 22:37:30 +03:00
Nekotekina ba7f4af02b CFG: minor cleanup 2020-03-31 21:50:23 +03:00
kd-11 69d90f6fec vk: Remove NVIDIA workaround for broken partial occlusion queries
- This bug has been fixed in the latest drivers.
2020-03-31 20:53:12 +03:00
kd-11 8c847d3a4b vk: Remove RADV workaround regarding renderpass barriers
- The situation was clarified in the official vulkan spec to allow this
  behavior.
  Barriers are now only inserted by the driver when layout
transitions are requested.
2020-03-31 20:53:12 +03:00
kd-11 b327e329d6 vk: Avoid query log spam if no program is loaded 2020-03-31 20:53:12 +03:00
Eladash 92f821aeb1 PPU LLVM: Add FMA accuracy setting (#7874)
* PPU LLVM : Match PS3 for the instructions fmadd, fmadds, fmsub, fmsubs, fnmadd, fnmadds, fnmsub, fnmsubs

Co-authored-by: doesthisusername <yfirestorm@gmail.com>
2020-03-31 20:01:10 +03:00
Megamouse fc3a134e7d Emu: make "Silence All Logs" dynamic 2020-03-31 18:06:37 +02:00
Megamouse d6b8213c9f set key_vault log spam to trace 2020-03-31 18:06:37 +02:00
Megamouse f079eb4026 add cacert.pem to gitignore 2020-03-31 18:06:37 +02:00
Megamouse 28bea14d72 add missing files to visual studio project 2020-03-31 18:06:37 +02:00
Megamouse a76a4d8136 change sig_log to SIG 2020-03-31 18:06:37 +02:00
Eladash fdd7f0645d Some typos (#7908)
* sys_lwcond: replace writer lock with reader lock

* sys_rsx: Typo fix

* sys_net: Fixup for buffer reading
2020-03-31 16:44:50 +03:00
Eladash 29be815302 rsx: Implement DECR memory layout (#7906) 2020-03-31 05:12:30 +01:00
Eladash 1510505b30 Fix sys_rwlock_wlock timeout event 2020-03-30 14:22:15 +03:00
Jan Beich afce3ee2ed Qt: add more headers for non-Vulkan
rpcs3/rpcs3qt/emu_settings.cpp:111:44: error: use of undeclared identifier 'g_cfg'
        for (const auto& v : cfg_adapter::get_cfg(g_cfg, begin, end).to_list())
                                                  ^
rpcs3/rpcs3qt/emu_settings.cpp:262:60: error: use of undeclared identifier 'Emulator'
        fs::create_path(title_id.empty() ? fs::get_config_dir() : Emulator::GetCustomConfigDir());
                                                                  ^
rpcs3/rpcs3qt/emu_settings.cpp:276:39: error: use of undeclared identifier 'Emulator'
                const std::string config_path_new = Emulator::GetCustomConfigPath(m_title_id);
                                                    ^
rpcs3/rpcs3qt/emu_settings.cpp:277:39: error: use of undeclared identifier 'Emulator'
                const std::string config_path_old = Emulator::GetCustomConfigPath(m_title_id, true);
                                                    ^
rpcs3/rpcs3qt/emu_settings.cpp:308:17: error: use of undeclared identifier 'Emulator'
                config_name = Emulator::GetCustomConfigPath(m_title_id);
                              ^
rpcs3/rpcs3qt/emu_settings.cpp:319:21: error: use of undeclared identifier 'g_cfg'
        if (config_name == g_cfg.name || m_title_id == Emu.GetTitleID())
                           ^
rpcs3/rpcs3qt/emu_settings.cpp:319:49: error: use of undeclared identifier 'Emu'
        if (config_name == g_cfg.name || m_title_id == Emu.GetTitleID())
                                                       ^
rpcs3/rpcs3qt/emu_settings.cpp:322:3: error: use of undeclared identifier 'g_cfg'
                g_cfg.from_string(config.to_string(), true);
                ^
rpcs3/rpcs3qt/emu_settings.cpp:324:8: error: use of undeclared identifier 'Emu'
                if (!Emu.IsStopped()) // Don't spam the log while emulation is stopped. The config will be logged on boot anyway.
                     ^
rpcs3/rpcs3qt/emu_settings.cpp:326:51: error: use of undeclared identifier 'g_cfg'
                        cfg_log.notice("Updated configuration:\n%s\n", g_cfg.to_string());
                                                                       ^
2020-03-30 10:52:46 +02:00
Eladash 019aae8bec sys_net: Fix access violation handling (#7901)
Should fix page faults notifications on unmapped menory on Gran Turismo 5.
2020-03-30 05:53:17 +01:00
JohnHolmesII 6d32ebecca CI: Update Azure cache task to newer version 2020-03-29 14:10:07 +03:00
JohnHolmesII ad13075b36 Build: Fix potential issue with Windows builds not receiving correct
branch info
2020-03-29 14:10:07 +03:00
JohnHolmesII 8581a2775a CI: Add workaround for exporting variables in Azure
Using '-x' to echo commands in the shell causes
the Azure process commands to be processed twice
2020-03-29 14:10:07 +03:00
Whatcookie cc100f4008 Fix alignment on embedded spu elf searching (#7894)
- They are actually 128 byte (1024 bit) aligned.
2020-03-29 03:54:45 +01:00
Nekotekina cba9ed3527 CMake: add /MT for MSVC 2020-03-28 17:21:03 +03:00
Nekotekina dcc269128f SPU LLVM: runtime multithreaded compilation
Active for CPU with 12 or more threads.
2020-03-28 17:17:51 +03:00
Nekotekina aae338a91c named_thread_group: add a default constructor 2020-03-28 17:17:51 +03:00
Nekotekina 9db088e17b SPU LLVM: log hash in some places 2020-03-28 17:17:51 +03:00
illusion c2a24fd047 readme.md: Fix Azure Badge URL (#7888)
previously leads to RPCS3.glslang instead of RPCS3.RPCS3
2020-03-28 10:38:38 +00:00
Eladash 4215499b7f rsx: Fix typo in NV4097_SET_TRANSFORM_PROGRAM range 2020-03-28 11:07:34 +03:00
unknown 049825812e RSX: Restrict analyser loop error 2020-03-28 09:42:13 +03:00
Eladash 66bd8308d9 lv2: Wait for rescheduling before confirming timeouts (#7875) 2020-03-28 03:16:59 +00:00
xddxd d96dabcd60 rsx: Rename current_instrution to current_instruction (#7883) 2020-03-28 02:46:48 +00:00
Jan Beich 777f0a7c82 Implement IsDebuggerPresent on BSDs (#7880) 2020-03-28 01:57:41 +00:00
Jan Beich 58492ef92d build/cmake: add option to use system-wide libcurl package (#7882) 2020-03-28 00:49:31 +00:00
JohnHolmesII f5a51599d9 CD: Fix experimental build warning for Travis 2020-03-27 23:00:22 +03:00
JohnHolmesII 6712ac0a72 Build: Do not warn for local builds 2020-03-27 23:00:22 +03:00
Zion d6258fce54 Change target to the correct commit SHA on RPCS3/RPCS3-binaries-win side 2020-03-27 19:21:41 +03:00
AniLeo 4e28aa4681 azure: Fix win releases repository 2020-03-27 18:47:35 +03:00
JohnHolmesII 70d6a12894 CI: Port Windows build to Azure Pipelines (#7757)
* CI: Port Windows build to Azure Pipelines from Appveyor

* CI: Split Windows build into scripts

* CI: Remove Appveyor

* CI: Add GitHub Release deployment to Azure Windows Build

* VCS: Add full branch name function to rpcs3_version

The STRINGIZE macro was a little awkward, and difficult to control
at configure time. Since other version information is already
included, the full branch name is now added as a function. It's
runtime instead of compile-time checking, but it seems worth it.

* CI: Overhaul Windows setup script

Previously, there was no way of forcing a re-download
of cached dependencies when they were replaced by new ones. In
addition, there was really no verification of downloads or cache.
Now, changing a few lines at the top of the file will automagically
force a cache update.
2020-03-27 16:37:27 +03:00
AniLeo 96185af64f .gitignore: Ignore cmake autogen libusb files
Co-Authored-By: Eladash <elad3356p@gmail.com>
2020-03-27 15:26:28 +03:00
AniLeo c00ee7ed5b hle: cellSysutilNpEula
Add missing function names and stub all functions

Co-Authored-By: Eladash <elad3356p@gmail.com>

Co-Authored-By: Eladash <elad3356p@gmail.com>
2020-03-27 15:26:28 +03:00
RipleyTom cd4eed0704 Gives ANSI path to curl CURLOPT_CAINFO 2020-03-27 14:23:20 +03:00
dio-gh 2aac46efcc Update building instructions (#7872)
* Update building instructions

Makes the link for the prebuilt LLVM point to the `_mt` version now, since the previous one will fail to compile on latest.

* Update glslang link

Replaces the outdated not-shady-at-all link with the new, shiny and correct one.

* Fixing a 'the'

Fixes a 'the'.

Co-authored-by: Ani <ani-leo@outlook.com>
2020-03-27 10:34:13 +03:00
scribam a2bf0719ea cmake: Fix windeployqt command line for release builds (#7871) 2020-03-27 00:33:07 +00:00
Ani e8177906e7 System/Load: Handle PSP Remaster (#7857)
This just makes RPCS3 execute PSP Remaster games through 
psp_emulator.self
pspemu does not work yet, so the boot will fail, but at the least it 
starts loading
2020-03-26 20:03:00 +03:00
Nekotekina 17a9ce6fb9 Fix PS1 game_path
Don't assume local path has '/dev_hdd0' in it.
2020-03-26 18:32:42 +03:00
Eladash 36d8553f9c liblv2 HLE: Fix entryx of start/stop prx functions 2020-03-26 17:52:45 +03:00
Eladash 9d971e3b07 rsx: More strict infinite desync detection
6 desyncs per second for 1.5 seconds is pretty bad already.
2020-03-26 17:52:45 +03:00
Eladash 7ed570dc4a PPU LLVM: Add relocation 5 for ADDIS
+ Add some more for u16 relocations (4, 5, 6), simplify logic.
2020-03-26 17:52:45 +03:00
Nekotekina a5ba4a18df Fix windeployqt command line for release builds 2020-03-26 16:53:21 +03:00
Nekotekina 214a3ba21b Return Appveyor to VS 16.5 2020-03-26 16:48:44 +03:00
Maxim Kulyk 30a8cadf60 [MSVC] Remove unnecessary configurations and properly fix curl 2020-03-26 15:56:40 +03:00
Nekotekina 15a36bb844 Adjust llvm hash (affects nothing) 2020-03-26 15:29:15 +03:00
Nekotekina fa29c5aa94 ppu_iname: refactor to use actual strings 2020-03-26 15:28:41 +03:00
Nekotekina 8d1a9dce91 spu_iname: refactor to use actual strings 2020-03-26 15:26:55 +03:00
Eladash 453478c98b PPU LLVM: Log unsupported relocation opcode 2020-03-26 15:22:45 +03:00
Eladash ccc7cb7994 Log IDs of loaded prx modules 2020-03-26 15:22:45 +03:00
Eladash 38c8dd98b4 rsx: Implement basic infinite FIFO desync detection 2020-03-26 15:22:45 +03:00
Maxim Kulyk 433a21286a [appveyor] Update glslang and LLVM links 2020-03-26 15:21:53 +03:00
Maxim Kulyk ec4287cbd3 static RT 2020-03-26 15:21:53 +03:00
Maxim Kulyk e58fa7d51f Fix curl 2020-03-26 15:21:53 +03:00
Maxim Kulyk 70f1302fa7 [MSVC] Disable exceptions and spectre mitigation in common_default.props
Disabling exceptions in common_default.props ensures that all projects do not use them since not all projects import rpcs3_default.props.

Spectre mitigation is disabled by default unless WDK is installed so this is more of a just in case measure since rpcs3 does not need it.
2020-03-26 15:21:53 +03:00
Maxim Kulyk 3b9f419859 [MSVC] Added common props to llvm and glslang
common_default.props are now imported when building LLVM and glslang via MSVC.
2020-03-26 15:21:53 +03:00
Maxim Kulyk d26c465911 [MSVC] Move libcurl and wolfssl project files
libcurl and wolfssl were moved to rpcs3 source control to make buildsystem changes easier.

common_default.props and common_default_macros.props included to project files.
Int and Out Dirs changed to default:
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)\</OutDir>   <IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
2020-03-26 15:21:53 +03:00
Eladash 158e34faca rsx: Reset all method registers at rsx_state::init() 2020-03-25 17:51:59 +03:00
Eladash 768b4f8c65 rsx: Improve NV308A_COLOR
* Fix NV308A_COLOR methods range.
* Batch NV308A_COLOR methods execution together.
* Fix termination of bind_range<> in rsx methods binding.
2020-03-25 17:51:59 +03:00
Eladash 150d1bcdd5 sys_prx_unload_module: Implement CELL_PRX_ERROR_NOT_REMOVABLE 2020-03-25 16:22:47 +03:00
Eladash e1f2f3f081 sys_prx: Improve sys_prx_start/stop_module
* Add missing error codes, "internal" errors are ones which are not reachable from liblv2.sprx functions

* Implement SYS_PRX_NO_RESIDENT (unloading module) for _sys_prx_start_module.
2020-03-25 16:22:47 +03:00
Eladash 717dd1625c sys_prx: Implement sys_prx_get_module_list 2020-03-25 16:22:47 +03:00
Megamouse a11c77c009 Qt: fix mem leaks in screenshot and save managers 2020-03-25 11:50:06 +01:00
Megamouse 844f9683ec Qt: add naive lazy loading to screenshot manager 2020-03-25 11:50:06 +01:00
Megamouse f27de28ee9 Qt: add open file location to screenshot preview
Remove duplicate slash from screenshot path
2020-03-25 11:50:06 +01:00
Megamouse bd49ad358c Qt: move open_dir to qt_utils 2020-03-25 11:50:06 +01:00
Nekotekina 89514c043a Fix "Unknown option: updating" 2020-03-25 11:23:38 +03:00
Nekotekina b33648fd14 Implement SAFE_BUFFERS as __attribute__((no_stack_protector))
It was doing nothing outside of MSVC. Still seems doing nothing.
2020-03-25 11:18:48 +03:00
Nekotekina 471db3219d Finalize constexpr ppu_decoder<> thing
Move SSSE3 checks to runtime in PPUInterpreter.cpp
2020-03-25 11:18:48 +03:00
Megamouse fd3522436a overlays/osk: add more panels 2020-03-25 03:54:49 +01:00
Nekotekina 1ceb779a38 Make ppu_decoder<> objects constexpr (partial) 2020-03-24 13:46:46 +03:00
Nekotekina ecb6d38451 Roll back to VS 16.4 on Appveyor
Workaround VCRUNTIME140_1.dll dependency.
2020-03-24 12:28:20 +03:00
Nekotekina a936533eb1 Make spu_decoder<> objects constexpr 2020-03-24 12:18:37 +03:00
Eladash eb1de04ca8 _sys_lwmutex_lock: log new case of ESRCH 2020-03-23 23:18:21 +03:00
Eladash 2aff36647a Make sceNpDrmProcessExitSpawn(2) execute sys_game calls correctly 2020-03-23 23:18:21 +03:00
Nekotekina 19e20d9c19 Auto-Updater: increase lock file waiting timeout in the case of updating
Normal case: timeout reduced from 3s to 2s.
Updating case: increased timeout to 10s.
2020-03-23 22:52:05 +03:00
Nekotekina 3d78694590 Debug: measure initialization time (before main() function) 2020-03-23 22:18:45 +03:00
Eladash 52360b3f98 liblv2 HLE: Fix sys_lwmutex_lock assertation 2020-03-23 21:37:37 +03:00
Eladash 08e66ab14c Minor warning fixes 2020-03-23 21:37:37 +03:00
Eladash 3de41bfea7 _sys_lwcond_signal: Make mode 3 respect ordering of the sleep queue 2020-03-23 21:37:37 +03:00
Megamouse 1537f505a5 cellGem: fix move_handler::mouse left click 2020-03-23 15:10:01 +03:00
Nekotekina 5ebc538d7e Workaround for VS 16.5
Strange codegen bug didn't promote s32 to u64.
2020-03-23 14:48:49 +03:00
kd-11 4965bf7d7a gl/vk: Refactor draw call handling and stub shader interpreter
- Refactors backend draw call management to make it easier to extend
  functionality.
- Stubs shader interpreter functionality.
2020-03-23 14:47:28 +03:00
illusion a0509328d4 [README.md] Update to Visual C++ Redistributable 2019 2020-03-23 12:23:18 +03:00
Eladash 537f175f52 Another fixup after #7826 2020-03-23 11:54:19 +03:00
Eladash 017ef5a94e Minor fixup after #7826 2020-03-23 10:59:51 +03:00
Eladash cccc32fa9d sys_lwmutex/lwcond: track lwcond waiters (#7826)
In lwmutex destroy syscall, wait for pending waiters.
2020-03-23 10:30:17 +03:00
sL1pKn07 9de9ec1f01 Fix build with Qt 5.15+ 2020-03-23 07:23:56 +03:00
Megamouse ef10ed4499 Qt: Add basic screenshot manager 2020-03-22 23:40:55 +01:00
Megamouse b447e6f55d Qt: use simple curl wrapper to avoid some pitfalls 2020-03-22 19:16:25 +01:00
Megamouse 3c63db93ed Qt: fix double slash in updater tmp_folder 2020-03-22 19:16:25 +01:00
Megamouse da09badd8d Qt: simplify current_build in update manager 2020-03-22 19:16:25 +01:00
Megamouse 7f8d802bd5 Qt: fix log message in update manager 2020-03-22 19:16:25 +01:00
Megamouse 532215fb81 Qt: show welcome dialog before showing the app
Fixes interference with update manager
2020-03-22 19:16:25 +01:00
Megamouse 13e166084d Qt: use Localized::GetVerboseTimeByMs 2020-03-22 19:16:25 +01:00
Emmanuel Gil Peyrot 425e032a62 SPU: Copy with memcpy() instead of hand-rolled SSE2
In some very unscientific benchmark:
spu_thread::do_dma_transfer() was taking 2.27% of my CPU before, now
0.07%, while __memmove_avx_unaligned_erms() was taking 1.47% and now
2.88%, which added makes about 0.8% saved.
2020-03-22 15:51:03 +03:00
Nekotekina 5261886449 CURL_STATICLIB macro cleanup
Also move includes from headers. CURL is just void.
2020-03-22 14:13:52 +03:00
Nekotekina e606130262 Memoize and print r3-r6 under Current function in the ppu_thread::dump() 2020-03-22 14:13:52 +03:00
Megamouse 7d33ca7059 Qt: use QDateTime in update manager 2020-03-22 14:13:33 +03:00
RipleyTom af4efafae1 Remove Qt5Network Qt5OpenGL and Qt5QML dependencies 2020-03-22 13:48:43 +03:00
Megamouse 09a8974786 Qt: fix curl threads 2020-03-22 13:48:43 +03:00
RipleyTom b1d8bf754e Replace QNetwork operations with libcurl + wolfssl 2020-03-22 13:48:43 +03:00
Eladash 132c3e1c1a kernel explorer: Add information about memory containers 2020-03-22 12:41:02 +03:00
Eladash dc839e1784 lv2: Do not lose r3 data on syscalls
Allows to get the ID of the lv2 sync objects in the debugger by looking at r3's content.
2020-03-22 12:41:02 +03:00
Eladash f1cf62ac57 kernel explorer: Implement ability to view lwmutex owner 2020-03-22 12:41:02 +03:00
kd-11 12044bd8b0 rsx: Properly calculate vertex range when divisor is active
- The upper bound is to be rounded up, not down.
2020-03-22 10:57:47 +03:00
Eladash 01cafc042d cellSaveData: Ensure savedata_context members are 16-byte aligned
I saw stvx v128{0} (aligned 16-bytes store) usage on the first 16-bytes of CellSaveDataCBResult before funcStat in fw.
Also I saw 4 stw of u32{0} on it as well before funcFile, funcFixed and funcList.
So just add the resets for result before all callbacks, and make all
members of savedata_ontext 16 -byte aligned in case there are more
members guaranteed to be aligned.
2020-03-21 19:05:20 +03:00
Eladash ceaee0ec68 cellSaveData: Clear traces of setList setup from setBuf->buf, add missing memset
* Always memset 0 setBuf->buf (to bufSize) before funcStat if the direcory is not new.
* Always memset 0 setBuf->buf (to bufSize) if listGet->dirNum became non-zero (listGet->dirListNum can be zero yet memset still occurs) .
* Clear traces of setList setup before funcStat (after funcFixed/List, only if listGet->dirNum != 0, callback can hack this value and prevent the memset).
2020-03-21 19:05:20 +03:00
Eladash b6a288d383 cellSaveData: Skip directory items in savedata_get_list_item 2020-03-21 19:05:20 +03:00
Eladash ae14eb0747 Minor fix of cellUserInfoGetStat
stat == nullptr is allowed, fix invalid id error code.
2020-03-21 19:05:20 +03:00
Eladash be0e586671 cellSaveData: Add error checks for cellSaveData(User)GetListItem 2020-03-21 19:05:20 +03:00
Eladash 66916df4ae cellSaveData: Set listSet->focusPosition to LISTHEAD by default 2020-03-21 19:05:20 +03:00
Eladash fae46bf194 cellSaveData: Add CELL_SAVEDATA_ERROR_NOUSER 2020-03-21 19:05:20 +03:00
Eladash e1cb827488 PPU Precise: Fix FMADDS, FMSUBS, FNMSUBS, FNMADDS 2020-03-21 16:32:09 +03:00
Eladash 3a36b713ce Dont spam syscalls stats if emu is paused 2020-03-21 16:31:18 +03:00
Nekotekina 49d8731c1c Thread.h: fix warning 2020-03-21 13:49:41 +03:00
Nekotekina ad552c6b78 Appveyor: use previous VS 2019 image (workaround) 2020-03-21 13:20:49 +03:00
Nekotekina ebb007ecb4 Update llvm hash 2020-03-21 12:38:16 +03:00
Eladash 9acf8e283d Fix OSK thread exit condition 2020-03-21 12:37:29 +03:00
Nekotekina 7f5dd1dd62 Fix thread_base::join 2020-03-21 10:36:04 +03:00
Nekotekina c577bd2111 Implement thread_state::errored
State after calling thread emergency_exit() function.
Also default-construct thread result in this case.
2020-03-20 21:31:27 +03:00
Megamouse eb2dcaf602 Qt: fix some translation bubus 2020-03-20 01:43:08 +01:00
Megamouse fd8cda0f2b overlays/osk: fix selection after changing panels
We now try to keep the current x and y selected after panel changes.
Also change some copy to ref
2020-03-19 21:10:08 +01:00
Megamouse c63f77e3b0 overlays/osk: fix full width characters 2020-03-19 21:10:08 +01:00
Megamouse a1f70bf96e overlays/osk: do not change the preview text on empty input
This prevents that the placeholder disappears
2020-03-19 21:10:08 +01:00
Megamouse f1127f1894 overlays: implement osk panels 2020-03-19 21:10:08 +01:00
Zion Nimchuk 27367dc493 Fix clang warnings 2020-03-19 19:20:27 +03:00
Zion Nimchuk 5ba07ed50f Partially revert 6ec149d. Fixes #7799
Turns out linking with LTO still doesn't play nice with Qt.
For reference:
https://github.com/InBetweenNames/gentooLTO/issues/444
https://bugreports.qt.io/browse/QTBUG-61710
2020-03-19 19:20:27 +03:00
Eladash 1dbb5422a2 Avoid a segfault when reading ppu stack contents in debuggers
TODO: lock vm mutex.
2020-03-19 14:18:05 +03:00
Eladash a3289e9d40 Fix memory leak in rsx debugger 2020-03-19 14:18:05 +03:00
Eladash f2d6a1ff60 disasm: Improve instructions spacing 2020-03-19 14:18:05 +03:00
Eladash fd45bf5fba debugger: Force aligned memory view
Fixes a corner case viewing unaligned memory at the end of spu memory.
Also unaligned view isn't suitable for the debugger, for these purposes the memory viewer should be used instead.
2020-03-19 14:18:05 +03:00
Eladash e3668cc26c Fix a segfault in memory viewer
Also a memory leak.
2020-03-19 14:18:05 +03:00
Eladash 7139c4fbab Fix bug introduced by #7797 2020-03-19 07:22:05 +03:00
Malcolm Jestadt 0bfdc1f62e PPU LLVM: Improve VMADDFP and VNMSUBFP
- Use native FMA to emulate VMADDFP, with a fallback for processors that don't support FMA
- Use native FMA to emulate VNMSUBFP as well, but note that it differs from the emulated path with regards to negative zero
2020-03-19 06:47:16 +03:00
Eladash b11e8f8b8d Minor fix of sys_ppu_thread_yield return value
Account for a special case where threads were rotated but no context
switch was made.
2020-03-19 06:45:14 +03:00
Eladash 7be35315da Fix lv2 sys_lwcond/sys_lwmutex kernel explorer names 2020-03-19 06:45:14 +03:00
Nekotekina aa5c6c4d2b Cleanup std::is_pod usage (deprecated in C++20) 2020-03-18 18:28:46 +03:00
Nekotekina 6a2571d0e1 SPU: print current chunk hash in dump 2020-03-18 18:28:46 +03:00
Nekotekina 20f7544a8a SPU profiler: minor change
Use std::greater to sort
2020-03-18 18:28:46 +03:00
Zion Nimchuk 6ec149d8f5 Build rpcs3's AppImages with link time optimization
On the clang build we now link with lld, and on GCC we now link with Gold
2020-03-18 13:07:44 +03:00
Zion Nimchuk 2678ac6382 Change default audio backend on non-windows
FAudio is preferred, but if we didn't build with FAudio, we default to OpenAL
Also changed it to explicitly use xaudio backend on windows, rather than the static cast we had before.
2020-03-18 09:38:13 +01:00
Eladash c9b5ba4a5c BEType.h: use common initial sequance in v128
Partially obey 'strict type aliasing' rule.
2020-03-17 18:22:13 +03:00
Eladash 03a6d67c6c Log sys_lwmutex/sys_lwcond names as strings
Use std::string_view instead of creating a temporary NTS string when reading object name.
2020-03-17 18:22:13 +03:00
Eladash a9f492b605 sys_spu: Fix oops in sys_raw_spu_destroy after #7782
'id' is not the idm id, also explicitly join the thread so a situation where the thread is still active and communicating other threads (e.g via MMIO or MFC) yet its ID is removed won't happen. (logic breakage, destroyed thread can't be  active)
2020-03-17 18:22:13 +03:00
Eladash 664d606123 Add return value of sys_ppu_thread_yield 2020-03-17 18:22:13 +03:00
Eladash 00d25a191b lv2: Uncomment sys_ppu_thread_stop/restart 2020-03-17 18:22:13 +03:00
Eladash 3566faabd9 Add missing lv2_obj::sleep when joining interrupt thread 2020-03-16 21:06:33 +03:00
Eladash 7e224c5585 cellVdecClose: Followup fix to #7663
Avoid executing sys_interrupt_thread_disestablish on different ppu thread with the same ID.
2020-03-16 21:06:33 +03:00
Eladash 9e14e835e7 Fix sys_raw_spu_destroy 2020-03-16 21:06:33 +03:00
Megamouse 33d01fd252 log: properly escape all html except newlines 2020-03-15 20:41:24 +03:00
kd-11 d25ba03e82 vk: Lazy evaluate renderpass scope
- Spamming the driver with renderpass open/close cycles is bad for performance.
2020-03-15 18:39:40 +03:00
kd-11 7025985c0d rsx: Improve section scanning when updating surface cache resources in blit engine. 2020-03-15 16:51:23 +03:00
kd-11 a756c0679e rsx: Implement cross-aspect slice gathering
- Fixes a data leak that can happen when a surface is rejected due to aspect mismatch.
- Mismatch can lead to rejection due to area covered excluding the RTT and inevitable upload a texture from CPU at the same location.
- Overlapping fbo/shader_read resources are not allowed.
2020-03-15 16:51:23 +03:00
Eladash 377e06a4a2 rsx: Fix unknown Blend equation 2020-03-15 09:53:15 +03:00
Nekotekina a0612ff4a7 Disable failing OSX build on travis
Since we have Azure maybe someone will have better luck with it.
2020-03-14 23:07:40 +03:00
Nekotekina 11d5bd3452 Try to re-enable Azure Pipelines for PRs 2020-03-14 22:50:17 +03:00
Rose 231e837f9b [UI] Grey out AA and Aniso settings under strict rendering (#7773)
* Grey out AA and aniso under strict rendering

* Сhange aniso UI string to 'Auto'

Co-authored-by: Ivan <Nekotekina@users.noreply.github.com>
2020-03-14 20:45:41 +03:00
Nekotekina 45389dca51 PPU: minor fix for ppu_join_status::max
Don't treat it as special "invalid" value.
2020-03-14 20:36:56 +03:00
Eladash 4e6934c9dc Minor idm::remove_verify usage optimization in sys_interrupty.cpp
Avoid copying a shared ptr, create a weak ptr instead.
2020-03-14 19:26:37 +02:00
Eladash 74c05ec5ee PPU Disasm: Fix non-link extended BCCTR forms 2020-03-14 19:26:22 +02:00
Eladash cb4192bce9 vm: Log all guest memory bases at startup 2020-03-14 18:30:14 +02:00
Eladash 83a2204f87 PPU Disasm: Fixup BCCTR after #7775 2020-03-14 18:30:14 +02:00
Eladash c16124f0d9 idm: Fix minor race in cellVdecClose, sys_raw_spu_destroy...
Because of racing removal of IDs vs the shared pointer owned object
2020-03-14 18:30:14 +02:00
Eladash efe6e1eb0a sys_ppu_thread: Make PPU id removal after exit atomic with descheduling
* Make PPU id removal after exit atomic with descheduling
* Make joining thread scheduling atomic with thread exit sleep.
* Update sys_ppu_thread_stop/restart.
* Add idm::remove_verify.
2020-03-14 18:30:14 +02:00
Eladash c3d36940c7 cellSaveData: do not allow to read/write/delete system files in funcFile
Return param error 70 as realhw in this case.
2020-03-14 16:12:18 +03:00
Eladash ff341fe597 PPU Disasm: Fix branches spacing
Null terminator was added at the end which prevented proper spacing.
2020-03-14 16:12:18 +03:00
Eladash db71d4852a cellSaveData: Fix adding file entries to PARAM.SFO on error 2020-03-14 16:12:18 +03:00
Eladash 88ee198d78 cellSaveData: return ERROR_FAILURE on funcFile deletion failures 2020-03-14 16:12:18 +03:00
Nekotekina 9176ca084c VFS: clarify escape/unescape cannot work on paths
With recent changes, it can only work with file or directory name.
2020-03-14 16:01:55 +03:00
Nekotekina 70cd8afafa VFS: improve vfs::escape (escape NUL, LPT, COM...)
Windows legacy trash.
2020-03-14 15:07:59 +03:00
Nekotekina 6a8f5e6b38 VFS: fix vfs::get
Escape each path element separately.
2020-03-14 14:25:37 +03:00
Nekotekina 6c234b48ce VFS: Fix possible out of range in vfs::escape 2020-03-14 13:33:25 +03:00
Nekotekina bf957a575c VFS: fix out of range problem in vfs::unescape
Also improve unescape with "!" allowing any character
2020-03-14 13:15:46 +03:00
Nekotekina 0c65a1721d VFS: escape multidot names like ... 2020-03-14 12:34:28 +03:00
Eladash 5d78d81c00 cellSaveData: Filter directory lists to allowed savedata directories
Filters "." and "..", as well as possible wrong directories added by the user.
2020-03-13 22:43:27 +03:00
Eladash b21b4faca8 cellSaveData: Fixed savedata lock after fmt::throw_exception 2020-03-13 22:43:27 +03:00
Eladash d58f52ff31 cellSaveData: Add some listSet error checks
* Check listSet->fixedListNum.
* Check listSet->fixedList for nullptr and its directory items names.
* Check listSet->focusDirName for nullptr and directory name.
* Check listSet->newData->iconPosition.
* Check listSet->newData->dirName for nullptr and directory string.
* Check statSet->setParam->parental_level for old sdk.
* Return an error if listSet->focusPosition is NEWDATA and listSet->newData is nullptr.
* Simplify savedata directory list selection.
2020-03-13 22:43:27 +03:00
Eladash 54af8ec544 cellSaveData: funcFile fixes
* Allow '_' at filenames start and extension.
* Check if reading offset is valid, fix error code to CELL_SAVEDATA_ERROR_FAILURE.
* Don't create empty file on error of write ops.
* Don't allow "." and ".." filenames on funcFile, return CELL_SAVEDATA_ERROR_BROKEN.
2020-03-13 22:43:27 +03:00
Eladash fdf47f43d8 cellSaveData: refactor param error 70 checks
Also extend the check to check empty name.
2020-03-13 22:43:27 +03:00
kd-11 2ae83782e1 vk: Fix potential MTRSX deadlock in case of a race condition 2020-03-13 22:06:04 +03:00
Eladash f3877d11e8 rsx: Fix initial boolean state of m_textures_dirty and m_vertex_textures_dirty 2020-03-12 21:36:43 +01:00
Eladash 28e9cade2c GUI/rsx capture: Disable capturing if no game is running! 2020-03-12 21:36:43 +01:00
Eladash c04abac630 rsx capture: Fix exceptions handler, fix tiny race condition on capture new capture 2020-03-12 21:36:43 +01:00
kd-11 7e9dbeff7b vk: Fix MTRSX deadlock (#7766) 2020-03-12 22:29:58 +03:00
Megamouse f0edcc16fe evdev: add more buttons to button list 2020-03-12 19:43:52 +01:00
Megamouse e7adef9fe1 evdev: remove unused call to update_device 2020-03-12 19:43:52 +01:00
Megamouse 9c5da55dca evdev: Some random cleanup 2020-03-12 19:43:52 +01:00
Nekotekina d802b3d8b2 Remove -fno-strict-aliasing
It was added due to miscommunication.
2020-03-12 16:04:57 +03:00
Nekotekina 04dedb17eb Disable exception handling.
Use -fno-exceptions in cmake.
On MSVC, enable _HAS_EXCEPTION=0.
Cleanup throw/catch from the source.
Create yaml.cpp enclave because it needs exception to work.
Disable thread_local optimizations in logs.cpp (TODO).
Implement cpu_counter for cpu_threads (moved globals).
2020-03-12 16:03:08 +03:00
kd-11 47bbfdd2aa vk: Change texture cache memory management for disposed textures
- Use global resource manager instead of using the 2-frame hold behavior.
- Fixes high VRAM usage in some games
2020-03-11 16:29:34 +03:00
Nekotekina 6bd96a4590 Fix thread_base::finalize (and emergency_exit, collaterally)
Forgot to reset futex callback. Could cause crashes.
2020-03-10 23:23:32 +03:00
Nekotekina 92eeec39b7 Improve Stop Watchdog
Make it less possible to interfere with the debugger.
2020-03-10 23:00:23 +03:00
Nekotekina 656db6c668 Fatal errors: concatenate multiple args after --error
It should fix error dialogs on Windows since it decomposes the arg string.
2020-03-10 22:42:33 +03:00
kd-11 7989de9d16 vk: Properly release dma resources. 2020-03-10 22:02:02 +03:00
Megamouse 3ea94c286b input/overlays: fix premature pad interception removal
shader compilation and trophy notifications shouldn't cancel the pad interception during proper dialogs
2020-03-10 19:04:32 +01:00
Bird Egop 4e25daffa6 Explicitly rename has_512 into has_avx512 (#7751) 2020-03-10 19:21:00 +03:00
Nekotekina b4f416cb76 Fix narrow warning in ds4_pad_handler.cpp 2020-03-10 18:45:49 +03:00
Nekotekina 1678b37aa0 Use TRAP on segfault with debugger (Linux) 2020-03-10 14:06:06 +03:00
Nekotekina adfd8ab43c Break in the debugger in thread_ctrl::emergency_exit
Implement IsDebuggerPresent analog for non-Windows systems.
2020-03-10 13:28:24 +03:00
Nekotekina 87d4b14ca9 Pause only on fatal messages
Also make some access violation an error since we don't pause on it.
2020-03-10 11:26:42 +03:00
Nekotekina d3eb267ba9 Logs: add 'always' method for debugging 2020-03-10 11:23:56 +03:00
kd-11 12b73c8bdc rsx: Fix copypasta 2020-03-09 17:20:24 +03:00
Eladash 5751b77688 GUI: followup to #7347
Show "Reboot" on current running game when there's no config.
2020-03-09 16:07:14 +03:00
Eladash 636ed4a48b HLE cellGcmSys: Avoid calling sys_rsx syscalls in rsx code 2020-03-09 16:07:14 +03:00
Eladash af7cdcb5c7 Add forgotten error check in sys_spu_thread_group_connect_event 2020-03-09 16:07:14 +03:00
kd-11 2985a39d2e rsx: Rewrite async decompiler 2020-03-09 14:59:25 +03:00
Nekotekina 609c0d46af Implement stop watchdog
Shows fatal error if stopping takes more than 5s.
2020-03-09 13:20:49 +03:00
MSuih a2b6546d37 Fix framelimit/aspect ratio width 2020-03-08 21:56:48 +01:00
Nekotekina 9dca2887d8 Fixup for Emu.Pause()
Remove some reduntant calls.
Don't pause on unknown sys_fs_fcntl operation.
2020-03-08 22:03:16 +03:00
Nekotekina 6268a2d384 Improve report_fatal_error()
Previously it could cause secondary segfault on Linux.
2020-03-08 22:03:15 +03:00
Nekotekina c87beaa694 Use _wexecl on Windows
Allows original path to contain any Unicode character.
2020-03-08 20:45:34 +03:00
Nekotekina 1bbe2e9b15 Simplify report_fatal_error
Those semaphores didn't achieve anything.
Launch separate process if Qt is already initialized.
2020-03-08 20:45:34 +03:00
Nekotekina e40019354c Pause emulation on any fatal log message. 2020-03-08 20:45:34 +03:00
Nekotekina 07e1766a7c Implement thread_ctrl::emergency_exit()
Replace exception throws with this.
2020-03-08 15:11:02 +03:00
illusion0001 814c73407d overlay: set minimum update interval to 1ms 2020-03-08 15:05:42 +03:00
Eladash 5692c3de04 Fix sceNpUtilCmpNpId 2020-03-08 12:49:34 +03:00
kd-11 8214425a3c rsx: Fix framebuffer native layout for X32_FLOAT
- It was not matching the order laid out for normal textures uploaded from CPU.
2020-03-08 11:43:49 +03:00
kd-11 84a542fbce rsx: Blit engine improvements
- Detect writes to the display output memory and handle it specially.
  It already defines a known 2D region.
- Try and detect situations where raw transfers would be of benefit.
2020-03-08 10:30:13 +03:00
Megamouse ab4189998c Qt: don't create stupid default.ini file when resetting gui configs 2020-03-08 00:06:48 +01:00
Megamouse 9b672cb969 Qt: Improve tooltip areas in network tab 2020-03-08 00:06:48 +01:00
Megamouse 5f247cbedc Qt: Backup current gui config before applying another one
Also fixes some strange issues caused by the pointer
2020-03-08 00:06:48 +01:00
Megamouse 53676067fc Qt: remove gui settings default shenanigans 2020-03-08 00:06:48 +01:00
Megamouse 11bc7de0ca Qt: more code cleanup in gui files 2020-03-08 00:06:48 +01:00
Megamouse 091dcc1052 Qt: fix play button state when booting rpcs3 for the first time 2020-03-08 00:06:48 +01:00
Megamouse 934a2eb9fa Qt: some code cleanup in gui files 2020-03-08 00:06:48 +01:00
Megamouse 426643c44d Qt: Prefer currently selected game when pressing the play button
Also rename Start to Play
2020-03-08 00:06:48 +01:00
Megamouse 7dd36ff829 Qt: Fix CurrentSelectionIconPath for game grid
Fixes deselection issue when booting a game in the game grid
2020-03-08 00:06:48 +01:00
Megamouse 0c45457101 Qt: Add title and title id to button tooltips 2020-03-08 00:06:48 +01:00
Megamouse e56b3256b0 Qt: Add missing boot error dialog 2020-03-08 00:06:48 +01:00
Eladash 892f74d762 rsx: Improve frame-limiter (#7723)
* rsx: Improve frame-limiter accuracy

* lv2: Improve lv2_obj::wait_timeout response time for aborting threads

* rsx: Make stretch to display area setting dynamic

* rsx: Redefine 'auto' frame limiter to obey vblank rate

* rsx: Make frame limiter setting dynamic

* rsx: Make frame-limiter compatible with dynamic changes
2020-03-08 01:11:35 +03:00
Eladash deb6bd3e25 Atomic sys_prx_load_module_list error checks 2020-03-07 22:03:38 +03:00
Eladash 5e86ef2371 rsx: Make force cpu blit setting dynamic 2020-03-07 21:17:26 +03:00
Nekotekina e74d3c2674 Fix llvm_build.vcxproj instructions 2020-03-07 18:34:04 +03:00
kd-11 149d550f7e gl: Restore commented out line
- Byte order step was disabled for debugging and not restored
2020-03-07 17:23:25 +03:00
kd-11 70f2577b9e vk/gl: Use best-fit semantics when scanning texture cache for flippable images
- Allows sourcing flip data from the blit engine resources which avoids expensive flush and re-upload
2020-03-07 16:58:35 +03:00
kd-11 93295f7f50 vk: Fix image properties for flip temporary images to be samplable.
- In case of gamma correction or other effects, they may require shader access.
- BGRA8_UNORM is usually safe to use directly without staging memory.
2020-03-07 16:58:35 +03:00
kd-11 1725f7a34b rsx: Add anaglyph 3D filter 2020-03-07 16:58:35 +03:00
kd-11 6e3406b3f5 video: Allow selection of 3D stereo resolutions 2020-03-07 16:58:35 +03:00
Nekotekina 19107b2de5 logs.cpp: fix log format for backward compatibility
Don't add prefix for first messages.
2020-03-07 15:33:07 +03:00
Nekotekina 7599c66639 logs.cpp: print some errors if failed to create logs 2020-03-07 14:38:19 +03:00
Nekotekina b726aa5a3e logs.hpp: minor optimization for non-formatting logs
Also use single template with CharT to match fmt::format.
2020-03-07 13:52:51 +03:00
Nekotekina 12a3cdf0e8 Move Log.cpp to util/logs.cpp
Minor cleanup
2020-03-07 13:31:10 +03:00
Nekotekina e4a81b1d13 Move Log.h to util/logs.hpp 2020-03-07 12:29:23 +03:00
Nekotekina a166d3680e Don't throw on invalid whence (return fs::error::einval) 2020-03-07 11:52:54 +03:00
Nekotekina 8461a5cbe2 Add fs::error::unknown, don't throw 2020-03-07 11:22:04 +03:00
Nekotekina 66b0b78055 Logs.cpp: more code moved to main.cpp 2020-03-07 11:15:44 +03:00
Nekotekina 2209be5216 Logs: remove mem-mapped buffer and move instance lock to main.cpp
Part of the work to untangle utilities from RPCS3-specific things.
2020-03-07 10:49:09 +03:00
Eladash 1669e95870 Implement lv2_file::open()
Return accurate error codes in prx_load_module, sys_spu_image_open and overlay_load_module.
2020-03-06 21:16:46 +03:00
Nekotekina acd50eefaf Try to use designated initializers 2020-03-06 09:42:49 +03:00
Nekotekina 7514e53385 Fix SPRX/firmware installation (use a mutex) 2020-03-06 08:39:24 +03:00
Megamouse e1b4cf1557 Qt: Fix led dialog layout and use hidpi painting 2020-03-05 22:37:48 +01:00
Megamouse 9e449db0c2 Qt/Input: piggyback on existing callback for battery_level
removes ds4 timer workaround
2020-03-05 22:37:48 +01:00
Adiost f776910966 Qt/Input: new ds4 LED settings 2020-03-05 22:37:48 +01:00
Megamouse 0361184930 Fix llvm link 2020-03-05 20:33:44 +03:00
Eladash f6cf36f6a7 Fix _sys_prx_get_module_info p0pt->filename writing with 0 size 2020-03-05 18:28:56 +03:00
Nekotekina 7a8772dafa Replace std::string::npos with umax 2020-03-05 14:05:23 +03:00
Nekotekina 0a41999818 PPU LLVM: fix regression from warning fixes
Forgot that negative power is used here.
2020-03-05 11:07:40 +03:00
Megamouse f1147f70f4 Fix 7z for Debug and Release 2020-03-04 23:58:16 +01:00
Eladash 39eafc1f3b Fix Crypto/utils.cpp: extract_file_name 2020-03-05 00:31:43 +03:00
Megamouse 21b6495aaa Fix ui and sys_net warnings 2020-03-04 22:28:05 +01:00
Nekotekina Aux1 250736ece5 Fix warnings in emucore 2020-03-04 21:23:34 +03:00
Nekotekina Aux1 f2f3321952 Fix warnings in VKGSRender 2020-03-04 21:23:34 +03:00
Nekotekina Aux1 c3f3451269 Fix warnings in GLGSRender 2020-03-04 21:23:34 +03:00
kd-11 54775d91dc rsx/blit-engine: Account for a rare corner case
- It is possible to have a RTV<->DSV transfer with compatible-sized formats.
  Mark the depth size as typeless in such a situation to avoid crossing the aspect barrier with the API.
2020-03-04 21:21:59 +03:00
RipleyTom f1f5c91386 Fake PSN (#7516) 2020-03-04 13:55:35 +00:00
Eladash bb1b4bac9b Update thread_base::notify_abort() 2020-03-04 14:39:41 +03:00
Nekotekina bdbc7b5f1d PPU: use named_thread_group to compile modules
Improves internal logic by not using too many threads.
2020-03-04 14:10:38 +03:00
Nekotekina 8d847d6f1c Thread: internal cleanup
Use different, simpler algorithm in wait_for.
Although the very idea of such notifications was rotten.
2020-03-03 20:26:37 +03:00
Nekotekina d594490329 Thread: removed unused wait() with predicate.
It doesn't work this way anyway.
2020-03-03 18:33:02 +03:00
Nekotekina 6c66153372 Threads: move linux m_timer to static thread_local variable
Allows lazy allocation of the timer handle.
2020-03-03 18:33:02 +03:00
Nekotekina 5b0476e772 Update LLVM to new llvm-mirror (LLVM 11)
Use clang-cl to build LLVM on Windows.
2020-03-03 18:33:02 +03:00
Nekotekina 68f50c7035 Fix ppu_syscall_usage thread waiting
Fixed 10s hang on exit
2020-03-03 18:33:02 +03:00
Eladash 5c3d417b35 Fix cellGameDataCheck's game data creation with PARAM.SFO set/get 2020-03-03 18:31:43 +03:00
Nekotekina 01db83bc36 SPU LLVM: Rewrite fma32x4 to match FM and older asmjit stuff 2020-03-03 11:31:20 +03:00
Eladash de1774d8f2 cellSaveData: fix doneGet->sizeKB (#7674)
* cellSaveData: fix doneGet->sizeKB

* [⚠️] Warning: beware of typos [⚠️]
2020-03-03 11:24:49 +03:00
Zion Nimchuk 0f1fd059fc Properly setup Azure Pipelines using current system
Also sets up Azure artifacts (including for PRs) for AppImages
2020-03-03 10:39:30 +03:00
JohnHolmesII 87c8d1800b Azure (#7673)
* Set up CI with Azure Pipelines
2020-03-03 01:55:05 +03:00
Nekotekina 3105b21909 Print PPU Syscall Usage Stats
* Every 10 seconds
* On normal exit
2020-03-02 20:48:20 +03:00
MSuih d94b875187 Minor cleanup
- Remove log prefix as auto-updater no longer uses general channel for logging
- Swap some C-style nulls for nullpointers
- Other misc changes
2020-03-02 12:31:59 +03:00
MSuih 7129902b25 Add time logging for updater
Might help diagnose issues
2020-03-02 12:31:59 +03:00
Nekotekina bd234a7668 sys_ppu: another fixup 2020-03-02 10:35:54 +03:00
Megamouse 73a9946212 Qt: remove game window title size restriction
- Elide game window title label
- Add tooltip with format and resolved title
- Remove max length (do not wrap text to show how ridiculous it will look if it's too long)
2020-03-01 22:00:57 +01:00
Nekotekina c7fa4e2375 Fixup 2020-03-01 22:40:48 +03:00
Nekotekina 6ee9153329 sys_ppu_thread: fixing detached threads 2020-03-01 22:29:03 +03:00
InvoxiPlayGames 752c4a7b0d Fix duplicate inputs for GHLtar strumming 2020-03-01 20:10:46 +03:00
kd-11 582c98359e videoOut: Resolve 'auto' aspect ratio
- 'Auto' is not an actual aspect ratio, just a dont-care flag to set the
  display to the best fit aspect ratio.
  Decay this option into a proper ratio for cellVideoOutGetState to
return legal values.
2020-03-01 20:10:11 +03:00
Eladash 7dfd50d5cc cellSaveData: followup to #7652 2020-03-01 20:09:46 +03:00
Nekotekina b05b16aedc sys_ppu: Hotfix for detached threads 2020-03-01 18:30:16 +03:00
Eladash ffd5a9e91c cellSaveData: Add some error checks for fixedSet, fileSet params 2020-03-01 10:56:41 +02:00
424 changed files with 28440 additions and 11400 deletions
+66
View File
@@ -0,0 +1,66 @@
#!/bin/sh -ex
# Setup Qt variables
export QT_BASE_DIR=/opt/qt${QTVERMIN}
export PATH=$QT_BASE_DIR/bin:$PATH
export LD_LIBRARY_PATH=$QT_BASE_DIR/lib/x86_64-linux-gnu:$QT_BASE_DIR/lib
cd rpcs3 || exit 1
# 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 $(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
mkdir build && cd build || exit 1
if [ "$COMPILER" = "gcc" ]; then
# These are set in the dockerfile
export CC=${GCC_BINARY}
export CXX=${GXX_BINARY}
export LINKER=gold
# We need to set the following variables for LTO to link properly
export AR=/usr/bin/gcc-ar-9
export RANLIB=/usr/bin/gcc-ranlib-9
export CFLAGS="-fuse-linker-plugin"
else
export CC=${CLANG_BINARY}
export CXX=${CLANGXX_BINARY}
export LINKER=lld
export AR=/usr/bin/llvm-ar-$LLVMVER
export RANLIB=/usr/bin/llvm-ranlib-$LLVMVER
fi
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" \
-DCMAKE_CXX_FLAGS="$CFLAGS" \
-DCMAKE_AR="$AR" \
-DCMAKE_RANLIB="$RANLIB" \
-G Ninja
ninja; build_status=$?;
cd ..
# If it compiled succesfully let's deploy depending on the build pipeline (Travis, Azure Pipelines).
# Travis only deploys on master, and it publishes to GitHub releases. Azure publishes PRs as artifacts
# only.
{ [ "$IS_AZURE" = "true" ] ||
{ [ "$TRAVIS_BRANCH" = "master" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ]; };
} && SHOULD_DEPLOY="true" || SHOULD_DEPLOY="false"
if [ "$build_status" -eq 0 ] && [ "$SHOULD_DEPLOY" = "true" ]; then
.ci/deploy-linux.sh
fi
+10 -5
View File
@@ -1,3 +1,5 @@
#!/bin/sh -ex
export CCACHE_SLOPPINESS=pch_defines,time_macros
export CMAKE_PREFIX_PATH=/usr/local/opt/qt5/
export PATH="/usr/local/opt/ccache/libexec:$PATH"
@@ -8,15 +10,18 @@ unzip -: gfx-portability-macos-latest.zip
curl -sLO https://github.com/KhronosGroup/Vulkan-Headers/archive/sdk-1.1.106.0.zip
unzip -: sdk-*.zip
mkdir vulkan-sdk
ln -s ${PWD}/Vulkan-Headers*/include vulkan-sdk/include
ln -s "${PWD}"/Vulkan-Headers*/include vulkan-sdk/include
mkdir vulkan-sdk/lib
cp target/release/libportability.dylib vulkan-sdk/lib/libVulkan.dylib
# Let macdeployqt locate and install Vulkan library
install_name_tool -id ${PWD}/vulkan-sdk/lib/libVulkan.dylib vulkan-sdk/lib/libVulkan.dylib
export VULKAN_SDK=${PWD}/vulkan-sdk
install_name_tool -id "${PWD}"/vulkan-sdk/lib/libVulkan.dylib vulkan-sdk/lib/libVulkan.dylib
export VULKAN_SDK="${PWD}/vulkan-sdk"
git submodule update --quiet --init asmjit 3rdparty/ffmpeg 3rdparty/pugixml 3rdparty/span 3rdparty/libpng 3rdparty/cereal 3rdparty/hidapi 3rdparty/libusb 3rdparty/xxHash 3rdparty/yaml-cpp 3rdparty/FAudio Vulkan/glslang
# 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)
mkdir build; cd build
mkdir build && cd build || exit 1
cmake .. -DWITH_LLVM=OFF -DUSE_NATIVE_INSTRUCTIONS=OFF -G Ninja
ninja
+67
View File
@@ -0,0 +1,67 @@
#!/bin/sh -ex
cd build || exit 1
if [ "$DEPLOY_APPIMAGE" = "true" ]; then
DESTDIR=appdir ninja install
QT_APPIMAGE="linuxdeployqt.AppImage"
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
rm ./appdir/usr/lib/libxcb*
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}
# 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++/
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
# Compile checker binary for AppImageKit-checkrt
# 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.26 and CXXABI_1.3.11
printf "#include <bits/stdc++.h>\nint main(){std::make_exception_ptr(0);std::pmr::get_default_resource();}" | $CXX -x c++ -std=c++2a -o ./appdir/usr/optional/checker -
# Package it up and send it off
./squashfs-root/usr/bin/appimagetool /rpcs3/build/appdir
ls
COMM_TAG="$(grep 'version{.*}' ../rpcs3/rpcs3_version.cpp | awk -F[\{,] '{printf "%d.%d.%d", $2, $3, $4}')"
COMM_COUNT="$(git rev-list --count HEAD)"
COMM_HASH="$(git rev-parse --short=8 HEAD)"
RPCS3_APPIMAGE="rpcs3-v${COMM_TAG}-${COMM_COUNT}-${COMM_HASH}_linux64.AppImage"
curl -sLO https://github.com/hcorion/uploadtool/raw/master/upload.sh
mv ./RPCS3*.AppImage "$RPCS3_APPIMAGE"
# If we're building using Azure Pipelines, let's copy over the AppImage artifact
if [ -n "$BUILD_ARTIFACTSTAGINGDIRECTORY" ]; then
cp "$RPCS3_APPIMAGE" ~/artifacts
fi
FILESIZE=$(stat -c %s ./rpcs3*.AppImage)
SHA256SUM=$(sha256sum ./rpcs3*.AppImage)
if [ -n "$GITHUB_TOKEN" ]; then
unset TRAVIS_REPO_SLUG
REPO_SLUG=RPCS3/rpcs3-binaries-linux \
UPLOADTOOL_BODY="$SHA256SUM;${FILESIZE}B"\
RELEASE_NAME=build-${TRAVIS_COMMIT}\
RELEASE_TITLE=${COMM_TAG}-${COMM_COUNT}\
REPO_COMMIT=d812f1254a1157c80fd402f94446310560f54e5f\
bash upload.sh rpcs3*.AppImage
fi
fi
if [ "$DEPLOY_PPA" = "true" ]; then
export DEBFULLNAME="RPCS3 Build Bot"
fi
+24
View File
@@ -0,0 +1,24 @@
#!/bin/sh -ex
# BUILD_blablabla is Azure specific, so we wrap it for portability
ARTIFACT_DIR="$BUILD_ARTIFACTSTAGINGDIRECTORY"
# Remove unecessary files
rm -f ./bin/rpcs3.exp ./bin/rpcs3.lib ./bin/rpcs3.pdb
# Prepare compatibility database for packaging, as well as
# certificate for ssl (auto-updater)
curl -sL 'https://rpcs3.net/compatibility?api=v1&export' | iconv -t UTF-8 > ./bin/GuiConfigs/compat_database.dat
curl -sL 'https://curl.haxx.se/ca/cacert.pem' > ./bin/cacert.pem
# Package artifacts
7z a -m0=LZMA2 -mx9 "$BUILD" ./bin/*
# Generate sha256 hashes
# Write to file for GitHub releases
sha256sum "$BUILD" | awk '{ print $1 }' | tee "$BUILD.sha256"
echo "$(cat "$BUILD.sha256");$(stat -c %s "$BUILD")B" > GitHubReleaseMessage.txt
# Move files to publishing directory
mv -- "$BUILD" "$ARTIFACT_DIR"
mv -- "$BUILD.sha256" "$ARTIFACT_DIR"
+13
View File
@@ -0,0 +1,13 @@
#!/bin/sh -e
# Export variables for later stages of the Azure pipeline
# Values done in this manner will appear as environment variables
# in later stages.
# From pure-sh-bible
# Setting 'IFS' tells 'read' where to split the string.
while IFS='=' read -r key val; do
# Skip over lines containing comments.
[ "${key##\#*}" ] || continue
echo "##vso[task.setvariable variable=$key]$val"
done < ".ci/azure-vars.env"
+114
View File
@@ -0,0 +1,114 @@
#!/bin/sh -ex
# These are Azure specific, so we wrap them for portability
REPO_NAME="$BUILD_REPOSITORY_NAME"
REPO_BRANCH="$SYSTEM_PULLREQUEST_SOURCEBRANCH"
PR_NUMBER="$SYSTEM_PULLREQUEST_PULLREQUESTID"
# Resource/dependency URLs
# Qt mirrors can be volatile and slow, so we list 2
#QT_HOST="http://mirrors.ocf.berkeley.edu/qt/"
QT_HOST="http://qt.mirror.constant.com/"
QT_URL_VER=$(echo "$QT_VER" | sed "s/\.//g")
QT_PREFIX="online/qtsdkrepository/windows_x86/desktop/qt5_${QT_URL_VER}/qt.qt5.${QT_URL_VER}.win64_msvc2017_64/${QT_VER}-0-${QT_DATE}"
QT_SUFFIX="-Windows-Windows_10-MSVC2017-Windows-Windows_10-X86_64.7z"
QT_BASE_URL="${QT_HOST}${QT_PREFIX}qtbase${QT_SUFFIX}"
QT_WINE_URL="${QT_HOST}${QT_PREFIX}qtwinextras${QT_SUFFIX}"
QT_DECL_URL="${QT_HOST}${QT_PREFIX}qtdeclarative${QT_SUFFIX}"
QT_TOOL_URL="${QT_HOST}${QT_PREFIX}qttools${QT_SUFFIX}"
LLVMLIBS_URL='https://github.com/RPCS3/llvm-mirror/releases/download/custom-build-win/llvmlibs_mt.7z'
GLSLANG_URL='https://github.com/RPCS3/glslang/releases/download/custom-build-win/glslanglibs_mt.7z'
VULKAN_SDK_URL="https://sdk.lunarg.com/sdk/download/${VULKAN_VER}/windows/VulkanSDK-${VULKAN_VER}-Installer.exe"
DEP_URLS=" \
$QT_BASE_URL \
$QT_WINE_URL \
$QT_DECL_URL \
$QT_TOOL_URL \
$LLVMLIBS_URL \
$GLSLANG_URL \
$VULKAN_SDK_URL"
# Azure pipelines doesn't make a cache dir if it doesn't exist, so we do it manually
[ -d "$CACHE_DIR" ] || mkdir "$CACHE_DIR"
# 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 $(awk '/path/ && !/llvm/ { print $3 }' .gitmodules)
# Git bash doesn't have rev, so here it is
rev()
{
echo "$1" | awk '{ for(i = length($0); i != 0; --i) { a = a substr($0, i, 1); } } END { print a }'
}
# Usage: download_and_verify url checksum algo file
# Check to see if a file is already cached, and the checksum matches. If not, download it.
# Tries up to 3 times
download_and_verify()
{
url="$1"
correctChecksum="$2"
algo="$3"
fileName="$4"
for _ in 1 2 3; do
[ -e "$CACHE_DIR/$fileName" ] || curl -L -o "$CACHE_DIR/$fileName" "$url"
fileChecksum=$("${algo}sum" "$CACHE_DIR/$fileName" | awk '{ print $1 }')
[ "$fileChecksum" = "$correctChecksum" ] && return 0
rm "$CACHE_DIR/$fileName"
done
return 1;
}
# Some dependencies install here
[ -d "./lib" ] || mkdir "./lib"
for url in $DEP_URLS; do
# Get the filename from the URL. Breaks if urls have js args, so don't do that pls
fileName="$(rev "$(rev "$url" | cut -d'/' -f1)")"
[ -z "$fileName" ] && echo "Unable to parse url: $url" && exit 1
# 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="." ;;
*glslang*) checksum=$(curl -L "${url}.sha256"); algo="sha256"; outDir="./lib/Release - LLVM-x64" ;;
*Vulkan*)
# Vulkan setup needs to be run in batch environment
# Need to subshell this or else it doesn't wait
download_and_verify "$url" "$VULKAN_SDK_SHA" "sha256" "$fileName"
cp "$CACHE_DIR/$fileName" .
_=$(echo "$fileName /S" | cmd)
continue
;;
*) echo "Unknown url resource: $url"; exit 1 ;;
esac
download_and_verify "$url" "$checksum" "$algo" "$fileName"
7z x -y "$CACHE_DIR/$fileName" -aos -o"$outDir"
done
# Gather explicit version number and number of commits
COMM_TAG=$(awk '/version{.*}/ { printf("%d.%d.%d", $5, $6, $7) }' ./rpcs3/rpcs3_version.cpp)
COMM_COUNT=$(git rev-list --count HEAD)
COMM_HASH=$(git rev-parse --short=8 HEAD)
# Format the above into filenames
if [ -n "$PR_NUMBER" ]; then
AVVER="${COMM_TAG}-${COMM_HASH}"
BUILD="rpcs3-v${AVVER}_win64.7z"
else
AVVER="${COMM_TAG}-${COMM_COUNT}"
BUILD="rpcs3-v${AVVER}-${COMM_HASH}_win64.7z"
fi
# BRANCH is used for experimental build warnings for pr builds, used in main_window.cpp.
# BUILD is the name of the release artifact
# AVVER is used for GitHub releases, it is the version number.
BRANCH="${REPO_NAME}/${REPO_BRANCH}"
echo "BRANCH=$BRANCH" > .ci/azure-vars.env
echo "BUILD=$BUILD" >> .ci/azure-vars.env
echo "AVVER=$AVVER" >> .ci/azure-vars.env
+7
View File
@@ -2,6 +2,13 @@
TRAVIS_PULL_REQUEST
TRAVIS_BRANCH
TRAVIS_COMMIT
# Variables set by Azure Pipelines
IS_AZURE
BUILD_REASON
BUILD_SOURCEVERSION
BUILD_ARTIFACTSTAGINGDIRECTORY
BUILD_REPOSITORY_NAME
BUILD_SOURCEBRANCHNAME
# Variables for Travis build matrix
COMPILER
DEPLOY_APPIMAGE
+7
View File
@@ -108,3 +108,10 @@ CMakeLists.txt.user
# yaml-cpp
yaml-cpp.pc
# libusb
/3rdparty/libusb_cmake/config.h
/3rdparty/libusb_cmake/libusb-1.0.pc
# ssl certificate
cacert.pem
+12 -3
View File
@@ -8,7 +8,7 @@
ignore = dirty
[submodule "llvm"]
path = llvm
url = https://github.com/RPCS3/llvm
url = https://github.com/RPCS3/llvm-mirror
ignore = dirty
[submodule "Vulkan/glslang"]
path = Vulkan/glslang
@@ -16,7 +16,7 @@
ignore = dirty
[submodule "3rdparty/cereal"]
path = 3rdparty/cereal
url = https://github.com/USCiLab/cereal.git
url = https://github.com/RPCS3/cereal.git
ignore = dirty
[submodule "3rdparty/zlib"]
path = 3rdparty/zlib
@@ -37,7 +37,7 @@
ignore = dirty
[submodule "3rdparty/yaml-cpp"]
path = 3rdparty/yaml-cpp
url = https://github.com/jbeder/yaml-cpp.git
url = https://github.com/RPCS3/yaml-cpp.git
ignore = dirty
[submodule "3rdparty/libpng"]
path = 3rdparty/libpng
@@ -55,3 +55,12 @@
path = 3rdparty/span
url = https://github.com/tcbrindle/span
ignore = dirty
[submodule "3rdparty/curl"]
path = 3rdparty/curl
url = https://github.com/RipleyTom/curl.git
ignore = dirty
[submodule "3rdparty/wolfssl"]
path = 3rdparty/wolfssl
url = https://github.com/RipleyTom/wolfssl.git
ignore = dirty
+13 -13
View File
@@ -11,7 +11,7 @@ jobs:
cache: ccache
compiler: gcc
install: "docker pull rpcs3/rpcs3-travis-xenial:1.2"
script: 'travis_wait docker run -v $(pwd):/rpcs3 -v "$HOME/.ccache":/root/.ccache --env-file .travis/travis.env rpcs3/rpcs3-travis-xenial:1.2 /bin/bash -ex /rpcs3/.travis/build-linux.bash'
script: 'travis_wait docker run -v $(pwd):/rpcs3 -v "$HOME/.ccache":/root/.ccache --env-file .ci/travis.env rpcs3/rpcs3-travis-xenial:1.2 /rpcs3/.ci/build-linux.sh'
- os: linux
dist: xenial
env:
@@ -21,18 +21,18 @@ jobs:
cache: ccache
compiler: clang
install: "docker pull rpcs3/rpcs3-travis-xenial:1.2"
script: 'travis_wait docker run -v $(pwd):/rpcs3 -v "$HOME/.ccache":/root/.ccache --env-file .travis/travis.env rpcs3/rpcs3-travis-xenial:1.2 /bin/bash -ex /rpcs3/.travis/build-linux.bash'
- os: osx
osx_image: xcode11.3
addons:
homebrew:
packages:
- ccache
- glew
- ninja
- qt
script: "/bin/bash -ex .travis/build-mac.bash"
cache: ccache
script: 'travis_wait docker run -v $(pwd):/rpcs3 -v "$HOME/.ccache":/root/.ccache --env-file .ci/travis.env rpcs3/rpcs3-travis-xenial:1.2 /rpcs3/.ci/build-linux.sh'
# - os: osx
# osx_image: xcode11.3
# addons:
# homebrew:
# packages:
# - ccache
# - glew
# - ninja
# - qt
# script: "/bin/bash -ex .ci/build-mac.sh"
# cache: ccache
allow_failures:
- os: osx
-35
View File
@@ -1,35 +0,0 @@
#!/bin/env bash -ex
shopt -s nocasematch
# Setup Qt variables
export QT_BASE_DIR=/opt/qt${QTVERMIN}
export PATH=$QT_BASE_DIR/bin:$PATH
export LD_LIBRARY_PATH=$QT_BASE_DIR/lib/x86_64-linux-gnu:$QT_BASE_DIR/lib
cd rpcs3
git submodule update --quiet --init asmjit 3rdparty/ffmpeg 3rdparty/pugixml 3rdparty/span 3rdparty/libpng 3rdparty/cereal 3rdparty/hidapi 3rdparty/xxHash 3rdparty/yaml-cpp 3rdparty/libusb 3rdparty/FAudio Vulkan/glslang
# Download pre-compiled llvm libs
curl -sLO https://github.com/RPCS3/llvm/releases/download/continuous-linux-master/llvmlibs-linux.tar.gz
mkdir llvmlibs
tar -xzf ./llvmlibs-linux.tar.gz -C llvmlibs
mkdir build ; cd build
if [ $COMPILER = "gcc" ]; then
# These are set in the dockerfile
export CC=${GCC_BINARY}
export CXX=${GXX_BINARY}
else
export CC=${CLANG_BINARY}
export CXX=${CLANGXX_BINARY}
fi
cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_LLVM_SUBMODULE=OFF -DUSE_COTIRE=OFF -DLLVM_DIR=llvmlibs/lib/cmake/llvm/ -DUSE_NATIVE_INSTRUCTIONS=OFF -G Ninja
ninja; build_status=$?;
cd ..
# If it compiled succesfully let's deploy
if [ $build_status -eq 0 ] && [ -n "$GITHUB_TOKEN" ] && [ "$TRAVIS_BRANCH" = "master" ] && [ "$TRAVIS_PULL_REQUEST" = false ]; then /bin/bash -ex .travis/deploy-linux.bash ; fi
-54
View File
@@ -1,54 +0,0 @@
#!/bin/env bash -ex
shopt -s nocasematch
cd build
if [ "$DEPLOY_APPIMAGE" = "true" ]; then
DESTDIR=appdir ninja install
curl -sLO "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage"
chmod a+x linuxdeployqt*.AppImage
./linuxdeployqt*.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
rm ./appdir/usr/lib/libxcb*
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}
# 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++/
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
# Compile checker binary for AppImageKit-checkrt
# 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.26 and CXXABI_1.3.11
printf "#include <bits/stdc++.h>\nint main(){std::make_exception_ptr(0);std::pmr::get_default_resource();}" | $CXX -x c++ -std=c++2a -o ./appdir/usr/optional/checker -
# Package it up and send it off
./squashfs-root/usr/bin/appimagetool /rpcs3/build/appdir
ls
COMM_TAG="$(grep 'version{.*}' ../rpcs3/rpcs3_version.cpp | awk -F[{,] '{printf "%d.%d.%d", $2, $3, $4}')"
COMM_COUNT="$(git rev-list --count HEAD)"
curl -sLO https://github.com/hcorion/uploadtool/raw/master/upload.sh
mv ./RPCS3*.AppImage rpcs3-v${COMM_TAG}-${COMM_COUNT}-${TRAVIS_COMMIT:0:8}_linux64.AppImage
FILESIZE=($(stat -c %s ./rpcs3*.AppImage))
SHA256SUM=($(sha256sum ./rpcs3*.AppImage))
unset TRAVIS_REPO_SLUG
REPO_SLUG=RPCS3/rpcs3-binaries-linux \
UPLOADTOOL_BODY="$SHA256SUM;${FILESIZE}B"\
RELEASE_NAME=build-${TRAVIS_COMMIT}\
RELEASE_TITLE=${COMM_TAG}-${COMM_COUNT}\
REPO_COMMIT=d812f1254a1157c80fd402f94446310560f54e5f\
bash upload.sh rpcs3*.AppImage
fi
if [ "$DEPLOY_PPA" = "true" ]; then
export DEBFULLNAME="RPCS3 Build Bot"
fi
+14
View File
@@ -413,6 +413,18 @@ endif()
# LLVM
include(llvm.cmake)
# CURL
if(USE_SYSTEM_CURL)
message("-- RPCS3: using shared libcurl")
find_package(CURL REQUIRED)
add_library(wolfssl-3-static INTERFACE)
add_library(libcurl INTERFACE)
target_link_libraries(libcurl INTERFACE CURL::libcurl)
else()
message("-- RPCS3: building libcurl + wolfssl submodules")
add_subdirectory(wolfssl EXCLUDE_FROM_ALL)
add_subdirectory(curl EXCLUDE_FROM_ALL)
endif()
# add nice ALIAS targets for ease of use
add_library(3rdparty::libusb ALIAS usb-1.0-static)
@@ -436,3 +448,5 @@ add_library(3rdparty::vulkan ALIAS ${VULKAN_TARGET})
add_library(3rdparty::openal ALIAS 3rdparty_openal)
add_library(3rdparty::ffmpeg ALIAS 3rdparty_ffmpeg)
add_library(3rdparty::glew ALIAS 3rdparty_glew)
add_library(3rdparty::wolfssl ALIAS wolfssl-3-static)
add_library(3rdparty::libcurl ALIAS libcurl)
Vendored Submodule
+1
Submodule 3rdparty/curl added at aa1a12cb23
+10 -10
View File
@@ -1,17 +1,17 @@
#pragma once
#if defined(DISCORD_DYNAMIC_LIB)
# if defined(_WIN32)
# if defined(DISCORD_BUILDING_SDK)
# define DISCORD_EXPORT __declspec(dllexport)
# else
# define DISCORD_EXPORT __declspec(dllimport)
# endif
# else
# define DISCORD_EXPORT __attribute__((visibility("default")))
# endif
#if defined(_WIN32)
#if defined(DISCORD_BUILDING_SDK)
#define DISCORD_EXPORT __declspec(dllexport)
#else
# define DISCORD_EXPORT
#define DISCORD_EXPORT __declspec(dllimport)
#endif
#else
#define DISCORD_EXPORT __attribute__((visibility("default")))
#endif
#else
#define DISCORD_EXPORT
#endif
#ifdef __cplusplus
+4 -4
View File
@@ -41,20 +41,20 @@ typedef struct DiscordRichPresence {
int8_t instance;
} DiscordRichPresence;
typedef struct DiscordJoinRequest {
typedef struct DiscordUser {
const char* userId;
const char* username;
const char* discriminator;
const char* avatar;
} DiscordJoinRequest;
} DiscordUser;
typedef struct DiscordEventHandlers {
void (*ready)(void);
void (*ready)(const DiscordUser* request);
void (*disconnected)(int errorCode, const char* message);
void (*errored)(int errorCode, const char* message);
void (*joinGame)(const char* joinSecret);
void (*spectateGame)(const char* spectateSecret);
void (*joinRequest)(const DiscordJoinRequest* request);
void (*joinRequest)(const DiscordUser* request);
} DiscordEventHandlers;
#define DISCORD_REPLY_NO 0
Binary file not shown.
-1
View File
@@ -55,7 +55,6 @@
<AdditionalIncludeDirectories>hidapi\hidapi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
+371
View File
@@ -0,0 +1,371 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug - LLVM|x64">
<Configuration>Debug - LLVM</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release - LLVM|x64">
<Configuration>Release - LLVM</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}</ProjectGuid>
<RootNamespace>libcurl</RootNamespace>
</PropertyGroup>
<Import Project="..\common_default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="..\common_default_macros.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>Unicode</CharacterSet>
</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" />
</ImportGroup>
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup>
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<AdditionalIncludeDirectories>curl\include;curl\lib;wolfssl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>HAVE_SNI;NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_WOLFSSL;USE_IPV6;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<FunctionLevelLinking>true</FunctionLevelLinking>
<WarningLevel>Level4</WarningLevel>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Lib>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<TargetMachine>MachineX64</TargetMachine>
</Lib>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="curl\lib\altsvc.c" />
<ClCompile Include="curl\lib\amigaos.c" />
<ClCompile Include="curl\lib\asyn-ares.c" />
<ClCompile Include="curl\lib\asyn-thread.c" />
<ClCompile Include="curl\lib\base64.c" />
<ClCompile Include="curl\lib\conncache.c" />
<ClCompile Include="curl\lib\connect.c" />
<ClCompile Include="curl\lib\content_encoding.c" />
<ClCompile Include="curl\lib\cookie.c" />
<ClCompile Include="curl\lib\curl_addrinfo.c" />
<ClCompile Include="curl\lib\curl_ctype.c" />
<ClCompile Include="curl\lib\curl_des.c" />
<ClCompile Include="curl\lib\curl_endian.c" />
<ClCompile Include="curl\lib\curl_fnmatch.c" />
<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_memrchr.c" />
<ClCompile Include="curl\lib\curl_multibyte.c" />
<ClCompile Include="curl\lib\curl_ntlm_core.c" />
<ClCompile Include="curl\lib\curl_ntlm_wb.c" />
<ClCompile Include="curl\lib\curl_path.c" />
<ClCompile Include="curl\lib\curl_range.c" />
<ClCompile Include="curl\lib\curl_rtmp.c" />
<ClCompile Include="curl\lib\curl_sasl.c" />
<ClCompile Include="curl\lib\curl_sspi.c" />
<ClCompile Include="curl\lib\curl_threads.c" />
<ClCompile Include="curl\lib\dict.c" />
<ClCompile Include="curl\lib\doh.c" />
<ClCompile Include="curl\lib\dotdot.c" />
<ClCompile Include="curl\lib\easy.c" />
<ClCompile Include="curl\lib\escape.c" />
<ClCompile Include="curl\lib\file.c" />
<ClCompile Include="curl\lib\fileinfo.c" />
<ClCompile Include="curl\lib\formdata.c" />
<ClCompile Include="curl\lib\ftp.c" />
<ClCompile Include="curl\lib\ftplistparser.c" />
<ClCompile Include="curl\lib\getenv.c" />
<ClCompile Include="curl\lib\getinfo.c" />
<ClCompile Include="curl\lib\gopher.c" />
<ClCompile Include="curl\lib\hash.c" />
<ClCompile Include="curl\lib\hmac.c" />
<ClCompile Include="curl\lib\hostasyn.c" />
<ClCompile Include="curl\lib\hostcheck.c" />
<ClCompile Include="curl\lib\hostip.c" />
<ClCompile Include="curl\lib\hostip4.c" />
<ClCompile Include="curl\lib\hostip6.c" />
<ClCompile Include="curl\lib\hostsyn.c" />
<ClCompile Include="curl\lib\http.c" />
<ClCompile Include="curl\lib\http2.c" />
<ClCompile Include="curl\lib\http_chunks.c" />
<ClCompile Include="curl\lib\http_digest.c" />
<ClCompile Include="curl\lib\http_negotiate.c" />
<ClCompile Include="curl\lib\http_ntlm.c" />
<ClCompile Include="curl\lib\http_proxy.c" />
<ClCompile Include="curl\lib\idn_win32.c" />
<ClCompile Include="curl\lib\if2ip.c" />
<ClCompile Include="curl\lib\imap.c" />
<ClCompile Include="curl\lib\inet_ntop.c" />
<ClCompile Include="curl\lib\inet_pton.c" />
<ClCompile Include="curl\lib\krb5.c" />
<ClCompile Include="curl\lib\ldap.c" />
<ClCompile Include="curl\lib\llist.c" />
<ClCompile Include="curl\lib\md4.c" />
<ClCompile Include="curl\lib\md5.c" />
<ClCompile Include="curl\lib\memdebug.c" />
<ClCompile Include="curl\lib\mime.c" />
<ClCompile Include="curl\lib\mprintf.c" />
<ClCompile Include="curl\lib\multi.c" />
<ClCompile Include="curl\lib\netrc.c" />
<ClCompile Include="curl\lib\non-ascii.c" />
<ClCompile Include="curl\lib\nonblock.c" />
<ClCompile Include="curl\lib\nwlib.c" />
<ClCompile Include="curl\lib\nwos.c" />
<ClCompile Include="curl\lib\openldap.c" />
<ClCompile Include="curl\lib\parsedate.c" />
<ClCompile Include="curl\lib\pingpong.c" />
<ClCompile Include="curl\lib\pop3.c" />
<ClCompile Include="curl\lib\progress.c" />
<ClCompile Include="curl\lib\psl.c" />
<ClCompile Include="curl\lib\rand.c" />
<ClCompile Include="curl\lib\rename.c" />
<ClCompile Include="curl\lib\rtsp.c" />
<ClCompile Include="curl\lib\security.c" />
<ClCompile Include="curl\lib\select.c" />
<ClCompile Include="curl\lib\sendf.c" />
<ClCompile Include="curl\lib\setopt.c" />
<ClCompile Include="curl\lib\sha256.c" />
<ClCompile Include="curl\lib\share.c" />
<ClCompile Include="curl\lib\slist.c" />
<ClCompile Include="curl\lib\smb.c" />
<ClCompile Include="curl\lib\smtp.c" />
<ClCompile Include="curl\lib\socketpair.c" />
<ClCompile Include="curl\lib\socks.c" />
<ClCompile Include="curl\lib\socks_gssapi.c" />
<ClCompile Include="curl\lib\socks_sspi.c" />
<ClCompile Include="curl\lib\speedcheck.c" />
<ClCompile Include="curl\lib\splay.c" />
<ClCompile Include="curl\lib\strcase.c" />
<ClCompile Include="curl\lib\strdup.c" />
<ClCompile Include="curl\lib\strerror.c" />
<ClCompile Include="curl\lib\strtok.c" />
<ClCompile Include="curl\lib\strtoofft.c" />
<ClCompile Include="curl\lib\system_win32.c" />
<ClCompile Include="curl\lib\telnet.c" />
<ClCompile Include="curl\lib\tftp.c" />
<ClCompile Include="curl\lib\timeval.c" />
<ClCompile Include="curl\lib\transfer.c" />
<ClCompile Include="curl\lib\url.c" />
<ClCompile Include="curl\lib\urlapi.c" />
<ClCompile Include="curl\lib\version.c" />
<ClCompile Include="curl\lib\warnless.c" />
<ClCompile Include="curl\lib\wildcard.c" />
<ClCompile Include="curl\lib\x509asn1.c" />
<ClCompile Include="curl\lib\vauth\cleartext.c" />
<ClCompile Include="curl\lib\vauth\cram.c" />
<ClCompile Include="curl\lib\vauth\digest.c" />
<ClCompile Include="curl\lib\vauth\digest_sspi.c" />
<ClCompile Include="curl\lib\vauth\krb5_gssapi.c" />
<ClCompile Include="curl\lib\vauth\krb5_sspi.c" />
<ClCompile Include="curl\lib\vauth\ntlm.c" />
<ClCompile Include="curl\lib\vauth\ntlm_sspi.c" />
<ClCompile Include="curl\lib\vauth\oauth2.c" />
<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\vssh\libssh.c" />
<ClCompile Include="curl\lib\vssh\libssh2.c" />
<ClCompile Include="curl\lib\vssh\wolfssh.c" />
<ClCompile Include="curl\lib\vtls\bearssl.c" />
<ClCompile Include="curl\lib\vtls\gskit.c" />
<ClCompile Include="curl\lib\vtls\gtls.c" />
<ClCompile Include="curl\lib\vtls\mbedtls.c" />
<ClCompile Include="curl\lib\vtls\mbedtls_threadlock.c" />
<ClCompile Include="curl\lib\vtls\mesalink.c" />
<ClCompile Include="curl\lib\vtls\nss.c" />
<ClCompile Include="curl\lib\vtls\openssl.c" />
<ClCompile Include="curl\lib\vtls\schannel.c" />
<ClCompile Include="curl\lib\vtls\schannel_verify.c" />
<ClCompile Include="curl\lib\vtls\sectransp.c" />
<ClCompile Include="curl\lib\vtls\vtls.c" />
<ClCompile Include="curl\lib\vtls\wolfssl.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="curl\include\curl\curl.h" />
<ClInclude Include="curl\include\curl\curlver.h" />
<ClInclude Include="curl\include\curl\easy.h" />
<ClInclude Include="curl\include\curl\mprintf.h" />
<ClInclude Include="curl\include\curl\multi.h" />
<ClInclude Include="curl\include\curl\stdcheaders.h" />
<ClInclude Include="curl\include\curl\system.h" />
<ClInclude Include="curl\include\curl\typecheck-gcc.h" />
<ClInclude Include="curl\include\curl\urlapi.h" />
<ClInclude Include="curl\lib\altsvc.h" />
<ClInclude Include="curl\lib\amigaos.h" />
<ClInclude Include="curl\lib\arpa_telnet.h" />
<ClInclude Include="curl\lib\asyn.h" />
<ClInclude Include="curl\lib\config-amigaos.h" />
<ClInclude Include="curl\lib\config-dos.h" />
<ClInclude Include="curl\lib\config-mac.h" />
<ClInclude Include="curl\lib\config-os400.h" />
<ClInclude Include="curl\lib\config-plan9.h" />
<ClInclude Include="curl\lib\config-riscos.h" />
<ClInclude Include="curl\lib\config-symbian.h" />
<ClInclude Include="curl\lib\config-tpf.h" />
<ClInclude Include="curl\lib\config-vxworks.h" />
<ClInclude Include="curl\lib\config-win32.h" />
<ClInclude Include="curl\lib\config-win32ce.h" />
<ClInclude Include="curl\lib\conncache.h" />
<ClInclude Include="curl\lib\connect.h" />
<ClInclude Include="curl\lib\content_encoding.h" />
<ClInclude Include="curl\lib\cookie.h" />
<ClInclude Include="curl\lib\curlx.h" />
<ClInclude Include="curl\lib\curl_addrinfo.h" />
<ClInclude Include="curl\lib\curl_base64.h" />
<ClInclude Include="curl\lib\curl_ctype.h" />
<ClInclude Include="curl\lib\curl_des.h" />
<ClInclude Include="curl\lib\curl_endian.h" />
<ClInclude Include="curl\lib\curl_fnmatch.h" />
<ClInclude Include="curl\lib\curl_gethostname.h" />
<ClInclude Include="curl\lib\curl_get_line.h" />
<ClInclude Include="curl\lib\curl_gssapi.h" />
<ClInclude Include="curl\lib\curl_hmac.h" />
<ClInclude Include="curl\lib\curl_ldap.h" />
<ClInclude Include="curl\lib\curl_md4.h" />
<ClInclude Include="curl\lib\curl_md5.h" />
<ClInclude Include="curl\lib\curl_memory.h" />
<ClInclude Include="curl\lib\curl_memrchr.h" />
<ClInclude Include="curl\lib\curl_multibyte.h" />
<ClInclude Include="curl\lib\curl_ntlm_core.h" />
<ClInclude Include="curl\lib\curl_ntlm_wb.h" />
<ClInclude Include="curl\lib\curl_path.h" />
<ClInclude Include="curl\lib\curl_printf.h" />
<ClInclude Include="curl\lib\curl_range.h" />
<ClInclude Include="curl\lib\curl_rtmp.h" />
<ClInclude Include="curl\lib\curl_sasl.h" />
<ClInclude Include="curl\lib\curl_sec.h" />
<ClInclude Include="curl\lib\curl_setup.h" />
<ClInclude Include="curl\lib\curl_setup_once.h" />
<ClInclude Include="curl\lib\curl_sha256.h" />
<ClInclude Include="curl\lib\curl_sspi.h" />
<ClInclude Include="curl\lib\curl_threads.h" />
<ClInclude Include="curl\lib\dict.h" />
<ClInclude Include="curl\lib\doh.h" />
<ClInclude Include="curl\lib\dotdot.h" />
<ClInclude Include="curl\lib\easyif.h" />
<ClInclude Include="curl\lib\escape.h" />
<ClInclude Include="curl\lib\file.h" />
<ClInclude Include="curl\lib\fileinfo.h" />
<ClInclude Include="curl\lib\formdata.h" />
<ClInclude Include="curl\lib\ftp.h" />
<ClInclude Include="curl\lib\ftplistparser.h" />
<ClInclude Include="curl\lib\getinfo.h" />
<ClInclude Include="curl\lib\gopher.h" />
<ClInclude Include="curl\lib\hash.h" />
<ClInclude Include="curl\lib\hostcheck.h" />
<ClInclude Include="curl\lib\hostip.h" />
<ClInclude Include="curl\lib\http.h" />
<ClInclude Include="curl\lib\http2.h" />
<ClInclude Include="curl\lib\http_chunks.h" />
<ClInclude Include="curl\lib\http_digest.h" />
<ClInclude Include="curl\lib\http_negotiate.h" />
<ClInclude Include="curl\lib\http_ntlm.h" />
<ClInclude Include="curl\lib\http_proxy.h" />
<ClInclude Include="curl\lib\if2ip.h" />
<ClInclude Include="curl\lib\imap.h" />
<ClInclude Include="curl\lib\inet_ntop.h" />
<ClInclude Include="curl\lib\inet_pton.h" />
<ClInclude Include="curl\lib\llist.h" />
<ClInclude Include="curl\lib\memdebug.h" />
<ClInclude Include="curl\lib\mime.h" />
<ClInclude Include="curl\lib\multihandle.h" />
<ClInclude Include="curl\lib\multiif.h" />
<ClInclude Include="curl\lib\netrc.h" />
<ClInclude Include="curl\lib\non-ascii.h" />
<ClInclude Include="curl\lib\nonblock.h" />
<ClInclude Include="curl\lib\parsedate.h" />
<ClInclude Include="curl\lib\pingpong.h" />
<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" />
<ClInclude Include="curl\lib\select.h" />
<ClInclude Include="curl\lib\sendf.h" />
<ClInclude Include="curl\lib\setopt.h" />
<ClInclude Include="curl\lib\setup-os400.h" />
<ClInclude Include="curl\lib\setup-vms.h" />
<ClInclude Include="curl\lib\share.h" />
<ClInclude Include="curl\lib\sigpipe.h" />
<ClInclude Include="curl\lib\slist.h" />
<ClInclude Include="curl\lib\smb.h" />
<ClInclude Include="curl\lib\smtp.h" />
<ClInclude Include="curl\lib\sockaddr.h" />
<ClInclude Include="curl\lib\socketpair.h" />
<ClInclude Include="curl\lib\socks.h" />
<ClInclude Include="curl\lib\speedcheck.h" />
<ClInclude Include="curl\lib\splay.h" />
<ClInclude Include="curl\lib\strcase.h" />
<ClInclude Include="curl\lib\strdup.h" />
<ClInclude Include="curl\lib\strerror.h" />
<ClInclude Include="curl\lib\strtok.h" />
<ClInclude Include="curl\lib\strtoofft.h" />
<ClInclude Include="curl\lib\system_win32.h" />
<ClInclude Include="curl\lib\telnet.h" />
<ClInclude Include="curl\lib\tftp.h" />
<ClInclude Include="curl\lib\timeval.h" />
<ClInclude Include="curl\lib\transfer.h" />
<ClInclude Include="curl\lib\url.h" />
<ClInclude Include="curl\lib\urlapi-int.h" />
<ClInclude Include="curl\lib\urldata.h" />
<ClInclude Include="curl\lib\warnless.h" />
<ClInclude Include="curl\lib\wildcard.h" />
<ClInclude Include="curl\lib\x509asn1.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\vssh\ssh.h" />
<ClInclude Include="curl\lib\vssh\wolfssh.h" />
<ClInclude Include="curl\lib\vtls\bearssl.h" />
<ClInclude Include="curl\lib\vtls\gskit.h" />
<ClInclude Include="curl\lib\vtls\gtls.h" />
<ClInclude Include="curl\lib\vtls\mbedtls.h" />
<ClInclude Include="curl\lib\vtls\mbedtls_threadlock.h" />
<ClInclude Include="curl\lib\vtls\mesalink.h" />
<ClInclude Include="curl\lib\vtls\nssg.h" />
<ClInclude Include="curl\lib\vtls\openssl.h" />
<ClInclude Include="curl\lib\vtls\schannel.h" />
<ClInclude Include="curl\lib\vtls\sectransp.h" />
<ClInclude Include="curl\lib\vtls\vtls.h" />
<ClInclude Include="curl\lib\vtls\wolfssl.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="curl\lib\libcurl.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
+911
View File
@@ -0,0 +1,911 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="curl\lib\altsvc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\amigaos.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\asyn-ares.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\asyn-thread.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\base64.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\conncache.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\connect.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\content_encoding.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\cookie.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\curl_addrinfo.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\curl_ctype.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\curl_des.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\curl_endian.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\curl_fnmatch.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\curl_gethostname.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\curl_get_line.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\curl_gssapi.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\curl_memrchr.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\curl_multibyte.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\curl_ntlm_core.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\curl_ntlm_wb.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\curl_path.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\curl_range.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\curl_rtmp.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\curl_sasl.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\curl_sspi.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\curl_threads.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\dict.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\doh.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\dotdot.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\easy.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\escape.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\file.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\fileinfo.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\formdata.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\ftp.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\ftplistparser.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\getenv.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\getinfo.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\gopher.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\hash.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\hmac.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\hostasyn.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\hostcheck.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\hostip.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\hostip4.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\hostip6.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\hostsyn.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\http.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\http2.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\http_chunks.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\http_digest.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\http_negotiate.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\http_ntlm.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\http_proxy.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\idn_win32.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\if2ip.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\imap.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\inet_ntop.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\inet_pton.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\krb5.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\ldap.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\llist.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\md4.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\md5.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\memdebug.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\mime.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\mprintf.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\multi.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\netrc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\non-ascii.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\nonblock.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\nwlib.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\nwos.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\openldap.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\parsedate.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\pingpong.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\pop3.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\progress.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\psl.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\rand.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\rename.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\rtsp.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\security.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\select.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\sendf.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\setopt.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\sha256.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\share.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\slist.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\smb.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\smtp.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\socketpair.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\socks.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\socks_gssapi.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\socks_sspi.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\speedcheck.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\splay.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\strcase.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\strdup.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\strerror.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\strtok.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\strtoofft.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\system_win32.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\telnet.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\tftp.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\timeval.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\transfer.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\url.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\urlapi.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\version.c">
<Filter>Source Files</Filter>
</ClCompile>
<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\x509asn1.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vauth\cleartext.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vauth\cram.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vauth\digest.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vauth\digest_sspi.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vauth\krb5_gssapi.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vauth\krb5_sspi.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vauth\ntlm.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vauth\ntlm_sspi.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vauth\oauth2.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vauth\spnego_gssapi.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vauth\spnego_sspi.c">
<Filter>Source Files</Filter>
</ClCompile>
<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>
<ClCompile Include="curl\lib\vssh\libssh2.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vssh\wolfssh.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vtls\bearssl.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vtls\gskit.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vtls\gtls.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vtls\mbedtls.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vtls\mbedtls_threadlock.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vtls\mesalink.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vtls\nss.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vtls\openssl.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vtls\schannel.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vtls\schannel_verify.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vtls\sectransp.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vtls\vtls.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vtls\wolfssl.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="curl\include\curl\curl.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\include\curl\curlver.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\include\curl\easy.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\include\curl\mprintf.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\include\curl\multi.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\include\curl\stdcheaders.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\include\curl\system.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\include\curl\typecheck-gcc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\include\curl\urlapi.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\altsvc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\amigaos.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\arpa_telnet.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\asyn.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\config-amigaos.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\config-dos.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\config-mac.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\config-os400.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\config-plan9.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\config-riscos.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\config-symbian.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\config-tpf.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\config-vxworks.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\config-win32.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\config-win32ce.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\conncache.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\connect.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\content_encoding.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\cookie.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\curlx.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\curl_addrinfo.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\curl_base64.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\curl_ctype.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\curl_des.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\curl_endian.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\curl_fnmatch.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\curl_gethostname.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\curl_get_line.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\curl_gssapi.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\curl_hmac.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\curl_ldap.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\curl_md4.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\curl_md5.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\curl_memory.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\curl_memrchr.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\curl_multibyte.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\curl_ntlm_core.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\curl_ntlm_wb.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\curl_path.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\curl_printf.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\curl_range.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\curl_rtmp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\curl_sasl.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\curl_sec.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\curl_setup.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\curl_setup_once.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\curl_sha256.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\curl_sspi.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\curl_threads.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\dict.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\doh.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\dotdot.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\easyif.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\escape.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\file.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\fileinfo.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\formdata.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\ftp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\ftplistparser.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\getinfo.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\gopher.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\hash.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\hostcheck.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\hostip.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\http.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\http2.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\http_chunks.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\http_digest.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\http_negotiate.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\http_ntlm.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\http_proxy.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\if2ip.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\imap.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\inet_ntop.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\inet_pton.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\llist.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\memdebug.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\mime.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\multihandle.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\multiif.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\netrc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\non-ascii.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\nonblock.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\parsedate.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\pingpong.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\pop3.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\progress.h">
<Filter>Header Files</Filter>
</ClInclude>
<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>
<ClInclude Include="curl\lib\rename.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\rtsp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\select.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\sendf.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\setopt.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\setup-os400.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\setup-vms.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\share.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\sigpipe.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\slist.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\smb.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\smtp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\sockaddr.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\socketpair.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\socks.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\speedcheck.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\splay.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\strcase.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\strdup.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\strerror.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\strtok.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\strtoofft.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\system_win32.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\telnet.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\tftp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\timeval.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\transfer.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\url.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\urlapi-int.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\urldata.h">
<Filter>Header Files</Filter>
</ClInclude>
<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\x509asn1.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\vauth\digest.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\vauth\ntlm.h">
<Filter>Header Files</Filter>
</ClInclude>
<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>
<ClInclude Include="curl\lib\vssh\wolfssh.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\vtls\bearssl.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\vtls\gskit.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\vtls\gtls.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\vtls\mbedtls.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\vtls\mbedtls_threadlock.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\vtls\mesalink.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\vtls\nssg.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\vtls\openssl.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\vtls\schannel.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\vtls\sectransp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\vtls\vtls.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\vtls\wolfssl.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="curl\lib\libcurl.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>
+1 -1
View File
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 2.8.4)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_BINARY_DIR}/cmake/modules")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
set(LIBUSB_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../libusb/)
+5 -5
View File
@@ -12,7 +12,7 @@ if(WITH_LLVM)
option(LLVM_INCLUDE_TOOLS OFF)
option(LLVM_INCLUDE_UTILS OFF)
option(WITH_POLLY OFF)
option(LLVM_ENABLE_CXX1Z TRUE)
option(LLVM_CCACHE_BUILD ON)
set(CXX_FLAGS_OLD ${CMAKE_CXX_FLAGS})
@@ -27,7 +27,7 @@ if(WITH_LLVM)
set(CMAKE_CXX_FLAGS ${CXX_FLAGS_OLD})
# now tries to find LLVM again
find_package(LLVM 10.0 CONFIG)
find_package(LLVM 11.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()
@@ -40,11 +40,11 @@ if(WITH_LLVM)
set(LLVM_DIR ${CMAKE_SOURCE_DIR}/${LLVM_DIR})
endif()
find_package(LLVM 10.0 CONFIG)
find_package(LLVM 11.0 CONFIG)
if (NOT LLVM_FOUND)
if (LLVM_VERSION AND LLVM_VERSION_MAJOR LESS 9)
message(FATAL_ERROR "Found LLVM version ${LLVM_VERSION}. Required version 9.0. \
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.")
endif()
+4 -4
View File
@@ -1,16 +1,16 @@
add_library(3rdparty_qt5 INTERFACE)
find_package(Qt5 5.14 CONFIG COMPONENTS Widgets Network Qml Concurrent)
find_package(Qt5 5.14 CONFIG COMPONENTS Widgets Concurrent)
if(WIN32)
find_package(Qt5 5.14 COMPONENTS WinExtras REQUIRED)
target_link_libraries(3rdparty_qt5 INTERFACE Qt5::Widgets Qt5::WinExtras Qt5::Network Qt5::Qml Qt5::Concurrent)
target_link_libraries(3rdparty_qt5 INTERFACE Qt5::Widgets Qt5::WinExtras Qt5::Concurrent)
else()
find_package(Qt5 5.14 COMPONENTS DBus Gui)
if(Qt5DBus_FOUND)
target_link_libraries(3rdparty_qt5 INTERFACE Qt5::Widgets Qt5::DBus Qt5::Network Qt5::Qml Qt5::Concurrent)
target_link_libraries(3rdparty_qt5 INTERFACE Qt5::Widgets Qt5::DBus Qt5::Concurrent)
target_compile_definitions(3rdparty_qt5 INTERFACE -DHAVE_QTDBUS)
else()
target_link_libraries(3rdparty_qt5 INTERFACE Qt5::Widgets Qt5::Network Qt5::Qml Qt5::Concurrent)
target_link_libraries(3rdparty_qt5 INTERFACE Qt5::Widgets Qt5::Concurrent)
endif()
target_include_directories(3rdparty_qt5 INTERFACE ${Qt5Gui_PRIVATE_INCLUDE_DIRS})
endif()
Vendored Submodule
+1
Submodule 3rdparty/wolfssl added at f7130a4e43
+162
View File
@@ -0,0 +1,162 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.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">
<ProjectGuid>{73973223-5EE8-41CA-8E88-1D60E89A237B}</ProjectGuid>
<RootNamespace>wolfssl</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="..\common_default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="..\common_default_macros.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>./wolfssl;./wolfssl/IDE/WIN;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WOLFSSL_LIB;WOLFSSL_USER_SETTINGS;CYASSL_USER_SETTINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4206;4214;4706;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>./wolfssl;./wolfssl/IDE/WIN;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WOLFSSL_LIB;WOLFSSL_USER_SETTINGS;CYASSL_USER_SETTINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="wolfssl\src\crl.c" />
<ClCompile Include="wolfssl\src\internal.c" />
<ClCompile Include="wolfssl\src\wolfio.c" />
<ClCompile Include="wolfssl\src\keys.c" />
<ClCompile Include="wolfssl\src\ocsp.c" />
<ClCompile Include="wolfssl\src\ssl.c" />
<ClCompile Include="wolfssl\src\tls.c" />
<ClCompile Include="wolfssl\src\tls13.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\aes.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\arc4.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\asn.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\blake2b.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\blake2s.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\camellia.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\chacha.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\chacha20_poly1305.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\cmac.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\coding.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\curve25519.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\cpuid.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\des3.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\dh.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\dsa.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\ecc.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\ed25519.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\error.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\fe_operations.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\ge_low_mem.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\ge_operations.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\hash.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\hc128.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\hmac.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\idea.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\integer.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\logging.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\md2.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\md4.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\md5.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\memory.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\pkcs7.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\pkcs12.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\poly1305.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\pwdbased.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\rabbit.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\random.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\ripemd.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\rsa.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\sha.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\sha256.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\sha3.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\sha512.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\signature.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\sp_c32.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\sp_c64.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\sp_int.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\sp_x86_64.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\srp.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\tfm.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\wc_encrypt.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\wc_pkcs11.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\wc_port.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\wolfmath.c" />
<ClCompile Include="wolfssl\wolfcrypt\src\wolfevent.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="wolfssl\resource.h" />
<CustomBuild Include="wolfssl\wolfcrypt\src\aes_asm.asm">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DLL Debug|x64'">false</ExcludedFromBuild>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">ml64.exe /c /Zi /Fo"$(OutDir)%(Filename).obj" %(Identity)</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='DLL Debug|x64'">ml64.exe /c /Zi /Fo"$(IntDir)%(Filename).obj" %(Identity)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)%(Filename).obj</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='DLL Debug|x64'">$(IntDir)%(Filename).obj</Outputs>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DLL Release|x64'">false</ExcludedFromBuild>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">ml64.exe /c /Zi /Fo"$(OutDir)%(Filename).obj" %(Identity)</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='DLL Release|x64'">ml64.exe /c /Zi /Fo"$(IntDir)%(Filename).obj" %(Identity)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(OutDir)%(Filename).obj</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='DLL Release|x64'">$(IntDir)%(Filename).obj</Outputs>
</CustomBuild>
<ClInclude Include="wolfssl\IDE\WIN\user_settings.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="wolfssl\wolfssl.rc">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ResourceCompile>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
+5
View File
@@ -37,6 +37,11 @@
<Import Project="..\rpcs3_release.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup>
<ClCompile>
<ExceptionHandling>Sync</ExceptionHandling>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="yaml-cpp\src\binary.cpp">
</ClCompile>
+2 -2
View File
@@ -110,9 +110,9 @@ git submodule update --init
Open `rpcs3.sln`. The recommended build configuration is `Release - LLVM` for all purposes.
You may want to download precompiled [LLVM libs](https://github.com/RPCS3/llvm/releases/download/continuous-master/llvmlibs.7z) and extract to root rpcs3 folder (which contains `rpcs3.sln`), as well as download and extract [additional libs](https://drive.google.com/uc?export=download&id=1A2eOMmCO714i0U7J0qI4aEMKnuWl8l_R) 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/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).
If you're not using precompiled libs, build the projects in *__BUILD_BEFORE* folder: right-click on every project > *Build*.
If you're not using the precompiled libs, build the projects in *__BUILD_BEFORE* folder: right-click on every project > *Build*.
`Build > Build Solution`
+1 -1
View File
@@ -22,7 +22,7 @@ option(USE_LIBEVDEV "libevdev-based joystick support" ON)
option(USE_DISCORD_RPC "Discord rich presence integration" ON)
option(USE_SYSTEM_ZLIB "Prefer system ZLIB instead of the builtin one" ON)
option(USE_VULKAN "Vulkan render backend" ON)
option(USE_COTIRE "Use precompiled headers" ON)
option(USE_PRECOMPILED_HEADERS "Use precompiled headers" ON)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/rpcs3/cmake_modules")
+2 -2
View File
@@ -2,7 +2,7 @@ RPCS3
=====
[![Build Status](https://travis-ci.org/RPCS3/rpcs3.svg?branch=master)](https://travis-ci.org/RPCS3/rpcs3)
[![Build status](https://ci.appveyor.com/api/projects/status/411c4clmiohtx7eo/branch/master?svg=true)](https://ci.appveyor.com/project/rpcs3/rpcs3/branch/master)
[![Build Status](https://dev.azure.com/nekotekina/nekotekina/_apis/build/status/RPCS3.rpcs3?branchName=master)](https://dev.azure.com/nekotekina/nekotekina/_build/latest?definitionId=4&branchName=master)
The world's first free and open-source PlayStation 3 emulator/debugger, written in C++ for Windows and Linux.
@@ -32,7 +32,7 @@ See [BUILDING.md](BUILDING.md) for more information about how to setup an enviro
Check our friendly [quickstart](https://rpcs3.net/quickstart) guide to make sure your computer meets the minimum system requirements to run RPCS3.
Don't forget to have your graphics driver up to date and to install the [Visual C++ Redistributable Packages for Visual Studio 2017](https://go.microsoft.com/fwlink/?LinkId=746572) if you are a Windows user.
Don't forget to have your graphics driver up to date and to install the [Visual C++ Redistributable Packages for Visual Studio 2019](https://aka.ms/vs/16/release/VC_redist.x64.exe) if you are a Windows user.
## License
+26 -8
View File
@@ -18,17 +18,17 @@ union alignas(16) v128
template <typename T, std::size_t N, std::size_t M>
struct masked_array_t // array type accessed as (index ^ M)
{
T m_data[N];
char m_data[16];
public:
T& operator[](std::size_t index)
{
return m_data[index ^ M];
return reinterpret_cast<T*>(m_data)[index ^ M];
}
const T& operator[](std::size_t index) const
{
return m_data[index ^ M];
return reinterpret_cast<const T*>(m_data)[index ^ M];
}
};
@@ -68,7 +68,7 @@ union alignas(16) v128
struct bit_array_128
{
u64 m_data[2];
char m_data[16];
public:
class bit_element
@@ -118,26 +118,30 @@ union alignas(16) v128
// Index 0 returns the MSB and index 127 returns the LSB
bit_element operator[](u32 index)
{
const auto data_ptr = reinterpret_cast<u64*>(m_data);
if constexpr (std::endian::little == std::endian::native)
{
return bit_element(m_data[1 - (index >> 6)], 0x8000000000000000ull >> (index & 0x3F));
return bit_element(data_ptr[1 - (index >> 6)], 0x8000000000000000ull >> (index & 0x3F));
}
else
{
return bit_element(m_data[index >> 6], 0x8000000000000000ull >> (index & 0x3F));
return bit_element(data_ptr[index >> 6], 0x8000000000000000ull >> (index & 0x3F));
}
}
// Index 0 returns the MSB and index 127 returns the LSB
bool operator[](u32 index) const
{
const auto data_ptr = reinterpret_cast<const u64*>(m_data);
if constexpr (std::endian::little == std::endian::native)
{
return (m_data[1 - (index >> 6)] & (0x8000000000000000ull >> (index & 0x3F))) != 0;
return (data_ptr[1 - (index >> 6)] & (0x8000000000000000ull >> (index & 0x3F))) != 0;
}
else
{
return (m_data[index >> 6] & (0x8000000000000000ull >> (index & 0x3F))) != 0;
return (data_ptr[index >> 6] & (0x8000000000000000ull >> (index & 0x3F))) != 0;
}
}
} _bit;
@@ -219,6 +223,20 @@ union alignas(16) v128
return ret;
}
// Unaligned load with optional index offset
static v128 loadu(const void* ptr, std::size_t index = 0)
{
v128 ret;
std::memcpy(&ret, static_cast<const u8*>(ptr) + index * sizeof(v128), sizeof(v128));
return ret;
}
// Unaligned store with optional index offset
static void storeu(v128 value, void* ptr, std::size_t index = 0)
{
std::memcpy(static_cast<u8*>(ptr) + index * sizeof(v128), &value, sizeof(v128));
}
static inline v128 add8(const v128& left, const v128& right)
{
return fromV(_mm_add_epi8(left.vi, right.vi));
+58 -20
View File
@@ -1,11 +1,14 @@
#include "stdafx.h"
#include "Config.h"
#include "Utilities/types.h"
#include "yaml-cpp/yaml.h"
#include "util/yaml.hpp"
#include <typeinfo>
#include <charconv>
[[noreturn]] void report_fatal_error(const std::string&);
LOG_CHANNEL(cfg_log, "CFG");
namespace cfg
@@ -15,7 +18,7 @@ namespace cfg
{
if (_type != type::node)
{
fmt::throw_exception("Invalid root node" HERE);
cfg_log.fatal("Invalid root node" HERE);
}
}
@@ -26,7 +29,7 @@ namespace cfg
{
if (pair.first == name)
{
fmt::throw_exception("Node already exists: %s" HERE, name);
cfg_log.fatal("Node already exists: %s" HERE, name);
}
}
@@ -35,12 +38,12 @@ namespace cfg
bool _base::from_string(const std::string&, bool)
{
fmt::throw_exception("from_string() purecall" HERE);
report_fatal_error("from_string() purecall" HERE);
}
bool _base::from_list(std::vector<std::string>&&)
{
fmt::throw_exception("from_list() purecall" HERE);
report_fatal_error("from_list() purecall" HERE);
}
// Emit YAML
@@ -80,7 +83,44 @@ bool cfg::try_to_int64(s64* out, const std::string& value, s64 min, s64 max)
if (result < min || result > max)
{
if (out) cfg_log.error("cfg::try_to_int('%s'): out of bounds (%lld..%lld)", value, min, max);
if (out) cfg_log.error("cfg::try_to_int('%s'): out of bounds (%d..%d)", value, min, max);
return false;
}
if (out) *out = result;
return true;
}
std::vector<std::string> cfg::make_uint_range(u64 min, u64 max)
{
return {std::to_string(min), std::to_string(max)};
}
bool cfg::try_to_uint64(u64* out, const std::string& value, u64 min, u64 max)
{
u64 result;
const char* start = &value.front();
const char* end = &value.back() + 1;
int base = 10;
if (start[0] == '0' && (start[1] == 'x' || start[1] == 'X'))
{
// Limited hex support
base = 16;
start += 2;
}
const auto ret = std::from_chars(start, end, result, base);
if (ret.ec != std::errc() || ret.ptr != end)
{
if (out) cfg_log.error("cfg::try_to_int('%s'): invalid integer", value);
return false;
}
if (result < min || result > max)
{
if (out) cfg_log.error("cfg::try_to_int('%s'): out of bounds (%u..%u)", value, min, max);
return false;
}
@@ -286,7 +326,7 @@ void cfg::decode(const YAML::Node& data, cfg::_base& rhs, bool dynamic)
if (YAML::convert<std::string>::decode(data, value))
{
rhs.from_string(value);
rhs.from_string(value, dynamic);
}
break; // ???
@@ -302,14 +342,17 @@ std::string cfg::node::to_string() const
return {out.c_str(), out.size()};
}
bool cfg::node::from_string(const std::string& value, bool dynamic) try
bool cfg::node::from_string(const std::string& value, bool dynamic)
{
cfg::decode(YAML::Load(value), *this, dynamic);
return true;
}
catch (const std::exception& e)
{
cfg_log.fatal("%s thrown: %s", typeid(e).name(), e.what());
auto [result, error] = yaml_load(value);
if (error.empty())
{
cfg::decode(result, *this, dynamic);
return true;
}
cfg_log.fatal("Failed to load node: %s", error);
return false;
}
@@ -338,12 +381,7 @@ void cfg::set_entry::from_default()
void cfg::log_entry::set_map(std::map<std::string, logs::level>&& map)
{
logs::reset();
for (auto&& pair : (m_map = std::move(map)))
{
logs::set_level(pair.first, pair.second);
}
m_map = std::move(map);
}
void cfg::log_entry::from_default()
+89 -8
View File
@@ -2,7 +2,7 @@
#include "Utilities/types.h"
#include "Utilities/StrFmt.h"
#include "Utilities/Log.h"
#include "util/logs.hpp"
#include "util/atomic.hpp"
#include "util/shared_cptr.hpp"
@@ -20,6 +20,12 @@ namespace cfg
// Convert string to signed integer
bool try_to_int64(s64* out, const std::string& value, s64 min, s64 max);
// Format min and max unsigned values
std::vector<std::string> make_uint_range(u64 min, u64 max);
// Convert string to unsigned integer
bool try_to_uint64(u64* out, const std::string& value, u64 min, u64 max);
// Internal hack
bool try_to_enum_value(u64* out, decltype(&fmt_class_string<int>::format) func, const std::string&);
@@ -27,12 +33,13 @@ namespace cfg
std::vector<std::string> try_to_enum_list(decltype(&fmt_class_string<int>::format) func);
// Config tree entry type.
enum class type : uint
enum class type : unsigned
{
node = 0, // cfg::node type
_bool, // cfg::_bool type
_enum, // cfg::_enum type
_int, // cfg::_int type
uint, // cfg::uint type
string, // cfg::string type
set, // cfg::set_entry type
log,
@@ -50,7 +57,7 @@ namespace cfg
_base(type _type);
// Owned entry constructor
_base(type _type, class node* owner, const std::string& name, bool dynamic = true);
_base(type _type, class node* owner, const std::string& name, bool dynamic);
public:
_base(const _base&) = delete;
@@ -126,7 +133,7 @@ namespace cfg
atomic_t<bool> m_value;
public:
const bool def;
bool def;
_bool(node* owner, const std::string& name, bool def = false, bool dynamic = false)
: _base(type::_bool, owner, name, dynamic)
@@ -302,6 +309,80 @@ namespace cfg
// Alias for 64 bit int
using int64 = _int<INT64_MIN, INT64_MAX>;
// Unsigned 32/64-bit integer entry with custom Min/Max range.
template <u64 Min, u64 Max>
class uint final : public _base
{
static_assert(Min < Max, "Invalid cfg::uint range");
// Prefer 32 bit type if possible
using int_type = std::conditional_t<Max <= UINT32_MAX, u32, u64>;
atomic_t<int_type> m_value;
public:
int_type def;
// Expose range
static const u64 max = Max;
static const 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)
, m_value(def)
, def(def)
{
}
operator int_type() const
{
return m_value;
}
int_type get() const
{
return m_value;
}
void from_default() override
{
m_value = def;
}
std::string to_string() const override
{
return std::to_string(m_value);
}
bool from_string(const std::string& value, bool /*dynamic*/ = false) override
{
u64 result;
if (try_to_uint64(&result, value, Min, Max))
{
m_value = static_cast<int_type>(result);
return true;
}
return false;
}
void set(const u64& value)
{
m_value = static_cast<int_type>(value);
}
std::vector<std::string> to_list() const override
{
return make_uint_range(Min, Max);
}
};
// Alias for 32 bit uint
using uint32 = uint<0, UINT32_MAX>;
// Alias for 64 bit int
using uint64 = uint<0, UINT64_MAX>;
// Simple string entry with mutex
class string final : public _base
{
@@ -359,15 +440,15 @@ namespace cfg
}
};
// Simple set entry with mutex (TODO: template for various types)
// Simple set entry (TODO: template for various types)
class set_entry final : public _base
{
std::set<std::string> m_set;
public:
// Default value is empty list in current implementation
set_entry(node* owner, const std::string& name, bool dynamic = false)
: _base(type::set, owner, name, dynamic)
set_entry(node* owner, const std::string& name)
: _base(type::set, owner, name, false)
{
}
@@ -402,7 +483,7 @@ namespace cfg
public:
log_entry(node* owner, const std::string& name)
: _base(type::log, owner, name)
: _base(type::log, owner, name, true)
{
}
+10 -14
View File
@@ -129,8 +129,7 @@ static fs::error to_error(DWORD e)
case ERROR_DIR_NOT_EMPTY: return fs::error::notempty;
case ERROR_NOT_READY: return fs::error::noent;
case ERROR_FILENAME_EXCED_RANGE: return fs::error::toolong;
//case ERROR_INVALID_PARAMETER: return fs::error::inval;
default: fmt::throw_exception("Unknown Win32 error: %u.", e);
default: return fs::error::unknown;
}
}
@@ -171,7 +170,7 @@ static fs::error to_error(int e)
case ENOTEMPTY: return fs::error::notempty;
case EROFS: return fs::error::readonly;
case EISDIR: return fs::error::isdir;
default: fmt::throw_exception("Unknown system error: %d.", e);
default: return fs::error::unknown;
}
}
@@ -1147,7 +1146,7 @@ fs::file::file(const std::string& path, bs_t<open_mode> mode)
return;
}
if (mode & fs::trunc && mode & (fs::lock + fs::unread))
if (mode & fs::trunc && mode & (fs::lock + fs::unread) && mode & fs::write)
{
// Postpone truncation in order to avoid using O_TRUNC on a locked file
verify(HERE), ::ftruncate(fd, 0) == 0;
@@ -1314,8 +1313,7 @@ fs::file::file(const void* ptr, std::size_t size)
const s64 new_pos =
whence == fs::seek_set ? offset :
whence == fs::seek_cur ? offset + m_pos :
whence == fs::seek_end ? offset + size() :
(fmt::raw_error("fs::file::memory_stream::seek(): invalid whence"), 0);
whence == fs::seek_end ? offset + size() : -1;
if (new_pos < 0)
{
@@ -1605,15 +1603,14 @@ bool fs::remove_all(const std::string& path, bool remove_root)
continue;
}
if (entry.is_directory == false)
if (!entry.is_directory)
{
if (!remove_file(path_append(path, entry.name)))
{
return false;
}
}
if (entry.is_directory == true)
else
{
if (!remove_all(path_append(path, entry.name)))
{
@@ -1653,12 +1650,11 @@ u64 fs::get_dir_size(const std::string& path, u64 rounding_alignment)
continue;
}
if (entry.is_directory == false)
if (!entry.is_directory)
{
result += ::align(entry.size, rounding_alignment);
}
if (entry.is_directory == true)
else
{
const u64 size = get_dir_size(path_append(path, entry.name), rounding_alignment);
@@ -1766,8 +1762,7 @@ fs::file fs::make_gather(std::vector<fs::file> files)
const s64 new_pos =
whence == fs::seek_set ? offset :
whence == fs::seek_cur ? offset + pos :
whence == fs::seek_end ? offset + end :
(fmt::raw_error("fs::gather_stream::seek(): invalid whence"), 0);
whence == fs::seek_end ? offset + end : -1;
if (new_pos < 0)
{
@@ -1823,6 +1818,7 @@ void fmt_class_string<fs::error>::format(std::string& out, u64 arg)
case fs::error::readonly: return "Read only";
case fs::error::isdir: return "Is a directory";
case fs::error::toolong: return "Path too long";
case fs::error::unknown: return "Unknown system error";
}
return unknown;
+15 -15
View File
@@ -290,16 +290,16 @@ namespace fs
}
// Write POD unconditionally
template<typename T>
std::enable_if_t<std::is_pod<T>::value && !std::is_pointer<T>::value, const file&> write(const T& data) const
template <typename T>
std::enable_if_t<std::is_trivially_copyable_v<T> && !std::is_pointer_v<T>, const file&> write(const T& data) const
{
if (write(std::addressof(data), sizeof(T)) != sizeof(T)) xfail();
return *this;
}
// Write POD std::vector unconditionally
template<typename T>
std::enable_if_t<std::is_pod<T>::value && !std::is_pointer<T>::value, const file&> write(const std::vector<T>& vec) const
template <typename T>
std::enable_if_t<std::is_trivially_copyable_v<T> && !std::is_pointer_v<T>, const file&> write(const std::vector<T>& vec) const
{
if (write(vec.data(), vec.size() * sizeof(T)) != vec.size() * sizeof(T)) xfail();
return *this;
@@ -319,30 +319,30 @@ namespace fs
}
// Read POD, sizeof(T) is used
template<typename T>
std::enable_if_t<std::is_pod<T>::value && !std::is_pointer<T>::value, bool> read(T& data) const
template <typename T>
std::enable_if_t<std::is_trivially_copyable_v<T> && !std::is_pointer_v<T>, bool> read(T& data) const
{
return read(&data, sizeof(T)) == sizeof(T);
}
// Read POD std::vector, size must be set by resize() method
template<typename T>
std::enable_if_t<std::is_pod<T>::value && !std::is_pointer<T>::value, bool> read(std::vector<T>& vec) const
template <typename T>
std::enable_if_t<std::is_trivially_copyable_v<T> && !std::is_pointer_v<T>, bool> read(std::vector<T>& vec) const
{
return read(vec.data(), sizeof(T) * vec.size()) == sizeof(T) * vec.size();
}
// Read POD std::vector
template<typename T>
std::enable_if_t<std::is_pod<T>::value && !std::is_pointer<T>::value, bool> read(std::vector<T>& vec, std::size_t size) const
template <typename T>
std::enable_if_t<std::is_trivially_copyable_v<T> && !std::is_pointer_v<T>, bool> read(std::vector<T>& vec, std::size_t size) const
{
vec.resize(size);
return read(vec.data(), sizeof(T) * size) == sizeof(T) * size;
}
// Read POD (experimental)
template<typename T>
std::enable_if_t<std::is_pod<T>::value && !std::is_pointer<T>::value, T> read() const
template <typename T>
std::enable_if_t<std::is_trivially_copyable_v<T> && !std::is_pointer_v<T>, T> read() const
{
T result;
if (!read(result)) xfail();
@@ -360,7 +360,7 @@ namespace fs
// Read full file to std::vector
template<typename T>
std::enable_if_t<std::is_pod<T>::value && !std::is_pointer<T>::value, std::vector<T>> to_vector() const
std::enable_if_t<std::is_trivially_copyable_v<T> && !std::is_pointer_v<T>, std::vector<T>> to_vector() const
{
std::vector<T> result;
result.resize(size() / sizeof(T));
@@ -516,6 +516,7 @@ namespace fs
readonly,
isdir,
toolong,
unknown
};
// Error code returned
@@ -597,8 +598,7 @@ namespace fs
const s64 new_pos =
whence == fs::seek_set ? offset :
whence == fs::seek_cur ? offset + pos :
whence == fs::seek_end ? offset + size() :
(fmt::raw_error("fs::container_stream<>::seek(): invalid whence"), 0);
whence == fs::seek_end ? offset + size() : -1;
if (new_pos < 0)
{
+34 -6
View File
@@ -2,7 +2,7 @@
#include "JIT.h"
#include "StrFmt.h"
#include "File.h"
#include "Log.h"
#include "util/logs.hpp"
#include "mutex.h"
#include "sysinfo.h"
#include "VirtualMemory.h"
@@ -918,12 +918,12 @@ public:
void notifyObjectCompiled(const llvm::Module* module, llvm::MemoryBufferRef obj) override
{
std::string name = m_path;
name.append(module->getName());
name.append(module->getName().data());
//fs::file(name, fs::rewrite).write(obj.getBufferStart(), obj.getBufferSize());
name.append(".gz");
z_stream zs{};
uLong zsz = compressBound(obj.getBufferSize()) + 256;
uLong zsz = compressBound(::narrow<u32>(obj.getBufferSize(), HERE)) + 256;
auto zbuf = std::make_unique<uchar[]>(zsz);
#ifndef _MSC_VER
#pragma GCC diagnostic push
@@ -965,6 +965,11 @@ public:
std::vector<uchar> gz = cached.to_vector<uchar>();
std::vector<uchar> out;
z_stream zs{};
if (gz.empty()) [[unlikely]]
{
return nullptr;
}
#ifndef _MSC_VER
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wold-style-cast"
@@ -1015,6 +1020,11 @@ public:
if (fs::file cached{path, fs::read})
{
if (cached.size() == 0) [[unlikely]]
{
return nullptr;
}
auto buf = llvm::WritableMemoryBuffer::getNewUninitMemBuffer(cached.size());
cached.read(buf->getBufferStart(), buf->getBufferSize());
return buf;
@@ -1026,7 +1036,7 @@ public:
std::unique_ptr<llvm::MemoryBuffer> getObject(const llvm::Module* module) override
{
std::string path = m_path;
path.append(module->getName());
path.append(module->getName().data());
if (auto buf = load(path))
{
@@ -1044,7 +1054,7 @@ std::string jit_compiler::cpu(const std::string& _cpu)
if (m_cpu.empty())
{
m_cpu = llvm::sys::getHostCPUName();
m_cpu = llvm::sys::getHostCPUName().operator std::string();
if (m_cpu == "sandybridge" ||
m_cpu == "ivybridge" ||
@@ -1077,7 +1087,7 @@ std::string jit_compiler::cpu(const std::string& _cpu)
m_cpu == "tigerlake")
{
// Downgrade if AVX-512 is disabled or not supported
if (!utils::has_512())
if (!utils::has_avx512())
{
m_cpu = "skylake";
}
@@ -1200,6 +1210,24 @@ void jit_compiler::add(const std::string& path)
}
}
bool jit_compiler::check(const std::string& path)
{
if (auto cache = ObjectCache::load(path))
{
if (auto object_file = llvm::object::ObjectFile::createObjectFile(*cache))
{
return true;
}
if (fs::remove_file(path))
{
jit_log.error("ObjectCache: Removed damaged file: %s", path);
}
}
return false;
}
void jit_compiler::fin()
{
m_engine->finalizeObject();
+3
View File
@@ -171,6 +171,9 @@ public:
// Add object (path to obj file)
void add(const std::string& path);
// Check object file
static bool check(const std::string& path);
// Finalize
void fin();
+50 -7
View File
@@ -1,10 +1,12 @@
#include "StrFmt.h"
#include "StrFmt.h"
#include "BEType.h"
#include "StrUtil.h"
#include "cfmt.h"
#include "util/logs.hpp"
#include <algorithm>
#include <string_view>
#include "Thread.h"
#ifdef _WIN32
#include <Windows.h>
@@ -12,6 +14,47 @@
#include <errno.h>
#endif
#ifdef _WIN32
std::string wchar_to_utf8(wchar_t *src)
{
std::string utf8_string;
const auto tmp_size = WideCharToMultiByte(CP_UTF8, 0, src, -1, nullptr, 0, nullptr, nullptr);
utf8_string.resize(tmp_size);
WideCharToMultiByte(CP_UTF8, 0, src, -1, utf8_string.data(), tmp_size, nullptr, nullptr);
return utf8_string;
}
std::string wchar_path_to_ansi_path(const std::wstring& src)
{
std::wstring buf_short;
std::string buf_final;
// Get the short path from the wide char path(short path should only contain ansi characters)
auto tmp_size = GetShortPathNameW(src.data(), nullptr, 0);
buf_short.resize(tmp_size);
GetShortPathNameW(src.data(), buf_short.data(), tmp_size);
// Convert wide char to ansi
tmp_size = WideCharToMultiByte(CP_ACP, 0, buf_short.data(), -1, nullptr, 0, nullptr, nullptr);
buf_final.resize(tmp_size);
WideCharToMultiByte(CP_ACP, 0, buf_short.data(), -1, buf_final.data(), tmp_size, nullptr, nullptr);
return buf_final;
}
std::string utf8_path_to_ansi_path(const std::string& src)
{
std::wstring buf_wide;
// Converts the utf-8 path to wide char
const auto tmp_size = MultiByteToWideChar(CP_UTF8, 0, src.c_str(), -1, nullptr, 0);
buf_wide.resize(tmp_size);
MultiByteToWideChar(CP_UTF8, 0, src.c_str(), -1, buf_wide.data(), tmp_size);
return wchar_path_to_ansi_path(buf_wide);
}
#endif
template <>
void fmt_class_string<std::pair<const fmt_type_info*, u64>>::format(std::string& out, u64 arg)
{
@@ -203,7 +246,7 @@ namespace fmt
{
void raw_error(const char* msg)
{
throw std::runtime_error{msg};
thread_ctrl::emergency_exit(msg);
}
void raw_verify_error(const char* msg, const fmt_type_info* sup, u64 arg)
@@ -236,7 +279,7 @@ namespace fmt
out += msg;
}
throw std::runtime_error{out};
thread_ctrl::emergency_exit(out);
}
void raw_narrow_error(const char* msg, const fmt_type_info* sup, u64 arg)
@@ -256,14 +299,14 @@ namespace fmt
out += msg;
}
throw std::range_error{out};
thread_ctrl::emergency_exit(out);
}
void raw_throw_exception(const char* fmt, const fmt_type_info* sup, const u64* args)
{
std::string out;
raw_append(out, fmt, sup, args);
throw std::runtime_error{out};
thread_ctrl::emergency_exit(out);
}
struct cfmt_src;
@@ -342,7 +385,7 @@ std::string fmt::replace_first(const std::string& src, const std::string& from,
{
auto pos = src.find(from);
if (pos == std::string::npos)
if (pos == umax)
{
return src;
}
@@ -353,7 +396,7 @@ std::string fmt::replace_first(const std::string& src, const std::string& from,
std::string fmt::replace_all(const std::string& src, const std::string& from, const std::string& to)
{
std::string target = src;
for (auto pos = target.find(from); pos != std::string::npos; pos = target.find(from, pos + 1))
for (auto pos = target.find(from); pos != umax; pos = target.find(from, pos + 1))
{
target = (pos ? target.substr(0, pos) + to : to) + std::string(target.c_str() + pos + from.length());
pos += to.length();
+12 -15
View File
@@ -7,22 +7,19 @@
#include <functional>
#include <string_view>
// Copy null-terminated string from std::string to char array with truncation
template <std::size_t N>
inline void strcpy_trunc(char (&dst)[N], const std::string& src)
{
const std::size_t count = src.size() >= N ? N - 1 : src.size();
std::memcpy(dst, src.c_str(), count);
std::memset(dst + count, 0, N - count);
}
#ifdef _WIN32
std::string wchar_to_utf8(wchar_t *src);
std::string wchar_path_to_ansi_path(const std::wstring& src);
std::string utf8_path_to_ansi_path(const std::string& src);
#endif
// Copy null-terminated string from char array to another char array with truncation
template <std::size_t N, std::size_t N2>
inline void strcpy_trunc(char (&dst)[N], const char (&src)[N2])
// 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)
{
const std::size_t count = N2 >= N ? N - 1 : N2;
std::memcpy(dst, src, count);
std::memset(dst + count, 0, N - count);
const std::size_t count = std::size(src) >= std::size(dst) ? std::size(dst) - 1 : std::size(src);
std::memcpy(std::data(dst), std::data(src), count);
std::memset(std::data(dst) + count, 0, std::size(dst) - count);
}
namespace fmt
@@ -84,7 +81,7 @@ namespace fmt
template <typename T>
std::string merge(const T& source, const std::string& separator)
{
if (!source.size())
if (source.empty())
{
return {};
}
+292 -128
View File
@@ -40,10 +40,41 @@
#include <sys/timerfd.h>
#endif
#include "sync.h"
#include "Log.h"
#if defined(__APPLE__) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
# include <sys/sysctl.h>
# include <unistd.h>
# if defined(__DragonFly__) || defined(__FreeBSD__)
# include <sys/user.h>
# endif
# if defined(__OpenBSD__)
# include <sys/param.h>
# include <sys/proc.h>
# endif
LOG_CHANNEL(sig_log);
# if defined(__NetBSD__)
# undef KERN_PROC
# define KERN_PROC KERN_PROC2
# define kinfo_proc kinfo_proc2
# endif
# if defined(__APPLE__)
# define KP_FLAGS kp_proc.p_flag
# elif defined(__DragonFly__)
# define KP_FLAGS kp_flags
# elif defined(__FreeBSD__)
# define KP_FLAGS ki_flag
# elif defined(__NetBSD__)
# define KP_FLAGS p_flag
# elif defined(__OpenBSD__)
# define KP_FLAGS p_psflags
# define P_TRACED PS_TRACED
# endif
#endif
#include "sync.h"
#include "util/logs.hpp"
LOG_CHANNEL(sig_log, "SIG");
LOG_CHANNEL(sys_log, "SYS");
LOG_CHANNEL(vm_log, "VM");
@@ -60,21 +91,68 @@ void fmt_class_string<std::thread::id>::format(std::string& out, u64 arg)
out += ss.str();
}
[[noreturn]] void catch_all_exceptions()
#ifndef _WIN32
bool IsDebuggerPresent()
{
try
#if defined(__APPLE__) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
int mib[] = {
CTL_KERN,
KERN_PROC,
KERN_PROC_PID,
getpid(),
# if defined(__NetBSD__) || defined(__OpenBSD__)
sizeof(struct kinfo_proc),
1,
# endif
};
u_int miblen = std::size(mib);
struct kinfo_proc info;
size_t size = sizeof(info);
if (sysctl(mib, miblen, &info, &size, NULL, 0))
{
throw;
return false;
}
catch (const std::exception& e)
return info.KP_FLAGS & P_TRACED;
#else
char buf[4096];
fs::file status_fd("/proc/self/status");
if (!status_fd)
{
report_fatal_error("{" + g_tls_log_prefix() + "} Unhandled exception of type '"s + typeid(e).name() + "': "s + e.what());
std::fprintf(stderr, "Failed to open /proc/self/status\n");
return false;
}
catch (...)
const auto num_read = status_fd.read(buf, sizeof(buf) - 1);
if (num_read == 0 || num_read == umax)
{
report_fatal_error("{" + g_tls_log_prefix() + "} Unhandled exception (unknown)");
std::fprintf(stderr, "Failed to read /proc/self/status (%d)\n", errno);
return false;
}
buf[num_read] = '\0';
std::string_view status = buf;
const auto found = status.find("TracerPid:");
if (found == umax)
{
std::fprintf(stderr, "Failed to find 'TracerPid:' in /proc/self/status\n");
return false;
}
for (const char* cp = status.data() + found + 10; cp <= status.data() + num_read; ++cp)
{
if (!std::isspace(*cp))
{
return std::isdigit(*cp) != 0 && *cp != '0';
}
}
return false;
#endif
}
#endif
enum x64_reg_t : u32
{
@@ -1111,33 +1189,12 @@ bool handle_access_violation(u32 addr, bool is_writing, x64_context* context) no
if (rsx::g_access_violation_handler)
{
bool handled = false;
try
if (cpu)
{
if (cpu)
{
vm::temporary_unlock(*cpu);
}
handled = rsx::g_access_violation_handler(addr, is_writing);
vm::temporary_unlock(*cpu);
}
catch (const std::exception& e)
{
rsx_log.fatal("g_access_violation_handler(0x%x, %d): %s", addr, is_writing, e.what());
if (cpu)
{
cpu->state += cpu_flag::dbg_pause;
if (cpu->test_stopped())
{
std::terminate();
}
}
return false;
}
bool handled = rsx::g_access_violation_handler(addr, is_writing);
if (handled)
{
@@ -1393,9 +1450,17 @@ bool handle_access_violation(u32 addr, bool is_writing, x64_context* context) no
pf_events->events.emplace(static_cast<u32>(data2), addr);
}
sig_log.error("Page_fault %s location 0x%x because of %s memory", is_writing ? "writing" : "reading",
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");
if (cpu->id_type() == 1)
{
if (const auto func = static_cast<ppu_thread*>(cpu)->current_function)
{
sig_log.warning("Page_fault while in function %s", func);
}
}
error_code sending_error = sys_event_port_send(pf_port_id, data1, data2, data3);
// If we fail due to being busy, wait a bit and try again.
@@ -1448,8 +1513,8 @@ bool handle_access_violation(u32 addr, bool is_writing, x64_context* context) no
{
if (!access_violation_recovered)
{
vm_log.notice("\n%s", cpu->dump());
vm_log.fatal("Access violation %s location 0x%x (%s)", is_writing ? "writing" : "reading", addr, (is_writing && vm::check_addr(addr)) ? "read-only memory" : "unmapped memory");
vm_log.notice("\n%s", cpu->dump_all());
vm_log.error("Access violation %s location 0x%x (%s)", is_writing ? "writing" : "reading", addr, (is_writing && vm::check_addr(addr)) ? "read-only memory" : "unmapped memory");
}
// TODO:
@@ -1479,7 +1544,7 @@ bool handle_access_violation(u32 addr, bool is_writing, x64_context* context) no
if (cpu && !access_violation_recovered)
{
vm_log.notice("\n%s", cpu->dump());
vm_log.notice("\n%s", cpu->dump_all());
}
// Note: a thread may access violate more than once after hack_alloc recovery
@@ -1560,7 +1625,7 @@ static LONG exception_filter(PEXCEPTION_POINTERS pExp) noexcept
if (const auto cpu = get_current_cpu_thread())
{
sys_log.notice("\n%s", cpu->dump());
sys_log.notice("\n%s", cpu->dump_all());
}
}
@@ -1568,9 +1633,6 @@ static LONG exception_filter(PEXCEPTION_POINTERS pExp) noexcept
fmt::append(msg, "Thread id = %s.\n", std::this_thread::get_id());
sys_log.notice("Memory bases:\nvm::g_base_addr = %p\nvm::g_sudo_addr = %p\nvm::g_exec_addr = %p\nvm::g_stat_addr = %p\nvm::g_reservations = %p\n",
vm::g_base_addr, vm::g_sudo_addr, vm::g_exec_addr, vm::g_stat_addr, vm::g_reservations);
std::vector<HMODULE> modules;
for (DWORD size = 256; modules.size() != size; size /= sizeof(HMODULE))
{
@@ -1692,12 +1754,9 @@ static void signal_handler(int sig, siginfo_t* info, void* uct) noexcept
if (const auto cpu = get_current_cpu_thread())
{
sys_log.notice("\n%s", cpu->dump());
sys_log.notice("\n%s", cpu->dump_all());
}
sys_log.notice("Memory bases:\nvm::g_base_addr = %p\nvm::g_sudo_addr = %p\nvm::g_exec_addr = %p\nvm::g_stat_addr = %p\nvm::g_reservations = %p\n",
vm::g_base_addr, vm::g_sudo_addr, vm::g_exec_addr, vm::g_stat_addr, vm::g_reservations);
std::string msg = fmt::format("Segfault %s location %p at %p.\n", cause, info->si_addr, RIP(context));
if (thread_ctrl::get_current())
@@ -1709,8 +1768,14 @@ static void signal_handler(int sig, siginfo_t* info, void* uct) noexcept
fmt::append(msg, "Thread id = %s.\n", std::this_thread::get_id());
// TODO (debugger interaction)
sys_log.fatal("\n%s", msg);
std::fprintf(stderr, "%s\n", msg.c_str());
if (IsDebuggerPresent())
{
__asm("int3;");
}
report_fatal_error(msg);
}
@@ -1723,17 +1788,37 @@ const bool s_exception_handler_set = []() -> bool
if (::sigaction(SIGSEGV, &sa, NULL) == -1)
{
std::printf("sigaction(SIGSEGV) failed (0x%x).", errno);
std::fprintf(stderr, "sigaction(SIGSEGV) failed (%d).\n", errno);
std::abort();
}
std::printf("Debugger: %d\n", +IsDebuggerPresent());
return true;
}();
#endif
const bool s_terminate_handler_set = []() -> bool
{
std::set_terminate([]()
{
if (IsDebuggerPresent())
#ifdef _MSC_VER
__debugbreak();
#else
__asm("int3;");
#endif
report_fatal_error("RPCS3 has abnormally terminated.");
});
return true;
}();
thread_local DECLARE(thread_ctrl::g_tls_this_thread) = nullptr;
thread_local DECLARE(thread_ctrl::g_tls_error_callback) = nullptr;
DECLARE(thread_ctrl::g_native_core_layout) { native_core_arrangement::undefined };
void thread_base::start(native_entry entry)
@@ -1746,11 +1831,13 @@ void thread_base::start(native_entry entry)
#endif
}
void thread_base::initialize(bool(*wait_cb)(const void*))
void thread_base::initialize(void (*error_cb)(), bool(*wait_cb)(const void*))
{
// Initialize TLS variable
// Initialize TLS variables
thread_ctrl::g_tls_this_thread = this;
thread_ctrl::g_tls_error_callback = error_cb;
// Initialize atomic wait callback
atomic_storage_futex::set_wait_callback(wait_cb);
@@ -1800,36 +1887,18 @@ void thread_base::initialize(bool(*wait_cb)(const void*))
name.resize(std::min<std::size_t>(15, name.size()));
pthread_setname_np(pthread_self(), name.c_str());
#endif
#ifdef __linux__
m_timer = timerfd_create(CLOCK_MONOTONIC, 0);
if (m_timer == -1)
{
sig_log.error("Linux timer allocation failed, use wait_unlock() only");
}
#endif
}
void thread_base::notify_abort() noexcept
{
// For now
notify();
atomic_storage_futex::raw_notify(+m_state_notifier);
}
bool thread_base::finalize(int) noexcept
bool thread_base::finalize(thread_state result_state) noexcept
{
// Report pending errors
error_code::error_report(0, 0, 0, 0);
#ifdef __linux__
if (m_timer != -1)
{
close(m_timer);
}
#endif
#ifdef _WIN32
ULONG64 cycles{};
QueryThreadCycleTime(GetCurrentThread(), &cycles);
@@ -1872,7 +1941,7 @@ bool thread_base::finalize(int) noexcept
fsoft, fhard, ctxvol, ctxinv);
// Return true if need to delete thread object
const bool ok = m_state.exchange(thread_state::finished) <= thread_state::aborting;
const bool ok = m_state.exchange(result_state) <= thread_state::aborting;
// Signal waiting threads
m_state.notify_all();
@@ -1883,6 +1952,7 @@ bool thread_base::finalize(int) noexcept
void thread_base::finalize() noexcept
{
atomic_storage_futex::set_wait_callback([](const void*){ return true; });
g_tls_log_prefix = []() -> std::string { return {}; };
thread_ctrl::g_tls_this_thread = nullptr;
}
@@ -1892,7 +1962,34 @@ void thread_ctrl::_wait_for(u64 usec, bool alert /* true */)
auto _this = g_tls_this_thread;
#ifdef __linux__
if (!alert && _this->m_timer != -1 && usec > 0 && usec <= 1000)
static thread_local struct linux_timer_handle_t
{
// Allocate timer only if needed (i.e. someone calls _wait_for with alert and short period)
const int m_timer = timerfd_create(CLOCK_MONOTONIC, 0);
linux_timer_handle_t() noexcept
{
if (m_timer == -1)
{
sig_log.error("Linux timer allocation failed, using the fallback instead.");
}
}
operator int() const
{
return m_timer;
}
~linux_timer_handle_t()
{
if (m_timer != -1)
{
close(m_timer);
}
}
} fd_timer;
if (!alert && usec > 0 && usec <= 1000 && fd_timer != -1)
{
struct itimerspec timeout;
u64 missed;
@@ -1902,55 +1999,19 @@ void thread_ctrl::_wait_for(u64 usec, bool alert /* true */)
timeout.it_value.tv_sec = nsec / 1000000000ull;
timeout.it_interval.tv_sec = 0;
timeout.it_interval.tv_nsec = 0;
timerfd_settime(_this->m_timer, 0, &timeout, NULL);
if (read(_this->m_timer, &missed, sizeof(missed)) != sizeof(missed))
timerfd_settime(fd_timer, 0, &timeout, NULL);
if (read(fd_timer, &missed, sizeof(missed)) != sizeof(missed))
sig_log.error("timerfd: read() failed");
return;
}
#endif
std::unique_lock lock(_this->m_mutex, std::defer_lock);
while (true)
if (_this->m_signal && _this->m_signal.exchange(0))
{
// Mutex is unlocked at the start and after the waiting
if (u32 sig = _this->m_signal.load())
{
if (sig & 1)
{
_this->m_signal &= ~1;
return;
}
}
if (usec == 0)
{
// No timeout: return immediately
return;
}
if (!lock)
{
lock.lock();
}
// Double-check the value
if (u32 sig = _this->m_signal.load())
{
if (sig & 1)
{
_this->m_signal &= ~1;
return;
}
}
_this->m_cond.wait_unlock(usec, lock);
if (usec < cond_variable::max_timeout)
{
usec = 0;
}
return;
}
_this->m_signal.wait(0, atomic_wait_timeout{usec <= 0xffff'ffff'ffff'ffff / 1000 ? usec * 1000 : 0xffff'ffff'ffff'ffff});
}
std::string thread_ctrl::get_name_cached()
@@ -1989,22 +2050,24 @@ thread_base::~thread_base()
}
}
void thread_base::join() const
bool thread_base::join() const
{
for (auto state = m_state.load(); state != thread_state::finished;)
for (auto state = m_state.load(); state != thread_state::finished && state != thread_state::errored;)
{
m_state.wait(state);
state = m_state;
}
return m_state.load() == thread_state::finished;
}
void thread_base::notify()
{
if (!(m_signal & 1))
// Increment with saturation
if (m_signal.try_inc())
{
m_signal |= 1;
m_mutex.lock_unlock();
m_cond.notify_one();
// Considered impossible to have a situation when not notified
m_signal.notify_all();
}
}
@@ -2045,17 +2108,58 @@ u64 thread_base::get_cycles()
}
}
void thread_ctrl::emergency_exit(std::string_view reason)
{
sig_log.fatal("Thread terminated due to fatal error: %s", reason);
std::fprintf(stderr, "Thread '%s' terminated due to fatal error: %s\n", g_tls_log_prefix().c_str(), std::string(reason).c_str());
#ifdef _WIN32
if (IsDebuggerPresent())
{
OutputDebugStringA(fmt::format("Thread '%s' terminated due to fatal error: %s\n", g_tls_log_prefix(), reason).c_str());
__debugbreak();
}
#else
if (IsDebuggerPresent())
{
__asm("int3;");
}
#endif
if (const auto _this = g_tls_this_thread)
{
g_tls_error_callback();
if (_this->finalize(thread_state::errored))
{
delete _this;
}
thread_base::finalize();
#ifdef _WIN32
_endthreadex(0);
#else
pthread_exit(0);
#endif
}
// Assume main thread
report_fatal_error(std::string(reason));
}
void thread_ctrl::detect_cpu_layout()
{
if (!g_native_core_layout.compare_and_swap_test(native_core_arrangement::undefined, native_core_arrangement::generic))
return;
const auto system_id = utils::get_system_info();
if (system_id.find("Ryzen") != std::string::npos)
if (system_id.find("Ryzen") != umax)
{
g_native_core_layout.store(native_core_arrangement::amd_ccx);
}
else if (system_id.find("Intel") != std::string::npos)
else if (system_id.find("Intel") != umax)
{
#ifdef _WIN32
const LOGICAL_PROCESSOR_RELATIONSHIP relationship = LOGICAL_PROCESSOR_RELATIONSHIP::RelationProcessorCore;
@@ -2125,7 +2229,7 @@ u64 thread_ctrl::get_affinity_mask(thread_class group)
const auto system_id = utils::get_system_info();
if (thread_count >= 32)
{
if (system_id.find("3950X") != std::string::npos)
if (system_id.find("3950X") != umax)
{
// zen2
// Ryzen 9 3950X
@@ -2134,7 +2238,7 @@ u64 thread_ctrl::get_affinity_mask(thread_class group)
spu_mask = 0b00000000111111110000000000000000;
rsx_mask = 0b00000000000000001111111100000000;
}
else if (system_id.find("2970WX") != std::string::npos)
else if (system_id.find("2970WX") != umax)
{
// zen+
// Threadripper 2970WX
@@ -2156,7 +2260,7 @@ u64 thread_ctrl::get_affinity_mask(thread_class group)
}
else if (thread_count == 24)
{
if (system_id.find("3900X") != std::string::npos)
if (system_id.find("3900X") != umax)
{
// zen2
// Ryzen 9 3900X
@@ -2177,7 +2281,7 @@ u64 thread_ctrl::get_affinity_mask(thread_class group)
}
else if (thread_count == 16)
{
if (system_id.find("3700X") != std::string::npos || system_id.find("3800X") != std::string::npos)
if (system_id.find("3700X") != umax || system_id.find("3800X") != umax)
{
// Ryzen 7 3700/3800 (x)
// Assign threads 1-16
@@ -2197,7 +2301,7 @@ u64 thread_ctrl::get_affinity_mask(thread_class group)
}
else if (thread_count == 12)
{
if (system_id.find("3600") != std::string::npos)
if (system_id.find("3600") != umax)
{
// zen2
// R5 3600 (x)
@@ -2302,7 +2406,7 @@ void thread_ctrl::set_thread_affinity_mask(u64 mask)
SetThreadAffinityMask(_this_thread, mask);
#elif __APPLE__
// Supports only one core
thread_affinity_policy_data_t policy = { static_cast<integer_t>(utils::cnttz64(mask)) };
thread_affinity_policy_data_t policy = { static_cast<integer_t>(std::countr_zero(mask)) };
thread_port_t mach_thread = pthread_mach_thread_np(pthread_self());
thread_policy_set(mach_thread, THREAD_AFFINITY_POLICY, reinterpret_cast<thread_policy_t>(&policy), 1);
#elif defined(__linux__) || defined(__DragonFly__) || defined(__FreeBSD__)
@@ -2327,6 +2431,66 @@ void thread_ctrl::set_thread_affinity_mask(u64 mask)
}
}
pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cs);
if (int err = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cs))
{
sig_log.error("Failed to set thread affinity 0x%x: error %d.", mask, err);
}
#endif
}
u64 thread_ctrl::get_thread_affinity_mask()
{
#ifdef _WIN32
DWORD_PTR res, _sys;
if (!GetProcessAffinityMask(GetCurrentProcess(), &res, &_sys))
{
sig_log.error("Failed to get process affinity mask.");
return 0;
}
if (DWORD_PTR result = SetThreadAffinityMask(GetCurrentThread(), res))
{
if (res != result)
{
SetThreadAffinityMask(GetCurrentThread(), result);
}
return result;
}
sig_log.error("Failed to get thread affinity mask.");
return 0;
#elif defined(__linux__) || defined(__DragonFly__) || defined(__FreeBSD__)
cpu_set_t cs;
CPU_ZERO(&cs);
if (int err = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cs))
{
sig_log.error("Failed to get thread affinity mask: error %d.", err);
return 0;
}
u64 result;
for (u32 core = 0; core < 64u; core++)
{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wold-style-cast"
if (CPU_ISSET(core, &cs))
#pragma GCC diagnostic pop
{
result |= 1ull << core;
}
}
if (result == 0)
{
sig_log.error("Thread affinity mask is out of u64 range.");
return 0;
}
return result;
#else
return -1;
#endif
}
+61 -42
View File
@@ -15,9 +15,6 @@
// Report error and call std::abort(), defined in main.cpp
[[noreturn]] void report_fatal_error(const std::string&);
// Will report exception and call std::abort() if put in catch(...)
[[noreturn]] void catch_all_exceptions();
// Hardware core layout
enum class native_core_arrangement : u32
{
@@ -39,6 +36,7 @@ enum class thread_state : u32
{
created, // Initial state
aborting, // The thread has been joined in the destructor or explicitly aborted
errored, // Set after the emergency_exit call
finished // Final state, always set at the end of thread execution
};
@@ -48,6 +46,8 @@ class named_thread;
template <typename T>
struct result_storage
{
static_assert(std::is_default_constructible_v<T> && noexcept(T()));
alignas(T) std::byte data[sizeof(T)];
static constexpr bool empty = false;
@@ -97,21 +97,10 @@ class thread_base
using native_entry = void*(*)(void* arg);
#endif
#ifdef __linux__
// Linux thread timer
int m_timer = -1;
#endif
// Thread handle (platform-specific)
atomic_t<std::uintptr_t> m_thread{0};
// Thread mutex
mutable shared_mutex m_mutex;
// Thread condition variable
cond_variable m_cond;
// Thread flags
// Thread playtoy, that shouldn't be used
atomic_t<u32> m_signal{0};
// Thread state
@@ -130,13 +119,13 @@ class thread_base
void start(native_entry);
// Called at the thread start
void initialize(bool(*wait_cb)(const void*));
void initialize(void (*error_cb)(), bool(*wait_cb)(const void*));
// May be called in destructor
void notify_abort() noexcept;
// Called at the thread end, returns true if needs destruction
bool finalize(int) noexcept;
bool finalize(thread_state result) noexcept;
// Cleanup after possibly deleting the thread instance
static void finalize() noexcept;
@@ -156,7 +145,7 @@ public:
u64 get_cycles();
// Wait for the thread (it does NOT change thread state, and can be called from multiple threads)
void join() const;
bool join() const;
// Notify the thread
void notify();
@@ -168,6 +157,9 @@ class thread_ctrl final
// Current thread
static thread_local thread_base* g_tls_this_thread;
// Error handling details
static thread_local void(*g_tls_error_callback)();
// Target cpu core layout
static atomic_t<native_core_arrangement> g_native_core_layout;
@@ -236,20 +228,8 @@ public:
_wait_for(-1, true);
}
// Wait until pred().
template <typename F, typename RT = std::invoke_result_t<F>>
static inline RT wait(F&& pred)
{
while (true)
{
if (RT result = pred())
{
return result;
}
_wait_for(-1, true);
}
}
// Exit.
[[noreturn]] static void emergency_exit(std::string_view reason);
// Get current thread (may be nullptr)
static thread_base* get_current()
@@ -268,6 +248,9 @@ public:
// Sets the preferred affinity mask for this thread
static void set_thread_affinity_mask(u64 mask);
// Miscellaneous
static u64 get_thread_affinity_mask();
};
// Derived from the callable object Context, possibly a lambda
@@ -279,9 +262,9 @@ class named_thread final : public Context, result_storage_t<Context>, thread_bas
// Type-erased thread entry point
#ifdef _WIN32
static inline uint __stdcall entry_point(void* arg) try
static inline uint __stdcall entry_point(void* arg)
#else
static inline void* entry_point(void* arg) try
static inline void* entry_point(void* arg)
#endif
{
const auto _this = static_cast<named_thread*>(static_cast<thread*>(arg));
@@ -295,14 +278,19 @@ class named_thread final : public Context, result_storage_t<Context>, thread_bas
thread::finalize();
return 0;
}
catch (...)
{
catch_all_exceptions();
}
bool entry_point()
{
thread::initialize([](const void* data)
auto tls_error_cb = []()
{
if constexpr (!result::empty)
{
// Construct using default constructor in the case of failure
new (static_cast<result*>(static_cast<named_thread*>(thread_ctrl::get_current()))->get()) typename result::type();
}
};
thread::initialize(tls_error_cb, [](const void* data)
{
const auto _this = thread_ctrl::get_current();
@@ -338,7 +326,7 @@ class named_thread final : public Context, result_storage_t<Context>, thread_bas
new (result::get()) typename result::type(Context::operator()());
}
return thread::finalize(0);
return thread::finalize(thread_state::finished);
}
friend class thread_ctrl;
@@ -442,6 +430,11 @@ class named_thread_group final
Thread* m_threads;
void init_threads()
{
m_threads = static_cast<Thread*>(::operator new(sizeof(Thread) * m_count, std::align_val_t{alignof(Thread)}));
}
public:
// Lambda constructor, also the implicit deduction guide candidate
named_thread_group(std::string_view name, u32 count, const Context& f)
@@ -453,7 +446,7 @@ public:
return;
}
m_threads = static_cast<Thread*>(::operator new(sizeof(Thread) * m_count, std::align_val_t{alignof(Thread)}));
init_threads();
// Create all threads
for (u32 i = 0; i < m_count; i++)
@@ -462,17 +455,43 @@ public:
}
}
// Default constructor
named_thread_group(std::string_view name, u32 count)
: m_count(count)
, m_threads(nullptr)
{
if (count == 0)
{
return;
}
init_threads();
// Create all threads
for (u32 i = 0; i < m_count; i++)
{
new (static_cast<void*>(m_threads + i)) Thread(std::string(name) + std::to_string(i + 1));
}
}
named_thread_group(const named_thread_group&) = delete;
named_thread_group& operator=(const named_thread_group&) = delete;
// Wait for completion
void join() const
bool join() const
{
bool result = true;
for (u32 i = 0; i < m_count; i++)
{
std::as_const(*std::launder(m_threads + i))();
if (std::as_const(*std::launder(m_threads + i)) != thread_state::finished)
result = false;
}
return result;
}
// Join and access specific thread
+4 -3
View File
@@ -1,5 +1,5 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "util/logs.hpp"
#include "VirtualMemory.h"
#ifdef _WIN32
#include <Windows.h>
@@ -141,8 +141,9 @@ namespace utils
#endif
}
shm::shm(u32 size)
shm::shm(u32 size, u32 flags)
: m_size(::align(size, 0x10000))
, m_flags(flags)
{
#ifdef _WIN32
m_handle = ::CreateFileMappingW(INVALID_HANDLE_VALUE, NULL, PAGE_EXECUTE_READWRITE, 0, m_size, NULL);
@@ -154,7 +155,7 @@ namespace utils
#else
while ((m_file = ::shm_open("/rpcs3-mem1", O_RDWR | O_CREAT | O_EXCL, S_IWUSR | S_IRUSR)) == -1)
{
if (m_file == -1 && errno == EMFILE)
if (errno == EMFILE)
{
fmt::throw_exception("Too many open files. Raise the limit and try again.");
}
+8 -1
View File
@@ -48,9 +48,10 @@ namespace utils
int m_file;
#endif
u32 m_size;
u32 m_flags;
public:
explicit shm(u32 size);
explicit shm(u32 size, u32 flags = 0);
shm(const shm&) = delete;
@@ -74,5 +75,11 @@ namespace utils
{
return m_size;
}
// Flags are unspecified, consider it userdata
u32 flags() const
{
return m_flags;
}
};
}
+13 -10
View File
@@ -60,21 +60,26 @@ namespace utils
return (start1 >= start2 && end1 <= end2);
}
address_range(u32 _start, u32 _end) : start(_start), end(_end) {}
constexpr address_range(u32 _start, u32 _end) : start(_start), end(_end) {}
public:
// Constructors
address_range() = default;
address_range(const address_range &other) : start(other.start), end(other.end) {}
constexpr address_range() = default;
constexpr address_range(const address_range &other) : start(other.start), end(other.end) {}
static inline address_range start_length(u32 _start, u32 _length)
static constexpr address_range start_length(u32 _start, u32 _length)
{
return address_range(_start, _start + (_length - 1));
if (!_length)
{
return {};
}
return {_start, _start + (_length - 1)};
}
static inline address_range start_end(u32 _start, u32 _end)
static constexpr address_range start_end(u32 _start, u32 _end)
{
return address_range(_start, _end);
return {_start, _end};
}
// Length
@@ -176,9 +181,7 @@ namespace utils
void set_min_max(const address_range &other)
{
const address_range _range = get_min_max(other);
start = _range.start;
end = _range.end;
*this = get_min_max(other);
}
bool is_page_range() const
-65
View File
@@ -4,71 +4,6 @@
namespace utils
{
inline u32 cntlz32(u32 arg, bool nonzero = false)
{
#ifdef _MSC_VER
ulong res;
return _BitScanReverse(&res, arg) || nonzero ? res ^ 31 : 32;
#elif __LZCNT__
return _lzcnt_u32(arg);
#else
return arg || nonzero ? __builtin_clz(arg) : 32;
#endif
}
inline u64 cntlz64(u64 arg, bool nonzero = false)
{
#ifdef _MSC_VER
ulong res;
return _BitScanReverse64(&res, arg) || nonzero ? res ^ 63 : 64;
#elif __LZCNT__
return _lzcnt_u64(arg);
#else
return arg || nonzero ? __builtin_clzll(arg) : 64;
#endif
}
inline u32 cnttz32(u32 arg, bool nonzero = false)
{
#ifdef _MSC_VER
ulong res;
return _BitScanForward(&res, arg) || nonzero ? res : 32;
#elif __BMI__
return _tzcnt_u32(arg);
#else
return arg || nonzero ? __builtin_ctz(arg) : 32;
#endif
}
inline u64 cnttz64(u64 arg, bool nonzero = false)
{
#ifdef _MSC_VER
ulong res;
return _BitScanForward64(&res, arg) || nonzero ? res : 64;
#elif __BMI__
return _tzcnt_u64(arg);
#else
return arg || nonzero ? __builtin_ctzll(arg) : 64;
#endif
}
inline u8 popcnt32(u32 arg)
{
#ifdef _MSC_VER
const u32 a1 = arg & 0x55555555;
const u32 a2 = (arg >> 1) & 0x55555555;
const u32 a3 = a1 + a2;
const u32 b1 = a3 & 0x33333333;
const u32 b2 = (a3 >> 2) & 0x33333333;
const u32 b3 = b1 + b2;
const u32 c3 = (b3 + (b3 >> 4)) & 0x0f0f0f0f;
const u32 d3 = c3 + (c3 >> 8);
return static_cast<u8>(d3 + (d3 >> 16));
#else
return __builtin_popcount(arg);
#endif
}
// Rotate helpers
#if defined(__GNUG__)
+4 -8
View File
@@ -1,5 +1,5 @@
#include "bin_patch.h"
#include <yaml-cpp/yaml.h>
#include "util/yaml.hpp"
#include "File.h"
#include "Config.h"
@@ -34,15 +34,11 @@ void patch_engine::append(const std::string& patch)
{
if (fs::file f{patch})
{
YAML::Node root;
auto [root, error] = yaml_load(f.to_string());
try
if (!error.empty())
{
root = YAML::Load(f.to_string());
}
catch (const std::exception& e)
{
patch_log.fatal("Failed to load patch file %s\n%s thrown: %s", patch, typeid(e).name(), e.what());
patch_log.fatal("Failed to load patch file %s:\n%s", patch, error);
return;
}
+2 -3
View File
@@ -1,7 +1,6 @@
#pragma once
#include "types.h"
#include "asm.h"
#include <climits>
#include <string>
#include <vector>
@@ -59,7 +58,7 @@ std::size_t cfmt_append(Dst& out, const Char* fmt, Src&& src)
const auto write_octal = [&](u64 value, u64 min_num)
{
out.resize(out.size() + std::max<u64>(min_num, 66 / 3 - (utils::cntlz64(value | 1, true) + 2) / 3), '0');
out.resize(out.size() + std::max<u64>(min_num, 66 / 3 - (std::countl_zero<u64>(value | 1) + 2) / 3), '0');
// Write in reversed order
for (auto i = out.rbegin(); value; i++, value /= 8)
@@ -70,7 +69,7 @@ std::size_t cfmt_append(Dst& out, const Char* fmt, Src&& src)
const auto write_hex = [&](u64 value, bool upper, u64 min_num)
{
out.resize(out.size() + std::max<u64>(min_num, 64 / 4 - utils::cntlz64(value | 1, true) / 4), '0');
out.resize(out.size() + std::max<u64>(min_num, 64 / 4 - std::countl_zero<u64>(value | 1) / 4), '0');
// Write in reversed order
for (auto i = out.rbegin(); value; i++, value /= 16)
+3 -3
View File
@@ -1,4 +1,4 @@
#include "cond.h"
#include "cond.h"
#include "sync.h"
#include "lockless.h"
@@ -38,7 +38,7 @@ void cond_variable::imp_wake(u32 _count) noexcept
}
// Add signal
value += c_signal_mask & -c_signal_mask;
value += c_signal_mask & (0 - c_signal_mask);
return true;
});
@@ -47,7 +47,7 @@ void cond_variable::imp_wake(u32 _count) noexcept
return;
}
if (_count > 1 || ((_old + (c_signal_mask & -c_signal_mask)) & c_signal_mask) == c_signal_mask)
if (_count > 1 || ((_old + (c_signal_mask & (0 - c_signal_mask))) & c_signal_mask) == c_signal_mask)
{
// Resort to notify_all if signal count reached max
m_value.notify_all();
-1
View File
@@ -3,7 +3,6 @@
#include "types.h"
#include "util/atomic.hpp"
#include <shared_mutex>
#include "asm.h"
// Lightweight condition variable
class cond_variable
+18 -9
View File
@@ -47,8 +47,9 @@ if errorlevel 1 (
echo // This is a generated file. > "%GIT_VERSION_FILE%"
echo. >> "%GIT_VERSION_FILE%"
echo #define RPCS3_GIT_VERSION "unknown" >> "%GIT_VERSION_FILE%"
echo #define RPCS3_GIT_BRANCH "unknown" >> "%GIT_VERSION_FILE%"
echo #define RPCS3_GIT_VERSION ^"local_build^" >> "%GIT_VERSION_FILE%"
echo #define RPCS3_GIT_BRANCH ^"local_build^" >> "%GIT_VERSION_FILE%"
echo #define RPCS3_GIT_FULL_BRANCH ^"local_build^" >> "%GIT_VERSION_FILE%"
echo. >> "%GIT_VERSION_FILE%"
echo // If you don't want this file to update/recompile, change to 1. >> "%GIT_VERSION_FILE%"
echo #define RPCS3_GIT_VERSION_NO_UPDATE 0 >> "%GIT_VERSION_FILE%"
@@ -58,30 +59,37 @@ if errorlevel 1 (
rem // Get commit count from (unshallowed) HEAD
for /F %%I IN ('call %GIT% rev-list HEAD --count') do set COMMIT_COUNT=%%I
rem // If we're in AppVeyor, building a non-master, pull request artifact
if defined APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH (
if defined SYSTEM_PULLREQUEST_SOURCEBRANCH (
rem // These environment variables are defined by Azure pipelines
rem // BUILD_REPOSITORY_NAME will look like "RPCS3/rpcs3"
rem // SYSTEM_PULLREQUEST_SOURCEBRANCH will look like "master"
rem // BUILD_SOURCEBRANCHNAME will look like "master"
rem // See https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables
set GIT_FULL_BRANCH=%BUILD_REPOSITORY_NAME%/%BUILD_SOURCEBRANCHNAME%
if "%APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH%"=="master" (
if "%SYSTEM_PULLREQUEST_SOURCEBRANCH%"=="master" (
rem // If pull request comes from a master branch, GIT_BRANCH = username/branch in order to distinguish from upstream/master
for /f "tokens=1* delims=/" %%a in ("%APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME%") do set user=%%a
set "GIT_BRANCH=!user!/%APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH%"
for /f "tokens=1* delims=/" %%a in ("%BUILD_REPOSITORY_NAME%") do set user=%%a
set "GIT_BRANCH=!user!/%SYSTEM_PULLREQUEST_SOURCEBRANCH%"
) else (
rem // Otherwise, GIT_BRANCH=branch
set GIT_BRANCH=%APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH%
set GIT_BRANCH=%SYSTEM_PULLREQUEST_SOURCEBRANCH%
)
rem // Make GIT_VERSION the last commit (shortened); Don't include commit count on non-master builds
for /F %%I IN ('call %GIT% rev-parse --short^=8 HEAD') do set GIT_VERSION=%%I
) else (
rem // Get last commit (shortened) and concat after commit count in GIT_VERSION
for /F %%I IN ('call %GIT% rev-parse --short^=8 HEAD') do set GIT_VERSION=%COMMIT_COUNT%-%%I
for /F %%I IN ('call %GIT% rev-parse --abbrev-ref HEAD') do set GIT_BRANCH=%%I
set GIT_FULL_BRANCH=local_build
)
rem // Echo obtained GIT_VERSION for debug purposes if needed
echo %GIT_VERSION%
echo %GIT_FULL_BRANCH%
rem // Don't modify the file if it already has the current version.
if exist "%GIT_VERSION_FILE%" (
@@ -95,6 +103,7 @@ echo // This is a generated file. > "%GIT_VERSION_FILE%"
echo. >> "%GIT_VERSION_FILE%"
echo #define RPCS3_GIT_VERSION "%GIT_VERSION%" >> "%GIT_VERSION_FILE%"
echo #define RPCS3_GIT_BRANCH ^"%GIT_BRANCH%^" >> "%GIT_VERSION_FILE%"
echo #define RPCS3_GIT_FULL_BRANCH ^"%GIT_FULL_BRANCH%^" >> "%GIT_VERSION_FILE%"
echo. >> "%GIT_VERSION_FILE%"
echo // If you don't want this file to update/recompile, change to 1. >> "%GIT_VERSION_FILE%"
echo #define RPCS3_GIT_VERSION_NO_UPDATE 0 >> "%GIT_VERSION_FILE%"
+111 -11
View File
@@ -2,6 +2,7 @@
#include "StrFmt.h"
#include "File.h"
#include "Emu/system_config.h"
#include "Thread.h"
#ifdef _WIN32
#include "windows.h"
@@ -56,10 +57,10 @@ bool utils::has_mpx()
return g_value;
}
bool utils::has_512()
bool utils::has_avx512()
{
// Check AVX512F, AVX512CD, AVX512DQ, AVX512BW, AVX512VL extensions (Skylake-X level support)
static const bool g_value = get_cpuid(0, 0)[0] >= 0x7 && (get_cpuid(7, 0)[1] & 0xd0030000) == 0xd0030000 && (get_cpuid(1,0)[2] & 0x0C000000) == 0x0C000000 && (get_xgetbv(0) & 0xe6) == 0xe6;
static const bool g_value = get_cpuid(0, 0)[0] >= 0x7 && (get_cpuid(7, 0)[1] & 0xd0030000) == 0xd0030000 && (get_cpuid(1, 0)[2] & 0x0C000000) == 0x0C000000 && (get_xgetbv(0) & 0xe6) == 0xe6;
return g_value;
}
@@ -75,6 +76,24 @@ bool utils::has_clwb()
return g_value;
}
bool utils::has_invariant_tsc()
{
static const bool g_value = get_cpuid(0, 0)[0] >= 0x7 && (get_cpuid(0x80000007, 0)[3] & 0x100) == 0x100;
return g_value;
}
bool utils::has_fma3()
{
static const bool g_value = get_cpuid(0, 0)[0] >= 0x1 && get_cpuid(1, 0)[2] & 0x1000;
return g_value;
}
bool utils::has_fma4()
{
static const bool g_value = get_cpuid(0, 0)[0] >= 0x7 && (get_cpuid(0x80000001, 0)[2] & 0x10000) == 0x10000;
return g_value;
}
std::string utils::get_cpu_brand()
{
std::string brand;
@@ -115,7 +134,7 @@ std::string utils::get_system_info()
if (const ullong tsc_freq = get_tsc_freq())
{
fmt::append(result, " | TSC: %.02fGHz", tsc_freq / 1000000000.);
fmt::append(result, " | TSC: %.03fGHz", tsc_freq / 1000000000.);
}
else
{
@@ -131,7 +150,7 @@ std::string utils::get_system_info()
result += '+';
}
if (has_512())
if (has_avx512())
{
result += '+';
}
@@ -142,6 +161,24 @@ std::string utils::get_system_info()
}
}
if (has_fma3() || has_fma4())
{
result += " | FMA";
if (has_fma3() && has_fma4())
{
result += "3+4";
}
else if (has_fma3())
{
result += "3";
}
else if (has_fma4())
{
result += "4";
}
}
if (has_rtm())
{
result += " | TSX";
@@ -155,7 +192,6 @@ std::string utils::get_system_info()
{
result += " disabled by default";
}
}
return result;
@@ -227,17 +263,81 @@ std::string utils::get_OS_version()
return output;
}
static constexpr ullong round_tsc(ullong val)
{
return ::rounded_div(val, 1'000'000) * 1'000'000;
}
ullong utils::get_tsc_freq()
{
static const ullong cal_tsc = []() -> ullong
{
if (!has_invariant_tsc())
return 0;
#ifdef _WIN32
LARGE_INTEGER freq;
if (!QueryPerformanceFrequency(&freq) || freq.QuadPart > 9'999'999)
return 0;
return freq.QuadPart * 1024;
LARGE_INTEGER freq;
if (!QueryPerformanceFrequency(&freq))
return 0;
if (freq.QuadPart <= 9'999'999)
return round_tsc(freq.QuadPart * 1024);
const ullong timer_freq = freq.QuadPart;
#else
// TODO
return 0;
const ullong timer_freq = 1'000'000'000;
#endif
// Calibrate TSC
constexpr int samples = 40;
ullong rdtsc_data[samples];
ullong timer_data[samples];
ullong error_data[samples];
// Narrow thread affinity to a single core
const u64 old_aff = thread_ctrl::get_thread_affinity_mask();
thread_ctrl::set_thread_affinity_mask(old_aff & (0 - old_aff));
#ifndef _WIN32
struct timespec ts0;
clock_gettime(CLOCK_MONOTONIC, &ts0);
ullong sec_base = ts0.tv_sec;
#endif
for (int i = 0; i < samples; i++)
{
#ifdef _WIN32
Sleep(1);
error_data[i] = (_mm_lfence(), __rdtsc());
LARGE_INTEGER ctr;
QueryPerformanceCounter(&ctr);
rdtsc_data[i] = (_mm_lfence(), __rdtsc());
timer_data[i] = ctr.QuadPart;
#else
usleep(200);
error_data[i] = (_mm_lfence(), __rdtsc());
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
rdtsc_data[i] = (_mm_lfence(), __rdtsc());
timer_data[i] = ts.tv_nsec + (ts.tv_sec - sec_base) * 1'000'000'000;
#endif
}
// Restore main thread affinity
thread_ctrl::set_thread_affinity_mask(old_aff);
// Compute average TSC
ullong acc = 0;
for (int i = 0; i < samples - 1; i++)
{
acc += (rdtsc_data[i + 1] - rdtsc_data[i]) * timer_freq / (timer_data[i + 1] - timer_data[i]);
}
// Rounding
return round_tsc(acc / (samples - 1));
}();
return cal_tsc;
}
u64 utils::get_total_memory()
+7 -1
View File
@@ -41,12 +41,18 @@ namespace utils
bool has_mpx();
bool has_512();
bool has_avx512();
bool has_xop();
bool has_clwb();
bool has_invariant_tsc();
bool has_fma3();
bool has_fma4();
std::string get_cpu_brand();
std::string get_system_info();
+17 -8
View File
@@ -17,9 +17,12 @@
#include <limits>
#include <array>
#if __has_include(<bit>)
#include <bit>
#ifdef _MSC_VER
#ifndef __cpp_lib_bitops
#define __cpp_lib_bitops
#endif
#endif
#include <bit>
#ifndef __has_builtin
#define __has_builtin(x) 0
@@ -46,7 +49,7 @@
#define ASSUME(...) do { if (!(__VA_ARGS__)) __builtin_unreachable(); } while (0) // note: the compiler will generate code to evaluate "cond" if the expression is opaque
#endif
#define SAFE_BUFFERS
#define SAFE_BUFFERS __attribute__((no_stack_protector))
#define NEVER_INLINE __attribute__((noinline))
#define FORCE_INLINE __attribute__((always_inline)) inline
#define RESTRICT __restrict__
@@ -167,6 +170,12 @@ using get_uint_t = typename get_int_impl<N>::utype;
template <std::size_t N>
using get_sint_t = typename get_int_impl<N>::stype;
template <typename T>
std::remove_cvref_t<T> as_rvalue(T&& obj)
{
return std::forward<T>(obj);
}
// Formatting helper, type-specific preprocessing for improving safety and functionality
template <typename T, typename = void>
struct fmt_unveil;
@@ -822,19 +831,19 @@ struct alignas(A) any_pod
any_pod() = default;
template <typename T, typename T2 = TT<T>, typename = std::enable_if_t<std::is_pod<T2>::value && sizeof(T2) == S && alignof(T2) <= A>>
template <typename T, typename T2 = TT<T>, typename = std::enable_if_t<std::is_trivially_copyable_v<T> && sizeof(T2) == S && alignof(T2) <= A>>
any_pod(const T& value)
{
reinterpret_cast<T2&>(data) = value;
*this = std::bit_cast<any_pod>(value);
}
template <typename T, typename T2 = TT<T>, typename = std::enable_if_t<std::is_pod<T2>::value && sizeof(T2) == S && alignof(T2) <= A>>
template <typename T, typename T2 = TT<T>, typename = std::enable_if_t<std::is_trivially_copyable_v<T> && sizeof(T2) == S && alignof(T2) <= A>>
T2& as()
{
return reinterpret_cast<T2&>(data);
}
template <typename T, typename T2 = TT<T>, typename = std::enable_if_t<std::is_pod<T2>::value && sizeof(T2) == S && alignof(T2) <= A>>
template <typename T, typename T2 = TT<T>, typename = std::enable_if_t<std::is_trivially_copyable_v<T> && sizeof(T2) == S && alignof(T2) <= A>>
const T2& as() const
{
return reinterpret_cast<const T2&>(data);
@@ -899,7 +908,7 @@ struct cmd64 : any64
}
};
static_assert(sizeof(cmd64) == 8 && std::is_pod<cmd64>::value, "Incorrect cmd64 type");
static_assert(sizeof(cmd64) == 8 && std::is_trivially_copyable_v<cmd64>, "Incorrect cmd64 type");
// Error code type (return type), implements error reporting. Could be a template.
struct error_code
+17 -14
View File
@@ -36,29 +36,32 @@
<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" >
<CmakeGenerator>"Visual Studio $(VisualStudioVersion.Substring(0,2))"</CmakeGenerator>
<PropertyGroup Label="UserMacros">
<CmakeGenerator>"Visual Studio $(VisualStudioVersion.Substring(0,2))"</CmakeGenerator>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<NMakeBuildCommandLine>cmake -G $(CmakeGenerator) -A x64 -DCMAKE_CONFIGURATION_TYPES="Debug;Release" ../glslang
msbuild.exe ALL_BUILD.vcxproj /t:build /p:Configuration=Release /p:ForceImportBeforeCppTargets=$(SolutionDir)rpcs3_glslang.props /m</NMakeBuildCommandLine>
<NMakeReBuildCommandLine>cmake -G $(CmakeGenerator) -A x64 -DCMAKE_CONFIGURATION_TYPES="Debug;Release" ../glslang
msbuild.exe ALL_BUILD.vcxproj /t:rebuild /p:Configuration=Release /p:ForceImportBeforeCppTargets=$(SolutionDir)rpcs3_glslang.props /m</NMakeReBuildCommandLine>
<NMakeCleanCommandLine>cmake -G $(CmakeGenerator) -A x64 -DCMAKE_CONFIGURATION_TYPES="Debug;Release" ../glslang
msbuild.exe ALL_BUILD.vcxproj /t:clean /p:Configuration=Release /p:ForceImportBeforeCppTargets=$(SolutionDir)rpcs3_glslang.props /m</NMakeCleanCommandLine>
<NMakeBuildCommandLine>
cmake -G $(CmakeGenerator) -A x64 -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DCMAKE_CXX_STANDARD=20 -DLLVM_USE_CRT_DEBUG=MTd -DLLVM_USE_CRT_RELEASE=MT ../glslang
msbuild.exe ALL_BUILD.vcxproj /t:build /p:Configuration=Release /p:ForceImportBeforeCppTargets=$(SolutionDir)common_default.props /m</NMakeBuildCommandLine>
<NMakeReBuildCommandLine>
cmake -G $(CmakeGenerator) -A x64 -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DCMAKE_CXX_STANDARD=20 -DLLVM_USE_CRT_DEBUG=MTd -DLLVM_USE_CRT_RELEASE=MT ../glslang
msbuild.exe ALL_BUILD.vcxproj /t:rebuild /p:Configuration=Release /p:ForceImportBeforeCppTargets=$(SolutionDir)common_default.props /m</NMakeReBuildCommandLine>
<NMakeCleanCommandLine>
cmake -G $(CmakeGenerator) -A x64 -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DCMAKE_CXX_STANDARD=20 -DLLVM_USE_CRT_DEBUG=MTd -DLLVM_USE_CRT_RELEASE=MT ../glslang
msbuild.exe ALL_BUILD.vcxproj /t:clean /p:Configuration=Release /p:ForceImportBeforeCppTargets=$(SolutionDir)common_default.props /m</NMakeCleanCommandLine>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<NMakeBuildCommandLine>
cmake -G $(CmakeGenerator) -A x64 -DCMAKE_CONFIGURATION_TYPES="Debug;Release" ../glslang
msbuild.exe ALL_BUILD.vcxproj /t:build /p:Configuration=Debug /p:ForceImportBeforeCppTargets=$(SolutionDir)rpcs3_glslang.props /m
cmake -G $(CmakeGenerator) -A x64 -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DCMAKE_CXX_STANDARD=20 -DLLVM_USE_CRT_DEBUG=MTd -DLLVM_USE_CRT_RELEASE=MT ../glslang
msbuild.exe ALL_BUILD.vcxproj /t:build /p:Configuration=Debug /p:ForceImportBeforeCppTargets=$(SolutionDir)common_default.props /m
</NMakeBuildCommandLine>
<NMakeReBuildCommandLine>
cmake -G $(CmakeGenerator) -A x64 -DCMAKE_CONFIGURATION_TYPES="Debug;Release" ../glslang
msbuild.exe ALL_BUILD.vcxproj /t:rebuild /p:Configuration=Debug /p:ForceImportBeforeCppTargets=$(SolutionDir)rpcs3_glslang.props /m
cmake -G $(CmakeGenerator) -A x64 -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DCMAKE_CXX_STANDARD=20 -DLLVM_USE_CRT_DEBUG=MTd -DLLVM_USE_CRT_RELEASE=MT ../glslang
msbuild.exe ALL_BUILD.vcxproj /t:rebuild /p:Configuration=Debug /p:ForceImportBeforeCppTargets=$(SolutionDir)common_default.props /m
</NMakeReBuildCommandLine>
<NMakeCleanCommandLine>
cmake -G $(CmakeGenerator) -A x64 -DCMAKE_CONFIGURATION_TYPES="Debug;Release" ../glslang
msbuild.exe ALL_BUILD.vcxproj /t:clean /p:Configuration=Debug /p:ForceImportBeforeCppTargets=$(SolutionDir)rpcs3_glslang.props /m
cmake -G $(CmakeGenerator) -A x64 -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DCMAKE_CXX_STANDARD=20 -DLLVM_USE_CRT_DEBUG=MTd -DLLVM_USE_CRT_RELEASE=MT ../glslang
msbuild.exe ALL_BUILD.vcxproj /t:clean /p:Configuration=Debug /p:ForceImportBeforeCppTargets=$(SolutionDir)common_default.props /m
</NMakeCleanCommandLine>
</PropertyGroup>
<ItemDefinitionGroup>
-149
View File
@@ -1,149 +0,0 @@
version: '{build}'
image: Visual Studio 2019
environment:
QTDIR: C:\Qt\5.14\msvc2017_64
LLVMLIBS: https://github.com/RPCS3/llvm/releases/download/continuous-master/llvmlibs.7z
GLSLANG: https://www.dropbox.com/s/6e8w6t5dxh3ad4l/glslang.7z?dl=1
COMPATDB: https://rpcs3.net/compatibility?api=v1&export
VULKAN_SDK: "C:\\VulkanSDK\\1.1.126.0"
VULKAN_SDK_URL: https://sdk.lunarg.com/sdk/download/1.1.126.0/windows/VulkanSDK-1.1.126.0-Installer.exe
VULKAN_SDK_SHA: ee86f25580b550390ce46508415e744d62e87e9c0de6cd299998058253a2a4ba
cache:
- glslang.7z -> appveyor.yml
- compat_database.dat
- vulkan-sdk.exe -> appveyor.yml
install:
- ps: | # set env vars for versioning
$env:COMM_TAG = $(Get-Content ./rpcs3/rpcs3_version.cpp | findstr 'version{.*}' | %{ $ver = $_ -split "[{,]"; "{0}.{1}.{2}" -f [int]$ver[1],[int]$ver[2],[int]$ver[3]; })
$env:COMM_COUNT = $(git rev-list --count HEAD)
$env:COMM_HASH = $(git rev-parse --short=8 HEAD)
if ($env:APPVEYOR_PULL_REQUEST_NUMBER) {
$env:BUILD = "rpcs3-v{0}-{1}_win64.7z" -f $env:COMM_TAG, $env:COMM_HASH
$env:AVVER = "{0}-{1}" -f $env:COMM_TAG.TrimStart("v"), $env:COMM_HASH
}
else {
$env:BUILD = "rpcs3-v{0}-{1}-{2}_win64.7z" -f $env:COMM_TAG, $env:COMM_COUNT, $env:COMM_HASH
$env:AVVER = "{0}-{1}" -f $env:COMM_TAG.TrimStart("v"), $env:COMM_COUNT
}
- ps: | # used for experimental build warnings for pr builds
$env:BRANCH = "{0}/{1}/#{2}" -f $env:APPVEYOR_REPO_NAME, `
$env:APPVEYOR_REPO_BRANCH, $env:APPVEYOR_PULL_REQUEST_NUMBER
$env:BRANCH = $env:BRANCH -replace "/#$"
- ps: | # misc global settings
$env:PATH += $env:QTDIR
[net.servicepointmanager]::securityprotocol = "tls12, tls11, tls"
- ps: | # update and init submodules
git submodule -q update --init `
3rdparty/cereal `
3rdparty/ffmpeg `
3rdparty/span `
3rdparty/hidapi `
3rdparty/libpng `
3rdparty/libusb `
3rdparty/pugixml `
3rdparty/xxHash `
3rdparty/yaml-cpp `
3rdparty/zlib `
3rdparty/FAudio `
asmjit `
Vulkan/glslang
platform: x64
configuration: Release - LLVM
build:
parallel: true
project: rpcs3.sln
verbosity: normal
before_build:
- ps: | # initialize mirror arrays and fetch precompiled build dependencies
$VULKAN_SDK_URLS = @(
$env:VULKAN_SDK_URL;
"$($env:VULKAN_SDK_URL)?Human=true";
)
if (!(test-path llvmlibs.7z)) { irm $env:LLVMLIBS -outfile llvmlibs.7z }
if (!(test-path glslang.7z)) { irm $env:GLSLANG -outfile glslang.7z }
7z x llvmlibs.7z -aos -o"." | out-null
7z x glslang.7z -aos -o".\lib\$env:CONFIGURATION-$env:PLATFORM" | out-null
if (!(test-path vulkan-sdk.exe))
{
foreach ($url in $VULKAN_SDK_URLS) {
irm $url -outfile vulkan-sdk.exe
if ($env:VULKAN_SDK_SHA -eq $(Get-FileHash .\vulkan-sdk.exe).Hash)
{
echo "Successfully downloaded and verified vulkan-sdk.exe!"
break
}
else
{
echo "Invalid file hash, Vulkan SDK Setup was possibly tampered with, retrying with a different mirror..."
}
}
}
.\vulkan-sdk.exe /S
after_build:
- ps: | # remove unnecessary files
rm .\bin\rpcs3.exp, .\bin\rpcs3.lib, .\bin\rpcs3.pdb
- ps: | # prepare compatibility database for packaging
$db = irm $env:COMPATDB -erroraction silentlycontinue
if ($db -and $db.return_code -eq 0) {
$db | convertto-json -compress | out-file compat_database.dat -encoding utf8
}
copy-item compat_database.dat .\bin\GuiConfigs\compat_database.dat
- ps: | # package artifacts
7z a -m0=LZMA2 -mx9 $env:BUILD .\bin\*
7z a -m0=LZMA2 -mx9 openssl_win64.7z C:\OpenSSL-v111-Win64\bin\libcrypto-1_1-x64.dll `
C:\OpenSSL-v111-Win64\bin\libssl-1_1-x64.dll
$env:FILESIZE = (Get-Item $env:BUILD).length
- ps: | # generate sha256 hashes
(get-filehash $env:BUILD -algorithm SHA256).Hash | out-file ("{0}.sha256" -f $env:BUILD) -encoding ascii
$env:SHA256SUM = (get-filehash $env:BUILD -algorithm SHA256).Hash
(get-filehash openssl_win64.7z -algorithm SHA256).Hash | out-file "openssl_win64.7z.sha256" -encoding ascii
test: off
artifacts:
- path: $(BUILD)
name: rpcs3
- path: $(BUILD).sha256
name: rpcs3 sha256 hash
- path: openssl_win64.7z
name: openssl
- path: openssl_win64.7z.sha256
name: openssl sha256 hash
deploy:
provider: GitHub
# Description is a semi-colon seperated list for easy parsing
description: "$(SHA256SUM);$(FILESIZE)B"
tag: build-$(APPVEYOR_REPO_COMMIT)
release: $(AVVER)
artifact: $(BUILD)
repository: RPCS3/rpcs3-binaries-win
draft: false
prerelease: false
force_update: true
auth_token:
secure: gTZqN6J9QNQTv9vu2qtExWk1x4o9dSfyTH/y86Yhe3qu+2w6Mly1MaDFMaXgrN1e
on:
branch: master
appveyor_repo_name: RPCS3/rpcs3
on_success:
- ps: | # update appveyor build version, done last to prevent webhook breakage
update-appveyorbuild -version $env:AVVER
+100
View File
@@ -0,0 +1,100 @@
trigger:
branches:
include:
- master
tags:
exclude:
- '*'
pr:
branches:
include:
- master
jobs:
- job: Linux_Build
strategy:
matrix:
Clang:
COMPILER: clang
GCC:
COMPILER: gcc
DEPLOY_APPIMAGE: true
variables:
CCACHE_DIR: $(Pipeline.Workspace)/ccache
IS_AZURE: true
pool:
vmImage: 'ubuntu-latest'
steps:
- task: Cache@2
inputs:
key: ccache | $(Agent.OS) | $(COMPILER)
path: $(CCACHE_DIR)
displayName: ccache
- bash: |
docker pull --quiet rpcs3/rpcs3-travis-xenial:1.2
docker run \
-v $(pwd):/rpcs3 \
--env-file .ci/travis.env \
-v $CCACHE_DIR:/root/.ccache \
-v $BUILD_ARTIFACTSTAGINGDIRECTORY:/root/artifacts \
rpcs3/rpcs3-travis-xenial:1.2 \
/rpcs3/.ci/build-linux.sh
displayName: Docker setup and build
- publish: $(Build.ArtifactStagingDirectory)
condition: eq(variables['COMPILER'], 'gcc')
- job: Windows_Build
variables:
COMPILER: msvc
QT_VER: '5.14.1'
QT_DATE: '202001240957'
QTDIR: C:\Qt\$(QT_VER)\msvc2017_64
VULKAN_VER: '1.1.126.0'
VULKAN_SDK_SHA: 'ee86f25580b550390ce46508415e744d62e87e9c0de6cd299998058253a2a4ba'
VULKAN_SDK: C:\VulkanSDK\$(VULKAN_VER)
CACHE_DIR: ./cache
pool:
vmImage: "windows-latest"
steps:
- task: Cache@2
inputs:
key: $(Agent.OS) | $(COMPILER)
path: $(CACHE_DIR)
displayName: Cache
- bash: .ci/setup-windows.sh
displayName: Download and unpack dependencies
- bash: .ci/export-azure-vars.sh
displayName: Export Variables
- task: VSBuild@1
inputs:
solution: 'rpcs3.sln'
msbuildArgs: '/m'
platform: x64
configuration: 'Release - LLVM'
displayName: Compile RPCS3
- bash: .ci/deploy-windows.sh
displayName: Pack up build artifacts
- publish: $(Build.ArtifactStagingDirectory)
artifact: Windows App Bundle
- task: GitHubRelease@1
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
inputs:
gitHubConnection: 'RPCS3-Token'
repositoryName: 'RPCS3/rpcs3-binaries-win'
releaseNotesFilePath: 'GitHubReleaseMessage.txt'
action: 'create'
target: '7d09e3be30805911226241afbb14f8cdc2eb054e'
tagSource: 'userSpecifiedTag'
tag: 'build-$(Build.SourceVersion)'
title: $(AVVER)
addChangeLog: false
displayName: Push build to GitHub
+8
View File
@@ -6,10 +6,18 @@
<PropertyGroup Label="Globals">
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<PropertyGroup Label="Configuration">
<!-- Spectre mitigation is disabled by default unless WDK is installed -->
<SpectreMitigation>false</SpectreMitigation>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<LanguageStandard>stdcpplatest</LanguageStandard>
<PreprocessorDefinitions>_SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING=1;_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>false</ExceptionHandling>
<AdditionalOptions>-d2FH4- %(AdditionalOptions)</AdditionalOptions>
<RuntimeLibrary Condition = "$(Configuration.Contains('Release'))">MultiThreaded</RuntimeLibrary>
<RuntimeLibrary Condition = "$(Configuration.Contains('Debug'))">MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
<Link>
<AdditionalOptions>-d2:-FH4- %(AdditionalOptions)</AdditionalOptions>
+1 -1
Submodule llvm updated: 1394b1ccc8...f5679565d3
+15 -14
View File
@@ -34,38 +34,39 @@
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" >
<CmakeGenerator>"Visual Studio $(VisualStudioVersion.Substring(0,2))"</CmakeGenerator>
<PropertyGroup Label="UserMacros">
<CmakeGenerator>"Visual Studio $(VisualStudioVersion.Substring(0,2))"</CmakeGenerator>
<CmakeCLI>cmake -G $(CmakeGenerator) -A x64 -Thost=x64 -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DLLVM_TARGETS_TO_BUILD=X86 -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 -DWITH_POLLY=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=$(WindowsTargetPlatformVersion) -DCMAKE_CXX_STANDARD=20 -DLLVM_USE_CRT_DEBUG=MTd -DLLVM_USE_CRT_RELEASE=MT ../llvm</CmakeCLI>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<NMakePreprocessorDefinitions>
</NMakePreprocessorDefinitions>
<NMakeBuildCommandLine>
cmake -G $(CmakeGenerator) -A x64 -Thost=x64 -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DLLVM_TARGETS_TO_BUILD=X86 -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 -DWITH_POLLY=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=$(WindowsTargetPlatformVersion) ../llvm
msbuild.exe ALL_BUILD.vcxproj /t:build /p:Configuration=Debug /m
$(CmakeCLI)
msbuild.exe ALL_BUILD.vcxproj /t:build /p:Configuration=Debug /p:ForceImportBeforeCppTargets=$(SolutionDir)common_default.props /m
</NMakeBuildCommandLine>
<NMakeReBuildCommandLine>
cmake -G $(CmakeGenerator) -A x64 -Thost=x64 -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DLLVM_TARGETS_TO_BUILD=X86 -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 -DWITH_POLLY=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=$(WindowsTargetPlatformVersion) ../llvm
msbuild.exe ALL_BUILD.vcxproj /t:rebuild /p:Configuration=Debug /m
$(CmakeCLI)
msbuild.exe ALL_BUILD.vcxproj /t:rebuild /p:Configuration=Debug /p:ForceImportBeforeCppTargets=$(SolutionDir)common_default.props /m
</NMakeReBuildCommandLine>
<NMakeCleanCommandLine>
cmake -G $(CmakeGenerator) -A x64 -Thost=x64 -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DLLVM_TARGETS_TO_BUILD=X86 -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 -DWITH_POLLY=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=$(WindowsTargetPlatformVersion) ../llvm
msbuild.exe ALL_BUILD.vcxproj /t:clean /p:Configuration=Debug /m
$(CmakeCLI)
msbuild.exe ALL_BUILD.vcxproj /t:clean /p:Configuration=Debug /p:ForceImportBeforeCppTargets=$(SolutionDir)common_default.props /m
</NMakeCleanCommandLine>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<NMakePreprocessorDefinitions />
<NMakeBuildCommandLine>
cmake -G $(CmakeGenerator) -A x64 -Thost=x64 -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DLLVM_TARGETS_TO_BUILD=X86 -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 -DWITH_POLLY=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=$(WindowsTargetPlatformVersion) ../llvm
msbuild.exe ALL_BUILD.vcxproj /t:build /p:Configuration=Release /m
$(CmakeCLI)
msbuild.exe ALL_BUILD.vcxproj /t:build /p:Configuration=Release /p:ForceImportBeforeCppTargets=$(SolutionDir)common_default.props /m
</NMakeBuildCommandLine>
<NMakeReBuildCommandLine>
cmake -G $(CmakeGenerator) -A x64 -Thost=x64 -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DLLVM_TARGETS_TO_BUILD=X86 -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 -DWITH_POLLY=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=$(WindowsTargetPlatformVersion) ../llvm
msbuild.exe ALL_BUILD.vcxproj /t:rebuild /p:Configuration=Release /m
$(CmakeCLI)
msbuild.exe ALL_BUILD.vcxproj /t:rebuild /p:Configuration=Release /p:ForceImportBeforeCppTargets=$(SolutionDir)common_default.props /m
</NMakeReBuildCommandLine>
<NMakeCleanCommandLine>
cmake -G $(CmakeGenerator) -A x64 -Thost=x64 -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DLLVM_TARGETS_TO_BUILD=X86 -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 -DWITH_POLLY=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=$(WindowsTargetPlatformVersion) ../llvm
msbuild.exe ALL_BUILD.vcxproj /t:clean /p:Configuration=Release /m
$(CmakeCLI)
msbuild.exe ALL_BUILD.vcxproj /t:clean /p:Configuration=Release /p:ForceImportBeforeCppTargets=$(SolutionDir)common_default.props /m
</NMakeCleanCommandLine>
</PropertyGroup>
<ItemDefinitionGroup>
+34
View File
@@ -59,6 +59,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rpcs3", "rpcs3\rpcs3.vcxpro
{60F89955-91C6-3A36-8000-13C592FEC2DF} = {60F89955-91C6-3A36-8000-13C592FEC2DF}
{3EE5F075-B546-42C4-B6A8-E3CCEF38B78D} = {3EE5F075-B546-42C4-B6A8-E3CCEF38B78D}
{D6973076-9317-4EF2-A0B8-B7A18AC0713E} = {D6973076-9317-4EF2-A0B8-B7A18AC0713E}
{DA6F56B4-06A4-441D-AD70-AC5A7D51FADB} = {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}
{FDC361C5-7734-493B-8CFB-037308B35122} = {FDC361C5-7734-493B-8CFB-037308B35122}
{8F85B6CC-250F-4ACA-A617-E820A74E3E3C} = {8F85B6CC-250F-4ACA-A617-E820A74E3E3C}
{5B146DEA-9ACE-4D32-A7FD-3F42464DD69C} = {5B146DEA-9ACE-4D32-A7FD-3F42464DD69C}
@@ -81,6 +82,17 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "7z", "7z", "{CB3DD03E-074E-
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "7zlib", "3rdparty\7zlib.vcxproj", "{5B146DEA-9ACE-4D32-A7FD-3F42464DD69C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "wolfssl", "wolfssl", "{6DA34724-E5B2-4306-906D-1A2340637047}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wolfssl", "3rdparty\wolfssl.vcxproj", "{73973223-5EE8-41CA-8E88-1D60E89A237B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libcurl", "libcurl", "{BE02DA0B-BEE1-4214-AFA9-3617982F2FEA}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcurl", "3rdparty\libcurl.vcxproj", "{DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}"
ProjectSection(ProjectDependencies) = postProject
{73973223-5EE8-41CA-8E88-1D60E89A237B} = {73973223-5EE8-41CA-8E88-1D60E89A237B}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug - LLVM|x64 = Debug - LLVM|x64
@@ -249,6 +261,26 @@ Global
{5B146DEA-9ACE-4D32-A7FD-3F42464DD69C}.Release - LLVM|x64.Build.0 = Release|x64
{5B146DEA-9ACE-4D32-A7FD-3F42464DD69C}.Release|x64.ActiveCfg = Release|x64
{5B146DEA-9ACE-4D32-A7FD-3F42464DD69C}.Release|x64.Build.0 = Release|x64
{73973223-5EE8-41CA-8E88-1D60E89A237B}.Debug - LLVM|x64.ActiveCfg = Debug|x64
{73973223-5EE8-41CA-8E88-1D60E89A237B}.Debug - LLVM|x64.Build.0 = Debug|x64
{73973223-5EE8-41CA-8E88-1D60E89A237B}.Debug - MemLeak|x64.ActiveCfg = Debug|x64
{73973223-5EE8-41CA-8E88-1D60E89A237B}.Debug - MemLeak|x64.Build.0 = Debug|x64
{73973223-5EE8-41CA-8E88-1D60E89A237B}.Debug|x64.ActiveCfg = Debug|x64
{73973223-5EE8-41CA-8E88-1D60E89A237B}.Debug|x64.Build.0 = Debug|x64
{73973223-5EE8-41CA-8E88-1D60E89A237B}.Release - LLVM|x64.ActiveCfg = Release|x64
{73973223-5EE8-41CA-8E88-1D60E89A237B}.Release - LLVM|x64.Build.0 = Release|x64
{73973223-5EE8-41CA-8E88-1D60E89A237B}.Release|x64.ActiveCfg = Release|x64
{73973223-5EE8-41CA-8E88-1D60E89A237B}.Release|x64.Build.0 = Release|x64
{DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.Debug - LLVM|x64.ActiveCfg = Debug - LLVM|x64
{DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.Debug - LLVM|x64.Build.0 = Debug - LLVM|x64
{DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.Debug - MemLeak|x64.ActiveCfg = Debug|x64
{DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.Debug - MemLeak|x64.Build.0 = Debug|x64
{DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.Debug|x64.ActiveCfg = Debug|x64
{DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.Debug|x64.Build.0 = Debug|x64
{DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.Release - LLVM|x64.ActiveCfg = Release - LLVM|x64
{DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.Release - LLVM|x64.Build.0 = Release - LLVM|x64
{DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.Release|x64.ActiveCfg = Release|x64
{DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -270,6 +302,8 @@ Global
{939FE206-1182-ABC3-1234-FEAB88E98404} = {D16E245C-CC5A-4B9A-8BAB-1176F02C1631}
{349EE8F9-7D25-4909-AAF5-FF3FADE72187} = {6D8E86F7-84A0-45BA-ACC3-F02FC5545B3B}
{5B146DEA-9ACE-4D32-A7FD-3F42464DD69C} = {CB3DD03E-074E-4FA5-B253-51A3372D1768}
{73973223-5EE8-41CA-8E88-1D60E89A237B} = {6DA34724-E5B2-4306-906D-1A2340637047}
{DA6F56B4-06A4-441D-AD70-AC5A7D51FADB} = {BE02DA0B-BEE1-4214-AFA9-3617982F2FEA}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {06CC7920-E085-4B81-9582-8DE8AAD42510}
+13 -7
View File
@@ -1,6 +1,8 @@
cmake_minimum_required(VERSION 3.8.2)
include(cotire)
if(USE_PRECOMPILED_HEADERS AND NOT COMMAND target_precompile_headers)
include(cotire)
endif()
# Generate git-version.h at build time.
include(${CMAKE_CURRENT_SOURCE_DIR}/git-version.cmake)
@@ -110,12 +112,16 @@ else()
target_link_libraries(rpcs3 ${CMAKE_DL_LIBS})
endif()
if(USE_COTIRE)
set_target_properties(rpcs3 PROPERTIES
COTIRE_CXX_PREFIX_HEADER_INIT "${RPCS3_SRC_DIR}/stdafx.h"
COTIRE_ADD_UNITY_BUILD OFF)
if(USE_PRECOMPILED_HEADERS)
if(COMMAND target_precompile_headers)
target_precompile_headers(rpcs3 PRIVATE "${RPCS3_SRC_DIR}/stdafx.h")
else()
set_target_properties(rpcs3 PROPERTIES
COTIRE_CXX_PREFIX_HEADER_INIT "${RPCS3_SRC_DIR}/stdafx.h"
COTIRE_ADD_UNITY_BUILD OFF)
cotire(rpcs3)
cotire(rpcs3)
endif()
endif()
# Copy icons to executable directory
@@ -135,7 +141,7 @@ elseif(UNIX)
elseif(WIN32)
add_custom_command(TARGET rpcs3 POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy_directory "${CMAKE_SOURCE_DIR}/bin" "$<TARGET_FILE_DIR:rpcs3>"
COMMAND "${Qt5_DIR}/../../../bin/windeployqt" --no-angle --no-compiler-runtime --no-opengl-sw --no-patchqt --no-svg --no-translations --no-quick --plugindir "$<TARGET_FILE_DIR:rpcs3>/qt/plugins" "$<TARGET_FILE:rpcs3>")
COMMAND "${Qt5_DIR}/../../../bin/windeployqt" --no-angle --no-compiler-runtime --no-opengl-sw --no-patchqt --no-svg --no-translations --no-quick --plugindir "$<TARGET_FILE_DIR:rpcs3>/qt/plugins" --release "$<TARGET_FILE:rpcs3>")
endif()
# Unix installation
+2 -1
View File
@@ -1,6 +1,7 @@
#include "utils.h"
#include "aes.h"
#include "key_vault.h"
#include "util/logs.hpp"
LOG_CHANNEL(key_vault_log, "KEY_VAULT");
@@ -706,7 +707,7 @@ SELF_KEY KeyVault::FindSelfKey(u32 type, u16 revision, u64 version)
// Empty key.
SELF_KEY key(0, 0, 0, 0, "", "", "", "", 0);
key_vault_log.notice("FindSelfKey: Type:0x%x, Revision:0x%x, Version:0x%x", type, revision, version);
key_vault_log.trace("FindSelfKey: Type:0x%x, Revision:0x%x, Version:0x%x", type, revision, version);
// Check SELF type.
switch (type)
+18 -3
View File
@@ -1,13 +1,13 @@
#pragma once
#include "Utilities/types.h"
#include "Utilities/Log.h"
#include <string>
#include <vector>
#include <memory>
enum SELF_KEY_TYPE {
enum SELF_KEY_TYPE
{
KEY_LV0 = 1,
KEY_LV1,
KEY_LV2,
@@ -18,7 +18,8 @@ enum SELF_KEY_TYPE {
KEY_NPDRM
};
struct SELF_KEY {
struct SELF_KEY
{
u64 version_start;
u64 version_end;
u16 revision;
@@ -44,6 +45,18 @@ static u8 PKG_AES_KEY2[0x10] = {
0x07, 0xf2, 0xc6, 0x82, 0x90, 0xb5, 0x0d, 0x2c, 0x33, 0x81, 0x8d, 0x70, 0x9b, 0x60, 0xe6, 0x2b
};
static u8 PKG_AES_KEY_VITA_1[0x10] = {
0xE3, 0x1A, 0x70, 0xC9, 0xCE, 0x1D, 0xD7, 0x2B, 0xF3, 0xC0, 0x62, 0x29, 0x63, 0xF2, 0xEC, 0xCB
};
static u8 PKG_AES_KEY_VITA_2[0x10] = {
0x42, 0x3A, 0xCA, 0x3A, 0x2B, 0xD5, 0x64, 0x9F, 0x96, 0x86, 0xAB, 0xAD, 0x6F, 0xD8, 0x80, 0x1F
};
static u8 PKG_AES_KEY_VITA_3[0x10] = {
0xAF, 0x07, 0xFD, 0x59, 0x65, 0x25, 0x27, 0xBA, 0xF1, 0x33, 0x89, 0x66, 0x8B, 0x17, 0xD9, 0xEA
};
static u8 NP_IDPS[0x10] = {
0x5E, 0x06, 0xE0, 0x4F, 0xD9, 0x4A, 0x71, 0xBF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01
};
@@ -68,10 +81,12 @@ static u8 NP_RIF_KEY[0x10] = {
0xDA, 0x7D, 0x4B, 0x5E, 0x49, 0x9A, 0x4F, 0x53, 0xB1, 0xC1, 0xA1, 0x4A, 0x74, 0x84, 0x44, 0x3B
};
// PSP Minis
static u8 NP_PSP_KEY_1[0x10] = {
0x2A, 0x6A, 0xFB, 0xCF, 0x43, 0xD1, 0x57, 0x9F, 0x7D, 0x73, 0x87, 0x41, 0xA1, 0x3B, 0xD4, 0x2E
};
// PSP Remasters
static u8 NP_PSP_KEY_2[0x10] = {
0x0D, 0xB8, 0x57, 0x32, 0x36, 0x6C, 0xD7, 0x34, 0xFC, 0x87, 0x9E, 0x74, 0x33, 0x43, 0xBB, 0x4F
};
+2 -2
View File
@@ -1,4 +1,4 @@
#include "stdafx.h"
#include "stdafx.h"
#include "key_vault.h"
#include "unedat.h"
@@ -578,7 +578,7 @@ int validate_npd_hashes(const char* file_name, const u8* klicensee, NPD_HEADER *
int title_hash_result = 0;
int dev_hash_result = 0;
const auto file_name_length = std::strlen(file_name);
const s32 file_name_length = ::narrow<s32>(std::strlen(file_name), HERE);
std::unique_ptr<u8[]> buf(new u8[0x30 + file_name_length]);
// Build the title buffer (content_id + file_name).
+2 -2
View File
@@ -18,6 +18,7 @@ struct loaded_npdrm_keys
{
std::array<u8, 0x10> devKlic{};
std::array<u8, 0x10> rifKey{};
atomic_t<u32> npdrm_fds{0};
};
struct NPD_HEADER
@@ -112,8 +113,7 @@ public:
const s64 new_pos =
whence == fs::seek_set ? offset :
whence == fs::seek_cur ? offset + pos :
whence == fs::seek_end ? offset + size() :
(fmt::raw_error("EDATADecrypter::seek(): invalid whence"), 0);
whence == fs::seek_end ? offset + size() : -1;
if (new_pos < 0)
{
+667 -170
View File
File diff suppressed because it is too large Load Diff
+240 -6
View File
@@ -1,6 +1,8 @@
#pragma once
#include "Utilities/BEType.h"
#include <sstream>
#include <iomanip>
// Constants
enum
@@ -15,7 +17,7 @@ enum : u16
PKG_RELEASE_TYPE_DEBUG = 0x0000,
PKG_PLATFORM_TYPE_PS3 = 0x0001,
PKG_PLATFORM_TYPE_PSP = 0x0002,
PKG_PLATFORM_TYPE_PSP_PSVITA = 0x0002,
};
enum : u32
@@ -24,6 +26,7 @@ enum : u32
PKG_FILE_ENTRY_NPDRMEDAT = 2,
PKG_FILE_ENTRY_REGULAR = 3,
PKG_FILE_ENTRY_FOLDER = 4,
PKG_FILE_ENTRY_UNK0 = 5,
PKG_FILE_ENTRY_UNK1 = 6,
PKG_FILE_ENTRY_SDAT = 9,
@@ -34,12 +37,12 @@ enum : u32
// Structs
struct PKGHeader
{
nse_t<u32> pkg_magic; // Magic (0x7f504b47)
le_t<u32> pkg_magic; // Magic (0x7f504b47) (" PKG")
be_t<u16> pkg_type; // Release type (Retail:0x8000, Debug:0x0000)
be_t<u16> pkg_platform; // Platform type (PS3:0x0001, PSP:0x0002)
be_t<u32> pkg_info_off;
be_t<u32> pkg_info_num;
be_t<u32> header_size; // Header size
be_t<u32> meta_offset; // Metadata offset. Usually 0xC0 for PS3, usually 0x280 for PSP and PSVita
be_t<u32> meta_count; // Metadata item count
be_t<u32> meta_size; // Metadata size.
be_t<u32> file_count; // Number of files
be_t<u64> pkg_size; // PKG size in bytes
be_t<u64> data_offset; // Encrypted data offset
@@ -47,6 +50,23 @@ struct PKGHeader
char title_id[48]; // Title ID
be_t<u64> qa_digest[2]; // This should be the hash of "files + attribs"
be_t<u128> klicensee; // Nonce
// + some stuff
};
// Extended header in PSP and PSVita packages
struct PKGExtHeader
{
le_t<u32> magic; // 0x7F657874 (" ext")
be_t<u32> unknown_1; // Maybe version. always 1
be_t<u32> ext_hdr_size; // Extended header size. ex: 0x40
be_t<u32> ext_data_size; // ex: 0x180
be_t<u32> main_and_ext_headers_hmac_offset; // ex: 0x100
be_t<u32> metadata_header_hmac_offset; // ex: 0x360, 0x390, 0x490
be_t<u64> tail_offset; // tail size seams to be always 0x1A0
be_t<u32> padding1;
be_t<u32> pkg_key_id; // Id of the AES key used for decryption. PSP = 0x1, PSVita = 0xC0000002, PSM = 0xC0000004
be_t<u32> full_header_hmac_offset; // ex: none (old pkg): 0, 0x930
u8 padding2[20];
};
struct PKGEntry
@@ -59,4 +79,218 @@ struct PKGEntry
be_t<u32> pad; // Padding (zeros)
};
bool pkg_install(const std::string& path, atomic_t<double>&);
// https://www.psdevwiki.com/ps3/PKG_files#PKG_Metadata
struct PKGMetaData
{
private:
static std::string to_hex_string(u8 buf[], size_t size)
{
std::stringstream sstream;
for (size_t i = 0; i < size; i++)
{
sstream << std::hex << std::setw(2) << std::setfill('0') << static_cast<int>(buf[i]);
}
return sstream.str();
}
static std::string to_hex_string(u8 buf[], size_t size, size_t dotpos)
{
std::string result = to_hex_string(buf, size);
if (result.size() > dotpos)
{
result.insert(dotpos, 1, '.');
}
return result;
}
public:
be_t<u32> drm_type{ 0 };
be_t<u32> content_type{ 0 };
be_t<u32> package_type{ 0 };
be_t<u64> package_size{ 0 };
u8 qa_digest[24]{ 0 };
be_t<u64> unk_0x9{ 0 };
be_t<u64> unk_0xB{ 0 };
struct package_revision
{
struct package_revision_data
{
u8 make_package_npdrm_ver[2]{ 0 };
u8 version[2]{ 0 };
} data{};
std::string make_package_npdrm_ver;
std::string version;
void interpret_data()
{
make_package_npdrm_ver = to_hex_string(data.make_package_npdrm_ver, sizeof(data.make_package_npdrm_ver));
version = to_hex_string(data.version, sizeof(data.version), 2);
}
std::string to_string()
{
return fmt::format("make package npdrm version: %s, version: %s", make_package_npdrm_ver, version);
}
} package_revision;
struct software_revision
{
struct software_revision_data
{
u8 unk[1]{ 0 };
u8 firmware_version[3]{ 0 };
u8 version[2]{ 0 };
u8 app_version[2]{ 0 };
} data{};
std::string unk; // maybe hardware id
std::string firmware_version;
std::string version;
std::string app_version;
void interpret_data()
{
unk = to_hex_string(data.unk, sizeof(data.unk));
firmware_version = to_hex_string(data.firmware_version, sizeof(data.firmware_version), 2);
version = to_hex_string(data.version, sizeof(data.version), 2);
app_version = to_hex_string(data.app_version, sizeof(data.app_version), 2);
}
std::string to_string()
{
return fmt::format("unk: %s, firmware version: %s, version: %s, app version: %s",
unk, firmware_version, version, app_version);
}
} software_revision;
std::string title_id;
std::string install_dir;
// PSVita stuff
struct vita_item_info // size is 0x28 (40)
{
be_t<u32> offset{ 0 };
be_t<u32> size{ 0 };
u8 sha256[32]{ 0 };
std::string to_string()
{
return fmt::format("offset: 0x%x, size: 0x%x, sha256: 0x%x", offset, size, sha256);
}
} item_info;
struct vita_sfo_info // size is 0x38 (56)
{
be_t<u32> param_offset{ 0 };
be_t<u16> param_size{ 0 };
be_t<u32> unk_1{ 0 }; // seen values: 0x00000001-0x00000018, 0x0000001b-0x0000001c
be_t<u32> psp2_system_ver{ 0 }; // BCD encoded
u8 unk_2[8]{ 0 };
u8 param_digest[32]{ 0 }; // SHA256 of param_data. Called ParamDigest: This is sha256 digest of param.sfo.
std::string to_string()
{
return fmt::format("param_offset: 0x%x, param_size: 0x%x, unk_1: 0x%x, psp2_system_ver: 0x%x, unk_2: 0x%x, param_digest: 0x%x",
param_offset, param_size, unk_1, psp2_system_ver, unk_2, param_digest);
}
} sfo_info;
struct vita_unknown_data_info // size is 0x48 (72)
{
be_t<u32> unknown_data_offset{ 0 };
be_t<u16> unknown_data_size{ 0 }; // ex: 0x320
u8 unk[32]{ 0 };
u8 unknown_data_sha256[32]{ 0 };
std::string to_string()
{
return fmt::format("unknown_data_offset: 0x%x, unknown_data_size: 0x%x, unk: 0x%x, unknown_data_sha256: 0x%x",
unknown_data_offset, unknown_data_size, unk, unknown_data_sha256);
}
} unknown_data_info;
struct vita_entirety_info // size is 0x38 (56)
{
be_t<u32> entirety_data_offset{ 0 }; // located just before SFO
be_t<u32> entirety_data_size{ 0 }; // ex: 0xA0, C0, 0x100, 0x120, 0x160
be_t<u16> flags{ 0 }; // ex: EE 00, FE 10, FE 78, FE F8, FF 10, FF 90, FF D0, flags indicating which digests it embeds
be_t<u16> unk_1{ 0 }; // always 00 00
be_t<u32> unk_2{ 0 }; // ex: 1, 0
u8 unk_3[8]{ 0 };
u8 entirety_digest[32]{ 0 };
std::string to_string()
{
return fmt::format("entirety_data_offset: 0x%x, entirety_data_size: 0x%x, flags: 0x%x, unk_1: 0x%x, unk_2: 0x%x, unk_3: 0x%x, entirety_digest: 0x%x",
entirety_data_offset, entirety_data_size, flags, unk_1, unk_2, unk_3, entirety_digest);
}
} entirety_info;
struct vita_version_info // size is 0x28 (40)
{
be_t<u32> publishing_tools_version{ 0 };
be_t<u32> psf_builder_version{ 0 };
u8 padding[32]{ 0 };
std::string to_string()
{
return fmt::format("publishing_tools_version: 0x%x, psf_builder_version: 0x%x, padding: 0x%x",
publishing_tools_version, psf_builder_version, padding);
}
} version_info;
struct vita_self_info // size is 0x38 (56)
{
be_t<u32> self_info_offset{ 0 }; // offset to the first self_info_data_element
be_t<u32> self_info_size{ 0 }; // usually 0x10 or 0x20
u8 unk[16]{ 0 };
u8 self_sha256[32]{ 0 };
std::string to_string()
{
return fmt::format("self_info_offset: 0x%x, self_info_size: 0x%x, unk: 0x%x, self_sha256: 0x%x",
self_info_offset, self_info_size, unk, self_sha256);
}
} self_info;
};
enum class package_error
{
no_error,
app_version,
other
};
class package_reader
{
public:
package_reader(const std::string& path);
~package_reader();
package_error check_target_app_version();
bool extract_data(atomic_t<double>& sync);
private:
bool read_header();
bool read_metadata();
bool decrypt_data();
void archive_seek(const s64 new_offset, const fs::seek_mode damode = fs::seek_set);
u64 archive_read(void* data_ptr, const u64 num_bytes);
u64 decrypt(u64 offset, u64 size, const uchar* key);
const std::size_t BUF_SIZE = 8192 * 1024; // 8 MB
bool m_is_valid = false;
std::string m_path;
std::string install_dir;
std::vector<fs::file> filelist;
size_t cur_file = 0;
u64 cur_offset = 0;
u64 cur_file_offset = 0;
std::unique_ptr<u128[]> buf;
std::array<uchar, 16> dec_key{};
PKGHeader header{};
PKGMetaData metadata{};
};
+6 -6
View File
@@ -744,7 +744,7 @@ bool SCEDecrypter::DecryptData()
// Calculate the total data size.
for (unsigned int i = 0; i < meta_hdr.section_count; i++)
{
data_buf_length += meta_shdr[i].data_size;
data_buf_length += ::narrow<u32>(meta_shdr[i].data_size, HERE);
}
// Allocate a buffer to store decrypted data.
@@ -798,7 +798,7 @@ bool SCEDecrypter::DecryptData()
}
// Advance the buffer's offset.
data_buf_offset += meta_shdr[i].data_size;
data_buf_offset += ::narrow<u32>(meta_shdr[i].data_size, HERE);
}
return true;
@@ -828,7 +828,7 @@ std::vector<fs::file> SCEDecrypter::MakeFile()
strm.zalloc = Z_NULL;
strm.zfree = Z_NULL;
strm.opaque = Z_NULL;
strm.avail_in = meta_shdr[i].data_size;
strm.avail_in = ::narrow<uInt>(meta_shdr[i].data_size, HERE);
strm.avail_out = BUFSIZE;
strm.next_in = data_buf.get()+data_buf_offset;
strm.next_out = tempbuf;
@@ -873,7 +873,7 @@ std::vector<fs::file> SCEDecrypter::MakeFile()
}
// Advance the data buffer offset by data size.
data_buf_offset += meta_shdr[i].data_size;
data_buf_offset += ::narrow<u32>(meta_shdr[i].data_size, HERE);
if (out_f.pos() != out_f.size())
fmt::throw_exception("MakeELF written bytes (%llu) does not equal buffer size (%llu).", out_f.pos(), out_f.size());
@@ -1238,7 +1238,7 @@ bool SELFDecrypter::DecryptData()
if (meta_shdr[i].encrypted == 3)
{
if ((meta_shdr[i].key_idx <= meta_hdr.key_count - 1) && (meta_shdr[i].iv_idx <= meta_hdr.key_count))
data_buf_length += meta_shdr[i].data_size;
data_buf_length += ::narrow<u32>(meta_shdr[i].data_size, HERE);
}
}
@@ -1284,7 +1284,7 @@ bool SELFDecrypter::DecryptData()
memcpy(data_buf.get() + data_buf_offset, buf.get(), meta_shdr[i].data_size);
// Advance the buffer's offset.
data_buf_offset += meta_shdr[i].data_size;
data_buf_offset += ::narrow<u32>(meta_shdr[i].data_size, HERE);
}
}
}
+3 -3
View File
@@ -1,11 +1,11 @@
#pragma once
#pragma once
#include "key_vault.h"
#include "zlib.h"
#include "Utilities/types.h"
#include "Utilities/File.h"
#include "Utilities/Log.h"
#include "util/logs.hpp"
LOG_CHANNEL(self_log, "SELF");
@@ -489,7 +489,7 @@ private:
}
// Advance the data buffer offset by data size.
data_buf_offset += meta_shdr[i].data_size;
data_buf_offset += ::narrow<u32>(meta_shdr[i].data_size, HERE);
}
}
+12 -5
View File
@@ -6,8 +6,12 @@
#include <cstring>
#include <stdio.h>
#include <time.h>
#include "Utilities/StrUtil.h"
#include "Utilities/span.h"
#include <memory>
#include <string>
#include <string_view>
// Auxiliary functions (endian swap, xor).
@@ -142,11 +146,14 @@ void cmac_hash_forge(unsigned char *key, int key_len, unsigned char *in, int in_
char* extract_file_name(const char* file_path, char real_file_name[MAX_PATH])
{
size_t file_path_len = strlen(file_path);
const char* p = strrchr(file_path, '/');
if (!p) p = strrchr(file_path, '\\');
if (p) file_path_len = file_path + file_path_len - p - 1;
strncpy(real_file_name, p ? (p + 1) : file_path, file_path_len + 1);
std::string_view v(file_path);
if (auto pos = v.find_last_of("/\\"); pos != umax)
{
v.remove_prefix(pos + 1);
}
gsl::span r(real_file_name, MAX_PATH);
strcpy_trunc(r, v);
return real_file_name;
}
+1 -1
View File
@@ -2,7 +2,7 @@
#error "XAudio2 can only be built on Windows."
#endif
#include "Utilities/Log.h"
#include "util/logs.hpp"
#include "Utilities/StrFmt.h"
#include "Emu/System.h"
#include "Emu/system_config.h"
+29 -8
View File
@@ -31,13 +31,15 @@ target_sources(rpcs3_emu PRIVATE
../util/atomic2.cpp
../util/shared_cptr.cpp
../util/fixed_typemap.cpp
../util/logs.cpp
../util/yaml.cpp
../util/cereal.cpp
../../Utilities/bin_patch.cpp
../../Utilities/cond.cpp
../../Utilities/Config.cpp
../../Utilities/dynamic_library.cpp
../../Utilities/File.cpp
../../Utilities/JIT.cpp
../../Utilities/Log.cpp
../../Utilities/LUrlParser.cpp
../../Utilities/mutex.cpp
../../Utilities/rXml.cpp
@@ -62,6 +64,12 @@ else()
set_source_files_properties("../../Utilities/JIT.cpp" PROPERTIES COMPILE_FLAGS -fno-rtti)
endif()
if (MSVC)
set_source_files_properties("../util/yaml.cpp" PROPERTIES COMPILE_FLAGS /EHsc)
else()
set_source_files_properties("../util/yaml.cpp" PROPERTIES COMPILE_FLAGS -fexceptions)
endif()
# Crypto
target_sources(rpcs3_emu PRIVATE
@@ -351,6 +359,10 @@ target_sources(rpcs3_emu PRIVATE
Io/GHLtar.cpp
)
# Np
target_sources(rpcs3_emu PRIVATE
NP/np_handler.cpp
)
# Memory
target_sources(rpcs3_emu PRIVATE
@@ -384,6 +396,7 @@ target_sources(rpcs3_emu PRIVATE
RSX/Overlays/overlay_list_view.cpp
RSX/Overlays/overlay_message_dialog.cpp
RSX/Overlays/overlay_osk.cpp
RSX/Overlays/overlay_osk_panel.cpp
RSX/Overlays/overlay_perf_metrics.cpp
RSX/Overlays/overlay_progress_bar.cpp
RSX/Overlays/overlay_save_dialog.cpp
@@ -396,11 +409,13 @@ target_sources(rpcs3_emu PRIVATE
RSX/Capture/rsx_capture.cpp
RSX/Capture/rsx_replay.cpp
RSX/GL/GLCommonDecompiler.cpp
RSX/GL/GLDraw.cpp
RSX/GL/GLFragmentProgram.cpp
RSX/GL/GLGSRender.cpp
RSX/GL/GLHelpers.cpp
RSX/GL/GLPresent.cpp
RSX/GL/GLRenderTargets.cpp
RSX/GL/GLShaderInterpreter.cpp
RSX/GL/GLTexture.cpp
RSX/GL/GLVertexBuffers.cpp
RSX/GL/GLVertexProgram.cpp
@@ -412,6 +427,7 @@ if(TARGET 3rdparty_vulkan)
RSX/VK/VKCommandStream.cpp
RSX/VK/VKCommonDecompiler.cpp
RSX/VK/VKDMA.cpp
RSX/VK/VKDraw.cpp
RSX/VK/VKFormats.cpp
RSX/VK/VKFragmentProgram.cpp
RSX/VK/VKFramebuffer.cpp
@@ -423,6 +439,7 @@ if(TARGET 3rdparty_vulkan)
RSX/VK/VKRenderPass.cpp
RSX/VK/VKResolveHelper.cpp
RSX/VK/VKResourceManager.cpp
RSX/VK/VKShaderInterpreter.cpp
RSX/VK/VKTexture.cpp
RSX/VK/VKVertexBuffers.cpp
RSX/VK/VKVertexProgram.cpp
@@ -440,13 +457,17 @@ target_link_libraries(rpcs3_emu
)
if (USE_COTIRE)
# Setup cotire
option(UNITY_BUILD_EMU "Use unity build for rpcs3_emu target" OFF)
if (USE_PRECOMPILED_HEADERS)
if (COMMAND target_precompile_headers)
target_precompile_headers(rpcs3_emu PRIVATE "${RPCS3_SRC_DIR}/stdafx.h")
else()
# Setup cotire
option(UNITY_BUILD_EMU "Use unity build for rpcs3_emu target" OFF)
set_target_properties(rpcs3_emu PROPERTIES
COTIRE_CXX_PREFIX_HEADER_INIT "${RPCS3_SRC_DIR}/stdafx.h"
COTIRE_ADD_UNITY_BUILD ${UNITY_BUILD_EMU})
set_target_properties(rpcs3_emu PROPERTIES
COTIRE_CXX_PREFIX_HEADER_INIT "${RPCS3_SRC_DIR}/stdafx.h"
COTIRE_ADD_UNITY_BUILD ${UNITY_BUILD_EMU})
cotire(rpcs3_emu)
cotire(rpcs3_emu)
endif()
endif()
+160 -79
View File
@@ -84,12 +84,11 @@ struct cpu_prof
void print(u32 id) const
{
// Make reversed map: sample_count -> name
std::multimap<u64, u64> chart;
std::multimap<u64, u64, std::greater<u64>> chart;
for (auto& [name, count] : freq)
{
// Inverse bits to sort in descending order
chart.emplace(~count, name);
chart.emplace(count, name);
}
// Print results
@@ -99,10 +98,8 @@ struct cpu_prof
// Fraction of non-idle samples
const f64 busy = 1. * (samples - idle) / samples;
for (auto& [rcount, name] : chart)
for (auto& [count, name] : chart)
{
// Get correct count value
const u64 count = ~rcount;
const f64 _frac = count / busy / samples;
// Print only 7 hash characters out of 11 (which covers roughly 48 bits)
@@ -243,28 +240,83 @@ using cpu_profiler = named_thread<cpu_prof>;
thread_local cpu_thread* g_tls_current_cpu_thread = nullptr;
// For synchronizing suspend_all operation
alignas(64) shared_mutex g_cpu_suspend_lock;
struct cpu_counter
{
// For synchronizing suspend_all operation
alignas(64) shared_mutex cpu_suspend_lock;
// Semaphore for global thread array (global counter)
alignas(64) atomic_t<u32> g_cpu_array_sema{0};
// Semaphore for global thread array (global counter)
alignas(64) atomic_t<u32> cpu_array_sema{0};
// Semaphore subdivision for each array slot (64 x N in total)
atomic_t<u64> g_cpu_array_bits[6]{};
// Semaphore subdivision for each array slot (64 x N in total)
atomic_t<u64> cpu_array_bits[6]{};
// All registered threads
atomic_t<cpu_thread*> g_cpu_array[sizeof(g_cpu_array_bits) * 8]{};
// All registered threads
atomic_t<cpu_thread*> cpu_array[sizeof(cpu_array_bits) * 8]{};
u64 add(cpu_thread* _this)
{
if (!cpu_array_sema.try_inc(sizeof(cpu_counter::cpu_array_bits) * 8))
{
return -1;
}
u64 array_slot = -1;
for (u32 i = 0;; i = (i + 1) % ::size32(cpu_array_bits))
{
const auto [bits, ok] = cpu_array_bits[i].fetch_op([](u64& bits) -> u64
{
if (~bits) [[likely]]
{
// Set lowest clear bit
bits |= bits + 1;
return true;
}
return false;
});
if (ok) [[likely]]
{
// Get actual slot number
array_slot = i * 64 + std::countr_one(bits);
break;
}
}
// Register and wait if necessary
verify("cpu_counter::add()" HERE), cpu_array[array_slot].exchange(_this) == nullptr;
_this->state += cpu_flag::wait;
cpu_suspend_lock.lock_unlock();
return array_slot;
}
void remove(cpu_thread* _this, u64 slot)
{
// Unregister and wait if necessary
_this->state += cpu_flag::wait;
if (cpu_array[slot].exchange(nullptr) != _this)
sys_log.fatal("Inconsistency for array slot %u", slot);
cpu_array_bits[slot / 64] &= ~(1ull << (slot % 64));
cpu_array_sema--;
cpu_suspend_lock.lock_unlock();
}
};
template <typename F>
void for_all_cpu(F&& func) noexcept
{
for (u32 i = 0; i < ::size32(g_cpu_array_bits); i++)
{
for (u64 bits = g_cpu_array_bits[i]; bits; bits &= bits - 1)
{
const u64 index = i * 64 + utils::cnttz64(bits, true);
auto ctr = g_fxo->get<cpu_counter>();
if (cpu_thread* cpu = g_cpu_array[index].load())
for (u32 i = 0; i < ::size32(ctr->cpu_array_bits); i++)
{
for (u64 bits = ctr->cpu_array_bits[i]; bits; bits &= bits - 1)
{
const u64 index = i * 64 + std::countr_zero(bits);
if (cpu_thread* cpu = ctr->cpu_array[index].load())
{
func(cpu);
}
@@ -301,53 +353,79 @@ void cpu_thread::operator()()
}
}
if (id_type() == 1 && false)
while (!g_fxo->get<cpu_counter>() && !g_fxo->get<cpu_profiler>())
{
g_fxo->get<cpu_profiler>()->registered.push(id);
// Can we have a little race, right? First thread is started concurrently with g_fxo->init()
std::this_thread::sleep_for(1ms);
}
if (id_type() == 2 && g_cfg.core.spu_prof)
switch (id_type())
{
g_fxo->get<cpu_profiler>()->registered.push(id);
case 1:
{
//g_fxo->get<cpu_profiler>()->registered.push(id);
break;
}
case 2:
{
if (g_cfg.core.spu_prof)
{
g_fxo->get<cpu_profiler>()->registered.push(id);
}
break;
}
default: break;
}
// Register thread in g_cpu_array
if (!g_cpu_array_sema.try_inc(sizeof(g_cpu_array_bits) * 8))
const u64 array_slot = g_fxo->get<cpu_counter>()->add(this);
if (array_slot == umax)
{
sys_log.fatal("Too many threads.");
Emu.Pause();
return;
}
u64 array_slot = -1;
for (u32 i = 0;; i = (i + 1) % ::size32(g_cpu_array_bits))
static thread_local struct thread_cleanup_t
{
const auto [bits, ok] = g_cpu_array_bits[i].fetch_op([](u64& bits) -> u64
cpu_thread* _this;
u64 slot;
std::string name;
thread_cleanup_t(cpu_thread* _this, u64 slot)
: _this(_this)
, slot(slot)
, name(thread_ctrl::get_name())
{
if (~bits) [[likely]]
}
void cleanup()
{
if (_this == nullptr)
{
// Set lowest clear bit
bits |= bits + 1;
return true;
return;
}
return false;
});
if (auto ptr = vm::g_tls_locked)
{
ptr->compare_and_swap(_this, nullptr);
}
if (ok) [[likely]]
{
// Get actual slot number
array_slot = i * 64 + utils::cnttz64(~bits, false);
break;
g_fxo->get<cpu_counter>()->remove(_this, slot);
_this = nullptr;
}
}
// Register and wait if necessary
verify("g_cpu_array[...] -> this" HERE), g_cpu_array[array_slot].exchange(this) == nullptr;
state += cpu_flag::wait;
g_cpu_suspend_lock.lock_unlock();
~thread_cleanup_t()
{
if (_this)
{
sys_log.warning("CPU Thread '%s' terminated abnormally:\n%s", name, _this->dump_all());
cleanup();
}
}
} cleanup{this, array_slot};
// Check thread status
while (!(state & (cpu_flag::exit + cpu_flag::dbg_global_stop)) && thread_ctrl::state() != thread_state::aborting)
@@ -355,18 +433,7 @@ void cpu_thread::operator()()
// Check stop status
if (!(state & cpu_flag::stop))
{
try
{
cpu_task();
}
catch (const std::exception& e)
{
Emu.Pause();
sys_log.fatal("%s thrown: %s", typeid(e).name(), e.what());
sys_log.notice("\n%s", dump());
break;
}
cpu_task();
state -= cpu_flag::ret;
continue;
}
@@ -374,17 +441,8 @@ void cpu_thread::operator()()
thread_ctrl::wait();
}
if (auto ptr = vm::g_tls_locked)
{
ptr->compare_and_swap(this, nullptr);
}
// Unregister and wait if necessary
state += cpu_flag::wait;
verify("g_cpu_array[...] -> null" HERE), g_cpu_array[array_slot].exchange(nullptr) == this;
g_cpu_array_bits[array_slot / 64] &= ~(1ull << (array_slot % 64));
g_cpu_array_sema--;
g_cpu_suspend_lock.lock_unlock();
// Complete cleanup gracefully
cleanup.cleanup();
}
cpu_thread::~cpu_thread()
@@ -479,7 +537,7 @@ bool cpu_thread::check_state() noexcept
else
{
// If only cpu_flag::pause was set, notification won't arrive
g_cpu_suspend_lock.lock_unlock();
g_fxo->get<cpu_counter>()->cpu_suspend_lock.lock_unlock();
}
}
@@ -550,7 +608,27 @@ std::string cpu_thread::get_name() const
}
}
std::string cpu_thread::dump() const
std::string cpu_thread::dump_all() const
{
return {};
}
std::string cpu_thread::dump_regs() const
{
return {};
}
std::string cpu_thread::dump_callstack() const
{
return {};
}
std::vector<u32> cpu_thread::dump_callstack_list() const
{
return {};
}
std::string cpu_thread::dump_misc() const
{
return fmt::format("Type: %s\n" "State: %s\n", typeid(*this).name(), state.load());
}
@@ -563,11 +641,14 @@ cpu_thread::suspend_all::suspend_all(cpu_thread* _this) noexcept
m_this->state += cpu_flag::wait;
}
g_cpu_suspend_lock.lock_vip();
g_fxo->get<cpu_counter>()->cpu_suspend_lock.lock_vip();
for_all_cpu([](cpu_thread* cpu)
{
cpu->state += cpu_flag::pause;
if (!(cpu->state & cpu_flag::pause))
{
cpu->state += cpu_flag::pause;
}
});
busy_wait(500);
@@ -596,18 +677,18 @@ cpu_thread::suspend_all::suspend_all(cpu_thread* _this) noexcept
cpu_thread::suspend_all::~suspend_all()
{
// Make sure the latest thread does the cleanup and notifies others
if (g_cpu_suspend_lock.downgrade_unique_vip_lock_to_low_or_unlock())
if (g_fxo->get<cpu_counter>()->cpu_suspend_lock.downgrade_unique_vip_lock_to_low_or_unlock())
{
for_all_cpu([&](cpu_thread* cpu)
{
cpu->state -= cpu_flag::pause;
});
g_cpu_suspend_lock.unlock_low();
g_fxo->get<cpu_counter>()->cpu_suspend_lock.unlock_low();
}
else
{
g_cpu_suspend_lock.lock_unlock();
g_fxo->get<cpu_counter>()->cpu_suspend_lock.lock_unlock();
}
if (m_this)
@@ -626,7 +707,7 @@ void cpu_thread::stop_all() noexcept
}
else
{
::vip_lock lock(g_cpu_suspend_lock);
::vip_lock lock(g_fxo->get<cpu_counter>()->cpu_suspend_lock);
for_all_cpu([](cpu_thread* cpu)
{
@@ -637,7 +718,7 @@ void cpu_thread::stop_all() noexcept
sys_log.notice("All CPU threads have been signaled.");
while (g_cpu_array_sema)
while (g_fxo->get<cpu_counter>()->cpu_array_sema)
{
std::this_thread::sleep_for(10ms);
}
+17 -3
View File
@@ -1,8 +1,10 @@
#pragma once
#pragma once
#include "../Utilities/Thread.h"
#include "../Utilities/bit_set.h"
#include <vector>
// Thread state flags
enum class cpu_flag : u32
{
@@ -91,8 +93,20 @@ public:
// Get thread name (as assigned to named_thread)
std::string get_name() const;
// Get CPU state dump
virtual std::string dump() const;
// Get CPU state dump (everything)
virtual std::string dump_all() const = 0;
// Get CPU register dump
virtual std::string dump_regs() const;
// Get CPU call stack dump
virtual std::string dump_callstack() const;
// Get CPU call stack list
virtual std::vector<u32> dump_callstack_list() const;
// Get CPU dump of misc information
virtual std::string dump_misc() const;
// Thread entry point function
virtual void cpu_task() = 0;
+4 -4
View File
@@ -1,4 +1,4 @@
#ifdef LLVM_AVAILABLE
#ifdef LLVM_AVAILABLE
#include "CPUTranslator.h"
@@ -117,21 +117,21 @@ v128 cpu_translator::get_const_vector<v128>(llvm::Constant* c, u32 a, u32 b)
{
for (u32 i = 0; i < 16; i++)
{
result._u8[i] = cv->getElementAsInteger(i);
result._u8[i] = static_cast<u8>(cv->getElementAsInteger(i));
}
}
else if (sct->isIntegerTy(16))
{
for (u32 i = 0; i < 8; i++)
{
result._u16[i] = cv->getElementAsInteger(i);
result._u16[i] = static_cast<u16>(cv->getElementAsInteger(i));
}
}
else if (sct->isIntegerTy(32))
{
for (u32 i = 0; i < 4; i++)
{
result._u32[i] = cv->getElementAsInteger(i);
result._u32[i] = static_cast<u32>(cv->getElementAsInteger(i));
}
}
else if (sct->isIntegerTy(64))
+13 -1
View File
@@ -16,6 +16,7 @@
#include "llvm/IR/Module.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Analysis/ConstantFolding.h"
#include "llvm/IR/IntrinsicsX86.h"
#ifdef _MSC_VER
#pragma warning(pop)
#else
@@ -27,7 +28,7 @@
#include "Utilities/StrFmt.h"
#include "Utilities/BEType.h"
#include "Utilities/BitField.h"
#include "Utilities/Log.h"
#include "util/logs.hpp"
#include "Utilities/JIT.h"
#include <unordered_map>
@@ -2841,6 +2842,17 @@ struct fmt_unveil<llvm::TypeSize, void>
}
};
#ifndef _MSC_VER
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wignored-attributes"
#endif
template <>
inline llvm::Type* cpu_translator::get_type<__m128i>()
{
return llvm::VectorType::get(llvm::Type::getInt8Ty(m_context), 16);
}
#ifndef _MSC_VER
#pragma GCC diagnostic pop
#endif
+3 -1
View File
@@ -62,5 +62,7 @@ void fmt_class_string<spu_mfc_cmd>::format(std::string& out, u64 arg)
{
const auto& cmd = get_object(arg);
fmt::append(out, "%s #%02u 0x%05x:0x%08x 0x%x", cmd.cmd, cmd.tag, cmd.lsa, cmd.eah * 0x100000000ull + cmd.eal, cmd.size);
const u8 tag = cmd.tag;
fmt::append(out, "%s #%02u 0x%05x:0x%08llx 0x%x%s", cmd.cmd, tag & 0x7f, cmd.lsa, u64{cmd.eah} << 32 | cmd.eal, cmd.size, (tag & 0x80) ? " (stalled)" : "");
}
+1 -1
View File
@@ -80,7 +80,7 @@ bool statichle_handler::load_patterns()
for (u32 j = 0; j < 32; j++)
dapat.start_pattern[j] = char_to_u8(pattern[0][j * 2], pattern[0][(j * 2) + 1]);
dapat.crc16_length = char_to_u8(pattern[1][0], pattern[1][1]);
dapat.crc16_length = ::narrow<u8>(char_to_u8(pattern[1][0], pattern[1][1]), HERE);
dapat.crc16 = (char_to_u8(pattern[2][0], pattern[2][1]) << 8) | char_to_u8(pattern[2][2], pattern[2][3]);
dapat.total_length = (char_to_u8(pattern[3][0], pattern[3][1]) << 8) | char_to_u8(pattern[3][2], pattern[3][3]);
dapat.module = pattern[4];
+6 -1
View File
@@ -833,7 +833,12 @@ error_code cellAdecClose(u32 handle)
thread_ctrl::wait_for(1000); // hack
}
idm::remove<ppu_thread>(handle);
if (!idm::remove_verify<ppu_thread>(handle, std::move(adec)))
{
// Removed by other thread beforehead
return CELL_ADEC_ERROR_ARG;
}
return CELL_OK;
}
+101 -54
View File
@@ -26,6 +26,8 @@ void fmt_class_string<CellAudioOutError>::format(std::string& out, u64 arg)
});
}
error_code cellAudioOutGetNumberOfDevice(u32 audioOut);
error_code cellAudioOutGetSoundAvailability(u32 audioOut, u32 type, u32 fs, u32 option)
{
cellSysutil.warning("cellAudioOutGetSoundAvailability(audioOut=%d, type=%d, fs=0x%x, option=%d)", audioOut, type, fs, option);
@@ -122,29 +124,55 @@ error_code cellAudioOutGetState(u32 audioOut, u32 deviceIndex, vm::ptr<CellAudio
return CELL_AUDIO_OUT_ERROR_ILLEGAL_PARAMETER;
}
*state = {};
const auto num = cellAudioOutGetNumberOfDevice(audioOut);
if (num < 0)
{
return num;
}
CellAudioOutState _state;
std::memset(&_state, 0, sizeof(_state));
if (deviceIndex >= num + 0u)
{
if (audioOut == CELL_AUDIO_OUT_SECONDARY)
{
// Error codes are not returned here
// Random (uninitialized) data from the stack seems to be returned here
// Although it was constant on my tests so let's write that
_state.state = 0x10;
_state.soundMode.layout = 0xD00C1680;
std::memcpy(state.get_ptr(), &_state, state.size());
return CELL_OK;
}
return CELL_AUDIO_OUT_ERROR_PARAMETER_OUT_OF_RANGE;
}
switch (audioOut)
{
case CELL_AUDIO_OUT_PRIMARY:
state->state = CELL_AUDIO_OUT_OUTPUT_STATE_ENABLED;
state->encoder = CELL_AUDIO_OUT_CODING_TYPE_LPCM;
state->downMixer = CELL_AUDIO_OUT_DOWNMIXER_NONE;
state->soundMode.type = CELL_AUDIO_OUT_CODING_TYPE_LPCM;
state->soundMode.channel = CELL_AUDIO_OUT_CHNUM_8;
state->soundMode.fs = CELL_AUDIO_OUT_FS_48KHZ;
state->soundMode.reserved = 0;
state->soundMode.layout = CELL_AUDIO_OUT_SPEAKER_LAYOUT_8CH_LREClrxy;
return CELL_OK;
case CELL_AUDIO_OUT_SECONDARY:
state->state = CELL_AUDIO_OUT_OUTPUT_STATE_DISABLED;
return CELL_OK;
{
_state.state = CELL_AUDIO_OUT_OUTPUT_STATE_ENABLED;
_state.encoder = CELL_AUDIO_OUT_CODING_TYPE_LPCM;
_state.downMixer = CELL_AUDIO_OUT_DOWNMIXER_NONE;
_state.soundMode.type = CELL_AUDIO_OUT_CODING_TYPE_LPCM;
_state.soundMode.channel = CELL_AUDIO_OUT_CHNUM_8;
_state.soundMode.fs = CELL_AUDIO_OUT_FS_48KHZ;
_state.soundMode.reserved = 0;
_state.soundMode.layout = CELL_AUDIO_OUT_SPEAKER_LAYOUT_8CH_LREClrxy;
break;
}
return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_AUDIO_OUT;
default:
return CELL_AUDIO_OUT_ERROR_ILLEGAL_PARAMETER;
}
std::memcpy(state.get_ptr(), &_state, state.size());
return CELL_OK;
}
error_code cellAudioOutConfigure(u32 audioOut, vm::ptr<CellAudioOutConfiguration> config, vm::ptr<CellAudioOutOption> option, u32 waitForEvent)
@@ -159,6 +187,7 @@ error_code cellAudioOutConfigure(u32 audioOut, vm::ptr<CellAudioOutConfiguration
switch (audioOut)
{
case CELL_AUDIO_OUT_PRIMARY:
{
if (config->channel)
{
//Emu.GetAudioManager().GetInfo().mode.channel = config->channel;
@@ -172,12 +201,14 @@ error_code cellAudioOutConfigure(u32 audioOut, vm::ptr<CellAudioOutConfiguration
}
return CELL_OK;
case CELL_AUDIO_OUT_SECONDARY:
return CELL_OK;
}
return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_AUDIO_OUT;
case CELL_AUDIO_OUT_SECONDARY:
return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_AUDIO_OUT;
default: break;
}
return CELL_AUDIO_OUT_ERROR_ILLEGAL_PARAMETER;
}
error_code cellAudioOutGetConfiguration(u32 audioOut, vm::ptr<CellAudioOutConfiguration> config, vm::ptr<CellAudioOutOption> option)
@@ -189,30 +220,27 @@ error_code cellAudioOutGetConfiguration(u32 audioOut, vm::ptr<CellAudioOutConfig
return CELL_AUDIO_OUT_ERROR_ILLEGAL_PARAMETER;
}
if (option)
{
*option = {};
}
*config = {};
CellAudioOutConfiguration _config;
std::memset(&_config, 0, sizeof(_config));
switch (audioOut)
{
case CELL_AUDIO_OUT_PRIMARY:
config->channel = CELL_AUDIO_OUT_CHNUM_8;
config->encoder = CELL_AUDIO_OUT_CODING_TYPE_LPCM;
config->downMixer = CELL_AUDIO_OUT_DOWNMIXER_NONE;
return CELL_OK;
case CELL_AUDIO_OUT_SECONDARY:
return CELL_OK;
default:
{
_config.channel = CELL_AUDIO_OUT_CHNUM_8;
_config.encoder = CELL_AUDIO_OUT_CODING_TYPE_LPCM;
_config.downMixer = CELL_AUDIO_OUT_DOWNMIXER_NONE;
break;
}
return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_AUDIO_OUT;
case CELL_AUDIO_OUT_SECONDARY:
return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_AUDIO_OUT;
default:
return CELL_AUDIO_OUT_ERROR_ILLEGAL_PARAMETER;
}
std::memcpy(config.get_ptr(), &_config, config.size());
return CELL_OK;
}
error_code cellAudioOutGetNumberOfDevice(u32 audioOut)
@@ -229,7 +257,7 @@ error_code cellAudioOutGetNumberOfDevice(u32 audioOut)
break;
}
return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_AUDIO_OUT;
return CELL_AUDIO_OUT_ERROR_ILLEGAL_PARAMETER;
}
error_code cellAudioOutGetDeviceInfo(u32 audioOut, u32 deviceIndex, vm::ptr<CellAudioOutDeviceInfo> info)
@@ -241,24 +269,42 @@ error_code cellAudioOutGetDeviceInfo(u32 audioOut, u32 deviceIndex, vm::ptr<Cell
return CELL_AUDIO_OUT_ERROR_ILLEGAL_PARAMETER;
}
if (deviceIndex)
const auto num = cellAudioOutGetNumberOfDevice(audioOut);
if (num < 0)
{
return CELL_AUDIO_OUT_ERROR_DEVICE_NOT_FOUND;
return num;
}
info->portType = CELL_AUDIO_OUT_PORT_HDMI;
info->availableModeCount = 2;
info->state = CELL_AUDIO_OUT_DEVICE_STATE_AVAILABLE;
info->latency = 1000;
info->availableModes[0].type = CELL_AUDIO_OUT_CODING_TYPE_LPCM;
info->availableModes[0].channel = CELL_AUDIO_OUT_CHNUM_8;
info->availableModes[0].fs = CELL_AUDIO_OUT_FS_48KHZ;
info->availableModes[0].layout = CELL_AUDIO_OUT_SPEAKER_LAYOUT_8CH_LREClrxy;
info->availableModes[1].type = CELL_AUDIO_OUT_CODING_TYPE_LPCM;
info->availableModes[1].channel = CELL_AUDIO_OUT_CHNUM_2;
info->availableModes[1].fs = CELL_AUDIO_OUT_FS_48KHZ;
info->availableModes[1].layout = CELL_AUDIO_OUT_SPEAKER_LAYOUT_2CH;
if (deviceIndex >= num + 0u)
{
if (audioOut == CELL_AUDIO_OUT_SECONDARY)
{
// Error codes are not returned here
std::memset(info.get_ptr(), 0, info.size());
return CELL_OK;
}
return CELL_AUDIO_OUT_ERROR_PARAMETER_OUT_OF_RANGE;
}
CellAudioOutDeviceInfo _info;
std::memset(&_info, 0, sizeof(_info));
_info.portType = CELL_AUDIO_OUT_PORT_HDMI;
_info.availableModeCount = 2;
_info.state = CELL_AUDIO_OUT_DEVICE_STATE_AVAILABLE;
_info.latency = 1000;
_info.availableModes[0].type = CELL_AUDIO_OUT_CODING_TYPE_LPCM;
_info.availableModes[0].channel = CELL_AUDIO_OUT_CHNUM_8;
_info.availableModes[0].fs = CELL_AUDIO_OUT_FS_48KHZ;
_info.availableModes[0].layout = CELL_AUDIO_OUT_SPEAKER_LAYOUT_8CH_LREClrxy;
_info.availableModes[1].type = CELL_AUDIO_OUT_CODING_TYPE_LPCM;
_info.availableModes[1].channel = CELL_AUDIO_OUT_CHNUM_2;
_info.availableModes[1].fs = CELL_AUDIO_OUT_FS_48KHZ;
_info.availableModes[1].layout = CELL_AUDIO_OUT_SPEAKER_LAYOUT_2CH;
std::memcpy(info.get_ptr(), &_info, info.size());
return CELL_OK;
}
@@ -274,10 +320,11 @@ error_code cellAudioOutSetCopyControl(u32 audioOut, u32 control)
switch (audioOut)
{
case CELL_AUDIO_OUT_PRIMARY:
case CELL_AUDIO_OUT_SECONDARY:
break;
default:
case CELL_AUDIO_OUT_SECONDARY:
return CELL_AUDIO_OUT_ERROR_UNSUPPORTED_AUDIO_OUT;
default:
return CELL_AUDIO_OUT_ERROR_ILLEGAL_PARAMETER;
}
return CELL_OK;
+8
View File
@@ -300,6 +300,14 @@ error_code cellVideoOutGetScreenSize(u32 videoOut, vm::ptr<f32> screenSize)
return CELL_VIDEO_OUT_ERROR_UNSUPPORTED_VIDEO_OUT;
}
if (g_cfg.video.enable_3d)
{
// Return Playstation 3D display value
// Some games call this function when 3D is enabled
*screenSize = 24.f;
return CELL_OK;
}
// TODO: Use virtual screen size
#ifdef _WIN32
// HDC screen = GetDC(NULL);
-32
View File
@@ -44,38 +44,6 @@ error_code cellCameraReadEx(s32 dev_num, vm::ptr<CellCameraReadEx> read);
// * HLE helper functions *
// ************************
template <>
void fmt_class_string<camera_handler>::format(std::string& out, u64 arg)
{
format_enum(out, arg, [](auto value)
{
switch (value)
{
case camera_handler::null: return "Null";
case camera_handler::fake: return "Fake";
}
return unknown;
});
}
template <>
void fmt_class_string<fake_camera_type>::format(std::string& out, u64 arg)
{
format_enum(out, arg, [](auto value)
{
switch (value)
{
case fake_camera_type::unknown: return "Unknown";
case fake_camera_type::eyetoy: return "EyeToy";
case fake_camera_type::eyetoy2: return "PS Eye";
case fake_camera_type::uvc1_1: return "UVC 1.1";
}
return unknown;
});
}
static const char* get_camera_attr_name(s32 value)
{
switch (value)
-6
View File
@@ -863,12 +863,6 @@ s32 cellFsStReadWaitCallback(u32 fd, u64 size, vm::ptr<void(s32 xfd, u64 xsize)>
using fs_aio_cb_t = vm::ptr<void(vm::ptr<CellFsAio> xaio, s32 error, s32 xid, u64 size)>;
// temporarily
struct lv2_fs_mount_point
{
std::mutex mutex;
};
struct fs_aio_thread : ppu_thread
{
using ppu_thread::ppu_thread;
+18 -22
View File
@@ -10,6 +10,7 @@
#include "Loader/PSF.h"
#include "Utilities/StrUtil.h"
#include "Utilities/span.h"
#include "util/init_mutex.hpp"
#include <thread>
@@ -137,15 +138,9 @@ struct content_permission final
bool success = false;
fs::g_tls_error = fs::error::ok;
try
{
if (temp.size() <= 1 || fs::remove_all(temp))
{
success = true;
}
}
catch (...)
if (temp.size() <= 1 || fs::remove_all(temp))
{
success = true;
}
if (!success)
@@ -483,13 +478,14 @@ error_code cellGameDataCheck(u32 type, vm::cptr<char> dirName, vm::ptr<CellGameC
perm->can_create = true;
}
perm->restrict_sfo_params = false;
if (!fs::is_dir(vfs::get(dir)))
{
cellGame.warning("cellGameDataCheck(): directory '%s' not found", dir);
return not_an_error(CELL_GAME_RET_NONE);
}
perm->restrict_sfo_params = false;
perm->sfo = psf::load_object(fs::file(vfs::get(dir + "/PARAM.SFO")));
return CELL_OK;
}
@@ -569,9 +565,13 @@ error_code cellGameDataCheckCreate2(ppu_thread& ppu, u32 version, vm::cptr<char>
const u32 new_data = sfo.empty() && !fs::is_file(vfs::get(dir + "/PARAM.SFO")) ? CELL_GAMEDATA_ISNEWDATA_YES : CELL_GAMEDATA_ISNEWDATA_NO;
if (!new_data && psf::get_string(sfo, "CATEGORY", "") != "GD")
if (!new_data)
{
return CELL_GAMEDATA_ERROR_BROKEN;
const auto cat = psf::get_string(sfo, "CATEGORY", "");
if (cat != "GD" && cat != "DG")
{
return CELL_GAMEDATA_ERROR_BROKEN;
}
}
cbGet->isNewData = new_data;
@@ -632,7 +632,11 @@ error_code cellGameDataCheckCreate2(ppu_thread& ppu, u32 version, vm::cptr<char>
if (setParam)
{
psf::assign(sfo, "CATEGORY", psf::string(3, "GD"));
if (new_data)
{
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", psf::string(CELL_GAME_SYSP_TITLE_SIZE, setParam->title));
psf::assign(sfo, "VERSION", psf::string(CELL_GAME_SYSP_VERSION_SIZE, setParam->dataVersion));
@@ -873,7 +877,6 @@ error_code cellGameGetParamString(s32 id, vm::ptr<char> buf, u32 bufsize)
}
const std::string value = psf::get_string(prm->sfo, std::string(key.name));
const auto value_size = value.size() + 1;
if (value.empty() && !prm->sfo.count(std::string(key.name)))
{
@@ -881,15 +884,8 @@ error_code cellGameGetParamString(s32 id, vm::ptr<char> buf, u32 bufsize)
cellGame.warning("cellGameGetParamString(): id=%d was not found", id);
}
const auto pbuf = buf.get_ptr();
const bool to_pad = bufsize > value_size;
std::memcpy(pbuf, value.c_str(), to_pad ? value_size : bufsize);
if (to_pad)
{
std::memset(pbuf + value_size, 0, bufsize - value_size);
}
gsl::span dst(buf.get_ptr(), bufsize);
strcpy_trunc(dst, value);
return CELL_OK;
}
+6 -7
View File
@@ -266,7 +266,7 @@ error_code cellGcmBindTile(u8 index)
return CELL_GCM_ERROR_INVALID_VALUE;
}
rsx::get_current_renderer()->tiles[index].binded = true;
rsx::get_current_renderer()->tiles[index].bound = true;
return CELL_OK;
}
@@ -281,7 +281,7 @@ error_code cellGcmBindZcull(u8 index, u32 offset, u32 width, u32 height, u32 cul
return CELL_GCM_ERROR_INVALID_VALUE;
}
rsx::get_current_renderer()->zculls[index].binded = true;
rsx::get_current_renderer()->zculls[index].bound = true;
return CELL_OK;
}
@@ -586,7 +586,6 @@ void cellGcmSetSecondVFrequency(u32 freq)
switch (freq)
{
case CELL_GCM_DISPLAY_FREQUENCY_59_94HZ:
render->fps_limit = 59.94;
break;
case CELL_GCM_DISPLAY_FREQUENCY_SCANOUT:
cellGcmSys.todo("Unimplemented display frequency: Scanout");
@@ -702,7 +701,7 @@ void cellGcmSetZcull(u8 index, u32 offset, u32 width, u32 height, u32 cullStart,
zcull.sFunc = sFunc;
zcull.sRef = sRef;
zcull.sMask = sMask;
zcull.binded = (zCullFormat > 0);
zcull.bound = (zCullFormat > 0);
vm::_ptr<CellGcmZcullInfo>(gcm_cfg->zculls_addr)[index] = zcull.pack();
}
@@ -716,7 +715,7 @@ error_code cellGcmUnbindTile(u8 index)
return CELL_GCM_ERROR_INVALID_VALUE;
}
rsx::get_current_renderer()->tiles[index].binded = false;
rsx::get_current_renderer()->tiles[index].bound = false;
return CELL_OK;
}
@@ -730,7 +729,7 @@ error_code cellGcmUnbindZcull(u8 index)
return CELL_GCM_ERROR_INVALID_VALUE;
}
rsx::get_current_renderer()->zculls[index].binded = false;
rsx::get_current_renderer()->zculls[index].bound = false;
return CELL_OK;
}
@@ -1302,7 +1301,7 @@ error_code cellGcmSetTile(u8 index, u8 location, u32 offset, u32 size, u32 pitch
tile.comp = comp;
tile.base = base;
tile.bank = bank;
tile.binded = (pitch > 0);
tile.bound = (pitch > 0);
vm::_ptr<CellGcmTileInfo>(gcm_cfg->tiles_addr)[index] = tile.pack();
return CELL_OK;
+10 -22
View File
@@ -136,26 +136,6 @@ struct gem_config
}
};
// ************************
// * HLE helper functions *
// ************************
template <>
void fmt_class_string<move_handler>::format(std::string& out, u64 arg)
{
format_enum(out, arg, [](auto value)
{
switch (value)
{
case move_handler::null: return "Null";
case move_handler::fake: return "Fake";
case move_handler::mouse: return "Mouse";
}
return unknown;
});
}
/**
* \brief Verifies that a Move controller id is valid
* \param gem_num Move controler ID to verify
@@ -295,7 +275,7 @@ static bool ds3_input_to_ext(const u32 port_no, CellGemExtPortData& ext)
* \param mouse_no Mouse index number to use
* \param digital_buttons Bitmask filled with CELL_GEM_CTRL_* values
* \param analog_t Analog value of Move's Trigger.
* \return true on success, false if mouse mouse_no is invalid
* \return true on success, false if mouse_no is invalid
*/
static bool mouse_input_to_pad(const u32 mouse_no, be_t<u16>& digital_buttons, be_t<u16>& analog_t)
{
@@ -325,7 +305,7 @@ static bool mouse_input_to_pad(const u32 mouse_no, be_t<u16>& digital_buttons, b
if ((mouse_data.buttons & CELL_MOUSE_BUTTON_2) && (mouse_data.buttons & CELL_MOUSE_BUTTON_3))
digital_buttons |= CELL_GEM_CTRL_TRIANGLE;
analog_t = mouse_data.buttons & (CELL_MOUSE_BUTTON_1 ? 0xFFFF : 0);
analog_t = (mouse_data.buttons & CELL_MOUSE_BUTTON_1) ? 0xFFFF : 0;
return true;
}
@@ -713,7 +693,9 @@ error_code cellGemGetImageState(u32 gem_num, vm::ptr<CellGemImageState> gem_imag
gem_image_state->projectiony = 1;
}
else if (g_cfg.io.move == move_handler::mouse)
{
mouse_pos_to_gem_image_state(gem_num, gem_image_state);
}
if (g_cfg.io.move == move_handler::fake || g_cfg.io.move == move_handler::mouse)
{
@@ -747,9 +729,13 @@ error_code cellGemGetInertialState(u32 gem_num, u32 state_flag, u64 timestamp, v
}
if (g_cfg.io.move == move_handler::fake)
{
ds3_input_to_pad(gem_num, inertial_state->pad.digitalbuttons, inertial_state->pad.analog_T);
}
else if (g_cfg.io.move == move_handler::mouse)
{
mouse_input_to_pad(gem_num, inertial_state->pad.digitalbuttons, inertial_state->pad.analog_T);
}
if (g_cfg.io.move == move_handler::fake || g_cfg.io.move == move_handler::mouse)
{
@@ -879,7 +865,9 @@ error_code cellGemGetState(u32 gem_num, u32 flag, u64 time_parameter, vm::ptr<Ce
}
if (g_cfg.io.move == move_handler::fake)
{
ds3_input_to_pad(gem_num, gem_state->pad.digitalbuttons, gem_state->pad.analog_T);
}
else if (g_cfg.io.move == move_handler::mouse)
{
mouse_input_to_pad(gem_num, gem_state->pad.digitalbuttons, gem_state->pad.analog_T);
+15 -15
View File
@@ -56,7 +56,7 @@ bool ime_jp_manager::addString(vm::cptr<u16> str)
if (!str)
return false;
for (size_t i = 0; i < CELL_IMEJP_STRING_MAXLENGTH; i++)
for (u32 i = 0; i < CELL_IMEJP_STRING_MAXLENGTH; i++)
{
if (!addChar(str[i]))
return false;
@@ -111,7 +111,7 @@ void ime_jp_manager::moveCursorEnd(s8 amount)
{
if (amount > 0)
{
cursor_end = std::max(static_cast<s32>(cursor), std::min<s32>(cursor_end + amount, input_string.length() - 1));
cursor_end = std::max(static_cast<s32>(cursor), std::min<s32>(static_cast<s32>(cursor_end) + amount, ::narrow<s32>(input_string.length()) - 1));
}
else if (amount < 0)
{
@@ -199,7 +199,7 @@ error_code cellImeJpOpen3(sys_memory_container_t container_id, vm::ptr<CellImeJp
if (addDicPath)
{
for (size_t i = 0; i < 4; i++)
for (u32 i = 0; i < 4; i++)
{
if (addDicPath[i] && addDicPath[i]->path[0])
{
@@ -798,10 +798,10 @@ error_code cellImeJpMoveFocusClause(CellImeJpHandle hImeJpHandle, s16 moveType)
manager->moveCursor(-1);
break;
case CELL_IMEJP_FOCUS_TOP:
manager->moveCursor((-1) * manager->input_string.length());
manager->moveCursor(-1 * ::narrow<s8>(manager->input_string.length(), HERE));
break;
case CELL_IMEJP_FOCUS_END:
manager->moveCursor(manager->input_string.length());
manager->moveCursor(::narrow<s8>(manager->input_string.length(), HERE));
manager->moveCursor(-1);
break;
default:
@@ -830,7 +830,7 @@ error_code cellImeJpGetFocusTop(CellImeJpHandle hImeJpHandle, vm::ptr<s16> pFocu
return CELL_IMEJP_ERROR_CONTEXT;
}
*pFocusTop = manager->cursor * 2; // offset in bytes
*pFocusTop = static_cast<u16>(manager->cursor * 2); // offset in bytes
return CELL_OK;
}
@@ -858,7 +858,7 @@ error_code cellImeJpGetFocusLength(CellImeJpHandle hImeJpHandle, vm::ptr<s16> pF
}
else
{
*pFocusLength = (manager->cursor_end - manager->cursor + 1) * 2; // offset in bytes
*pFocusLength = static_cast<u16>((manager->cursor_end - manager->cursor + 1) * 2); // offset in bytes
}
return CELL_OK;
@@ -881,14 +881,14 @@ error_code cellImeJpGetConfirmYomiString(CellImeJpHandle hImeJpHandle, vm::ptr<u
return CELL_IMEJP_ERROR_CONTEXT;
}
for (size_t i = 0; i < CELL_IMEJP_STRING_MAXLENGTH; i++)
for (u32 i = 0; i < CELL_IMEJP_STRING_MAXLENGTH; i++)
{
pYomiString[i] = 0;
}
const size_t max_len = std::min<size_t>(CELL_IMEJP_STRING_MAXLENGTH - 1, manager->confirmed_string.length());
for (size_t i = 0; i < max_len; i++)
for (u32 i = 0; i < max_len; i++)
{
pYomiString[i] = manager->confirmed_string[i];
}
@@ -913,14 +913,14 @@ error_code cellImeJpGetConfirmString(CellImeJpHandle hImeJpHandle, vm::ptr<u16>
return CELL_IMEJP_ERROR_CONTEXT;
}
for (size_t i = 0; i < CELL_IMEJP_STRING_MAXLENGTH; i++)
for (u32 i = 0; i < CELL_IMEJP_STRING_MAXLENGTH; i++)
{
pConfirmString[i] = 0;
}
const size_t max_len = std::min<size_t>(CELL_IMEJP_STRING_MAXLENGTH - 1, manager->confirmed_string.length());
for (size_t i = 0; i < max_len; i++)
for (u32 i = 0; i < max_len; i++)
{
pConfirmString[i] = manager->confirmed_string[i];
}
@@ -945,14 +945,14 @@ error_code cellImeJpGetConvertYomiString(CellImeJpHandle hImeJpHandle, vm::ptr<u
return CELL_IMEJP_ERROR_CONTEXT;
}
for (size_t i = 0; i < CELL_IMEJP_STRING_MAXLENGTH; i++)
for (u32 i = 0; i < CELL_IMEJP_STRING_MAXLENGTH; i++)
{
pYomiString[i] = 0;
}
const size_t max_len = std::min<size_t>(CELL_IMEJP_STRING_MAXLENGTH - 1, manager->input_string.length());
for (size_t i = 0; i < max_len; i++)
for (u32 i = 0; i < max_len; i++)
{
pYomiString[i] = manager->input_string[i];
}
@@ -977,14 +977,14 @@ error_code cellImeJpGetConvertString(CellImeJpHandle hImeJpHandle, vm::ptr<u16>
return CELL_IMEJP_ERROR_CONTEXT;
}
for (size_t i = 0; i < CELL_IMEJP_STRING_MAXLENGTH; i++)
for (u32 i = 0; i < CELL_IMEJP_STRING_MAXLENGTH; i++)
{
pConvertString[i] = 0;
}
const size_t max_len = std::min<size_t>(CELL_IMEJP_STRING_MAXLENGTH - 1, manager->input_string.length());
for (size_t i = 0; i < max_len; i++)
for (u32 i = 0; i < max_len; i++)
{
pConvertString[i] = manager->input_string[i];
}
-17
View File
@@ -10,23 +10,6 @@
LOG_CHANNEL(cellMic);
template <>
void fmt_class_string<microphone_handler>::format(std::string& out, u64 arg)
{
format_enum(out, arg, [](auto value) {
switch (value)
{
case microphone_handler::null: return "Null";
case microphone_handler::standard: return "Standard";
case microphone_handler::singstar: return "SingStar";
case microphone_handler::real_singstar: return "Real SingStar";
case microphone_handler::rocksmith: return "Rocksmith";
}
return unknown;
});
}
void mic_context::operator()()
{
while (thread_ctrl::state() != thread_state::aborting)
+2 -2
View File
@@ -116,7 +116,7 @@ struct msg_dlg_thread_info
continue;
}
dlg->close();
dlg->close(true, true);
}
}
else if (const auto dlg = g_fxo->get<msg_info>()->get())
@@ -463,7 +463,7 @@ error_code cellMsgDialogAbort()
if (auto dlg = manager->get<rsx::overlays::message_dialog>())
{
g_fxo->get<msg_dlg_thread>()->wait_until = 0;
dlg->close(false);
dlg->close(false, true);
return CELL_OK;
}
}
+51 -37
View File
@@ -2,12 +2,18 @@
#include "Emu/system_config.h"
#include "Emu/Cell/PPUModule.h"
#include "Emu/IdManager.h"
#include "Emu/Cell/lv2/sys_sync.h"
#include "cellGame.h"
#include "cellSysutil.h"
#include "cellNetCtl.h"
#include "Utilities/StrUtil.h"
#include "Emu/IdManager.h"
#include "Emu/NP/np_handler.h"
#include <thread>
LOG_CHANNEL(cellNetCtl);
@@ -90,14 +96,14 @@ error_code cellNetCtlInit()
{
cellNetCtl.warning("cellNetCtlInit()");
auto net_ctl_manager = g_fxo->get<cell_net_ctl_manager>();
const auto nph = g_fxo->get<named_thread<np_handler>>();
if (net_ctl_manager->is_initialized)
if (nph->is_netctl_init)
{
return CELL_NET_CTL_ERROR_NOT_TERMINATED;
}
net_ctl_manager->is_initialized = true;
nph->is_netctl_init = true;
return CELL_OK;
}
@@ -106,15 +112,17 @@ void cellNetCtlTerm()
{
cellNetCtl.warning("cellNetCtlTerm()");
auto net_ctl_manager = g_fxo->get<cell_net_ctl_manager>();
net_ctl_manager->is_initialized = false;
const auto nph = g_fxo->get<named_thread<np_handler>>();
nph->is_netctl_init = false;
}
error_code cellNetCtlGetState(vm::ptr<s32> state)
{
cellNetCtl.trace("cellNetCtlGetState(state=*0x%x)", state);
if (!g_fxo->get<cell_net_ctl_manager>()->is_initialized)
const auto nph = g_fxo->get<named_thread<np_handler>>();
if (!nph->is_netctl_init)
{
return CELL_NET_CTL_ERROR_NOT_INITIALIZED;
}
@@ -124,7 +132,8 @@ error_code cellNetCtlGetState(vm::ptr<s32> state)
return CELL_NET_CTL_ERROR_INVALID_ADDR;
}
*state = g_cfg.net.net_status;
*state = nph->get_net_status();
return CELL_OK;
}
@@ -132,7 +141,9 @@ error_code cellNetCtlAddHandler(vm::ptr<cellNetCtlHandler> handler, vm::ptr<void
{
cellNetCtl.todo("cellNetCtlAddHandler(handler=*0x%x, arg=*0x%x, hid=*0x%x)", handler, arg, hid);
if (!g_fxo->get<cell_net_ctl_manager>()->is_initialized)
const auto nph = g_fxo->get<named_thread<np_handler>>();
if (!nph->is_netctl_init)
{
return CELL_NET_CTL_ERROR_NOT_INITIALIZED;
}
@@ -149,7 +160,9 @@ error_code cellNetCtlDelHandler(s32 hid)
{
cellNetCtl.todo("cellNetCtlDelHandler(hid=0x%x)", hid);
if (!g_fxo->get<cell_net_ctl_manager>()->is_initialized)
const auto nph = g_fxo->get<named_thread<np_handler>>();
if (!nph->is_netctl_init)
{
return CELL_NET_CTL_ERROR_NOT_INITIALIZED;
}
@@ -166,7 +179,9 @@ error_code cellNetCtlGetInfo(s32 code, vm::ptr<CellNetCtlInfo> info)
{
cellNetCtl.todo("cellNetCtlGetInfo(code=0x%x (%s), info=*0x%x)", code, InfoCodeToName(code), info);
if (!g_fxo->get<cell_net_ctl_manager>()->is_initialized)
const auto nph = g_fxo->get<named_thread<np_handler>>();
if (!nph->is_netctl_init)
{
return CELL_NET_CTL_ERROR_NOT_INITIALIZED;
}
@@ -183,7 +198,7 @@ error_code cellNetCtlGetInfo(s32 code, vm::ptr<CellNetCtlInfo> info)
return CELL_OK;
}
if (g_cfg.net.net_status == CELL_NET_CTL_STATE_Disconnected)
if (nph->get_net_status() == CELL_NET_CTL_STATE_Disconnected)
{
return CELL_NET_CTL_ERROR_NOT_CONNECTED;
}
@@ -198,15 +213,7 @@ error_code cellNetCtlGetInfo(s32 code, vm::ptr<CellNetCtlInfo> info)
}
else if (code == CELL_NET_CTL_INFO_IP_ADDRESS)
{
if (g_cfg.net.net_status != CELL_NET_CTL_STATE_IPObtained)
{
// 0.0.0.0 seems to be the default address when no ethernet cables are connected to the PS3
strcpy_trunc(info->ip_address, "0.0.0.0");
}
else
{
strcpy_trunc(info->ip_address, g_cfg.net.ip_address);
}
strcpy_trunc(info->ip_address, nph->get_ip());
}
else if (code == CELL_NET_CTL_INFO_NETMASK)
{
@@ -224,7 +231,9 @@ error_code cellNetCtlNetStartDialogLoadAsync(vm::cptr<CellNetCtlNetStartDialogPa
{
cellNetCtl.error("cellNetCtlNetStartDialogLoadAsync(param=*0x%x)", param);
if (!g_fxo->get<cell_net_ctl_manager>()->is_initialized)
const auto nph = g_fxo->get<named_thread<np_handler>>();
if (!nph->is_netctl_init)
{
return CELL_NET_CTL_ERROR_NOT_INITIALIZED;
}
@@ -244,10 +253,17 @@ error_code cellNetCtlNetStartDialogLoadAsync(vm::cptr<CellNetCtlNetStartDialogPa
return CELL_NET_CTL_ERROR_INVALID_SIZE;
}
// TODO: Actually sign into PSN or an emulated network similar to PSN (ESN)
// TODO: Properly open the dialog prompt for sign in
sysutil_send_system_cmd(CELL_SYSUTIL_NET_CTL_NETSTART_LOADED, 0);
sysutil_send_system_cmd(CELL_SYSUTIL_NET_CTL_NETSTART_FINISHED, 0);
// This is a hack for Diva F 2nd that registers the sysutil callback after calling this function.
g_fxo->init<named_thread>("Delayed cellNetCtlNetStartDialogLoadAsync messages", []()
{
lv2_obj::wait_timeout(500000, nullptr);
if (thread_ctrl::state() != thread_state::aborting)
{
sysutil_send_system_cmd(CELL_SYSUTIL_NET_CTL_NETSTART_LOADED, 0);
sysutil_send_system_cmd(CELL_SYSUTIL_NET_CTL_NETSTART_FINISHED, 0);
}
});
return CELL_OK;
}
@@ -256,7 +272,9 @@ error_code cellNetCtlNetStartDialogAbortAsync()
{
cellNetCtl.error("cellNetCtlNetStartDialogAbortAsync()");
if (!g_fxo->get<cell_net_ctl_manager>()->is_initialized)
const auto nph = g_fxo->get<named_thread<np_handler>>();
if (!nph->is_netctl_init)
{
return CELL_NET_CTL_ERROR_NOT_INITIALIZED;
}
@@ -268,7 +286,9 @@ error_code cellNetCtlNetStartDialogUnloadAsync(vm::ptr<CellNetCtlNetStartDialogR
{
cellNetCtl.warning("cellNetCtlNetStartDialogUnloadAsync(result=*0x%x)", result);
if (!g_fxo->get<cell_net_ctl_manager>()->is_initialized)
const auto nph = g_fxo->get<named_thread<np_handler>>();
if (!nph->is_netctl_init)
{
return CELL_NET_CTL_ERROR_NOT_INITIALIZED;
}
@@ -283,15 +303,7 @@ error_code cellNetCtlNetStartDialogUnloadAsync(vm::ptr<CellNetCtlNetStartDialogR
return CELL_NET_CTL_ERROR_INVALID_SIZE;
}
if (g_cfg.net.net_status == CELL_NET_CTL_STATE_Disconnected)
{
result->result = CELL_NET_CTL_ERROR_NET_NOT_CONNECTED;
}
else
{
// Hack
result->result = CELL_NET_CTL_ERROR_DIALOG_CANCELED;
}
result->result = nph->get_net_status() == CELL_NET_CTL_STATE_IPObtained ? 0 : CELL_NET_CTL_ERROR_DIALOG_CANCELED;
sysutil_send_system_cmd(CELL_SYSUTIL_NET_CTL_NETSTART_UNLOADED, 0);
@@ -302,7 +314,9 @@ error_code cellNetCtlGetNatInfo(vm::ptr<CellNetCtlNatInfo> natInfo)
{
cellNetCtl.warning("cellNetCtlGetNatInfo(natInfo=*0x%x)", natInfo);
if (!g_fxo->get<cell_net_ctl_manager>()->is_initialized)
const auto nph = g_fxo->get<named_thread<np_handler>>();
if (!nph->is_netctl_init)
{
return CELL_NET_CTL_ERROR_NOT_INITIALIZED;
}
-5
View File
@@ -352,8 +352,3 @@ struct CellGameUpdateParam
using CellGameUpdateCallback = void(s32 status, s32 error_code, vm::ptr<void> userdata);
using CellGameUpdateCallbackEx = void(vm::ptr<CellGameUpdateResult> result, vm::ptr<void> userdata);
struct cell_net_ctl_manager
{
atomic_t<bool> is_initialized = false;
};
+6 -4
View File
@@ -1,5 +1,6 @@
#include "stdafx.h"
#include "Emu/System.h"
#include "Emu/system_config.h"
#include "Emu/Cell/PPUModule.h"
#include "Emu/RSX/Overlays/overlay_osk.h"
#include "Input/pad_thread.h"
@@ -62,8 +63,7 @@ std::shared_ptr<OskDialogBase> _get_osk_dialog(bool create = false)
if (auto manager = g_fxo->get<rsx::overlays::display_manager>())
{
auto dlg = std::make_shared<rsx::overlays::osk_latin>();
std::shared_ptr<rsx::overlays::osk_dialog> dlg = std::make_shared<rsx::overlays::osk_dialog>();
osk->dlg = manager->add(dlg);
}
else
@@ -105,7 +105,9 @@ error_code cellOskDialogLoadAsync(u32 container, vm::ptr<CellOskDialogParam> dia
// Get the OSK options
u32 maxLength = (inputFieldInfo->limit_length >= CELL_OSKDIALOG_STRING_SIZE) ? 511 : u32{inputFieldInfo->limit_length};
u32 options = dialogParam->prohibitFlgs;
const u32 prohibitFlgs = dialogParam->prohibitFlgs;
const u32 allowOskPanelFlg = dialogParam->allowOskPanelFlg;
const u32 firstViewPanel = dialogParam->firstViewPanel;
// Get init text and prepare return value
osk->osk_input_result = CELL_OSKDIALOG_INPUT_FIELD_RESULT_OK;
@@ -242,7 +244,7 @@ error_code cellOskDialogLoadAsync(u32 container, vm::ptr<CellOskDialogParam> dia
Emu.CallAfter([=, &result]()
{
osk->Create("On Screen Keyboard", message, osk->osk_text, maxLength, options);
osk->Create("On Screen Keyboard", message, osk->osk_text, maxLength, prohibitFlgs, allowOskPanelFlg, firstViewPanel);
result = true;
});
+1 -1
View File
@@ -243,7 +243,7 @@ enum class OskDialogState
class OskDialogBase
{
public:
virtual void Create(const std::string& title, const std::u16string& message, char16_t* init_text, u32 charlimit, u32 options) = 0;
virtual void Create(const std::string& title, const std::u16string& message, char16_t* init_text, u32 charlimit, u32 prohibit_flags, u32 panel_flag, u32 first_view_panel) = 0;
virtual void Close(bool accepted) = 0;
virtual ~OskDialogBase();
+49 -41
View File
@@ -5,6 +5,7 @@
#include "Emu/Io/pad_types.h"
#include "Input/pad_thread.h"
#include "Input/product_info.h"
#include "cellPad.h"
LOG_CHANNEL(sys_io);
@@ -433,7 +434,6 @@ error_code cellPadPeriphGetInfo(vm::ptr<CellPadPeriphInfo> info)
const auto& pads = handler->GetPads();
// TODO: Support other types of controllers
for (u32 i = 0; i < CELL_PAD_MAX_PORT_NUM; ++i)
{
if (i >= config->max_connect)
@@ -445,7 +445,7 @@ error_code cellPadPeriphGetInfo(vm::ptr<CellPadPeriphInfo> info)
info->device_capability[i] = pads[i]->m_device_capability;
info->device_type[i] = pads[i]->m_device_type;
info->pclass_type[i] = pads[i]->m_class_type;
info->pclass_profile[i] = 0x0;
info->pclass_profile[i] = pads[i]->m_class_profile;
}
return CELL_OK;
@@ -478,10 +478,10 @@ error_code cellPadPeriphGetData(u32 port_no, vm::ptr<CellPadPeriphData> data)
if (!(pad->m_port_status & CELL_PAD_STATUS_CONNECTED))
return CELL_PAD_ERROR_NO_DEVICE;
// todo: support for 'unique' controllers, which goes in offsets 24+ in padData
data->pclass_type = pad->m_class_type;
data->pclass_profile = 0x0;
data->pclass_profile = pad->m_class_profile;
// TODO: support for 'unique' controllers, which goes in offsets 24+ in padData (CELL_PAD_PCLASS_BTN_OFFSET)
return cellPadGetData(port_no, data.ptr(&CellPadPeriphData::cellpad_data));
}
@@ -636,43 +636,40 @@ error_code cellPadGetInfo(vm::ptr<CellPadInfo> info)
pads[i]->m_port_status &= ~CELL_PAD_STATUS_ASSIGN_CHANGES; // TODO: should ASSIGN flags be cleared here?
info->status[i] = pads[i]->m_port_status;
// TODO: Allow selecting different product IDs
switch (pads[i]->m_class_type)
if (pads[i]->m_vendor_id == 0 || pads[i]->m_product_id == 0)
{
case CELL_PAD_PCLASS_TYPE_GUITAR:
// Sony Computer Entertainment America
info->vendor_id[i] = 0x12BA;
// RedOctane Guitar (Guitar Hero)
info->product_id[i] = 0x0100;
// Harmonix Guitar (Rock Band)
// info->product_id[i] = 0x0200;
break;
case CELL_PAD_PCLASS_TYPE_DRUM:
// Sony Computer Entertainment America
info->vendor_id[i] = 0x12BA;
// RedOctane Drum Kit (Guitar Hero)
info->product_id[i] = 0x0120;
// Harmonix Drum Kit (Rock Band)
// info->product_id[i] = 0x0210;
break;
case CELL_PAD_PCLASS_TYPE_DJ:
// Sony Computer Entertainment America
info->vendor_id[i] = 0x12BA;
// DJ Hero Turntable
info->product_id[i] = 0x0140;
break;
case CELL_PAD_PCLASS_TYPE_DANCEMAT:
// Konami Digital Entertainment
info->vendor_id[i] = 0x1CCF;
// Dance Dance Revolution Mat
info->product_id[i] = 0x0140;
break;
default:
// Sony Corp.
info->vendor_id[i] = 0x054C;
// PlayStation 3 Controller
info->product_id[i] = 0x0268;
break;
// Fallback to defaults
input::product_info product;
switch (pads[i]->m_class_type)
{
case CELL_PAD_PCLASS_TYPE_GUITAR:
product = input::get_product_info(input::product_type::red_octane_gh_guitar);
break;
case CELL_PAD_PCLASS_TYPE_DRUM:
product = input::get_product_info(input::product_type::red_octane_gh_drum_kit);
break;
case CELL_PAD_PCLASS_TYPE_DJ:
product = input::get_product_info(input::product_type::dj_hero_turntable);
break;
case CELL_PAD_PCLASS_TYPE_DANCEMAT:
product = input::get_product_info(input::product_type::dance_dance_revolution_mat);
break;
case CELL_PAD_PCLASS_TYPE_NAVIGATION:
case CELL_PAD_PCLASS_TYPE_STANDARD:
default:
product = input::get_product_info(input::product_type::playstation_3_controller);
break;
}
info->vendor_id[i] = product.vendor_id;
info->product_id[i] = product.product_id;
}
else
{
info->vendor_id[i] = pads[i]->m_vendor_id;
info->product_id[i] = pads[i]->m_product_id;
}
}
@@ -927,8 +924,19 @@ error_code cellPadLddRegisterController()
if (handle < 0)
return CELL_PAD_ERROR_TOO_MANY_DEVICES;
const auto product = input::get_product_info(input::product_type::playstation_3_controller);
auto& pads = handler->GetPads();
pads[handle]->Init(CELL_PAD_STATUS_CONNECTED | CELL_PAD_STATUS_ASSIGN_CHANGES | CELL_PAD_STATUS_CUSTOM_CONTROLLER, CELL_PAD_CAPABILITY_PS3_CONFORMITY, CELL_PAD_DEV_TYPE_LDD, 0);
pads[handle]->Init
(
CELL_PAD_STATUS_CONNECTED | CELL_PAD_STATUS_ASSIGN_CHANGES | CELL_PAD_STATUS_CUSTOM_CONTROLLER,
CELL_PAD_CAPABILITY_PS3_CONFORMITY,
CELL_PAD_DEV_TYPE_LDD,
CELL_PAD_PCLASS_TYPE_STANDARD,
product.pclass_profile,
product.vendor_id,
product.product_id
);
config->port_setting[handle] = 0;
return not_an_error(handle);
+75
View File
@@ -34,6 +34,81 @@ enum
CELL_PAD_PCLASS_TYPE_NAVIGATION = 0x05,
};
// Profile of a Standard Type Controller
// Profile of a Navigation Type Controller
// Bits 0 31 All 0s
// Profile of a Guitar Type Controller
enum
{
// Basic
CELL_PAD_PCLASS_PROFILE_GUITAR_FRET_1 = 0x00000001,
CELL_PAD_PCLASS_PROFILE_GUITAR_FRET_2 = 0x00000002,
CELL_PAD_PCLASS_PROFILE_GUITAR_FRET_3 = 0x00000004,
CELL_PAD_PCLASS_PROFILE_GUITAR_FRET_4 = 0x00000008,
CELL_PAD_PCLASS_PROFILE_GUITAR_FRET_5 = 0x00000010,
CELL_PAD_PCLASS_PROFILE_GUITAR_STRUM_UP = 0x00000020,
CELL_PAD_PCLASS_PROFILE_GUITAR_STRUM_DOWN = 0x00000040,
CELL_PAD_PCLASS_PROFILE_GUITAR_WHAMMYBAR = 0x00000080,
// All Basic = 0x000000FF
// Optional
CELL_PAD_PCLASS_PROFILE_GUITAR_FRET_H1 = 0x00000100,
CELL_PAD_PCLASS_PROFILE_GUITAR_FRET_H2 = 0x00000200,
CELL_PAD_PCLASS_PROFILE_GUITAR_FRET_H3 = 0x00000400,
CELL_PAD_PCLASS_PROFILE_GUITAR_FRET_H4 = 0x00000800,
CELL_PAD_PCLASS_PROFILE_GUITAR_FRET_H5 = 0x00001000,
CELL_PAD_PCLASS_PROFILE_GUITAR_5WAY_EFFECT = 0x00002000,
CELL_PAD_PCLASS_PROFILE_GUITAR_TILT_SENS = 0x00004000,
// All = 0x00007FFF
};
// Profile of a Drum Type Controller
enum
{
CELL_PAD_PCLASS_PROFILE_DRUM_SNARE = 0x00000001,
CELL_PAD_PCLASS_PROFILE_DRUM_TOM = 0x00000002,
CELL_PAD_PCLASS_PROFILE_DRUM_TOM2 = 0x00000004,
CELL_PAD_PCLASS_PROFILE_DRUM_TOM_FLOOR = 0x00000008,
CELL_PAD_PCLASS_PROFILE_DRUM_KICK = 0x00000010,
CELL_PAD_PCLASS_PROFILE_DRUM_CYM_HiHAT = 0x00000020,
CELL_PAD_PCLASS_PROFILE_DRUM_CYM_CRASH = 0x00000040,
CELL_PAD_PCLASS_PROFILE_DRUM_CYM_RIDE = 0x00000080,
CELL_PAD_PCLASS_PROFILE_DRUM_KICK2 = 0x00000100,
// All = 0x000001FF
};
// Profile of a DJ Deck Type Controller
enum
{
CELL_PAD_PCLASS_PROFILE_DJ_MIXER_ATTACK = 0x00000001,
CELL_PAD_PCLASS_PROFILE_DJ_MIXER_CROSSFADER = 0x00000002,
CELL_PAD_PCLASS_PROFILE_DJ_MIXER_DSP_DIAL = 0x00000004,
CELL_PAD_PCLASS_PROFILE_DJ_DECK1_STREAM1 = 0x00000008,
CELL_PAD_PCLASS_PROFILE_DJ_DECK1_STREAM2 = 0x00000010,
CELL_PAD_PCLASS_PROFILE_DJ_DECK1_STREAM3 = 0x00000020,
CELL_PAD_PCLASS_PROFILE_DJ_DECK1_PLATTER = 0x00000040,
CELL_PAD_PCLASS_PROFILE_DJ_DECK2_STREAM1 = 0x00000080,
CELL_PAD_PCLASS_PROFILE_DJ_DECK2_STREAM2 = 0x00000100,
CELL_PAD_PCLASS_PROFILE_DJ_DECK2_STREAM3 = 0x00000200,
CELL_PAD_PCLASS_PROFILE_DJ_DECK2_PLATTER = 0x00000400,
// All = 0x000007FF
};
// Profile of a Dance Mat Type Controller
enum
{
CELL_PAD_PCLASS_PROFILE_DANCEMAT_CIRCLE = 0x00000001,
CELL_PAD_PCLASS_PROFILE_DANCEMAT_CROSS = 0x00000002,
CELL_PAD_PCLASS_PROFILE_DANCEMAT_TRIANGLE = 0x00000004,
CELL_PAD_PCLASS_PROFILE_DANCEMAT_SQUARE = 0x00000008,
CELL_PAD_PCLASS_PROFILE_DANCEMAT_RIGHT = 0x00000010,
CELL_PAD_PCLASS_PROFILE_DANCEMAT_LEFT = 0x00000020,
CELL_PAD_PCLASS_PROFILE_DANCEMAT_UP = 0x00000040,
CELL_PAD_PCLASS_PROFILE_DANCEMAT_DOWN = 0x00000080,
// All = 0x000000FF
};
// Length returned in CellPadData struct
enum
{
+5 -40
View File
@@ -151,7 +151,7 @@ void pngDecError(png_structp png_ptr, png_const_charp error_message)
{
cellPngDec.error("%s", error_message);
// we can't return here or libpng blows up
throw LibPngCustomException("Fatal Error in libpng");
report_fatal_error("Fatal Error in libpng");
}
// Custom warning handler for libpng
@@ -486,14 +486,7 @@ s32 pngDecOpen(ppu_thread& ppu, PHandle handle, PPStream png_stream, PSrc source
png_set_progressive_read_fn(stream->png_ptr, stream.get_ptr(), pngDecInfoCallback, pngDecRowCallback, pngDecEndCallback);
// push header tag to libpng to keep us in sync
try
{
png_process_data(stream->png_ptr, stream->info_ptr, header, 8);
}
catch (LibPngCustomException&)
{
return CELL_PNGDEC_ERROR_HEADER;
}
png_process_data(stream->png_ptr, stream->info_ptr, header, 8);
}
else
{
@@ -729,15 +722,7 @@ s32 pngDecodeData(ppu_thread& ppu, PHandle handle, PStream stream, vm::ptr<u8> d
if (stream->buffer->length > stream->buffer->cursor)
{
u8* data = static_cast<u8*>(stream->buffer->data.get_ptr()) + stream->buffer->cursor;
try
{
png_process_data(stream->png_ptr, stream->info_ptr, data, stream->buffer->length - stream->buffer->cursor);
}
catch (LibPngCustomException&)
{
freeMem();
return CELL_PNGDEC_ERROR_FATAL;
}
png_process_data(stream->png_ptr, stream->info_ptr, data, stream->buffer->length - stream->buffer->cursor);
streamInfo->decodedStrmSize = ::narrow<u32>(stream->buffer->length);
}
@@ -747,15 +732,7 @@ s32 pngDecodeData(ppu_thread& ppu, PHandle handle, PStream stream, vm::ptr<u8> d
{
stream->cbCtrlStream.cbCtrlStrmFunc(ppu, streamInfo, streamParam, stream->cbCtrlStream.cbCtrlStrmArg);
streamInfo->decodedStrmSize += streamParam->strmSize;
try
{
png_process_data(stream->png_ptr, stream->info_ptr, static_cast<u8*>(streamParam->strmPtr.get_ptr()), streamParam->strmSize);
}
catch (LibPngCustomException&)
{
freeMem();
return CELL_PNGDEC_ERROR_FATAL;
}
png_process_data(stream->png_ptr, stream->info_ptr, static_cast<u8*>(streamParam->strmPtr.get_ptr()), streamParam->strmSize);
}
freeMem();
@@ -767,7 +744,6 @@ s32 pngDecodeData(ppu_thread& ppu, PHandle handle, PStream stream, vm::ptr<u8> d
// Decode the image
// todo: commandptr
try
{
for (u32 j = 0; j < stream->passes; j++)
{
@@ -779,10 +755,6 @@ s32 pngDecodeData(ppu_thread& ppu, PHandle handle, PStream stream, vm::ptr<u8> d
}
png_read_end(stream->png_ptr, stream->info_ptr);
}
catch (LibPngCustomException&)
{
return CELL_PNGDEC_ERROR_FATAL;
}
}
// Get the number of iTXt, tEXt and zTXt chunks
@@ -862,14 +834,7 @@ s32 cellPngDecExtReadHeader(PHandle handle, PStream stream, PInfo info, PExtInfo
// lets push what we have so far
u8* data = static_cast<u8*>(stream->buffer->data.get_ptr()) + stream->buffer->cursor;
try
{
png_process_data(stream->png_ptr, stream->info_ptr, data, stream->buffer->length);
}
catch (LibPngCustomException&)
{
return CELL_PNGDEC_ERROR_HEADER;
}
png_process_data(stream->png_ptr, stream->info_ptr, data, stream->buffer->length);
// lets hope we pushed enough for callback
pngSetHeader(stream.get_ptr());
File diff suppressed because it is too large Load Diff
+29 -16
View File
@@ -1,24 +1,24 @@
#pragma once
#pragma once
#include "Utilities/BEType.h"
// Return Codes
enum
enum CellRtcError
{
CELL_RTC_ERROR_NOT_INITIALIZED = 0x80010601,
CELL_RTC_ERROR_INVALID_POINTER = 0x80010602,
CELL_RTC_ERROR_INVALID_VALUE = 0x80010603,
CELL_RTC_ERROR_INVALID_ARG = 0x80010604,
CELL_RTC_ERROR_NOT_SUPPORTED = 0x80010605,
CELL_RTC_ERROR_NO_CLOCK = 0x80010606,
CELL_RTC_ERROR_BAD_PARSE = 0x80010607,
CELL_RTC_ERROR_INVALID_YEAR = 0x80010621,
CELL_RTC_ERROR_INVALID_MONTH = 0x80010622,
CELL_RTC_ERROR_INVALID_DAY = 0x80010623,
CELL_RTC_ERROR_INVALID_HOUR = 0x80010624,
CELL_RTC_ERROR_INVALID_MINUTE = 0x80010625,
CELL_RTC_ERROR_INVALID_SECOND = 0x80010626,
CELL_RTC_ERROR_INVALID_MICROSECOND = 0x80010627,
CELL_RTC_ERROR_NOT_INITIALIZED = 0x80010601,
CELL_RTC_ERROR_INVALID_POINTER = 0x80010602,
CELL_RTC_ERROR_INVALID_VALUE = 0x80010603,
CELL_RTC_ERROR_INVALID_ARG = 0x80010604,
CELL_RTC_ERROR_NOT_SUPPORTED = 0x80010605,
CELL_RTC_ERROR_NO_CLOCK = 0x80010606,
CELL_RTC_ERROR_BAD_PARSE = 0x80010607,
CELL_RTC_ERROR_INVALID_YEAR = 0x80010621,
CELL_RTC_ERROR_INVALID_MONTH = 0x80010622,
CELL_RTC_ERROR_INVALID_DAY = 0x80010623,
CELL_RTC_ERROR_INVALID_HOUR = 0x80010624,
CELL_RTC_ERROR_INVALID_MINUTE = 0x80010625,
CELL_RTC_ERROR_INVALID_SECOND = 0x80010626,
CELL_RTC_ERROR_INVALID_MICROSECOND = 0x80010627,
};
struct CellRtcTick
@@ -36,3 +36,16 @@ struct CellRtcDateTime
be_t<u16> second;
be_t<u32> microsecond;
};
error_code cellRtcTickAddYears(vm::ptr<CellRtcTick> pTick0, vm::cptr<CellRtcTick> pTick1, s32 iAdd);
error_code cellRtcTickAddMonths(vm::ptr<CellRtcTick> pTick0, vm::cptr<CellRtcTick> pTick1, s32 lAdd);
error_code cellRtcTickAddDays(vm::ptr<CellRtcTick> pTick0, vm::cptr<CellRtcTick> pTick1, s32 lAdd);
error_code cellRtcTickAddHours(vm::ptr<CellRtcTick> pTick0, vm::cptr<CellRtcTick> pTick1, s32 lAdd);
error_code cellRtcTickAddMinutes(vm::ptr<CellRtcTick> pTick0, vm::cptr<CellRtcTick> pTick1, s64 lAdd);
error_code cellRtcTickAddSeconds(vm::ptr<CellRtcTick> pTick0, vm::cptr<CellRtcTick> pTick1, s64 lAdd);
error_code cellRtcSetTick(vm::ptr<CellRtcDateTime> pTime, vm::cptr<CellRtcTick> pTick);
u32 cellRtcGetTickResolution();
error_code cellRtcCheckValid(vm::cptr<CellRtcDateTime> pTime);
error_code cellRtcGetDayOfWeek(s32 year, s32 month, s32 day);
error_code cellRtcGetTick(vm::cptr<CellRtcDateTime> pTime, vm::ptr<CellRtcTick> pTick);
+5 -4
View File
@@ -703,9 +703,9 @@ s32 cellSailPlayerSetParameter(vm::ptr<CellSailPlayer> pSelf, s32 parameterType,
switch (parameterType)
{
case CELL_SAIL_PARAMETER_GRAPHICS_ADAPTER_BUFFER_RELEASE_DELAY: pSelf->graphics_adapter_buffer_release_delay = param1; break; // TODO: Stream index
case CELL_SAIL_PARAMETER_CONTROL_PPU_THREAD_STACK_SIZE: pSelf->control_ppu_thread_stack_size = param0; break;
case CELL_SAIL_PARAMETER_ENABLE_APOST_SRC: pSelf->enable_apost_src = param1; break; // TODO: Stream index
case CELL_SAIL_PARAMETER_GRAPHICS_ADAPTER_BUFFER_RELEASE_DELAY: pSelf->graphics_adapter_buffer_release_delay = static_cast<u32>(param1); break; // TODO: Stream index
case CELL_SAIL_PARAMETER_CONTROL_PPU_THREAD_STACK_SIZE: pSelf->control_ppu_thread_stack_size = static_cast<u32>(param0); break;
case CELL_SAIL_PARAMETER_ENABLE_APOST_SRC: pSelf->enable_apost_src = static_cast<u32>(param1); break; // TODO: Stream index
default: cellSail.todo("cellSailPlayerSetParameter(): unimplemented parameter %s", ParameterCodeToName(parameterType));
}
@@ -718,6 +718,7 @@ s32 cellSailPlayerGetParameter(vm::ptr<CellSailPlayer> pSelf, s32 parameterType,
switch (parameterType)
{
case 0:
default: cellSail.error("cellSailPlayerGetParameter(): unimplemented parameter %s", ParameterCodeToName(parameterType));
}
@@ -806,7 +807,7 @@ s32 cellSailPlayerCreateDescriptor(vm::ptr<CellSailPlayer> pSelf, s32 streamType
{
if (fs::file f{ vfs::get(uri.substr(12)) })
{
u64 size = f.size();
u32 size = ::size32(f);
u32 buffer = vm::alloc(size, vm::main);
auto bufPtr = vm::cptr<PamfHeader>::make(buffer);
PamfHeader *buf = const_cast<PamfHeader*>(bufPtr.get_ptr());

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