Compare commits

..

634 Commits

Author SHA1 Message Date
Megamouse 9b3a878c18 cellAudioIn: reduce log spam
Some logs I've seen are 20% filled with this stuff.
2023-07-31 13:19:55 +03:00
Megamouse 365b264656 cellMsgDialogAbort: do not return CELL_MSGDIALOG_ERROR_DIALOG_NOT_OPENED 2023-07-31 13:19:55 +03:00
Eladash 1184d6aecb Thread.cpp: Fixup SPU access violation log message 2023-07-31 11:55:31 +03:00
Eladash b12edf70bb Optimize RSX Debugger 2023-07-31 11:55:31 +03:00
Elad Ashkenazi 53c1da8f94 Qt: Fix elf_memory_dumping_dialog PPU address 2023-07-31 08:53:10 +03:00
Elad Ashkenazi 213b810279 Debugger: Transition to plain text edit 2023-07-31 08:53:10 +03:00
Elad Ashkenazi 8a4617d3c2 Fix color tag of logs/tty 2023-07-31 08:53:10 +03:00
Megamouse c108b31954 Qt: fix data type of find_dialog text edits 2023-07-31 04:10:09 +03:00
Whatcookie fd6829f757 SPU LLVM: AVX-512 optimization for CFLTU (#14384)
- Takes advantage of vrangeps and the new float to uint instructions from AVX-512
- Down from 6 to 3 instructions

TODO: Somehow ensure that this is what llvm outputs using CreateFPToUI?
2023-07-29 09:01:01 +03:00
Talkashie dabb2cc9a0 Fix typos, improve consistency
Fixes typos where spelling or grammar is objectively wrong.
Changes wording and capitalization in some areas to be more consistent with other areas.
2023-07-28 13:09:06 +03:00
Whatcookie 4ecb06c901 SPU LLVM: Optimize common SFI+ROTQMBY pattern 2023-07-28 10:26:40 +03:00
Whatcookie 375bc4cc69 Utils: Add initial AVX10 support
- Adds detection for AVX10 features
- Also adds new bools for 256-wide AVX-512 instructions, indicated by either AVX-512 support, or AVX10
2023-07-28 06:55:20 +03:00
Elad Ashkenazi 9265ff53d0 Include spu.log inside RPCS3.log when SPU Debug is true 2023-07-27 19:15:32 +03:00
Eladash 75ad56338b SPU/Non-TSX: Implement cuncurrent reservations 2023-07-27 02:50:01 +03:00
Eladash db24ce7708 SPU/MFC: Format command more consistently 2023-07-27 02:50:01 +03:00
Eladash 2d45ecff22 cellSaveData: Adjust to non-TSX 2023-07-27 02:50:01 +03:00
Elad Ashkenazi 5d98f3866c Log TTY output after emulation have been stopped 2023-07-26 17:56:44 +03:00
Elad Ashkenazi 106f31db6a sceNpTrophy: Minor UB fixup
id.data[9] is char while isprint should accept u8.
2023-07-26 17:56:44 +03:00
brian218 9a5bdc9b4f sys_fs: Updated sys_fs_fcntl(0xc0000015&0xc000001c)'s error handling according to real hardware testing 2023-07-26 13:10:51 +03:00
brian218 0b829be798 sys_fs: Fixed up sys_fs_fcntl(0xc0000007) aka cellFsArcadeHddSerialNumber according to real hardware testing 2023-07-26 13:10:51 +03:00
Megamouse 94bb75fb7c sceNpTrophy: Check if a trophy configuration file exists before starting the install process 2023-07-25 22:00:19 +02:00
Eladash 7d84d0f83e sceNpTrophy: Initial commSign checking of CreateContext 2023-07-25 21:40:35 +03:00
oltolm bc40b61ef1 rename fs::stat to fs::get_stat 2023-07-25 12:15:08 +03:00
Megamouse 73c3d5fc81 Fix config path in Emu.Restart() 2023-07-25 11:12:16 +03:00
Megamouse 13575029c0 cellSaveData: add some more error logging 2023-07-25 11:12:16 +03:00
brian218 ea016382f2 Fixed Emu.Restart(graceful=false) no longer worked after #14038 2023-07-25 09:48:11 +03:00
Eladash 782344eed8 Debugger: Make break-all non-default 2023-07-24 17:07:15 +03:00
Eladash 95fb7859d2 Fixup patches 2023-07-24 17:07:15 +03:00
Eladash 9d3e626b55 Minor ppu_initialize fix 2023-07-24 17:07:15 +03:00
Eladash a6e8b9037a ppu: Make install function log message trace 2023-07-24 17:07:15 +03:00
brian218 c9f91ecee9 USIO: Added support for Tekken Tag Tournament 2 Live Monitor edition 2023-07-24 08:39:14 +02:00
oltolm 7cb2d3f143 opengl: fix Qt warnings (#14249) 2023-07-24 07:30:21 +03:00
brian218 a975b4937a USIO: Added support for Tekken Tag Tournament 2 2023-07-23 20:23:00 +02:00
Eladash fce8e0fef0 Savestates: Facilitate multi slots 2023-07-23 17:58:54 +03:00
Eladash 12fe55a258 Thread.cpp: Always print SPU thread name in access violation
Suppress GUI log window prefix removal.
2023-07-23 17:58:54 +03:00
Eladash 3bbc2c1f4c PPU Analyzer: Fixup get_ptr() 2023-07-23 17:58:54 +03:00
Eladash 99671b754f Add ppu_module::get_ref() to ease debugging 2023-07-23 17:58:54 +03:00
Eladash 9fc5f6271b Update SPU reservation notifier mask 2023-07-23 17:58:54 +03:00
Eladash 4647f3046e Qt: Minor logging change 2023-07-23 17:58:54 +03:00
Eladash c44cddabfa CPUThread.cpp: Fix use of cpu_counter::add
This also fixes a crash when saving savestate because main thread uses cpu_counter::suspend_all which adds cuncurrency.
2023-07-23 17:58:54 +03:00
Eladash 9ff91c29f2 Invalidate Savestates 2023-07-23 17:58:54 +03:00
Eladash e303cc536c Qt: Fix GetBootConfirmation() 2023-07-23 17:06:59 +03:00
Eladash afdfefc9ad Game List: Fix allowance of caches/games to be removed while the game is running! 2023-07-23 17:06:59 +03:00
Eladash 3033914e2d Game List: Implement Remove HDD1 Cache option 2023-07-23 17:06:59 +03:00
brian218 70b124cfa0 USIO: Fixed BACKUP MEMORY ERROR for some games (#14248) 2023-07-23 12:17:49 +03:00
Eladash 38a5313ed2 Fix log data loss on force application shutdown 2023-07-21 12:27:35 +03:00
Eladash 9291e2777d File.h: Implement fs::error::xdev 2023-07-21 12:27:35 +03:00
Eladash 465da5136d Qt: Fix saved log filename 2023-07-21 12:27:35 +03:00
Megamouse 568e7481d8 sys_fs: use path instead of u8path
Japanese PS3 games often use unicode paths which hard crash the std::filesystem::string() method.
wstring() would work in these cases, but I guess we can just use path() instead of u8path().
2023-07-20 07:22:07 +03:00
Darkhost1999 a0297933ce Create Missing Paths for Dev_USB/HDD0 and mms
In addiytion, fix 2 warnings.
2023-07-19 12:01:44 +03:00
Eladash 50dad6801b SPU LLVM: Use get_known_bits() in SHUFB 2023-07-18 22:27:45 +03:00
Malcolm Jestadt ee7475a9d4 SPU LLVM: Handle SHUFB special cases with a lookup table
- Needs 3 instructions to handle the special cases, since x86 lacks an 8 bit simd shift instruction
2023-07-18 22:27:45 +03:00
Elad Ashkenazi ba988f1d3f Qt: Exit And Save Log - toolbar action (#14212)
Fixup main_window::IsValidFile
2023-07-18 05:11:53 +03:00
Megamouse db029ed29f Fix default renderer when creating a brand new config 2023-07-17 09:35:26 +02:00
Elad Ashkenazi 41d38975f7 Savestates/sys_fs: Utilize fs::file::get_id to fix an old bug 2023-07-17 08:09:09 +03:00
Eladash eecadab387 Implement fs::file::get_id()
File descripor ID with 2 provided ways to compare between them:
1. is_mirror_of():
 Test if identical:
  For example: when LHS writes one byte to a file at X offset, RHS file be able to read that exact byte at X offset)

2. is_coherent_with():
 Test if both files point to the same file:
  For example: if a file descriptor pointing to the complete file exists and is being truncated to 0 bytes from non-
  -zero size state: this has to affect both RHS and LHS files.
2023-07-17 08:09:09 +03:00
Eladash e27e6c0b2d Implement PPU usleep control setting hack 2023-07-17 07:17:11 +03:00
Eladash 30a5d646ec Qt: Minor fixup 2023-07-16 20:16:20 +02:00
Eladash 882fb3e049 Qt: Cache drag-and-drop result when moving it 2023-07-16 19:49:55 +03:00
Eladash 0423781363 Qt: Restrict file types for drag-and-drop 2023-07-16 17:43:27 +03:00
Megamouse 43cfb3cd10 ecdsa: tiny optimization for key and curve 2023-07-16 09:32:39 +02:00
Megamouse de15c9746f ecdsa: clean up some code 2023-07-16 09:32:39 +02:00
Eladash 1371bf89e0 PPU LLVM: Allow to abort OVL analysis in the middle 2023-07-15 08:26:28 +03:00
Eladash 3b8f8d7fc8 PPU LLVM: Improve precompilation time 2023-07-15 08:26:28 +03:00
Megamouse a828c214b5 Qt/patches: highlight faulty lines in patch creator 2023-07-13 08:40:19 +02:00
Megamouse 3381144d2e Patches: improve location logging of some invalid nodes 2023-07-13 08:40:19 +02:00
Megamouse a19883f875 Patches: do not allow empty patch names 2023-07-13 08:40:19 +02:00
Megamouse 482722af0a Patches: fix logging for locations of node iterators 2023-07-13 08:40:19 +02:00
Megamouse 02bac61c9c Patches: validate yml patch offset values 2023-07-13 08:40:19 +02:00
Megamouse e8ee5831d3 Qt: add validator to patch creator offset lineedit 2023-07-13 08:40:19 +02:00
Eladash 083b4f0d3b Patches: Fix potential RPCS3 crashes due to invalid patches 2023-07-13 07:38:46 +03:00
Eladash c0280b43f2 PPU/Debugger: View the currently used CR field content in register panel 2023-07-12 13:22:06 +03:00
Megamouse d153e977a7 Qt: ignore Qt::Key_unknown when parsing key sequences 2023-07-12 09:35:43 +03:00
kd-11 eee7bf0c97 vk: Don't load depth-stencil textures on the transfer queue 2023-07-12 03:20:08 +03:00
oltolm 0c94606fcf Make compile with msvc, clang and gcc on Windows 2023-07-11 21:40:30 +03:00
nastys ed75bab7b2 macOS CI: add Homebrew and Qt caches 2023-07-11 19:55:36 +02:00
kd-11 bff6e0d277 rsx: Don't assert when surface and texture cache overlap lockable memory
- It's not a serious enough problem and the root cause is understood.
2023-07-11 04:09:30 +03:00
kd-11 c325017675 rsx: Preserve the texcoord transform around destructive modifications 2023-07-11 04:09:30 +03:00
Elad Ashkenazi 4b12c9a9fc Force inherit BDVD/PS3_GAME across game updates (#14159) 2023-07-11 00:30:02 +03:00
kd-11 0d57744efa rsx: Fix AMD shader codegen 2023-07-10 22:44:40 +03:00
Elad Ashkenazi e882d64d8a SPU/PPU Debugger: Add decimal mode to registers panel 2023-07-10 19:06:57 +03:00
Eladash 16f910e350 sys_fs: Fix log levels 2023-07-10 12:39:26 +03:00
Megamouse e2c2ef9788 Write config.yml if it doesn't exist or is empty on boot 2023-07-10 00:50:19 +02:00
kd-11 a98b4adead rsx: Fix projected coordinates calculation again 2023-07-09 19:33:48 +03:00
kd-11 186fe53279 rsx: Fix the default shadow codegen path 2023-07-09 19:33:48 +03:00
kd-11 c9917c826a Fix typo 2023-07-09 19:33:48 +03:00
kd-11 aedebecae2 rsx: Reimplement projected texturing 2023-07-09 19:33:48 +03:00
Eladash 482dd0e8f8 SPU: Remove wrong clamp in MFC_Size
Just crashes real MFC.
2023-07-09 13:33:03 +03:00
Eladash cae2e7de80 LV2: Log allocated guest VM addresses 2023-07-09 13:33:03 +03:00
Eladash e76ce05e29 logs: Add manual set log level with RegEx 2023-07-09 13:33:03 +03:00
Eladash a98174be85 Logs re-enable on Emu.Kill() fixup 2023-07-09 13:33:03 +03:00
Eladash b68cfbf794 Fix spu_thread::dump_callstack_list regression
TODO: Fix in PPU [properly!]
2023-07-09 13:33:03 +03:00
Eladash 17d8f2884e Debug fixes 2023-07-09 13:33:03 +03:00
Megamouse 050b8fa7df Qt: Use detailed text for install message 2023-07-08 20:11:01 +02:00
Megamouse c30c9b2168 Home menu: improve Anisotropic Filter Override value labels 2023-07-08 13:42:05 +02:00
Megamouse 358735a199 Home menu: add optional special label overrides 2023-07-08 13:42:05 +02:00
Megamouse d909bbc297 Home menu: set vblank step size to 30 2023-07-08 13:42:05 +02:00
Megamouse 2adb2f82d7 Home menu: move advanced video options to advanced menu 2023-07-08 13:42:05 +02:00
Michael G 5a013127ec build-mac: Enable Discord Rich Presence for Mac Users 2023-07-08 07:38:14 +03:00
Elad Ashkenazi 1219e5c244 SPU: Fix static interpreter requirement with interrupts
Removed a wrong condition in PPU LLVM as a fixup.
2023-07-07 22:39:49 +03:00
Megamouse 4aec48c2ca Only silence logging during gameplay 2023-07-07 18:28:34 +02:00
Eladash 8d54ddf426 memory viewer: Add RegEx instruction searching mode 2023-07-07 16:03:08 +03:00
Eladash c21cdb8055 Implement PPU LV2 debug 2023-07-07 16:03:08 +03:00
Eladash 05824e6acd UX: Option to pause emulation when RPCS3 is not focused 2023-07-07 14:38:32 +03:00
Ivan Chikish b3b680f073 [simd.hpp] Fix gv_fmafs 2023-07-07 11:09:55 +03:00
Eladash 598fe85243 PPU LLVM/RawSPU: Implement MMIO violation elimination pass 2023-07-06 19:46:36 +03:00
kd-11 e7ac84fca3 rsx: Fine-tune the subimage view bezel dimensions 2023-07-06 14:06:30 +03:00
kd-11 b9ea6be842 rsx: Fix AA factor calculation 2023-07-06 14:06:30 +03:00
kd-11 d46dbc0fa8 rsx: Fill section dimensions when converting atlas op to copy op 2023-07-06 14:06:30 +03:00
Michael G 0e10f12ec0 build-mac: Improve build time for macOS
Co-Authored-By: Megamouse <studienricky89@googlemail.com>
2023-07-06 07:49:06 +02:00
Sanjay Govind 8f178b2c29 sys_usbd: Implement support for Santroller devices 2023-07-05 23:54:37 +02:00
kd-11 d41fe80b8e Clamp MSAA sampling weights to avoid clipping 2023-07-05 02:51:04 +03:00
Megamouse 96e992bd26 CI: Ignore FAudio submodule in windows builds 2023-07-04 23:51:44 +02:00
kd-11 465c421707 rsx: Wrap MSAA coordinates before texelFetch 2023-07-04 23:41:12 +03:00
Elad Ashkenazi f7e9622084 vm_native.cpp: Workaround for rpcs3_vm_sparse.tmp crashes 2023-07-04 20:44:41 +02:00
kd-11 79e000f63d rsx: Fix virtual coordinate clamping 2023-07-04 09:31:51 +03:00
kd-11 10af0e8c93 vk: Disable anisotropy if the anisotropic level is meaningless 2023-07-04 09:31:51 +03:00
kd-11 d13cf0e29a rsx: Fix shader interpreter
- It broke ages ago
2023-07-04 09:31:51 +03:00
kd-11 1671922f7e rsx: Fix shader interpreter compilation 2023-07-04 09:31:51 +03:00
kd-11 c9da795bf3 rsx: Fix vp codegen when unrestricted depth range extension is absent 2023-07-04 09:31:51 +03:00
kd-11 69eb1401a9 vk/gl: Fix debug overlay stats 2023-07-04 09:31:51 +03:00
kd-11 aa06ac119f rsx: Fix sampled descriptor address corruption 2023-07-04 09:31:51 +03:00
kd-11 1afee59c95 rsx: Insert missing texture barrier 2023-07-04 09:31:51 +03:00
kd-11 4decad6f6b rsx: Force compatibility checks when applying fast-path optimizations 2023-07-04 09:31:51 +03:00
kd-11 a37f786a37 rsx: Properly fill in the cyclic ref field for framebuffer references 2023-07-04 09:31:51 +03:00
kd-11 8f98e572e1 rsx: Use designated initializer for the dangerous copy_region_descriptor type
- We need to move more dangerous braced initializations to c++20
- Also adds a base address variable which will come in handy
2023-07-04 09:31:51 +03:00
kd-11 c818f8af82 vk: Fix namespace pollution in sync module 2023-07-04 09:31:51 +03:00
kd-11 fac8bcc20c rsx: Formatting and tidying changes 2023-07-04 09:31:51 +03:00
kd-11 1d004f2788 rsx: Lower single-image-blit to a scaled coordinate fetch 2023-07-04 09:31:51 +03:00
kd-11 cef4ea786a rsx: Trivially detect single-image-blit transfer operations 2023-07-04 09:31:51 +03:00
kd-11 8ebf24d8e7 vk: Do not clear memory if we're going to overwrite it with a copy anyway 2023-07-04 09:31:51 +03:00
kd-11 69b02f7e46 rsx: Implement atlas trivialization pass
- Decompose sequences of copies into the minimally required set.
  This does 2 things:
  a. Reduces GPU workload by doing less transfers
  b. Allows the clipping optimization to kick in and skip a ton of GPU work
2023-07-04 09:31:51 +03:00
kd-11 b788e05396 rsx: Implement GPU copy ellision through coordinate transform
- TODO: Some corner cases still exist where format may not be a match after a cache merge.
2023-07-04 09:31:51 +03:00
kd-11 5dc4e74c98 rsx: Minor optimization to speed up texture state sync a bit given the larger structure in use now 2023-07-04 09:31:51 +03:00
kd-11 436ef1cff6 rsx: Fix shader compilation when texture ops are referenced 2023-07-04 09:31:51 +03:00
kd-11 d77a78cdf1 rsx: Rework texture coordinate handling to support clamping and a more sane scale-bias setup 2023-07-04 09:31:51 +03:00
kd-11 66cb855db0 rsx: Fix fragment program codegen 2023-07-04 09:31:51 +03:00
kd-11 fb3aa9628d rsx: Migrate vertex fetch out of the cpp file 2023-07-04 09:31:51 +03:00
kd-11 89c81d9f22 rsx: Switch common codegen to use the glsl scripts 2023-07-04 09:31:51 +03:00
kd-11 cffcfad42a rsx: Add the glsl files
- Generated from inline strings in GLSLCommon.cpp
2023-07-04 09:31:51 +03:00
Eladash 21f5976d35 cellSpurs: Implement ShutdownTaskset and WorkloadFlagReceiver2 2023-07-02 19:01:13 +03:00
Megamouse 21ada251fe Update dependencies 2023-07-02 07:59:25 +02:00
Megamouse 44801c50f3 Input: update buttons on pressure button toggle 2023-07-01 08:56:10 +02:00
Megamouse 6a1fb8cb73 Input: fix multibutton mousepress (sticks only) 2023-07-01 08:56:10 +02:00
Megamouse 8e8cefb3f6 Input: fix multibutton mousepress (buttons only) 2023-07-01 08:56:10 +02:00
Megamouse e0e4fa3b3e Input: Add tooltips for button mapping 2023-07-01 08:56:10 +02:00
Megamouse b9dbda5ddc Fix some warning 2023-07-01 08:56:10 +02:00
kd-11 931a2c516f vk/rsx: Fix build errors and warnings 2023-06-30 18:38:14 +03:00
kd-11 2f9e1cf4df vk: Get rid of some spammy debug code 2023-06-30 18:38:14 +03:00
kd-11 68d1c38f3b vk: Minor refactor to make early-exit branches trivial and easier to read 2023-06-30 18:38:14 +03:00
kd-11 c4acea6c82 vk: Fix some regressions in synchronization2 behavior 2023-06-30 18:38:14 +03:00
kd-11 7ebabddfe0 vk: Fix GPU hang 2023-06-30 18:38:14 +03:00
kd-11 a047ddffc0 vk: Restructure gpu labels and add them as an event backend 2023-06-30 18:38:14 +03:00
kd-11 92992a5406 vk: Use pipeline barriers for proper event sync 2023-06-30 18:38:14 +03:00
Eladash 593f850693 Qt: Save UI settings and geometry safely on closeEvent 2023-06-29 14:02:25 +02:00
Eladash f87db1ac14 System.cpp: Do not hold the watchdog forever for PPU LLVM compilation cancel
Protects against the case in which the LLVM workers deadlock themselves.
2023-06-29 12:12:56 +03:00
Eladash 363e498462 Remove overlay hack for PPU LLVM OVL precompilation 2023-06-29 12:12:56 +03:00
Eladash a03dd44924 Empty kill and init callback before calling them 2023-06-29 12:12:56 +03:00
Eladash 554b27a82a PPU LLVM: Implement SELF precompilation
Do not use PS3 memory for precompilation.
2023-06-28 18:34:33 +03:00
Eladash 7062ead4fd PPU LLVM: Precompile all disc game data including PRX etc
Even if there is no EBOOT.BIN.
2023-06-28 18:34:33 +03:00
Eladash 5f2f084091 Savestate/IDM: Do not save unsavable containers 2023-06-28 18:34:33 +03:00
Eladash a560121775 Fix Create PPU Cache 2023-06-28 18:34:33 +03:00
Dark b0a346709e RB3MidiGuitar.cpp: Support 5-Fret play
Rock Band 3 has support for playing the regular guitar mode with the
Pro Guitar. While the real MPA does not support this, the game accepts
it just fine so there's no harm in emulating it.
2023-06-27 20:11:10 +02:00
Megamouse 7b64cd2a8e input/overlays: add option to lock overlay input to player one 2023-06-27 19:36:05 +02:00
kd-11 9ecfecb83e Constify 2023-06-27 16:41:30 +03:00
kd-11 ec4565263d Dump extensions info to the log 2023-06-27 16:41:30 +03:00
kd-11 ed1da364e5 vk: Fix a bunch of corner cases when syncing GPU and host memory 2023-06-27 16:41:30 +03:00
kd-11 942dbbc8fa vk: Add explicit sync when doing copy_image_to_buffer 2023-06-27 16:41:30 +03:00
kd-11 3e8f9cbbf2 Add flags to handle sync domain with v2 events 2023-06-27 16:41:30 +03:00
kd-11 322b5dac79 Properly enable synchronization2 feature 2023-06-27 16:41:30 +03:00
kd-11 5a85fee3f1 Silence logspam about unused parameter 2023-06-27 16:41:30 +03:00
kd-11 ca472b6750 Silence log spam about copy ellision 2023-06-27 16:41:30 +03:00
Megamouse 8e3d0af08e Qt: remove obsolete shortcut 2023-06-26 21:23:48 +02:00
Megamouse 12f2b900ca Qt: use shortcut instead of hardcoded keypress event 2023-06-26 21:23:48 +02:00
Megamouse 6228dff809 welcome_dialog: remove weird window close event 2023-06-26 21:23:48 +02:00
Eladash d34b3190f7 Make stopping emulation not pause or crash UI
* Make the UI and main thread available when stopping emulation.
* Make BlockingCallFromMainThread always execute, preventing bugs when it unexpectedly did not.
* Add error code for when starting emulation when Emu.Kill() is in progress.
2023-06-26 20:48:38 +02:00
Eladash 4f5348c7d4 Fix properly RSX replay thread stop bug 2023-06-26 20:48:38 +02:00
Eladash aff871f127 about_dialog: Add new testers 2023-06-25 20:16:55 +03:00
Eladash 9f00359e17 Qt: Add RPCS3 Discord & Wiki to About Dialog 2023-06-25 20:16:55 +03:00
Eladash 0871436488 settings: Display rendering result of 100% resolution scale 2023-06-25 20:16:55 +03:00
Eladash 6aa598b029 Qt: Add Create RPCS3 shortcuts to Wecome Dialog 2023-06-25 20:16:55 +03:00
Eladash 83e22fa9f0 Qt: Make welcome dialog accessible through F1 or Help menu
Enable window close button after "I have read the Quickstart" is checked.
2023-06-25 20:16:55 +03:00
Eladash a230340578 Qt: Fix memory leak in welcome dialog 2023-06-25 20:16:55 +03:00
Eladash 2da78c6591 Qt: Allow to drop RAP&PKG together 2023-06-25 20:16:55 +03:00
Eladash 46350200d7 Qt: Always set QEvent::isAccepted is drag&drop events 2023-06-25 20:16:55 +03:00
Eladash 00502e94b5 Qt: Do not require to close games when adding new disc game directories 2023-06-25 20:16:55 +03:00
brian218 70ce7ee106 sys_fs: Fixed up one of sys_fs_unmount()'s error codes to match real system behavior 2023-06-25 09:08:20 +02:00
brian218 cf4ae38699 sys_fs: Implemented get_normalized_path() 2023-06-25 09:08:20 +02:00
Eladash 09f83e48ff fs: Add get_parent_dir_view
string view version of the argument path, use with care.
2023-06-24 12:00:04 +03:00
Eladash bcbce5dd48 File.cpp: revert get_parent_dir change 2023-06-24 12:00:04 +03:00
kd-11 0a0ef50caf Try to fix build 2023-06-23 15:21:17 +03:00
kd-11 e20f1587cd Workaround for old compilers
Xcode is not yet c++20 compliant
2023-06-23 15:21:17 +03:00
kd-11 715e3856f2 vk: Update async compute (fast) to use the new sync API 2023-06-22 14:59:58 +03:00
kd-11 850166eca1 vk: Reimplement events using synchronization2 extension 2023-06-22 14:59:58 +03:00
Eladash 00cca7be69 Utilities/Memory Viewer: Improve image viewer
* Added image scaling with Ctrl+Plus, Ctrl+Minus.
* Added hover position to see which address is being pointed at, when double clicking on it the image viewer is closed and the memory viewer jumps to the clicked memory data.
2023-06-21 22:28:52 +03:00
Eladash 0a43f69e87 Utilities/Memory Viewer: Add G8 and G32MAX image formats 2023-06-21 22:28:52 +03:00
Eladash c84d2d895e Utilities/Memory Viewer: Add PageDown/PageUp scrolling
* F5 for single refresh.
2023-06-21 22:28:52 +03:00
Eladash 87d5f45277 Utilities/Memory Viewer: Fix memory leak 2023-06-21 22:28:52 +03:00
Eladash 137f37cd41 Debugger/RSX: Add shortcut for RSX semaphores 2023-06-21 22:28:52 +03:00
Eladash 18722d7874 Utilities/Memory Viewer: Add auto-refresh mode 2023-06-21 22:28:52 +03:00
Eladash 307e1351df asm.hpp: Fix mul_saturate 2023-06-21 22:28:52 +03:00
Eladash 441fbd63bb Fix PPU debug setting with PPU interpreter 2023-06-20 18:18:24 +03:00
Eladash 073b723c09 Fix Create PPU Cache 2023-06-19 13:59:56 +03:00
unknown 37bc73865d jit: fix assertion in GDBJITRegistrationListener 2023-06-18 13:06:53 +03:00
RipleyTom e2bced978e Move connect workaround to connect interface 2023-06-18 01:04:01 +02:00
Megamouse a6d8c4343f Windows: silence uncritical performance counter error 2023-06-16 19:36:44 +02:00
kd-11 d5654d64d5 Nicer variable names 2023-06-16 15:29:36 +03:00
kd-11 06459eb37b vk: Latch query copy requests to reduce number of vulkan commands used 2023-06-16 15:29:36 +03:00
Megamouse d08fea551e progress dialog fix 2023-06-16 10:30:27 +02:00
Megamouse 924692bf1c Qt: use shift+click to append the button instead of replacing it 2023-06-15 22:39:30 +02:00
Megamouse ec9e8916b1 evdev: don't release buttons while other buttons are still pressed 2023-06-15 22:39:30 +02:00
Megamouse d3be8ee2b7 input: allow multiple key codes per button 2023-06-15 22:39:30 +02:00
Megamouse 16f869fe5a logging: minor trace optimizations 2023-06-15 19:48:15 +02:00
Megamouse a90858193e Qt/logging: add format function for QString 2023-06-15 19:48:15 +02:00
Ani 6dcf63009e Settings: Move Accurate SPU DMA to Advanced 2023-06-15 01:22:15 +02:00
Ani 5f8f86b5a7 Settings: Add Output Scaling to Home Menu 2023-06-15 01:22:15 +02:00
Ani a78117e094 Settings: Enable hot-reloading of Output Scaling 2023-06-15 01:22:15 +02:00
Ani 44421920b3 Settings: Reorder settings in Debug 2023-06-15 01:22:15 +02:00
Ani 0e79fbda05 Settings: Reorder settings in Emulator 2023-06-15 01:22:15 +02:00
Ani 9ab89c634b Settings: Move Automatically start games after boot to Debug 2023-06-15 01:22:15 +02:00
Ani 0a6f12f448 Settings: Rename to Force GPU Texture Scaling
Before the setting's name was Use GPU Texture Scaling
2023-06-15 01:22:15 +02:00
Ani 8612bdd03d Settings: Rename to Pause emulation after loading savestates
Before the setting's name was Start Savestates Paused
2023-06-15 01:22:15 +02:00
Ani f08d3e12ca Settings: Remove PPU Interpreter (dynamic)
It has been unimplemented for a long while, so no point in displaying
it, it can be added once the feature is implemented again
2023-06-15 01:22:15 +02:00
Ani deda47f461 Settings: Move Accurate GETLLAR to Advanced
Also includes some minor cleanup to move some code to their right blocks 
in settings_dialog and tooltips
2023-06-15 01:22:15 +02:00
Ani 2751f5e254 Settings: Move Accurate PPU Float Condition Control to Debug 2023-06-15 01:22:15 +02:00
Ani 2ac1ff1d0a Settings: Move Accurate PPU Vector NaN Handling to Debug 2023-06-15 01:22:15 +02:00
Ani 30e8c70055 Settings: Move Accurate PPU Non-Java Mode to Debug 2023-06-15 01:22:15 +02:00
Ani 62600b3be0 Settings: Move Accurate PPU Saturation Bit to Debug 2023-06-15 01:22:15 +02:00
Ani 57b9130cf7 Settings: Add Show PPU compilation hint 2023-06-15 01:22:15 +02:00
Ani b557a7fa16 Settings: Move Start Savestates Paused to Emulator
Under Emulator Settings groupbox, this is not really an Advanced setting 
thus it's more fitting on the Emulator tab
2023-06-15 01:22:15 +02:00
Ani 73e336adfa Settings: Move Disable Vertex Cache to Advanced
Under GPU group box, MTRSX now works with Vertex Cache so the use cases
for this settings are very reduced
2023-06-15 01:22:15 +02:00
Ani 86b27a3088 Settings: Remove Full Width AVX-512 from the UI
This is a very niche setting, so it can remain a config.yml setting only
2023-06-15 01:22:15 +02:00
Ani cce699a465 Settings: Enable Full Width AVX-512 by default
It is only known to cause performance hits in old Skylake-X AVX-512 CPUs 
as opposed to the other AVX-512 enabled CPUs, so it should be enabled as 
default
2023-06-15 01:22:15 +02:00
Megamouse d662a39a12 PPUAnalyser: fix std::move nonsense 2023-06-14 11:05:00 +03:00
kd-11 49c6c2c529 vk: Do not hard-sync on first sign of fragmentation
- It is very likely that the resource would be available if we just waited a while for the GPU queue to clear.
- Instead of also discarding the current work, first check if we can get by without a hard sync.
2023-06-14 01:12:11 +03:00
kd-11 29f3eec957 vk: On pool recovery, rescan the subpool table in case a new pool really cannot be created 2023-06-14 01:12:11 +03:00
kd-11 c1d875d841 vk: Handle VK_ERROR_FRAGMENTATION when allocating descriptor pools 2023-06-14 01:12:11 +03:00
Megamouse d28e3c4f08 np_handler: fix warning: check socket in discover_ip_address 2023-06-13 18:08:51 +02:00
Megamouse cedfb95f9b Loader: remove dead code 2023-06-12 19:35:15 +02:00
Elad Ashkenazi 59430ee83e Log Frame: Make clear act clear pending messages (#14004) 2023-06-12 18:46:09 +02:00
Megamouse b436d2a7f4 input: add controller index to SDL controllers 2023-06-12 18:05:34 +02:00
Megamouse 84d2ad70e6 input: add new buttons for Dualsense Edge 2023-06-12 17:29:14 +02:00
Megamouse 1bd9549e45 input: merge some duplicate code 2023-06-12 17:29:14 +02:00
Megamouse 2409a0d04e input: Add dualsense edge PID 2023-06-12 17:29:14 +02:00
Megamouse 635fed0427 fs/linux: fix potential copy_file issue
sendfile is meant to be run in a loop, since there is no guarantee that a single call copies all the data.
The current implementation may lead to corrupt files on linux.
2023-06-12 15:59:32 +03:00
RipleyTom 5d7e75c5d8 Fix EINVAL returned on connect call to connecting socket 2023-06-11 15:42:22 +02:00
Eladash c0e97b4e96 Qt: Improve PS3 Binaries Decryption tool 2023-06-11 00:40:14 +02:00
brian218 b2842dcd52 System.cpp: Updated the definition of user-space LV2 CoreOS SELFs 2023-06-10 17:59:02 +02:00
Jan Beich 112f1016ed CI: switch FreeBSD back to /latest after llvm16 re-appeared
This reverts commit 5e6aa45658.
2023-06-10 10:00:55 +02:00
Megamouse c78c504043 overlays: update progress dialog workaround 2023-06-10 09:09:55 +02:00
kd-11 27349c5c69 vk: Cleaner approach to object lifetime management 2023-06-10 02:54:16 +03:00
kd-11 872aa2b358 vk: Improved OOM handling
- Don't aggressively delete surfaces unless we're really crashing
- Release barrier resources before destroying the surface in case of fatal crash
2023-06-10 02:54:16 +03:00
kd-11 72abc0f219 rsx: Minor annotations and refactoring 2023-06-10 01:36:10 +03:00
kd-11 4d565eade6 rsx: Drop format information from the vertex cache and use a simpler model that is much faster 2023-06-10 01:36:10 +03:00
kd-11 2df7e46cb1 rsx: Import robin-hood unordered map which is much faster than std 2023-06-10 01:36:10 +03:00
kd-11 105205312b rsx: Rewrite the find method to avoid unnecessary allocations 2023-06-10 01:36:10 +03:00
kd-11 97f7461aa9 rsx: Allow the vertex cache to be enabled independently of MTRSX 2023-06-10 01:36:10 +03:00
kd-11 7e2eaf43ca rsx: Capture stats about vertex cache performance 2023-06-10 01:36:10 +03:00
Eladash d752ab0151 SPU/Debugger: Add RawSPU debug data 2023-06-09 14:07:37 +03:00
Eladash c87a7cb2c0 PPU: Fix thread entry detection false positives 2023-06-09 14:07:37 +03:00
Megamouse 6aff2803e5 cellMsgDialog: Fix segfault when closing non-blocking Qt dialogs 2023-06-09 02:03:44 +02:00
Megamouse fcfca6efda Qt: add ability to style richtext href links 2023-06-08 22:58:55 +02:00
Megamouse 0ebe832f8e input: fix some warnings 2023-06-08 22:58:55 +02:00
Megamouse 86ed82dcec PSF: improve load readability 2023-06-08 21:15:39 +02:00
Megamouse 769b69999f fix whitespace 2023-06-08 21:15:39 +02:00
Megamouse 91ee066751 Qt: do not set play/pause button texts to 'Resume' on emu stop or ready
Since the states now always seem to match, this makes no sense anymore
2023-06-08 21:15:39 +02:00
Megamouse 404d08ef6d Qt: always use last boot path for game boot actions
The actual path caused the GUI to try to run elfs directly after booting a game from a loader.
2023-06-08 21:15:39 +02:00
Megamouse 11487cd591 System: fix config path in restore_on_no_boot 2023-06-08 21:15:39 +02:00
Megamouse 51a30977d2 System: use const ref for libs map 2023-06-08 21:15:39 +02:00
Megamouse c0366ba40c Qt: fix start/restart shortcut 2023-06-08 21:15:39 +02:00
Megamouse 3f5bc3464d Rename ProcureCurrentEmulationCourseInformation to GetEmulationIdentifier
This is much easier to understand in my opinion.
The old name just made me scratch my head whenever I read it.
2023-06-08 21:15:39 +02:00
Megamouse fcd6be71b0 debugger_frame: don't query cpu thread if emulation is stopped anyway 2023-06-08 21:15:39 +02:00
brian218 ad22cf5051 unself.cpp: Always reset the old SELF header information before loading 2023-06-08 18:18:57 +02:00
Megamouse 8f66c50721 input: add pressure intensity toggle mode 2023-06-08 16:41:44 +02:00
kd-11 6f834e99d2 vk: Disable conditional rendering on MacOS 2023-06-06 22:05:54 +03:00
kd-11 86c7b31b6d Force disable conditional render on macOS 2023-06-06 22:05:54 +03:00
Eladash 6d918b565f PPU: Sleep after returning from thread entry function 2023-06-06 17:53:09 +02:00
Eladash 52575a44b2 sys_ppu_thread: Optimize joined thread notification 2023-06-06 17:53:09 +02:00
Eladash d5eebd6ab4 debugger: Fix trailing spaces in PPU register dump 2023-06-06 09:48:27 +02:00
Eladash 3f44ecb77a register_editor_dialog: Improve selection 2023-06-06 09:48:27 +02:00
Eladash 9bd4426225 Fix _sys_interrupt_thread_disestablish with lingering thread copies 2023-06-06 09:48:27 +02:00
Eladash 4af0a33f1f Fix sys_ppu_thread_detach/exit with lingering thread copies 2023-06-06 09:48:27 +02:00
Eladash 636bde6343 Logs: Fix trailing space, nbsp and unintended character 2023-06-06 09:48:27 +02:00
Eladash 16579e0b1f Fix spu_thread::cleanup() 2023-06-06 09:48:27 +02:00
Megamouse 292d3faa9e input: fix pad profile override with existing custom pad configs 2023-06-06 08:09:31 +02:00
Megamouse 6d2f7f6e54 sys_fs: fix map entry removal in destructor 2023-06-05 23:14:12 +02:00
brian218 a131a41874 Fixed a bug in fs::get_parent_dir() 2023-06-05 20:15:43 +02:00
brian218 48ffc19193 Update sys_usbd.cpp 2023-06-05 20:15:43 +02:00
Eladash e75c0dbaa1 debugger(CallStack): Make Return act as double click 2023-06-05 17:39:52 +03:00
Eladash 0c0f63a2a8 debugger: Fix potential null dereference 2023-06-05 17:39:52 +03:00
Eladash c9942aa828 debugger: Fix key events when CallStack is focused 2023-06-05 17:39:52 +03:00
Eladash ca56f0747e debugger: Avoid incorrect update timer restart 2023-06-05 17:39:52 +03:00
Eladash e77c01d00a debugger: Fix use of invalid pointers 2023-06-05 17:39:52 +03:00
brian218 c85775922e sys_usbd: Implemented sys_usbd_unregister_extra_ldd() 2023-06-05 13:51:54 +03:00
brian218 da0c9c2ce9 sys_usbd: USB VID/PID logging format fixup 2023-06-05 13:51:54 +03:00
brian218 42b388317e sys_ss: Further implemented Update Manager service for VSH 2023-06-05 13:51:54 +03:00
brian218 6a570ae57e sys_fs: Implemented sys_fs_mount(prot=1) read-only mounting & fixed up some operation and permission checks 2023-06-05 13:51:54 +03:00
Jan Beich 5e6aa45658 CI: temporarily switch FreeBSD to /quarterly packages
llvm16 failed to build on /latest, so the package is missing atm.
As builds are automatic this will resolve itself in a few days.
2023-06-04 23:11:24 +02:00
Jan Beich 5fa8af1c9a CI: upgrade FreeBSD to 13.2
FreeBSD doesn't support /latest and /quarterly package repos on EOL
versions. 13.1 reaches EOL on 2023-07-31, so avoid CI breakage.
2023-06-04 23:11:24 +02:00
Elad Ashkenazi 2e4bf9ef1b Update sys_timer.cpp 2023-06-04 01:26:24 +02:00
Elad Ashkenazi ba9f55679d Update sys_timer.cpp 2023-06-04 01:26:24 +02:00
Elad Ashkenazi 2c999a550b Update sys_mutex.h 2023-06-04 01:26:24 +02:00
Elad Ashkenazi 805de248d3 Update sys_lwmutex.h 2023-06-04 01:26:24 +02:00
Elad Ashkenazi 1240874e41 Update sys_lwmutex.h 2023-06-04 01:26:24 +02:00
Elad Ashkenazi feff50e7e0 Update sys_mutex.h 2023-06-04 01:26:24 +02:00
Ani 33558d14e5 rpcs3_version: Bump to 0.0.28 2023-06-02 19:54:07 +02:00
Eladash c37fc73a02 PPU LLVM: Invalidate cache for testers 2023-06-02 08:54:46 +03:00
Eladash d152537e50 sys_lwcond/cond/ppu_thread: Respect scheduler in various syscalls 2023-06-02 08:54:46 +03:00
Eladash 5d4e87373f LV2: Make _sys_lwcond_destroy wait for lwmutex lock 2023-06-02 08:54:46 +03:00
Eladash 1c36156594 PPU LLVM: Fix LWSYNC according to cellSpursWakeup 2023-06-02 08:54:46 +03:00
Eladash 300701a06b Make page faults entry enqueue and event atomic 2023-06-02 08:54:46 +03:00
Eladash a776f15557 SPU: fix event count with ACK and mask write 2023-06-02 08:54:46 +03:00
Eladash 1c89f8a855 LV2/Timer: Fix ENOTCONN check of start timer 2023-06-02 08:54:46 +03:00
Eladash 81e4d9c2ee LV2/TImer: Fix notification discard 2023-06-02 08:54:46 +03:00
Eladash 49be6be8f4 LV2/Timer: Make timers consistent 2023-06-02 08:54:46 +03:00
Eladash b861a9c5d0 LV2: Implement set-priority thread requeue 2023-06-02 08:54:46 +03:00
Eladash 9828e6cafc LV2: Push other-than-this thread to the back on priority set 2023-06-02 08:54:46 +03:00
Eladash 3d8d9ef61c Threads.cpp: Fix infinite looping 2023-06-02 08:54:46 +03:00
Eladash 5d13978bbf sys_lwcond: Implement TIMEOUT on lwmutex lock 2023-06-02 08:54:46 +03:00
Eladash b844aecb9e sys_lwmutex/mutex: Fix race on lock timeout 2023-06-02 08:54:46 +03:00
Eladash f57c8c1c35 LV2: Unconditional Timer Synchronization Fix 2023-06-02 08:54:46 +03:00
kd-11 bbbc5f6e6c rsx: Write a warning to the log if we decide to collapse surfaces to reduce VRAM usage. 2023-06-01 19:25:50 +03:00
kd-11 ac0c60b740 vk: Rename gc_wrapper_t to gc_callback_t which is more relevant 2023-06-01 19:25:50 +03:00
kd-11 f2f95a20a3 vk: Minor improvement to descriptor and garbage collector interaction 2023-06-01 19:25:50 +03:00
kd-11 12f213ffad rsx: Trim the number of in-flight invalidated resources (temp cache)
- This drastically improves memory allocation behavior.
  Holding too many invalidated resources can lead to a cascading overallocation error as old resources hold refs to even older resources and nothing gets deleted.
2023-06-01 19:25:50 +03:00
Megamouse 66e1cf96e2 Qt/Loader: Let users choose which packages to install 2023-06-01 16:34:23 +02:00
Elad Ashkenazi c3b7229fbb Extra PS3_EXTRA fix 2023-06-01 06:43:33 +02:00
Megamouse f96a0ce9d2 Trophies: Add more sanity checks to pugixml backend 2023-05-30 19:11:57 +02:00
Megamouse ba592070f7 Qt: fix random initial game selection in trophy dir 2023-05-30 19:11:57 +02:00
kd-11 6a2ea62f82 vk: Minor cleanup 2023-05-30 16:50:08 +03:00
kd-11 6cfd817b5a vk: Fix descriptor-related crashes 2023-05-30 16:50:08 +03:00
kd-11 c99ef4b09f vk: Refactor descriptor handling 2023-05-30 16:50:08 +03:00
kd-11 7e131f8fb6 rsx/util: Add some c++ guards around simple_array class 2023-05-30 16:50:08 +03:00
kd-11 10171c19c3 vk: Unify descriptor allocation
- Pool management should be a backend implementation detail.
2023-05-30 16:50:08 +03:00
Elad Ashkenazi e0853095e3 Fixup debugger_frame double events 2023-05-30 13:11:03 +02:00
Eladash 5a365506f7 Qt/Debugger: Add Ctrl+F (find thread), Ctrl+C (copy) 2023-05-28 13:53:35 +02:00
Megamouse 4aee1b378a overlays: fix media list dialog pad interception 2023-05-28 11:56:49 +02:00
Elad Ashkenazi 9f5e3ecb8c rsx/overlays: Fix crash on stop 2023-05-26 07:42:29 +02:00
Megamouse 7b9614fcf3 Hid: add some logging for initial send_output_report 2023-05-25 23:02:22 +02:00
Megamouse 8e62a0e22d input: remove some outdated comments 2023-05-25 23:02:22 +02:00
Megamouse f89d3d5077 cellCamera: don't switch to main thread unless really necessary 2023-05-25 21:30:27 +02:00
Megamouse 145e059cdf input: allow to remap emulated pads dynamically 2023-05-25 20:37:15 +02:00
Megamouse 22916a7e8d Qt/input: limit some usb device configs to 2 players 2023-05-25 20:37:15 +02:00
Megamouse 07f458f991 Qt: rename emulated pads menu to usb devices 2023-05-25 20:37:15 +02:00
Megamouse 6180a58d7a Qt: disable emulated pad settings during emulation 2023-05-25 20:37:15 +02:00
Megamouse 5cc2a7c09e input: fix emulated pad stick y axis 2023-05-25 20:37:15 +02:00
Megamouse e584653b72 input: move emulated pad handling to config class 2023-05-25 20:37:15 +02:00
Megamouse f4b346a6f8 input: fix emulated button map accessors 2023-05-25 20:37:15 +02:00
Megamouse cb1b71bc57 Qt: fix emulated button reset 2023-05-25 20:37:15 +02:00
Megamouse 95060efb7d input: add support for multi-assignment in emulated pads 2023-05-25 20:37:15 +02:00
Megamouse b82dd61a0c input: add emulated axis configs 2023-05-25 20:37:15 +02:00
Megamouse c84d10686f Qt: change wording on fake PS Move config 2023-05-25 20:37:15 +02:00
Megamouse d652a81078 Qt/input: add emulated pads settings dialogs 2023-05-25 20:37:15 +02:00
Megamouse fc76d2df38 input: list actual nodes instead of button ids 2023-05-25 20:37:15 +02:00
Megamouse 1a98682ea0 input: add enum count for enumeration 2023-05-25 20:37:15 +02:00
Megamouse 64437a531b input: use global configs 2023-05-25 20:37:15 +02:00
Megamouse 4d26170bd6 input: add emulated_pad_config template class 2023-05-25 20:37:15 +02:00
Megamouse 36831a3d6a input: add gem ds3 config file
No sticks yet
2023-05-25 20:37:15 +02:00
Megamouse e7c0df4eac input: add usio config file
No sticks yet
2023-05-25 20:37:15 +02:00
Megamouse a296c19633 input: add ghltar config file
No sticks yet
2023-05-25 20:37:15 +02:00
Megamouse 8b5f7a0770 input: add turntable config file
No sticks yet
2023-05-25 20:37:15 +02:00
Megamouse 7b9a36be7d input: add buzz config file
Adds a buzz.yml and implements a generic way to save actual DS3 mapping independent of pad handlers
2023-05-25 20:37:15 +02:00
shinra-electric cbe1628cf2 remove deprecated VK_MVK_moltenvk and replace with mvk_config.h
VK_MVK_moltenvk extension has been removed. 

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

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

* llvm: remove OLDLLVM define
2023-03-11 01:57:21 +03:00
RipleyTom ec8cb1668c Fix hid_pad_handler 2023-03-10 15:23:55 +01:00
RipleyTom 1b7b59466d Add missing spinning icon from resources 2023-03-09 22:34:23 +01:00
Elad Ashkenazi e45e9c20dd PPU: Do not break on unexpected TOC (#13490) 2023-03-09 16:53:44 +03:00
RipleyTom 450cb1771c Add better error handling for RequestSignalingInfos 2023-03-08 18:25:26 +01:00
RipleyTom f7a3d45c2c Use NBIO for RPCN 2023-03-08 13:11:33 +01:00
Eladash 65eb625843 cellSaveData: Slow save completion 2023-03-07 13:01:21 +01:00
Megamouse c06b957a8a hid: try to fix linux 2023-03-06 14:36:14 +01:00
Megamouse 05064dfaf4 cellVdec: revert RGBA alignment change 2023-03-05 22:49:49 +01:00
Megamouse 425610b98a Use win_error for WSAGetLastError 2023-03-05 22:49:49 +01:00
Megamouse 0d34b97948 overlays: apply message fade in during lifetime extension if necessary 2023-03-05 02:55:59 +01:00
Megamouse c6426245e4 overlays: refresh existing compile message expiration 2023-03-05 02:55:59 +01:00
Megamouse 6fe41870ab overlays: properly remove outdated messages from the queue.
Fixes zombie item glitch if a newer message has shorter duration than the older message
2023-03-05 02:55:59 +01:00
Megamouse 2d4e02f277 overlays: add ppu compile message if the progress dialog is unavailable 2023-03-05 02:55:59 +01:00
Megamouse 6d7d3fff6d Improve some decryption log messages 2023-03-05 02:55:59 +01:00
Megamouse cc145eaf2e patches: fix move_file/hide_file error 2023-03-04 19:18:36 +01:00
Megamouse da6d1d359c hid/ds4: add logging for PID and VID 2023-03-04 19:18:36 +01:00
Megamouse 92ae57c9ee Windows: log more descriptive errors 2023-03-04 18:34:56 +01:00
Megamouse 8409979dc5 Qt: Disable some network settings in global config. Re-enable RPCN in global config. 2023-03-04 18:34:56 +01:00
Elad Ashkenazi 8bc92a2cbb VFS: Fix mounting non-existant paths (#13488) 2023-03-04 17:12:45 +01:00
RipleyTom 2de4c03faa Fix wolfssl connect 2023-03-03 22:51:01 +01:00
Eladash 382a7c94a2 Patches: Virtual move/remove game files patches 2023-03-03 20:56:11 +01:00
Megamouse 1d7a00666e rpcn: throw exception when using rpcn features without a proper config 2023-03-03 11:30:39 +01:00
Megamouse 14c0289542 Qt: disable psn setting in global settings
Also move some common code to helper functions
2023-03-03 09:05:30 +01:00
Megamouse 69ebdfd689 cellMic: random improvements 2023-03-03 08:27:42 +01:00
Megamouse fc21ece784 pkg install: return correct error if possible. Add more early outs and skip workers on error, 2023-03-02 23:27:20 +01:00
kd-11 a3ededdcf1 rsx: Implement deferred buffer allocations for GPU write 2023-03-02 12:48:58 +03:00
582 changed files with 31956 additions and 16380 deletions
+4 -4
View File
@@ -3,13 +3,13 @@
# Pull all the submodules except llvm
# Note: Tried to use git submodule status, but it takes over 20 seconds
# shellcheck disable=SC2046
git submodule -q update --init --depth 1 $(awk '/path/ && !/llvm/ { print $3 }' .gitmodules)
git submodule -q update --init --depth 1 $(awk '/path/ && !/llvm/ && !/SPIRV/ { print $3 }' .gitmodules)
# Prefer newer Clang than in base system (see also .ci/install-freebsd.sh)
# libc++ isn't in llvm* packages, so download manually
fetch https://github.com/llvm/llvm-project/releases/download/llvmorg-15.0.6/llvm-project-15.0.6.src.tar.xz
fetch https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.1/llvm-project-16.0.1.src.tar.xz
tar xf llvm*.tar.xz
export CC=clang15 CXX=clang++15
export CC=clang16 CXX=clang++16
cmake -B libcxx_build -G Ninja -S llvm*/libcxx \
-DLLVM_CCACHE_BUILD=ON \
-DLIBCXX_INCLUDE_BENCHMARKS=OFF \
@@ -20,7 +20,7 @@ export CXXFLAGS="$CXXFLAGS -nostdinc++ -isystem$PWD/libcxx_prefix/include/c++/v1
export LDFLAGS="$LDFLAGS -nostdlib++ -L$PWD/libcxx_prefix/lib -l:libc++.a -lcxxrt"
CONFIGURE_ARGS="
-DWITH_LLVM=OFF
-DWITH_LLVM=ON
-DUSE_SDL=OFF
-DUSE_PRECOMPILED_HEADERS=OFF
-DUSE_NATIVE_INSTRUCTIONS=OFF
+5 -10
View File
@@ -9,15 +9,10 @@ if [ -z "$CIRRUS_CI" ]; then
cd rpcs3 || exit 1
fi
# Pull all the submodules except llvm, since it is built separately and we just download that build
# Pull all the submodules except llvm
# Note: Tried to use git submodule status, but it takes over 20 seconds
# shellcheck disable=SC2046
git submodule -q update --init $(awk '/path/ && !/llvm/ { print $3 }' .gitmodules)
# Download pre-compiled llvm libs
curl -sLO https://github.com/RPCS3/llvm-mirror/releases/download/custom-build/llvmlibs-linux.tar.gz
mkdir llvmlibs
tar -xzf ./llvmlibs-linux.tar.gz -C llvmlibs
git submodule -q update --init $(awk '/path/ && !/llvm/ && !/SPIRV/ { print $3 }' .gitmodules)
mkdir build && cd build || exit 1
@@ -42,8 +37,6 @@ export CFLAGS="$CFLAGS -fuse-ld=${LINKER}"
cmake .. \
-DCMAKE_INSTALL_PREFIX=/usr \
-DBUILD_LLVM_SUBMODULE=OFF \
-DLLVM_DIR=llvmlibs/lib/cmake/llvm/ \
-DUSE_NATIVE_INSTRUCTIONS=OFF \
-DUSE_PRECOMPILED_HEADERS=OFF \
-DCMAKE_C_FLAGS="$CFLAGS" \
@@ -51,8 +44,10 @@ cmake .. \
-DCMAKE_AR="$AR" \
-DCMAKE_RANLIB="$RANLIB" \
-DUSE_SYSTEM_CURL=ON \
-DUSE_SDL=OFF \
-DUSE_SDL=ON \
-DOpenGL_GL_PREFERENCE=LEGACY \
-DLLVM_DIR=/opt/llvm/lib/cmake/llvm \
-DSTATIC_LINK_LLVM=ON \
-G Ninja
ninja; build_status=$?;
+37 -15
View File
@@ -1,11 +1,17 @@
#!/bin/sh -ex
brew install -f --overwrite llvm@14 nasm ninja git p7zip create-dmg ccache
export HOMEBREW_NO_AUTO_UPDATE=1
brew install -f --overwrite nasm ninja git p7zip create-dmg ccache pipenv
#/usr/sbin/softwareupdate --install-rosetta --agree-to-license
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
arch -x86_64 /usr/local/homebrew/bin/brew install -f --overwrite llvm@14 sdl2 glew cmake
arch -x86_64 /usr/local/bin/brew update
arch -x86_64 /usr/local/bin/brew install -f --overwrite llvm@16 sdl2 glew cmake faudio vulkan-headers
arch -x86_64 /usr/local/bin/brew link -f llvm@16
# moltenvk based on commit for 1.2.4 release
wget https://raw.githubusercontent.com/Homebrew/homebrew-core/b233d4f9f40f26d81da11140defbfd578cfe4a69/Formula/molten-vk.rb
arch -x86_64 /usr/local/bin/brew install -f --overwrite ./molten-vk.rb
#export MACOSX_DEPLOYMENT_TARGET=12.0
export CXX=clang++
export CC=clang
@@ -13,7 +19,7 @@ export CC=clang
export BREW_PATH;
BREW_PATH="$(brew --prefix)"
export BREW_X64_PATH;
BREW_X64_PATH="$("/usr/local/homebrew/bin/brew" --prefix)"
BREW_X64_PATH="$("/usr/local/bin/brew" --prefix)"
export BREW_BIN="/usr/local/bin"
export BREW_SBIN="/usr/local/sbin"
export CMAKE_EXTRA_OPTS='-DLLVM_TARGETS_TO_BUILD=X86'
@@ -21,25 +27,39 @@ export CMAKE_EXTRA_OPTS='-DLLVM_TARGETS_TO_BUILD=X86'
export WORKDIR;
WORKDIR="$(pwd)"
#get Qt
git clone https://github.com/engnr/qt-downloader.git
cd qt-downloader
git checkout f52efee0f18668c6d6de2dec0234b8c4bc54c597
pip3 install pipenv
pipenv run pip3 install py7zr requests semantic_version lxml
pipenv run ./qt-downloader macos desktop 5.15.2 clang_64 --opensource
cd ..
# Get Qt
if [ ! -d "/tmp/Qt/5.15.2" ]; then
mkdir -p "/tmp/Qt"
git clone https://github.com/engnr/qt-downloader.git
cd qt-downloader
git checkout f52efee0f18668c6d6de2dec0234b8c4bc54c597
cd "/tmp/Qt"
"/opt/homebrew/bin/pipenv" run pip3 install py7zr requests semantic_version lxml
"/opt/homebrew/bin/pipenv" run "$WORKDIR/qt-downloader/qt-downloader" macos desktop 5.15.2 clang_64 --opensource
fi
cd "$WORKDIR"
ditto "/tmp/Qt/5.15.2" "qt-downloader/5.15.2"
export Qt5_DIR="$WORKDIR/qt-downloader/5.15.2/clang_64/lib/cmake/Qt5"
export SDL2_DIR="$BREW_X64_PATH/opt/sdl2/lib/cmake/SDL2"
export PATH="$BREW_PATH/opt/llvm@14/bin:$WORKDIR/qt-downloader/5.15.2/clang_64/bin:$BREW_BIN:$BREW_SBIN:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Apple/usr/bin:$PATH"
export PATH="$BREW_X64_PATH/opt/llvm@16/bin:$WORKDIR/qt-downloader/5.15.2/clang_64/bin:$BREW_BIN:$BREW_SBIN:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Apple/usr/bin:$PATH"
export LDFLAGS="-L$BREW_X64_PATH/lib -Wl,-rpath,$BREW_X64_PATH/lib"
export CPPFLAGS="-I$BREW_X64_PATH/include -msse -msse2 -mcx16 -no-pie"
export LIBRARY_PATH="$BREW_X64_PATH/lib"
export LD_LIBRARY_PATH="$BREW_X64_PATH/lib"
git submodule update --init --recursive --depth 1
export VULKAN_SDK
VULKAN_SDK="$BREW_X64_PATH/opt/molten-vk"
ln -s "$VULKAN_SDK/lib/libMoltenVK.dylib" "$VULKAN_SDK/lib/libvulkan.dylib"
export VK_ICD_FILENAMES="$VULKAN_SDK/share/vulkan/icd.d/MoltenVK_icd.json"
export LLVM_DIR
LLVM_DIR="BREW_X64_PATH/opt/llvm@16"
# exclude FAudio, SPIRV and LLVM, and sdl from submodule update
# shellcheck disable=SC2046
git submodule -q update --init --depth=1 --jobs=8 $(awk '/path/ && !/FAudio/ && !/llvm/ && !/SPIRV/ && !/SDL/ { print $3 }' .gitmodules)
# 3rdparty fixes
sed -i '' "s/extern const double NSAppKitVersionNumber;/const double NSAppKitVersionNumber = 1343;/g" 3rdparty/hidapi/hidapi/mac/hid.c
@@ -47,12 +67,14 @@ sed -i '' "s/extern const double NSAppKitVersionNumber;/const double NSAppKitVer
mkdir build && cd build || exit 1
"$BREW_X64_PATH/bin/cmake" .. \
-DUSE_SDL=ON -DUSE_DISCORD_RPC=OFF -DUSE_VULKAN=ON -DUSE_ALSA=OFF -DUSE_PULSE=OFF -DUSE_AUDIOUNIT=ON \
-DUSE_SDL=ON -DUSE_DISCORD_RPC=ON -DUSE_VULKAN=ON -DUSE_ALSA=OFF -DUSE_PULSE=OFF -DUSE_AUDIOUNIT=ON \
-DLLVM_CCACHE_BUILD=OFF -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF \
-DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_TOOLS=OFF \
-DLLVM_INCLUDE_UTILS=OFF -DLLVM_USE_PERF=OFF -DLLVM_ENABLE_Z3_SOLVER=OFF \
-DUSE_NATIVE_INSTRUCTIONS=OFF \
-DUSE_SYSTEM_MVK=OFF \
-DUSE_SYSTEM_MVK=ON \
-DUSE_SYSTEM_FAUDIO=ON \
-DUSE_SYSTEM_SDL=ON \
$CMAKE_EXTRA_OPTS \
-DLLVM_TARGET_ARCH=X86_64 -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_IGNORE_PATH="$BREW_PATH/lib" \
-G Ninja
+14 -40
View File
@@ -3,48 +3,27 @@
cd build || exit 1
if [ "$DEPLOY_APPIMAGE" = "true" ]; then
DESTDIR=appdir ninja install
QT_APPIMAGE="linuxdeployqt.AppImage"
DESTDIR=AppDir ninja install
curl -sL "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" > "$QT_APPIMAGE"
chmod a+x "$QT_APPIMAGE"
"./$QT_APPIMAGE" --appimage-extract
./squashfs-root/AppRun ./appdir/usr/share/applications/*.desktop -bundle-non-qt-libs
ls ./appdir/usr/lib/
rm -r ./appdir/usr/share/doc
cp "$(readlink -f /lib/x86_64-linux-gnu/libnsl.so.1)" ./appdir/usr/lib/libnsl.so.1
export PATH=/rpcs3/build/squashfs-root/usr/bin/:"${PATH}"
curl -sL -o /usr/bin/linuxdeploy https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
chmod +x /usr/bin/linuxdeploy
curl -sL -o /usr/bin/linuxdeploy-plugin-qt https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage
chmod +x /usr/bin/linuxdeploy-plugin-qt
curl -sL -o linuxdeploy-plugin-checkrt.sh https://github.com/linuxdeploy/linuxdeploy-plugin-checkrt/releases/download/continuous/linuxdeploy-plugin-checkrt-x86_64.sh
chmod +x ./linuxdeploy-plugin-checkrt.sh
# 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++/
EXTRA_QT_PLUGINS="svg;" APPIMAGE_EXTRACT_AND_RUN=1 linuxdeploy --appdir AppDir --plugin qt
# Remove libwayland-client because it has platform-dependent exports and breaks other OSes
rm -f ./appdir/usr/lib/libwayland-client.so*
rm -f ./AppDir/usr/lib/libwayland-client.so*
# Remove libgmodule and libglib due to g_source_set_static_name symbol conflict with host libraries
rm -f ./appdir/usr/lib/libgmodule-2.0.so*
rm -f ./appdir/usr/lib/libglib-2.0.so*
# Remove git directory containing local commit history file
rm -rf ./AppDir/usr/share/rpcs3/git
# Install latest appimage runner
rm ./appdir/AppRun
curl -sL https://github.com/RPCS3/AppImageKit-checkrt/releases/download/continuous2/AppRun-patched-x86_64 -o ./appdir/AppRun
chmod a+x ./appdir/AppRun
curl -sL https://github.com/RPCS3/AppImageKit-checkrt/releases/download/continuous2/exec-x86_64.so -o ./appdir/usr/optional/exec.so
./linuxdeploy-plugin-checkrt.sh --appdir AppDir
# 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.29 and CXXABI_1.3.11
printf "#include <sstream>\n#include <exception>\n#include <memory_resource>\nint main(){auto x = std::stringbuf();x.get_allocator();std::make_exception_ptr(0);std::pmr::get_default_resource();}" \
| $CXX -x c++ -std=c++2a -o ./appdir/usr/optional/checker -
# Package it up and send it off
./squashfs-root/usr/bin/appimagetool "$APPDIR"
ls
linuxdeploy --appimage-extract
./squashfs-root/plugins/linuxdeploy-plugin-appimage/usr/bin/appimagetool AppDir -g
COMM_TAG=$(awk '/version{.*}/ { printf("%d.%d.%d", $5, $6, $7) }' ../rpcs3/rpcs3_version.cpp)
COMM_COUNT="$(git rev-list --count HEAD)"
@@ -61,9 +40,4 @@ if [ "$DEPLOY_APPIMAGE" = "true" ]; then
FILESIZE=$(stat -c %s ./rpcs3*.AppImage)
SHA256SUM=$(sha256sum ./rpcs3*.AppImage | awk '{ print $1 }')
echo "${SHA256SUM};${FILESIZE}B" > "$RELEASE_MESSAGE"
fi
if [ "$DEPLOY_PPA" = "true" ]; then
export DEBFULLNAME="RPCS3 Build Bot"
fi
+3 -2
View File
@@ -15,7 +15,7 @@ echo "AVVER=$AVVER" >> ../.ci/ci-vars.env
cd bin
mkdir "rpcs3.app/Contents/lib/"
cp "/usr/local/Homebrew/opt/llvm@14/lib/c++/libc++abi.1.0.dylib" "rpcs3.app/Contents/lib/libc++abi.1.dylib"
cp "/usr/local/opt/llvm@16/lib/c++/libc++abi.1.0.dylib" "rpcs3.app/Contents/lib/libc++abi.1.dylib"
rm -rf "rpcs3.app/Contents/Frameworks/QtPdf.framework" \
"rpcs3.app/Contents/Frameworks/QtQml.framework" \
@@ -23,7 +23,8 @@ rm -rf "rpcs3.app/Contents/Frameworks/QtPdf.framework" \
"rpcs3.app/Contents/Frameworks/QtQuick.framework" \
"rpcs3.app/Contents/Frameworks/QtVirtualKeyboard.framework" \
"rpcs3.app/Contents/Plugins/platforminputcontexts" \
"rpcs3.app/Contents/Plugins/virtualkeyboard"
"rpcs3.app/Contents/Plugins/virtualkeyboard" \
"rpcs3.app/Contents/Resources/git"
# Need to do this rename hack due to case insensitive filesystem
mv rpcs3.app RPCS3_.app
+1
View File
@@ -5,6 +5,7 @@ ARTIFACT_DIR="$BUILD_ARTIFACTSTAGINGDIRECTORY"
# Remove unecessary files
rm -f ./bin/rpcs3.exp ./bin/rpcs3.lib ./bin/rpcs3.pdb ./bin/vc_redist.x64.exe
rm -rf ./bin/git
# Prepare compatibility database for packaging, as well as
# certificate for ssl (auto-updater)
+1 -1
View File
@@ -1,4 +1,4 @@
#!/bin/sh -ex
curl -L -o "./llvm.lock" "https://github.com/RPCS3/llvm-mirror/releases/download/custom-build-win/llvmlibs_mt.7z.sha256"
curl -L -o "./llvm.lock" "https://github.com/RPCS3/llvm-mirror/releases/download/custom-build-win-16.0.1/llvmlibs_mt.7z.sha256"
curl -L -o "./glslang.lock" "https://github.com/RPCS3/glslang/releases/download/custom-build-win/glslanglibs_mt.7z.sha256"
+1 -1
View File
@@ -9,7 +9,7 @@ export ASSUME_ALWAYS_YES=true
pkg info # debug
# Prefer newer Clang than in base system (see also .ci/build-freebsd.sh)
pkg install llvm15
pkg install llvm16
# Mandatory dependencies (qt5-dbus and qt5-gui are pulled via qt5-widgets)
pkg install git ccache cmake ninja qt5-qmake qt5-buildtools qt5-widgets qt5-concurrent qt5-multimedia qt5-svg glew openal-soft ffmpeg
+3 -3
View File
@@ -19,7 +19,7 @@ QT_DECL_URL="${QT_HOST}${QT_PREFIX}qtdeclarative${QT_SUFFIX}"
QT_TOOL_URL="${QT_HOST}${QT_PREFIX}qttools${QT_SUFFIX}"
QT_MM_URL="${QT_HOST}${QT_PREFIX}qtmultimedia${QT_SUFFIX}"
QT_SVG_URL="${QT_HOST}${QT_PREFIX}qtsvg${QT_SUFFIX}"
LLVMLIBS_URL='https://github.com/RPCS3/llvm-mirror/releases/download/custom-build-win/llvmlibs_mt.7z'
LLVMLIBS_URL='https://github.com/RPCS3/llvm-mirror/releases/download/custom-build-win-16.0.1/llvmlibs_mt.7z'
GLSLANG_URL='https://github.com/RPCS3/glslang/releases/download/custom-build-win/glslanglibs_mt.7z'
VULKAN_SDK_URL="https://www.dropbox.com/s/cs77c3iv5mbo0bt/VulkanSDK-${VULKAN_VER}-Installer.exe"
@@ -40,7 +40,7 @@ DEP_URLS=" \
# Pull all the submodules except llvm, since it is built separately and we just download that build
# Note: Tried to use git submodule status, but it takes over 20 seconds
# shellcheck disable=SC2046
git submodule -q update --init --depth=1 --jobs=8 $(awk '/path/ && !/llvm/ { print $3 }' .gitmodules)
git submodule -q update --init --depth=1 --jobs=8 $(awk '/path/ && !/FAudio/ && !/llvm/ && !/SPIRV/ { print $3 }' .gitmodules)
# Git bash doesn't have rev, so here it is
rev()
@@ -79,7 +79,7 @@ for url in $DEP_URLS; do
# shellcheck disable=SC1003
case "$url" in
*qt*) checksum=$(curl -L "${url}.sha1"); algo="sha1"; outDir='C:\Qt\' ;;
*llvm*) checksum=$(curl -L "${url}.sha256"); algo="sha256"; outDir="." ;;
*llvm*) checksum=$(curl -L "${url}.sha256"); algo="sha256"; outDir="./3rdparty/llvm" ;;
*glslang*) checksum=$(curl -L "${url}.sha256"); algo="sha256"; outDir="./lib/Release-x64" ;;
*Vulkan*)
# Vulkan setup needs to be run in batch environment
+7 -3
View File
@@ -61,7 +61,7 @@ windows_task:
linux_task:
container:
image: rpcs3/rpcs3-ci-bionic:1.6
image: rpcs3/rpcs3-ci-bionic:1.8
cpu: 4
memory: 16G
env:
@@ -108,7 +108,7 @@ freebsd_task:
matrix:
- name: Cirrus FreeBSD
freebsd_instance:
image_family: freebsd-13-1
image_family: freebsd-13-2
cpu: 8
memory: 8G
env:
@@ -121,12 +121,16 @@ freebsd_task:
macos_task:
timeout_in: 12000m
homebrew_cache:
folder: /Users/admin/Library/Caches/Homebrew
qt_cache:
folder: /tmp/Qt
ccache_cache:
folder: /tmp/ccache_dir
matrix:
- name: Cirrus macOS
macos_instance:
image: ghcr.io/cirruslabs/macos-monterey-xcode:14
image: ghcr.io/cirruslabs/macos-monterey-xcode:latest
mac_script:
- mkdir artifacts
- chmod +x ".ci/build-mac.sh"
+12 -1
View File
@@ -31,12 +31,12 @@
*.wav
/build
/build-*
/lib
/tmp
/ipch
/rpcs3/Debug
/rpcs3/Release
/llvm_build
!/bin
/bin/*
@@ -104,6 +104,7 @@ rpcs3/rpcs3_autogen/*
# QtCreator
CMakeLists.txt.user
*.autosave
# CLion
/.idea/*
@@ -125,7 +126,17 @@ yaml-cpp.pc
# miniupnp
/3rdparty/miniupnp/x64/*
# llvm
/3rdparty/llvm/llvm_build
# legacy llvm
/llvm_build
# ssl certificate
cacert.pem
_ReSharper.*/
CMakeUserPresets.json
.cache/
.lldbinit
+9 -5
View File
@@ -7,9 +7,9 @@
url = ../../RPCS3/asmjit.git
branch = aarch64
ignore = dirty
[submodule "llvm"]
path = llvm
url = ../../RPCS3/llvm-mirror.git
[submodule "3rdparty/llvm/llvm"]
path = 3rdparty/llvm/llvm
url = ../../llvm/llvm-project.git
ignore = dirty
[submodule "3rdparty/glslang"]
path = 3rdparty/glslang/glslang
@@ -78,8 +78,12 @@
ignore = dirty
[submodule "3rdparty/libsdl-org/SDL"]
path = 3rdparty/libsdl-org/SDL
url = https://github.com/libsdl-org/SDL.git
url = ../../libsdl-org/SDL.git
ignore = dirty
[submodule "3rdparty/miniupnp/miniupnp"]
path = 3rdparty/miniupnp/miniupnp
url = https://github.com/miniupnp/miniupnp.git
url = ../../miniupnp/miniupnp.git
ignore = dirty
[submodule "3rdparty/rtmidi/rtmidi"]
path = 3rdparty/rtmidi/rtmidi
url = ../../thestk/rtmidi
+44 -40
View File
@@ -4,6 +4,11 @@ include(CMakeDependentOption)
set(CMAKE_CXX_STANDARD 20)
# Warnings are silenced for 3rdparty code
if(NOT MSVC)
add_compile_options("$<$<COMPILE_LANGUAGE:CXX,C>:-w>")
endif()
# Dummy target to use when lib isn't available
add_library(3rdparty_dummy_lib INTERFACE)
@@ -42,16 +47,16 @@ endif()
# libusb
if(CMAKE_SYSTEM MATCHES "DragonFly|FreeBSD")
if(CMAKE_SYSTEM_NAME MATCHES "DragonFly|FreeBSD")
pkg_check_modules(LIBUSB REQUIRED IMPORTED_TARGET libusb-1.0>=1.0 )
CMAKE_DEPENDENT_OPTION( USE_SYSTEM_LIBUSB "Use system libusb-1.0 as shared library" ON
cmake_dependent_option(USE_SYSTEM_LIBUSB "Use system libusb-1.0 as shared library" ON
"LIBUSB_FOUND" OFF)
else()
pkg_check_modules(LIBUSB IMPORTED_TARGET libusb-1.0>=1.0 )
CMAKE_DEPENDENT_OPTION( USE_SYSTEM_LIBUSB "Use system libusb-1.0 as shared library" OFF
cmake_dependent_option(USE_SYSTEM_LIBUSB "Use system libusb-1.0 as shared library" OFF
"LIBUSB_FOUND" OFF)
endif()
if(CMAKE_SYSTEM MATCHES "DragonFly|FreeBSD")
if(CMAKE_SYSTEM_NAME MATCHES "DragonFly|FreeBSD")
# Always use system libusb as reference implementation isn't supported
add_library(usb-1.0-shared INTERFACE)
target_link_libraries(usb-1.0-shared INTERFACE PkgConfig::LIBUSB)
@@ -78,7 +83,7 @@ add_subdirectory(hidapi)
# Vulkan
add_subdirectory(glslang EXCLUDE_FROM_ALL)
add_subdirectory(SPIRV EXCLUDE_FROM_ALL)
#add_subdirectory(SPIRV EXCLUDE_FROM_ALL)
# yaml-cpp
@@ -100,10 +105,6 @@ endif()
# OpenGL
# Prefer GLVND for OpenGL rather than legacy, unless it's been defined elsewhere, in the case of AppImage builds
if(NOT DEFINED OpenGL_GL_PREFERENCE)
set(OpenGL_GL_PREFERENCE GLVND)
endif()
find_package(OpenGL REQUIRED)
add_library(3rdparty_opengl INTERFACE)
@@ -111,17 +112,14 @@ target_include_directories(3rdparty_opengl INTERFACE GL)
if (WIN32)
if(NOT MSVC)
target_link_libraries(3rdparty_opengl INTERFACE ${OPENGL_LIBRARIES} opengl32.lib glu32.lib)
target_link_libraries(3rdparty_opengl INTERFACE OpenGL::GL OpenGL::GLU)
else()
target_link_libraries(3rdparty_opengl INTERFACE dxgi.lib d2d1.lib dwrite.lib)
endif()
elseif(APPLE)
target_link_libraries(3rdparty_opengl INTERFACE OpenGL::GL OpenGL::GLU)
else()
target_link_libraries(3rdparty_opengl INTERFACE ${OPENGL_LIBRARIES})
target_compile_definitions(3rdparty_opengl
INTERFACE
-DGL_GLEXT_PROTOTYPES
-DGLX_GLXEXT_PROTOTYPES)
target_link_libraries(3rdparty_opengl INTERFACE OpenGL::GL OpenGL::GLU OpenGL::GLX)
endif()
@@ -160,9 +158,9 @@ set(VULKAN_TARGET 3rdparty_dummy_lib)
if(USE_VULKAN)
if(APPLE)
if(USE_SYSTEM_MVK)
message("-- RPCS3: Using system MoltenVK")
message(STATUS "RPCS3: Using system MoltenVK")
else()
message("-- RPCS3: MoltenVK submodule")
message(STATUS "RPCS3: MoltenVK submodule")
execute_process(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" .
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/MoltenVK"
@@ -189,7 +187,7 @@ if(USE_VULKAN)
if(VULKAN_FOUND)
add_library(3rdparty_vulkan INTERFACE)
target_compile_definitions(3rdparty_vulkan INTERFACE -DHAVE_VULKAN)
target_link_libraries(3rdparty_vulkan INTERFACE SPIRV SPIRV-Tools-opt Vulkan::Vulkan)
target_link_libraries(3rdparty_vulkan INTERFACE SPIRV Vulkan::Vulkan)
if(UNIX AND NOT APPLE)
find_package(Wayland)
@@ -204,9 +202,9 @@ if(USE_VULKAN)
set(VULKAN_TARGET 3rdparty_vulkan)
else()
message("WARNING! USE_VULKAN was enabled, but libvulkan was not found. RPCS3 will be compiled without Vulkan support.")
message(WARNING "USE_VULKAN was enabled, but libvulkan was not found. RPCS3 will be compiled without Vulkan support.")
if(APPLE)
message( FATAL_ERROR "ERROR! To build without Vulkan support on macOS, please disable USE_VULKAN.")
message(FATAL_ERROR "To build without Vulkan support on macOS, please disable USE_VULKAN.")
endif()
endif()
endif()
@@ -225,7 +223,7 @@ if(USE_FAUDIO)
if (USE_SYSTEM_FAUDIO)
if (NOT SDL2_FOUND OR SDL2_VERSION VERSION_LESS 2.0.12)
message(WARNING
"-- RPCS3: System FAudio requires SDL 2.0.9 or newer. Please note, this warning"
"RPCS3: FAudio requires SDL 2.0.9 or newer. Please note, this warning"
"can also be displayed with SDL2 versions between 2.0.9-2.0.12, as the"
"CMake config files are not correctly installed. Since a valid SDL2"
">=2.0.9 version cannot be found, building with FAudio will be skipped.")
@@ -262,36 +260,36 @@ add_library(3rdparty_ffmpeg INTERFACE)
# Select the version of ffmpeg to use, default is builtin
if(USE_SYSTEM_FFMPEG)
message("-- RPCS3: using shared ffmpeg")
message(STATUS "RPCS3: using shared ffmpeg")
find_package(FFMPEG REQUIRED)
target_include_directories(3rdparty_ffmpeg INTERFACE ${FFMPEG_INCLUDE_DIR})
target_link_libraries(3rdparty_ffmpeg INTERFACE ${FFMPEG_LIBRARIES})
else()
if (NOT MSVC AND WIN32)
message("-- RPCS3: building ffmpeg submodule")
message(STATUS "RPCS3: building ffmpeg submodule")
include(ProcessorCount)
ProcessorCount(N)
ExternalProject_Add(ffmpeg-mingw
DOWNLOAD_COMMAND ""
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ffmpeg
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/ffmpeg
CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/ffmpeg/configure --prefix=./windows/x86_64 --arch=x86_64 --disable-avdevice --disable-programs --disable-avfilter --disable-postproc --disable-doc --disable-pthreads --enable-w32threads --disable-network --disable-everything --disable-encoders --disable-muxers --disable-hwaccels --disable-parsers --disable-protocols --enable-dxva2 --enable-static --disable-shared --enable-decoder=aac --enable-decoder=aac_latm --enable-decoder=atrac3 --enable-decoder=atrac3p --enable-decoder=mp3 --enable-decoder=pcm_s16le --enable-decoder=pcm_s8 --enable-decoder=h264 --enable-decoder=mpeg4 --enable-decoder=mpeg2video --enable-decoder=mjpeg --enable-decoder=mjpegb --enable-encoder=pcm_s16le --enable-encoder=ffv1 --enable-encoder=mpeg4 --enable-parser=h264 --enable-parser=mpeg4video --enable-parser=mpegaudio --enable-parser=mpegvideo --enable-parser=mjpeg --enable-parser=aac --enable-parser=aac_latm --enable-muxer=avi --enable-demuxer=h264 --enable-demuxer=m4v --enable-demuxer=mp3 --enable-demuxer=mpegvideo --enable-demuxer=mpegps --enable-demuxer=mjpeg --enable-demuxer=avi --enable-demuxer=aac --enable-demuxer=pmp --enable-demuxer=oma --enable-demuxer=pcm_s16le --enable-demuxer=pcm_s8 --enable-demuxer=wav --enable-hwaccel=h264_dxva2 --enable-indev=dshow --enable-protocol=file
BUILD_COMMAND make -j 4
CONFIGURE_COMMAND bash ${CMAKE_CURRENT_SOURCE_DIR}/ffmpeg/configure --prefix=./windows/x86_64 --arch=x86_64 --disable-avdevice --disable-programs --disable-avfilter --disable-postproc --disable-doc --disable-pthreads --enable-w32threads --disable-network --disable-everything --disable-encoders --disable-muxers --disable-hwaccels --disable-parsers --disable-protocols --enable-dxva2 --enable-static --disable-shared --enable-decoder=aac --enable-decoder=aac_latm --enable-decoder=atrac3 --enable-decoder=atrac3p --enable-decoder=mp3 --enable-decoder=pcm_s16le --enable-decoder=pcm_s8 --enable-decoder=h264 --enable-decoder=mpeg4 --enable-decoder=mpeg2video --enable-decoder=mjpeg --enable-decoder=mjpegb --enable-encoder=pcm_s16le --enable-encoder=ffv1 --enable-encoder=mpeg4 --enable-parser=h264 --enable-parser=mpeg4video --enable-parser=mpegaudio --enable-parser=mpegvideo --enable-parser=mjpeg --enable-parser=aac --enable-parser=aac_latm --enable-muxer=avi --enable-demuxer=h264 --enable-demuxer=m4v --enable-demuxer=mp3 --enable-demuxer=mpegvideo --enable-demuxer=mpegps --enable-demuxer=mjpeg --enable-demuxer=avi --enable-demuxer=aac --enable-demuxer=pmp --enable-demuxer=oma --enable-demuxer=pcm_s16le --enable-demuxer=pcm_s8 --enable-demuxer=wav --enable-hwaccel=h264_dxva2 --enable-indev=dshow --enable-protocol=file
BUILD_COMMAND make -j ${N}
INSTALL_COMMAND make install
)
set(FFMPEG_LIB_AVFORMAT "${CMAKE_CURRENT_BINARY_DIR}/ffmpeg/windows/x86_64/lib/libavformat.a")
set(FFMPEG_LIB_AVCODEC "${CMAKE_CURRENT_BINARY_DIR}/ffmpeg/windows/x86_64/lib/libavcodec.a")
set(FFMPEG_LIB_AVUTIL "${CMAKE_CURRENT_BINARY_DIR}/ffmpeg/windows/x86_64/lib/libavutil.a")
set(FFMPEG_LIB_SWSCALE "${CMAKE_CURRENT_BINARY_DIR}/ffmpeg/windows/x86_64/lib/libswscale.a")
set(FFMPEG_LIB_SWRESAMPLE "${CMAKE_CURRENT_BINARY_DIR}/ffmpeg/windows/x86_64/lib/libswresample.a")
target_link_directories(3rdparty_ffmpeg INTERFACE "${CMAKE_CURRENT_BINARY_DIR}/ffmpeg/windows/x86_64/lib")
target_link_libraries(3rdparty_ffmpeg INTERFACE avformat avcodec avutil swscale swresample iconv)
else()
message("-- RPCS3: using builtin ffmpeg")
message(STATUS "RPCS3: using builtin ffmpeg")
if (WIN32)
set(FFMPEG_LIB_DIR "ffmpeg/windows/x86_64")
target_link_libraries(3rdparty_ffmpeg INTERFACE "Bcrypt.lib")
elseif(CMAKE_SYSTEM MATCHES "Linux")
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(FFMPEG_LIB_DIR "ffmpeg/linux/x86_64")
elseif(APPLE)
set(FFMPEG_LIB_DIR "ffmpeg/macos/x86_64")
@@ -304,31 +302,31 @@ else()
find_library(FFMPEG_LIB_AVUTIL avutil PATHS ${FFMPEG_LIB_DIR} NO_DEFAULT_PATH)
find_library(FFMPEG_LIB_SWSCALE swscale PATHS ${FFMPEG_LIB_DIR} NO_DEFAULT_PATH)
find_library(FFMPEG_LIB_SWRESAMPLE swresample PATHS ${FFMPEG_LIB_DIR} NO_DEFAULT_PATH)
endif()
target_include_directories(3rdparty_ffmpeg INTERFACE "ffmpeg/include")
target_link_libraries(3rdparty_ffmpeg
target_link_libraries(3rdparty_ffmpeg
INTERFACE
${FFMPEG_LIB_AVFORMAT}
${FFMPEG_LIB_AVCODEC}
${FFMPEG_LIB_AVUTIL}
${FFMPEG_LIB_SWSCALE}
${FFMPEG_LIB_SWRESAMPLE}
)
)
endif()
target_include_directories(3rdparty_ffmpeg INTERFACE "ffmpeg/include")
endif()
# GLEW
add_library(3rdparty_glew INTERFACE)
if(NOT MSVC)
find_package(GLEW 1.13.0 REQUIRED)
find_package(GLEW REQUIRED)
target_link_libraries(3rdparty_glew INTERFACE GLEW::GLEW)
endif()
# LLVM
include(llvm.cmake)
add_subdirectory(llvm EXCLUDE_FROM_ALL)
# WOLFSSL
add_subdirectory(wolfssl EXCLUDE_FROM_ALL)
@@ -345,6 +343,8 @@ if(USE_SDL)
message(STATUS "Using system SDL2")
add_library(3rdparty_sdl2 INTERFACE)
target_compile_definitions(3rdparty_sdl2 INTERFACE -DHAVE_SDL2=1)
target_include_directories(3rdparty_sdl2 INTERFACE ${SDL2_INCLUDE_DIRS})
target_link_libraries(3rdparty_sdl2 INTERFACE ${SDL2_LIBRARIES})
set(SDL2_TARGET 3rdparty_sdl2)
else()
message(FATAL_ERROR "SDL2 is not available on this system")
@@ -361,6 +361,9 @@ endif()
# MINIUPNP
add_subdirectory(miniupnp EXCLUDE_FROM_ALL)
# RTMIDI
add_subdirectory(rtmidi EXCLUDE_FROM_ALL)
# add nice ALIAS targets for ease of use
if(USE_SYSTEM_LIBUSB)
add_library(3rdparty::libusb ALIAS usb-1.0-shared)
@@ -389,3 +392,4 @@ add_library(3rdparty::libcurl ALIAS libcurl)
add_library(3rdparty::soundtouch ALIAS soundtouch)
add_library(3rdparty::sdl2 ALIAS ${SDL2_TARGET})
add_library(3rdparty::miniupnpc ALIAS libminiupnpc-static)
add_library(3rdparty::rtmidi ALIAS rtmidi)
+1 -1
View File
@@ -4,7 +4,7 @@ include(ExternalProject)
ExternalProject_Add(moltenvk
GIT_REPOSITORY https://github.com/KhronosGroup/MoltenVK.git
GIT_TAG fb581e4
GIT_TAG 4c6bfbe
BUILD_IN_SOURCE 1
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/MoltenVK
CONFIGURE_COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/MoltenVK/fetchDependencies" --macos
+1 -1
View File
@@ -1,5 +1,5 @@
# OpenAL
if (MSVC)
if (WIN32)
find_path(OPENAL_INCLUDE_DIR al.h PATHS include/)
find_library(OPENAL_LIBRARY OpenAL32 PATHS libs/Win64/)
else()
+1
View File
@@ -70,6 +70,7 @@
<PreprocessorDefinitions>SOUNDTOUCH_ALLOW_SSE;ST_NO_EXCEPTION_HANDLING;USE_MULTICH_ALWAYS;SOUNDTOUCH_FLOAT_SAMPLES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>./soundtouch/source/SoundTouch;./soundtouch/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DebugInformationFormat Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">ProgramDatabase</DebugInformationFormat>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
</ClCompile>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+1
View File
@@ -187,6 +187,7 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PreprocessorDefinitions>ASMJIT_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release'">MaxSpeed</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
</ClCompile>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+1
View File
@@ -79,6 +79,7 @@
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>OUTSIDE_SPEEX;RANDOM_PREFIX=speex;FLOATING_POINT;_USE_SSE;_USE_SSE2;EXPORT=;USE_WASAPI;USE_WINMM;CUBEB_WASAPI_USE_IAUDIOSTREAMVOLUME;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>./cubeb/subprojects/;./extra/;./cubeb/src/;./cubeb/include/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
</ClCompile>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+22 -10
View File
@@ -1,24 +1,36 @@
# CURL
if(USE_SYSTEM_CURL)
message("-- RPCS3: using shared libcurl")
message(STATUS "RPCS3: using shared libcurl")
find_package(CURL REQUIRED)
add_library(libcurl INTERFACE)
target_link_libraries(libcurl INTERFACE CURL::libcurl)
else()
message("-- RPCS3: building libcurl + wolfssl submodules")
add_compile_definitions(HAVE_SNI OPENSSL_EXTRA)
option(BUILD_CURL_EXE "Set to ON to build curl executable." OFF)
option(CURL_USE_WOLFSSL "enable wolfSSL for SSL/TLS" ON)
option(HTTP_ONLY "disables all protocols except HTTP (This overrides all CURL_DISABLE_* options)" ON)
option(CURL_ZLIB "Set to ON to enable building curl with zlib support." OFF)
option(USE_LIBIDN2 "Use libidn2 for IDN support" OFF) # Disabled because MacOs CI doesn't work otherwise
message(STATUS "RPCS3: building libcurl + wolfssl submodules")
set(BUILD_CURL_EXE OFF CACHE BOOL "Set to ON to build curl executable.")
# If set to ON then CURL can not find our wolfssl
set(CURL_USE_WOLFSSL OFF CACHE BOOL "enable wolfSSL for SSL/TLS")
set(CURL_USE_OPENSSL OFF CACHE BOOL "Use OpenSSL code. Experimental")
set(HTTP_ONLY ON CACHE BOOL "disables all protocols except HTTP (This overrides all CURL_DISABLE_* options)")
set(USE_LIBIDN2 OFF CACHE BOOL "Use libidn2 for IDN support") # Disabled because MacOS CI doesn't work otherwise
set(CURL_CA_PATH "none" CACHE STRING "Location of default CA path. Set 'none' to disable or 'auto' for auto-detection. Defaults to 'auto'.")
if(USE_MSVC_STATIC_CRT)
set(CURL_STATIC_CRT ON CACHE BOOL "Use static crt to build curl" FORCE)
set(CURL_STATIC_CRT ON CACHE BOOL "Use static crt to build curl")
endif()
if(WIN32)
set(ENABLE_UNICODE ON CACHE BOOL "enable Unicode")
endif()
set(CURL_USE_LIBSSH2 OFF CACHE BOOL "Use libSSH2")
set(CURL_USE_LIBPSL OFF CACHE BOOL "Use libPSL")
set(SSL_ENABLED ON)
set(USE_WOLFSSL ON)
add_subdirectory(curl EXCLUDE_FROM_ALL)
set_property(TARGET libcurl PROPERTY FOLDER "3rdparty/")
target_link_libraries(libcurl PRIVATE wolfssl)
if(MSVC)
target_compile_definitions(libcurl PRIVATE HAVE_SSIZE_T)
endif()
endif()
+25 -9
View File
@@ -64,8 +64,14 @@
<ClCompile Include="curl\lib\asyn-ares.c" />
<ClCompile Include="curl\lib\asyn-thread.c" />
<ClCompile Include="curl\lib\base64.c" />
<ClCompile Include="curl\lib\bufq.c" />
<ClCompile Include="curl\lib\bufref.c" />
<ClCompile Include="curl\lib\c-hyper.c" />
<ClCompile Include="curl\lib\cf-h1-proxy.c" />
<ClCompile Include="curl\lib\cf-h2-proxy.c" />
<ClCompile Include="curl\lib\cf-haproxy.c" />
<ClCompile Include="curl\lib\cf-https-connect.c" />
<ClCompile Include="curl\lib\cf-socket.c" />
<ClCompile Include="curl\lib\cfilters.c" />
<ClCompile Include="curl\lib\conncache.c" />
<ClCompile Include="curl\lib\connect.c" />
@@ -78,6 +84,7 @@
<ClCompile Include="curl\lib\curl_gethostname.c" />
<ClCompile Include="curl\lib\curl_get_line.c" />
<ClCompile Include="curl\lib\curl_gssapi.c" />
<ClCompile Include="curl\lib\curl_log.c" />
<ClCompile Include="curl\lib\curl_memrchr.c" />
<ClCompile Include="curl\lib\curl_multibyte.c" />
<ClCompile Include="curl\lib\curl_ntlm_core.c" />
@@ -91,6 +98,7 @@
<ClCompile Include="curl\lib\dict.c" />
<ClCompile Include="curl\lib\doh.c" />
<ClCompile Include="curl\lib\dynbuf.c" />
<ClCompile Include="curl\lib\dynhds.c" />
<ClCompile Include="curl\lib\easy.c" />
<ClCompile Include="curl\lib\easygetopt.c" />
<ClCompile Include="curl\lib\easyoptions.c" />
@@ -104,7 +112,6 @@
<ClCompile Include="curl\lib\getenv.c" />
<ClCompile Include="curl\lib\getinfo.c" />
<ClCompile Include="curl\lib\gopher.c" />
<ClCompile Include="curl\lib\h2h3.c" />
<ClCompile Include="curl\lib\hash.c" />
<ClCompile Include="curl\lib\headers.c" />
<ClCompile Include="curl\lib\hmac.c" />
@@ -115,6 +122,7 @@
<ClCompile Include="curl\lib\hostsyn.c" />
<ClCompile Include="curl\lib\hsts.c" />
<ClCompile Include="curl\lib\http.c" />
<ClCompile Include="curl\lib\http1.c" />
<ClCompile Include="curl\lib\http2.c" />
<ClCompile Include="curl\lib\http_aws_sigv4.c" />
<ClCompile Include="curl\lib\http_chunks.c" />
@@ -179,11 +187,13 @@
<ClCompile Include="curl\lib\vauth\gsasl.c" />
<ClCompile Include="curl\lib\version.c" />
<ClCompile Include="curl\lib\version_win32.c" />
<ClCompile Include="curl\lib\vquic\curl_msh3.c" />
<ClCompile Include="curl\lib\vquic\curl_ngtcp2.c" />
<ClCompile Include="curl\lib\vquic\curl_quiche.c" />
<ClCompile Include="curl\lib\vtls\hostcheck.c" />
<ClCompile Include="curl\lib\vtls\rustls.c" />
<ClCompile Include="curl\lib\vtls\x509asn1.c" />
<ClCompile Include="curl\lib\warnless.c" />
<ClCompile Include="curl\lib\wildcard.c" />
<ClCompile Include="curl\lib\vauth\cleartext.c" />
<ClCompile Include="curl\lib\vauth\cram.c" />
<ClCompile Include="curl\lib\vauth\digest.c" />
@@ -196,8 +206,6 @@
<ClCompile Include="curl\lib\vauth\spnego_gssapi.c" />
<ClCompile Include="curl\lib\vauth\spnego_sspi.c" />
<ClCompile Include="curl\lib\vauth\vauth.c" />
<ClCompile Include="curl\lib\vquic\ngtcp2.c" />
<ClCompile Include="curl\lib\vquic\quiche.c" />
<ClCompile Include="curl\lib\vquic\vquic.c" />
<ClCompile Include="curl\lib\vssh\libssh.c" />
<ClCompile Include="curl\lib\vssh\libssh2.c" />
@@ -231,8 +239,14 @@
<ClInclude Include="curl\lib\amigaos.h" />
<ClInclude Include="curl\lib\arpa_telnet.h" />
<ClInclude Include="curl\lib\asyn.h" />
<ClInclude Include="curl\lib\bufq.h" />
<ClInclude Include="curl\lib\bufref.h" />
<ClInclude Include="curl\lib\c-hyper.h" />
<ClInclude Include="curl\lib\cf-h1-proxy.h" />
<ClInclude Include="curl\lib\cf-h2-proxy.h" />
<ClInclude Include="curl\lib\cf-haproxy.h" />
<ClInclude Include="curl\lib\cf-https-connect.h" />
<ClInclude Include="curl\lib\cf-socket.h" />
<ClInclude Include="curl\lib\cfilters.h" />
<ClInclude Include="curl\lib\config-amigaos.h" />
<ClInclude Include="curl\lib\config-dos.h" />
@@ -259,6 +273,7 @@
<ClInclude Include="curl\lib\curl_hmac.h" />
<ClInclude Include="curl\lib\curl_krb5.h" />
<ClInclude Include="curl\lib\curl_ldap.h" />
<ClInclude Include="curl\lib\curl_log.h" />
<ClInclude Include="curl\lib\curl_md4.h" />
<ClInclude Include="curl\lib\curl_md5.h" />
<ClInclude Include="curl\lib\curl_memory.h" />
@@ -280,6 +295,7 @@
<ClInclude Include="curl\lib\doh.h" />
<ClInclude Include="curl\lib\dotdot.h" />
<ClInclude Include="curl\lib\dynbuf.h" />
<ClInclude Include="curl\lib\dynhds.h" />
<ClInclude Include="curl\lib\easyif.h" />
<ClInclude Include="curl\lib\easyoptions.h" />
<ClInclude Include="curl\lib\easy_lock.h" />
@@ -293,12 +309,12 @@
<ClInclude Include="curl\lib\functypes.h" />
<ClInclude Include="curl\lib\getinfo.h" />
<ClInclude Include="curl\lib\gopher.h" />
<ClInclude Include="curl\lib\h2h3.h" />
<ClInclude Include="curl\lib\hash.h" />
<ClInclude Include="curl\lib\headers.h" />
<ClInclude Include="curl\lib\hostip.h" />
<ClInclude Include="curl\lib\hsts.h" />
<ClInclude Include="curl\lib\http.h" />
<ClInclude Include="curl\lib\http1.h" />
<ClInclude Include="curl\lib\http2.h" />
<ClInclude Include="curl\lib\http_aws_sigv4.h" />
<ClInclude Include="curl\lib\http_chunks.h" />
@@ -325,7 +341,6 @@
<ClInclude Include="curl\lib\pop3.h" />
<ClInclude Include="curl\lib\progress.h" />
<ClInclude Include="curl\lib\psl.h" />
<ClInclude Include="curl\lib\quic.h" />
<ClInclude Include="curl\lib\rand.h" />
<ClInclude Include="curl\lib\rename.h" />
<ClInclude Include="curl\lib\rtsp.h" />
@@ -360,16 +375,17 @@
<ClInclude Include="curl\lib\urlapi-int.h" />
<ClInclude Include="curl\lib\urldata.h" />
<ClInclude Include="curl\lib\version_win32.h" />
<ClInclude Include="curl\lib\vquic\curl_msh3.h" />
<ClInclude Include="curl\lib\vquic\curl_ngtcp2.h" />
<ClInclude Include="curl\lib\vquic\curl_quiche.h" />
<ClInclude Include="curl\lib\vquic\vquic_int.h" />
<ClInclude Include="curl\lib\vtls\hostcheck.h" />
<ClInclude Include="curl\lib\vtls\rustls.h" />
<ClInclude Include="curl\lib\vtls\x509asn1.h" />
<ClInclude Include="curl\lib\warnless.h" />
<ClInclude Include="curl\lib\wildcard.h" />
<ClInclude Include="curl\lib\vauth\digest.h" />
<ClInclude Include="curl\lib\vauth\ntlm.h" />
<ClInclude Include="curl\lib\vauth\vauth.h" />
<ClInclude Include="curl\lib\vquic\ngtcp2.h" />
<ClInclude Include="curl\lib\vquic\quiche.h" />
<ClInclude Include="curl\lib\vquic\vquic.h" />
<ClInclude Include="curl\lib\vssh\ssh.h" />
<ClInclude Include="curl\lib\vssh\wolfssh.h" />
+75 -27
View File
@@ -330,9 +330,6 @@
<ClCompile Include="curl\lib\warnless.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\wildcard.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vauth\cleartext.c">
<Filter>Source Files</Filter>
</ClCompile>
@@ -369,12 +366,6 @@
<ClCompile Include="curl\lib\vauth\vauth.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vquic\ngtcp2.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vquic\quiche.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vssh\libssh.c">
<Filter>Source Files</Filter>
</ClCompile>
@@ -456,9 +447,6 @@
<ClCompile Include="curl\lib\vauth\gsasl.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\h2h3.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vtls\hostcheck.c">
<Filter>Source Files</Filter>
</ClCompile>
@@ -486,6 +474,42 @@
<ClCompile Include="curl\lib\idn.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\curl_log.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\cf-https-connect.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\cf-socket.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vquic\curl_msh3.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vquic\curl_ngtcp2.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vquic\curl_quiche.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\http1.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\dynhds.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\bufq.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\cf-h1-proxy.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\cf-h2-proxy.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\cf-haproxy.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="curl\include\curl\curl.h">
@@ -764,9 +788,6 @@
<ClInclude Include="curl\lib\psl.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\quic.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\rand.h">
<Filter>Header Files</Filter>
</ClInclude>
@@ -863,9 +884,6 @@
<ClInclude Include="curl\lib\warnless.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\wildcard.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\vauth\digest.h">
<Filter>Header Files</Filter>
</ClInclude>
@@ -875,12 +893,6 @@
<ClInclude Include="curl\lib\vauth\vauth.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\vquic\ngtcp2.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\vquic\quiche.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\vssh\ssh.h">
<Filter>Header Files</Filter>
</ClInclude>
@@ -956,9 +968,6 @@
<ClInclude Include="curl\lib\vtls\rustls.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\h2h3.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\vtls\hostcheck.h">
<Filter>Header Files</Filter>
</ClInclude>
@@ -992,6 +1001,45 @@
<ClInclude Include="curl\lib\idn.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\curl_log.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\cf-https-connect.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\cf-socket.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\vquic\curl_msh3.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\vquic\curl_ngtcp2.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\vquic\curl_quiche.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\vquic\vquic_int.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\http1.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\dynhds.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\bufq.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\cf-h1-proxy.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\cf-h2-proxy.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\cf-haproxy.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="curl\lib\libcurl.rc">
+1 -1
View File
@@ -14,7 +14,7 @@ if(APPLE)
elseif(CMAKE_SYSTEM MATCHES "Linux")
target_link_libraries(3rdparty_hidapi INTERFACE hidapi-hidraw udev)
elseif(WIN32)
target_link_libraries(3rdparty_hidapi INTERFACE hidapi-hid Shlwapi.lib)
target_link_libraries(3rdparty_hidapi INTERFACE hidapi::hidapi hidapi::include Shlwapi.lib)
else()
target_link_libraries(3rdparty_hidapi INTERFACE hidapi-libusb usb)
endif()
+5 -4
View File
@@ -2,14 +2,15 @@
# Select the version of libpng to use, default is builtin
if (NOT USE_SYSTEM_LIBPNG)
# We use libpng's static library and don't need to build the shared library and run the tests
set(PNG_SHARED OFF CACHE BOOL "Build shared lib" FORCE)
set(PNG_TESTS OFF CACHE BOOL "Build libpng tests" FORCE)
set(PNG_BUILD_ZLIB ON CACHE BOOL "ZLIB is already build or package is found" FORCE)
set(PNG_SHARED OFF CACHE BOOL "Build shared lib")
set(PNG_TESTS OFF CACHE BOOL "Build libpng tests")
set(PNG_BUILD_ZLIB ON CACHE BOOL "ZLIB is already build or package is found")
set(SKIP_INSTALL_ALL ON)
add_subdirectory(libpng EXCLUDE_FROM_ALL)
target_include_directories(png_static INTERFACE "${libpng_BINARY_DIR}" "${libpng_SOURCE_DIR}")
target_link_libraries(png_static 3rdparty::zlib)
set(LIBPNG_TARGET png_static PARENT_SCOPE)
set(LIBPNG_TARGET png_static PARENT_SCOPE)
else()
find_package(PNG REQUIRED)
+1
View File
@@ -453,6 +453,7 @@
<SDLCheck>false</SDLCheck>
<AdditionalIncludeDirectories>SDL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DebugInformationFormat Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">ProgramDatabase</DebugInformationFormat>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
</ClCompile>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+1 -1
View File
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.4)
cmake_minimum_required(VERSION 3.0)
project(libusb)
+5 -1
View File
@@ -89,7 +89,11 @@ set(PACKAGE_URL "http://www.libusb.org" CACHE INTERNAL "package url" FORCE)
set(PACKAGE_TARNAME "libusb" CACHE INTERNAL "tarball name" FORCE)
set(VERSION "${PACKAGE_VERSION}" CACHE INTERNAL "version" FORCE)
configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h @ONLY)
if(MSVC)
file(COPY libusb/msvc/config.h DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
else()
configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h @ONLY)
endif()
message(STATUS "Generated configuration file in ${CMAKE_CURRENT_BINARY_DIR}/config.h")
# for generated config.h
+8 -17
View File
@@ -3,22 +3,6 @@ include(os.cmake)
include(config.cmake)
include(FindThreads)
set (LIBUSB_COMMON
core.c
descriptor.c
io.c
sync.c
hotplug.c
strerror.c
libusb-1.0.rc
libusb-1.0.def
)
foreach(SRC IN LISTS LIBUSB_COMMON)
list(APPEND LIBUSB_COMMON_FINAL ${LIBUSB_SOURCE_DIR}/libusb/${SRC})
endforeach()
include_directories(${LIBUSB_SOURCE_DIR}/libusb)
include_directories(${LIBUSB_SOURCE_DIR}/libusb/os)
@@ -28,7 +12,14 @@ endif()
add_library(usb-1.0-static
STATIC
${LIBUSB_COMMON_FINAL}
libusb/libusb/core.c
libusb/libusb/descriptor.c
libusb/libusb/io.c
libusb/libusb/sync.c
libusb/libusb/hotplug.c
libusb/libusb/strerror.c
libusb/libusb/libusb-1.0.rc
libusb/libusb/libusb-1.0.def
${LIBUSB_PLATFORM}
)
+22 -21
View File
@@ -5,42 +5,43 @@ if (CMAKE_USE_PTHREADS_INIT)
set(PTHREADS_ENABLED TRUE)
endif()
if (WIN32 OR "${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
if (CYGWIN)
add_compile_definitions(PLATFORM_WINDOWS=1)
set(OS_WINDOWS 1 CACHE INTERNAL "controls config.h macro definition" FORCE)
set(OS_WINDOWS 1)
# Enable MingW support for RC language (for CMake pre-2.8)
if (MINGW)
set(CMAKE_RC_COMPILER_INIT windres)
set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> <FLAGS> -O coff <DEFINES> -i <SOURCE> -o <OBJECT>")
endif()
enable_language(RC)
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
message(STATUS "Detected cygwin")
set(PTHREADS_ENABLED TRUE)
set(WITHOUT_POLL_H TRUE CACHE INTERNAL "Disable using poll.h even if it's available - use windows poll instead fo cygwin's" FORCE)
endif()
message(STATUS "Detected Cygwin")
set(PTHREADS_ENABLED TRUE)
set(WITHOUT_POLL_H TRUE)
list(APPEND PLATFORM_SRC
events_windows.c
windows_usbdk.c
windows_common.c
windows_winusb.c
threads_windows.c
)
if (PTHREADS_ENABLED AND NOT WITHOUT_PTHREADS)
list(APPEND PLATFORM_SRC threads_posix)
else()
list(APPEND PLATFORM_SRC threads_windows.c)
endif()
elseif(WIN32)
add_compile_definitions(PLATFORM_WINDOWS=1)
set(OS_WINDOWS 1)
set(PTHREADS_ENABLED FALSE)
list(APPEND PLATFORM_SRC
events_windows.c
windows_usbdk.c
windows_common.c
windows_winusb.c
)
list(APPEND PLATFORM_SRC threads_windows.c)
elseif (APPLE)
# Apple != OSX alone
add_compile_definitions(PLATFORM_POSIX=1 HAVE_CLOCK_GETTIME)
set(OS_DARWIN 1 CACHE INTERNAL "controls config.h macro definition" FORCE)
set(OS_DARWIN 1)
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(PLATFORM_SRC
darwin_usb.c
threads_posix.c
@@ -77,7 +78,7 @@ elseif (UNIX)
# Unix is for all *NIX systems including OSX
add_compile_definitions(PLATFORM_POSIX=1 HAVE_CLOCK_GETTIME)
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
set(OS_LINUX 1 CACHE INTERNAL "controls config.h macro definition" FORCE)
set(OS_LINUX 1)
set(PLATFORM_SRC
linux_usbfs.c
@@ -108,4 +109,4 @@ set(LIBUSB_LIBRARIES ${LIBUSB_LIBRARIES} PARENT_SCOPE)
if (WITHOUT_PTHREADS)
set(PTHREADS_ENABLED FALSE)
endif()
set(THREADS_POSIX ${PTHREADS_ENABLED} CACHE INTERNAL "use pthreads" FORCE)
set(THREADS_POSIX ${PTHREADS_ENABLED})
-93
View File
@@ -1,93 +0,0 @@
if(WITH_LLVM)
CHECK_CXX_COMPILER_FLAG("-msse -msse2 -mcx16" COMPILER_X86)
CHECK_CXX_COMPILER_FLAG("-march=armv8-a+lse" COMPILER_ARM)
if(BUILD_LLVM_SUBMODULE)
message(STATUS "LLVM will be built from the submodule.")
set(LLVM_TARGETS_TO_BUILD "AArch64;X86")
option(LLVM_BUILD_RUNTIME OFF)
option(LLVM_BUILD_TOOLS OFF)
option(LLVM_INCLUDE_BENCHMARKS OFF)
option(LLVM_INCLUDE_DOCS OFF)
option(LLVM_INCLUDE_EXAMPLES OFF)
option(LLVM_INCLUDE_TESTS OFF)
option(LLVM_INCLUDE_TOOLS OFF)
option(LLVM_INCLUDE_UTILS OFF)
option(LLVM_CCACHE_BUILD ON)
if(WIN32)
set(LLVM_USE_INTEL_JITEVENTS ON)
endif()
if(CMAKE_SYSTEM MATCHES "Linux")
set(LLVM_USE_INTEL_JITEVENTS ON)
set(LLVM_USE_PERF ON)
endif()
set(CXX_FLAGS_OLD ${CMAKE_CXX_FLAGS})
if (MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS")
endif()
# LLVM needs to be built out-of-tree
add_subdirectory(${CMAKE_SOURCE_DIR}/llvm ${CMAKE_CURRENT_BINARY_DIR}/llvm_build EXCLUDE_FROM_ALL)
set(LLVM_DIR "${CMAKE_CURRENT_BINARY_DIR}/llvm_build/lib/cmake/llvm/")
set(CMAKE_CXX_FLAGS ${CXX_FLAGS_OLD})
# now tries to find LLVM again
find_package(LLVM 13.0 CONFIG)
if(NOT LLVM_FOUND)
message(FATAL_ERROR "Couldn't build LLVM from the submodule. You might need to run `git submodule update --init`")
endif()
else()
message(STATUS "Using prebuilt LLVM")
if (LLVM_DIR AND NOT IS_ABSOLUTE "${LLVM_DIR}")
# change relative LLVM_DIR to be relative to the source dir
set(LLVM_DIR ${CMAKE_SOURCE_DIR}/${LLVM_DIR})
endif()
find_package(LLVM 13.0 CONFIG)
if (NOT LLVM_FOUND)
if (LLVM_VERSION AND LLVM_VERSION_MAJOR LESS 11)
message(FATAL_ERROR "Found LLVM version ${LLVM_VERSION}. Required version 11.0. \
Enable BUILD_LLVM_SUBMODULE option to build LLVM from included as a git submodule.")
endif()
message(FATAL_ERROR "Can't find LLVM libraries from the CMAKE_PREFIX_PATH path or LLVM_DIR. \
Enable BUILD_LLVM_SUBMODULE option to build LLVM from included as a git submodule.")
endif()
endif()
set(LLVM_LIBS LLVMMCJIT)
if(COMPILER_X86)
set(LLVM_LIBS ${LLVM_LIBS} LLVMX86CodeGen LLVMX86AsmParser)
endif()
if(COMPILER_ARM)
set(LLVM_LIBS ${LLVM_LIBS} LLVMX86CodeGen LLVMX86AsmParser LLVMAArch64CodeGen LLVMAArch64AsmParser)
endif()
if(WIN32 OR CMAKE_SYSTEM MATCHES "Linux")
set(LLVM_LIBS ${LLVM_LIBS} LLVMIntelJITEvents)
endif()
if(CMAKE_SYSTEM MATCHES "Linux")
set(LLVM_LIBS ${LLVM_LIBS} LLVMPerfJITEvents)
endif()
add_library(3rdparty_llvm INTERFACE)
target_link_libraries(3rdparty_llvm INTERFACE ${LLVM_LIBS})
target_include_directories(3rdparty_llvm INTERFACE ${LLVM_INCLUDE_DIRS})
target_compile_definitions(3rdparty_llvm INTERFACE ${LLVM_DEFINITIONS} -DLLVM_AVAILABLE)
add_library(3rdparty::llvm ALIAS 3rdparty_llvm)
else()
add_library(3rdparty::llvm ALIAS 3rdparty_dummy_lib)
endif()
+99
View File
@@ -0,0 +1,99 @@
if(WITH_LLVM)
check_cxx_compiler_flag("-msse -msse2 -mcx16" COMPILER_X86)
check_cxx_compiler_flag("-march=armv8-a+lse" COMPILER_ARM)
if(BUILD_LLVM)
message(STATUS "LLVM will be built from the submodule.")
set(LLVM_TARGETS_TO_BUILD "AArch64;X86" CACHE STRING "Semicolon-separated list of targets to build, or \"all\".")
option(LLVM_BUILD_RUNTIME OFF)
option(LLVM_BUILD_TOOLS OFF)
option(LLVM_INCLUDE_BENCHMARKS OFF)
option(LLVM_INCLUDE_DOCS OFF)
option(LLVM_INCLUDE_EXAMPLES OFF)
option(LLVM_INCLUDE_TESTS OFF)
option(LLVM_INCLUDE_TOOLS OFF)
option(LLVM_INCLUDE_UTILS OFF)
# we globally enable ccache
set(LLVM_CCACHE_BUILD OFF CACHE BOOL "Set to ON for a ccache enabled build")
if(WIN32)
set(LLVM_USE_INTEL_JITEVENTS ON)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(LLVM_USE_INTEL_JITEVENTS ON)
set(LLVM_USE_PERF ON)
endif()
if (MSVC)
add_compile_definitions("$<$<COMPILE_LANGUAGE:CXX>:_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS>")
endif()
# LLVM needs to be built out-of-tree
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/llvm/llvm ${CMAKE_CURRENT_BINARY_DIR}/llvm_build EXCLUDE_FROM_ALL)
set(LLVM_DIR "${CMAKE_CURRENT_BINARY_DIR}/llvm_build/lib/cmake/llvm/")
set(STATIC_LINK_LLVM ON CACHE BOOL "Link against LLVM statically. This will get set to ON if you build LLVM from the submodule." FORCE)
# now tries to find LLVM again
find_package(LLVM 16.0 CONFIG)
if(NOT LLVM_FOUND)
message(FATAL_ERROR "Couldn't build LLVM from the submodule. You might need to run `git submodule update --init`")
endif()
else()
message(STATUS "Using prebuilt or system LLVM")
if (LLVM_DIR AND NOT IS_ABSOLUTE "${LLVM_DIR}")
# change relative LLVM_DIR to be relative to the source dir
set(LLVM_DIR ${CMAKE_SOURCE_DIR}/${LLVM_DIR})
endif()
find_package(LLVM 16.0 CONFIG)
if (NOT LLVM_FOUND)
if (LLVM_VERSION AND LLVM_VERSION_MAJOR LESS 16)
message(FATAL_ERROR "Found LLVM version ${LLVM_VERSION}. Required version 16. \
Enable BUILD_LLVM option to build LLVM from included as a git submodule.")
endif()
message(FATAL_ERROR "Can't find LLVM libraries from the CMAKE_PREFIX_PATH path or LLVM_DIR. \
Enable BUILD_LLVM option to build LLVM from included as a git submodule.")
endif()
endif()
if (STATIC_LINK_LLVM)
if (NOT DEFINED LLVM_TARGETS_TO_BUILD)
if(COMPILER_ARM)
set(LLVM_TARGETS_TO_BUILD "AArch64;X86" CACHE STRING "Semicolon-separated list of targets to build, or \"all\".")
else()
set(LLVM_TARGETS_TO_BUILD "X86" CACHE STRING "Semicolon-separated list of targets to build, or \"all\".")
endif()
endif()
if((WIN32 AND BUILD_LLVM) OR CMAKE_SYSTEM_NAME STREQUAL "Linux")
list (APPEND LLVM_ADDITIONAL_LIBS IntelJITEvents)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
list (APPEND LLVM_ADDITIONAL_LIBS PerfJITEvents)
endif()
llvm_map_components_to_libnames(LLVM_LIBS
${LLVM_TARGETS_TO_BUILD}
${LLVM_ADDITIONAL_LIBS}
Core
ExecutionEngine
MCJIT
)
else()
set(LLVM_LIBS LLVM)
endif()
add_library(3rdparty_llvm INTERFACE)
target_link_libraries(3rdparty_llvm INTERFACE ${LLVM_LIBS})
target_include_directories(3rdparty_llvm INTERFACE ${LLVM_INCLUDE_DIRS})
separate_arguments(LLVM_DEFINITIONS_LIST NATIVE_COMMAND ${LLVM_DEFINITIONS})
target_compile_definitions(3rdparty_llvm INTERFACE ${LLVM_DEFINITIONS_LIST} LLVM_AVAILABLE)
add_library(3rdparty::llvm ALIAS 3rdparty_llvm)
else()
add_library(3rdparty::llvm ALIAS 3rdparty_dummy_lib)
endif()
Vendored Submodule
+1
Submodule 3rdparty/llvm/llvm added at cd89023f79
@@ -14,9 +14,9 @@
<ProjectGuid>{8BC303AB-25BE-4276-8E57-73F171B2D672}</ProjectGuid>
<Keyword>MakeFileProj</Keyword>
</PropertyGroup>
<Import Project="..\buildfiles\msvc\common_default.props" />
<Import Project="$(SolutionDir)\buildfiles\msvc\common_default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="..\buildfiles\msvc\common_default_macros.props" />
<Import Project="$(SolutionDir)\buildfiles\msvc\common_default_macros.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Makefile</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
@@ -39,9 +39,9 @@
</ImportGroup>
<PropertyGroup Label="UserMacros">
<CmakeReleaseCLI>call vsdevcmd.bat -arch=amd64
cmake -G Ninja -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_INSTALL_PREFIX="./Release" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_DEFAULT_TARGET_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_HOST_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_TOOLS=OFF -DLLVM_INCLUDE_UTILS=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=$(WindowsTargetPlatformVersion) -DLLVM_USE_CRT_DEBUG=MTd -DLLVM_USE_CRT_RELEASE=MT -DLLVM_USE_INTEL_JITEVENTS=ON ../llvm</CmakeReleaseCLI>
cmake -G Ninja -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_INSTALL_PREFIX="./Release" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_DEFAULT_TARGET_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_HOST_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_BENCHMARKS=OFF -DLLVM_INCLUDE_UTILS=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=$(WindowsTargetPlatformVersion) -DLLVM_USE_CRT_DEBUG=MTd -DLLVM_USE_CRT_RELEASE=MT -DLLVM_USE_INTEL_JITEVENTS=ON ../llvm/llvm</CmakeReleaseCLI>
<CmakeDebugCLI>call vsdevcmd.bat -arch=amd64
cmake -G Ninja -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_INSTALL_PREFIX="./Debug" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_DEFAULT_TARGET_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_HOST_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_TOOLS=OFF -DLLVM_INCLUDE_UTILS=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=$(WindowsTargetPlatformVersion) -DLLVM_USE_CRT_DEBUG=MTd -DLLVM_USE_CRT_RELEASE=MT -DLLVM_USE_INTEL_JITEVENTS=ON ../llvm</CmakeDebugCLI>
cmake -G Ninja -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_INSTALL_PREFIX="./Debug" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_DEFAULT_TARGET_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_HOST_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_BENCHMARKS=OFF -DLLVM_INCLUDE_UTILS=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=$(WindowsTargetPlatformVersion) -DLLVM_USE_CRT_DEBUG=MTd -DLLVM_USE_CRT_RELEASE=MT -DLLVM_USE_INTEL_JITEVENTS=ON ../llvm/llvm</CmakeDebugCLI>
<CmakeCleanCLI>echo Cleaning..
for /F "delims= eol=|" %%f in ('
dir /b ^| findstr /V "[^.]*\build[^.]*\.vcxproj"') do (
@@ -14,9 +14,9 @@
<ProjectGuid>{A37E4273-85DB-4217-B775-CE971B87D9DF}</ProjectGuid>
<Keyword>MakeFileProj</Keyword>
</PropertyGroup>
<Import Project="..\buildfiles\msvc\common_default_clang_cl.props" />
<Import Project="$(SolutionDir)\buildfiles\msvc\common_default_clang_cl.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="..\buildfiles\msvc\common_default_macros.props" />
<Import Project="$(SolutionDir)\buildfiles\msvc\common_default_macros.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Makefile</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
@@ -39,9 +39,9 @@
</ImportGroup>
<PropertyGroup Label="UserMacros">
<CmakeReleaseCLI>call vsdevcmd.bat -arch=amd64
cmake -G Ninja -DCMAKE_CXX_COMPILER="clang-cl.exe" -DCMAKE_C_COMPILER="clang-cl.exe" -DCMAKE_BUILD_TYPE="Release" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_DEFAULT_TARGET_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_HOST_TRIPLE:STRING=x86_64-pc-windows-msvc -DCMAKE_INSTALL_PREFIX="./Release" -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_TOOLS=OFF -DLLVM_INCLUDE_UTILS=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=$(WindowsTargetPlatformVersion) -DLLVM_USE_CRT_DEBUG=MTd -DLLVM_USE_CRT_RELEASE=MT -DLLVM_USE_INTEL_JITEVENTS=ON ../llvm</CmakeReleaseCLI>
cmake -G Ninja -DCMAKE_CXX_COMPILER="clang-cl.exe" -DCMAKE_C_COMPILER="clang-cl.exe" -DCMAKE_BUILD_TYPE="Release" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_DEFAULT_TARGET_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_HOST_TRIPLE:STRING=x86_64-pc-windows-msvc -DCMAKE_INSTALL_PREFIX="./Release" -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_BENCHMARKS=OFF -DLLVM_INCLUDE_UTILS=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=$(WindowsTargetPlatformVersion) -DLLVM_USE_CRT_DEBUG=MTd -DLLVM_USE_CRT_RELEASE=MT -DLLVM_USE_INTEL_JITEVENTS=ON ../llvm/llvm</CmakeReleaseCLI>
<CmakeDebugCLI>call vsdevcmd.bat -arch=amd64
cmake -G Ninja -DCMAKE_CXX_COMPILER="clang-cl.exe" -DCMAKE_C_COMPILER="clang-cl.exe" -DCMAKE_BUILD_TYPE="Debug" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_DEFAULT_TARGET_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_HOST_TRIPLE:STRING=x86_64-pc-windows-msvc -DCMAKE_INSTALL_PREFIX="./Debug" -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_TOOLS=OFF -DLLVM_INCLUDE_UTILS=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=$(WindowsTargetPlatformVersion) -DLLVM_USE_CRT_DEBUG=MTd -DLLVM_USE_CRT_RELEASE=MT -DLLVM_USE_INTEL_JITEVENTS=ON ../llvm</CmakeDebugCLI>
cmake -G Ninja -DCMAKE_CXX_COMPILER="clang-cl.exe" -DCMAKE_C_COMPILER="clang-cl.exe" -DCMAKE_BUILD_TYPE="Debug" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_DEFAULT_TARGET_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_HOST_TRIPLE:STRING=x86_64-pc-windows-msvc -DCMAKE_INSTALL_PREFIX="./Debug" -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_BENCHMARKS=OFF -DLLVM_INCLUDE_UTILS=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=$(WindowsTargetPlatformVersion) -DLLVM_USE_CRT_DEBUG=MTd -DLLVM_USE_CRT_RELEASE=MT -DLLVM_USE_INTEL_JITEVENTS=ON ../llvm/llvm</CmakeDebugCLI>
<CmakeCleanCLI>echo Cleaning..
for /F "delims= eol=|" %%f in ('
dir /b ^| findstr /V "[^.]*\build[^.]*\.vcxproj"') do (
+16 -5
View File
@@ -12,24 +12,32 @@
#include <thread>
#include <sys/types.h>
#if _WIN32
#define read_portable(a, b, c) (recv(a, b, c, 0))
#define write_portable(a, b, c) (send(a, b, c, 0))
#define read_portable(a, b, c) (recv(a, b, ::narrow<int>(c), 0))
#define write_portable(a, b, c) (send(a, b, ::narrow<int>(c), 0))
#define close_portable(a) (closesocket(a))
#define bzero(b, len) (memset((b), '\0', (len)), (void)0)
#include <WinSock2.h>
#include <windows.h>
#include <ws2tcpip.h>
#else
#define read_portable(a, b, c) (read(a, b, c))
#define write_portable(a, b, c) (write(a, b, c))
#define close_portable(a) (close(a))
#include <sys/socket.h>
#include <sys/un.h>
#include <arpa/inet.h>
#include <poll.h>
#if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
#include <unistd.h>
#endif
#endif
#ifdef _WIN32
constexpr SOCKET invalid_socket = INVALID_SOCKET;
#else
constexpr int invalid_socket = -1;
#endif
namespace pine
{
/**
@@ -379,7 +387,7 @@ namespace pine
m_msgsock = accept(m_sock, 0, 0);
if (m_msgsock == -1)
if (m_msgsock == invalid_socket)
{
// everything else is non recoverable in our scope
// we also mark as recoverable socket errors where it would block a
@@ -533,10 +541,13 @@ namespace pine
// yes very good windows s/sun/sin/g sure is fine
server.sin_family = AF_INET;
// localhost only
server.sin_addr.s_addr = inet_addr("127.0.0.1");
if (!inet_pton(server.sin_family, "127.0.0.1", &server.sin_addr.s_addr))
{
fmt::throw_exception("IPC: Failed to convert localhost");
}
server.sin_port = htons(Impl::get_port());
if (bind(m_sock, (struct sockaddr*)&server, sizeof(server)) == SOCKET_ERROR)
if (bind(m_sock, reinterpret_cast<struct sockaddr*>(&server), sizeof(server)) == SOCKET_ERROR)
{
Impl::error("IPC: Error while binding to socket! Shutting down...");
return;
+2 -2
View File
@@ -20,7 +20,7 @@ endif()
if(NOT Qt5Widgets_FOUND)
if(Qt5Widgets_VERSION VERSION_LESS ${QT_MIN_VER})
message("Minimum supported Qt5 version is ${QT_MIN_VER}! You have version ${Qt5Widgets_VERSION} installed, please upgrade!")
if(CMAKE_SYSTEM MATCHES "Linux")
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
message(FATAL_ERROR "Most distros do not provide an up-to-date version of Qt.
If you're on Ubuntu or Linux Mint, there are PPAs you can use to install one of the latest qt5 versions.
Find the correct ppa at https://launchpad.net/~beineri and follow the instructions.")
@@ -35,7 +35,7 @@ Find the correct ppa at https://launchpad.net/~beineri and follow the instructio
if(WIN32)
message(FATAL_ERROR "Make sure the QTDIR env variable has been set properly. (for example C:\\Qt\\${QT_MIN_VER}\\msvc2019_64\\)
You can also try setting the Qt5_DIR preprocessor definiton.")
elseif(CMAKE_SYSTEM MATCHES "Linux")
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
message(FATAL_ERROR "Make sure to install your distro's qt5 package!")
else()
message(FATAL_ERROR "You need to have Qt5 installed, look online for instructions on installing Qt5 on ${CMAKE_SYSTEM}.")
File diff suppressed because it is too large Load Diff
+1
View File
@@ -0,0 +1 @@
add_subdirectory(rtmidi EXCLUDE_FROM_ALL)
Vendored Submodule
+1
Submodule 3rdparty/rtmidi/rtmidi added at 84a99422a3
+61
View File
@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClInclude Include="rtmidi\RtMidi.h" />
<ClInclude Include="rtmidi\rtmidi_c.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="rtmidi\RtMidi.cpp" />
<ClCompile Include="rtmidi\rtmidi_c.cpp" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{2C902C67-985C-4BE0-94A3-E0FE2EB929A3}</ProjectGuid>
<RootNamespace>rtmidi</RootNamespace>
</PropertyGroup>
<Import Project="$(SolutionDir)\buildfiles\msvc\common_default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(SolutionDir)\buildfiles\msvc\common_default_macros.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(SolutionDir)\buildfiles\msvc\rpcs3_default.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(SolutionDir)\buildfiles\msvc\rpcs3_debug.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(SolutionDir)\buildfiles\msvc\rpcs3_release.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup>
<ClCompile>
<WarningLevel>TurnOffAllWarnings</WarningLevel>
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>__WINDOWS_MM__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>./rtmidi/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DebugInformationFormat Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">ProgramDatabase</DebugInformationFormat>
</ClCompile>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
+17 -31
View File
@@ -1,40 +1,26 @@
if(USE_SYSTEM_WOLFSSL)
message("-- RPCS3: using shared wolfssl")
message(STATUS "RPCS3: using shared wolfssl")
pkg_check_modules(WolfSSL REQUIRED IMPORTED_TARGET wolfssl>=4.7.0)
add_library(wolfssl INTERFACE)
target_link_libraries(wolfssl INTERFACE PkgConfig::WolfSSL)
else()
# TODO(cjj19970505@live.cn)
# OPENSSL_EXTRA, and HAVE_SNI are unconfigurable from CMake cache.
# but they do have it in a TODO list (wolfssl/CMakeList, 1021)
add_compile_definitions(OPENSSL_EXTRA WOLFSSL_DES_ECB HAVE_SNI HAVE_WRITE_DUP)
add_compile_definitions(FP_MAX_BITS=8192)
set(WOLFSSL_TLS13 "no" CACHE INTERNAL "")
set(WOLFSSL_SHA224 "yes" CACHE INTERNAL "")
set(WOLFSSL_SHA3 "yes" CACHE INTERNAL "")
set(WOLFSSL_SHAKE256 "yes" CACHE INTERNAL "")
set(WOLFSSL_BASE64_ENCODE "no" CACHE INTERNAL "")
set(WOLFSSL_DES3 "yes" CACHE INTERNAL "")
set(WOLFSSL_POLY1305 "yes" CACHE INTERNAL "")
set(WOLFSSL_CHACHA "yes" CACHE INTERNAL "")
set(WOLFSSL_FILESYSTEM "yes" CACHE INTERNAL "")
set(WOLFSSL_PWDBASED "yes" CACHE INTERNAL "")
set(WOLFSSL_FAST_MATH "yes" CACHE INTERNAL "")
set(WOLFSSL_EXAMPLES "no" CACHE INTERNAL "")
set(WOLFSSL_CRYPT_TESTS "no" CACHE INTERNAL "")
set(WOLFSSL_ASYNC_THREADS "no" CACHE INTERNAL "")
set(WOLFSSL_CONFIG_H "no" CACHE INTERNAL "")
set(WOLFSSL_TLS13 OFF CACHE STRING "Enable wolfSSL TLS v1.3 (default: enabled)")
set(WOLFSSL_SHA3 ON CACHE STRING "Enable wolfSSL SHA-3 support (default: enabled on x86_64/aarch64)")
set(WOLFSSL_SHAKE256 ON CACHE STRING "Enable wolfSSL SHAKE256 support (default: enabled on x86_64/aarch64)")
set(WOLFSSL_BASE64_ENCODE OFF CACHE STRING "Enable Base64 encoding (default: enabled on x86_64)")
set(WOLFSSL_DES3 ON CACHE STRING "Enable DES3 (default: disabled)")
set(WOLFSSL_PWDBASED ON CACHE STRING "Enable PWDBASED (default: disabled)")
set(WOLFSSL_FAST_MATH ON CACHE STRING "Enable fast math ops (default: disabled)")
set(WOLFSSL_EXAMPLES OFF CACHE STRING "Enable examples (default: enabled)")
set(WOLFSSL_CRYPT_TESTS OFF CACHE STRING "Enable Crypt Bench/Test (default: enabled)")
set(WOLFSSL_ASYNC_THREADS OFF CACHE STRING "Enable Asynchronous Threading (default: enabled)")
set(WOLFSSL_BUILD_OUT_OF_TREE ON CACHE STRING "Don't generate files in the source tree (default: no)")
set(WOLFSSL_SNI ON CACHE STRING "Enable SNI (default: disabled)")
set(WOLFSSL_OPENSSLEXTRA ON CACHE STRING "Enable extra OpenSSL API, size+ (default: disabled)")
set(WOLFSSL_HARDEN OFF CACHE STRING "Enable Hardened build, Enables Timing Resistance and Blinding (default: enabled)")
add_subdirectory(wolfssl EXCLUDE_FROM_ALL)
set(WolfSSL_LIBRARY "$<TARGET_FILE:wolfssl>" CACHE INTERNAL "")
# "${CMAKE_CURRENT_SOURCE_DIR}/wolfssl/wolfssl/" provides openssl headers
# So that curl can be built on an environment where openssl headers are not provided
set(WolfSSL_INCLUDE_DIR
"${CMAKE_CURRENT_SOURCE_DIR}/wolfssl/"
"${CMAKE_CURRENT_SOURCE_DIR}/wolfssl/wolfssl/"
"${CMAKE_CURRENT_BINARY_DIR}/wolfssl/"
CACHE INTERNAL "")
target_compile_definitions(wolfssl PUBLIC WOLFSSL_DES_ECB HAVE_WRITE_DUP)
target_compile_definitions(wolfssl PUBLIC FP_MAX_BITS=8192)
endif()
+6
View File
@@ -37,6 +37,7 @@
#define NO_PSK
#define HAVE_EXTENDED_MASTER
#define WOLFSSL_SNIFFER
#define WOLFSSL_IGNORE_FILE_WARN
#define HAVE_AESGCM
#define HAVE_SUPPORTED_CURVES
#define HAVE_TLS_EXTENSIONS
@@ -63,11 +64,16 @@ extern FILE* wolfSSL_fopen_utf8(const char* name, const char* mode);
#define XFWRITE fwrite
#define XFCLOSE fclose
#define XSEEK_END SEEK_END
#define XSEEK_SET SEEK_SET
#define XBADFILE NULL
#define XFGETS fgets
#define XFPRINTF fprintf
#define XFFLUSH fflush
/* For some reason we need to define ssize_t */
#define HAVE_SSIZE_T
#define ssize_t __int64
#include <sys/stat.h>
extern int wolfSSL_stat_utf8(const char* path, struct _stat* buffer);
#define XSTAT wolfSSL_stat_utf8
+1
View File
@@ -73,6 +73,7 @@
<ItemGroup>
<ClCompile Include="wolfssl\src\crl.c" />
<ClCompile Include="wolfssl\src\internal.c" />
<ClCompile Include="wolfssl\src\ssl_asn1.c" />
<ClCompile Include="wolfssl\src\wolfio.c" />
<ClCompile Include="wolfssl\src\keys.c" />
<ClCompile Include="wolfssl\src\ocsp.c" />
+11 -9
View File
@@ -1,14 +1,16 @@
if (USE_SYSTEM_ZLIB)
message(STATUS "-- RPCS3: Using syztem ZLIB")
find_package(ZLIB QUIET)
message(STATUS "RPCS3: Using system ZLIB")
find_package(ZLIB QUIET)
add_library(3rdparty_zlib INTERFACE)
target_link_libraries(3rdparty_zlib INTERFACE ${ZLIB_LIBRARIES})
target_include_directories(3rdparty_zlib INTERFACE ${ZLIB_INCLUDE_DIRS})
else()
message(STATUS "-- RPCS3: Using builtin ZLIB")
message(STATUS "RPCS3: Using builtin ZLIB")
set(SKIP_INSTALL_ALL ON)
add_subdirectory(zlib EXCLUDE_FROM_ALL)
set(ZLIB_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/zlib" "${CMAKE_CURRENT_BINARY_DIR}/zlib")
set(ZLIB_LIBRARY zlibstatic)
endif()
add_library(3rdparty_zlib INTERFACE)
target_link_libraries(3rdparty_zlib INTERFACE ${ZLIB_LIBRARY})
target_include_directories(3rdparty_zlib INTERFACE ${ZLIB_INCLUDE_DIR})
add_library(3rdparty_zlib INTERFACE)
target_link_libraries(3rdparty_zlib INTERFACE zlibstatic)
target_include_directories(3rdparty_zlib INTERFACE zlib ${CMAKE_CURRENT_BINARY_DIR}/zlib)
endif()
+1 -1
View File
@@ -111,7 +111,7 @@ git submodule update --init
Open `rpcs3.sln`. The recommended build configuration is `Release`. (On older revisions: `Release - LLVM`)
You may want to download the precompiled [LLVM libs](https://github.com/RPCS3/llvm-mirror/releases/download/custom-build-win/llvmlibs_mt.7z) and extract them to the root rpcs3 folder (which contains `rpcs3.sln`), as well as download and extract the [additional libs](https://github.com/RPCS3/glslang/releases/download/custom-build-win/glslanglibs_mt.7z) to `lib\%CONFIGURATION%-x64\` to speed up compilation time (unoptimised/debug libs are currently not available precompiled).
You may want to download the precompiled [LLVM libs](https://github.com/RPCS3/llvm-mirror/releases/download/custom-build-win-16.0.1/llvmlibs_mt.7z) and extract them to `3rdparty\llvm\`, as well as download and extract the [additional libs](https://github.com/RPCS3/glslang/releases/download/custom-build-win/glslanglibs_mt.7z) to `lib\%CONFIGURATION%-x64\` to speed up compilation time (unoptimised/debug libs are currently not available precompiled).
If you're not using the precompiled libs, build the following projects in *__BUILD_BEFORE* folder by right-clicking on a project > *Build*.:
* glslang
+18 -21
View File
@@ -1,12 +1,14 @@
cmake_minimum_required(VERSION 3.16.9)
project(rpcs3)
project(rpcs3 LANGUAGES C CXX)
if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11)
message(FATAL_ERROR "RPCS3 requires at least gcc-11.")
endif()
elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.0)
message(FATAL_ERROR "RPCS3 requires at least clang-12.0.")
endif()
@@ -14,7 +16,8 @@ endif()
option(USE_NATIVE_INSTRUCTIONS "USE_NATIVE_INSTRUCTIONS makes rpcs3 compile with -march=native, which is useful for local builds, but not good for packages." ON)
option(WITH_LLVM "Enable usage of LLVM library" ON)
option(BUILD_LLVM_SUBMODULE "Build LLVM from git submodule" ON)
option(BUILD_LLVM "Build LLVM from git submodule" OFF)
option(STATIC_LINK_LLVM "Link against LLVM statically. This will get set to ON if you build LLVM from the submodule." OFF)
option(USE_FAUDIO "FAudio audio backend" ON)
option(USE_LIBEVDEV "libevdev-based joystick support" ON)
option(USE_DISCORD_RPC "Discord rich presence integration" OFF)
@@ -24,7 +27,7 @@ option(USE_PRECOMPILED_HEADERS "Use precompiled headers" OFF)
option(USE_SDL "Enables SDL input handler" OFF)
option(USE_SYSTEM_SDL "Prefer system SDL instead of the builtin one" OFF)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/buildfiles/cmake")
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/buildfiles/cmake")
include(CheckCXXCompilerFlag)
@@ -42,7 +45,7 @@ else()
endif()
if(CMAKE_BUILD_TYPE MATCHES "Debug" AND NOT MSVC)
add_definitions(-D_DEBUG)
add_compile_definitions(_DEBUG)
endif()
if(MSVC)
@@ -74,7 +77,7 @@ if(MSVC)
# TODO(cjj19970505@live.cn)
# offical QT uses dynamic CRT.
# When building our lib with static CRT and debug build type
# and linking with Qt with dynmaic CRT and debug build,
# and linking with Qt with dynamic CRT and debug build,
# error is encountered in runtime (which is expected).
# But building our lib with static CRT and release build type,
# and linking with Qt with dynamic CRT and release build seems to be working,
@@ -89,6 +92,7 @@ if(MSVC)
message(AUTHOR_WARNING "Debug build currently can not work with static CRT.")
endif()
endif()
add_compile_options(/MP)
endif()
if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
@@ -97,13 +101,12 @@ endif()
find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
set(CMAKE_CXX_COMPILER_LAUNCHER ccache)
endif()
if(WIN32)
add_definitions(-DUNICODE)
add_definitions(-D_WIN32_WINNT=0x0602)
add_compile_definitions(UNICODE)
add_compile_definitions(_WIN32_WINNT=0x0602)
endif()
if(APPLE AND CMAKE_OSX_ARCHITECTURES STREQUAL "arm64")
@@ -111,10 +114,7 @@ if(APPLE AND CMAKE_OSX_ARCHITECTURES STREQUAL "arm64")
link_directories(/opt/homebrew/lib)
endif()
# Warnings are silenced for 3rdparty code
set(CMAKE_CXX_FLAGS -w)
set(CMAKE_C_FLAGS -w)
set(LLVM_ENABLE_WARNINGS OFF CACHE BOOL "")
set(LLVM_ENABLE_WARNINGS OFF CACHE BOOL "Enable compiler warnings.")
if(MSVC)
add_compile_options(/wd4530 /utf-8) # C++ exception handler used, but unwind semantics are not enabled
@@ -122,9 +122,6 @@ endif()
add_subdirectory(3rdparty)
unset(CMAKE_CXX_FLAGS)
unset(CMAKE_C_FLAGS)
if (DISABLE_LTO)
if (CMAKE_C_FLAGS)
string(REGEX REPLACE "-flto[^ ]*" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
@@ -136,7 +133,7 @@ endif()
string(FIND "${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS}" "-flto" FOUND_LTO)
if (NOT FOUND_LTO EQUAL -1)
message(FATAL_ERROR "Rpcs3 doesn't support building with LTO, use -DDISABLE_LTO=TRUE to force-disable it")
message(FATAL_ERROR "RPCS3 doesn't support building with LTO, use -DDISABLE_LTO=TRUE to force-disable it")
endif()
if(NOT WIN32)
@@ -148,6 +145,6 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${PROJECT_BINARY_DIR}/bin")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${PROJECT_BINARY_DIR}/bin")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${PROJECT_BINARY_DIR}/bin")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
add_subdirectory(rpcs3)
set_directory_properties(PROPERTIES VS_STARTUP_PROJECT rpcs3)
+68
View File
@@ -0,0 +1,68 @@
{
"version": 3,
"configurePresets": [
{
"name": "gcc",
"generator": "Ninja",
"binaryDir": "build-gcc",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"USE_FAUDIO": "OFF",
"USE_SYSTEM_CURL": "OFF",
"USE_SYSTEM_ZLIB": "OFF",
"USE_SYSTEM_LIBPNG": "OFF",
"USE_NATIVE_INSTRUCTIONS": "ON",
"USE_PRECOMPILED_HEADERS": "ON",
"BUILD_LLVM": "OFF",
"STATIC_LINK_LLVM": "ON"
}
},
{
"name": "clang",
"generator": "Ninja",
"binaryDir": "build-clang64",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"USE_FAUDIO": "OFF",
"USE_SYSTEM_CURL": "OFF",
"USE_SYSTEM_ZLIB": "OFF",
"USE_SYSTEM_LIBPNG": "OFF",
"LLVM_ENABLE_LIBCXX": "ON",
"USE_NATIVE_INSTRUCTIONS": "ON",
"USE_PRECOMPILED_HEADERS": "ON",
"BUILD_LLVM": "OFF",
"STATIC_LINK_LLVM": "ON"
},
"environment": {
"CXX": "clang++",
"CC": "clang"
}
},
{
"name": "msvc",
"displayName": "Windows x64",
"generator": "Visual Studio 17 2022",
"binaryDir": "build-msvc",
"architecture": {
"value": "x64",
"strategy": "external"
},
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}",
"USE_FAUDIO": "OFF",
"USE_PRECOMPILED_HEADERS": "ON",
"USE_SYSTEM_ZLIB": "OFF",
"USE_NATIVE_INSTRUCTIONS": "ON",
"BUILD_LLVM": "ON",
"STATIC_LINK_LLVM": "ON"
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": {
"hostOS": [
"Windows"
]
}
}
}
]
}
+2 -2
View File
@@ -725,7 +725,7 @@ namespace CRCPP
{
while (size--)
{
#if defined(WIN32) || defined(_WIN32) || defined(WINCE)
#ifdef _MSC_VER
// Disable warning about data loss when doing (remainder >> CHAR_BIT) when
// remainder is one byte long. The algorithm is still correct in this case,
// though it's possible that one additional machine instruction will be executed.
@@ -733,7 +733,7 @@ namespace CRCPP
# pragma warning (disable : 4333)
#endif
remainder = (remainder >> CHAR_BIT) ^ lookupTable[static_cast<unsigned char>(remainder ^ *current++)];
#if defined(WIN32) || defined(_WIN32) || defined(WINCE)
#ifdef _MSC_VER
# pragma warning (pop)
#endif
}
+9 -3
View File
@@ -7,6 +7,12 @@
LOG_CHANNEL(cfg_log, "CFG");
template <>
void fmt_class_string<cfg::node>::format(std::string& out, u64 arg)
{
out += get_object(arg).to_string();
}
namespace cfg
{
_base::_base(type _type)
@@ -23,9 +29,9 @@ namespace cfg
{
for (const auto& node : owner->m_nodes)
{
if (node->get_name() == name)
if (node->get_name() == m_name)
{
cfg_log.fatal("Node already exists: %s", name);
cfg_log.fatal("Node already exists: %s", m_name);
}
}
@@ -61,7 +67,7 @@ bool try_to_int64(s64* out, std::string_view value, s64 min, s64 max)
{
if (value.empty())
{
if (out) cfg_log.error("cfg::try_to_uint64(): called with an empty string");
if (out) cfg_log.error("cfg::try_to_int64(): called with an empty string");
return false;
}
+5
View File
@@ -226,6 +226,11 @@ namespace cfg
return m_value;
}
T get_default() const
{
return def;
}
void set(T value)
{
m_value = value;
+152 -19
View File
@@ -130,6 +130,7 @@ static fs::error to_error(DWORD e)
case ERROR_NOT_READY: return fs::error::noent;
case ERROR_FILENAME_EXCED_RANGE: return fs::error::toolong;
case ERROR_DISK_FULL: return fs::error::nospace;
case ERROR_NOT_SAME_DEVICE: return fs::error::xdev;
default: return fs::error::unknown;
}
}
@@ -172,6 +173,7 @@ static fs::error to_error(int e)
case EROFS: return fs::error::readonly;
case EISDIR: return fs::error::isdir;
case ENOSPC: return fs::error::nospace;
case EXDEV: return fs::error::xdev;
default: return fs::error::unknown;
}
}
@@ -225,9 +227,9 @@ namespace fs
{
}
[[noreturn]] stat_t file_base::stat()
[[noreturn]] stat_t file_base::get_stat()
{
fmt::throw_exception("fs::file::stat() not supported.");
fmt::throw_exception("fs::file::get_stat() not supported.");
}
void file_base::sync()
@@ -244,6 +246,11 @@ namespace fs
#endif
}
file_id file_base::get_id()
{
return {};
}
u64 file_base::write_gather(const iovec_clone* buffers, u64 buf_count)
{
u64 total = 0;
@@ -272,6 +279,66 @@ namespace fs
return this->write(buf.get(), total);
}
file_id::operator bool() const
{
return !type.empty() && !data.empty();
}
// Test if identical
// For example: when LHS writes one byte to a file at X offset, RHS file be able to read that exact byte at X offset)
bool file_id::is_mirror_of(const file_id& rhs) const
{
// If either is an invalid ID we cannot compare safely, return false
return rhs && type == rhs.type && data == rhs.data;
}
// Test if both files point to the same file
// For example: if a file descriptor pointing to the complete file exists and is being truncated to 0 bytes from non-
// -zero size state: this has to affect both RHS and LHS files.
bool file_id::is_coherent_with(const file_id& rhs) const
{
struct id_view
{
std::string_view type_view;
std::basic_string_view<u8> data_view;
};
id_view _rhs{rhs.type, {rhs.data.data(), rhs.data.size()}};
id_view _lhs{type, {data.data(), data.size()}};
// Peek through fs::file wrappers
auto peek_wrapppers = [](id_view& id)
{
u64 offset_count = 0;
constexpr auto lv2_view = "lv2_file::file_view: "sv;
for (usz pos = 0; (pos = id.type_view.find(lv2_view, pos)) != umax; pos += lv2_view.size())
{
offset_count++;
}
// Remove offsets data
id.data_view.remove_suffix(sizeof(u64) * offset_count);
// Get last category identifier
if (usz sep = id.type_view.rfind(": "); sep != umax)
{
id.type_view.remove_prefix(sep + 2);
}
};
peek_wrapppers(_rhs);
peek_wrapppers(_lhs);
// If either is an invalid ID we cannot compare safely, return false
if (_rhs.type_view.empty() || _rhs.data_view.empty())
{
return false;
}
return _rhs.type_view == _lhs.type_view && _rhs.data_view == _lhs.data_view;
}
dir_base::~dir_base()
{
}
@@ -384,12 +451,12 @@ shared_ptr<fs::device_base> fs::set_virtual_device(const std::string& name, shar
return get_device_manager().set_device(name, std::move(device));
}
std::string fs::get_parent_dir(std::string_view path, u32 levels)
std::string_view fs::get_parent_dir_view(std::string_view path, u32 parent_level)
{
std::string_view result = path;
// Number of path components to remove
usz to_remove = levels;
usz to_remove = parent_level;
while (to_remove--)
{
@@ -432,10 +499,10 @@ std::string fs::get_parent_dir(std::string_view path, u32 levels)
return "/";
}
return std::string{result};
return result;
}
bool fs::stat(const std::string& path, stat_t& info)
bool fs::get_stat(const std::string& path, stat_t& info)
{
// Ensure consistent information on failure
info = {};
@@ -551,13 +618,13 @@ bool fs::stat(const std::string& path, stat_t& info)
bool fs::exists(const std::string& path)
{
fs::stat_t info{};
return fs::stat(path, info);
return fs::get_stat(path, info);
}
bool fs::is_file(const std::string& path)
{
fs::stat_t info{};
if (!fs::stat(path, info))
if (!fs::get_stat(path, info))
{
return false;
}
@@ -574,7 +641,7 @@ bool fs::is_file(const std::string& path)
bool fs::is_dir(const std::string& path)
{
fs::stat_t info{};
if (!fs::stat(path, info))
if (!fs::get_stat(path, info))
{
return false;
}
@@ -863,9 +930,20 @@ bool fs::copy_file(const std::string& from, const std::string& to, bool overwrit
if (::fcopyfile(input, output, 0, COPYFILE_ALL))
#elif defined(__linux__) || defined(__sun)
// sendfile will work with non-socket output (i.e. regular file) on Linux 2.6.33+
off_t bytes_copied = 0;
struct ::stat fileinfo = { 0 };
if (::fstat(input, &fileinfo) == -1 || ::sendfile(output, input, &bytes_copied, fileinfo.st_size) == -1)
bool result = ::fstat(input, &fileinfo) != -1;
if (result)
{
for (off_t bytes_copied = 0; bytes_copied < fileinfo.st_size; /* Do nothing, bytes_copied is increased by sendfile. */)
{
if (::sendfile(output, input, &bytes_copied, fileinfo.st_size - bytes_copied) == -1)
{
result = false;
break;
}
}
}
if (!result)
#else
#error "Native file copy implementation is missing"
#endif
@@ -1120,7 +1198,7 @@ fs::file::file(const std::string& path, bs_t<open_mode> mode)
CloseHandle(m_handle);
}
stat_t stat() override
stat_t get_stat() override
{
FILE_BASIC_INFO basic_info;
ensure(GetFileInformationByHandleEx(m_handle, FileBasicInfo, &basic_info, sizeof(FILE_BASIC_INFO))); // "file::stat"
@@ -1278,6 +1356,28 @@ fs::file::file(const std::string& path, bs_t<open_mode> mode)
{
return m_handle;
}
file_id get_id() override
{
file_id id{"windows_file"};
id.data.resize(sizeof(FILE_ID_INFO));
FILE_ID_INFO info;
if (!GetFileInformationByHandleEx(m_handle, FileIdInfo, &info, sizeof(info)))
{
// Try GetFileInformationByHandle as a fallback
BY_HANDLE_FILE_INFORMATION info2;
ensure(GetFileInformationByHandle(m_handle, &info2));
info = {};
info.VolumeSerialNumber = info2.dwVolumeSerialNumber;
std::memcpy(&info.FileId, &info2.nFileIndexHigh, 8);
}
std::memcpy(id.data.data(), &info, sizeof(info));
return id;
}
};
m_file = std::make_unique<windows_file>(handle);
@@ -1345,7 +1445,7 @@ fs::file::file(const std::string& path, bs_t<open_mode> mode)
::close(m_fd);
}
stat_t stat() override
stat_t get_stat() override
{
struct ::stat file_info;
ensure(::fstat(m_fd, &file_info) == 0); // "file::stat"
@@ -1470,6 +1570,19 @@ fs::file::file(const std::string& path, bs_t<open_mode> mode)
return m_fd;
}
file_id get_id() override
{
struct ::stat file_info;
ensure(::fstat(m_fd, &file_info) == 0); // "file::get_id"
file_id id{"unix_file"};
id.data.resize(sizeof(file_info.st_dev) + sizeof(file_info.st_ino));
std::memcpy(id.data.data(), &file_info.st_dev, sizeof(file_info.st_dev));
std::memcpy(id.data.data() + sizeof(file_info.st_dev), &file_info.st_ino, sizeof(file_info.st_ino));
return id;
}
u64 write_gather(const iovec_clone* buffers, u64 buf_count) override
{
static_assert(sizeof(iovec) == sizeof(iovec_clone), "Weird iovec size");
@@ -1495,7 +1608,7 @@ fs::file::file(const std::string& path, bs_t<open_mode> mode)
m_file = std::make_unique<unix_file>(fd);
if (mode & fs::isfile && !(mode & fs::write) && stat().is_directory)
if (mode & fs::isfile && !(mode & fs::write) && get_stat().is_directory)
{
m_file.reset();
g_tls_error = error::isdir;
@@ -1604,6 +1717,16 @@ fs::native_handle fs::file::get_handle() const
#endif
}
fs::file_id fs::file::get_id() const
{
if (m_file)
{
return m_file->get_id();
}
return {};
}
bool fs::dir::open(const std::string& path)
{
if (path.empty())
@@ -1646,7 +1769,7 @@ bool fs::dir::open(const std::string& path)
to_utf8(info.name, found.cFileName);
info.is_directory = (found.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0;
info.is_writable = (found.dwFileAttributes & FILE_ATTRIBUTE_READONLY) == 0;
info.size = ((u64)found.nFileSizeHigh << 32) | (u64)found.nFileSizeLow;
info.size = (static_cast<u64>(found.nFileSizeHigh) << 32) | static_cast<u64>(found.nFileSizeLow);
info.atime = to_time(found.ftLastAccessTime);
info.mtime = to_time(found.ftLastWriteTime);
info.ctime = info.mtime;
@@ -1783,7 +1906,7 @@ const std::string& fs::get_config_dir()
if (GetEnvironmentVariable(L"RPCS3_CONFIG_DIR", buf, size) - 1 >= size - 1 &&
GetModuleFileName(nullptr, buf, size) - 1 >= size - 1)
{
MessageBoxA(nullptr, fmt::format("GetModuleFileName() failed: error %u.", GetLastError()).c_str(), "fs::get_config_dir()", MB_ICONERROR);
MessageBoxA(nullptr, fmt::format("GetModuleFileName() failed: error: %s", fmt::win_error{GetLastError(), nullptr}).c_str(), "fs::get_config_dir()", MB_ICONERROR);
return dir; // empty
}
@@ -1868,7 +1991,7 @@ const std::string& fs::get_temp_dir()
wchar_t buf[MAX_PATH + 2]{};
if (GetTempPathW(MAX_PATH + 1, buf) - 1 > MAX_PATH)
{
MessageBoxA(nullptr, fmt::format("GetTempPath() failed: error %u.", GetLastError()).c_str(), "fs::get_temp_dir()", MB_ICONERROR);
MessageBoxA(nullptr, fmt::format("GetTempPath() failed: error: %s", fmt::win_error{GetLastError(), nullptr}).c_str(), "fs::get_temp_dir()", MB_ICONERROR);
return dir; // empty
}
@@ -1991,13 +2114,13 @@ fs::file fs::make_gather(std::vector<fs::file> files)
{
}
fs::stat_t stat() override
fs::stat_t get_stat() override
{
fs::stat_t result{};
if (!files.empty())
{
result = files[0].stat();
result = files[0].get_stat();
}
result.is_directory = false;
@@ -2239,9 +2362,19 @@ void fmt_class_string<fs::error>::format(std::string& out, u64 arg)
case fs::error::isdir: return "Is a directory";
case fs::error::toolong: return "Path too long";
case fs::error::nospace: return "Not enough space on the device";
case fs::error::xdev: return "Device mismatch";
case fs::error::unknown: return "Unknown system error";
}
return unknown;
});
}
template<>
void fmt_class_string<fs::file_id>::format(std::string& out, u64 arg)
{
const fs::file_id& id = get_object(arg);
// TODO: Format data
fmt::append(out, "{type='%s'}", id.type);
}
+28 -7
View File
@@ -84,12 +84,22 @@ namespace fs
usz iov_len;
};
struct file_id
{
std::string type;
std::vector<u8> data;
explicit operator bool() const;
bool is_mirror_of(const file_id&) const;
bool is_coherent_with(const file_id&) const;
};
// File handle base
struct file_base
{
virtual ~file_base();
[[noreturn]] virtual stat_t stat();
[[noreturn]] virtual stat_t get_stat();
virtual void sync();
virtual bool trunc(u64 length) = 0;
virtual u64 read(void* buffer, u64 size) = 0;
@@ -98,6 +108,7 @@ namespace fs
virtual u64 seek(s64 offset, seek_mode whence) = 0;
virtual u64 size() = 0;
virtual native_handle get_handle();
virtual file_id get_id();
virtual u64 write_gather(const iovec_clone* buffers, u64 buf_count);
};
@@ -165,11 +176,17 @@ namespace fs
// Set virtual device with specified name (nullptr for deletion)
shared_ptr<device_base> set_virtual_device(const std::string& name, shared_ptr<device_base> device);
// Try to get parent directory (returns empty string on failure)
std::string get_parent_dir(std::string_view path, u32 levels = 1);
// Try to get parent directory
std::string_view get_parent_dir_view(std::string_view path, u32 parent_level = 1);
// String (typical use) version
inline std::string get_parent_dir(std::string_view path, u32 parent_level = 1)
{
return std::string{get_parent_dir_view(path, parent_level)};
}
// Get file information
bool stat(const std::string& path, stat_t& info);
bool get_stat(const std::string& path, stat_t& info);
// Check whether a file or a directory exists (not recommended, use is_file() or is_dir() instead)
bool exists(const std::string& path);
@@ -267,14 +284,14 @@ namespace fs
}
// Get file information
stat_t stat(
stat_t get_stat(
u32 line = __builtin_LINE(),
u32 col = __builtin_COLUMN(),
const char* file = __builtin_FILE(),
const char* func = __builtin_FUNCTION()) const
{
if (!m_file) xnull({line, col, file, func});
return m_file->stat();
return m_file->get_stat();
}
// Sync file buffers
@@ -499,6 +516,9 @@ namespace fs
// Get native handle if available
native_handle get_handle() const;
// Get file ID information (custom ID)
file_id get_id() const;
// Gathered write
u64 write_gather(const iovec_clone* buffers, u64 buf_count,
u32 line = __builtin_LINE(),
@@ -684,6 +704,7 @@ namespace fs
isdir,
toolong,
nospace,
xdev,
unknown
};
@@ -808,7 +829,7 @@ namespace fs
return obj.size();
}
stat_t stat() override
stat_t get_stat() override
{
return m_stat;
}
+67 -23
View File
@@ -198,6 +198,9 @@ static u8* add_jit_memory(usz size, uint align)
});
}
ensure(pointer + pos >= get_jit_memory() + Off);
ensure(pointer + pos < get_jit_memory() + Off + 0x40000000);
return pointer + pos;
}
@@ -795,7 +798,7 @@ void asmjit::simd_builder::vec_cmp_eq(u32 esize, const Operand& dst, const Opera
}
else
{
_vec_binary_op(kIdPcmpeqw, kIdVpcmpeqw, kIdNone, dst, lhs, rhs);
_vec_binary_op(kIdPcmpeqd, kIdVpcmpeqd, kIdNone, dst, lhs, rhs);
}
}
else
@@ -1304,7 +1307,7 @@ std::string jit_compiler::cpu(const std::string& _cpu)
if (m_cpu.empty())
{
m_cpu = llvm::sys::getHostCPUName().operator std::string();
m_cpu = llvm::sys::getHostCPUName().str();
if (m_cpu == "sandybridge" ||
m_cpu == "ivybridge" ||
@@ -1319,7 +1322,10 @@ std::string jit_compiler::cpu(const std::string& _cpu)
m_cpu == "icelake-client" ||
m_cpu == "icelake-server" ||
m_cpu == "tigerlake" ||
m_cpu == "rocketlake")
m_cpu == "rocketlake" ||
m_cpu == "alderlake" ||
m_cpu == "raptorlake" ||
m_cpu == "meteorlake")
{
// Downgrade if AVX is not supported by some chips
if (!utils::has_avx())
@@ -1350,11 +1356,51 @@ std::string jit_compiler::cpu(const std::string& _cpu)
// Upgrade
m_cpu = "znver2";
}
if ((m_cpu == "znver3" || m_cpu == "goldmont" || m_cpu == "alderlake" || m_cpu == "raptorlake" || m_cpu == "meteorlake") && utils::has_avx512_icl())
{
// Upgrade
m_cpu = "icelake-client";
}
if (m_cpu == "goldmont" && utils::has_avx2())
{
// Upgrade
m_cpu = "alderlake";
}
}
return m_cpu;
}
std::string jit_compiler::triple1()
{
#if defined(_WIN32)
return llvm::Triple::normalize(llvm::sys::getProcessTriple());
#elif defined(__APPLE__) && defined(ARCH_X64)
return llvm::Triple::normalize("x86_64-unknown-linux-gnu");
#elif defined(__APPLE__) && defined(ARCH_ARM64)
return llvm::Triple::normalize("aarch64-unknown-linux-gnu");
#else
return llvm::Triple::normalize(llvm::sys::getProcessTriple());
#endif
}
std::string jit_compiler::triple2()
{
#if defined(_WIN32) && defined(ARCH_X64)
return llvm::Triple::normalize("x86_64-unknown-linux-gnu");
#elif defined(_WIN32) && defined(ARCH_ARM64)
return llvm::Triple::normalize("aarch64-unknown-linux-gnu");
#elif defined(__APPLE__) && defined(ARCH_X64)
return llvm::Triple::normalize("x86_64-unknown-linux-gnu");
#elif defined(__APPLE__) && defined(ARCH_ARM64)
return llvm::Triple::normalize("aarch64-unknown-linux-gnu");
#else
return llvm::Triple::normalize(llvm::sys::getProcessTriple());
#endif
}
jit_compiler::jit_compiler(const std::unordered_map<std::string, u64>& _link, const std::string& _cpu, u32 flags)
: m_context(new llvm::LLVMContext)
, m_cpu(cpu(_cpu))
@@ -1362,15 +1408,13 @@ jit_compiler::jit_compiler(const std::unordered_map<std::string, u64>& _link, co
std::string result;
auto null_mod = std::make_unique<llvm::Module> ("null_", *m_context);
#if defined(__APPLE__) && defined(ARCH_ARM64)
// Force override triple on Apple arm64 or we'll get linking errors.
null_mod->setTargetTriple(llvm::Triple::normalize(utils::c_llvm_default_triple));
#endif
null_mod->setTargetTriple(jit_compiler::triple1());
std::unique_ptr<llvm::RTDyldMemoryManager> mem;
if (_link.empty())
{
std::unique_ptr<llvm::RTDyldMemoryManager> mem;
// Auxiliary JIT (does not use custom memory manager, only writes the objects)
if (flags & 0x1)
{
mem = std::make_unique<MemoryManager1>();
@@ -1378,31 +1422,31 @@ jit_compiler::jit_compiler(const std::unordered_map<std::string, u64>& _link, co
else
{
mem = std::make_unique<MemoryManager2>();
null_mod->setTargetTriple(llvm::Triple::normalize(utils::c_llvm_default_triple));
null_mod->setTargetTriple(jit_compiler::triple2());
}
}
else
{
mem = std::make_unique<MemoryManager1>();
}
// Auxiliary JIT (does not use custom memory manager, only writes the objects)
{
m_engine.reset(llvm::EngineBuilder(std::move(null_mod))
.setErrorStr(&result)
.setEngineKind(llvm::EngineKind::JIT)
.setMCJITMemoryManager(std::move(mem))
.setOptLevel(llvm::CodeGenOpt::Aggressive)
.setCodeModel(flags & 0x2 ? llvm::CodeModel::Large : llvm::CodeModel::Small)
#ifdef __APPLE__
//.setCodeModel(llvm::CodeModel::Large)
#endif
.setRelocationModel(llvm::Reloc::Model::PIC_)
.setMCPU(m_cpu)
.create());
}
else
{
// Primary JIT
m_engine.reset(llvm::EngineBuilder(std::move(null_mod))
.setErrorStr(&result)
.setEngineKind(llvm::EngineKind::JIT)
.setMCJITMemoryManager(std::make_unique<MemoryManager1>())
.setOptLevel(llvm::CodeGenOpt::Aggressive)
.setCodeModel(flags & 0x2 ? llvm::CodeModel::Large : llvm::CodeModel::Small)
.setMCPU(m_cpu)
.create());
if (!_link.empty())
{
for (auto&& [name, addr] : _link)
{
m_engine->updateGlobalMapping(name, addr);
@@ -1461,7 +1505,7 @@ void jit_compiler::add(const std::string& path)
if (auto object_file = llvm::object::ObjectFile::createObjectFile(*cache))
{
m_engine->addObjectFile( std::move(*object_file) );
m_engine->addObjectFile(llvm::object::OwningBinary<llvm::object::ObjectFile>(std::move(*object_file), std::move(cache)));
}
else
{
+6
View File
@@ -546,6 +546,12 @@ public:
// Get CPU info
static std::string cpu(const std::string& _cpu);
// Get system triple (PPU)
static std::string triple1();
// Get system triple (SPU)
static std::string triple2();
};
#endif
+41 -4
View File
@@ -63,7 +63,7 @@ std::string fmt::win_error_to_string(unsigned long error, void* module_handle)
std::string message;
LPWSTR message_buffer = nullptr;
if (FormatMessageW((module_handle ? FORMAT_MESSAGE_FROM_HMODULE : FORMAT_MESSAGE_FROM_SYSTEM) | FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_IGNORE_INSERTS,
module_handle, error, 0, (LPWSTR)&message_buffer, 0, nullptr))
module_handle, error, 0, reinterpret_cast<LPWSTR>(&message_buffer), 0, nullptr))
{
message = fmt::format("%s (0x%x)", fmt::trim(wchar_to_utf8(message_buffer), " \t\n\r\f\v"), error);
}
@@ -79,6 +79,17 @@ std::string fmt::win_error_to_string(unsigned long error, void* module_handle)
return message;
}
std::string fmt::win_error_to_string(const fmt::win_error& error)
{
return fmt::win_error_to_string(error.error, error.module_handle);
}
template <>
void fmt_class_string<fmt::win_error>::format(std::string& out, u64 arg)
{
fmt::append(out, "%s", fmt::win_error_to_string(get_object(arg)));
}
#endif
template <>
@@ -203,6 +214,26 @@ void fmt_class_string<std::vector<char8_t>>::format(std::string& out, u64 arg)
out.append(obj.cbegin(), obj.cend());
}
template <>
void fmt_class_string<fmt::buf_to_hexstring>::format(std::string& out, u64 arg)
{
const auto& _arg = get_object(arg);
const std::vector<u8> buf(_arg.buf, _arg.buf + _arg.len);
out.reserve(out.size() + (buf.size() * 3));
static constexpr char hex[16] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
for (usz index = 0; index < buf.size(); index++)
{
out += hex[buf[index] >> 4];
out += hex[buf[index] & 15];
if (((index + 1) % 16) == 0)
out += '\n';
else
out += ' ';
}
}
void format_byte_array(std::string& out, const uchar* data, usz size)
{
if (!size)
@@ -558,7 +589,7 @@ std::vector<std::string> fmt::split(std::string_view source, std::initializer_li
return result;
}
std::string fmt::trim(const std::string& source, const std::string& values)
std::string fmt::trim(const std::string& source, std::string_view values)
{
usz begin = source.find_first_not_of(values);
@@ -568,7 +599,13 @@ std::string fmt::trim(const std::string& source, const std::string& values)
return source.substr(begin, source.find_last_not_of(values) + 1);
}
std::string fmt::to_upper(const std::string& string)
void fmt::trim_back(std::string& source, std::string_view values)
{
const usz index = source.find_last_not_of(values);
source.resize(index + 1);
}
std::string fmt::to_upper(std::string_view string)
{
std::string result;
result.resize(string.size());
@@ -576,7 +613,7 @@ std::string fmt::to_upper(const std::string& string)
return result;
}
std::string fmt::to_lower(const std::string& string)
std::string fmt::to_lower(std::string_view string)
{
std::string result;
result.resize(string.size());
+7
View File
@@ -10,8 +10,15 @@ namespace fmt
static std::string format(const CharT(&)[N], const Args&...);
#ifdef _WIN32
struct win_error
{
unsigned long error{};
void* module_handle{};
};
// Get a string for a windows error (DWORD). Optionally a module HANDLE can be passed.
std::string win_error_to_string(unsigned long error, void* module_handle = nullptr);
std::string win_error_to_string(const win_error& error);
#endif
}
+33 -4
View File
@@ -15,7 +15,7 @@ std::u16string utf8_to_utf16(std::string_view src);
// Copy null-terminated string from a std::string or a char array to a char array with truncation
template <typename D, typename T>
inline void strcpy_trunc(D& dst, const T& src)
inline void strcpy_trunc(D&& dst, const T& src)
{
const usz count = std::size(src) >= std::size(dst) ? std::max<usz>(std::size(dst), 1) - 1 : std::size(src);
std::memcpy(std::data(dst), std::data(src), count);
@@ -124,7 +124,8 @@ namespace fmt
}
std::vector<std::string> split(std::string_view source, std::initializer_list<std::string_view> separators, bool is_skip_empty = true);
std::string trim(const std::string& source, const std::string& values = " \t");
std::string trim(const std::string& source, std::string_view values = " \t");
void trim_back(std::string& source, std::string_view values = " \t");
template <typename T>
std::string merge(const T& source, const std::string& separator)
@@ -173,8 +174,36 @@ namespace fmt
return result;
}
std::string to_upper(const std::string& string);
std::string to_lower(const std::string& string);
std::string to_upper(std::string_view string);
std::string to_lower(std::string_view string);
bool match(const std::string& source, const std::string& mask);
struct buf_to_hexstring
{
buf_to_hexstring(const u8* buf, usz len)
: buf(buf), len(len) {}
const u8* buf;
usz len;
};
struct string_hash
{
using hash_type = std::hash<std::string_view>;
using is_transparent = void;
std::size_t operator()(const char* str) const
{
return hash_type{}(str);
}
std::size_t operator()(std::string_view str) const
{
return hash_type{}(str);
}
std::size_t operator()(std::string const& str) const
{
return hash_type{}(str);
}
};
}
+116 -47
View File
@@ -4,6 +4,7 @@
#include "Emu/Cell/PPUThread.h"
#include "Emu/Cell/lv2/sys_mmapper.h"
#include "Emu/Cell/lv2/sys_event.h"
#include "Emu/Cell/lv2/sys_process.h"
#include "Emu/RSX/RSXThread.h"
#include "Thread.h"
#include "Utilities/JIT.h"
@@ -15,6 +16,11 @@
#include <Psapi.h>
#include <process.h>
#include <sysinfoapi.h>
#include "util/dyn_lib.hpp"
DYNAMIC_IMPORT_RENAME("Kernel32.dll", SetThreadDescriptionImport, "SetThreadDescription", HRESULT(HANDLE hThread, PCWSTR lpThreadDescription));
#else
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
@@ -104,11 +110,7 @@ std::string dump_useful_thread_info()
if (auto cpu = get_current_cpu_thread())
{
// Wrap it to disable some internal exceptions when printing (not thrown on main thread)
Emu.BlockingCallFromMainThread([&]()
{
cpu->dump_all(result);
});
cpu->dump_all(result);
}
return result;
@@ -277,8 +279,11 @@ enum x64_op_t : u32
X64OP_ADC, // lock adc [mem], ...
X64OP_SUB, // lock sub [mem], ...
X64OP_SBB, // lock sbb [mem], ...
X64OP_BEXTR,
};
static thread_local x64_reg_t s_tls_reg3{};
void decode_x64_reg_op(const u8* code, x64_op_t& out_op, x64_reg_t& out_reg, usz& out_size, usz& out_length)
{
// simple analysis of x64 code allows to reinterpret MOV or other instructions in any desired way
@@ -739,10 +744,12 @@ void decode_x64_reg_op(const u8* code, x64_op_t& out_op, x64_reg_t& out_reg, usz
const u8 vopm = op1 == 0xc5 ? 1 : op2 & 0x1f;
const u8 vop1 = op1 == 0xc5 ? op3 : code[2];
const u8 vlen = (opx & 0x4) ? 32 : 16;
//const u8 vreg = (~opx >> 3) & 0xf;
const u8 vreg = (~opx >> 3) & 0xf;
out_length += op1 == 0xc5 ? 2 : 3;
code += op1 == 0xc5 ? 2 : 3;
s_tls_reg3 = x64_reg_t{vreg};
if (vopm == 0x1) switch (vop1) // Implied leading byte 0x0F
{
case 0x11:
@@ -772,6 +779,22 @@ void decode_x64_reg_op(const u8* code, x64_op_t& out_op, x64_reg_t& out_reg, usz
}
}
if (vopm == 0x2) switch (vop1) // Implied leading bytes 0x0F 0x38
{
case 0xf7:
{
if (!repe && !repne && vlen == 16) // BEXTR r32,mem,r32
{
out_op = X64OP_BEXTR;
out_reg = get_modRM_reg_xmm(code, rex);
out_size = opx & 0x80 ? 8 : 4;
out_length += get_modRM_size(code);
return;
}
break;
}
}
break;
}
case 0xc6:
@@ -1367,6 +1390,37 @@ bool handle_access_violation(u32 addr, bool is_writing, ucontext_t* context) noe
break;
}
case X64OP_BEXTR:
{
u32 value;
if (is_writing || !thread->read_reg(addr, value))
{
return false;
}
value = stx::se_storage<u32>::swap(value);
u64 ctrl;
if (!get_x64_reg_value(context, s_tls_reg3, d_size, i_size, ctrl))
{
return false;
}
u8 start = ctrl & 0xff;
u8 _len = (ctrl & 0xff00) >> 8;
if (_len > 32)
_len = 32;
if (start > 32)
start = 32;
value = (u64{value} >> start) & ~(u64{umax} << _len);
if (!put_x64_reg_value(context, reg, d_size, value) || !set_x64_cmp_flags(context, d_size, value, 0))
{
return false;
}
break;
}
case X64OP_STORE:
case X64OP_STORE_BE:
{
@@ -1457,7 +1511,7 @@ bool handle_access_violation(u32 addr, bool is_writing, ucontext_t* context) noe
}
}
if (pf_port_id)
if (auto pf_port = idm::get<lv2_obj, lv2_event_port>(pf_port_id); pf_port && pf_port->queue)
{
// We notify the game that a page fault occurred so it can rectify it.
// Note, for data3, were the memory readable AND we got a page fault, it must be due to a write violation since reads are allowed.
@@ -1495,21 +1549,34 @@ bool handle_access_violation(u32 addr, bool is_writing, ucontext_t* context) noe
}
}
// Deschedule
if (cpu->id_type() == 1)
{
lv2_obj::sleep(*cpu);
}
// Now, place the page fault event onto table so that other functions [sys_mmapper_free_address and pagefault recovery funcs etc]
// know that this thread is page faulted and where.
auto& pf_events = g_fxo->get<page_fault_event_entries>();
// De-schedule
if (cpu->id_type() == 1)
{
std::lock_guard pf_lock(pf_events.pf_mutex);
pf_events.events.emplace(cpu, addr);
cpu->state -= cpu_flag::signal; // Cannot use check_state here and signal must be removed if exists
lv2_obj::sleep(*cpu);
}
auto send_event = [&]() -> error_code
{
lv2_obj::notify_all_t notify_later{};
std::lock_guard pf_lock(pf_events.pf_mutex);
if (auto error = pf_port->queue->send(pf_port->name ? pf_port->name : ((u64{process_getpid() + 0u} << 32) | u64{pf_port_id}), data1, data2, data3))
{
return error;
}
pf_events.events.emplace(cpu, addr);
return {};
};
sig_log.warning("Page_fault %s location 0x%x because of %s memory", is_writing ? "writing" : "reading",
addr, data3 == SYS_MEMORY_PAGE_FAULT_CAUSE_READ_ONLY ? "writing read-only" : "using unmapped");
@@ -1521,13 +1588,12 @@ bool handle_access_violation(u32 addr, bool is_writing, ucontext_t* context) noe
}
}
error_code sending_error = sys_event_port_send(pf_port_id, data1, data2, data3);
error_code sending_error = not_an_error(CELL_EBUSY);
// If we fail due to being busy, wait a bit and try again.
while (static_cast<u32>(sending_error) == CELL_EBUSY)
for (; static_cast<u32>(sending_error) == CELL_EBUSY; thread_ctrl::wait_for(1000))
{
thread_ctrl::wait_for(1000);
sending_error = sys_event_port_send(pf_port_id, data1, data2, data3);
sending_error = send_event();
if (cpu->is_stopped())
{
@@ -1569,7 +1635,7 @@ bool handle_access_violation(u32 addr, bool is_writing, ucontext_t* context) noe
if (!g_tls_access_violation_recovered)
{
vm_log.notice("\n%s", dump_useful_thread_info());
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");
vm_log.error("[%s] Access violation %s location 0x%x (%s)", cpu->get_name(), is_writing ? "writing" : "reading", addr, (is_writing && vm::check_addr(addr)) ? "read-only memory" : "unmapped memory");
}
// TODO:
@@ -1761,12 +1827,16 @@ static LONG exception_filter(PEXCEPTION_POINTERS pExp) noexcept
const bool s_exception_handler_set = []() -> bool
{
if (!AddVectoredExceptionHandler(1, (PVECTORED_EXCEPTION_HANDLER)exception_handler))
#ifdef USE_ASAN
if (!AddVectoredExceptionHandler(FALSE, static_cast<PVECTORED_EXCEPTION_HANDLER>(exception_handler)))
#else
if (!AddVectoredExceptionHandler(1, static_cast<PVECTORED_EXCEPTION_HANDLER>(exception_handler)))
#endif
{
report_fatal_error("AddVectoredExceptionHandler() failed.");
}
if (!SetUnhandledExceptionFilter((LPTOP_LEVEL_EXCEPTION_FILTER)exception_filter))
if (!SetUnhandledExceptionFilter(static_cast<LPTOP_LEVEL_EXCEPTION_FILTER>(exception_filter)))
{
report_fatal_error("SetUnhandledExceptionFilter() failed.");
}
@@ -1972,7 +2042,7 @@ void thread_base::start()
#ifdef _WIN32
m_thread = ::_beginthreadex(nullptr, 0, entry_point, this, CREATE_SUSPENDED, nullptr);
ensure(m_thread);
ensure(::ResumeThread(reinterpret_cast<HANDLE>(+m_thread)) != -1);
ensure(::ResumeThread(reinterpret_cast<HANDLE>(+m_thread)) != static_cast<DWORD>(-1));
#elif defined(__APPLE__)
pthread_attr_t stack_size_attr;
pthread_attr_init(&stack_size_attr);
@@ -2018,6 +2088,13 @@ void thread_base::initialize(void (*error_cb)())
void thread_base::set_name(std::string name)
{
#ifdef _WIN32
if (SetThreadDescriptionImport)
{
SetThreadDescriptionImport(GetCurrentThread(), utf8_to_wchar(name).c_str());
}
#endif
#ifdef _MSC_VER
struct THREADNAME_INFO
{
@@ -2073,7 +2150,7 @@ u64 thread_base::finalize(thread_state result_state) noexcept
tls_cycles += cycles;
FILETIME ctime, etime, ktime, utime;
GetThreadTimes(GetCurrentThread(), &ctime, &etime, &ktime, &utime);
const u64 time = ((ktime.dwLowDateTime | (u64)ktime.dwHighDateTime << 32) + (utime.dwLowDateTime | (u64)utime.dwHighDateTime << 32)) * 100ull - tls_time;
const u64 time = ((ktime.dwLowDateTime | static_cast<u64>(ktime.dwHighDateTime) << 32) + (utime.dwLowDateTime | static_cast<u64>(utime.dwHighDateTime) << 32)) * 100ull - tls_time;
tls_time += time;
const u64 fsoft = 0;
const u64 fhard = 0;
@@ -2351,10 +2428,9 @@ void thread_ctrl::wait_for(u64 usec, [[maybe_unused]] bool alert /* true */)
{
struct itimerspec timeout;
u64 missed;
u64 nsec = usec * 1000ull;
timeout.it_value.tv_nsec = (nsec % 1000000000ull);
timeout.it_value.tv_sec = nsec / 1000000000ull;
timeout.it_value.tv_nsec = usec * 1'000ull;
timeout.it_value.tv_sec = 0;
timeout.it_interval.tv_sec = 0;
timeout.it_interval.tv_nsec = 0;
timerfd_settime(fd_timer, 0, &timeout, NULL);
@@ -2580,26 +2656,24 @@ void thread_base::exec()
while (shared_ptr<thread_future> head = m_taskq.exchange(null_ptr))
{
// TODO: check if adapting reverse algorithm is feasible here
shared_ptr<thread_future>* prev{};
thread_future* prev_head{head.get()};
for (auto ptr = head.get(); ptr; ptr = ptr->next.get())
for (thread_future* prev{};;)
{
utils::prefetch_exec(ptr->exec.load());
utils::prefetch_exec(prev_head->exec.load());
ptr->prev = prev;
if (ptr->next)
if (auto next = prev_head->next.get())
{
prev = &ptr->next;
prev = std::exchange(prev_head, next);
prev_head->prev = prev;
}
else
{
break;
}
}
if (!prev)
{
prev = &head;
}
for (auto ptr = prev->get(); ptr; ptr = ptr->prev->get())
for (auto ptr = prev_head; ptr; ptr = ptr->prev)
{
if (auto task = ptr->exec.load()) [[likely]]
{
@@ -2623,11 +2697,6 @@ void thread_base::exec()
// Partial cleanup
ptr->next.reset();
}
if (!ptr->prev)
{
break;
}
}
if (!m_taskq) [[likely]]
@@ -2710,7 +2779,7 @@ void thread_ctrl::detect_cpu_layout()
if (!GetLogicalProcessorInformationEx(relationship,
reinterpret_cast<SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *>(buffer.data()), &buffer_size))
{
sig_log.error("GetLogicalProcessorInformationEx failed (size=%u, error=%u)", buffer_size, GetLastError());
sig_log.error("GetLogicalProcessorInformationEx failed (size=%u, error=%s)", buffer_size, fmt::win_error{GetLastError(), nullptr});
}
else
{
@@ -2957,7 +3026,7 @@ void thread_ctrl::set_native_priority(int priority)
if (!SetThreadPriority(_this_thread, native_priority))
{
sig_log.error("SetThreadPriority() failed: 0x%x", GetLastError());
sig_log.error("SetThreadPriority() failed: %s", fmt::win_error{GetLastError(), nullptr});
}
#else
int policy;
@@ -3009,7 +3078,7 @@ void thread_ctrl::set_thread_affinity_mask(u64 mask)
HANDLE _this_thread = GetCurrentThread();
if (!SetThreadAffinityMask(_this_thread, !mask ? process_affinity_mask : mask))
{
sig_log.error("Failed to set thread affinity 0x%x: error 0x%x.", mask, GetLastError());
sig_log.error("Failed to set thread affinity 0x%x: error: %s", mask, fmt::win_error{GetLastError(), nullptr});
}
#elif __APPLE__
// Supports only one core
+1 -1
View File
@@ -95,7 +95,7 @@ class thread_future
shared_ptr<thread_future> next{};
shared_ptr<thread_future>* prev{};
thread_future* prev{};
protected:
atomic_t<void(*)(thread_base*, thread_future*)> exec{};
+206 -34
View File
@@ -4,6 +4,7 @@
#include "version.h"
#include "Emu/Memory/vm.h"
#include "Emu/System.h"
#include "Emu/VFS.h"
#include "util/types.hpp"
#include "util/endian.hpp"
@@ -76,6 +77,9 @@ void fmt_class_string<patch_type>::format(std::string& out, u64 arg)
case patch_type::lef32: return "lef32";
case patch_type::lef64: return "lef64";
case patch_type::utf8: return "utf8";
case patch_type::c_utf8: return "cutf8";
case patch_type::move_file: return "move_file";
case patch_type::hide_file: return "hide_file";
}
return unknown;
@@ -215,18 +219,18 @@ bool patch_engine::load(patch_map& patches_map, const std::string& path, std::st
// Go through each main key in the file
for (auto pair : root)
{
const auto& main_key = pair.first.Scalar();
const std::string& main_key = pair.first.Scalar();
if (const auto yml_type = pair.second.Type(); yml_type != YAML::NodeType::Map)
if (main_key.empty())
{
append_log_message(log_messages, fmt::format("Error: Skipping key %s: expected Map, found %s (location: %s, file: %s)", main_key, yml_type, get_yaml_node_location(pair.second), path), &patch_log.error);
append_log_message(log_messages, fmt::format("Error: Skipping empty key (location: %s, file: %s)", get_yaml_node_location(pair.first), path), &patch_log.error);
is_valid = false;
continue;
}
if (main_key.empty())
if (const auto yml_type = pair.second.Type(); yml_type != YAML::NodeType::Map)
{
append_log_message(log_messages, fmt::format("Error: Skipping empty key (location: %s, file: %s)", get_yaml_node_location(pair.second), path), &patch_log.error);
append_log_message(log_messages, fmt::format("Error: Skipping key %s: expected Map, found %s (location: %s, file: %s)", main_key, yml_type, get_yaml_node_location(pair.second), path), &patch_log.error);
is_valid = false;
continue;
}
@@ -238,7 +242,7 @@ bool patch_engine::load(patch_map& patches_map, const std::string& path, std::st
}
// Find or create an entry matching the key/hash in our map
auto& container = patches_map[main_key];
patch_container& container = patches_map[main_key];
container.hash = main_key;
container.version = version;
@@ -248,6 +252,13 @@ bool patch_engine::load(patch_map& patches_map, const std::string& path, std::st
// Each key in "Patches" is also the patch description
const std::string& description = patches_entry.first.Scalar();
if (description.empty())
{
append_log_message(log_messages, fmt::format("Error: Empty patch name (key: %s, location: %s, file: %s)", main_key, get_yaml_node_location(patches_entry.first), path), &patch_log.error);
is_valid = false;
continue;
}
// Compile patch information
if (const auto yml_type = patches_entry.second.Type(); yml_type != YAML::NodeType::Map)
@@ -326,7 +337,7 @@ bool patch_engine::load(patch_map& patches_map, const std::string& path, std::st
continue;
}
patch_engine::patch_app_versions app_versions;
patch_app_versions app_versions;
for (const auto version : serial_node.second)
{
@@ -575,6 +586,14 @@ bool patch_engine::load(patch_map& patches_map, const std::string& path, std::st
{
if (!read_patch_node(info, patch_node, root, log_messages))
{
for (const auto& it : patches_entry.second)
{
if (it.first.Scalar() == patch_key::patch)
{
append_log_message(log_messages, fmt::format("Skipping invalid patch node %s: (key: %s, location: %s)", info.description, main_key, get_yaml_node_location(it.first)), &patch_log.error);
break;
}
}
is_valid = false;
}
}
@@ -682,26 +701,56 @@ bool patch_engine::add_patch_data(YAML::Node node, patch_info& info, u32 modifie
return false;
}
if (!addr_node.Scalar().starts_with("0x"))
if (patch_type_uses_hex_offset(type) && !addr_node.Scalar().starts_with("0x"))
{
append_log_message(log_messages, fmt::format("Skipping patch node %s. Address element has wrong format %s. (key: %s, location: %s)", info.description, addr_node.Scalar(), info.hash, get_yaml_node_location(node)), &patch_log.error);
return false;
}
struct patch_data p_data{};
p_data.type = type;
p_data.offset = addr_node.as<u32>(0) + modifier;
p_data.original_value = value_node.Scalar();
p_data.type = type;
p_data.offset = addr_node.as<u32>(0) + modifier;
p_data.original_offset = addr_node.Scalar();
p_data.original_value = value_node.Scalar();
const bool is_config_value = info.default_config_values.contains(p_data.original_value);
const patch_config_value config_value = is_config_value ? ::at32(info.default_config_values, p_data.original_value) : patch_config_value{};
std::string error_message;
// Validate offset
switch (p_data.type)
{
case patch_type::move_file:
case patch_type::hide_file:
break;
default:
{
get_yaml_node_value<u32>(addr_node, error_message);
if (!error_message.empty())
{
error_message = fmt::format("Skipping patch data entry: [ %s, 0x%.8x, %s ] (key: %s, location: %s) Invalid patch offset '%s' (not a valid u32 or overflow)",
p_data.type, p_data.offset, p_data.original_value.empty() ? "?" : p_data.original_value, info.hash, get_yaml_node_location(node), p_data.original_offset);
append_log_message(log_messages, error_message, &patch_log.error);
return false;
}
if ((0xFFFFFFFF - modifier) < p_data.offset)
{
error_message = fmt::format("Skipping patch data entry: [ %s, 0x%.8x, %s ] (key: %s, location: %s) Invalid combination of patch offset 0x%.8x and modifier 0x%.8x (overflow)",
p_data.type, p_data.offset, p_data.original_value.empty() ? "?" : p_data.original_value, info.hash, get_yaml_node_location(node), p_data.offset, modifier);
append_log_message(log_messages, error_message, &patch_log.error);
return false;
}
break;
}
}
switch (p_data.type)
{
case patch_type::utf8:
case patch_type::jump_func:
case patch_type::move_file:
case patch_type::hide_file:
{
break;
}
@@ -799,7 +848,7 @@ void unmap_vm_area(std::shared_ptr<vm::block_t>& ptr)
}
// Returns old 'applied' size
static usz apply_modification(std::basic_string<u32>& applied, patch_engine::patch_info& patch, u8* dst, u32 filesz, u32 min_addr)
static usz apply_modification(std::basic_string<u32>& applied, patch_engine::patch_info& patch, std::function<u8*(u32, u32)> mem_translate, u32 filesz, u32 min_addr)
{
const usz old_applied_size = applied.size();
@@ -840,8 +889,8 @@ static usz apply_modification(std::basic_string<u32>& applied, patch_engine::pat
{
if (p.type != patch_type::alloc) continue;
// Do not allow null address or if dst is not a VM ptr
if (const u32 alloc_at = vm::try_get_addr(dst + (p.offset & -4096)).first; alloc_at >> 16)
// Do not allow null address or if resultant ptr is not a VM ptr
if (const u32 alloc_at = (p.offset & -4096); alloc_at >> 16)
{
const u32 alloc_size = utils::align(static_cast<u32>(p.value.long_value) + alloc_at % 4096, 4096);
@@ -920,7 +969,74 @@ static usz apply_modification(std::basic_string<u32>& applied, patch_engine::pat
relocate_instructions_at = 0;
}
if (!relocate_instructions_at && (offset < min_addr || offset - min_addr >= filesz))
u32 memory_size = 0;
switch (p.type)
{
case patch_type::invalid:
case patch_type::load:
{
// Invalid in this context
break;
}
case patch_type::alloc:
{
// Applied before
memory_size = 0;
continue;
}
case patch_type::byte:
{
memory_size = sizeof(u8);
break;
}
case patch_type::le16:
case patch_type::be16:
{
memory_size = sizeof(u16);
break;
}
case patch_type::code_alloc:
case patch_type::jump:
case patch_type::jump_link:
case patch_type::jump_func:
case patch_type::le32:
case patch_type::lef32:
case patch_type::bd32:
case patch_type::be32:
case patch_type::bef32:
{
memory_size = sizeof(u32);
break;
}
case patch_type::lef64:
case patch_type::le64:
case patch_type::bd64:
case patch_type::be64:
case patch_type::bef64:
{
memory_size = sizeof(u64);
break;
}
case patch_type::utf8:
{
memory_size = p.original_value.size();
break;
}
case patch_type::c_utf8:
{
memory_size = utils::add_saturate<u32>(p.original_value.size(), 1);
break;
}
case patch_type::move_file:
case patch_type::hide_file:
{
memory_size = 0;
break;
}
}
if (memory_size != 0 && !relocate_instructions_at && (filesz < memory_size || offset < min_addr || offset - min_addr > filesz - memory_size))
{
// This patch is out of range for this segment
continue;
@@ -928,7 +1044,13 @@ static usz apply_modification(std::basic_string<u32>& applied, patch_engine::pat
offset -= min_addr;
auto ptr = dst + offset;
auto ptr = mem_translate(offset, memory_size);
if (!ptr && memory_size != 0 && !relocate_instructions_at)
{
// Memory translation failed
continue;
}
if (relocate_instructions_at)
{
@@ -954,7 +1076,7 @@ static usz apply_modification(std::basic_string<u32>& applied, patch_engine::pat
}
case patch_type::code_alloc:
{
const u32 out_branch = vm::try_get_addr(dst + (offset & -4)).first;
const u32 out_branch = vm::try_get_addr(relocate_instructions_at ? vm::get_super_ptr<u8>(offset & -4) : mem_translate(offset & -4, 4)).first;
// Allow only if points to a PPU executable instruction
if (out_branch < 0x10000 || out_branch >= 0x4000'0000 || !vm::check_addr<4>(out_branch, vm::page_executable))
@@ -1038,7 +1160,7 @@ static usz apply_modification(std::basic_string<u32>& applied, patch_engine::pat
case patch_type::jump:
case patch_type::jump_link:
{
const u32 out_branch = vm::try_get_addr(dst + (offset & -4)).first;
const u32 out_branch = vm::try_get_addr(relocate_instructions_at ? vm::get_super_ptr<u8>(offset & -4) : mem_translate(offset & -4, 4)).first;
const u32 dest = static_cast<u32>(p.value.long_value);
// Allow only if points to a PPU executable instruction
@@ -1054,7 +1176,7 @@ static usz apply_modification(std::basic_string<u32>& applied, patch_engine::pat
{
const std::string& str = p.original_value;
const u32 out_branch = vm::try_get_addr(dst + (offset & -4)).first;
const u32 out_branch = vm::try_get_addr(relocate_instructions_at ? vm::get_super_ptr<u8>(offset & -4) : mem_translate(offset & -4, 4)).first;
const usz sep_pos = str.find_first_of(':');
// Must contain only a single ':' or none
@@ -1070,7 +1192,7 @@ static usz apply_modification(std::basic_string<u32>& applied, patch_engine::pat
if (func_name.starts_with("0x"sv))
{
// Raw hexadeciaml-formatted FNID (real function name cannot contain a digit at the start, derived from C/CPP which were used in PS3 development)
// Raw hexadecimal-formatted FNID (real function name cannot contain a digit at the start, derived from C/CPP which were used in PS3 development)
const auto result = std::from_chars(func_name.data() + 2, func_name.data() + func_name.size() - 2, id, 16);
if (result.ec != std::errc() || str.data() + sep_pos != result.ptr)
@@ -1191,6 +1313,56 @@ static usz apply_modification(std::basic_string<u32>& applied, patch_engine::pat
std::memcpy(ptr, p.original_value.data(), p.original_value.size());
break;
}
case patch_type::c_utf8:
{
std::memcpy(ptr, p.original_value.data(), p.original_value.size() + 1);
break;
}
case patch_type::move_file:
case patch_type::hide_file:
{
const bool is_hide = p.type == patch_type::hide_file;
std::string original_vfs_path = p.original_offset;
std::string dest_vfs_path = p.original_value;
if (original_vfs_path.empty())
{
patch_log.error("Failed to patch file: original path is empty", original_vfs_path);
continue;
}
if (!is_hide && dest_vfs_path.empty())
{
patch_log.error("Failed to patch file: destination path is empty", dest_vfs_path);
continue;
}
if (!original_vfs_path.starts_with("/dev_"))
{
original_vfs_path.insert(0, "/dev_");
}
if (!is_hide && !dest_vfs_path.starts_with("/dev_"))
{
dest_vfs_path.insert(0, "/dev_");
}
const std::string dest_path = is_hide ? fs::get_config_dir() + "delete_this_dir.../delete_this..." : vfs::get(dest_vfs_path);
if (dest_path.empty())
{
patch_log.error("Failed to patch file path at '%s': destination is not mounted", original_vfs_path, dest_vfs_path);
continue;
}
if (!vfs::mount(original_vfs_path, dest_path))
{
patch_log.error("Failed to patch file path at '%s': vfs::mount(dest='%s') failed", original_vfs_path, dest_vfs_path);
continue;
}
break;
}
}
// Possibly an executable instruction
@@ -1200,7 +1372,7 @@ static usz apply_modification(std::basic_string<u32>& applied, patch_engine::pat
return old_applied_size;
}
std::basic_string<u32> patch_engine::apply(const std::string& name, u8* dst, u32 filesz, u32 min_addr)
std::basic_string<u32> patch_engine::apply(const std::string& name, std::function<u8*(u32, u32)> mem_translate, u32 filesz, u32 min_addr)
{
if (!m_map.contains(name))
{
@@ -1208,11 +1380,11 @@ std::basic_string<u32> patch_engine::apply(const std::string& name, u8* dst, u32
}
std::basic_string<u32> applied_total;
const auto& container = ::at32(m_map, name);
const auto& serial = Emu.GetTitleID();
const auto& app_version = Emu.GetAppVersion();
const patch_container& container = ::at32(m_map, name);
const std::string& serial = Emu.GetTitleID();
const std::string& app_version = Emu.GetAppVersion();
// Different containers in order to seperate the patches
// Different containers in order to separate the patches
std::vector<std::shared_ptr<patch_info>> patches_for_this_serial_and_this_version;
std::vector<std::shared_ptr<patch_info>> patches_for_this_serial_and_all_versions;
std::vector<std::shared_ptr<patch_info>> patches_for_all_serials_and_this_version;
@@ -1244,7 +1416,7 @@ std::basic_string<u32> patch_engine::apply(const std::string& name, u8* dst, u32
continue;
}
const auto& app_versions = ::at32(serials, found_serial);
const patch_app_versions& app_versions = ::at32(serials, found_serial);
std::string found_app_version;
if (app_versions.contains(app_version))
@@ -1341,7 +1513,7 @@ std::basic_string<u32> patch_engine::apply(const std::string& name, u8* dst, u32
{
if (patch)
{
const usz old_size = apply_modification(applied_total, *patch, dst, filesz, min_addr);
const usz old_size = apply_modification(applied_total, *patch, mem_translate, filesz, min_addr);
if (applied_total.size() != old_size)
{
@@ -1362,11 +1534,11 @@ void patch_engine::unload(const std::string& name)
return;
}
const auto& container = ::at32(m_map, name);
const patch_container& container = ::at32(m_map, name);
for (const auto& [description, patch] : container.patch_info_map)
{
for (auto& entry : patch.data_list)
for (const patch_data& entry : patch.data_list)
{
// Deallocate used memory
if (u32 addr = std::exchange(entry.alloc_addr, 0))
@@ -1494,7 +1666,7 @@ static void append_patches(patch_engine::patch_map& existing_patches, const patc
continue;
}
auto& container = existing_patches[hash];
patch_engine::patch_container& container = existing_patches[hash];
for (const auto& [description, new_info] : new_container.patch_info_map)
{
@@ -1505,7 +1677,7 @@ static void append_patches(patch_engine::patch_map& existing_patches, const patc
continue;
}
auto& info = container.patch_info_map[description];
patch_engine::patch_info& info = container.patch_info_map[description];
bool ok;
const bool version_is_bigger = utils::compare_versions(new_info.patch_version, info.patch_version, ok) > 0;
@@ -1668,7 +1840,7 @@ bool patch_engine::save_patches(const patch_map& patches, const std::string& pat
bool patch_engine::import_patches(const patch_engine::patch_map& patches, const std::string& path, usz& count, usz& total, std::stringstream* log_messages)
{
patch_engine::patch_map existing_patches;
patch_map existing_patches;
if (load(existing_patches, path, "", true, log_messages))
{
@@ -1681,13 +1853,13 @@ bool patch_engine::import_patches(const patch_engine::patch_map& patches, const
bool patch_engine::remove_patch(const patch_info& info)
{
patch_engine::patch_map patches;
patch_map patches;
if (load(patches, info.source_path))
{
if (patches.contains(info.hash))
{
auto& container = patches[info.hash];
patch_container& container = patches[info.hash];
if (container.patch_info_map.contains(info.description))
{
+11 -1
View File
@@ -3,6 +3,7 @@
#include <vector>
#include <string>
#include <unordered_map>
#include <functional>
#include "util/types.hpp"
#include "util/yaml.hpp"
@@ -52,8 +53,16 @@ enum class patch_type
bef32,
bef64,
utf8, // Text of string (not null-terminated automatically)
c_utf8, // Text of string (null-terminated automatically)
move_file, // Move file
hide_file, // Hide file
};
static constexpr bool patch_type_uses_hex_offset(patch_type type)
{
return type >= patch_type::alloc && type <= patch_type::c_utf8;
}
enum class patch_configurable_type
{
double_range,
@@ -69,6 +78,7 @@ public:
{
patch_type type = patch_type::load;
u32 offset = 0;
std::string original_offset{}; // Used for specifying paths
std::string original_value{}; // Used for import consistency (avoid rounding etc.)
union
{
@@ -204,7 +214,7 @@ public:
void append_title_patches(const std::string& title_id);
// Apply patch (returns the number of entries applied)
std::basic_string<u32> apply(const std::string& name, u8* dst, u32 filesz = -1, u32 min_addr = 0);
std::basic_string<u32> apply(const std::string& name, std::function<u8*(u32, u32)> mem_translate, u32 filesz = -1, u32 min_addr = 0);
// Deallocate memory used by patches
void unload(const std::string& name);
+7 -5
View File
@@ -42,6 +42,8 @@ public:
// Underlying type
using under = std::underlying_type_t<T>;
ENABLE_BITWISE_SERIALIZATION;
private:
// Underlying value
under m_data;
@@ -49,7 +51,7 @@ private:
friend class atomic_bs_t<T>;
// Value constructor
constexpr explicit bs_t(int, under data)
constexpr explicit bs_t(int, under data) noexcept
: m_data(data)
{
}
@@ -71,19 +73,19 @@ public:
bs_t() = default;
// Construct from a single bit
constexpr bs_t(T bit)
constexpr bs_t(T bit) noexcept
: m_data(shift(bit))
{
}
// Test for empty bitset
constexpr explicit operator bool() const
constexpr explicit operator bool() const noexcept
{
return m_data != 0;
}
// Extract underlying data
constexpr explicit operator under() const
constexpr explicit operator under() const noexcept
{
return m_data;
}
@@ -138,7 +140,7 @@ public:
return bs_t(0, lhs.m_data ^ rhs.m_data);
}
constexpr bool operator ==(bs_t rhs) const
constexpr bool operator ==(bs_t rhs) const noexcept
{
return m_data == rhs.m_data;
}
+63 -26
View File
@@ -5,54 +5,81 @@ rXmlNode::rXmlNode()
{
}
rXmlNode::rXmlNode(const pugi::xml_node &node)
rXmlNode::rXmlNode(const pugi::xml_node& node)
{
handle = node;
}
std::shared_ptr<rXmlNode> rXmlNode::GetChildren()
{
// it.begin() returns node_iterator*, *it.begin() return node*.
pugi::xml_object_range<pugi::xml_node_iterator> it = handle.children();
pugi::xml_node begin = *it.begin();
if (handle)
{
if (const pugi::xml_node child = handle.first_child())
{
return std::make_shared<rXmlNode>(child);
}
}
if (begin)
{
return std::make_shared<rXmlNode>(begin);
}
else
{
return nullptr;
}
return nullptr;
}
std::shared_ptr<rXmlNode> rXmlNode::GetNext()
{
pugi::xml_node result = handle.next_sibling();
if (result)
if (handle)
{
return std::make_shared<rXmlNode>(result);
}
else
{
return nullptr;
if (const pugi::xml_node result = handle.next_sibling())
{
return std::make_shared<rXmlNode>(result);
}
}
return nullptr;
}
std::string rXmlNode::GetName()
{
return handle.name();
if (handle)
{
if (const pugi::char_t* name = handle.name())
{
return name;
}
}
return {};
}
std::string rXmlNode::GetAttribute(const std::string &name)
std::string rXmlNode::GetAttribute(const std::string& name)
{
auto pred = [&name](pugi::xml_attribute attr) { return (name == attr.name()); };
return handle.find_attribute(pred).value();
if (handle)
{
const auto pred = [&name](const pugi::xml_attribute& attr) { return (name == attr.name()); };
if (const pugi::xml_attribute attr = handle.find_attribute(pred))
{
if (const pugi::char_t* value = attr.value())
{
return value;
}
}
}
return {};
}
std::string rXmlNode::GetNodeContent()
{
return handle.text().get();
if (handle)
{
if (const pugi::xml_text text = handle.text())
{
if (const pugi::char_t* value = text.get())
{
return value;
}
}
}
return {};
}
rXmlDocument::rXmlDocument()
@@ -61,10 +88,20 @@ rXmlDocument::rXmlDocument()
pugi::xml_parse_result rXmlDocument::Read(const std::string& data)
{
return handle.load_buffer(data.data(), data.size());
if (handle)
{
return handle.load_buffer(data.data(), data.size());
}
return {};
}
std::shared_ptr<rXmlNode> rXmlDocument::GetRoot()
{
return std::make_shared<rXmlNode>(handle.root());
if (const pugi::xml_node root = handle.root())
{
return std::make_shared<rXmlNode>(root);
}
return nullptr;
}
+2 -2
View File
@@ -19,11 +19,11 @@
struct rXmlNode
{
rXmlNode();
rXmlNode(const pugi::xml_node &);
rXmlNode(const pugi::xml_node& node);
std::shared_ptr<rXmlNode> GetChildren();
std::shared_ptr<rXmlNode> GetNext();
std::string GetName();
std::string GetAttribute(const std::string &name);
std::string GetAttribute(const std::string& name);
std::string GetNodeContent();
pugi::xml_node handle{};
+5 -5
View File
@@ -73,12 +73,12 @@ namespace utils
std::vector<std::string> get_backtrace_symbols(const std::vector<void*>& stack)
{
std::vector<std::string> result = {};
std::vector<u8> symbol_buf(sizeof(SYMBOL_INFO) + sizeof(TCHAR) * 256);
std::vector<u8> symbol_buf(sizeof(SYMBOL_INFOW) + sizeof(TCHAR) * 256);
const auto hProcess = ::GetCurrentProcess();
auto sym = reinterpret_cast<SYMBOL_INFO*>(symbol_buf.data());
sym->SizeOfStruct = sizeof(SYMBOL_INFO);
auto sym = reinterpret_cast<SYMBOL_INFOW*>(symbol_buf.data());
sym->SizeOfStruct = sizeof(SYMBOL_INFOW);
sym->MaxNameLen = 256;
IMAGEHLP_LINEW64 line_info{};
@@ -90,7 +90,7 @@ namespace utils
for (const auto& pointer : stack)
{
DWORD64 unused;
SymFromAddr(hProcess, reinterpret_cast<DWORD64>(pointer), &unused, sym);
SymFromAddrW(hProcess, reinterpret_cast<DWORD64>(pointer), &unused, sym);
if (sym->NameLen)
{
@@ -98,7 +98,7 @@ namespace utils
// Attempt to get file and line information if available
DWORD unused2;
if (SymGetLineFromAddrW(hProcess, reinterpret_cast<DWORD64>(pointer), &unused2, &line_info))
if (SymGetLineFromAddrW64(hProcess, reinterpret_cast<DWORD64>(pointer), &unused2, &line_info))
{
const auto full_path = fmt::format("%s:%u %s", wstr_to_utf8(line_info.FileName, -1), line_info.LineNumber, function_name);
result.push_back(full_path);
+32 -16
View File
@@ -43,28 +43,14 @@ QLabel#gamelist_icon_background_color {
color: rgba(209,209,209,255);
}
/* game grid stylesheet */
QTableWidget#game_grid {
font-weight:600;
font-size:8pt;
font-family:Lucida Grande;
color: rgba(51,51,51,255);
}
QTableWidget#game_grid::item:selected:active {
selection-background-color: #0078D7;
}
QTableWidget#game_grid::item:selected:!active {
selection-background-color: #008cff;
}
/* log stylesheet */
QTextEdit#tty_frame {
QPlainTextEdit#tty_frame {
background-color:#ffffff;
}
QLabel#tty_text {
color:#000000;
}
QTextEdit#log_frame {
QPlainTextEdit#log_frame {
background-color:#ffffff;
}
QLabel#log_level_always {
@@ -131,3 +117,33 @@ QLabel#rsx_debugger_display_buffer {
QLabel#l_controller {
color:#434343;
}
/* Game Grid */
#game_list_grid_item[selected="true"] {
background: #0078D7;
}
#game_list_grid_item:hover {
background: #008cff;
}
#game_list_grid_item:focus {
background: #0078D7;
}
/* Game Grid Font */
#game_list_grid_item #game_list_grid_item_title_label {
font-weight: 600;
font-size: 8pt;
font-family: Lucida Grande;
color: rgba(51,51,51,255);
}
/* Game Grid hover and focus: we need to handle properties differently when using descendants */
#game_list_grid_item[selected="true"] #game_list_grid_item_title_label {
color: #fff;
}
#game_list_grid_item[hover="true"] #game_list_grid_item_title_label {
color: #fff;
}
#game_list_grid_item[focus="true"] #game_list_grid_item_title_label {
color: #fff;
}
+45 -23
View File
@@ -197,17 +197,6 @@ QLabel#l_controller {
color: #FFF;
}
/* Game Grid Font */
QTableWidget#game_grid {
font-weight: 600;
font-size: 8pt;
font-family: Lucida Grande;
color: #FFF;
}
QTableWidget#game_grid::item:selected:!active {
selection-background-color: #313f4e;
}
/* Slider on toolbar */
QWidget#sizeSliderContainer {
background: transparent;
@@ -264,7 +253,7 @@ QLabel#thumbnail_icon_color {
}
/* Set Log colors */
QTextEdit#log_frame {
QPlainTextEdit#log_frame {
background-color: #000; /* Black */
}
QLabel#log_level_always {
@@ -296,7 +285,7 @@ QLabel#log_stack {
}
/* Set TTY colors */
QTextEdit#tty_frame {
QPlainTextEdit#tty_frame {
background-color: #000; /* Black */
}
QLabel#tty_text {
@@ -344,24 +333,57 @@ QLabel#debugger_frame_pc {
/* Tree view changes*/
QTreeView::branch:has-children:!has-siblings:closed,
QTreeView::branch:closed:has-children:has-siblings {
border-image: none;
image: url("GuiConfigs/list_arrow_white.png");
border-image: none;
image: url("GuiConfigs/list_arrow_white.png");
}
QTreeView::branch:open:has-children:!has-siblings,
QTreeView::branch:open:has-children:has-siblings {
border-image: none;
image: url("GuiConfigs/list_arrow_down_white.png");
QTreeView::branch:open:has-children:has-siblings {
border-image: none;
image: url("GuiConfigs/list_arrow_down_white.png");
}
QTreeView::branch:has-children:!has-siblings:closed:hover,
QTreeView::branch:closed:has-children:has-siblings:hover {
border-image: none;
image: url("GuiConfigs/list_arrow_blue.png");
border-image: none;
image: url("GuiConfigs/list_arrow_blue.png");
}
QTreeView::branch:open:has-children:!has-siblings:hover,
QTreeView::branch:open:has-children:has-siblings:hover {
border-image: none;
image: url("GuiConfigs/list_arrow_down_blue.png");
QTreeView::branch:open:has-children:has-siblings:hover {
border-image: none;
image: url("GuiConfigs/list_arrow_down_blue.png");
}
/* Game Grid */
#game_list_grid_item[selected="true"] {
background: #313f4e;
}
#game_list_grid_item:hover {
background: #313f4e;
}
#game_list_grid_item:focus {
background: #0078D7;
}
/* Game Grid Font */
#game_list_grid_item #game_list_grid_item_title_label {
font-weight: 600;
font-size: 8pt;
font-family: Lucida Grande;
color: #FFF;
}
/* Game Grid hover and focus: we need to handle properties differently when using descendants */
#game_list_grid_item[selected="true"] #game_list_grid_item_title_label {
background-color: #313f4e;
}
#game_list_grid_item[hover="true"] #game_list_grid_item_title_label {
background-color: #313f4e;
}
#game_list_grid_item[focus="true"] #game_list_grid_item_title_label {
background-color: #0078D7;
}
/* Richtext link color */
QLabel#richtext_link_color { color: #87cefa; }
+35 -14
View File
@@ -454,7 +454,7 @@ QListWidget::item:selected {
}
QListWidget::item:hover {
background-color: #30333a;
background-color: #30333a;
color: #8cf944;
border-radius: 0.25em;
}
@@ -565,7 +565,7 @@ QTableView {
}
QTableView::item:hover {
color: #8cf944;
color: #8cf944;
}
/* Game Icon Background */
@@ -579,7 +579,7 @@ QLabel#thumbnail_icon_color {
}
/* Log colors */
QTextEdit#log_frame {
QPlainTextEdit#log_frame {
background-color: #23262d;
}
@@ -620,7 +620,7 @@ QLabel#log_stack {
}
/* TTY colors */
QTextEdit#tty_frame {
QPlainTextEdit#tty_frame {
background-color: #23262d;
}
@@ -641,24 +641,45 @@ QLabel#debugger_frame_pc {
/* Tree view changes*/
QTreeView::branch:has-children:!has-siblings:closed,
QTreeView::branch:closed:has-children:has-siblings {
border-image: none;
image: url("GuiConfigs/list_arrow_white.png");
border-image: none;
image: url("GuiConfigs/list_arrow_white.png");
}
QTreeView::branch:open:has-children:!has-siblings,
QTreeView::branch:open:has-children:has-siblings {
border-image: none;
image: url("GuiConfigs/list_arrow_down_white.png");
QTreeView::branch:open:has-children:has-siblings {
border-image: none;
image: url("GuiConfigs/list_arrow_down_white.png");
}
QTreeView::branch:has-children:!has-siblings:closed:hover,
QTreeView::branch:closed:has-children:has-siblings:hover {
border-image: none;
image: url("GuiConfigs/list_arrow_green.png");
border-image: none;
image: url("GuiConfigs/list_arrow_green.png");
}
QTreeView::branch:open:has-children:!has-siblings:hover,
QTreeView::branch:open:has-children:has-siblings:hover {
border-image: none;
image: url("GuiConfigs/list_arrow_down_green.png");
QTreeView::branch:open:has-children:has-siblings:hover {
border-image: none;
image: url("GuiConfigs/list_arrow_down_green.png");
}
/* Game Grid */
#game_list_grid_item[selected="true"] {
background: #2d3038;
}
#game_list_grid_item:focus {
background: #2d3038;
}
/* Game Grid hover and focus: we need to handle properties differently when using descendants */
#game_list_grid_item[selected="true"] #game_list_grid_item_title_label {
background-color: #2d3038;
color: #8cf944;
}
#game_list_grid_item[focus="true"] #game_list_grid_item_title_label {
background-color: #2d3038;
color: #8cf944;
}
/* Richtext link color */
QLabel#richtext_link_color { color: #8cf944; }
+45 -26
View File
@@ -249,20 +249,6 @@ QWidget#trophy_notification_frame {
color: #e6e6e6;
}
/* Game Grid Font */
QTableWidget#game_grid {
font-weight: 600;
font-size: 8pt;
font-family: Lucida Grande;
selection-color: #e6e6e6;
}
QTableWidget#game_grid::item:selected:active {
selection-background-color: #4c4b4b;
}
QTableWidget#game_grid::item:selected:!active {
selection-background-color: #3d3d3d;
}
/* Set Toolbar Slider Size */
QSlider#sizeSlider::groove:horizontal {
border: 0em solid transparent;
@@ -306,7 +292,7 @@ QLabel#debugger_frame_pc {
}
/* Set Log colors */
QTextEdit#log_frame {
QPlainTextEdit#log_frame {
background-color: #000000; /* Black */
}
QLabel#log_level_always {
@@ -337,7 +323,7 @@ QLabel#log_stack {
color: #ffffff; /* White */
}
/* Set TTY colors */
QTextEdit#tty_frame {
QPlainTextEdit#tty_frame {
background-color: #000000; /* Black */
}
QLabel#tty_text {
@@ -347,24 +333,57 @@ QLabel#tty_text {
/* Tree view changes*/
QTreeView::branch:has-children:!has-siblings:closed,
QTreeView::branch:closed:has-children:has-siblings {
border-image: none;
image: url("GuiConfigs/list_arrow_white.png");
border-image: none;
image: url("GuiConfigs/list_arrow_white.png");
}
QTreeView::branch:open:has-children:!has-siblings,
QTreeView::branch:open:has-children:has-siblings {
border-image: none;
image: url("GuiConfigs/list_arrow_down_white.png");
QTreeView::branch:open:has-children:has-siblings {
border-image: none;
image: url("GuiConfigs/list_arrow_down_white.png");
}
QTreeView::branch:has-children:!has-siblings:closed:hover,
QTreeView::branch:closed:has-children:has-siblings:hover {
border-image: none;
image: url("GuiConfigs/list_arrow_blue.png");
border-image: none;
image: url("GuiConfigs/list_arrow_blue.png");
}
QTreeView::branch:open:has-children:!has-siblings:hover,
QTreeView::branch:open:has-children:has-siblings:hover {
border-image: none;
image: url("GuiConfigs/list_arrow_down_blue.png");
QTreeView::branch:open:has-children:has-siblings:hover {
border-image: none;
image: url("GuiConfigs/list_arrow_down_blue.png");
}
/* Game Grid */
#game_list_grid_item[selected="true"] {
background: #3d3d3d;
}
#game_list_grid_item:hover {
background: #3d3d3d;
}
#game_list_grid_item:focus {
background: #4c4b4b;
}
/* Game Grid Font */
#game_list_grid_item #game_list_grid_item_title_label {
font-weight: 600;
font-size: 8pt;
font-family: Lucida Grande;
}
/* Game Grid hover and focus: we need to handle properties differently when using descendants */
#game_list_grid_item[selected="true"] #game_list_grid_item_title_label {
background-color: #3d3d3d;
}
#game_list_grid_item[hover="true"] #game_list_grid_item_title_label {
background-color: #3d3d3d;
}
#game_list_grid_item[focus="true"] #game_list_grid_item_title_label {
color: #e6e6e6;
background-color: #4c4b4b;
}
/* Richtext link color */
QLabel#richtext_link_color { color: #87cefa; }
@@ -194,17 +194,6 @@ QLabel#l_controller {
color: #fff;
}
/* Game Grid Font */
QTableWidget#game_grid {
font-weight: 600;
font-size: 8pt;
font-family: Lucida Grande;
color: #fff;
}
QTableWidget#game_grid::item:selected:!active {
selection-background-color: #354454;
}
/* Slider on toolbar */
QWidget#sizeSliderContainer {
background: transparent;
@@ -261,7 +250,7 @@ QLabel#thumbnail_icon_color {
}
/* Set Log colors */
QTextEdit#log_frame {
QPlainTextEdit#log_frame {
background-color: #181d24; /* Black */
}
QLabel#log_level_always {
@@ -293,7 +282,7 @@ QLabel#log_stack {
}
/* Set TTY colors */
QTextEdit#tty_frame {
QPlainTextEdit#tty_frame {
background-color: #181d24; /* Black */
}
QLabel#tty_text {
@@ -341,24 +330,57 @@ QLabel#debugger_frame_pc {
/* Tree view changes*/
QTreeView::branch:has-children:!has-siblings:closed,
QTreeView::branch:closed:has-children:has-siblings {
border-image: none;
image: url("GuiConfigs/list_arrow_white.png");
border-image: none;
image: url("GuiConfigs/list_arrow_white.png");
}
QTreeView::branch:open:has-children:!has-siblings,
QTreeView::branch:open:has-children:has-siblings {
border-image: none;
image: url("GuiConfigs/list_arrow_down_white.png");
QTreeView::branch:open:has-children:has-siblings {
border-image: none;
image: url("GuiConfigs/list_arrow_down_white.png");
}
QTreeView::branch:has-children:!has-siblings:closed:hover,
QTreeView::branch:closed:has-children:has-siblings:hover {
border-image: none;
image: url("GuiConfigs/list_arrow_blue.png");
border-image: none;
image: url("GuiConfigs/list_arrow_blue.png");
}
QTreeView::branch:open:has-children:!has-siblings:hover,
QTreeView::branch:open:has-children:has-siblings:hover {
border-image: none;
image: url("GuiConfigs/list_arrow_down_blue.png");
QTreeView::branch:open:has-children:has-siblings:hover {
border-image: none;
image: url("GuiConfigs/list_arrow_down_blue.png");
}
/* Game Grid */
#game_list_grid_item[selected="true"] {
background: #354454;
}
#game_list_grid_item:hover {
background: #354454;
}
#game_list_grid_item:focus {
background: #0078D7;
}
/* Game Grid Font */
#game_list_grid_item #game_list_grid_item_title_label {
font-weight: 600;
font-size: 8pt;
font-family: Lucida Grande;
color: #FFF;
}
/* Game Grid hover and focus: we need to handle properties differently when using descendants */
#game_list_grid_item[selected="true"] #game_list_grid_item_title_label {
background-color: #354454;
}
#game_list_grid_item[hover="true"] #game_list_grid_item_title_label {
background-color: #354454;
}
#game_list_grid_item[focus="true"] #game_list_grid_item_title_label {
background-color: #0078D7;
}
/* Richtext link color */
QLabel#richtext_link_color { color: #87cefa; }
+33 -15
View File
@@ -367,21 +367,6 @@ QLabel#l_controller {
}
/* Game Grid Font */
QTableWidget#game_grid {
font-weight: 600;
color: #ffd785;
text-transform: uppercase;
selection-color: #ffd785;
}
QTableWidget#game_grid::item:selected:active {
selection-background-color: #4d4940;
}
QTableWidget#game_grid::item:selected:!active {
selection-background-color: #615c51;
}
/* Debug UI Settings buttons */
QLabel#color_button {
background: transparent;
@@ -489,3 +474,36 @@ QWidget#trophy_notification_frame {
background-color: #b3ac98;
color: #4d4940;
}
/* Game Grid */
#game_list_grid_item[selected="true"] {
background: #615c51;
}
#game_list_grid_item:hover {
background: #615c51;
}
#game_list_grid_item:focus {
background: #4d4940;
}
/* Game Grid Font */
#game_list_grid_item #game_list_grid_item_title_label {
font-weight: 600;
text-transform: uppercase;
color: #ffd785;
}
/* Game Grid hover and focus: we need to handle properties differently when using descendants */
#game_list_grid_item[selected="true"] #game_list_grid_item_title_label {
background-color: #615c51;
}
#game_list_grid_item[hover="true"] #game_list_grid_item_title_label {
background-color: #615c51;
}
#game_list_grid_item[focus="true"] #game_list_grid_item_title_label {
background-color: #4d4940;
color: #ffd785;
}
/* Richtext link color */
QLabel#richtext_link_color { color: #87cefa; }
+50 -11
View File
@@ -220,6 +220,17 @@ QScrollBar::up-arrow, QScrollBar::down-arrow, QScrollBar::up-button:vertical, QS
border: none;
}
#game_list_grid QScrollBar {
width: 10px;
height: 3px;
}
#game_list_grid QScrollBar::handle {
background: #1c273d;
}
#game_list_grid QScrollBar::handle:hover, QScrollBar::handle:pressed {
background: #0074e7;
}
/* Radio Buttons */
QRadioButton::indicator {
border: 0.0625em solid #455971;
@@ -600,7 +611,7 @@ QLineEdit:focus {
}
/* Log colors */
QTextEdit#log_frame {
QPlainTextEdit#log_frame {
background-color: #111525;
}
@@ -663,24 +674,52 @@ QLabel#debugger_frame_pc {
/* Tree view changes*/
QTreeView::branch:has-children:!has-siblings:closed,
QTreeView::branch:closed:has-children:has-siblings {
border-image: none;
image: url("GuiConfigs/list_arrow_white.png");
border-image: none;
image: url("GuiConfigs/list_arrow_white.png");
}
QTreeView::branch:open:has-children:!has-siblings,
QTreeView::branch:open:has-children:has-siblings {
border-image: none;
image: url("GuiConfigs/list_arrow_down_white.png");
QTreeView::branch:open:has-children:has-siblings {
border-image: none;
image: url("GuiConfigs/list_arrow_down_white.png");
}
QTreeView::branch:has-children:!has-siblings:closed:hover,
QTreeView::branch:closed:has-children:has-siblings:hover {
border-image: none;
image: url("GuiConfigs/list_arrow_blue.png");
border-image: none;
image: url("GuiConfigs/list_arrow_blue.png");
}
QTreeView::branch:open:has-children:!has-siblings:hover,
QTreeView::branch:open:has-children:has-siblings:hover {
border-image: none;
image: url("GuiConfigs/list_arrow_down_blue.png");
QTreeView::branch:open:has-children:has-siblings:hover {
border-image: none;
image: url("GuiConfigs/list_arrow_down_blue.png");
}
/* Game Grid */
#game_list_grid_item[selected="true"] {
background: #0f1d36;
}
#game_list_grid_item:focus {
background: #0f1d36;
}
#game_list_grid_item #game_list_grid_item_title_label {
color: #FFFFFF;
}
/* Game Grid hover and focus: we need to handle properties differently when using descendants */
#game_list_grid_item[selected="true"] #game_list_grid_item_title_label {
background-color: #0f1d36;
color: #2397ff;
}
#game_list_grid_item[hover="true"] #game_list_grid_item_title_label {
color: #2397ff;
}
#game_list_grid_item[focus="true"] #game_list_grid_item_title_label {
background-color: #0f1d36;
color: #2397ff;
}
/* Richtext link color */
QLabel#richtext_link_color { color: #0074e7; }
+22 -1
View File
@@ -619,7 +619,7 @@ QLineEdit:focus {
}
/* Log colors */
QTextEdit#log_frame {
QPlainTextEdit#log_frame {
background-color: #FFFFFF;
}
@@ -678,3 +678,24 @@ QLabel#debugger_frame_pc {
color: #000; /* Font Color: Black */
background-color: #00ff00; /* Green */
}
/* Game Grid */
#game_list_grid_item[selected="true"] {
background: #4343c1;
}
#game_list_grid_item:focus {
background: #4343c1;
}
/* Game Grid hover and focus: we need to handle properties differently when using descendants */
#game_list_grid_item[selected="true"] #game_list_grid_item_title_label {
background-color: #4343c1;
color: #FFF;
}
#game_list_grid_item[hover="true"] #game_list_grid_item_title_label {
color: #4343c1;
}
#game_list_grid_item[focus="true"] #game_list_grid_item_title_label {
background-color: #4343c1;
color: #FFF;
}
+23 -8
View File
@@ -358,14 +358,6 @@ QLabel#l_controller {
color: #4d4940;
}
/* Game Grid Font */
QTableWidget#game_grid {
font-weight: 600;
color: #4d4940;
text-transform: uppercase;
selection-color: #aea993;
}
/* Debug UI Settings buttons */
QLabel#color_button {
background: transparent;
@@ -463,3 +455,26 @@ QSlider#sizeSlider::groove:horizontal {
QLabel#validLabel {
font-weight: 600;
}
/* Game Grid */
#game_list_grid_item[selected="true"] {
background: #4d4940;
}
#game_list_grid_item:focus {
background: #4d4940;
}
/* Game Grid Font */
#game_list_grid_item #game_list_grid_item_title_label {
font-weight: 600;
color: #4d4940;
text-transform: uppercase;
}
/* Game Grid hover and focus: we need to handle properties differently when using descendants */
#game_list_grid_item[selected="true"] #game_list_grid_item_title_label {
color: #aea993;
}
#game_list_grid_item[focus="true"] #game_list_grid_item_title_label {
color: #aea993;
}
+26 -26
View File
@@ -1,9 +1,11 @@
# Check and configure compiler options for RPCS3
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:throwingNew- /constexpr:steps16777216 /D _CRT_SECURE_NO_DEPRECATE=1 /D _CRT_NON_CONFORMING_SWPRINTFS=1 /D _SCL_SECURE_NO_WARNINGS=1")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D NOMINMAX /D _ENABLE_EXTENDED_ALIGNED_STORAGE=1 /D _HAS_EXCEPTIONS=0")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS /DYNAMICBASE:NO /BASE:0x10000 /FIXED")
add_compile_options(/Zc:throwingNew- /constexpr:steps16777216)
add_compile_definitions(
_CRT_SECURE_NO_DEPRECATE=1 _CRT_NON_CONFORMING_SWPRINTFS=1 _SCL_SECURE_NO_WARNINGS=1
NOMINMAX _ENABLE_EXTENDED_ALIGNED_STORAGE=1 _HAS_EXCEPTIONS=0)
add_link_options(/DYNAMICBASE:NO /BASE:0x10000 /FIXED)
#TODO: Some of these could be cleaned up
add_compile_options(/wd4805) # Comparing boolean and int
@@ -12,19 +14,19 @@ if(MSVC)
add_link_options(/ignore:4281) # Undesirable base address 0x10000
# MSVC 2017 uses iterator as base class internally, causing a lot of warning spam
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING=1")
add_compile_definitions(_SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING=1)
# Increase stack limit to 8 MB
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:8388608,1048576")
add_link_options(/STACK:8388608,1048576)
else()
# Some distros have the compilers set to use PIE by default, but RPCS3 doesn't work with PIE, so we need to disable it.
CHECK_CXX_COMPILER_FLAG("-no-pie" HAS_NO_PIE)
CHECK_CXX_COMPILER_FLAG("-march=native" COMPILER_SUPPORTS_MARCH_NATIVE)
CHECK_CXX_COMPILER_FLAG("-msse -msse2 -mcx16" COMPILER_X86)
check_cxx_compiler_flag("-no-pie" HAS_NO_PIE)
check_cxx_compiler_flag("-march=native" COMPILER_SUPPORTS_MARCH_NATIVE)
check_cxx_compiler_flag("-msse -msse2 -mcx16" COMPILER_X86)
if (APPLE)
CHECK_CXX_COMPILER_FLAG("-march=armv8.4-a" COMPILER_ARM)
check_cxx_compiler_flag("-march=armv8.4-a" COMPILER_ARM)
else()
CHECK_CXX_COMPILER_FLAG("-march=armv8.1-a" COMPILER_ARM)
check_cxx_compiler_flag("-march=armv8.1-a" COMPILER_ARM)
endif()
add_compile_options(-Wall)
@@ -65,24 +67,24 @@ else()
add_compile_options(-Wstrict-aliasing=1)
#add_compile_options(-Wnull-dereference)
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_compile_options(-Werror=inconsistent-missing-override)
elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
add_compile_options(-Werror=suggest-override)
add_compile_options(-Wclobbered)
add_compile_options(-Wcast-function-type)
# add_compile_options(-Wcast-function-type)
add_compile_options(-Wduplicated-branches)
add_compile_options(-Wduplicated-cond)
endif()
#TODO Clean the code so these are removed
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_compile_options(-fconstexpr-steps=16777216)
add_compile_options(-Wno-unused-lambda-capture)
add_compile_options(-Wno-unused-private-field)
add_compile_options(-Wno-delete-non-virtual-dtor)
add_compile_options(-Wno-unused-command-line-argument)
elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
add_compile_options(-Wno-class-memaccess)
endif()
@@ -92,10 +94,10 @@ else()
if(NOT APPLE AND NOT WIN32)
# This hides our LLVM from mesa's LLVM, otherwise we get some unresolvable conflicts.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--exclude-libs,ALL")
add_link_options(-Wl,--exclude-libs,ALL)
if(HAS_NO_PIE)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -no-pie")
add_link_options(-no-pie)
endif()
elseif(APPLE)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
@@ -103,20 +105,18 @@ else()
endif()
if (CMAKE_OSX_ARCHITECTURES MATCHES "x86_64")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-image_base,0x10000 -Wl,-pagezero_size,0x10000")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-no_pie")
add_link_options(-Wl,-image_base,0x10000 -Wl,-pagezero_size,0x10000)
add_link_options(-Wl,-no_pie)
endif()
elseif(WIN32)
set(CMAKE_RC_COMPILER_INIT windres)
enable_language(RC)
set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> <FLAGS> -O coff <DEFINES> -i <SOURCE> -o <OBJECT>")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__STDC_FORMAT_MACROS=1")
add_compile_definitions(__STDC_FORMAT_MACROS=1)
# Workaround for mingw64 (MSYS2)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--allow-multiple-definition")
add_link_options(-Wl,--allow-multiple-definition)
# Increase stack limit to 8 MB
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--stack -Wl,8388608")
add_link_options(-Wl,--stack -Wl,8388608)
add_link_options(-Wl,--image-base,0x10000)
endif()
endif()
File diff suppressed because it is too large Load Diff
+91 -48
View File
@@ -14,56 +14,99 @@
<PreprocessorDefinitions>LLVM_AVAILABLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<AdditionalLibraryDirectories Condition="'$(Configuration)'=='Debug'">%(AdditionalLibraryDirectories);..\llvm_build\Debug\lib</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories Condition="'$(Configuration)'=='Debug'">%(AdditionalLibraryDirectories);..\3rdparty\llvm\llvm_build\Debug\lib</AdditionalLibraryDirectories>
<AdditionalDependencies>%(AdditionalDependencies);
LLVMProfileData.lib;
LLVMDebugInfoCodeView.lib;
LLVMDebugInfoMSF.lib;
LLVMInstrumentation.lib;
LLVMMCJIT.lib;
LLVMRuntimeDyld.lib;
LLVMVectorize.lib;
LLVMX86CodeGen.lib;
LLVMGlobalISel.lib;
LLVMX86Disassembler.lib;
LLVMExecutionEngine.lib;
LLVMAsmPrinter.lib;
LLVMSelectionDAG.lib;
LLVMCodeGen.lib;
LLVMScalarOpts.lib;
LLVMInstCombine.lib;
LLVMTransformUtils.lib;
LLVMAnalysis.lib;
LLVMTarget.lib;
LLVMX86Desc.lib;
LLVMObject.lib;
LLVMMCParser.lib;
LLVMBitReader.lib;
LLVMCore.lib;
LLVMMC.lib;
LLVMX86Info.lib;
LLVMSupport.lib;
LLVMMCDisassembler.lib;
LLVMipo.lib;
LLVMBinaryFormat.lib;
LLVMPasses.lib;
LLVMIRReader.lib;
LLVMLinker.lib;
LLVMAsmParser.lib;
LLVMX86AsmParser.lib;
LLVMDemangle.lib;
LLVMDebugInfoDWARF.lib;
LLVMRemarks.lib;
LLVMBitstreamReader.lib;
LLVMTextAPI.lib;
LLVMCFGuard.lib;
LLVMAggressiveInstCombine.lib;
LLVMBitWriter.lib;
LLVMCoroutines.lib;
LLVMObjCARCOpts.lib;
LLVMIntelJITEvents.lib;
LLVMAggressiveInstCombine.lib;
LLVMAnalysis.lib;
LLVMAsmParser.lib;
LLVMAsmPrinter.lib;
LLVMBinaryFormat.lib;
LLVMBitReader.lib;
LLVMBitstreamReader.lib;
LLVMBitWriter.lib;
LLVMCFGuard.lib;
LLVMCFIVerify.lib;
LLVMCodeGen.lib;
LLVMCore.lib;
LLVMCoroutines.lib;
LLVMCoverage.lib;
LLVMDebugInfoCodeView.lib;
LLVMDebuginfod.lib;
LLVMDebugInfoDWARF.lib;
LLVMDebugInfoGSYM.lib;
LLVMDebugInfoLogicalView.lib;
LLVMDebugInfoMSF.lib;
LLVMDebugInfoPDB.lib;
LLVMDemangle.lib;
LLVMDiff.lib;
LLVMDlltoolDriver.lib;
LLVMDWARFLinker.lib;
LLVMDWARFLinkerParallel.lib;
LLVMDWP.lib;
LLVMExecutionEngine.lib;
LLVMExegesis.lib;
LLVMExegesisX86.lib;
LLVMExtensions.lib;
LLVMFileCheck.lib;
LLVMFrontendHLSL.lib;
LLVMFrontendOpenACC.lib;
LLVMFrontendOpenMP.lib;
LLVMFuzzerCLI.lib;
LLVMFuzzMutate.lib;
LLVMGlobalISel.lib;
LLVMInstCombine.lib;
LLVMInstrumentation.lib;
LLVMIntelJITEvents.lib;
LLVMInterfaceStub.lib;
LLVMInterpreter.lib;
LLVMipo.lib;
LLVMIRPrinter.lib;
LLVMIRReader.lib;
LLVMJITLink.lib;
LLVMLibDriver.lib;
LLVMLineEditor.lib;
LLVMLinker.lib;
LLVMLTO.lib;
LLVMMCA.lib;
LLVMMCDisassembler.lib;
LLVMMCJIT.lib;
LLVMMC.lib;
LLVMMCParser.lib;
LLVMMIRParser.lib;
LLVMObjCARCOpts.lib;
LLVMObjCopy.lib;
LLVMObject.lib;
LLVMObjectYAML.lib;
LLVMOption.lib;
LLVMOrcJIT.lib;
LLVMOrcShared.lib;
LLVMOrcTargetProcess.lib;
LLVMPasses.lib;
LLVMProfileData.lib;
LLVMRemarks.lib;
LLVMRuntimeDyld.lib;
LLVMScalarOpts.lib;
LLVMSelectionDAG.lib;
LLVMSupport.lib;
LLVMSymbolize.lib;
LLVMTableGenGlobalISel.lib;
LLVMTableGen.lib;
LLVMTarget.lib;
LLVMTargetParser.lib;
LLVMTextAPI.lib;
LLVMTransformUtils.lib;
LLVMVectorize.lib;
LLVMWindowsDriver.lib;
LLVMWindowsManifest.lib;
LLVMX86AsmParser.lib;
LLVMX86CodeGen.lib;
LLVMX86Desc.lib;
LLVMX86Disassembler.lib;
LLVMX86Info.lib;
LLVMX86TargetMCA.lib;
LLVMXRay.lib;
</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup />
</Project>
</Project>
+91 -48
View File
@@ -15,56 +15,99 @@
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories Condition="'$(Configuration)'=='Release'">%(AdditionalLibraryDirectories);..\llvm_build\Release\lib</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories Condition="'$(Configuration)'=='Release'">%(AdditionalLibraryDirectories);..\3rdparty\llvm\llvm_build\Release\lib</AdditionalLibraryDirectories>
<AdditionalDependencies>%(AdditionalDependencies);
LLVMProfileData.lib;
LLVMDebugInfoCodeView.lib;
LLVMDebugInfoMSF.lib;
LLVMInstrumentation.lib;
LLVMMCJIT.lib;
LLVMRuntimeDyld.lib;
LLVMVectorize.lib;
LLVMX86CodeGen.lib;
LLVMGlobalISel.lib;
LLVMX86Disassembler.lib;
LLVMExecutionEngine.lib;
LLVMAsmPrinter.lib;
LLVMSelectionDAG.lib;
LLVMCodeGen.lib;
LLVMScalarOpts.lib;
LLVMInstCombine.lib;
LLVMTransformUtils.lib;
LLVMAnalysis.lib;
LLVMTarget.lib;
LLVMX86Desc.lib;
LLVMObject.lib;
LLVMMCParser.lib;
LLVMBitReader.lib;
LLVMCore.lib;
LLVMMC.lib;
LLVMX86Info.lib;
LLVMSupport.lib;
LLVMMCDisassembler.lib;
LLVMipo.lib;
LLVMBinaryFormat.lib;
LLVMPasses.lib;
LLVMIRReader.lib;
LLVMLinker.lib;
LLVMAsmParser.lib;
LLVMX86AsmParser.lib;
LLVMDemangle.lib;
LLVMDebugInfoDWARF.lib;
LLVMRemarks.lib;
LLVMBitstreamReader.lib;
LLVMTextAPI.lib;
LLVMCFGuard.lib;
LLVMAggressiveInstCombine.lib;
LLVMBitWriter.lib;
LLVMCoroutines.lib;
LLVMObjCARCOpts.lib;
LLVMIntelJITEvents.lib;
LLVMAggressiveInstCombine.lib;
LLVMAnalysis.lib;
LLVMAsmParser.lib;
LLVMAsmPrinter.lib;
LLVMBinaryFormat.lib;
LLVMBitReader.lib;
LLVMBitstreamReader.lib;
LLVMBitWriter.lib;
LLVMCFGuard.lib;
LLVMCFIVerify.lib;
LLVMCodeGen.lib;
LLVMCore.lib;
LLVMCoroutines.lib;
LLVMCoverage.lib;
LLVMDebugInfoCodeView.lib;
LLVMDebuginfod.lib;
LLVMDebugInfoDWARF.lib;
LLVMDebugInfoGSYM.lib;
LLVMDebugInfoLogicalView.lib;
LLVMDebugInfoMSF.lib;
LLVMDebugInfoPDB.lib;
LLVMDemangle.lib;
LLVMDiff.lib;
LLVMDlltoolDriver.lib;
LLVMDWARFLinker.lib;
LLVMDWARFLinkerParallel.lib;
LLVMDWP.lib;
LLVMExecutionEngine.lib;
LLVMExegesis.lib;
LLVMExegesisX86.lib;
LLVMExtensions.lib;
LLVMFileCheck.lib;
LLVMFrontendHLSL.lib;
LLVMFrontendOpenACC.lib;
LLVMFrontendOpenMP.lib;
LLVMFuzzerCLI.lib;
LLVMFuzzMutate.lib;
LLVMGlobalISel.lib;
LLVMInstCombine.lib;
LLVMInstrumentation.lib;
LLVMIntelJITEvents.lib;
LLVMInterfaceStub.lib;
LLVMInterpreter.lib;
LLVMipo.lib;
LLVMIRPrinter.lib;
LLVMIRReader.lib;
LLVMJITLink.lib;
LLVMLibDriver.lib;
LLVMLineEditor.lib;
LLVMLinker.lib;
LLVMLTO.lib;
LLVMMCA.lib;
LLVMMCDisassembler.lib;
LLVMMCJIT.lib;
LLVMMC.lib;
LLVMMCParser.lib;
LLVMMIRParser.lib;
LLVMObjCARCOpts.lib;
LLVMObjCopy.lib;
LLVMObject.lib;
LLVMObjectYAML.lib;
LLVMOption.lib;
LLVMOrcJIT.lib;
LLVMOrcShared.lib;
LLVMOrcTargetProcess.lib;
LLVMPasses.lib;
LLVMProfileData.lib;
LLVMRemarks.lib;
LLVMRuntimeDyld.lib;
LLVMScalarOpts.lib;
LLVMSelectionDAG.lib;
LLVMSupport.lib;
LLVMSymbolize.lib;
LLVMTableGenGlobalISel.lib;
LLVMTableGen.lib;
LLVMTarget.lib;
LLVMTargetParser.lib;
LLVMTextAPI.lib;
LLVMTransformUtils.lib;
LLVMVectorize.lib;
LLVMWindowsDriver.lib;
LLVMWindowsManifest.lib;
LLVMX86AsmParser.lib;
LLVMX86CodeGen.lib;
LLVMX86Desc.lib;
LLVMX86Disassembler.lib;
LLVMX86Info.lib;
LLVMX86TargetMCA.lib;
LLVMXRay.lib;
</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup />
</Project>
</Project>
Submodule llvm deleted from 9b52b6c39a
+11 -2
View File
@@ -6,11 +6,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asmjit", "3rdparty\asmjit\a
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "emucore", "rpcs3\emucore.vcxproj", "{C4A10229-4712-4BD2-B63E-50D93C67A038}"
ProjectSection(ProjectDependencies) = postProject
{2C902C67-985C-4BE0-94A3-E0FE2EB929A3} = {2C902C67-985C-4BE0-94A3-E0FE2EB929A3}
{5228F863-E0DD-4DE7-AA7B-5C52B14CD4D0} = {5228F863-E0DD-4DE7-AA7B-5C52B14CD4D0}
{939FE206-1182-ABC3-1234-FEAB88E98404} = {939FE206-1182-ABC3-1234-FEAB88E98404}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm_build", "llvm_build\llvm_build.vcxproj", "{8BC303AB-25BE-4276-8E57-73F171B2D672}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm_build", "3rdparty\llvm\llvm_build\llvm_build.vcxproj", "{8BC303AB-25BE-4276-8E57-73F171B2D672}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GLGSRender", "rpcs3\GLGSRender.vcxproj", "{3384223A-6D97-4799-9862-359F85312892}"
EndProject
@@ -41,6 +42,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "yaml-cpp", "3rdparty\yaml-c
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rpcs3", "rpcs3\rpcs3.vcxproj", "{70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12}"
ProjectSection(ProjectDependencies) = postProject
{2C902C67-985C-4BE0-94A3-E0FE2EB929A3} = {2C902C67-985C-4BE0-94A3-E0FE2EB929A3}
{3384223A-6D97-4799-9862-359F85312892} = {3384223A-6D97-4799-9862-359F85312892}
{349EE8F9-7D25-4909-AAF5-FF3FADE72187} = {349EE8F9-7D25-4909-AAF5-FF3FADE72187}
{3EE5F075-B546-42C4-B6A8-E3CCEF38B78D} = {3EE5F075-B546-42C4-B6A8-E3CCEF38B78D}
@@ -79,7 +81,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "spirv", "3rdparty\SPIRV\spi
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "3rdParty", "3rdParty", "{6C3B64A0-8F8A-4DC4-8C0B-D71EBEED7FA8}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm_build_clang_cl", "llvm_build\llvm_build_clang_cl.vcxproj", "{A37E4273-85DB-4217-B775-CE971B87D9DF}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm_build_clang_cl", "3rdparty\llvm\llvm_build\llvm_build_clang_cl.vcxproj", "{A37E4273-85DB-4217-B775-CE971B87D9DF}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Cubeb", "rpcs3\Cubeb.vcxproj", "{9610627D-20FE-4B07-8CE3-9FF68A5F1EC2}"
EndProject
@@ -96,6 +98,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "pine", "pine", "{A55DA1B5-C
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "miniupnpc_static", "3rdparty\miniupnp\miniupnpc_static.vcxproj", "{5228F863-E0DD-4DE7-AA7B-5C52B14CD4D0}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rtmidi", "3rdparty\rtmidi\rtmidi.vcxproj", "{2C902C67-985C-4BE0-94A3-E0FE2EB929A3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
@@ -194,6 +198,10 @@ Global
{5228F863-E0DD-4DE7-AA7B-5C52B14CD4D0}.Debug|x64.Build.0 = Debug|x64
{5228F863-E0DD-4DE7-AA7B-5C52B14CD4D0}.Release|x64.ActiveCfg = Release|x64
{5228F863-E0DD-4DE7-AA7B-5C52B14CD4D0}.Release|x64.Build.0 = Release|x64
{2C902C67-985C-4BE0-94A3-E0FE2EB929A3}.Debug|x64.ActiveCfg = Debug|x64
{2C902C67-985C-4BE0-94A3-E0FE2EB929A3}.Debug|x64.Build.0 = Debug|x64
{2C902C67-985C-4BE0-94A3-E0FE2EB929A3}.Release|x64.ActiveCfg = Release|x64
{2C902C67-985C-4BE0-94A3-E0FE2EB929A3}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -224,6 +232,7 @@ Global
{8DC244EE-A0BD-4038-BAF7-CFAFA5EB2BAA} = {6C3B64A0-8F8A-4DC4-8C0B-D71EBEED7FA8}
{A55DA1B5-CC17-4525-BE7F-1659CE17BB56} = {6C3B64A0-8F8A-4DC4-8C0B-D71EBEED7FA8}
{5228F863-E0DD-4DE7-AA7B-5C52B14CD4D0} = {6C3B64A0-8F8A-4DC4-8C0B-D71EBEED7FA8}
{2C902C67-985C-4BE0-94A3-E0FE2EB929A3} = {6C3B64A0-8F8A-4DC4-8C0B-D71EBEED7FA8}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {06CC7920-E085-4B81-9582-8DE8AAD42510}
+38 -56
View File
@@ -1,9 +1,4 @@

if(USE_PRECOMPILED_HEADERS AND NOT COMMAND target_precompile_headers)
include(cotire)
endif()
# Define GNU standard installation directories
# Define GNU standard installation directories
include(GNUInstallDirs)
# Generate git-version.h at build time.
@@ -16,10 +11,10 @@ include(CheckFunctionExists)
set(CMAKE_CXX_STANDARD 20)
set(ADDITIONAL_LIBS "")
if(CMAKE_SYSTEM MATCHES "Linux")
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
#on some Linux distros shm_unlink and similar functions are in librt only
set(ADDITIONAL_LIBS ${ADDITIONAL_LIBS} "rt")
elseif(NOT MSVC AND NOT CMAKE_CXX_FLAGS MATCHES "LIBICONV_PLUG")
elseif(NOT WIN32 AND NOT CMAKE_CXX_FLAGS MATCHES "LIBICONV_PLUG")
#it seems like glibc includes the iconv functions we use but other libc
#implementations like the one on OSX don't seem implement them
set(ADDITIONAL_LIBS ${ADDITIONAL_LIBS} "iconv")
@@ -34,13 +29,6 @@ if(UNIX AND NOT APPLE)
endif()
endif()
if(NOT RPCS3_SRC_DIR)
set(RPCS3_SRC_DIR ${CMAKE_CURRENT_LIST_DIR})
message("-- Initializing RPCS3_SRC_DIR=${RPCS3_SRC_DIR}")
else()
message("-- Using Custom RPCS3_SRC_DIR=${RPCS3_SRC_DIR}")
endif()
# Qt5
# finds Qt libraries and setups custom commands for MOC and UIC
# Must be done here because generated MOC and UIC targets cant
@@ -51,7 +39,21 @@ include(${CMAKE_SOURCE_DIR}/3rdparty/qt5.cmake)
add_subdirectory(Emu)
add_subdirectory(rpcs3qt)
set(RPCS3_SRC
if(WIN32)
add_executable(rpcs3 WIN32)
target_sources(rpcs3 PRIVATE rpcs3.rc)
elseif(APPLE)
add_executable(rpcs3 MACOSX_BUNDLE)
target_sources(rpcs3 PRIVATE rpcs3.icns)
set_target_properties(rpcs3
PROPERTIES
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/rpcs3.plist.in")
else()
add_executable(rpcs3)
endif()
target_sources(rpcs3
PRIVATE
display_sleep_control.cpp
headless_application.cpp
main.cpp
@@ -75,36 +77,20 @@ set(RPCS3_SRC
Input/xinput_pad_handler.cpp
)
if(WIN32)
add_executable(rpcs3 WIN32 ${RPCS3_SRC})
elseif(APPLE)
add_executable(rpcs3 MACOSX_BUNDLE ${RPCS3_SRC} "${RPCS3_SRC_DIR}/rpcs3.icns")
set_target_properties(rpcs3
PROPERTIES
MACOSX_BUNDLE_INFO_PLIST "${RPCS3_SRC_DIR}/rpcs3.plist.in")
else()
add_executable(rpcs3 ${RPCS3_SRC})
endif()
gen_git_version(${RPCS3_SRC_DIR})
gen_git_version(${CMAKE_CURRENT_SOURCE_DIR})
set_target_properties(rpcs3
PROPERTIES
AUTOMOC ON
AUTOUIC ON)
target_link_libraries(rpcs3 rpcs3_emu rpcs3_ui)
target_link_libraries(rpcs3 3rdparty::discordRPC 3rdparty::qt5 3rdparty::hidapi 3rdparty::libusb 3rdparty::wolfssl 3rdparty::libcurl)
target_link_libraries(rpcs3 ${ADDITIONAL_LIBS})
# Win resource file
if(WIN32)
target_sources(rpcs3 PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/rpcs3.rc")
endif()
target_link_libraries(rpcs3 PRIVATE rpcs3_emu rpcs3_ui)
target_link_libraries(rpcs3 PRIVATE 3rdparty::discordRPC 3rdparty::qt5 3rdparty::hidapi 3rdparty::libusb 3rdparty::wolfssl 3rdparty::libcurl 3rdparty::zlib)
target_link_libraries(rpcs3 PRIVATE ${ADDITIONAL_LIBS})
# Unix display manager
if(X11_FOUND)
target_include_directories(rpcs3 PUBLIC ${X11_INCLUDE_DIR})
target_link_libraries(rpcs3 ${X11_LIBRARIES})
target_link_libraries(rpcs3 PRIVATE ${X11_LIBRARIES})
elseif(USE_VULKAN AND UNIX AND NOT WAYLAND_FOUND AND NOT APPLE)
# Wayland has been checked in 3rdparty/CMakeLists.txt already.
message(FATAL_ERROR "RPCS3 requires either X11 or Wayland (or both) for Vulkan.")
@@ -113,30 +99,26 @@ endif()
if(UNIX)
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
find_package(Threads REQUIRED)
target_link_libraries(rpcs3 Threads::Threads)
target_link_libraries(rpcs3 PRIVATE Threads::Threads)
endif()
if(WIN32)
target_link_libraries(rpcs3 ws2_32.lib Iphlpapi.lib Winmm.lib Psapi.lib gdi32.lib setupapi.lib)
target_link_libraries(rpcs3 PRIVATE ws2_32 Iphlpapi Winmm Psapi gdi32 setupapi pdh)
else()
target_link_libraries(rpcs3 ${CMAKE_DL_LIBS})
target_link_libraries(rpcs3 PRIVATE ${CMAKE_DL_LIBS})
endif()
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)
endif()
target_precompile_headers(rpcs3 PRIVATE stdafx.h)
endif()
get_target_property(_qmake_executable Qt5::qmake IMPORTED_LOCATION)
get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY)
find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${_qt_bin_dir}")
if(APPLE)
find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${_qt_bin_dir}")
elseif(WIN32)
find_program(WINDEPLOYQT_EXECUTABLE windeployqt HINTS "${_qt_bin_dir}")
endif()
# Copy icons to executable directory
if(APPLE)
@@ -147,7 +129,7 @@ if(APPLE)
endif()
add_custom_command(TARGET rpcs3 POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${RPCS3_SRC_DIR}/rpcs3.icns $<TARGET_FILE_DIR:rpcs3>/../Resources/rpcs3.icns
${CMAKE_CURRENT_SOURCE_DIR}/rpcs3.icns $<TARGET_FILE_DIR:rpcs3>/../Resources/rpcs3.icns
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/bin/Icons $<TARGET_FILE_DIR:rpcs3>/../Resources/Icons
COMMAND ${CMAKE_COMMAND} -E copy_directory
@@ -183,18 +165,18 @@ elseif(WIN32)
# share/cmake/Qt5/ for Qt5_Dir
# If Qt5 is installed from official Qt installer
list(APPEND _QT5_TOOLS_PATHS "${Qt5_DIR}/../../../bin/")
# list(APPEND _QT5_TOOLS_PATHS "${Qt5_DIR}/../../../bin/")
# If Qt5 is installed from vcpkg
list(APPEND _QT5_TOOLS_PATHS "${Qt5_DIR}/../../../tools/qt5$<$<CONFIG:Debug>:/debug>/bin/")
# list(APPEND _QT5_TOOLS_PATHS "${Qt5_DIR}/../../../tools/qt5$<$<CONFIG:Debug>:/debug>/bin/")
add_custom_command(TARGET rpcs3 POST_BUILD
COMMAND set PATH=${_QT5_TOOLS_PATHS}$<SEMICOLON>%PATH%
# COMMAND set PATH=${_QT5_TOOLS_PATHS}$<SEMICOLON>%PATH%
COMMAND "${CMAKE_COMMAND}" -E copy_directory "${CMAKE_SOURCE_DIR}/bin" "$<TARGET_FILE_DIR:rpcs3>"
# If Qt5 is installed from vcpkg, add binary path to PATH
# otherwise windeployqt tool won't be able to locate necessary dlls
COMMAND set PATH=${Qt5_DIR}/../../../$<$<CONFIG:Debug>:debug/>bin/$<SEMICOLON>%PATH%
COMMAND "${_WINDEPLOYQT}" --no-angle --no-compiler-runtime --no-opengl-sw --no-patchqt --no-translations --no-quick --plugindir "$<TARGET_FILE_DIR:rpcs3>/qt/plugins" $<$<CONFIG:Debug>:--debug> $<$<CONFIG:Release>:--release> "$<TARGET_FILE:rpcs3>")
# COMMAND set PATH=${Qt5_DIR}/../../../$<$<CONFIG:Debug>:debug/>bin/$<SEMICOLON>%PATH%
COMMAND "${WINDEPLOYQT_EXECUTABLE}" --no-angle --no-compiler-runtime --no-opengl-sw --no-patchqt --no-translations --no-quick --plugindir "$<TARGET_FILE_DIR:rpcs3>/qt/plugins" --verbose 0 "$<TARGET_FILE:rpcs3>")
endif()
# Unix installation
+57 -50
View File
@@ -11,46 +11,77 @@
LOG_CHANNEL(dec_log, "DECRYPT");
void decrypt_sprx_libraries(std::vector<std::string> modules, std::function<std::string(std::string old_path, std::string path, bool tried)> input_cb)
usz decrypt_binaries_t::decrypt(std::string klic_input)
{
if (modules.empty())
if (m_index >= m_modules.size())
{
std::cout << "No paths specified" << std::endl; // For CLI
return;
m_index = umax;
return umax;
}
dec_log.notice("Decrypting binaries...");
std::cout << "Decrypting binaries..." << std::endl; // For CLI
// Always start with no KLIC
std::vector<u128> klics{u128{}};
if (const auto keys = g_fxo->try_get<loaded_npdrm_keys>())
if (m_klics.empty())
{
// Second klic: get it from a running game
if (const u128 klic = keys->last_key())
dec_log.notice("Decrypting binaries...");
std::cout << "Decrypting binaries..." << std::endl; // For CLI
// Always start with no KLIC
m_klics.emplace_back(u128{});
if (const auto keys = g_fxo->try_get<loaded_npdrm_keys>())
{
klics.emplace_back(klic);
// Second klic: get it from a running game
if (const u128 klic = keys->last_key())
{
m_klics.emplace_back(klic);
}
}
// Try to use the key that has been for the current running ELF
m_klics.insert(m_klics.end(), Emu.klic.begin(), Emu.klic.end());
}
if (std::string_view text = std::string_view{klic_input}.substr(klic_input.find_first_of('x') + 1); text.size() == 32)
{
// Allowed to fail (would simply repeat the operation if fails again)
u64 lo = 0;
u64 hi = 0;
bool success = false;
if (auto res = std::from_chars(text.data() + 0, text.data() + 16, lo, 16); res.ec == std::errc() && res.ptr == text.data() + 16)
{
if (res = std::from_chars(text.data() + 16, text.data() + 32, hi, 16); res.ec == std::errc() && res.ptr == text.data() + 32)
{
success = true;
}
}
if (success)
{
lo = std::bit_cast<be_t<u64>>(lo);
hi = std::bit_cast<be_t<u64>>(hi);
if (u128 input_key = ((u128{hi} << 64) | lo))
{
m_klics.emplace_back(input_key);
}
}
}
// Try to use the key that has been for the current running ELF
klics.insert(klics.end(), Emu.klic.begin(), Emu.klic.end());
for (const std::string& _module : modules)
while (m_index < m_modules.size())
{
const std::string& _module = m_modules[m_index];
const std::string old_path = _module;
fs::file elf_file;
bool tried = false;
bool invalid = false;
usz key_it = 0;
u32 file_magic{};
while (true)
{
for (; key_it < klics.size(); key_it++)
for (; key_it < m_klics.size(); key_it++)
{
if (!elf_file.open(old_path) || !elf_file.read(file_magic))
{
@@ -62,7 +93,7 @@ void decrypt_sprx_libraries(std::vector<std::string> modules, std::function<std:
case "SCE\0"_u32:
{
// First KLIC is no KLIC
elf_file = decrypt_self(std::move(elf_file), key_it != 0 ? reinterpret_cast<u8*>(&klics[key_it]) : nullptr);
elf_file = decrypt_self(std::move(elf_file), key_it != 0 ? reinterpret_cast<u8*>(&m_klics[key_it]) : nullptr);
if (!elf_file)
{
@@ -75,7 +106,7 @@ void decrypt_sprx_libraries(std::vector<std::string> modules, std::function<std:
case "NPD\0"_u32:
{
// EDAT / SDAT
elf_file = DecryptEDAT(elf_file, old_path, key_it != 0 ? 8 : 1, reinterpret_cast<u8*>(&klics[key_it]), true);
elf_file = DecryptEDAT(elf_file, old_path, key_it != 0 ? 8 : 1, reinterpret_cast<u8*>(&m_klics[key_it]), true);
if (!elf_file)
{
@@ -111,11 +142,13 @@ void decrypt_sprx_libraries(std::vector<std::string> modules, std::function<std:
new_file.write(elf_file.to_string());
dec_log.success("Decrypted %s -> %s", old_path, new_path);
std::cout << "Decrypted " << old_path << " -> " << new_path << std::endl; // For CLI
m_index++;
}
else
{
dec_log.error("Failed to create %s", new_path);
std::cout << "Failed to create " << new_path << std::endl; // For CLI
m_index = umax;
}
break;
@@ -124,42 +157,16 @@ void decrypt_sprx_libraries(std::vector<std::string> modules, std::function<std:
if (!invalid)
{
// Allow the user to manually type KLIC if decryption failed
const std::string filename = old_path.substr(old_path.find_last_of(fs::delim) + 1);
const std::string text = input_cb ? input_cb(old_path, filename, tried) : "";
if (!text.empty())
{
auto& klic = (tried ? klics.back() : klics.emplace_back());
ensure(text.size() == 32);
// It must succeed (only hex characters are present)
u64 lo_ = 0;
u64 hi_ = 0;
std::from_chars(&text[0], &text[16], lo_, 16);
std::from_chars(&text[16], &text[32], hi_, 16);
be_t<u64> lo = std::bit_cast<be_t<u64>>(lo_);
be_t<u64> hi = std::bit_cast<be_t<u64>>(hi_);
klic = (u128{+hi} << 64) | +lo;
// Retry with specified KLIC
key_it -= +std::exchange(tried, true); // Rewind on second and above attempt
dec_log.notice("KLIC entered for %s: %s", filename, klic);
continue;
}
dec_log.notice("User has cancelled entering KLIC.");
return m_index;
}
dec_log.error("Failed to decrypt \"%s\".", old_path);
std::cout << "Failed to decrypt \"" << old_path << "\"." << std::endl; // For CLI
break;
return m_index;
}
}
dec_log.notice("Finished decrypting all binaries.");
std::cout << "Finished decrypting all binaries." << std::endl; // For CLI
return m_index;
}
+24 -1
View File
@@ -1,3 +1,26 @@
#pragma once
void decrypt_sprx_libraries(std::vector<std::string> modules, std::function<std::string(std::string old_path, std::string path, bool tried)> input_cb);
class decrypt_binaries_t
{
std::vector<u128> m_klics;
std::vector<std::string> m_modules;
usz m_index = 0;
public:
decrypt_binaries_t(std::vector<std::string> modules) noexcept
: m_modules(std::move(modules))
{
}
usz decrypt(std::string klic_input = {});
bool done() const
{
return m_index >= m_klics.size();
}
const std::string& operator[](usz index) const
{
return ::at32(m_modules, index);
}
};
+65 -101
View File
@@ -5,21 +5,9 @@
#include "utils.h"
#include <cstring>
static void bn_zero(u8* d, u32 n)
static inline int bn_compare(u8* a, u8* b, u32 n)
{
memset(d, 0, n);
}
static void bn_copy(u8* d, u8* a, u32 n)
{
memcpy(d, a, n);
}
static int bn_compare(u8* a, u8* b, u32 n)
{
u32 i;
for (i = 0; i < n; i++)
for (u32 i = 0; i < n; i++)
{
if (a[i] < b[i])
return -1;
@@ -32,14 +20,10 @@ static int bn_compare(u8* a, u8* b, u32 n)
static u8 bn_add_1(u8* d, u8* a, u8* b, u32 n)
{
u32 i;
u32 dig;
u8 c;
c = 0;
for (i = n - 1; i < n; i--)
u8 c = 0;
for (u32 i = n - 1; i != umax; i--)
{
dig = a[i] + b[i] + c;
const u32 dig = a[i] + b[i] + c;
c = dig >> 8;
d[i] = dig;
}
@@ -49,14 +33,10 @@ static u8 bn_add_1(u8* d, u8* a, u8* b, u32 n)
static u8 bn_sub_1(u8* d, u8* a, u8* b, u32 n)
{
u32 i;
u32 dig;
u8 c;
c = 1;
for (i = n - 1; i < n; i--)
u8 c = 1;
for (u32 i = n - 1; i != umax; i--)
{
dig = a[i] + 255 - b[i] + c;
const u32 dig = a[i] + 255 - b[i] + c;
c = dig >> 8;
d[i] = dig;
}
@@ -105,15 +85,12 @@ static constexpr u8 inv256[0x80] = {
static void bn_mon_muladd_dig(u8* d, u8* a, u8 b, u8* N, u32 n)
{
u32 dig;
u32 i;
const u8 z = -(d[n - 1] + a[n - 1] * b) * inv256[N[n - 1] / 2];
dig = d[n - 1] + a[n - 1] * b + N[n - 1] * z;
u32 dig = d[n - 1] + a[n - 1] * b + N[n - 1] * z;
dig >>= 8;
for (i = n - 2; i < n; i--)
for (u32 i = n - 2; i < n; i--)
{
dig += d[i] + a[i] * b + N[i] * z;
d[i + 1] = dig;
@@ -132,21 +109,17 @@ static void bn_mon_muladd_dig(u8* d, u8* a, u8 b, u8* N, u32 n)
static void bn_mon_mul(u8* d, u8* a, u8* b, u8* N, u32 n)
{
u8 t[512];
u32 i;
memset(t, 0, n);
bn_zero(t, n);
for (i = n - 1; i < n; i--)
for (u32 i = n - 1; i != umax; i--)
bn_mon_muladd_dig(t, a, b[i], N, n);
bn_copy(d, t, n);
memcpy(d, t, n);
}
static void bn_to_mon(u8* d, u8* N, u32 n)
{
u32 i;
for (i = 0; i < 8 * n; i++)
for (u32 i = 0; i < 8 * n; i++)
bn_add(d, d, d, N, n);
}
@@ -154,7 +127,7 @@ static void bn_from_mon(u8* d, u8* N, u32 n)
{
u8 t[512];
bn_zero(t, n);
memset(t, 0, n);
t[n - 1] = 1;
bn_mon_mul(d, d, t, N, n);
}
@@ -162,29 +135,29 @@ static void bn_from_mon(u8* d, u8* N, u32 n)
static void bn_mon_exp(u8* d, u8* a, u8* N, u32 n, u8* e, u32 en)
{
u8 t[512];
u32 i;
u8 mask;
bn_zero(d, n);
memset(d, 0, n);
d[n - 1] = 1;
bn_to_mon(d, N, n);
for (i = 0; i < en; i++)
for (mask = 0x80; mask != 0; mask >>= 1)
for (u32 i = 0; i < en; i++)
{
for (u8 mask = 0x80; mask != 0; mask >>= 1)
{
bn_mon_mul(t, d, d, N, n);
if ((e[i] & mask) != 0)
bn_mon_mul(d, t, a, N, n);
else
bn_copy(d, t, n);
memcpy(d, t, n);
}
}
}
static void bn_mon_inv(u8* d, u8* a, u8* N, u32 n)
{
u8 t[512], s[512];
bn_zero(s, n);
memset(s, 0, n);
s[n - 1] = 2;
bn_sub_1(t, N, s, n);
bn_mon_exp(d, a, N, n, t, n);
@@ -203,26 +176,16 @@ static thread_local u8 ec_N[21]{};
static thread_local point ec_G{}; // mon
static thread_local point ec_Q{}; // mon
static thread_local u8 ec_k[21]{};
static thread_local bool ec_curve_initialized{};
static thread_local bool ec_pub_initialized{};
static void elt_copy(u8* d, u8* a)
static inline bool elt_is_zero(u8* d)
{
memcpy(d, a, 20);
}
static void elt_zero(u8* d)
{
memset(d, 0, 20);
}
static int elt_is_zero(u8* d)
{
u32 i;
for (i = 0; i < 20; i++)
for (u32 i = 0; i < 20; i++)
if (d[i] != 0)
return 0;
return false;
return 1;
return true;
}
static void elt_add(u8* d, u8* a, u8* b)
@@ -248,7 +211,7 @@ static void elt_square(u8* d, u8* a)
static void elt_inv(u8* d, u8* a)
{
u8 s[20];
elt_copy(s, a);
memcpy(s, a, 20);
bn_mon_inv(d, s, ec_p, 20);
}
@@ -264,13 +227,13 @@ static void point_from_mon(point* p)
bn_from_mon(p->y, ec_p, 20);
}
static void point_zero(point* p)
static inline void point_zero(point* p)
{
elt_zero(p->x);
elt_zero(p->y);
memset(p->x, 0, 20);
memset(p->y, 0, 20);
}
static int point_is_zero(point* p)
static inline bool point_is_zero(point* p)
{
return elt_is_zero(p->x) && elt_is_zero(p->y);
}
@@ -278,15 +241,13 @@ static int point_is_zero(point* p)
static void point_double(point* r, point* p)
{
u8 s[20], t[20];
point pp;
u8 *px, *py, *rx, *ry;
pp = *p;
point pp = *p;
px = pp.x;
py = pp.y;
rx = r->x;
ry = r->y;
u8* px = pp.x;
u8* py = pp.y;
u8* rx = r->x;
u8* ry = r->y;
if (elt_is_zero(py))
{
@@ -314,30 +275,28 @@ static void point_double(point* r, point* p)
static void point_add(point* r, point* p, point* q)
{
u8 s[20], t[20], u[20];
u8 *px, *py, *qx, *qy, *rx, *ry;
point pp, qq;
pp = *p;
qq = *q;
point pp = *p;
point qq = *q;
px = pp.x;
py = pp.y;
qx = qq.x;
qy = qq.y;
rx = r->x;
ry = r->y;
u8* px = pp.x;
u8* py = pp.y;
u8* qx = qq.x;
u8* qy = qq.y;
u8* rx = r->x;
u8* ry = r->y;
if (point_is_zero(&pp))
{
elt_copy(rx, qx);
elt_copy(ry, qy);
memcpy(rx, qx, 20);
memcpy(ry, qy, 20);
return;
}
if (point_is_zero(&qq))
{
elt_copy(rx, px);
elt_copy(ry, py);
memcpy(rx, px, 20);
memcpy(ry, py, 20);
return;
}
@@ -369,21 +328,20 @@ static void point_add(point* r, point* p, point* q)
static void point_mul(point* d, u8* a, point* b) // a is bignum
{
u32 i;
u8 mask;
point_zero(d);
for (i = 0; i < 21; i++)
for (mask = 0x80; mask != 0; mask >>= 1)
for (u32 i = 0; i < 21; i++)
{
for (u8 mask = 0x80; mask != 0; mask >>= 1)
{
point_double(d, d);
if ((a[i] & mask) != 0)
point_add(d, d, b);
}
}
}
static int check_ecdsa(struct point* Q, u8* R, u8* S, u8* hash)
static bool check_ecdsa(struct point* Q, u8* R, u8* S, u8* hash)
{
u8 Sinv[21];
u8 e[21];
@@ -424,8 +382,10 @@ static int check_ecdsa(struct point* Q, u8* R, u8* S, u8* hash)
return (bn_compare(rr, R, 21) == 0);
}
int ecdsa_set_curve(const u8* p, const u8* a, const u8* b, const u8* N, const u8* Gx, const u8* Gy)
void ecdsa_set_curve(const u8* p, const u8* a, const u8* b, const u8* N, const u8* Gx, const u8* Gy)
{
if (ec_curve_initialized) return;
memcpy(ec_p, p, 20);
memcpy(ec_a, a, 20);
memcpy(ec_b, b, 20);
@@ -438,14 +398,18 @@ int ecdsa_set_curve(const u8* p, const u8* a, const u8* b, const u8* N, const u8
point_to_mon(&ec_G);
return 0;
ec_curve_initialized = true;
}
void ecdsa_set_pub(const u8* Q)
{
if (ec_pub_initialized) return;
memcpy(ec_Q.x, Q, 20);
memcpy(ec_Q.y, Q+20, 20);
memcpy(ec_Q.y, Q + 20, 20);
point_to_mon(&ec_Q);
ec_pub_initialized = true;
}
void ecdsa_set_priv(const u8* k)
@@ -453,7 +417,7 @@ void ecdsa_set_priv(const u8* k)
memcpy(ec_k, k, sizeof ec_k);
}
int ecdsa_verify(u8* hash, u8* R, u8* S)
bool ecdsa_verify(u8* hash, u8* R, u8* S)
{
return check_ecdsa(&ec_Q, R, S, hash);
}
+2 -2
View File
@@ -6,7 +6,7 @@
#include "util/types.hpp"
int ecdsa_set_curve(const u8* p, const u8* a, const u8* b, const u8* N, const u8* Gx, const u8* Gy);
void ecdsa_set_curve(const u8* p, const u8* a, const u8* b, const u8* N, const u8* Gx, const u8* Gy);
void ecdsa_set_pub(const u8* Q);
void ecdsa_set_priv(const u8* k);
int ecdsa_verify(u8* hash, u8* R, u8* S);
bool ecdsa_verify(u8* hash, u8* R, u8* S);
+4
View File
@@ -493,7 +493,9 @@ int check_data(unsigned char *key, EDAT_HEADER *edat, NPD_HEADER *npd, const fs:
memcpy(signature_r + 01, metadata_signature, 0x14);
memcpy(signature_s + 01, metadata_signature + 0x14, 0x14);
if ((!memcmp(signature_r, zero_buf, 0x15)) || (!memcmp(signature_s, zero_buf, 0x15)))
{
edat_log.warning("Metadata signature is invalid!");
}
else
{
// Setup signature hash.
@@ -524,7 +526,9 @@ int check_data(unsigned char *key, EDAT_HEADER *edat, NPD_HEADER *npd, const fs:
memcpy(signature_s + 01, header_signature + 0x14, 0x14);
if ((!memcmp(signature_r, zero_buf, 0x15)) || (!memcmp(signature_s, zero_buf, 0x15)))
{
edat_log.warning("Header signature is invalid!");
}
else
{
// Setup header signature hash.
+9 -2
View File
@@ -95,9 +95,9 @@ public:
bool ReadHeader();
u64 ReadData(u64 pos, u8* data, u64 size);
fs::stat_t stat() override
fs::stat_t get_stat() override
{
fs::stat_t stats = edata_file.stat();
fs::stat_t stats = edata_file.get_stat();
stats.is_writable = false; // TODO
stats.size = file_size;
return stats;
@@ -143,4 +143,11 @@ public:
}
u64 size() override { return file_size; }
fs::file_id get_id() override
{
fs::file_id id = edata_file.get_id();
id.type.insert(0, "EDATADecrypter: "sv);
return id;
}
};
+43 -31
View File
@@ -67,7 +67,7 @@ bool package_reader::read_header()
}
pkg_log.notice("Path: '%s'", m_path);
pkg_log.notice("Header: pkg_magic = 0x%x = \"%s\"", +m_header.pkg_magic, std::string(reinterpret_cast<const char*>(&m_header.pkg_magic), 4));
pkg_log.notice("Header: pkg_magic = 0x%x = \"%s\"", +m_header.pkg_magic, std::string_view(reinterpret_cast<const char*>(&m_header.pkg_magic + 1), 3)); // Skip 0x7F
pkg_log.notice("Header: pkg_type = 0x%x = %d", m_header.pkg_type, m_header.pkg_type);
pkg_log.notice("Header: pkg_platform = 0x%x = %d", m_header.pkg_platform, m_header.pkg_platform);
pkg_log.notice("Header: meta_offset = 0x%x = %d", m_header.meta_offset, m_header.meta_offset);
@@ -94,7 +94,7 @@ bool package_reader::read_header()
return false;
}
pkg_log.notice("Extended header: magic = 0x%x = \"%s\"", +ext_header.magic, std::string(reinterpret_cast<const char*>(&ext_header.magic), 4));
pkg_log.notice("Extended header: magic = 0x%x = \"%s\"", +ext_header.magic, std::string_view(reinterpret_cast<const char*>(&ext_header.magic + 1), 3));
pkg_log.notice("Extended header: unknown_1 = 0x%x = %d", ext_header.unknown_1, ext_header.unknown_1);
pkg_log.notice("Extended header: ext_hdr_size = 0x%x = %d", ext_header.ext_hdr_size, ext_header.ext_hdr_size);
pkg_log.notice("Extended header: ext_data_size = 0x%x = %d", ext_header.ext_data_size, ext_header.ext_data_size);
@@ -782,7 +782,7 @@ bool package_reader::fill_data(std::map<std::string, install_entry*>& all_instal
const bool is_psp = (entry.type & PKG_FILE_ENTRY_PSP) != 0u;
decrypt(entry.name_offset, entry.name_size, is_psp ? PKG_AES_KEY2 : m_dec_key.data());
const std::string name{reinterpret_cast<char*>(m_bufs.back().get()), entry.name_size};
const std::string_view name{reinterpret_cast<char*>(m_bufs.back().get()), entry.name_size};
std::string path = m_install_path + vfs::escape(name);
if (entry.pad || (entry.type & ~PKG_FILE_ENTRY_KNOWN_BITS))
@@ -833,7 +833,7 @@ bool package_reader::fill_data(std::map<std::string, install_entry*>& all_instal
m_install_entries.push_back({
.weak_reference = map_ptr,
.name = name,
.name = std::string(name),
.file_offset = entry.file_offset,
.file_size = entry.file_size,
.type = entry.type,
@@ -1032,8 +1032,8 @@ package_error package_reader::extract_data(std::deque<package_reader>& readers,
if (!reader.set_install_path())
{
error = package_error::other;
reader.m_result = result::error;
break;
reader.m_result = result::error; // We don't know if it's dirty yet.
return error;
}
}
@@ -1042,41 +1042,52 @@ package_error package_reader::extract_data(std::deque<package_reader>& readers,
// Use a seperate map for each reader. We need to check if the target app version exists for each package in sequence.
std::map<std::string, install_entry*> all_install_entries;
if (error == package_error::no_error)
if (error != package_error::no_error || num_failures > 0)
{
// Check if this package is allowed to be installed on top of the existing data
error = reader.check_target_app_version();
ensure(reader.m_result == result::error || reader.m_result == result::error_dirty);
return error;
}
if (error == package_error::no_error)
{
reader.m_result = result::started;
// Check if this package is allowed to be installed on top of the existing data
error = reader.check_target_app_version();
// Parse the files to be installed and create all paths.
if (!reader.fill_data(all_install_entries))
{
error = package_error::other;
}
if (error != package_error::no_error)
{
reader.m_result = result::error; // We don't know if it's dirty yet.
return error;
}
reader.m_result = result::started;
// Parse the files to be installed and create all paths.
if (!reader.fill_data(all_install_entries))
{
error = package_error::other;
// Do not return yet. We may need to clean up down below.
}
reader.m_bufs.resize(std::min<usz>(utils::get_thread_count(), reader.m_install_entries.size()));
reader.m_num_failures = error == package_error::no_error ? 0 : 1;
atomic_t<usz> thread_indexer = 0;
named_thread_group workers("PKG Installer "sv, std::max<u32>(::narrow<u32>(reader.m_bufs.size()), 1) - 1, [&]()
if (reader.m_num_failures == 0)
{
reader.extract_worker(thread_key{thread_indexer++});
});
reader.m_bufs.resize(std::min<usz>(utils::get_thread_count(), reader.m_install_entries.size()));
reader.extract_worker(thread_key{thread_indexer++});
workers.join();
atomic_t<usz> thread_indexer = 0;
named_thread_group workers("PKG Installer "sv, std::max<u32>(::narrow<u32>(reader.m_bufs.size()), 1) - 1, [&]()
{
reader.extract_worker(thread_key{thread_indexer++});
});
reader.extract_worker(thread_key{thread_indexer++});
workers.join();
reader.m_bufs.clear();
reader.m_bufs.shrink_to_fit();
}
num_failures += reader.m_num_failures;
reader.m_bufs.clear();
reader.m_bufs.shrink_to_fit();
// We don't count this package as aborted if all entries were processed.
if (reader.m_num_failures || (reader.m_aborted && reader.m_entry_indexer < reader.m_install_entries.size()))
{
@@ -1099,13 +1110,14 @@ package_error package_reader::extract_data(std::deque<package_reader>& readers,
if (reader.m_num_failures)
{
pkg_log.error("Package failed to install ('%s')", reader.m_install_path);
reader.m_result = cleaned ? result::error_cleaned : result::error;
reader.m_result = cleaned ? result::error : result::error_dirty;
}
else
{
pkg_log.warning("Package installation aborted ('%s')", reader.m_install_path);
reader.m_result = cleaned ? result::aborted_cleaned : result::aborted;
reader.m_result = cleaned ? result::aborted : result::aborted_dirty;
}
break;
}
@@ -1121,7 +1133,7 @@ package_error package_reader::extract_data(std::deque<package_reader>& readers,
bootable_paths.emplace_back(std::move(reader.m_bootable_file_path));
}
if (num_failures > 0)
if (error == package_error::no_error && num_failures > 0)
{
error = package_error::other;
}
+2 -2
View File
@@ -338,9 +338,9 @@ public:
started,
success,
aborted,
aborted_cleaned,
aborted_dirty,
error,
error_cleaned
error_dirty
};
bool is_valid() const { return m_is_valid; }
+123 -125
View File
@@ -192,60 +192,58 @@ void WriteShdr(const fs::file& f, Elf32_Shdr& shdr)
}
void AppInfo::Load(const fs::file& f)
void program_identification_header::Load(const fs::file& f)
{
authid = Read64(f);
vendor_id = Read32(f);
self_type = Read32(f);
version = Read64(f);
padding = Read64(f);
program_authority_id = Read64(f);
program_vendor_id = Read32(f);
program_type = Read32(f);
program_sceversion = Read64(f);
padding = Read64(f);
}
void AppInfo::Show() const
void program_identification_header::Show() const
{
self_log.notice("AuthID: 0x%llx", authid);
self_log.notice("VendorID: 0x%08x", vendor_id);
self_log.notice("SELF type: 0x%08x", self_type);
self_log.notice("Version: 0x%llx", version);
self_log.notice("AuthID: 0x%llx", program_authority_id);
self_log.notice("VendorID: 0x%08x", program_vendor_id);
self_log.notice("SELF type: 0x%08x", program_type);
self_log.notice("Version: 0x%llx", program_sceversion);
}
void SectionInfo::Load(const fs::file& f)
void segment_ext_header::Load(const fs::file& f)
{
offset = Read64(f);
size = Read64(f);
compressed = Read32(f);
unknown1 = Read32(f);
unknown2 = Read32(f);
encrypted = Read32(f);
offset = Read64(f);
size = Read64(f);
compression = Read32(f);
unknown = Read32(f);
encryption = Read64(f);
}
void SectionInfo::Show() const
void segment_ext_header::Show() const
{
self_log.notice("Offset: 0x%llx", offset);
self_log.notice("Size: 0x%llx", size);
self_log.notice("Compressed: 0x%08x", compressed);
self_log.notice("Unknown1: 0x%08x", unknown1);
self_log.notice("Unknown2: 0x%08x", unknown2);
self_log.notice("Encrypted: 0x%08x", encrypted);
self_log.notice("Compression: 0x%08x", compression);
self_log.notice("Unknown: 0x%08x", unknown);
self_log.notice("Encryption: 0x%08x", encryption);
}
void SCEVersionInfo::Load(const fs::file& f)
void version_header::Load(const fs::file& f)
{
subheader_type = Read32(f);
present = Read32(f);
size = Read32(f);
unknown = Read32(f);
unknown4 = Read32(f);
}
void SCEVersionInfo::Show() const
void version_header::Show() const
{
self_log.notice("Sub-header type: 0x%08x", subheader_type);
self_log.notice("Present: 0x%08x", present);
self_log.notice("Size: 0x%08x", size);
self_log.notice("Unknown: 0x%08x", unknown);
self_log.notice("Unknown: 0x%08x", unknown4);
}
void ControlInfo::Load(const fs::file& f)
void supplemental_header::Load(const fs::file& f)
{
type = Read32(f);
size = Read32(f);
@@ -253,45 +251,45 @@ void ControlInfo::Load(const fs::file& f)
if (type == 1)
{
control_flags.ctrl_flag1 = Read32(f);
control_flags.unknown1 = Read32(f);
control_flags.unknown2 = Read32(f);
control_flags.unknown3 = Read32(f);
control_flags.unknown4 = Read32(f);
control_flags.unknown5 = Read32(f);
control_flags.unknown6 = Read32(f);
control_flags.unknown7 = Read32(f);
PS3_plaintext_capability_header.ctrl_flag1 = Read32(f);
PS3_plaintext_capability_header.unknown1 = Read32(f);
PS3_plaintext_capability_header.unknown2 = Read32(f);
PS3_plaintext_capability_header.unknown3 = Read32(f);
PS3_plaintext_capability_header.unknown4 = Read32(f);
PS3_plaintext_capability_header.unknown5 = Read32(f);
PS3_plaintext_capability_header.unknown6 = Read32(f);
PS3_plaintext_capability_header.unknown7 = Read32(f);
}
else if (type == 2)
{
if (size == 0x30)
{
f.read(file_digest_30.digest, 20);
file_digest_30.unknown = Read64(f);
f.read(PS3_elf_digest_header_30.constant_or_elf_digest, sizeof(PS3_elf_digest_header_30.constant_or_elf_digest));
f.read(PS3_elf_digest_header_30.padding, sizeof(PS3_elf_digest_header_30.padding));
}
else if (size == 0x40)
{
f.read(file_digest_40.digest1, 20);
f.read(file_digest_40.digest2, 20);
file_digest_40.unknown = Read64(f);
f.read(PS3_elf_digest_header_40.constant, sizeof(PS3_elf_digest_header_40.constant));
f.read(PS3_elf_digest_header_40.elf_digest, sizeof(PS3_elf_digest_header_40.elf_digest));
PS3_elf_digest_header_40.required_system_version = Read64(f);
}
}
else if (type == 3)
{
npdrm.magic = Read32(f);
npdrm.version = Read32(f);
npdrm.license = Read32(f);
npdrm.type = Read32(f);
f.read(npdrm.content_id, 48);
f.read(npdrm.digest, 16);
f.read(npdrm.title_hash, 16);
f.read(npdrm.dev_hash, 16);
npdrm.activate_time = Read64(f);
npdrm.expire_time = Read64(f);
PS3_npdrm_header.npd.magic = Read32(f);
PS3_npdrm_header.npd.version = Read32(f);
PS3_npdrm_header.npd.license = Read32(f);
PS3_npdrm_header.npd.type = Read32(f);
f.read(PS3_npdrm_header.npd.content_id, 48);
f.read(PS3_npdrm_header.npd.digest, 16);
f.read(PS3_npdrm_header.npd.title_hash, 16);
f.read(PS3_npdrm_header.npd.dev_hash, 16);
PS3_npdrm_header.npd.activate_time = Read64(f);
PS3_npdrm_header.npd.expire_time = Read64(f);
}
}
void ControlInfo::Show() const
void supplemental_header::Show() const
{
self_log.notice("Type: 0x%08x", type);
self_log.notice("Size: 0x%08x", size);
@@ -299,41 +297,41 @@ void ControlInfo::Show() const
if (type == 1)
{
self_log.notice("Control flag 1: 0x%08x", control_flags.ctrl_flag1);
self_log.notice("Unknown1: 0x%08x", control_flags.unknown1);
self_log.notice("Unknown2: 0x%08x", control_flags.unknown2);
self_log.notice("Unknown3: 0x%08x", control_flags.unknown3);
self_log.notice("Unknown4: 0x%08x", control_flags.unknown4);
self_log.notice("Unknown5: 0x%08x", control_flags.unknown5);
self_log.notice("Unknown6: 0x%08x", control_flags.unknown6);
self_log.notice("Unknown7: 0x%08x", control_flags.unknown7);
self_log.notice("Control flag 1: 0x%08x", PS3_plaintext_capability_header.ctrl_flag1);
self_log.notice("Unknown1: 0x%08x", PS3_plaintext_capability_header.unknown1);
self_log.notice("Unknown2: 0x%08x", PS3_plaintext_capability_header.unknown2);
self_log.notice("Unknown3: 0x%08x", PS3_plaintext_capability_header.unknown3);
self_log.notice("Unknown4: 0x%08x", PS3_plaintext_capability_header.unknown4);
self_log.notice("Unknown5: 0x%08x", PS3_plaintext_capability_header.unknown5);
self_log.notice("Unknown6: 0x%08x", PS3_plaintext_capability_header.unknown6);
self_log.notice("Unknown7: 0x%08x", PS3_plaintext_capability_header.unknown7);
}
else if (type == 2)
{
if (size == 0x30)
{
self_log.notice("Digest: %s", file_digest_30.digest);
self_log.notice("Unknown: 0x%llx", file_digest_30.unknown);
self_log.notice("Digest: %s", PS3_elf_digest_header_30.constant_or_elf_digest);
self_log.notice("Unknown: 0x%llx", PS3_elf_digest_header_30.padding);
}
else if (size == 0x40)
{
self_log.notice("Digest1: %s", file_digest_40.digest1);
self_log.notice("Digest2: %s", file_digest_40.digest2);
self_log.notice("Unknown: 0x%llx", file_digest_40.unknown);
self_log.notice("Digest1: %s", PS3_elf_digest_header_40.constant);
self_log.notice("Digest2: %s", PS3_elf_digest_header_40.elf_digest);
self_log.notice("Unknown: 0x%llx", PS3_elf_digest_header_40.required_system_version);
}
}
else if (type == 3)
{
self_log.notice("Magic: 0x%08x", npdrm.magic);
self_log.notice("Version: 0x%08x", npdrm.version);
self_log.notice("License: 0x%08x", npdrm.license);
self_log.notice("Type: 0x%08x", npdrm.type);
self_log.notice("ContentID: %s", npdrm.content_id);
self_log.notice("Digest: %s", npdrm.digest);
self_log.notice("Inverse digest: %s", npdrm.title_hash);
self_log.notice("XOR digest: %s", npdrm.dev_hash);
self_log.notice("Activation time: 0x%llx", npdrm.activate_time);
self_log.notice("Expiration time: 0x%llx", npdrm.expire_time);
self_log.notice("Magic: 0x%08x", PS3_npdrm_header.npd.magic);
self_log.notice("Version: 0x%08x", PS3_npdrm_header.npd.version);
self_log.notice("License: 0x%08x", PS3_npdrm_header.npd.license);
self_log.notice("Type: 0x%08x", PS3_npdrm_header.npd.type);
self_log.notice("ContentID: %s", PS3_npdrm_header.npd.content_id);
self_log.notice("Digest: %s", PS3_npdrm_header.npd.digest);
self_log.notice("Inverse digest: %s", PS3_npdrm_header.npd.title_hash);
self_log.notice("XOR digest: %s", PS3_npdrm_header.npd.dev_hash);
self_log.notice("Activation time: 0x%llx", PS3_npdrm_header.npd.activate_time);
self_log.notice("Expiration time: 0x%llx", PS3_npdrm_header.npd.expire_time);
}
}
@@ -610,18 +608,18 @@ void SceHeader::Load(const fs::file& f)
se_esize = Read64(f);
}
void SelfHeader::Load(const fs::file& f)
void ext_hdr::Load(const fs::file& f)
{
se_htype = Read64(f);
se_appinfooff = Read64(f);
se_elfoff = Read64(f);
se_phdroff = Read64(f);
se_shdroff = Read64(f);
se_secinfoff = Read64(f);
se_sceveroff = Read64(f);
se_controloff = Read64(f);
se_controlsize = Read64(f);
pad = Read64(f);
ext_hdr_version = Read64(f);
program_identification_hdr_offset = Read64(f);
ehdr_offset = Read64(f);
phdr_offset = Read64(f);
shdr_offset = Read64(f);
segment_ext_hdr_offset = Read64(f);
version_hdr_offset = Read64(f);
supplemental_hdr_offset = Read64(f);
supplemental_hdr_size = Read64(f);
padding = Read64(f);
}
SCEDecrypter::SCEDecrypter(const fs::file& s)
@@ -683,7 +681,7 @@ bool SCEDecrypter::LoadMetadata(const u8 erk[32], const u8 riv[16])
if ((meta_info.key_pad[0] != 0x00) ||
(meta_info.iv_pad[0] != 0x00))
{
self_log.error("Failed to decrypt metadata info!");
self_log.error("Failed to decrypt SCE metadata info!");
return false;
}
@@ -873,7 +871,7 @@ bool SELFDecrypter::LoadHeaders(bool isElf32, SelfAdditionalInfo* out_info)
if (out_info)
{
out_info->valid = false;
*out_info = {};
}
// Check SCE magic.
@@ -884,19 +882,19 @@ bool SELFDecrypter::LoadHeaders(bool isElf32, SelfAdditionalInfo* out_info)
}
// Read SELF header.
self_hdr.Load(self_f);
m_ext_hdr.Load(self_f);
// Read the APP INFO.
self_f.seek(self_hdr.se_appinfooff);
app_info.Load(self_f);
self_f.seek(m_ext_hdr.program_identification_hdr_offset);
m_prog_id_hdr.Load(self_f);
if (out_info)
{
out_info->app_info = app_info;
out_info->prog_id_hdr = m_prog_id_hdr;
}
// Read ELF header.
self_f.seek(self_hdr.se_elfoff);
self_f.seek(m_ext_hdr.ehdr_offset);
if (isElf32)
elf32_hdr.Load(self_f);
@@ -912,7 +910,7 @@ bool SELFDecrypter::LoadHeaders(bool isElf32, SelfAdditionalInfo* out_info)
self_log.error("ELF program header offset is null!");
return false;
}
self_f.seek(self_hdr.se_phdroff);
self_f.seek(m_ext_hdr.phdr_offset);
for(u32 i = 0; i < elf32_hdr.e_phnum; ++i)
{
phdr32_arr.emplace_back();
@@ -929,7 +927,7 @@ bool SELFDecrypter::LoadHeaders(bool isElf32, SelfAdditionalInfo* out_info)
return false;
}
self_f.seek(self_hdr.se_phdroff);
self_f.seek(m_ext_hdr.phdr_offset);
for (u32 i = 0; i < elf64_hdr.e_phnum; ++i)
{
@@ -940,34 +938,34 @@ bool SELFDecrypter::LoadHeaders(bool isElf32, SelfAdditionalInfo* out_info)
// Read section info.
secinfo_arr.clear();
self_f.seek(self_hdr.se_secinfoff);
m_seg_ext_hdr.clear();
self_f.seek(m_ext_hdr.segment_ext_hdr_offset);
for(u32 i = 0; i < ((isElf32) ? elf32_hdr.e_phnum : elf64_hdr.e_phnum); ++i)
{
secinfo_arr.emplace_back();
secinfo_arr.back().Load(self_f);
m_seg_ext_hdr.emplace_back();
m_seg_ext_hdr.back().Load(self_f);
}
// Read SCE version info.
self_f.seek(self_hdr.se_sceveroff);
scev_info.Load(self_f);
self_f.seek(m_ext_hdr.version_hdr_offset);
m_version_hdr.Load(self_f);
// Read control info.
ctrlinfo_arr.clear();
self_f.seek(self_hdr.se_controloff);
m_supplemental_hdr_arr.clear();
self_f.seek(m_ext_hdr.supplemental_hdr_offset);
for (u64 i = 0; i < self_hdr.se_controlsize;)
for (u64 i = 0; i < m_ext_hdr.supplemental_hdr_size;)
{
ctrlinfo_arr.emplace_back();
ControlInfo &cinfo = ctrlinfo_arr.back();
m_supplemental_hdr_arr.emplace_back();
supplemental_header& cinfo = m_supplemental_hdr_arr.back();
cinfo.Load(self_f);
i += cinfo.size;
}
if (out_info)
{
out_info->ctrl_info = ctrlinfo_arr;
out_info->supplemental_hdr = m_supplemental_hdr_arr;
}
// Read ELF section headers.
@@ -981,7 +979,7 @@ bool SELFDecrypter::LoadHeaders(bool isElf32, SelfAdditionalInfo* out_info)
return true;
}
self_f.seek(self_hdr.se_shdroff);
self_f.seek(m_ext_hdr.shdr_offset);
for(u32 i = 0; i < elf32_hdr.e_shnum; ++i)
{
@@ -998,7 +996,7 @@ bool SELFDecrypter::LoadHeaders(bool isElf32, SelfAdditionalInfo* out_info)
return true;
}
self_f.seek(self_hdr.se_shdroff);
self_f.seek(m_ext_hdr.shdr_offset);
for(u32 i = 0; i < elf64_hdr.e_shnum; ++i)
{
@@ -1023,11 +1021,11 @@ void SELFDecrypter::ShowHeaders(bool isElf32)
self_log.notice("----------------------------------------------------");
self_log.notice("SELF header");
self_log.notice("----------------------------------------------------");
self_hdr.Show();
m_ext_hdr.Show();
self_log.notice("----------------------------------------------------");
self_log.notice("APP INFO");
self_log.notice("----------------------------------------------------");
app_info.Show();
m_prog_id_hdr.Show();
self_log.notice("----------------------------------------------------");
self_log.notice("ELF header");
self_log.notice("----------------------------------------------------");
@@ -1040,17 +1038,17 @@ void SELFDecrypter::ShowHeaders(bool isElf32)
self_log.notice("----------------------------------------------------");
self_log.notice("Section info");
self_log.notice("----------------------------------------------------");
for(unsigned int i = 0; i < secinfo_arr.size(); i++)
secinfo_arr[i].Show();
for(unsigned int i = 0; i < m_seg_ext_hdr.size(); i++)
m_seg_ext_hdr[i].Show();
self_log.notice("----------------------------------------------------");
self_log.notice("SCE version info");
self_log.notice("----------------------------------------------------");
scev_info.Show();
m_version_hdr.Show();
self_log.notice("----------------------------------------------------");
self_log.notice("Control info");
self_log.notice("----------------------------------------------------");
for(unsigned int i = 0; i < ctrlinfo_arr.size(); i++)
ctrlinfo_arr[i].Show();
for(unsigned int i = 0; i < m_supplemental_hdr_arr.size(); i++)
m_supplemental_hdr_arr[i].Show();
self_log.notice("----------------------------------------------------");
self_log.notice("ELF section headers");
self_log.notice("----------------------------------------------------");
@@ -1095,7 +1093,7 @@ bool SELFDecrypter::DecryptNPDRM(u8 *metadata, u32 metadata_size)
else if (npd->license == 3) // Free license.
{
// Use klicensee if available.
if (key_v.GetKlicenseeKey() != nullptr)
if (key_v.GetKlicenseeKey())
memcpy(npdrm_key, key_v.GetKlicenseeKey(), 0x10);
else
memcpy(npdrm_key, NP_KLIC_FREE, 0x10);
@@ -1123,11 +1121,11 @@ bool SELFDecrypter::DecryptNPDRM(u8 *metadata, u32 metadata_size)
const NPD_HEADER* SELFDecrypter::GetNPDHeader() const
{
// Parse the control info structures to find the NPDRM control info.
for (const ControlInfo& info : ctrlinfo_arr)
for (const supplemental_header& info : m_supplemental_hdr_arr)
{
if (info.type == 3)
{
return &info.npdrm;
return &info.PS3_npdrm_header.npd;
}
}
@@ -1150,7 +1148,7 @@ bool SELFDecrypter::LoadMetadata(u8* klic_key)
self_f.read(metadata_headers.get(), metadata_headers_size);
// Find the right keyset from the key vault.
SELF_KEY keyset = key_v.FindSelfKey(app_info.self_type, sce_hdr.se_flags, app_info.version);
SELF_KEY keyset = key_v.FindSelfKey(m_prog_id_hdr.program_type, sce_hdr.se_flags, m_prog_id_hdr.program_sceversion);
// Set klic if given
if (klic_key)
@@ -1182,7 +1180,7 @@ bool SELFDecrypter::LoadMetadata(u8* klic_key)
if ((meta_info.key_pad[0] != 0x00) ||
(meta_info.iv_pad[0] != 0x00))
{
self_log.error("Failed to decrypt metadata info!");
self_log.error("Failed to decrypt SELF metadata info!");
return false;
}
@@ -1333,15 +1331,15 @@ static bool IsSelfElf32(const fs::file& f)
f.seek(0);
SceHeader hdr;
SelfHeader sh;
SceHeader hdr{};
ext_hdr sh{};
hdr.Load(f);
sh.Load(f);
// Locate the class byte and check it.
u8 elf_class[0x8];
f.seek(sh.se_elfoff);
f.seek(sh.ehdr_offset);
f.read(elf_class, 0x8);
return (elf_class[4] == 1);
@@ -1413,7 +1411,7 @@ fs::file decrypt_self(fs::file elf_or_self, u8* klic_key, SelfAdditionalInfo* ou
{
if (out_info)
{
out_info->valid = false;
*out_info = {};
}
if (!elf_or_self)
+184 -121
View File
@@ -11,52 +11,113 @@
LOG_CHANNEL(self_log, "SELF");
struct AppInfo
// SCE-specific definitions for e_type:
enum
{
u64 authid;
u32 vendor_id;
u32 self_type;
u64 version;
ET_SCE_EXEC = 0xFE00, // SCE Executable - PRX2
ET_SCE_RELEXEC = 0xFE04, // SCE Relocatable Executable - PRX2
ET_SCE_STUBLIB = 0xFE0C, // SCE SDK Stubs
ET_SCE_DYNEXEC = 0xFE10, // SCE EXEC_ASLR (PS4 Executable with ASLR)
ET_SCE_DYNAMIC = 0xFE18, // ?
ET_SCE_IOPRELEXEC = 0xFF80, // SCE IOP Relocatable Executable
ET_SCE_IOPRELEXEC2 = 0xFF81, // SCE IOP Relocatable Executable Version 2
ET_SCE_EERELEXEC = 0xFF90, // SCE EE Relocatable Executable
ET_SCE_EERELEXEC2 = 0xFF91, // SCE EE Relocatable Executable Version 2
ET_SCE_PSPRELEXEC = 0xFFA0, // SCE PSP Relocatable Executable
ET_SCE_PPURELEXEC = 0xFFA4, // SCE PPU Relocatable Executable
ET_SCE_ARMRELEXEC = 0xFFA5, // ?SCE ARM Relocatable Executable (PS Vita System Software earlier or equal 0.931.010)
ET_SCE_PSPOVERLAY = 0xFFA8, // ?
};
enum
{
ELFOSABI_CELL_LV2 = 102 // CELL LV2
};
enum
{
PT_SCE_RELA = 0x60000000,
PT_SCE_LICINFO_1 = 0x60000001,
PT_SCE_LICINFO_2 = 0x60000002,
PT_SCE_DYNLIBDATA = 0x61000000,
PT_SCE_PROCPARAM = 0x61000001,
PT_SCE_UNK_61000010 = 0x61000010,
PT_SCE_COMMENT = 0x6FFFFF00,
PT_SCE_LIBVERSION = 0x6FFFFF01,
PT_SCE_UNK_70000001 = 0x70000001,
PT_SCE_IOPMOD = 0x70000080,
PT_SCE_EEMOD = 0x70000090,
PT_SCE_PSPRELA = 0x700000A0,
PT_SCE_PSPRELA2 = 0x700000A1,
PT_SCE_PPURELA = 0x700000A4,
PT_SCE_SEGSYM = 0x700000A8,
};
enum
{
PF_SPU_X = 0x00100000,
PF_SPU_W = 0x00200000,
PF_SPU_R = 0x00400000,
PF_RSX_X = 0x01000000,
PF_RSX_W = 0x02000000,
PF_RSX_R = 0x04000000,
};
enum
{
SHT_SCE_RELA = 0x60000000,
SHT_SCE_NID = 0x61000001,
SHT_SCE_IOPMOD = 0x70000080,
SHT_SCE_EEMOD = 0x70000090,
SHT_SCE_PSPRELA = 0x700000A0,
SHT_SCE_PPURELA = 0x700000A4,
};
struct program_identification_header
{
u64 program_authority_id;
u32 program_vendor_id;
u32 program_type;
u64 program_sceversion;
u64 padding;
void Load(const fs::file& f);
void Show() const;
};
struct SectionInfo
struct segment_ext_header
{
u64 offset;
u64 size;
u32 compressed;
u32 unknown1;
u32 unknown2;
u32 encrypted;
u64 offset; // Offset to data
u64 size; // Size of data
u32 compression; // 1 = plain, 2 = zlib
u32 unknown; // Always 0, as far as I know.
u64 encryption; // 0 = unrequested, 1 = completed, 2 = requested
void Load(const fs::file& f);
void Show() const;
};
struct SCEVersionInfo
struct version_header
{
u32 subheader_type;
u32 present;
u32 size;
u32 unknown;
u32 subheader_type; // 1 - sceversion
u32 present; // 0 = false, 1 = true
u32 size; // usually 0x10
u32 unknown4;
void Load(const fs::file& f);
void Show() const;
};
struct ControlInfo
struct supplemental_header
{
u32 type;
u32 type; // 1=PS3 plaintext_capability; 2=PS3 ELF digest; 3=PS3 NPDRM, 4=PS Vita ELF digest; 5=PS Vita NPDRM; 6=PS Vita boot param; 7=PS Vita shared secret
u32 size;
u64 next;
u64 next; // 1 if another Supplemental Header element follows else 0
union
{
// type 1 0x30 bytes
struct
// type 1, 0x30 bytes
struct // 0x20 bytes of data
{
u32 ctrl_flag1;
u32 unknown1;
@@ -66,28 +127,28 @@ struct ControlInfo
u32 unknown5;
u32 unknown6;
u32 unknown7;
} PS3_plaintext_capability_header;
} control_flags;
// type 2 0x30 bytes
struct
// type 2, 0x40 bytes
struct // 0x30 bytes of data
{
u8 digest[20];
u64 unknown;
u8 constant[0x14]; // same for every PS3/PS Vita SELF, hardcoded in make_fself.exe: 627CB1808AB938E32C8C091708726A579E2586E4
u8 elf_digest[0x14]; // SHA-1. Hash F2C552BF716ED24759CBE8A0A9A6DB9965F3811C is blacklisted by appldr
u64 required_system_version; // filled on Sony authentication server, contains decimal PS3_SYSTEM_VER value from PARAM.SFO
} PS3_elf_digest_header_40;
} file_digest_30;
// type 2 0x40 bytes
struct
// type 2, 0x30 bytes
struct // 0x20 bytes of data
{
u8 digest1[20];
u8 digest2[20];
u64 unknown;
u8 constant_or_elf_digest[0x14];
u8 padding[0xC];
} PS3_elf_digest_header_30;
} file_digest_40;
// type 3 0x90 bytes
NPD_HEADER npdrm;
// type 3, 0x90 bytes
struct // 0x80 bytes of data
{
NPD_HEADER npd;
} PS3_npdrm_header;
};
void Load(const fs::file& f);
@@ -172,7 +233,7 @@ struct Signature
struct SelfSection
{
u8 *data;
u8* data;
u64 size;
u64 offset;
@@ -181,25 +242,26 @@ struct SelfSection
struct Elf32_Ehdr
{
//u8 e_ident[16]; // ELF identification
u32 e_magic;
u8 e_class;
u8 e_data;
u8 e_curver;
u8 e_os_abi;
u64 e_abi_ver;
u16 e_type;
u16 e_machine;
u32 e_version;
u32 e_entry;
u32 e_phoff;
u32 e_shoff;
u32 e_flags;
u16 e_ehsize;
u16 e_phentsize;
u16 e_phnum;
u16 e_shentsize;
u16 e_shnum;
u16 e_shstrndx;
u16 e_type; // object file type
u16 e_machine; // machine type
u32 e_version; // object file version
u32 e_entry; // entry point address
u32 e_phoff; // program header offset
u32 e_shoff; // section header offset
u32 e_flags; // processor-specific flags
u16 e_ehsize; // ELF header size
u16 e_phentsize; // size of program header entry
u16 e_phnum; // number of program header entries
u16 e_shentsize; // size of section header entry
u16 e_shnum; // number of section header entries
u16 e_shstrndx; // section name string table index
void Load(const fs::file& f);
static void Show() {}
@@ -210,16 +272,16 @@ struct Elf32_Ehdr
struct Elf32_Shdr
{
u32 sh_name;
u32 sh_type;
u32 sh_flags;
u32 sh_addr;
u32 sh_offset;
u32 sh_size;
u32 sh_link;
u32 sh_info;
u32 sh_addralign;
u32 sh_entsize;
u32 sh_name; // section name
u32 sh_type; // section type
u32 sh_flags; // section attributes
u32 sh_addr; // virtual address in memory
u32 sh_offset; // offset in file
u32 sh_size; // size of section
u32 sh_link; // link to other section
u32 sh_info; // miscellaneous information
u32 sh_addralign; // address alignment boundary
u32 sh_entsize; // size of entries, if section has table
void Load(const fs::file& f);
void LoadLE(const fs::file& f);
@@ -228,14 +290,14 @@ struct Elf32_Shdr
struct Elf32_Phdr
{
u32 p_type;
u32 p_offset;
u32 p_vaddr;
u32 p_paddr;
u32 p_filesz;
u32 p_memsz;
u32 p_flags;
u32 p_align;
u32 p_type; // Segment type
u32 p_offset; // Segment file offset
u32 p_vaddr; // Segment virtual address
u32 p_paddr; // Segment physical address
u32 p_filesz; // Segment size in file
u32 p_memsz; // Segment size in memory
u32 p_flags; // Segment flags
u32 p_align; // Segment alignment
void Load(const fs::file& f);
void LoadLE(const fs::file& f);
@@ -244,25 +306,26 @@ struct Elf32_Phdr
struct Elf64_Ehdr
{
//u8 e_ident[16]; // ELF identification
u32 e_magic;
u8 e_class;
u8 e_data;
u8 e_curver;
u8 e_os_abi;
u64 e_abi_ver;
u16 e_type;
u16 e_machine;
u32 e_version;
u64 e_entry;
u64 e_phoff;
u64 e_shoff;
u32 e_flags;
u16 e_ehsize;
u16 e_phentsize;
u16 e_phnum;
u16 e_shentsize;
u16 e_shnum;
u16 e_shstrndx;
u16 e_type; // object file type
u16 e_machine; // machine type
u32 e_version; // object file version
u64 e_entry; // entry point address
u64 e_phoff; // program header offset
u64 e_shoff; // section header offset
u32 e_flags; // processor-specific flags
u16 e_ehsize; // ELF header size
u16 e_phentsize; // size of program header entry
u16 e_phnum; // number of program header entries
u16 e_shentsize; // size of section header entry
u16 e_shnum; // number of section header entries
u16 e_shstrndx; // section name string table index
void Load(const fs::file& f);
static void Show() {}
@@ -272,16 +335,16 @@ struct Elf64_Ehdr
struct Elf64_Shdr
{
u32 sh_name;
u32 sh_type;
u64 sh_flags;
u64 sh_addr;
u64 sh_offset;
u64 sh_size;
u32 sh_link;
u32 sh_info;
u64 sh_addralign;
u64 sh_entsize;
u32 sh_name; // section name
u32 sh_type; // section type
u64 sh_flags; // section attributes
u64 sh_addr; // virtual address in memory
u64 sh_offset; // offset in file
u64 sh_size; // size of section
u32 sh_link; // link to other section
u32 sh_info; // miscellaneous information
u64 sh_addralign; // address alignment boundary
u64 sh_entsize; // size of entries, if section has table
void Load(const fs::file& f);
static void Show(){}
@@ -289,14 +352,14 @@ struct Elf64_Shdr
struct Elf64_Phdr
{
u32 p_type;
u32 p_flags;
u64 p_offset;
u64 p_vaddr;
u64 p_paddr;
u64 p_filesz;
u64 p_memsz;
u64 p_align;
u32 p_type; // Segment type
u32 p_flags; // Segment flags
u64 p_offset; // Segment file offset
u64 p_vaddr; // Segment virtual address
u64 p_paddr; // Segment physical address
u64 p_filesz; // Segment size in file
u64 p_memsz; // Segment size in memory
u64 p_align; // Segment alignment
void Load(const fs::file& f);
static void Show(){}
@@ -317,18 +380,18 @@ struct SceHeader
bool CheckMagic() const { return se_magic == 0x53434500; }
};
struct SelfHeader
struct ext_hdr
{
u64 se_htype;
u64 se_appinfooff;
u64 se_elfoff;
u64 se_phdroff;
u64 se_shdroff;
u64 se_secinfoff;
u64 se_sceveroff;
u64 se_controloff;
u64 se_controlsize;
u64 pad;
u64 ext_hdr_version;
u64 program_identification_hdr_offset;
u64 ehdr_offset;
u64 phdr_offset;
u64 shdr_offset;
u64 segment_ext_hdr_offset;
u64 version_hdr_offset;
u64 supplemental_hdr_offset;
u64 supplemental_hdr_size;
u64 padding;
void Load(const fs::file& f);
static void Show(){}
@@ -337,8 +400,8 @@ struct SelfHeader
struct SelfAdditionalInfo
{
bool valid = false;
std::vector<ControlInfo> ctrl_info;
AppInfo app_info;
std::vector<supplemental_header> supplemental_hdr;
program_identification_header prog_id_hdr;
};
class SCEDecrypter
@@ -376,8 +439,8 @@ class SELFDecrypter
// SCE, SELF and APP headers.
SceHeader sce_hdr{};
SelfHeader self_hdr{};
AppInfo app_info{};
ext_hdr m_ext_hdr{};
program_identification_header m_prog_id_hdr{};
// ELF64 header and program header/section header arrays.
Elf64_Ehdr elf64_hdr{};
@@ -390,9 +453,9 @@ class SELFDecrypter
std::vector<Elf32_Phdr> phdr32_arr{};
// Decryption info structs.
std::vector<SectionInfo> secinfo_arr{};
SCEVersionInfo scev_info{};
std::vector<ControlInfo> ctrlinfo_arr{};
std::vector<segment_ext_header> m_seg_ext_hdr{};
version_header m_version_hdr{};
std::vector<supplemental_header> m_supplemental_hdr_arr{};
// Metadata structs.
MetadataInfo meta_info{};
@@ -484,7 +547,7 @@ private:
}
// Write section headers.
if (self_hdr.se_shdroff != 0)
if (m_ext_hdr.shdr_offset != 0)
{
e.seek(ehdr.e_shoff);

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