Compare commits

...

2642 commits

Author SHA1 Message Date
Megamouse
20c9dcd2d6 Remove qstr, sstr and qsv aliases. This does not compile on clang-cl
Some checks failed
Generate Translation Template / Generate Translation Template (push) Failing after 48s
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Has been skipped
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Has been skipped
Build RPCS3 / RPCS3 FreeBSD (push) Has been skipped
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm gcc (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Has been cancelled
Build RPCS3 / RPCS3 Mac Intel (push) Has been cancelled
Build RPCS3 / RPCS3 Mac Apple Silicon (push) Has been cancelled
Build RPCS3 / RPCS3 Windows (push) Has been cancelled
Build RPCS3 / RPCS3 Windows Clang (push) Has been cancelled
2025-06-30 08:18:50 +02:00
Megamouse
38ff48595d Fix missing include on clang-cl 2025-06-30 08:18:50 +02:00
Megamouse
c7c206ecdc Fix u32 compile error on clang-cl 2025-06-30 08:18:50 +02:00
Megamouse
bfd2adab5e Fix noexcept warnings in XAudio 2025-06-30 08:18:50 +02:00
Elad
786ac95dc0 RawSPU: Add missing MMIO register reads
Some checks failed
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Mac Intel (push) Waiting to run
Build RPCS3 / RPCS3 Mac Apple Silicon (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
Build RPCS3 / RPCS3 Windows Clang (push) Waiting to run
Generate Translation Template / Generate Translation Template (push) Failing after 45s
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Has been skipped
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Has been skipped
Build RPCS3 / RPCS3 FreeBSD (push) Has been skipped
2025-06-29 21:31:52 +03:00
Elad
1660dc24b3 cellSaveData: Order equal elements using the opposing trait
Some checks failed
Generate Translation Template / Generate Translation Template (push) Failing after 47s
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Has been skipped
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Has been skipped
Build RPCS3 / RPCS3 FreeBSD (push) Has been skipped
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm gcc (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Has been cancelled
Build RPCS3 / RPCS3 Mac Intel (push) Has been cancelled
Build RPCS3 / RPCS3 Mac Apple Silicon (push) Has been cancelled
Build RPCS3 / RPCS3 Windows (push) Has been cancelled
Build RPCS3 / RPCS3 Windows Clang (push) Has been cancelled
2025-06-27 17:56:26 +03:00
kd-11
aa50b0fbb9 vk: Fix video-out calibration pass inputs
Some checks failed
Generate Translation Template / Generate Translation Template (push) Failing after 48s
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Has been skipped
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Has been skipped
Build RPCS3 / RPCS3 FreeBSD (push) Has been skipped
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm gcc (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Has been cancelled
Build RPCS3 / RPCS3 Mac Intel (push) Has been cancelled
Build RPCS3 / RPCS3 Mac Apple Silicon (push) Has been cancelled
Build RPCS3 / RPCS3 Windows (push) Has been cancelled
Build RPCS3 / RPCS3 Windows Clang (push) Has been cancelled
2025-06-25 23:06:04 +03:00
kd-11
3df93dcc19 vk: Fix shader interpreter inputs when textures are not used 2025-06-25 23:06:04 +03:00
kd-11
1f0328c5d5 vk: Fix up binding layouts for some broken shaders 2025-06-25 23:06:04 +03:00
kd-11
3f635033cc vk: Cleanup compiler warnings 2025-06-25 23:06:04 +03:00
kd-11
8130babad3 vk: Fix crash when running MSAA resolve shaders 2025-06-25 23:06:04 +03:00
kd-11
37c4406b23 Remove unused file 2025-06-25 23:06:04 +03:00
kd-11
5d6b8b20c4 vk: Fix binding of arrays 2025-06-25 23:06:04 +03:00
kd-11
396c4bbdd7 vk: Drop obsolete logic around descriptor switching 2025-06-25 23:06:04 +03:00
kd-11
16a0ae6a7b vk: Update shader interpreter to use dynamic binding layout 2025-06-25 23:06:04 +03:00
kd-11
dd28d100d6 vk: Fix crash when running attachment clear pass 2025-06-25 23:06:04 +03:00
kd-11
91e22aa4e4 vk: Fix FS stencil mirror binding location overwrites causing holes in descriptor layout 2025-06-25 23:06:04 +03:00
kd-11
cdc78f81f7 vk: Code improvements 2025-06-25 23:06:04 +03:00
kd-11
91491c7cf3 vk: Drop copy optimization
- The pointer-based nature of write entries, changes invalidate previous data
- Instead of managing scratch, just push to the descriptors built-in management which is quite optimal
2025-06-25 23:06:04 +03:00
kd-11
b3492b73ad vk: Improve pipeline layout validation and fix slot allocation bugs 2025-06-25 23:06:04 +03:00
kd-11
15791cf94e vk: Fix descriptor set update and caching model to support skipped updates 2025-06-25 23:06:04 +03:00
kd-11
5417d4854d vk: Fix edge cases in descriptor update logic 2025-06-25 23:06:04 +03:00
kd-11
bb1c0a5eee rsx/util: Support basic array merge 2025-06-25 23:06:04 +03:00
kd-11
3a65359d59 vk: Fix clang build and resource leak on exit 2025-06-25 23:06:04 +03:00
kd-11
ffa835efac vk: Use shared layout generator for all pipelines
- Common code applying flags uniformly fixes bugs with misconfigured options
2025-06-25 23:06:04 +03:00
kd-11
f241825c73 vk: Update binding model for compute jobs 2025-06-25 23:06:04 +03:00
kd-11
2c8c788d81 vk: Use standard C++ 2025-06-25 23:06:04 +03:00
kd-11
2ae9753d79 vk: Lazy register/derigeter of hot data 2025-06-25 23:06:04 +03:00
kd-11
93e6aa6310 vk: Fix FSR upscaling 2025-06-25 23:06:04 +03:00
kd-11
ae74aa336f vk: Use write commands instead of copy commands to avoid dependencies 2025-06-25 23:06:04 +03:00
kd-11
64866098e7 vk: Respect shader compile flags when linking 2025-06-25 23:06:04 +03:00
kd-11
20b54f3086 vk: Correctly initialize descriptor copy data 2025-06-25 23:06:04 +03:00
kd-11
aac4fbe941 vk: Fix graphical bugs and crashes 2025-06-25 23:06:04 +03:00
kd-11
356b2f5910 vk: Rewrite program binding management to use "separate shader objects" concept. 2025-06-25 23:06:04 +03:00
kd-11
4d493bbb80 vk: Fix build 2025-06-25 23:06:04 +03:00
kd-11
49729086ac vk: Move descriptor management to the pipeline layer
- Frees up callers from managing descriptors themselves (ewww)
- Makes descriptor reuse possible
- Opens up the door to techniques like descriptor_buffer by abstracting away management to an implementation detail
2025-06-25 23:06:04 +03:00
digant73
329655a1bf fix DEBUG mode compilation
Some checks failed
Generate Translation Template / Generate Translation Template (push) Failing after 1m8s
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Has been skipped
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Has been skipped
Build RPCS3 / RPCS3 FreeBSD (push) Has been skipped
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm gcc (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Has been cancelled
Build RPCS3 / RPCS3 Mac Intel (push) Has been cancelled
Build RPCS3 / RPCS3 Mac Apple Silicon (push) Has been cancelled
Build RPCS3 / RPCS3 Windows (push) Has been cancelled
Build RPCS3 / RPCS3 Windows Clang (push) Has been cancelled
2025-06-24 05:16:17 +03:00
qurious-pixel
b0067e8934 Windows Clang - libvulkan
Some checks failed
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Has been skipped
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Has been skipped
Build RPCS3 / RPCS3 FreeBSD (push) Has been skipped
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm gcc (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Has been cancelled
Build RPCS3 / RPCS3 Mac Intel (push) Has been cancelled
Build RPCS3 / RPCS3 Mac Apple Silicon (push) Has been cancelled
Build RPCS3 / RPCS3 Windows (push) Has been cancelled
Build RPCS3 / RPCS3 Windows Clang (push) Has been cancelled
Fix windows clang libvulkan static lib name
2025-06-22 03:38:16 +03:00
Kuan-Wei Chiu
22d9343f2c Fix invalid comparator in savedata_op sorting
Some checks failed
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Mac Intel (push) Waiting to run
Build RPCS3 / RPCS3 Mac Apple Silicon (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
Build RPCS3 / RPCS3 Windows Clang (push) Waiting to run
Generate Translation Template / Generate Translation Template (push) Failing after 1m29s
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Has been skipped
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Has been skipped
Build RPCS3 / RPCS3 FreeBSD (push) Has been skipped
According to the C++ standard, comparison functions used in sorting
algorithms such as std::sort must establish a strict weak ordering.
Specifically, the comparator must be irreflexive: for all values x,
comp(x, x) must be false.

The original comparator used >= for descending order, which violates
this requirement in the case of equal values (i.e., when a == b, both
comp(a, b) and comp(b, a) would return true). This can result in
undefined behavior in sorting algorithms, including potential
segmentation faults due to invalid iterator manipulation.

This change replaces >= with > to ensure irreflexivity and compliance
with the standard's requirement for a strict weak ordering.
2025-06-21 20:00:12 +03:00
qurious-pixel
9c93ec0bc3 exclude libusb submodule
Some checks failed
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Has been skipped
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Has been skipped
Build RPCS3 / RPCS3 FreeBSD (push) Has been skipped
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm gcc (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Has been cancelled
Build RPCS3 / RPCS3 Mac Intel (push) Has been cancelled
Build RPCS3 / RPCS3 Mac Apple Silicon (push) Has been cancelled
Build RPCS3 / RPCS3 Windows (push) Has been cancelled
Build RPCS3 / RPCS3 Windows Clang (push) Has been cancelled
2025-06-20 09:08:03 +02:00
qurious-pixel
c6c72d3721 install opencv FreeBSD 2025-06-20 09:08:03 +02:00
qurious-pixel
424f9306c4 Use system LibUSB for FreeBSD 2025-06-20 09:08:03 +02:00
qurious-pixel
5d552ca236 Add Timeout to FreeBSD build 2025-06-20 09:08:03 +02:00
Megamouse
28896acb83 CI: Build static OpenAl
Some checks failed
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Mac Intel (push) Waiting to run
Build RPCS3 / RPCS3 Mac Apple Silicon (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
Build RPCS3 / RPCS3 Windows Clang (push) Waiting to run
Generate Translation Template / Generate Translation Template (push) Failing after 1m14s
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Has been skipped
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Has been skipped
Build RPCS3 / RPCS3 FreeBSD (push) Has been skipped
2025-06-19 12:09:59 +02:00
Megamouse
6f37be1afd CI/Win/clang: try to fix vulkan support 2025-06-19 09:07:01 +02:00
Megamouse
4fd581b812 Add github actions for linux arm gcc
Some checks failed
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Mac Intel (push) Waiting to run
Build RPCS3 / RPCS3 Mac Apple Silicon (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
Build RPCS3 / RPCS3 Windows Clang (push) Waiting to run
Generate Translation Template / Generate Translation Template (push) Failing after 2m12s
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Has been skipped
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Has been skipped
Build RPCS3 / RPCS3 FreeBSD (push) Has been skipped
2025-06-18 16:31:05 +02:00
Marcin Serwin
bad6e99258 Disable -Wold-style-cast diagnostic before including sse2neon
Signed-off-by: Marcin Serwin <marcin@serwin.dev>
2025-06-18 15:52:52 +02:00
Megamouse
27359d3d32 CMake: add more options
Some checks failed
Generate Translation Template / Generate Translation Template (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Has been cancelled
Build RPCS3 / RPCS3 Mac Intel (push) Has been cancelled
Build RPCS3 / RPCS3 Mac Apple Silicon (push) Has been cancelled
Build RPCS3 / RPCS3 Windows (push) Has been cancelled
Build RPCS3 / RPCS3 Windows Clang (push) Has been cancelled
Build RPCS3 / RPCS3 FreeBSD (push) Has been cancelled
2025-06-16 09:01:00 +02:00
Megamouse
f8f34787b3 CI: Do not checkout zlib 2025-06-16 09:01:00 +02:00
Megamouse
d61c2496b6 hid/input: fix enumerated device comparison 2025-06-16 08:12:13 +02:00
Megamouse
5569c5c803 Win/cmake: Copy test directory to bin
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Mac Intel (push) Waiting to run
Build RPCS3 / RPCS3 Mac Apple Silicon (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
Build RPCS3 / RPCS3 Windows Clang (push) Waiting to run
Build RPCS3 / RPCS3 FreeBSD (push) Waiting to run
2025-06-15 17:12:50 +02:00
Megamouse
d0812ee5a8 CI: build windows clang 2025-06-15 17:12:50 +02:00
Megamouse
9634e58f0a CI: fix branch name and PR number
Some checks are pending
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Mac Intel (push) Waiting to run
Build RPCS3 / RPCS3 Mac Apple Silicon (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
Build RPCS3 / RPCS3 FreeBSD (push) Waiting to run
2025-06-14 23:44:06 +02:00
RipleyTom
9610d45ebf
Entitlements are never found (#17306)
Some checks failed
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Mac Intel (push) Waiting to run
Build RPCS3 / RPCS3 Mac Apple Silicon (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
Generate Translation Template / Generate Translation Template (push) Failing after 24s
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Has been skipped
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Has been skipped
Build RPCS3 / RPCS3 FreeBSD (push) Has been skipped
Minor change, we don't support entitlements atm.
2025-06-14 09:38:38 +03:00
Elad
85c813d84c
RawSPU: Fix race of SPU_MBox_Status_offs (#17303)
Some checks failed
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Mac Intel (push) Waiting to run
Build RPCS3 / RPCS3 Mac Apple Silicon (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
Generate Translation Template / Generate Translation Template (push) Failing after 41s
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Has been skipped
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Has been skipped
Build RPCS3 / RPCS3 FreeBSD (push) Has been skipped
2025-06-13 18:56:35 +03:00
Megamouse
ab55500f01 Add github actions for windows llvm
Some checks failed
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Mac Intel (push) Waiting to run
Build RPCS3 / RPCS3 Mac Apple Silicon (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
Generate Translation Template / Generate Translation Template (push) Failing after 34s
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Has been skipped
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Has been skipped
Build RPCS3 / RPCS3 FreeBSD (push) Has been skipped
2025-06-13 03:31:08 +02:00
Megamouse
af0432a44b Update opencv to 4.11.0
Some checks failed
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Mac Intel (push) Waiting to run
Build RPCS3 / RPCS3 Mac Apple Silicon (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
Generate Translation Template / Generate Translation Template (push) Failing after 1s
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Has been skipped
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Has been skipped
Build RPCS3 / RPCS3 FreeBSD (push) Has been skipped
2025-06-13 01:35:28 +02:00
qurious-pixel
2b7161208e
[CI] FreeBSD build (#17293)
Some checks failed
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Mac Intel (push) Waiting to run
Build RPCS3 / RPCS3 Mac Apple Silicon (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
Generate Translation Template / Generate Translation Template (push) Failing after 1m1s
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Has been skipped
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Has been skipped
Build RPCS3 / RPCS3 FreeBSD (push) Has been skipped
Build FreeBSD on Github Actions
2025-06-12 09:33:40 +03:00
Megamouse
5514d7c3d8 input: only copy relevant members to external buttons and sticks
Some checks failed
Generate Translation Template / Generate Translation Template (push) Failing after 41s
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Has been skipped
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Has been skipped
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Has been cancelled
Build RPCS3 / RPCS3 Mac Intel (push) Has been cancelled
Build RPCS3 / RPCS3 Mac Apple Silicon (push) Has been cancelled
Build RPCS3 / RPCS3 Windows (push) Has been cancelled
fixes a crash in std::set, which is not thread safe
2025-06-09 11:09:26 +02:00
Elad
823e17288c SPU: Skip PUTLLUC writes of the same data
Some checks failed
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Mac Intel (push) Waiting to run
Build RPCS3 / RPCS3 Mac Apple Silicon (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
Generate Translation Template / Generate Translation Template (push) Failing after 2m35s
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Has been skipped
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Has been skipped
2025-06-08 19:09:22 +03:00
Megamouse
866daf2059 input/macOs: Call hid_close on the main thread
Some checks failed
Generate Translation Template / Generate Translation Template (push) Failing after 2m42s
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Has been skipped
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Has been skipped
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Has been cancelled
Build RPCS3 / RPCS3 Mac Intel (push) Has been cancelled
Build RPCS3 / RPCS3 Mac Apple Silicon (push) Has been cancelled
Build RPCS3 / RPCS3 Windows (push) Has been cancelled
2025-06-07 13:03:41 +02:00
Megamouse
ae38cef7b1 input/macOs: Call hid_open_path on the main thread 2025-06-07 13:03:41 +02:00
Megamouse
e36f55ea41 input/macOs: call hid_enumerate on the main thread 2025-06-07 13:03:41 +02:00
Megamouse
819d3dc7a6 input/macOs: Run hidapi pad handlers on a single thread 2025-06-07 13:03:41 +02:00
oltolm
ac99b2036d llvm: fix deprecation warnings 2025-06-07 12:46:48 +03:00
Megamouse
46cce45b13 Fix missing inserted = true in check_for_duplicates_fast
Some checks failed
Generate Translation Template / Generate Translation Template (push) Failing after 1m14s
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Has been skipped
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Has been skipped
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Has been cancelled
Build RPCS3 / RPCS3 Mac Intel (push) Has been cancelled
Build RPCS3 / RPCS3 Mac Apple Silicon (push) Has been cancelled
Build RPCS3 / RPCS3 Windows (push) Has been cancelled
2025-06-06 01:07:33 +02:00
Megamouse
d685348644 Update Qt to 6.9.1
Some checks failed
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Mac Intel (push) Waiting to run
Build RPCS3 / RPCS3 Mac Apple Silicon (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
Generate Translation Template / Generate Translation Template (push) Failing after 44s
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Has been skipped
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Has been skipped
- Updates Qt to 6.9.1
2025-06-05 21:57:43 +02:00
Megamouse
d15b7a9955 ci/macOs: run unit tests
Some checks failed
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Has been skipped
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Has been skipped
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Has been cancelled
Build RPCS3 / RPCS3 Mac Intel (push) Has been cancelled
Build RPCS3 / RPCS3 Mac Apple Silicon (push) Has been cancelled
Build RPCS3 / RPCS3 Windows (push) Has been cancelled
2025-06-03 21:59:59 +02:00
kd-11
99db73a34f Update VMA vulkan version to 1.2
Some checks failed
Generate Translation Template / Generate Translation Template (push) Failing after 43s
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Has been skipped
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Has been skipped
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Has been cancelled
Build RPCS3 / RPCS3 Mac Intel (push) Has been cancelled
Build RPCS3 / RPCS3 Mac Apple Silicon (push) Has been cancelled
Build RPCS3 / RPCS3 Windows (push) Has been cancelled
2025-06-02 17:06:23 +03:00
kd-11
85e4eff571 vk: Raise min API version to 1.2 2025-06-02 17:06:23 +03:00
Megamouse
d8bc2d5c75 input: move copilot code to pad_thread
Some checks failed
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Mac Intel (push) Waiting to run
Build RPCS3 / RPCS3 Mac Apple Silicon (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
Generate Translation Template / Generate Translation Template (push) Failing after 40s
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Has been skipped
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Has been skipped
2025-06-02 09:12:32 +02:00
Megamouse
4704c03209 Fix some static analysis warnings, including c-style cast
Some checks failed
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Mac Intel (push) Waiting to run
Build RPCS3 / RPCS3 Mac Apple Silicon (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
Generate Translation Template / Generate Translation Template (push) Failing after 2m59s
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Has been skipped
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Has been skipped
2025-06-01 22:07:03 +02:00
Megamouse
70faef3fdb Logs: use thread_local
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Mac Intel (push) Waiting to run
Build RPCS3 / RPCS3 Mac Apple Silicon (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-06-01 20:17:51 +03:00
qurious-pixel
663ff55af9 restore ffmpeg dependencies on linux 2025-06-01 18:45:00 +02:00
Zion Nimchuk
229c1c38a3 Setup build caches to only save on master builds, to ensure PR caches don't take presidence 2025-06-01 13:18:16 +01:00
Ani
68d2573344 rpcs3_version: Bump to 0.0.37
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Mac Intel (push) Waiting to run
Build RPCS3 / RPCS3 Mac Apple Silicon (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-05-31 22:05:34 +01:00
Zion Nimchuk
c437fe9ff0 Fixing the two upload commit hashes got switched around 2025-05-31 20:36:04 +01:00
schm1dtmac
c93ee3dc1a thanks vscode 2025-05-31 19:08:04 +01:00
schm1dtmac
0f45c08188 Suggested review changes 2025-05-31 19:08:04 +01:00
schm1dtmac
55aaffb7b3 Readd Homebrew Cache (used to be on Cirrus), silence more warnings 2025-05-31 19:08:04 +01:00
schm1dtmac
aeafbfa2e1 Silence warnings 2025-05-31 19:08:04 +01:00
schm1dtmac
cd7c9a8da4 Move Mac builds to GH Actions 2025-05-31 19:08:04 +01:00
Megamouse
382e62c7d8 input: implement basic copiloting
Some checks failed
Generate Translation Template / Generate Translation Template (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Has been cancelled
Build RPCS3 / RPCS3 Windows (push) Has been cancelled
2025-05-29 20:56:13 +02:00
Megamouse
ae35430c96 multithreaded version_check 2025-05-29 20:56:13 +02:00
Megamouse
c0bfc34a75 Fix codestyle 2025-05-29 20:56:13 +02:00
Marcin Serwin
bda335a505 cmake: add option to use system cubeb
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
Signed-off-by: Marcin Serwin <marcin@serwin.dev>
2025-05-29 18:30:25 +02:00
oltolm
38289f3bc1 fix Windows build with GCC/Clang 2025-05-29 14:15:54 +02:00
oltolm
3d0a68c9e8 stdafx.h: fix clang warnings 2025-05-29 14:15:54 +02:00
Megamouse
a9df046f21 Update curl to 8.14.0
Some checks are pending
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-05-29 02:07:52 +02:00
kd-11
2d9a24d1d6 rsx/util/test: Cover edge cases in address_range test suite
Some checks failed
Generate Translation Template / Generate Translation Template (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Has been cancelled
Build RPCS3 / RPCS3 Windows (push) Has been cancelled
2025-05-27 15:06:32 +03:00
kd-11
45718d7679 rsx: Use address_range64 to simplify MM intersection tests 2025-05-27 15:06:32 +03:00
kd-11
2ea7ff6b14 rsx/util: Split address_range into a sized address_range template 2025-05-27 15:06:32 +03:00
kd-11
4f7c82ba8a utils: Rename address_range to address_range32 to allow implementation of address_range16 and address_range64 2025-05-27 15:06:32 +03:00
kd-11
79bcb7790c rsx/util: Add unit tests for address ranges 2025-05-27 15:06:32 +03:00
kd-11
1ff6bdd777 rsx: Flush MM queue before applying nv3089 block transfers
Some checks failed
Generate Translation Template / Generate Translation Template (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Has been cancelled
Build RPCS3 / RPCS3 Windows (push) Has been cancelled
2025-05-26 00:42:24 +03:00
Megamouse
3e674a896f Minor struct memory layout optimization
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-05-24 18:24:58 +02:00
Megamouse
3aba805bc9 rsx: Fix use after move warning 2025-05-24 18:24:58 +02:00
Megamouse
09ab5477e8 rsx: use more const ref 2025-05-24 18:24:58 +02:00
Megamouse
da273761d1 Fix some static analysis warnings 2025-05-24 18:24:58 +02:00
FlexBy420
4f2324cae7 Remove roadmap link from README
Roadmap was removed from the website as it wasn't updated in years.
2025-05-24 16:47:47 +02:00
RipleyTom
57207bbe96 Sort bin attributes based on ID
Some checks failed
Generate Translation Template / Generate Translation Template (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Has been cancelled
Build RPCS3 / RPCS3 Windows (push) Has been cancelled
2025-05-23 13:30:39 +02:00
Megamouse
b8a5986504 Update hidapi to 0.15.0 2025-05-23 09:20:09 +02:00
kd-11
b54c2124cf rsx: Refactor CgBinaryProgram to avoid namespace collision with X11
Some checks failed
Generate Translation Template / Generate Translation Template (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Has been cancelled
Build RPCS3 / RPCS3 Windows (push) Has been cancelled
2025-05-21 16:51:11 +03:00
kd-11
9a150b677e rsx-debugger: Extra safety checks for FP decompiler 2025-05-21 16:51:11 +03:00
kd-11
01ec2671b3 rsx-debugger: Show disassembly of the currently active VP and FP 2025-05-21 16:51:11 +03:00
kd-11
dd0004f80d rsx: Use safe memory in RSX assembly decompiler 2025-05-21 16:51:11 +03:00
kd-11
e59c6c3c18 vk: Force VMA to comply with Vulkan 1.0 2025-05-21 16:51:11 +03:00
Megamouse
c27d7db0a7 SDL: do not track emu state when initializing
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-05-21 07:01:11 +02:00
Megamouse
7e7943f962 Always initialize SDL from main thread 2025-05-21 07:01:11 +02:00
Katharine Chui
cb5fd17635 Logitech G27 log control transfers as todo
Some checks failed
Generate Translation Template / Generate Translation Template (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Has been cancelled
Build RPCS3 / RPCS3 Windows (push) Has been cancelled
2025-05-19 21:14:36 +02:00
Katharine Chui
c5e40dde74 Logitech G27 update bit 86 shifter_pressed behavior 2025-05-19 21:14:36 +02:00
elad335
5deb0fcbc6 PPU debugger: Update CIA unconditionally if "PPU Debug" enabled
Some checks failed
Generate Translation Template / Generate Translation Template (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Has been cancelled
Build RPCS3 / RPCS3 Windows (push) Has been cancelled
2025-05-17 20:14:27 +03:00
Megamouse
62055bed3f Silence clang warning spam
Some checks failed
Generate Translation Template / Generate Translation Template (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Has been cancelled
Build RPCS3 / RPCS3 Windows (push) Has been cancelled
2025-05-15 23:50:32 +02:00
Megamouse
182acfcf3e Fix log level of sdl pad handler log message
I accidentally changed this to error in a prior commit.
2025-05-15 23:50:32 +02:00
Katharine Chui
52aa475581
Logitech G27 update shifter input (#17216)
Based on information provided by Florin9doi
https://github.com/RPCS3/rpcs3/pull/17199#issuecomment-2883934412
2025-05-15 22:58:10 +02:00
Megamouse
64a3e50d6c Fix some warnings
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-05-15 16:23:47 +02:00
Megamouse
0750574a03 Update VulkanMemoryAllocator to 3.3.0 2025-05-15 16:23:47 +02:00
Megamouse
3dca4dd4bb Update SDL to 3.2.14
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-05-14 21:07:18 +02:00
Megamouse
410710b02c LG27: Update defaults 2025-05-14 19:52:06 +02:00
Megamouse
48be05e8f1 G27: Make warning label color more dynamic 2025-05-14 19:52:06 +02:00
Megamouse
36e680c603 G27: Improve layout a bit 2025-05-14 19:52:06 +02:00
Megamouse
5da1b44371 Fix emu name in label 2025-05-14 19:52:06 +02:00
Megamouse
9b3ee1ed17 Gui: simplify LogitechG27 settings dialog 2025-05-14 19:52:06 +02:00
elad335
3f2075070a Fix UB
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
Reference exists after destructor is called.
2025-05-14 09:44:07 +03:00
elad335
208c4e2af2 SPU: Improved GETLLAR spin detection conditions 2025-05-14 09:44:07 +03:00
Katharine Chui
a9b911750f
Logitech G27 Expand SDL device identification, add mapping note (#17206)
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
Fanatec windows drivers doesn't mux a single device into a single
software device. Instead they have two identical devices in
terms of vendor and product id. Add a mostly stable way to tell
between the two.

Currently working wheels should not be affected, Fanatec users
please map the wheel again.

Do not save config on reset
2025-05-14 01:31:52 +02:00
Megamouse
8d9ba4329d LogitechG27: use named_thread instead of std::thread 2025-05-14 01:18:32 +03:00
Megamouse
bc18b3592c SDL/input: Log GUID 2025-05-13 21:41:23 +02:00
elad335
fa744121fc Fix CallFromMainThread execution condition
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-05-13 17:37:13 +03:00
kd-11
f4dc18c872 rsx: Don't trigger surface swap-in/swap-out handlers when replacing self 2025-05-13 15:17:36 +03:00
RipleyTom
d02dea5df2 Make Disable IPv6 text translatable 2025-05-13 13:43:03 +02:00
RipleyTom
b1b02e0425 Bind RPCN client socket only if bind_ip is set
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-05-12 22:15:56 +02:00
RipleyTom
6854e9b974 Fix building with SDL submodule 2025-05-12 21:40:02 +02:00
RipleyTom
3894c903bc Make IP Binding more global
Some checks failed
Generate Translation Template / Generate Translation Template (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Has been cancelled
Build RPCS3 / RPCS3 Windows (push) Has been cancelled
2025-05-10 08:44:05 +03:00
elad335
d21358e91f System: Fix Kill calling duplication
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-05-09 11:39:53 +03:00
Megamouse
21cdbd90e9 trophies/overlays: treat unlocked hidden trophies just like normal unlocked trophies
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-05-08 21:20:16 +02:00
elad335
12f4e4fd8c SPU: Evaluated Thread-blocked LR messaging 2025-05-08 20:46:40 +03:00
elad335
3ea3ed6672 Emu: Track game termination progress better
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-05-08 17:06:47 +03:00
Katharine Chui
4840e3575b remove SDL_INIT_JOYSTICK since SDL_INIT_GAMEPAD implies SDL_INIT_JOYSTICK 2025-05-08 13:41:41 +02:00
Katharine Chui
f0672bdbc9 initialize sdl haptic, log haptic device open errors 2025-05-08 13:41:41 +02:00
Megamouse
2963d10325 cellSysutilCheckCallback: increase read_counter as soon as a callback is about to be called
The game might call sys_process_exit in one of the callbacks.
This might take a couple of seconds and does not increase the counter.
So we have to increase it before in order to give Kill some more time.
2025-05-08 12:58:38 +02:00
Megamouse
501643c10a Use const for present_samples buf argument 2025-05-08 12:58:38 +02:00
Megamouse
73a6141f3f overlays: Allow auto exit in home menu's exit game function
In case the game does not terminate itself properly.
2025-05-08 12:58:38 +02:00
Megamouse
738d1ef682 Emu: Make game termination less confusing 2025-05-08 12:58:38 +02:00
Megamouse
30a4b26306 Add log message when QApplication is being quit 2025-05-08 12:58:38 +02:00
Megamouse
fdc1a51cba Log RPCS3 exit code 2025-05-08 12:58:38 +02:00
Megamouse
9c7d8da298 Add log message if game ignores exit game request 2025-05-08 12:58:38 +02:00
Megamouse
0146b845d9 MSVC: Fix weird std::move on const variable warning... 2025-05-08 12:58:38 +02:00
Megamouse
fc3a905c90 Use string_view for log params 2025-05-08 12:58:38 +02:00
Megamouse
aa79afd7ae StrUtil: Add more unit tests 2025-05-08 12:58:38 +02:00
elad335
f17400092d Fixup SPU Interpreters 2025-05-08 11:54:16 +03:00
Katharine Chui
e1d3cf57c8
Logitech G27 fixes and cleanups (#17170)
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
- revamp effect direction to avoid some windows driver issues
- ref: https://github.com/libsdl-org/SDL/issues/7941
- fix possible SDL_SetJoystickLED calls on closed joystick handle
- various comment cleanups
- make now static sdl effect direction a template
- fix formatting, shorten logitech_g27_force_to_level, revamp sawtooth effect abuse logging
- log and handle ramp effects with reversed min/max forces
- remove abandoned functions
2025-05-07 19:20:35 +02:00
Elad
2a50ac1891
PPU Loader: Consume Executable Memory
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-05-06 21:21:38 +03:00
Megamouse
0724fa3aa9 VS: compile glslang with the solution
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-05-06 00:43:41 +02:00
Zion Nimchuk
ba46c62500 Remove old OGLCompiler.lib dep 2025-05-06 00:43:41 +02:00
Zion Nimchuk
1276867860 Cleanup what we build in glslang vcxproj 2025-05-06 00:43:41 +02:00
Zion Nimchuk
5249f6cba7 Just build the latest glslang instead of dowloading the precompiled libs 2025-05-06 00:43:41 +02:00
Megamouse
353e0a8400 VS: Add glslang include directory 2025-05-06 00:43:41 +02:00
Zion Nimchuk
ec4e65bdd9 Update glslang to 15.3.0 2025-05-06 00:43:41 +02:00
kd-11
e5d3944726 vk: Limit NV crash workaround to older generations 2025-05-06 00:00:04 +02:00
kd-11
e67beb27dd vk: Fix cyclic dependency problem during physical device init 2025-05-06 00:00:04 +02:00
kd-11
5cfa9fd83e vk: Disable texel buffer update-after-bind on NVIDIA driver 2025-05-06 00:00:04 +02:00
Megamouse
84a4cc01e1 SDL/Input: add DS3 pressure intensity 2025-05-05 23:20:40 +02:00
Megamouse
32ad9988a3 SDL/Input: add new misc buttons 2025-05-05 23:20:40 +02:00
Megamouse
fcdf542c47 Update SDL to 3.2.12
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-05-05 22:42:28 +02:00
Vestral
3cebfaa648
Atomic utils fixup after ASLR changes (#17168) 2025-05-05 21:48:07 +03:00
Séamus
74fa59590a Update MoltenVK to v1.3.0
Some checks are pending
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-05-05 09:04:17 +02:00
kd-11
4958d7a88f rsx: Do not interpolate when performing image reconstruction
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
- Interpolation introduces cross-channel bit-leakage and noise
2025-05-05 01:15:33 +03:00
Katharine Chui
487c58558e Logitech G27 touchups
Some checks failed
Generate Translation Template / Generate Translation Template (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Has been cancelled
Build RPCS3 / RPCS3 Windows (push) Has been cancelled
- TODO note and adjust type for housing SDL_CreateHapticEffect return
- fix implementation of command 0x09 Set LED
- fix LED joystick changes handling
2025-05-03 19:43:07 +02:00
Elad
cf1e53f9c8
Fix crash in memory viewer launcher (#17152) 2025-05-03 18:34:42 +03:00
Megamouse
75b728be7e Logitech G27 cleanup
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-05-03 13:21:34 +02:00
trigger
6428088e46
Qt: "Show in Memory Viewer" context action (#17131) 2025-05-03 08:35:45 +03:00
Katharine Chui
c0a1e8d5a5
virtual Logitech G27 for Gran Turismo 6 (#17135)
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-05-02 21:27:40 +02:00
Megamouse
7a9733dcca CMake: try to fix gcc 2025-05-02 17:18:11 +02:00
Megamouse
9146076e28 Update FAudio to 25.05 2025-05-02 17:18:11 +02:00
kd-11
b25276deec tests: Fix failing test and improve msvc setup
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-05-02 01:16:21 +03:00
kd-11
947c6ec3e1 test: Add UTs for rsx::simple_array<T> 2025-05-02 01:16:21 +03:00
Megamouse
ea94f44f66 Disable WholeProgramOptimization for unit test
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-05-01 15:28:52 +02:00
Megamouse
e48797db1a CI: Only run unit tests for pull requests 2025-05-01 15:28:52 +02:00
Megamouse
0439ca67d9 CI: Add windows unit tests
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-05-01 12:51:39 +02:00
Megamouse
399c871d79 VS: improve unit test project setup 2025-05-01 12:51:39 +02:00
Megamouse
6abe18a4f8 Add unit test for fmt::merge
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-05-01 00:56:37 +02:00
Megamouse
77f45954d0 Update libpng to 1.6.48 2025-05-01 00:56:37 +02:00
Megamouse
982dac9446 Remove unused fmt::match function 2025-05-01 00:56:37 +02:00
Megamouse
486e93f418 Fix fmt::replace_all with empty from and add unit tests 2025-05-01 00:56:37 +02:00
Megamouse
259768e896 Add submodule version check script 2025-05-01 00:56:37 +02:00
Megamouse
c792db2c60 CMake: Disable unit tests in gcc
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-04-30 19:40:10 +02:00
Megamouse
b6a3754ee5 CMake: Use existing main for unit tests 2025-04-30 19:40:10 +02:00
Megamouse
e4cc55dc19 Move spellcheck before build
This saves time when there's a syntax error in deploy_linux.sh
2025-04-30 19:40:10 +02:00
Megamouse
eb4c6df609 CI: Add unit tests 2025-04-30 19:40:10 +02:00
Megamouse
05b5f9aa97 VS: Remove unnecessary LinkIncremental to fix some warning
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-04-30 10:08:16 +02:00
Megamouse
a9d2150b0f VS: Remove unnecessary moc_predefs file to fix a warning 2025-04-30 10:08:16 +02:00
Megamouse
b17078fe1a Fix some warnings 2025-04-30 10:08:16 +02:00
Megamouse
9a5c4aba58 VS: Enable ASLR in unit test 2025-04-30 10:08:16 +02:00
Megamouse
9897a80216 CMake: fix gcc build 2025-04-30 10:08:16 +02:00
Megamouse
19cc93437e CMake: move all rpcs3 cpp files to rpcs3qt 2025-04-30 10:08:16 +02:00
Megamouse
39247fcbc1 CMake: Run unit test during build if requested 2025-04-30 10:08:16 +02:00
Megamouse
3b61613d1b CMake: Create unit test 2025-04-30 10:08:16 +02:00
Megamouse
81b1e5636d CMake: Create static rpcs3_lib 2025-04-30 10:08:16 +02:00
Vestral
e066735fe9 Utils fixes for ASLR
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-04-30 02:56:23 +02:00
Vestral
63b7134dce Separate segment and function addresses in PPU LLVM 2025-04-30 02:56:23 +02:00
Vestral
e110334c2c Disable SPU asmjit on ARM. Only supported on x86 2025-04-30 02:56:23 +02:00
Vestral
77eef4d783 Don't make assumptions about address format 2025-04-30 02:56:23 +02:00
Vestral
e2df71d87c Enable ASLR 2025-04-30 02:56:23 +02:00
Megamouse
68e7f4e820 fmt: add some unit tests and fix fmt::trim 2025-04-30 00:07:24 +02:00
Megamouse
376ac85029 Add unit test project to VS 2025-04-29 21:09:12 +02:00
Megamouse
b1b9310a50 Update docker to 1.6
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-04-29 19:21:32 +02:00
Megamouse
024949f17e Move main to main.cpp 2025-04-29 18:42:20 +02:00
Megamouse
74d995aae0 Rename main.cpp to rpcs3.cpp 2025-04-29 18:42:20 +02:00
Megamouse
5b60f0cc11 CI: Use variables for docker artifacts dir 2025-04-29 18:21:29 +02:00
Megamouse
a72f4f0606 Avoid checking out unused submodules 2025-04-29 18:21:29 +02:00
Megamouse
752df0dae7 VS: fix relative 3rdparty paths 2025-04-29 18:21:29 +02:00
Megamouse
2d4ff404bd VS: remove some outdated keywords 2025-04-29 18:21:29 +02:00
Megamouse
62fa074f9f github actions: disable pushes unless it's the RPCS3 master branch 2025-04-29 15:27:25 +02:00
trigger
c8f5659090
Qt: Hex validator for address/instruction inputs (#17113) 2025-04-29 14:42:16 +02:00
elad335
79b63556bb vm_native.cpp: Fix possible weakness of map_self() 2025-04-29 14:54:40 +03:00
elad335
1f81d42416 Fix sys_mmapper_unmap_shared_memory 2025-04-29 14:54:40 +03:00
kd-11
75bfc336fc vk: Prevent header internals from leaking
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-04-29 03:52:49 +03:00
kd-11
1af67f39ca vk: Stop using internal defines to structure platform-specific code 2025-04-29 03:52:49 +03:00
elad335
2aca213ba1 sys_mmapper: Lazily allocate shared memory descriptors
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-04-28 18:55:23 +03:00
elad335
730249a887 Embedded SPU Image Search Fixes 2025-04-28 17:44:33 +03:00
trigger
0e1cad4ca9 PPU: HasBreakpoint fast path when empty
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-04-28 09:28:51 +03:00
kd-11
2afd7707fe vk: Fix more silly mistakes
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-04-27 17:09:50 +03:00
kd-11
01cf71e49a vk: Fix indexed multidraw 2025-04-27 17:09:50 +03:00
kd-11
2f677ecebd rsx: Silence compiler warnings 2025-04-27 15:07:26 +03:00
kd-11
d958f8291a rsx: simplify simple_array<T>::erase_if 2025-04-27 15:07:26 +03:00
Megamouse
f435225940 Update wolfssl to 5.8.0
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-04-26 23:15:04 +02:00
Megamouse
e321af4a29 Update miniupnp to 2.3.9 2025-04-26 23:15:04 +02:00
RipleyTom
929a92f6c5 Avoid passing -fuse-ld to non-linking step 2025-04-26 22:48:14 +02:00
Megamouse
39d3754b18 cellVideoOutConvertCursorColor: fix and implement 2025-04-26 21:30:58 +02:00
digant73
d7ef5a85dc fix missing check on swapped item 2025-04-26 21:13:58 +03:00
digant73
519a3b5b79 fix erase_if method 2025-04-26 21:13:58 +03:00
RipleyTom
89dea9bd92 Fix IPv6 support detection
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-04-25 21:40:36 +02:00
elad335
ab269f6155 Warning fixes 2025-04-25 19:52:38 +03:00
elad335
dcc263ca5d SPU Image Finder Fixes 2025-04-25 19:52:38 +03:00
Megamouse
c2a5ac96cd Fix some warnings
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-04-25 11:10:07 +02:00
Megamouse
85a4c5eb93 Remove some obsolete pragmas 2025-04-25 11:10:07 +02:00
kd-11
cd2098fad7 vk: Fix copypasta causing incorrect buffer to be released by GC
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-04-25 04:01:47 +03:00
kd-11
7c538873b6 vk: Properly initialize EXT_multidraw functionality 2025-04-25 04:01:47 +03:00
kd-11
ebcf403f4a vk: Fix a rare GPU timeline UAF when replacing buffer views
- Might fix DEVICE_LOST errors observed on NV cards
2025-04-25 04:01:47 +03:00
kd-11
417cefa059 rsx: Fix static ringbuffer allocator logic 2025-04-25 04:01:47 +03:00
Megamouse
1960b5a605 hotfix: fix parentheses when saving some files
Some checks failed
Generate Translation Template / Generate Translation Template (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Has been cancelled
Build RPCS3 / RPCS3 Windows (push) Has been cancelled
2025-04-23 16:27:17 +02:00
kd-11
c401c0f9db vk: Get rid of multidraw indirection buffer 2025-04-23 16:01:17 +03:00
kd-11
a152bb1123 vk: Fix bug preparing multidraw command details 2025-04-23 16:01:17 +03:00
kd-11
7c27b7b727 rsx: Do not consume draw call barrier iterator when executing deps 2025-04-23 16:01:17 +03:00
kd-11
f3f1a2bb5d rsx: Cache draw subranges storage 2025-04-23 16:01:17 +03:00
Megamouse
b2feff7d38 Qt: implement music player dialog for music handler tests
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-04-23 08:14:59 +02:00
Megamouse
22c184bf75 cellMusic: improve logging 2025-04-23 08:14:59 +02:00
elad335
5ca5b54bf6 Fix sceNpTrophyRegisterContext
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-04-22 16:29:21 +03:00
kd-11
a928e8a3db types: Fix comment
Some checks failed
Generate Translation Template / Generate Translation Template (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Has been cancelled
Build RPCS3 / RPCS3 Windows (push) Has been cancelled
2025-04-20 17:50:01 +02:00
kd-11
2e624789ff vk: Properly initialize multi draw extension 2025-04-20 17:50:01 +02:00
kd-11
ef95fa9f5f rsx: de-uglify buffer upload restructure 2025-04-20 17:50:01 +02:00
NefariousTechSupport
cecf92e5b8
Copy debug self elf properly (#17070)
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
In 7de2869a53 this was changed to be a bit more safe, however it was reading from offset 0 instead of where the real elf started, meaning every debug self would just fail to load immediately.
2025-04-20 10:12:19 +03:00
elad335
8437a5f5ac PPU Debugger/Memory: STDCX/STWCX breakpoints, make vm::_ref const
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-04-19 16:14:00 +03:00
kd-11
564c903fbd rsx: Fix arm64 build
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-04-19 01:04:00 +03:00
kd-11
268de3cd24 rsx/vk: Retire the concept of heap being in "critical" state
- We waste a lot of time trying to manage that. We just swap out the buffer anyway as long as the client has enough RAM.
- This was more of an issue in early days when corrupt allocation requests were common trying to take gigabytes in one draw.
2025-04-19 01:04:00 +03:00
kd-11
d20f48f876 vk: Fix extension wrangling 2025-04-19 01:04:00 +03:00
kd-11
88e2a3761c vk: Rework multi-heap health checks for performance 2025-04-19 01:04:00 +03:00
kd-11
e136c2eadf vk: Rework heap checks to be explicit 2025-04-19 01:04:00 +03:00
kd-11
b2b50f5e82 vk: Optimize heap check iterator
- Significant boost in some scenarios
2025-04-19 01:04:00 +03:00
kd-11
26a7e9653f rsx: Optimize static heap allocations 2025-04-19 01:04:00 +03:00
kd-11
76948b6364 vk: Use robin_hood for renderpass caches 2025-04-19 01:04:00 +03:00
kd-11
0f57624a61 vk: Rework extension wrangling 2025-04-19 01:04:00 +03:00
kd-11
8aaf2f8577 vk: Implement EXT_multi_draw support 2025-04-19 01:04:00 +03:00
kd-11
8ce8410a5b vk: Use garbage collector to handle buffer views
- Legacy stuff left over from almost a decade ago
2025-04-19 01:04:00 +03:00
kd-11
a0ce9e52fa vk: Refactor the heap manager 2025-04-19 01:04:00 +03:00
kd-11
53288309a5 vk: Add automatic heap management 2025-04-19 01:04:00 +03:00
Nick Renieris
275f7e15c0 PPU: Fix memory write breakpoints for 13 instructions
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
Specifically: `STVX`, `STVXL`, `STDBRX`, `STWBRX`, `STFSX`, `STFSUX`, `STFDX`, `STFDUX`, `STHBRX`, `STFS`, `STFSU`, `STFD`, `STFDU`.

Closes https://github.com/RPCS3/rpcs3/issues/17062.
2025-04-18 20:52:37 +02:00
elad335
7de2869a53 Implement sys_spu_image_open_by_fd
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-04-18 13:53:50 +03:00
elad335
ab7a1a6ec4 sys_spu: Fix sys_spu_image_open 2025-04-18 13:53:50 +03:00
Antonino Di Guardo
b8d1d7cdf1
Fix game list update for auto-detection VFS games folder (#17051)
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-04-17 12:14:54 +02:00
Megamouse
8b2b74c34b Qt: Add checkboxes to vfs list to make selection more user friendly 2025-04-17 07:23:36 +02:00
Ani
a004ebfffb git: Remove unused code
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-04-16 13:36:56 +03:00
Megamouse
b51d6e9d92 Qt: use image_change_callback function to ensure the member is valid
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-04-16 03:19:15 +02:00
Megamouse
b96e41285c Qt: use unique_ptr in qt_video_source 2025-04-16 03:19:15 +02:00
Megamouse
9295e6f5c8 Qt: Fix gamelist icon after stopping a movie
Do not set an icon if it's null. This happens because we save memory
by clearing the pixmap of non-movie items.
Also don't stop the movie here, as it should be stopped already anyway.
2025-04-16 03:19:15 +02:00
Megamouse
e80809f629 Qt: fix game list image reset after a movie was stopped
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-04-15 18:47:54 +02:00
elad335
5ac4db752d sceNpTrophy: Send signals asynchronously
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-04-14 15:08:01 +03:00
Megamouse
746b438500 Qt/input: accumulate button presses between gui refresh
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
Fixes dropped input between gui refreshes
2025-04-14 09:31:52 +02:00
Fredrik Hubinette
0964c0356b Add Menu Key (used by 8bitdo Pro 2 controller 2025-04-14 07:36:17 +02:00
kd-11
7500d16524 rsx: Avoid reallocating scratch buffers every draw call when processing instancing data
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-04-14 03:16:37 +03:00
kd-11
b3bdff741c rsx: Fix simple_array<T>::erase_if 2025-04-14 03:16:37 +03:00
Megamouse
fcb6bc70f8 evdev: log positive axis config
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-04-13 11:40:01 +02:00
Megamouse
9c5b3a2300 Update to Qt 6.9.0
Some checks failed
Generate Translation Template / Generate Translation Template (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Has been cancelled
Build RPCS3 / RPCS3 Windows (push) Has been cancelled
2025-04-11 23:11:38 +02:00
kd-11
2d7ffaf07f vk: Fix typo in NVIDIA-specific stencil unresolve path
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-04-11 14:05:28 +03:00
Megamouse
9b7d5cd1a9 Qt: fix visibility check of table widget items
Some checks failed
Generate Translation Template / Generate Translation Template (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Has been cancelled
Build RPCS3 / RPCS3 Windows (push) Has been cancelled
2025-04-10 02:23:16 +02:00
RipleyTom
bcb5041df2 use fixed uruntime version 2025-04-10 00:22:04 +02:00
Escary
235707278f
reduce appimage size 2025-04-09 21:17:16 +02:00
Ani
db85595124 rsx: Replace robin_hood with ankerl::unordered_dense 2025-04-09 20:55:35 +02:00
Ani
15758171f0 glext: Update from 2022.05.30 to 2025.02.03 2025-04-09 20:19:42 +02:00
kd-11
d08610882a rsx: Remove superfluous log
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
- Back-to-back range with no barrier will already be logged in draw_call::append
2025-04-09 16:17:51 +03:00
kd-11
21434c471b rsx: Track command barrier types during recording for faster instancing compatibility checks 2025-04-09 16:17:51 +03:00
elad335
87d8bebd0d PPU LLVM: Fixup MTFSF
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-04-08 11:29:06 +03:00
Ani
e4d84e2c1c Qt: Fix multi package install dialog on Linux
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-04-08 09:28:10 +02:00
Ani
16036e0419 ppu: Remove redundant checks on MTFSF
Closes #11176
2025-04-08 07:04:37 +02:00
Ani
58714d8c68 docker: Update ffmpeg to 7.1.1 2025-04-08 06:43:28 +02:00
Megamouse
ddf684c4d2 Update curl to 8.13.0
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-04-07 21:37:59 +02:00
Megamouse
daa76be77e Update soundtouch to 2.4.0 2025-04-07 21:37:59 +02:00
Megamouse
600e460416 Fix compilation with newer Qt 2025-04-07 21:37:59 +02:00
Megamouse
e095904e1b cellMic: Use full device name registration and comparison 2025-04-07 20:38:59 +02:00
Megamouse
599d5c17a0 cellMic: Try to open device with different sample rates 2025-04-07 20:38:59 +02:00
elad335
6f98b8c5ae Silence sys_spu_thread_write_spu_mb
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-04-07 17:54:27 +03:00
elad335
eb2eb9ccf5 Improve lwmutex_lock error logging 2025-04-07 17:54:27 +03:00
elad335
19d01835d3 sys_spu: Fix HW schedular limits 2025-04-07 17:54:27 +03:00
kd-11
f38a61bdb3 Try msvc workaround
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-04-07 00:46:09 +03:00
kd-11
ed280cdbfe vk: Use dynamic constant buffer offset via push constant 2025-04-07 00:46:09 +03:00
kd-11
66909168ac vk: Silence compiler warning 2025-04-07 00:46:09 +03:00
kd-11
38a1c8becb vk: Use dynamic constants offset for transform constants 2025-04-07 00:46:09 +03:00
kd-11
1816a1eb34 vk: Switch transform constants from UBO to SSBO 2025-04-07 00:46:09 +03:00
kd-11
dad9a2b916 vk: Add support for dynamic buffer offsets 2025-04-07 00:46:09 +03:00
Ani
b3bbd939e3 appimage: Do not bundle libQt6OpenGL 2025-04-06 19:37:36 +02:00
Ani
cc84ebf8c2 appimage: Do not bundle Qt6VirtualKeyboard 2025-04-06 19:37:36 +02:00
Ani
2438e975e7 appimage: Do not bundle unused Qt6 libraries 2025-04-06 19:37:36 +02:00
elad335
04d833d3e6 Fix #17000
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-04-06 08:58:24 +03:00
elad335
2f872b3755 vm.cpp: Remove redundant cache hint 2025-04-06 08:58:24 +03:00
elad335
bd1f5ff194 PPU LLVM: Fix VMAXFP, VMINFP 2025-04-06 08:58:24 +03:00
Ani
613212f9e1 .github: Remove outdated pull request template
Some checks failed
Generate Translation Template / Generate Translation Template (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Has been cancelled
Build RPCS3 / RPCS3 Windows (push) Has been cancelled
2025-04-04 23:10:21 +02:00
Ani
4aff4a9c82 README: Update VC_redist from 2019 to 2022 2025-04-04 23:10:21 +02:00
Ani
264af550d5 .github: Update log path in issue templates 2025-04-04 23:10:21 +02:00
Ani
822546bf7d Discord: Use vanity URL 2025-04-04 23:10:21 +02:00
nastys
2ac2439c33 Fix macOS SDK path
Some checks are pending
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-04-04 05:38:48 +02:00
Megamouse
37dbd77628 Update FAudio to 25.04
Some checks are pending
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-04-03 07:59:49 +02:00
Megamouse
733ceada5e Update SDL to 3.2.10 2025-04-03 07:59:49 +02:00
Megamouse
847f92956f Qt: remove discontinued QWinTaskbar code
Some checks failed
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
Generate Translation Template / Generate Translation Template (push) Has been cancelled
Also remove some strange relics from the includes
2025-04-02 10:48:09 +02:00
Megamouse
73f2aaf9d8 Windows: fix updating with unicode user name
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-04-01 14:31:21 +02:00
Zion Nimchuk
c86a250795 Fix mac build with cmake 4.0 2025-04-01 09:02:27 +03:00
Zion Nimchuk
c6170aa4c7 Update Windows ccache version 2025-04-01 09:02:27 +03:00
Zion Nimchuk
89ae495c36 Update docker cmake to 3.28 and update minimum to 3.28, as well as remove uneeded minimum 2025-04-01 09:02:27 +03:00
Megamouse
5526c33d69 Review fixes + warning fixes
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-03-31 18:27:54 +02:00
Megamouse
e816636676 overlays: play ICON1.PAM in save data list if possible 2025-03-31 18:27:54 +02:00
Megamouse
40e8bc530c overlays: propagate item selection to children 2025-03-31 18:27:54 +02:00
Megamouse
9684467dc0 overlays: implement video overlay class 2025-03-31 18:27:54 +02:00
Megamouse
8e83fd7d50 Qt/overlays: expose qt_video_source_wrapper as emu callback 2025-03-31 18:27:54 +02:00
Megamouse
fac1cc57d7 Overlays: set layouts dirty if children are dirty
This fixes updates of widget items in lists.
Only set text dirty if it changed.
Properly mark spacers as compiled.
2025-03-31 18:27:54 +02:00
Megamouse
6511e0f3e6 cellSaveData: properly initialize SaveDataEntry
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-03-31 12:21:40 +02:00
Megamouse
9c1c932e68 Update OpenAL to 1.24.3 2025-03-31 12:01:55 +02:00
Megamouse
82c85c1a9c Qt: disable shortcuts completely if disable kb hotkeys is enabled 2025-03-31 11:41:11 +02:00
Megamouse
7cec2d0e18 Qt: set audio hotkey defaults to additionally need Ctrl pressed 2025-03-31 11:41:11 +02:00
Ani
2f8ed1a6bd rpcs3_version: Bump to 0.0.36
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-03-30 21:45:32 +02:00
Megamouse
781da9dc59 input: disable pad vibration after no new data was sent for 3 seconds
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
This is supposedly how the lib does it.
2025-03-30 20:42:15 +02:00
Vestral
1e6a4dc5c8 Fix discord after #16885 2025-03-30 19:58:28 +02:00
Megamouse
282fbcc3e5 Qt: fix wrong save data movie playing when selecting a different entry
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-03-30 12:35:16 +02:00
Megamouse
cd9c156937 7z: log error code when opening the file 2025-03-30 12:35:16 +02:00
DH
cd840ef70a LLVM JIT: do not produce broken binaries on crash 2025-03-30 08:18:09 +03:00
Zion Nimchuk
55190c2125 Update Qt to 6.8.3 and update clang compiler
Some checks are pending
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-03-29 23:21:54 +01:00
Megamouse
01cdc83aeb Qt: play ICON1.PAM in save data manager details
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-03-29 15:09:25 +01:00
Megamouse
b9e0a36816 Qt: Add qt video source class for more generic video playback 2025-03-29 15:09:25 +01:00
Megamouse
fccb761ef2 Qt: play ICON1.PAM in save data manager 2025-03-29 12:18:18 +01:00
Megamouse
0ffb4e62e6 Qt: pass game list events to base class 2025-03-29 12:18:18 +01:00
Megamouse
bd1102d3b7 Qt: simplify icon_ready_callback in game list 2025-03-29 12:18:18 +01:00
Megamouse
91427646f5 VulkanMemoryAllocator: Match current master commit
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-03-28 20:41:41 +01:00
Megamouse
596e6cc2c3 Add VulkanMemoryAllocator v2.3.0 submodule 2025-03-28 20:41:41 +01:00
elad335
9c99e75939 SPU Debug: WrDec and LSA view
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
Report the last written value to WrDec.
2025-03-28 19:56:54 +03:00
elad335
047f71b434 PPU/cellSpurs: MGS4: Fix cellSpursAddUrgentCommand race condition
cellSpursAddUrgentCommand searches in 4 slots for an empty slot to put the command at.
At first, it seems to do so unordered.

Meanwhile, on SPU side, it expects an order between all the commands because it pops them it in FIFO manner.
Not keeping track of how many commands are queued in total.

After second observation of cellSpursAddUrgentCommand, something odd comes takes places here.
Usually, reservation loops are individual and are expected to be closed without any changes of the previous loop affected by the proceeding one.
But in this case, after a single failure, the entire operayion is reset, a loop of 4 reservation operations suddenly is reset completely.

This makes one wonder if it the HW expects sometjing else here, perhaps it caches the reservation internally here?
After some adjustments to LDARX and STDCX to cache the reservation between succeeding loops, Metal Gear Solid 4 no longer freezes!
2025-03-28 19:56:54 +03:00
elad335
91b1ec6d5c SPU LLVM: Dump some funcs 2025-03-28 19:56:54 +03:00
Ani
a7df3cfb40 config: Set default Driver Wake-Up Delay to 0 2025-03-28 18:46:41 +03:00
Megamouse
949a80dc0a Loader: deny boot if the firmware is too old 2025-03-28 18:18:09 +03:00
Ian Carpenter
095c884331 unpkg: Restore support for PSP/Vita packages 2025-03-28 14:43:38 +03:00
Ani
32a8bcf525 config: Increase max vblank rate to 6000
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-03-28 10:47:23 +03:00
Megamouse
a469bfd4da overlays: hide friends list in home menu if rpcn is not configured
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-03-27 18:08:30 +01:00
Megamouse
6921684cd9 Update Qt to 6.8.3
Some checks are pending
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-03-27 09:25:02 +01:00
Megamouse
76c069e8bf VS/MSVC: Move LTCG and GL to CI only
This was taking too long on my local builds after simple code changes.
2025-03-27 04:35:27 +01:00
Megamouse
b571978f24 Windows/Qt: do not deploy dx and ffmpeg libs
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-03-27 02:33:32 +01:00
Megamouse
b8236e183c cellMic: log ALCenum error string 2025-03-27 00:51:15 +01:00
Megamouse
2a7e957c61 Qt: fix custom icons when "Prefer game data icons" is set
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-03-26 18:33:51 +01:00
Megamouse
467c4ba2cf Qt: add option to prefer game data icons in the game list 2025-03-26 12:07:59 +01:00
RipleyTom
324af04426 Set PSN to disconnected when net status is disconnected
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-03-25 21:46:38 +01:00
Megamouse
1b5d9a34df overlays/rpcn: Create list even if rpcn connection failed 2025-03-25 18:40:25 +01:00
Malcolm Jestadt
c52920755a SPU LLVM: Don't use vperm2b256to128 outside of CPUTranslator.h
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
- The vperm2b function uses vperm2b256to128 when it's ideal
2025-03-25 10:42:02 +02:00
Megamouse
faef63e8a7 patches: fix c_utf8 validation
Some checks are pending
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-03-24 21:44:23 +01:00
kd-11
ff135384ef Fix for GCC builds
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-03-24 17:00:07 +03:00
kd-11
a51602018e rsx: Code cleanup and fix fragment texture dirty trigger 2025-03-24 17:00:07 +03:00
kd-11
1616942943 rsx: Always execute pre-draw pipeline analysis regardless of flags 2025-03-24 17:00:07 +03:00
kd-11
ba7b7b65a1 rsx: Bypass sampling cache logic when dealing with host generated textures 2025-03-24 17:00:07 +03:00
RipleyTom
40ff182c31 Fix p2p binding to vport 0
Some checks failed
Generate Translation Template / Generate Translation Template (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Has been cancelled
Build RPCS3 / RPCS3 Windows (push) Has been cancelled
2025-03-23 06:08:09 +01:00
Whatcookie
d9071abd8b
Utils: Remove AVX10-256 detection (#16904)
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
- Intel recently removed 256b AVX10 from the AVX10 spec.
2025-03-22 13:28:45 +02:00
Megamouse
b4f453f687 overlays: don't check for hdd dirs if we play a disc game
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-03-21 20:47:45 +01:00
Megamouse
4c742f7742 Fix typo 2025-03-21 20:47:45 +01:00
Megamouse
fda51920b7 overlays: prefer overlay_picture over content_icon 2025-03-21 20:47:45 +01:00
Megamouse
4905fda371 Qt: Don't fetch ICON0.PNG from game data for disc games
ICON0.PNG is not supposed to be updateable, so we can ignore the hdd0 dir for disc games in that case
2025-03-21 20:47:45 +01:00
Megamouse
1ae1288a88 overlays: Look for the overlay in the same dir as the background 2025-03-21 20:47:45 +01:00
Megamouse
6fb0e991ea overlays: Don't use ICON0.PNG from hdd0 if the game is a disc game
ICON0.PNG is not supposed to be updateable, so we can ignore the hdd0 dir for disc games in that case
2025-03-21 20:47:45 +01:00
Megamouse
650176fac7 overlays: Simplify game content search 2025-03-21 20:47:45 +01:00
Megamouse
95aad6ceb5 overlays: adjust size and position of overlay image 2025-03-21 20:47:45 +01:00
Megamouse
7cd5d812d2 overlays: add background overlay image 2025-03-21 20:47:45 +01:00
Megamouse
b2ff24453c overlays: fix background image logic
Also make the path getter more generic
2025-03-21 20:47:45 +01:00
Megamouse
12eacfa67b overlays: use std::string instead of raw path argument
It will be converted to string anyway
2025-03-21 20:47:45 +01:00
Megamouse
cd25e91321 VS/MSVC: Enable LTCG and GL on release builds 2025-03-21 16:35:53 +01:00
Megamouse
518bfeca3f Update libusb to 1.0.28
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-03-20 23:52:10 +01:00
Megamouse
76495f07b8 Qt: Remove supporters from translations 2025-03-20 08:52:08 +01:00
Megamouse
ccecd1a627 Qt: only show shortcut confirmation once 2025-03-20 08:52:08 +01:00
Megamouse
8f3eff293d Remove unnecessary localization 2025-03-20 08:52:08 +01:00
Megamouse
806c9230cd Fix typo 2025-03-20 08:52:08 +01:00
Megamouse
24b6b6cad5 Qt: fix handler not found in pad settings after changing language 2025-03-20 08:52:08 +01:00
Megamouse
971fd40353 Remove some useless translations 2025-03-20 08:52:08 +01:00
Megamouse
2aba8c639e Fix typo 2025-03-20 08:52:08 +01:00
Megamouse
1a51ce1e66 SPU: Add Disable SPU GETLLAR Spin Optimization checkbox 2025-03-18 09:30:28 +02:00
Hugo Locurcio
1398e7702b Improve BUILDING.md documentation
- Add llvm-devel dependency to Fedora (required to compile).
- Recommend using the Ninja generator on Linux to speed up compilation
  (and mention it in the package installation lists).
- Use shorter CMake commands and use the standard `build` folder as a target.
- Use `--recursive` in Git clone to automatically fetch submodules.
- Fix path of output binary file on Linux.
2025-03-18 02:54:49 +01:00
Vestral
a45f604cd8 Fix discord-rpc build when ASLR is enabled 2025-03-18 02:32:05 +01:00
Megamouse
ec29650029 Fix warning 2025-03-17 23:11:31 +01:00
Megamouse
4b31e34ea4 Qt: use white checkmarks in Darker Style 2025-03-17 23:11:31 +01:00
Megamouse
ae83c28bc8 Qt: Simplify hover movie code 2025-03-17 14:41:08 +01:00
Megamouse
58327ca23c Qt/optimization: Don't look for PAM files if the game has a hover gif 2025-03-17 14:41:08 +01:00
Megamouse
5b540aed73 Qt: Do not use gamedata icon if game has custom icon 2025-03-17 14:41:08 +01:00
Megamouse
6e080044a0 Qt: fix code style of some variables 2025-03-17 14:41:08 +01:00
Megamouse
42ba0b6271 Qt: Use localized game icons and titles 2025-03-17 00:47:43 +01:00
kd-11
a1fa8dd701 config: Revert default shader compiler to async with draw-skip 2025-03-16 16:48:20 +01:00
kd-11
aea1efd5f2 rsx: Fix instancing constants lookup layout when running interpreter 2025-03-16 16:33:39 +03:00
kd-11
5ae05e26c4 vk: Implement instancing when running in interpreter mode 2025-03-16 16:33:39 +03:00
kd-11
023221bd3b gl: Reimplement driver capabilities detection in a more sane way 2025-03-16 16:33:39 +03:00
kd-11
14575f3efd rsx: Always initialize CC register in FP interpreter 2025-03-16 16:33:39 +03:00
kd-11
9f3eb33d80 gl: Double instancing buffer size to improve frametimes 2025-03-16 16:33:39 +03:00
kd-11
225d0b9482 gl: Support transform instancing in the shader interpreter 2025-03-16 16:33:39 +03:00
kd-11
65c0d3d425 gl: Add support for hardware instancing 2025-03-16 16:33:39 +03:00
kd-11
3d3fc2f3cd rsx: Fix cache invalidation when instancing state changes 2025-03-16 16:33:39 +03:00
Malcolm Jestadt
f9a72e8d75 SPU LLVM: Preserve sign on inf to NaN conversion in spu_re_acc with vfixupimmps 2025-03-15 10:46:08 +02:00
Attila Fidan
7b212e0e57 sys_usbd: Fix null pointer deref on destruction 2025-03-13 01:36:09 +01:00
Jan Beich
a108ce8015 CI: upgrade FreeBSD to 13.5
FreeBSD doesn't support /latest and /quarterly package repos on EOL
versions. 13.4 reaches EOL on 2025-06-30, so avoid CI breakage.
2025-03-12 23:35:59 +01:00
Megamouse
ff21a05c96 Always run Actions, we need them for merges 2025-03-12 20:26:06 +01:00
Megamouse
25eb869d5f Readme: Improve build tags 2025-03-12 20:26:06 +01:00
Megamouse
ff40128df6 Qt: Detach markup from dialog translations 2025-03-12 18:49:24 +01:00
kd-11
b2ed787c3a rsx: Invalidate program cache hint if the current vertex or fragment program is re-evaluated 2025-03-12 15:36:29 +03:00
Megamouse
ec5b2bc8d2 Fix missing enum in switch case 2025-03-12 01:08:49 +01:00
Megamouse
3a71da35a9 Fix redundant forward declaration warning 2025-03-12 01:08:49 +01:00
Megamouse
4c788abad1 Use named_thread in gui_pad_thread 2025-03-12 01:08:49 +01:00
Megamouse
3737cc37f6 Qt: Hide interpreter_only unless it is selected or the debug mode is active 2025-03-11 06:58:23 +01:00
Megamouse
d0c2cb7ae1 main: Fix some warning 2025-03-11 06:58:23 +01:00
DH
db945f6aed android: do not invalidate swapchain on VK_SUBOPTIMAL_KHR
Workaround
2025-03-10 21:09:27 +01:00
Megamouse
b3f5ed55a1 Set vulkan to default renderer whenever we have vulkan support 2025-03-10 21:09:27 +01:00
Megamouse
fa5a16e9fc hid_init: use hid_error in log message 2025-03-10 21:09:27 +01:00
DH
0c233c6578 [android] hid: enumerate by vendor/product ids 2025-03-10 21:09:27 +01:00
DH
8100779512 hid: add support of android devices 2025-03-10 21:09:27 +01:00
DH
d766baef12 fs::file: implement release_handle
cleanup
2025-03-10 21:09:27 +01:00
DH
95d0cb18e4 Coding style issues fixes
Thanks @Megamouse
2025-03-10 21:09:27 +01:00
DH
976b0a8f1d cpu stats: do not try parse /proc/stat on android 2025-03-10 21:09:27 +01:00
DH
919cb8e05c android: atomic: do not test SYS_futex_waitv syscall 2025-03-10 21:09:27 +01:00
DH
cac068dad9 rsx: implement android swapchain 2025-03-10 21:09:27 +01:00
DH
7520c09087 rsx: reduce shaders_cache::unpacked_type size for android 2025-03-10 21:09:27 +01:00
DH
edf096fc13 vm: do not check overcommit_memory on android 2025-03-10 21:09:27 +01:00
DH
2ebf257f84 vm: removed c_page_size, it cannot be used by globals 2025-03-10 21:09:27 +01:00
DH
57e7cee84e android: cfg: vulkan renderer is default 2025-03-10 21:09:27 +01:00
DH
adaf24310d add missed include to PUP.h 2025-03-10 21:09:27 +01:00
DH
94f52d6dc0 android: jit: teach fallback_cpu_detection provide meaningful results for aarch64 2025-03-10 21:09:27 +01:00
DH
3080b55d02 cfg: remove string::get() 2025-03-10 21:09:27 +01:00
DH
bbb682a440 unpkg: allow package_reader creation with provided fs::file 2025-03-10 21:09:27 +01:00
DH
f3d988d8ab fs::file: add from_native_handle constructor
fs::get_*_dir tweaks for android
2025-03-10 21:09:27 +01:00
DH
2c122a4401 llvm: disable extra targets for android
explicitly specify native target, llvm determines wrongly if cross compiler used
2025-03-10 21:09:27 +01:00
DH
26ce38a4ac 3rdparty/fusion: Always do build in release mode
this library has python numpy dependency in debug build
2025-03-10 21:09:27 +01:00
DH
5084fb82b8 Android stuff 2 2025-03-10 21:09:27 +01:00
DH
798c194025 android stuff 2025-03-10 21:09:27 +01:00
kd-11
11e214f332 rsx: Handle out-of-bounds read/writes from FIFO register IO 2025-03-10 16:07:26 +03:00
AniLeo
ddd3ac3663 Settings: Move 'Max Shader Compile Threads' next to the equivalent LLVM setting 2025-03-10 08:16:19 +01:00
AniLeo
bacce9bb37 Settings: Move 'Vulkan Queue Scheduler' to Debug 2025-03-10 08:16:19 +01:00
AniLeo
aa819c8b97 Settings: Move 'Disable On-Disk Shader Cache' to Debug 2025-03-10 08:16:19 +01:00
AniLeo
af768d5c22 Settings: Move 'Disable Asynchronous Memory Manager' to Debug 2025-03-10 08:16:19 +01:00
AniLeo
2bf5ae3272 Settings: Move 'SPU Profiler' to Debug 2025-03-10 08:16:19 +01:00
AniLeo
a074b14631 Settings: Move 'PPU Vector NaN Fixup' to Debug 2025-03-10 08:16:19 +01:00
AniLeo
ac7d53cc37 Settings: Specify FSR 1 2025-03-10 08:16:19 +01:00
AniLeo
6d46d45983 Settings: Default 'Shader Mode' to Async with Interpreter 2025-03-10 08:16:19 +01:00
AniLeo
eea2f19d82 Settings: Move 'SPU Block Size' to the middle column 2025-03-10 08:16:19 +01:00
kd-11
2dfbab457a rsx: Reupload surface if the surface cache denies knowledge of it 2025-03-09 22:01:49 +03:00
Zion Nimchuk
5e5f82d1a2 Set CI msbuild verbosity to minimal to reduce spam 2025-03-09 11:02:57 +02:00
Elad
5e4637e15c SPU LLVM: Subtract Timebase from decrementer 2025-03-09 07:42:59 +02:00
FlexBy420
a3d2e93b14 move script to .ci/generate-qt-ts.sh 2025-03-08 23:47:04 +01:00
FlexBy420
100454398c Make suggested changes and remove unnecessary package 2025-03-08 23:47:04 +01:00
FlexBy420
cce43beeae Apply suggestions from code review
Co-authored-by: Megamouse <studienricky89@googlemail.com>
2025-03-08 23:47:04 +01:00
FlexBy420
ebcb61b34b fix the branch name in qt-ts.yml 2025-03-08 23:47:04 +01:00
FlexBy420
47b880fa8d Move ts generator job to seperate workflow file 2025-03-08 23:47:04 +01:00
FlexBy420
cd76f05a86 Create qt-ts.yml 2025-03-08 23:47:04 +01:00
FlexBy420
9173fc9815 fix branch name in .ts job 2025-03-08 23:47:04 +01:00
FlexBy420
7df5cb84b5 add a job for generating translation template file (.ts) 2025-03-08 23:47:04 +01:00
kd-11
e6b3c2061e rsx: Fix boundary seek logic for FIFO addresses 2025-03-09 01:36:26 +03:00
schm1dtmac
563a3d3587 Target macOS 14 instead of 13 (fixes camera) 2025-03-09 01:02:49 +03:00
kd-11
3be1e0b6ff rsx: Clean up and simplify texture register manipulation tests 2025-03-08 22:10:55 +03:00
kd-11
93899bf5a9 rsx/FIFO: Reimplement grabbing command args as a contiguous pointer
- Allows grabbing indefinite size of buffer as long as the data is contiguously mapped.
2025-03-08 22:10:55 +03:00
kd-11
ec120d1cbb rsx: Add stubs for FP rehash checks on barrier acquire 2025-03-08 22:10:55 +03:00
kd-11
df7a2ab467 rsx: Unify fragment texture config changes dirty bit tracking
- Reverts unnecessary changes to dirty tracking.
- The GPU keeps a separate set of details, so all dirty bits are treated equal.
2025-03-08 22:10:55 +03:00
kd-11
a39a743abe rsx/prog: Fix compiler warning 2025-03-08 22:10:55 +03:00
kd-11
eca86ad449 rsx: Add program cache lookup ellision rate to overlay 2025-03-08 22:10:55 +03:00
kd-11
a1c8f3a528 rsx/prog: Use a proper cache hint key instead of disjointed counters 2025-03-08 22:10:55 +03:00
Elad
26495a8455 SPU: Fixup 2025-03-08 14:21:57 +02:00
Elad
32df7315be RSX: Do not invalidate FP analysis on same register writes 2025-03-08 14:21:57 +02:00
Elad
7995181235 RSX: Return FP shader as is if no changes were made 2025-03-08 14:21:57 +02:00
Elad
75dc2a12e2 RSX: Return VP shader as is if no changes were made 2025-03-08 14:21:57 +02:00
Elad
ae39c5b8cb RSX: Optimize vertex program ucode invalidation 2025-03-08 14:21:57 +02:00
Megamouse
eb43fbbb2a Update SDL to 3.2.8 2025-03-08 10:03:00 +01:00
Elad
e4ed5c47a3 Fixup 2025-03-08 10:48:21 +02:00
Elad
e4b9a21acc SPU Analyzer: Fix for value propagation 2025-03-08 10:36:26 +02:00
Whatcookie
bfb9dfea7e
RSX: ProgramStateCache loops optimizations 2025-03-07 09:54:12 +02:00
Elad
8ed2089070 RSX: Fix UB in FIFO_control::get_current_arg_ptr() 2025-03-07 09:41:52 +02:00
JoãoPaulo
583ec5d819
Update FW 4.92 Latest Version (#16811)
Update FW 4.92 Latest Version
Updates the latest FW version according to: https://www.playstation.com/en-us/support/hardware/ps3/system-software/
List of changes:
This system software update improves system performance.
2025-03-05 15:00:07 +02:00
kd-11
59280a133c vk: Do not force strict query scopes by default 2025-03-05 14:40:35 +03:00
Megamouse
ba12de867e static analysis: fix memory leak in decompress
Some checks failed
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Has been cancelled
Build RPCS3 / RPCS3 Windows (push) Has been cancelled
2025-03-05 00:12:30 +01:00
Megamouse
ca3d02fc61 static analysis: ensure is always false 2025-03-05 00:12:30 +01:00
Megamouse
a49c4c7682 static analysis: duplicate assignment 2025-03-05 00:12:30 +01:00
Megamouse
4f52c67566 static analysis: suspicious code 2025-03-05 00:12:30 +01:00
Megamouse
7a6a96254c static analysis: remove unused overrides 2025-03-05 00:12:30 +01:00
Megamouse
6abb863a54 static analysis: std::move 2025-03-05 00:12:30 +01:00
Megamouse
e8463403f5 static analysis: uninitialized variables 2025-03-05 00:12:30 +01:00
Megamouse
815a4e7dc1 static analysis: less references 2025-03-05 00:12:30 +01:00
Megamouse
df2f68da44 static analysis: more const ref 2025-03-05 00:12:30 +01:00
Megamouse
a8fc3f5f74 static analysis: more const 2025-03-05 00:12:30 +01:00
Megamouse
d3c5cc7b13 ci: Use more variables for LLVM and QT 2025-03-04 23:44:45 +01:00
Megamouse
760e43ad2c VS: move LLVM AdditionalDependencies to rpcs3_default.props 2025-03-04 23:44:45 +01:00
Megamouse
229734e45f VS: add some missing filters 2025-03-04 23:44:45 +01:00
RipleyTom
66952fe301 Add memory breakpoints
Some checks are pending
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
RPCS3 needs to be compiled with -DHAS_MEMORY_BREAKPOINTS=ON for it to be available
2025-03-04 15:41:36 +01:00
Megamouse
cb659474d9 overlays: fix friends/trophy list input on paused emulation
Some checks are pending
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-03-03 18:21:35 +01:00
Megamouse
d429776418 Qt/patches: Only consider bootable games 2025-03-03 17:49:31 +01:00
Megamouse
d034f6a77f Qt/patches: move game list loop to patch manager
This deduplicates some code
2025-03-03 17:49:31 +01:00
Malcolm Jestadt
1920aee415 RSX: Fix issue where linux builds could hit illegal instruction on machines without AVX-512
- Place avx-512 function attributes in their own functions
2025-03-03 15:58:55 +03:00
Elad
783079266e Emulator: Implement config CLI args, add barrier for host CLI args
Some checks are pending
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-03-03 06:54:00 +02:00
Megamouse
bd41774960 overlays/osk: implement horizontal scroll
Some checks are pending
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-03-02 23:44:08 +01:00
Megamouse
4aa25285a3 overlays: use thread local static vector in get_glyph_data 2025-03-02 23:44:08 +01:00
Megamouse
7fd1f5b5d3 Fix some warning 2025-03-02 23:44:08 +01:00
Megamouse
72ee5ed10d overlays: add ability to hide hidden trophies 2025-03-02 23:02:22 +01:00
Megamouse
048a44cbe5 overlays: add getter for selected entry 2025-03-02 23:02:22 +01:00
Megamouse
6f5f7ece06 overlays: fix and optimize layout exit loops 2025-03-02 23:02:22 +01:00
Zion Nimchuk
b3d28e2309 Switch Windows and Linux x64 builds and deployments to GitHub Actions 2025-03-02 22:35:04 +01:00
trigger
1dc3ebf891
SPU Analyzer: A fixup for crash, TODO: proper fix
Some checks are pending
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-03-02 10:24:42 +02:00
Malcolm Jestadt
6bd1ab576c RSX: Use AVX-512-ICL code in get_vertecx_program_ucode_hash and in vertex_program_compare
- Code is about 4 times as fast on my zen4 machine
- Should be twice as fast on zen5 machines with full width AVX-512
2025-03-02 09:07:07 +02:00
trigger
8e6272bfee Qt: Fix boot failed dialog
Some checks are pending
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-03-01 20:00:21 +01:00
kd-11
0aca5e222f vk: Fix MacOS build 2025-03-01 18:02:32 +03:00
kd-11
b8411a90cd vk/swapchain: Fix WSI swapchain configuration overrides 2025-03-01 18:02:32 +03:00
kd-11
4e9365f76b vk/swapchain: Consolidate native swapchain implementation for platforms where it is not implemented
- NATIVE swapchain only matters in headless scenarios or where we otherwise cannot access WSI properly.
- It is now optional, with a stub provided when WSI is not available.
2025-03-01 18:02:32 +03:00
kd-11
602fe15641 vk/swapchain: Move platform-specific code to appropriate headers 2025-03-01 18:02:32 +03:00
kd-11
8b2e792d31 vk: Refactor swapchain into separate platform headers 2025-03-01 18:02:32 +03:00
kd-11
aca1cdf0b6 vk: Refactor instance management header 2025-03-01 18:02:32 +03:00
trigger
af23df842d
PPU: Report encrypted modules with KLIC in main file, opportunistic compilation at exit-spawn (#16743)
Some checks are pending
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-03-01 11:45:03 +02:00
Ani
b266e3d4bf rpcs3_version: Bump to 0.0.35
Some checks are pending
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-03-01 00:11:02 +00:00
Zion Nimchuk
4e08242074 Remove ProgramDatabase from libpng and zlib
Some checks are pending
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-02-28 18:37:50 +01:00
Zion Nimchuk
0690315d9e Use ccache on Windows CI build 2025-02-28 18:37:50 +01:00
Elad
207ee59acd PPU Analyzer: Firmware/import caller analysis and KLIC finding pass
Some checks failed
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Has been cancelled
Build RPCS3 / RPCS3 Windows (push) Has been cancelled
2025-02-27 12:32:21 +02:00
Zion Nimchuk
e97bfecb7f Deploy aarch64 builds via via GitHub Actions instead of Cirrus
Some checks are pending
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-02-26 21:59:20 +01:00
Megamouse
fe1fd86216 move texture_cache_types implementation to cpp 2025-02-26 19:42:31 +01:00
Megamouse
4f3f155bbf Update zstd to 1.5.7
Some checks are pending
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-02-26 14:08:56 +01:00
Megamouse
f284849fce Update curl to 8.12.1 2025-02-26 14:08:56 +01:00
Megamouse
527da94dfa Update libpng to 1.6.47 2025-02-26 14:08:56 +01:00
Megamouse
7970c2a6af Update SDL to 2.32.0 2025-02-26 14:08:56 +01:00
Megamouse
c61199dd27 Fix signed vs unsigned comparison warning 2025-02-26 14:08:56 +01:00
oltolm
29ad4ecc78 concepts: fix review notes
Some checks are pending
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-02-26 11:04:02 +02:00
oltolm
ebde5310b9 use concepts instead of std::enable_if 2025-02-26 11:04:02 +02:00
Megamouse
5e6aef5dfd cellMic: fix division by zero 2025-02-26 07:53:33 +01:00
Megamouse
cb539579b5 Qt: log microphone list 2025-02-26 07:53:33 +01:00
Megamouse
d0d136ede5 github actions: rename jobs
Some checks are pending
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
2025-02-25 20:33:03 +01:00
Megamouse
4df1f9fb18 Move permissions to own file 2025-02-25 19:45:43 +01:00
Megamouse
3c576da42f Move debugger functions to emu_utils.cpp 2025-02-25 19:45:43 +01:00
Megamouse
709e3d2822 Move sys_time fmt to date_time.cpp 2025-02-25 19:45:43 +01:00
Megamouse
9082908606 Move is_input_allowed to GSFrameBase 2025-02-25 19:45:43 +01:00
Megamouse
8d801dadc4 Move display sleep functions to emu callbacks 2025-02-25 19:45:43 +01:00
Megamouse
87db82cacd Move check_microphone_permissions to emu callbacks 2025-02-25 19:45:43 +01:00
Megamouse
d33d3a9f57 Move cheat_type fmt to cheat_info.cpp 2025-02-25 19:45:43 +01:00
Zion Nimchuk
4794558c08 Fix Azure and Github Actions CI caching
Some checks failed
Build RPCS3 / Linux_Build (/rpcs3/.ci/build-linux-aarch64.sh, clang, rpcs3/rpcs3-ci-jammy-aarch64:1.1, ubuntu-24.04-arm) (push) Has been cancelled
Build RPCS3 / Linux_Build (/rpcs3/.ci/build-linux.sh, clang, rpcs3/rpcs3-ci-jammy:1.1, ubuntu-24.04) (push) Has been cancelled
Build RPCS3 / Linux_Build (/rpcs3/.ci/build-linux.sh, gcc, rpcs3/rpcs3-ci-jammy:1.1, ubuntu-24.04) (push) Has been cancelled
Build RPCS3 / Windows_Build (push) Has been cancelled
2025-02-24 10:51:09 +01:00
Darkhost1999
a44bd97cda Update QT to 6.8.2
Some checks are pending
Build RPCS3 / Linux_Build (/rpcs3/.ci/build-linux-aarch64.sh, clang, rpcs3/rpcs3-ci-jammy-aarch64:1.1, ubuntu-24.04-arm) (push) Waiting to run
Build RPCS3 / Linux_Build (/rpcs3/.ci/build-linux.sh, clang, rpcs3/rpcs3-ci-jammy:1.1, ubuntu-24.04) (push) Waiting to run
Build RPCS3 / Linux_Build (/rpcs3/.ci/build-linux.sh, gcc, rpcs3/rpcs3-ci-jammy:1.1, ubuntu-24.04) (push) Waiting to run
Build RPCS3 / Windows_Build (push) Waiting to run
https://code.qt.io/cgit/qt/qtreleasenotes.git/about/qt/6.8.2/release-note.md
2025-02-24 09:23:07 +01:00
Zion Nimchuk
807c5e2240 Add opencv to linux CI and specify which modules we want to use 2025-02-24 08:33:24 +02:00
oltolm
b08273b127
Use Microsoft::WRL::ComPtr (#16744)
Some checks are pending
Build RPCS3 / Linux_Build (/rpcs3/.ci/build-linux-aarch64.sh, clang, rpcs3/rpcs3-ci-jammy-aarch64:1.0, ubuntu-24.04-arm) (push) Waiting to run
Build RPCS3 / Linux_Build (/rpcs3/.ci/build-linux.sh, clang, rpcs3/rpcs3-ci-jammy:1.0, ubuntu-24.04) (push) Waiting to run
Build RPCS3 / Linux_Build (/rpcs3/.ci/build-linux.sh, gcc, rpcs3/rpcs3-ci-jammy:1.0, ubuntu-24.04) (push) Waiting to run
Build RPCS3 / Windows_Build (push) Waiting to run
2025-02-23 15:39:39 +02:00
Elad
796a237128 PKG: Refactor and proper support for IDU
Some checks are pending
Build RPCS3 / Linux_Build (/rpcs3/.ci/build-linux-aarch64.sh, clang, rpcs3/rpcs3-ci-jammy-aarch64:1.0, ubuntu-24.04-arm) (push) Waiting to run
Build RPCS3 / Linux_Build (/rpcs3/.ci/build-linux.sh, clang, rpcs3/rpcs3-ci-jammy:1.0, ubuntu-24.04) (push) Waiting to run
Build RPCS3 / Linux_Build (/rpcs3/.ci/build-linux.sh, gcc, rpcs3/rpcs3-ci-jammy:1.0, ubuntu-24.04) (push) Waiting to run
Build RPCS3 / Windows_Build (push) Waiting to run
2025-02-22 15:01:47 +02:00
Malcolm Jestadt
bd49c6bedb SPU LLVM: Small FCGT optimization 2025-02-22 07:35:14 +02:00
Elad
86a832da29 unpkg: Add support for IDU packages 2025-02-21 17:25:23 +02:00
Ivan Podogov
e72cb6801a Add DXT1-5 decompression on ARM 2025-02-20 14:57:57 +03:00
trigger
1e01511ca0
cellMic: Implement SIGSTATE_MICENG
Some checks failed
Build RPCS3 / Linux_Build (/rpcs3/.ci/build-linux-aarch64.sh, clang, rpcs3/rpcs3-ci-jammy-aarch64:1.0, ubuntu-24.04-arm) (push) Has been cancelled
Build RPCS3 / Linux_Build (/rpcs3/.ci/build-linux.sh, clang, rpcs3/rpcs3-ci-jammy:1.0, ubuntu-24.04) (push) Has been cancelled
Build RPCS3 / Linux_Build (/rpcs3/.ci/build-linux.sh, gcc, rpcs3/rpcs3-ci-jammy:1.0, ubuntu-24.04) (push) Has been cancelled
Build RPCS3 / Windows_Build (push) Has been cancelled
2025-02-20 11:57:41 +02:00
¥IGA
26e0f56bf9 CI: Use windows-2025 Runner 2025-02-20 09:50:36 +02:00
RipleyTom
157e73b67e Add missing NotFound error handling in LeaveRoom reply 2025-02-20 07:58:03 +02:00
RipleyTom
6074480ffb Reset presence when terminating NP
Some checks are pending
Build RPCS3 / Linux_Build (/rpcs3/.ci/build-linux-aarch64.sh, clang, rpcs3/rpcs3-ci-jammy-aarch64:1.0, ubuntu-24.04-arm) (push) Waiting to run
Build RPCS3 / Linux_Build (/rpcs3/.ci/build-linux.sh, clang, rpcs3/rpcs3-ci-jammy:1.0, ubuntu-24.04) (push) Waiting to run
Build RPCS3 / Linux_Build (/rpcs3/.ci/build-linux.sh, gcc, rpcs3/rpcs3-ci-jammy:1.0, ubuntu-24.04) (push) Waiting to run
Build RPCS3 / Windows_Build (push) Waiting to run
2025-02-19 11:14:55 +02:00
illusion0001
ec3d9a2cae Fix ARM matrix and review comments
Some checks failed
Build RPCS3 / Linux_Build (/rpcs3/.ci/build-linux-aarch64.sh, clang, rpcs3/rpcs3-ci-jammy-aarch64:1.0, ubuntu-24.04-arm) (push) Has been cancelled
Build RPCS3 / Linux_Build (/rpcs3/.ci/build-linux.sh, clang, rpcs3/rpcs3-ci-jammy:1.0, ubuntu-24.04) (push) Has been cancelled
Build RPCS3 / Linux_Build (/rpcs3/.ci/build-linux.sh, gcc, rpcs3/rpcs3-ci-jammy:1.0, ubuntu-24.04) (push) Has been cancelled
Build RPCS3 / Windows_Build (push) Has been cancelled
Co-authored-by: Megamouse <studienricky89@googlemail.com>
Co-authored-by: Zion <zionnimchuk@gmail.com>
2025-02-17 21:11:39 +00:00
Aleksey Komarov
c7c45bf2b8 Add arm64 build, update Qt version and docker image for github actions 2025-02-17 21:11:39 +00:00
illusion0001
49f6c5cdca GitHub Actions CI Port 2025-02-17 21:11:39 +00:00
Elad
52edef0867 Remove xxHash submodule 2025-02-17 18:00:01 +02:00
RipleyTom
0e5014788b Fix SignalingHelper notification 2025-02-17 07:42:33 +02:00
Malcolm Jestadt
7b9aaacc4b RSX: ProgramStateCache logic cleanup and microoptimizations
- Eliminate some redundant checks in fragment and vertex comparison functions
- Add is_any_src_constant optimization, eliminates 1 instruction per loop
2025-02-16 12:28:10 +02:00
Malcolm Jestadt
d891b83e4b RSX: Use checksum with rotated inputs for shader hashing instead of FNV
- Raises FPS from ~180 to ~200 in Ninja Gaiden
2025-02-16 12:28:10 +02:00
oltolm
7e10aa57c4 CMakeLists.txt: add option to disable LTO 2025-02-15 20:33:25 +00:00
oltolm
e3f57074aa cmake: fix build after 3rdparty updates 2025-02-15 20:33:25 +00:00
RipleyTom
a29ecaf1d3 Fix sendto for p2ps packets 2025-02-14 22:28:11 +00:00
Megamouse
cefcaaf287 Qt: enable updater for linux arm 2025-02-13 18:49:14 +01:00
Jan Beich
800c0f7a56 CI: drop fragile bundled libc++ on FreeBSD
- RPCS3 still uses C++20 which no longer needs recent Clang/libc++
- FreeBSD releases more frequently, bringing newer Clang/libc++
- bundled libc++ wastes too much limited CI time
2025-02-13 13:37:36 +00:00
Jan Beich
2593077361 CI: only use headers from bundled libc++ on FreeBSD
Linking different versions of libc++ can cause ABI issues but new C++
features are usually limited to headers.

ld: error: undefined symbol: operator new(unsigned long, std::align_val_t)
>>> referenced by string.cpp
>>>               string.cpp.o:(void* std::__1::__libcpp_operator_new[abi:ne190107]<unsigned long, std::align_val_t>(unsigned long, std::align_val_t)) in archive /tmp/cirrus-ci-build/libcxx_prefix/lib/libc++.a
>>> referenced by memory_string_searcher.cpp
>>>               memory_string_searcher.cpp.o:(memory_viewer_panel::OnSearch(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, unsigned int)) in archive rpcs3/rpcs3qt/librpcs3_ui.a
>>> referenced by game_list_frame.cpp
>>>               game_list_frame.cpp.o:(stx::auto_typemap<game_list_frame, 0u, 16u>::auto_typemap()) in archive rpcs3/rpcs3qt/librpcs3_ui.a
>>> referenced 23 more times
2025-02-13 13:37:36 +00:00
Jan Beich
e4595f63c4 CI: unbreak bundled libc++ on FreeBSD after 363a225554
CMake Error at src/CMakeLists.txt:262 (add_custom_command):
  Error evaluating generator expression:

    $<TARGET_PROPERTY:libcxx-abi-shared,IMPORTED_LIBNAME>

  Target "libcxx-abi-shared" not found.

CMake Error at libcxx_build/include/cmake_install.cmake:4117 (file):
  file INSTALL cannot find "/tmp/cirrus-ci-build/libcxx_build/include/c++/v1/libcxx.imp": No
  such file or directory.
2025-02-13 13:37:36 +00:00
Jan Beich
b7b5774df1 CI: unbreak bundled libc++ on FreeBSD after 67703b49d8
CMake Error at modules/CMakeLists.txt:221 (file):
  file RELATIVE_PATH must be passed a full path to the directory:
  libcxx_prefix/lib
2025-02-13 13:37:36 +00:00
Jan Beich
f60fb5a70e CI: upgrade FreeBSD to 13.4
FreeBSD doesn't support /latest and /quarterly package repos on EOL
versions. 13.3 reached EOL on 2024-12-31, so avoid CI breakage.

Failed to start an instance: INVALID_ARGUMENT: Not Found 404 Not Found
The resource 'projects/freebsd-org-cloud-dev/global/images/family/freebsd-13-3' was not found
2025-02-13 13:37:36 +00:00
Jan Beich
19077ee1ed cpu_stats: restore a header for BSDs after cd87a64621
rpcs3/util/cpu_stats.cpp:390:4: error: use of undeclared identifier 'getpid'
  390 |                         getpid(),
      |                         ^
2025-02-13 13:37:36 +00:00
Vestrel
26df3a8452
Add Cubeb log callback (#16510)
Co-authored-by: Elad <18193363+elad335@users.noreply.github.com>
2025-02-13 13:47:12 +02:00
Takuya Wakazono
b63140b423 Fix build without vulkan
Since commit 4594c91 made SPIRV required dependency, it needs to be
linked in CMakeLists.txt regardless of USE_VULKAN.
2025-02-13 11:48:36 +01:00
RipleyTom
eeff7b0f0a Fix Aarch Linux CI 2025-02-13 11:14:35 +02:00
RipleyTom
f15ed36da1 Fix Change Password dialog not saving the new password on success 2025-02-13 07:04:08 +01:00
RipleyTom
1efca833a4 Fix missing NoError error checking in a few sceNpGUI functions 2025-02-13 07:04:08 +01:00
RipleyTom
159370446f RPCN v1.4 2025-02-12 15:00:50 +01:00
Malcolm Jestadt
a9b0f76698 cmake: Enable LTO for rpcs3_emu target
- Provides a small speedup and saves some space in the binary.
2025-02-12 09:46:53 +02:00
kd-11
7fcd747819 rsx: Fix internal res tracking 2025-02-12 01:58:52 +03:00
RipleyTom
cd87a64621 Headers cleanup 2025-02-11 20:38:35 +01:00
Elad
63147fdede Remove ppu_acontext 2025-02-11 16:12:33 +02:00
Malcolm Jestadt
dfd83bc7a4 SPU LLVM: Add two dependency chains for SPU verification
- Should restore performance to match the xorsum builds
2025-02-11 12:30:21 +02:00
kd-11
3392f0a271 gl: Fix stencil resolve for NVIDIA cards
- Only NV cards fail to expose ARB_shader_stencil_export which forces a very clunky workaround
- Fix stencil parameter initialization
2025-02-11 02:28:31 +03:00
kd-11
10d5907f46 rsx: Implement framebuffer statistics to track the internal render resolution at runtime. 2025-02-11 02:28:31 +03:00
kd-11
0f3d2c7085 gl: Implement MSAA transparency (sample-to-coverage) 2025-02-11 02:28:31 +03:00
kd-11
485927ed0d gl: Fix crash when launching multiple games with MSAA enabled 2025-02-11 02:28:31 +03:00
kd-11
0d4f3cf0a5 Allow MSAA selection in the UI 2025-02-11 02:28:31 +03:00
kd-11
4f08bfd0a2 Fix compilation on clang 2025-02-11 02:28:31 +03:00
kd-11
54e7cb8d9e vk: Silence spec validation error on NV cards 2025-02-11 02:28:31 +03:00
kd-11
fab39a6495 gl: Add support for "hw MSAA resolve" option 2025-02-11 02:28:31 +03:00
kd-11
008bfa2cd2 gl: Add extra checks around invalid render/compute passes
- These would have saved a lot of time debugging problems
2025-02-11 02:28:31 +03:00
kd-11
5907a6a67d gl: Fix crash in texture cache due to incorrect surface handling 2025-02-11 02:28:31 +03:00
kd-11
85880e6037 gl: Implement remaining resolvers
- Add support for NVIDIA cards
- Implement all depth-stencil resolver passes
2025-02-11 02:28:31 +03:00
kd-11
042be7d7d1 gl: Implement basic MSAA rendertarget support
- Enough to get some popular titles working.
- Some depth resolvers still need work
2025-02-11 02:28:31 +03:00
kd-11
26d85e53a4 vk: Fix extension initialization during device creation
- Fix crash when using device_fault extension
- Fix spec violation when using conditional rendering
2025-02-11 02:28:31 +03:00
kd-11
f3e913b56a vk: Redesign resource binding for overlay passes 2025-02-11 02:28:31 +03:00
kd-11
99ace42447 gl: Enforce full image creation argument declaration
- Closes a class of bugs caused by implicit conversion of similar argument types
2025-02-11 02:28:31 +03:00
kd-11
6c6d03ac5e gl: Upgrade the surface cache to become MSAA-aware 2025-02-11 02:28:31 +03:00
kd-11
8249b5dbfa gl: Implement MSAA resolve/unresolve for color images 2025-02-11 02:28:31 +03:00
kd-11
2a4bd6a7fc gl: Implement multisampled image creation 2025-02-11 02:28:31 +03:00
kd-11
82981384d5 vk: Move MSAA resolve/unresolve shaders to common GPU program layer 2025-02-11 02:28:31 +03:00
kd-11
a7a49d9eaa gl: Plumb stubbed MSAA support into the render target handlers 2025-02-11 02:28:31 +03:00
kd-11
808f67a3b2 gl: Stub dynamic sample count when creating textures 2025-02-11 02:28:31 +03:00
Elad
9a7b8e41eb PPU Analyzer: Minor Fixup 2025-02-09 14:28:08 +02:00
Elad
c7e853bf99 PPU Analyzer: GPR-assisted jump table analysis 2025-02-07 20:27:17 +02:00
Elad
ac97b36b1c PPU Analyzer: Opt-out suspected floats from instruction stream 2025-02-07 20:27:17 +02:00
Elad
181c92a868 PPU Analyzer: Clean addr_heap fron non-valid code
Should speed up analysis in some cases.
2025-02-07 20:27:17 +02:00
Elad
86b7078464 PPU LLVM: Fix compilation of PRX with no relocations 2025-02-07 20:27:17 +02:00
Megamouse
a1a0333e56 cellVdec: implement cellVdecOpenExt 2025-02-06 19:31:23 +01:00
Megamouse
85715e893b win: Add more llvm prebuilt paths 2025-02-06 18:07:53 +01:00
Megamouse
2897297252 Update docker for llvm 19 2025-02-06 18:07:53 +01:00
Megamouse
17b75cd010 mac/llvm: fix libunwind path 2025-02-06 18:07:53 +01:00
Megamouse
363a225554 Update LLVM to 19.1.7 2025-02-06 18:07:53 +01:00
Megamouse
449c23ba4e cellL10n: implement SBCS conversions 2025-02-06 09:38:17 +01:00
Megamouse
78ee489906 Update curl to 8.12.0 2025-02-06 00:32:19 +01:00
Megamouse
cec1004da8 cellL10n: fix compilation on linux 2025-02-05 07:51:47 +01:00
Megamouse
666bbeba6e cellL10n: Use string_view 2025-02-05 07:51:47 +01:00
Megamouse
770b2ab26d cellL10n: implement ucs2/utf8/16/23 conversions 2025-02-05 07:51:47 +01:00
Elad
2420aa7a21 Fixup PPU block unfolding 2025-02-04 20:33:24 +02:00
Megamouse
a5d07af89a cellMusic: always select the whole playlist instead of a single track 2025-02-04 18:13:07 +01:00
Megamouse
9bccdf4f71 cellMusic: fix volume. Qt needs a value between 0 and 1 2025-02-04 18:13:07 +01:00
Megamouse
b5dbafb3e2 cellMusic: make selection context valid when setting a playlist 2025-02-04 18:13:07 +01:00
Megamouse
22a1f41ecb Input/DS4: use hid_write instead of hid_write_control
Apparently this was only needed for Windows 7
2025-02-04 12:06:31 +01:00
Megamouse
739c4bcfc8 Qt: ignore all game window hotkeys on "disable kb hotkeys" 2025-02-04 09:39:34 +01:00
Megamouse
85f288651b cellGem: reduce cellCamera log spam by setting some camera features 2025-02-04 03:09:27 +01:00
Megamouse
50387cc516 update_manager: use v3 api for all OS 2025-02-03 22:53:53 +00:00
kd-11
6123838a48 ppu/arm64: Fix ppu_recompiler_fallback implementation for ARM processors 2025-02-02 22:44:42 +03:00
Megamouse
7ffbada725 Update SDL to 2.30.12 2025-02-02 17:06:39 +01:00
Megamouse
88776ceaa6 Update Fusion to 1.2.8 2025-02-02 17:06:39 +01:00
Megamouse
35fbdd0bae Update FAudio to 25.02 2025-02-02 17:06:39 +01:00
Megamouse
0770c28207 Update libpng to 1.6.46 2025-02-02 17:06:39 +01:00
Megamouse
92979d23cf Set openal system version to 10.0 2025-02-02 17:06:39 +01:00
Megamouse
3187dc816e Fix some warnings 2025-02-02 17:06:39 +01:00
kd-11
cfd571cfc2 Re-enable TSC on ryzen CPUs 2025-02-02 17:45:50 +03:00
kd-11
89eb473dce rsx: Fix graphics corruption when switching between shader interpreter and recompiler at runtime 2025-02-02 12:08:05 +03:00
Malcolm Jestadt
911f0928cf SPU LLVM: Replace xorsum with simple checksum
- Fixes crashes in GTAV
2025-02-01 21:40:30 +02:00
Elad
394fc8eb79 Enable Time-based TSC for non-Ryzen CPUs 2025-01-31 14:35:08 +02:00
Elad
57b6ced957 PPU Analyzer: Fix per-instruction code submission 2025-01-31 13:01:53 +02:00
Malcolm Jestadt
506d92107c SPU LLVM: Use 512bit xorsum for SPU verification
- Provides a 2-3% uplift in SPU limited titles
- Removes the full_width_avx512 option
- Adds a precise spu verification option, for debugging (config file only)
2025-01-31 12:03:05 +02:00
Elad
665bb83297
Fix Savestates recent regression 2025-01-28 18:49:19 +02:00
Elad
7fc0f69e48 PPU LLVM: Fix HLE patches 2025-01-28 12:51:52 +02:00
Megamouse
67703b49d8 Update LLVM to 18.1.8 2025-01-25 18:15:13 +01:00
Megamouse
ad6eba1670 Fix some warnings 2025-01-25 17:06:35 +01:00
Megamouse
0ef2e96121 Fix segfault on missing firmware
Wait until kill to close the gs_frame on error
2025-01-25 17:06:35 +01:00
Megamouse
664e09f1ff Qt: Fix Recent savestate path 2025-01-25 15:39:05 +01:00
Megamouse
27baab992a Qt: Add path to recent game/savestate tooltip 2025-01-25 15:39:05 +01:00
Megamouse
099e3c67b2 Qt: fix recent savestate shortcuts 2025-01-25 15:39:05 +01:00
Megamouse
959d8fc25c Qt: Fix recent savestates menu settings 2025-01-25 15:39:05 +01:00
Elad
5ef442c2b8 Disable ARM trampolines 2025-01-25 12:47:44 +02:00
Elad
ba79e092a0 Protect RPCS3 from built-in PS2 emulator 2025-01-25 12:47:44 +02:00
Elad
9677a3a9ea Fix Emulator::IsPaused() to allow measurements during module compilation
Also fix a potential deadlock in access violation handler for non-cpu_thread
2025-01-25 12:47:44 +02:00
Elad
4c0832e6e6 PPU LLVM: Reduce size of JIT-transition treampolines to 16 2025-01-25 12:47:44 +02:00
Elad
6fc643f483 JITASM.cpp: add assert for code building 2025-01-25 12:47:44 +02:00
Elad
3f4210437d JIT.h: Add option for lowered function size 2025-01-25 12:47:44 +02:00
Elad
67f2356ef7 JIT.h: Use kOptimizeForSize 2025-01-25 12:47:44 +02:00
Elad
81d0dd686b LLVM: Add explicit resource-freeing at emulation stop 2025-01-25 12:47:44 +02:00
Elad
a24e747e16 PPU LLVM: Disable an experimental limit 2025-01-25 12:47:44 +02:00
Elad
05f52246a2 PPU LLVM: Simplify module progress
Do not mix module compilation with linking.
2025-01-25 12:47:44 +02:00
Elad
b46408d554 PPU Analyzer: Report invalid functions 2025-01-25 12:47:44 +02:00
Elad
58701000cd PPU Analyzer: Clean addr_heap from non-relocations (PRX) 2025-01-25 12:47:44 +02:00
Elad
5a5e475c6e PPU Analyzer: Move ppu_function::callers to lower sizeof(ppu_function) 2025-01-25 12:47:44 +02:00
Elad
ff89a08ee4 PPU Analyzer: Remove ppu_function::calls to lower sizeof(ppu_function)
Use blocks to get calls.
2025-01-25 12:47:44 +02:00
Elad
f5487e9137 PPU Analyzer: Use std::map::extract to reduce peak memory consumption 2025-01-25 12:47:44 +02:00
Elad
857eac3d10 PPU Analyzer: Remove ppu_function::name to lower sizeof(ppu_function) 2025-01-25 12:47:44 +02:00
Elad
f0fa8e3bc3 Remove ppu_attr::known_addr 2025-01-25 12:47:44 +02:00
Elad
9d5b75bb7a LLVM: Slice PPU executable memory 2025-01-25 12:47:44 +02:00
Elad
7b8fee7cdb Thread.cpp: Report VM addresses on VM segfault 2025-01-25 12:47:44 +02:00
Elad
64c53fcc61 LLVM: Install error reporting handler 2025-01-25 12:47:44 +02:00
Megamouse
10d038e43f Qt: Fix device notification registration segfault
The main window does not exist if we boot with no-gui
2025-01-25 00:57:22 +01:00
Sanjay Govind
f1f85335a7
sys_usbd: Fix emulated devices not being created without a physical device (#16608) 2025-01-24 08:44:10 +01:00
Megamouse
bd1ebb7a10 Qt: add savestate manager dialog 2025-01-24 05:32:19 +01:00
Sanjay Govind
e2bbaa2430
libusb: support hotplug (#16580) 2025-01-23 23:49:24 +01:00
Megamouse
ba702509c8 Qt: Add Recent savestates menu 2025-01-23 22:55:07 +01:00
Megamouse
448666c896 Log LLVM version 2025-01-23 18:01:16 +01:00
Megamouse
8f660fc6b1 cellGem: update gun handler connection periodically 2025-01-23 12:35:02 +01:00
Sanjay Govind
fd66b6b103 cellPad: Send disconnection notification when swapping device class 2025-01-23 09:19:37 +01:00
Megamouse
e83eeb3cca cellGem: Move the cursor out of the screen (Time Crisis 4 needs this) 2025-01-23 08:18:07 +01:00
Megamouse
f537a62ca6 cellGem: Set 255 as value for analog_t 2025-01-23 08:18:07 +01:00
Megamouse
b30ea34d05 cellGem: mark device as not visible at the screen borders 2025-01-23 08:18:07 +01:00
Megamouse
6fddb31a07 Qt/input: reset gui pad thread when saving pad settings 2025-01-22 20:47:07 +01:00
Megamouse
79d79aa80c cellCamera: move attach event to thread
Time crisis doesn't seem to like the immediate push to the queue.
2025-01-22 02:18:07 +01:00
Megamouse
fbc7ad6788 cellGem: move some locks around wait loops 2025-01-22 02:18:07 +01:00
Megamouse
fcac6a9322 sys_event: remove unnecessary copy 2025-01-22 02:18:07 +01:00
Megamouse
dc700ad620 cellCamera: close Qt camera on error (e.g. when usb is pulled) 2025-01-22 02:18:07 +01:00
Megamouse
74540844d2 cellGem: ignore missing pad handler
This is a hacky way to fix cellGem savestates
2025-01-22 02:18:07 +01:00
Megamouse
23483a80c7 cellGem: Fix camera image when loading savestates 2025-01-22 02:18:07 +01:00
Megamouse
ade2698bb4 cellCamera: start camera when loading savestates 2025-01-22 02:18:07 +01:00
Megamouse
85de7432a2 cellGem: improve convert_image_format logging 2025-01-22 02:18:07 +01:00
Megamouse
6805c36004 Decrease log level of config file move error 2025-01-22 02:18:07 +01:00
Megamouse
1cff5b35d4 input: add vibration multiplier 2025-01-21 08:44:38 +01:00
MSuih
9c5584956e Update minimum pugixml version to 1.15 2025-01-20 17:18:09 +01:00
kd-11
2af497efbb rsx: Fix texcoord transformation bug caused by incorrect BFE usage 2025-01-19 19:31:59 +03:00
kd-11
58a09e6838 vk: Use common pipeline layout in interpreter
- Avoids the layouts going out of sync every time something changes
2025-01-19 19:31:59 +03:00
kd-11
b5b93e962b vk: Factor out common pipeline layout generator into reusable parts 2025-01-19 19:31:59 +03:00
Emma
10e0fb2b54
sys_prx: implement get_module_id_by_name, module_info_v2 (#16573) 2025-01-18 15:16:38 +02:00
Megamouse
0a6f9ed967 windows: Ignore OneDrive in PATH. It leads to false positives 2025-01-17 00:32:54 +01:00
Megamouse
a7edfa221e windows: move logs to log dir 2025-01-16 21:33:33 +01:00
Megamouse
451e953d26 windows: move config.yml and games.yml to /config/ 2025-01-16 21:33:33 +01:00
Megamouse
5c2c4a6649 input: issue basic mouse move event on window leave
This may help with moving the mouse to the screen borders in windowed mode
2025-01-16 18:27:16 +01:00
kd-11
09580594e6 rsx: Fix shader cache loading 2025-01-16 02:43:33 +03:00
kd-11
efc9ae98ed vk: Fix out-of-bounds write when emitting MSAA unresolve clear command for NVIDIA fallback 2025-01-15 11:27:04 +03:00
kd-11
7da0822419 rsx/shaders: Fix MSAA coords wrapping when input is negative 2025-01-15 11:27:04 +03:00
kd-11
e1c6df0df3 rsx: Fix dynamic constants patching when draw call is skipped
- Also adds an optimization to skip reuploads when patch occurs outside our critical range.
2025-01-15 11:27:04 +03:00
kd-11
7965a0313c rsx: Improved shader interpreter support when hw instancing is active 2025-01-15 11:27:04 +03:00
Megamouse
0cc61d0ef0 windows: check for OneDrive paths 2025-01-14 23:32:02 +01:00
Megamouse
1966171838 Use string_view in rXml 2025-01-14 21:35:57 +01:00
Megamouse
2643fbdea4 Update pugixml to 1.15 2025-01-14 21:35:57 +01:00
Megamouse
82bbb0cc05 Update libpng to 1.6.45 2025-01-14 21:35:57 +01:00
Megamouse
d91927ee97 Qt/input: allow keypresses in raw mouse handler 2025-01-14 15:52:46 +01:00
capriots
ae670c35f7 cellAtracXdec: use lv2 mutexes + conds 2025-01-14 11:32:32 +02:00
Megamouse
d1ccadbac2 cellGem: ignore intercepted input 2025-01-14 08:53:36 +01:00
Megamouse
78a661db79 input: simplify raw mouse button press handling 2025-01-14 00:00:50 +01:00
Megamouse
b65f977c54 Qt/input: fix raw mouse button assignment 2025-01-14 00:00:50 +01:00
Megamouse
1b87e186c4 cellGem: fix initial tracker done state 2025-01-10 21:53:37 +01:00
Megamouse
3eb1e6303c cellGem: Use wait_on, fix fake/mouse move tracker wait 2025-01-10 21:53:37 +01:00
Megamouse
3b8efecc52 cellGem: Use atomic wait instead of wait_for 2025-01-10 21:53:37 +01:00
Megamouse
6716d555ff cellGem: Update controllers at 10 Hz in separate thread
Some games don't use cellGemGetInfo.
Which means we had to reboot the game if the controller wasn't
connected on boot.
Updating controllers outside of the cell functions fixes this problem.
2025-01-10 21:53:37 +01:00
kd-11
27c56cde22 rsx/shaders: Track active MRT count per shader
- Also use more robust hashing to avoid collisions
2025-01-10 04:34:28 +03:00
kd-11
a635e24fc2 rsx: Default initialize vertex program fields
- Fixes a crash when RSXVertexProgram is default-initialized. This
  probably also fixes a whole class of crashes that occur when
  shader interpreter is in use since that pipeline uses a
  default-initialized stub.
2025-01-10 04:34:28 +03:00
kd-11
dce0abc8b9 rsx/fp: Re-design register write tracking
- Always collapse register writes when exporting FS outputs
2025-01-10 04:34:28 +03:00
kd-11
88e13d8326 rsx: Don't crash when invalid buffer is allocated for a shader 2025-01-10 04:34:28 +03:00
Megamouse
061be74cdb Qt: add mouse config legend to mouse move dialog 2025-01-10 00:50:02 +01:00
Megamouse
d6f2f66f2b Qt/Input: use empty string for pad_button_max_enum
Also shorten translated mouse button strings
2025-01-10 00:50:02 +01:00
Megamouse
b8d0396f71 Fix self assignment warning 2025-01-10 00:50:02 +01:00
Megamouse
a0df1e09a6 ps move: allow to configure mouse move handler buttons 2025-01-10 00:50:02 +01:00
Megamouse
7e03828f35 input: Allow mapping keys to basic mouse buttons 2025-01-09 21:59:01 +01:00
Megamouse
9407974c10 cellGem: Add more camera image conversions 2025-01-09 09:38:36 +01:00
Megamouse
3381a884d0 Fix some warnings 2025-01-08 20:02:33 +01:00
Megamouse
415c2d0795 fake move: add gyro support 2025-01-08 20:02:33 +01:00
Megamouse
92d0707291 Decrease mouse move assignment distance 2025-01-07 21:11:46 +01:00
Elad
c6f3737c2a PPU LLVM: Fixup patches enlisting in analyzer 2025-01-07 20:42:45 +02:00
Antonino Di Guardo
ec77f2ab92
Minor cleanup (#16519)
* Minor cleanup
2025-01-07 19:46:13 +03:00
Elad
0b784ff2c1 PPU LLVM: Function table dependent resolver hashing 2025-01-07 15:43:41 +02:00
Megamouse
c443326fb1 Do not re-use the old game window if the renderer changed 2025-01-06 15:49:09 +01:00
Megamouse
2ac171a30f move error_report to ErrorCodes.cpp 2025-01-06 15:49:09 +01:00
Megamouse
7369169331 Disable continuous mode if a savestate is not possible 2025-01-06 15:49:09 +01:00
Megamouse
d5470d92ec Keep game window open when loading the last savestate 2025-01-06 15:49:09 +01:00
Megamouse
cc7e7300ce Clean up old game window in case of unexpected errors 2025-01-06 15:49:09 +01:00
Megamouse
3ce4c95e61 Show message while creating savestate in continuous mode 2025-01-06 15:49:09 +01:00
Megamouse
1ab3a0bd73 RSX/Qt: Reuse gs_frame if possible 2025-01-06 15:49:09 +01:00
Megamouse
99f1f4c22a cheats: add float32 gui support 2025-01-06 10:48:00 +01:00
oltolm
41a4dd4c1c cmake: fix wolfssl 2025-01-05 23:03:00 +01:00
oltolm
1080969b51 cmake: remove "--no-quick" from windeployqt 2025-01-05 23:03:00 +01:00
Elad
6165c2d8b3 Thread.h: Fix a bug by adding thread_state::destroying_context 2025-01-05 10:01:35 +02:00
Elad
036693a14d Fix sys_config_unregister_service 2025-01-05 10:01:35 +02:00
Aleksey Komarov
c9d39ce7ae vk: Support panvk, allow creating device without textureCompressionBC
panvk supports BC1-BC3 which is all RPCS3 require, support is reported as
false since not all formats are supported
2025-01-04 20:22:05 +02:00
Aleksey Komarov
da84326bd0 vk: Add driver vendor PANVK (Mali GPU on Mesa) 2025-01-04 20:22:05 +02:00
Megamouse
f255392a75 patches: create patch path on update 2025-01-04 15:45:22 +01:00
Megamouse
af3154a0d4 Qt: delete settings_dialog 2025-01-04 15:45:22 +01:00
Megamouse
d2b96636db Qt: delete batch progress dialog after user closed it (as originally intended) 2025-01-04 11:31:25 +01:00
Megamouse
635eac7704 Qt: fix batch compilation after a game was already running
Batch compilation wasn't working if g_system_progress_canceled wasn't reset
2025-01-04 11:31:25 +01:00
Megamouse
51417cc8c3 Qt: stop batch compilation immediately on cancel 2025-01-04 11:31:25 +01:00
Elad
2614450e4b Fix IDM image serialization 2025-01-04 09:29:09 +02:00
Megamouse
8ea27b0aca Qt: workaround for crash in long accepted slot 2025-01-03 20:21:56 +01:00
Megamouse
4f76aec6b3 VS: Fix compilation with new wolfssl version 2025-01-03 20:21:56 +01:00
Megamouse
dfdb33befb Update xxHash to 0.8.3 2025-01-03 20:21:56 +01:00
Megamouse
e76bd11f53 Update Wolfssl to 5.7.6 2025-01-03 20:21:56 +01:00
Megamouse
4b4399f63f Update FAudio to 25.01 2025-01-03 20:21:56 +01:00
Megamouse
796189ce68 Update SDL to 2.30.11 2025-01-03 20:21:56 +01:00
Elad
a8f80ebfe9 sys_time.cpp: Anti TSC measures 2025-01-03 16:26:21 +02:00
Andrew Griffiths
cb3662cc4d MacOS: fix for crash in SDL_Quit w/ gamepad input 2025-01-02 18:58:24 +01:00
Megamouse
fb237dd568 Audio: Add mute/unmute and volume shortcuts
Also add auto repeat to volume shortcuts
2025-01-02 09:34:47 +01:00
Aleksey Komarov
799cb79612 qt6: QT_MIN_VER should be 6.7 because of QCheckBox::checkStateChanged
Check: https://doc.qt.io/qt-6/qcheckbox.html
2025-01-01 23:04:56 +01:00
Megamouse
1c22cc2f52 overlays: add trophy list dialog 2025-01-01 13:42:21 +01:00
kd-11
0bb2f72ee2 rsx: Flush MM queue before memory is unmapped 2024-12-31 01:52:58 +03:00
schm1dtmac
b16d267f9d Fix types 2 2024-12-30 07:29:31 +02:00
schm1dtmac
9ffa923da6 Use corresponding SI/IEC units 2024-12-30 07:29:31 +02:00
schm1dtmac
8feccffec0 Fix types 2024-12-30 07:29:31 +02:00
schm1dtmac
3a16b2e92c Report filesizes on macOS as decimal multiples
i.e. multiples of 1000
2024-12-30 07:29:31 +02:00
Elad
a8bfa6a16c SPU: Operating system LR memory signals 2024-12-29 21:01:17 +02:00
kd-11
e135012acd rsx: Properly track changes in instancing state 2024-12-29 20:53:05 +03:00
kd-11
9de6a38e13 rsx: Test vertex program flags on each draw 2024-12-29 20:53:05 +03:00
kd-11
0baf873534 Cosmetic improvements 2024-12-29 20:53:05 +03:00
kd-11
35a66fe776 rsx: Do not use global registers object in logical "firmware" units 2024-12-29 20:53:05 +03:00
kd-11
0be8a5f9f4 rsx: Handle dangling execution barriers 2024-12-29 20:53:05 +03:00
kd-11
01fe39fbb9 rsx: Fix rare crash in vertex program decompiler
- This whole decompiler mess needs a rewrite
2024-12-29 20:53:05 +03:00
kd-11
cfc124fabf rsx: Fix instancing bug when indexed addressing is used to read constants 2024-12-29 20:53:05 +03:00
kd-11
15961b353a vk: Add support for hardware instanced draws 2024-12-29 20:53:05 +03:00
kd-11
d4573e233a rsx: Fix vertex program compiler crash 2024-12-29 20:53:05 +03:00
kd-11
9307abe7f5 rsx: Move more functions from rsx thread to the draw command processor 2024-12-29 20:53:05 +03:00
kd-11
05bab8ec4c rsx: Move draw call related functions to their own class 2024-12-29 20:53:05 +03:00
kd-11
9e9ae54455 rsx: Add GLSL support for instanced rendering 2024-12-29 20:53:05 +03:00
kd-11
e696d9b324 rsx: Add code to detect instanced draw commands 2024-12-29 20:53:05 +03:00
kd-11
43e04f3fc7 Revert "rsx/vk: Implement hardware instancing (#16466)"
This reverts commit 62701154f1.
2024-12-29 20:53:05 +03:00
kd-11
62701154f1
rsx/vk: Implement hardware instancing (#16466)
* rsx: Add code to detect instanced draw commands

* rsx: Add GLSL support for instanced rendering

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

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

* rsx: Fix vertex program compiler crash

* vk: Add support for hardware instanced draws

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

* rsx: Fix rare crash in vertex program decompiler

- This whole decompiler mess needs a rewrite

* rsx: Handle dangling execution barriers

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

* Cosmetic improvements

* rsx: Test vertex program flags on each draw

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

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

---------

Co-authored-by: Elad <18193363+elad335@users.noreply.github.com>
2024-12-29 14:53:04 +02:00
Elad
439d665096
CELL: Fix reservation notifications 2024-12-29 11:06:44 +02:00
Megamouse
418a99a62b VS: add some missing files to solution filters 2024-12-28 23:09:51 +01:00
Megamouse
1eac13b6bf Windows: log command line args in utf8 2024-12-28 23:09:51 +01:00
Darkhost1999
e58bd419f6
Add empty hdd tmp to UI (#16462)
This option is need for those using sprx mods and amongst other homebrew reasons such as apollo savedata.
2024-12-28 22:20:22 +01:00
Megamouse
5e176a390f MacOS: silence some warnings 2024-12-28 19:58:59 +01:00
Megamouse
a49cfc5a91 Simplify some ternaries 2024-12-28 19:58:59 +01:00
Megamouse
d3fedffa6a VS: Add sysinfo_darwin.mm to filters 2024-12-28 19:58:59 +01:00
Megamouse
33c3e3fb0f fix some warning 2024-12-28 18:10:06 +01:00
Megamouse
1d23be8429 Qt: Add Operating system category 2024-12-28 18:10:06 +01:00
Elad
7a4e88c146 Savestates: Fix main_ppu_module definition 2024-12-27 22:08:28 +02:00
Elad
cfeb022340 shared_ptr.hpp: Rewrite shared_ptr to single_ptr conversion
Logic felt non-intuitive and this method should be very explicit.
2024-12-27 22:08:28 +02:00
Elad
0cc655074d serialzation.hpp: Fix add_padding 2024-12-27 22:08:28 +02:00
Elad
a5ba96e991 Fixup lv2_socket 2024-12-27 22:08:28 +02:00
kd-11
b2949f114b vk: Wrap device fault handler in SEH2 2024-12-25 01:41:23 +03:00
kd-11
e3df7bccac vk: Selectively enable extended device fault features in logical device creation step 2024-12-25 01:41:23 +03:00
kd-11
2c45438422 vk: Minor improvements to extended fault output 2024-12-25 01:41:23 +03:00
kd-11
4ef1d48c0c vk: Properly initialize device fault counts structure 2024-12-25 01:41:23 +03:00
kd-11
7b6a672c64 vk: Fix device fault extension loading 2024-12-25 01:41:23 +03:00
kd-11
883529eaf3 vk: Add support for spec-compliant query scopes 2024-12-25 01:41:23 +03:00
kd-11
afc10ea112 vk: Workaround for older SDK header versions 2024-12-25 01:41:23 +03:00
kd-11
488e5d9eb5 vk: Register honeykrisp as known driver in RTT quirks check 2024-12-25 01:41:23 +03:00
kd-11
6d976b5d90 vk: Fix build 2024-12-25 01:41:23 +03:00
kd-11
b44e2d3b30 vk: Add basic support for honeykrisp driver 2024-12-25 01:41:23 +03:00
kd-11
a196bbcbcd vk: Remove unnecessary workaround for older SDK versions 2024-12-25 01:41:23 +03:00
kd-11
6000e3a47d vk: Add support for extended device fault information 2024-12-25 01:41:23 +03:00
Elad
623f5822b3 Fix Emulator::Pause() segfault 2024-12-24 21:31:57 +02:00
Elad
c6dadc537b Add some FXO init checks 2024-12-24 21:31:57 +02:00
Elad
98a0c76a08 StrFmt.cpp: Make function printing shorter 2024-12-24 21:31:57 +02:00
Elad
a2d5b5a0e2 Fixup GDB 2024-12-24 21:31:57 +02:00
Elad
d376ba5994 Remove lv2_socket_native destructor 2024-12-24 21:31:57 +02:00
Elad
6a4b9430c0 Thread.h: Add a few noexcept 2024-12-24 21:31:57 +02:00
Elad
3bf735161f sys_config: Move cleanup to IDM abort 2024-12-24 21:31:57 +02:00
Elad
4d0c835df3 util/shared_ptr.hpp: STX pointers library fixes 2024-12-24 21:31:57 +02:00
Elad
6eb4138595 Fixup sys_process 2024-12-24 21:31:57 +02:00
Megamouse
53817dcc90 Fix fs::file log formatting 2024-12-23 11:29:13 +01:00
Megamouse
99044ce6c6 Qt: allow to skip further automatic update notifications for a single version 2024-12-23 01:56:39 +01:00
Elad
575a245f8d
IDM: Implement lock-free smart pointers (#16403)
Replaces `std::shared_pointer` with `stx::atomic_ptr` and `stx::shared_ptr`.

Notes to programmers:

* This pr kills the use of `dynamic_cast`, `std::dynamic_pointer_cast` and `std::weak_ptr` on IDM objects, possible replacement is to save the object ID on the base object, then use idm::check/get_unlocked to the destination type via the saved ID which may be null. Null pointer check is how you can tell type mismatch (as dynamic cast) or object destruction (as weak_ptr locking).
* Double-inheritance on IDM objects should be used with care, `stx::shared_ptr` does not support constant-evaluated pointer offsetting to parent/child type.
* `idm::check/get_unlocked` can now be used anywhere.

Misc fixes:
* Fixes some segfaults with RPCN with interaction with IDM.
* Fix deadlocks in access violation handler due locking recursion.
* Fixes race condition in process exit-spawn on memory containers read.
* Fix bug that theoretically can prevent RPCS3 from booting - fix `id_manager::typeinfo` comparison to compare members instead of `memcmp` which can fail spuriously on padding bytes.
* Ensure all IDM inherited types of base, either has `id_base` or `id_type` defined locally, this allows to make getters such as `idm::get_unlocked<lv2_socket, lv2_socket_raw>()` which were broken before. (requires save-states invalidation)
* Removes broken operator[] overload of `stx::shared_ptr` and `stx::single_ptr` for non-array types.
2024-12-22 20:59:48 +02:00
Whatcookie
385710672f
SPU LLVM: Recognize ROTYQBYI and ROTQBI rotation pattern (#16409)
Co-authored-by: Elad <18193363+elad335@users.noreply.github.com>
2024-12-22 10:29:15 +02:00
Megamouse
beb3565001 ps move tracker: draw sphere size range into live image 2024-12-21 14:36:24 +01:00
Megamouse
ec7f50d925 ps move tracker: set max of radii to 50%
It makes no sense to have a larger radius than half of the image size
2024-12-21 14:36:24 +01:00
Megamouse
1a479e9bda ps move tracker: fix min and max radius labels 2024-12-21 14:36:24 +01:00
Megamouse
19cc363b09 ps move tracker: fix some data types 2024-12-21 14:36:24 +01:00
kd-11
760b49bc6c Cleanup 2024-12-21 15:24:15 +03:00
kd-11
70eca8cb24 vk: Fix border color swizzling behavior 2024-12-21 15:24:15 +03:00
Megamouse
ff0249d662 ps move: ignore second half frame in ZCM1
These values have high noise on my model and make it unusable.
2024-12-21 03:24:32 +01:00
Megamouse
d450a5ee95 cellGem: add magnetometer support 2024-12-21 03:24:32 +01:00
Megamouse
1cf927aef9 cellGem: request orientation reset during calibration 2024-12-21 00:48:52 +01:00
Megamouse
8678402c25 cellGem: fix some data types 2024-12-20 17:30:25 +01:00
Megamouse
ee2ea0cb02 cellGem: invalidate hue and tracking in cellGemInvalidateCalibration
This fixes the cursor color in OVERKILL
2024-12-20 17:30:25 +01:00
Megamouse
cf0b4d4ed4 cellGem: split status_flags into calibration flags and runtime flags 2024-12-20 17:30:25 +01:00
Megamouse
cc50049bca cellGem: implement cellGemSetRumble 2024-12-20 17:30:25 +01:00
Megamouse
c6a76eb9af cellGem: add setting to let the game actually set the device hues
This is not very useful at the moment since the tracker can't really
handle random hues yet.
2024-12-20 17:30:25 +01:00
Megamouse
67e8e373a7 cellGem: set sphere RGB when a hue is set and vice versa 2024-12-20 17:30:25 +01:00
Megamouse
304964ba71 cellGem: add debug setting for painting spheres into the live image 2024-12-20 17:30:25 +01:00
Megamouse
d2c58765cd cellGem: fix some data types 2024-12-20 17:30:25 +01:00
Megamouse
385d21e6dc Fix some warnings 2024-12-20 17:30:25 +01:00
Megamouse
0fd6956bb0 cellPhotoDecode: allow dev_bdvd paths 2024-12-19 18:01:10 +01:00
Megamouse
5073477415 cellGem: Split horizontal and vertical mouse rotation cone setting 2024-12-19 16:55:39 +01:00
Megamouse
c56147e04b Qt: fix settings_dialog opening on wrong tab
The dialog now uses open instead of exec, so we have to override open.
2024-12-19 13:49:43 +01:00
Megamouse
79fc366f23 Qt: fix flow_layout segfault 2024-12-19 13:49:43 +01:00
capriots
9d4ff13c2b
cellAdec implementation part 2: LPCM decoder (#16381)
* cellAdec: savestate fixup

* simd.hpp: add some intrinsics

* cellAdec implementation part 2: LPCM decoder

* cellAdec: set to HLE by default

* cellAdec: review fixes

---------

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

* "show at startup" checkbox always changeable
2024-12-07 20:56:05 +02:00
Antonino Di Guardo
24655fd975
fix dark theme switching on initial welcome dialog (#16373) 2024-12-06 20:14:35 +01:00
Darkhost1999
05d12f68ad Test
Works on my machine
2024-12-05 12:55:23 +02:00
Elad
d84fe592c8 PRX: Do not check exported function code address 2024-12-03 19:01:17 +02:00
Elad
b4505600c7 PPU: Notify SPUs while waiting for its own state 2024-11-30 18:06:34 +02:00
Elad
a4ea71d18f CELL: Rewrite reservation notification postponing 2024-11-30 18:06:34 +02:00
Megamouse
729826ec40 cellGem: fix HUE_NOT_SET 2024-11-29 05:39:11 +01:00
Megamouse
a8b0c0be07 cellGem: calculate distance from sphere to camera 2024-11-29 05:39:11 +01:00
Elad
926de68a79 Debugger: Dump related thread information on crash 2024-11-28 13:32:52 +02:00
Elad
cf850598eb System.cpp: Do not hold on fs::dir handle 2024-11-28 05:47:40 +02:00
Elad
2b9f076024 fs: Minor fix of fs::dir::open
Did not close previous handle on fs::dir::open like on fs::file
2024-11-28 05:47:40 +02:00
Elad
d63e643081 Emu: Fixup 2024-11-28 05:47:40 +02:00
Elad
9a2bcd2508 System.cpp: Fix Kill() on bad app startup 2024-11-27 16:00:40 +02:00
Elad
f3b9d64df7 Add some asserts for g_fxo->init<> 2024-11-27 16:00:40 +02:00
Elad
68c58281e5 System.cpp: Add system_state::loading 2024-11-27 16:00:40 +02:00
Elad
07df91d4e8 Fix Emulation boot recursion 2024-11-27 16:00:40 +02:00
Elad
378a69ea85 Qt: Deprecate processEvents() part 2 2024-11-27 16:00:40 +02:00
Elad
191e132c6c util/types.hpp: Rewrite narrow<> 2024-11-27 16:00:40 +02:00
Elad
fce07bbeab Qt: Deprecate proccessEvents() usage 2024-11-26 03:33:24 +02:00
kd-11
3e427c57f0 rsx: Use strict bounds testing when replacing memory via blit engine 2024-11-25 22:21:07 +03:00
kd-11
9afebfdd72 rsx/texture-cache: Rework invalidation cause object to have more granular controls 2024-11-25 22:21:07 +03:00
kd-11
109b841d8d rsx/util: Change the filter function to an in-place erase-if operation 2024-11-25 22:21:07 +03:00
Darkhost1999
b94ddb0cd3
Migrate Savestates Home Menu (#16340) 2024-11-23 21:29:07 +02:00
Elad
b073d08a52 LLVM: Implement Recursive Intrinsics 2024-11-23 20:22:58 +02:00
capriots
fcf0b74c79
VS: add quotes around paths
Fixes use with paths that contain spaces.
2024-11-23 18:10:29 +02:00
capriots
e7fd4224ad cellDmuxPamf: add module + stubs 2024-11-23 17:01:25 +02:00
capriots
8778e69f9d cellAdec: make AdecContext and AdecFrame trivial classes 2024-11-23 17:01:25 +02:00
capriots
108247dccc Invalidate savestates 2024-11-23 17:01:25 +02:00
capriots
9b3b9562c0 cellAdec: review + warning fixes 2024-11-23 17:01:25 +02:00
capriots
e7f1a34fe1 cellAdec implementation part 1: abstraction layer 2024-11-23 17:01:25 +02:00
capriots
0a29ca2946 Fix HLE PPU callback stack arguments 2024-11-23 17:01:25 +02:00
RipleyTom
0e8f1a9bf9 sys_net: Remove lingering ppu_to_awake from queue on timeout 2024-11-22 18:44:01 +02:00
Megamouse
a9f6b012b8 Qt 6.8.0 2024-11-22 15:48:16 +01:00
Megamouse
4ba4bddb09 Fix some warnings 2024-11-22 15:48:16 +01:00
Megamouse
3b51368be2 Qt: Use inplace image mirroring in video sink 2024-11-22 15:48:16 +01:00
FlexBy420
0111fd0d0e
Make error message for temporary and archive translatable (#16331) 2024-11-20 16:54:31 +02:00
Elad
cc86e01df9 lockless.h: Fox 2024-11-18 18:45:34 +02:00
Elad
1dfee5fbfa lockless.h: Fixup addressing 2024-11-18 18:45:34 +02:00
Elad
21f65f087d lockless.h: Fixup lf_array assert 2024-11-18 18:45:34 +02:00
Elad
ac849b958f Progress: Dialog: Fixup memory management 2024-11-18 18:45:34 +02:00
Megamouse
806a1202c5 VS: ignore opencv debug build guard (fix debug build) 2024-11-16 23:31:54 +01:00
Megamouse
2ee1770383 ci: Don't fetch opencv submodule unless on windows 2024-11-16 17:36:56 +01:00
digant
21da04364d gitignore cleanup
These files and folders are all deprecated
2024-11-16 17:36:56 +01:00
digant73
a66ba27791 added missing -p option 2024-11-16 17:36:56 +01:00
digant73
3fa3298a31 fixed CI for building on windows 2024-11-16 17:36:56 +01:00
digant
eccb3f6d0b Improve and fix sln solution 2024-11-16 17:36:56 +01:00
Megamouse
29901d65ed More constexpr 2024-11-16 15:10:20 +01:00
Megamouse
0bb83ed5e9 Fix warning 2024-11-16 15:10:20 +01:00
Megamouse
2d14742a05 Add opencv to cmake 2024-11-16 15:10:20 +01:00
Megamouse
6eaaadec71 Move opencv submodule to subdirectoty 2024-11-16 15:10:20 +01:00
Megamouse
b89f7515fd Qt: show warning if ps move tracking is not supported 2024-11-16 15:10:20 +01:00
Elad
05096854bc Update vm_native.cpp 2024-11-16 13:53:25 +02:00
Elad
68d74bc28a Progress Dialog: Fix recursion and concurrency use of text updates 2024-11-16 12:22:23 +02:00
Elad
1475625705 Implement lf_array::for_each 2024-11-16 12:22:23 +02:00
Elad
935e83a490 Utilities\lockless.h: Flatten recusrion in lf_array
Add assert for sane index access.
2024-11-16 12:22:23 +02:00
Megamouse
4df58494a0 Fix compilation 2024-11-16 09:45:31 +01:00
Megamouse
f16dfd8ca2 Add HAVE_OPENCV preprocessor flag 2024-11-16 09:45:31 +01:00
Megamouse
72dc5b3489 Windows: Add and deploy opencv files 2024-11-16 09:45:31 +01:00
Megamouse
b89cc9b973 cellGem: implement real ps move handler 2024-11-16 09:45:31 +01:00
Elad
e7faec6b0e
util/vm_native.cpp: Fix memory leak 2024-11-15 14:00:30 +02:00
Megamouse
7866dc2e34 overlays: localize RPCS3 progress dialog 2024-11-15 09:48:12 +01:00
Megamouse
070add461f overlays: get localized values in home menu settings 2024-11-15 09:48:12 +01:00
Megamouse
1211acd59c Qt: Add std::string GetSettingOptions
This has the potential for some minor optimizations
2024-11-15 09:48:12 +01:00
Megamouse
d78c39b3ab overlays: add more overlay hint option to home menu settings 2024-11-14 23:23:36 +01:00
Megamouse
81bb4b5951 overlays: remove unnecessary text logging 2024-11-14 23:23:36 +01:00
Megamouse
9461294ffc overlays: add input debug overlay to home menu settings 2024-11-14 23:23:36 +01:00
Megamouse
7087582a36 overlays: translate home menu settings
Also fix potential lambda text capture issue
2024-11-14 23:23:36 +01:00
overwriter
201be08a85 fix: cannot copy OpenAl32.dll with CMake 2024-11-14 21:44:59 +01:00
Megamouse
c3729d06d0 Qt: Replace some instances of QMap, QPair and QList 2024-11-14 20:50:33 +01:00
Megamouse
e8f730e61f Update curl to 8.11.0 2024-11-14 20:50:33 +01:00
Elad
c5bbee7a0a SPU: Fixup code comparison 2024-11-14 13:43:01 +02:00
Elad
8c00842614 Fixup std::vector to std::span 2024-11-14 13:43:01 +02:00
Elad
72437b50b4 LV2: Fix thread notifications regression 2024-11-12 15:00:35 +02:00
Elad
e9b24eba85
SPU Analyzer: Fix programs code caching 2024-11-12 11:11:37 +02:00
oltolm
2b0f786b2d
Fix std::basic_string warnings (#16261) 2024-11-11 21:54:44 +02:00
Megamouse
2262ac1684 Qt: Replace QMap with std::map
This should reduce the amount of string conversions during list refreshes
2024-11-06 09:34:32 +01:00
RipleyTom
c68f42e0ee Fix sceNpScoreGetRankingByNpId when no score is registered 2024-11-05 20:48:05 +01:00
Joshua de Reeper
73cee9a43d sys_usbd: Better Dimensions Move Handling 2024-11-05 18:17:05 +01:00
NicknineTheEagle
6d766ccbb5
cellSaveData: Add autosave indicator (#15720) 2024-11-04 21:53:34 +01:00
Elad
bcf581dc82 Fixup Emulator::GetBackgroundPicturePath() 2024-11-04 14:59:21 +02:00
Elad
c782b45b97 High-Resolution Game Background for loading 2024-11-04 10:59:45 +02:00
Megamouse
7858053bb9 Update SDL to 2.30.9 2024-11-04 08:31:03 +01:00
Megamouse
2d0d4119f4 Update FAudio to 24.11 2024-11-04 08:31:03 +01:00
Megamouse
d2d76bb560 Update wolfssl to 5.7.4 2024-11-03 17:05:11 +01:00
Elad Ashkenazi
bc22df8ba8 SPU: Optimize cellSpurs reservations 2024-11-03 11:13:54 +02:00
Elad
b053b1e200 Another attempt to fix fs::pending_file for hardlinks 2024-11-02 21:43:35 +02:00
Elad
d3c0ec5651 Print last system error on fs::error::unknown 2024-11-02 21:43:35 +02:00
Elad
695799c39a GUI: Fix welcome_dialog dereference 2024-11-02 21:43:35 +02:00
Elad
85d1649696 utils/atomic.hpp: Make atomic_op reject non-non-const lvalue 2024-11-02 21:43:35 +02:00
Elad
1417f9b7de utils/atomic.cpp: Fixup utils::get_unique_tsc()
It was reading s_min_tsc again inside the atomic operation.
Also optimize it a bit.
2024-11-02 21:43:35 +02:00
Elad
0e31aafc09 Fixup GCM unmap event sending 2024-11-02 21:43:35 +02:00
Ani
17e78a9e6f rpcs3_version: Bump to 0.0.34 2024-11-01 23:22:32 +00:00
oltolm
42751cc8fb SPULLVMRecompiler: remove unnecessary bitcast 2024-11-01 16:31:14 +02:00
Elad
e67d090c35 Fixup sys_event_port_send 2024-11-01 10:43:46 +02:00
Elad
ddd0494cf4 Silence sys_ss_access_control_engine 2024-11-01 10:43:46 +02:00
Elad
2222807624 RSX/GCM: Fix memory unmapping for HLE GCM 2024-11-01 10:43:46 +02:00
Elad
488814bb2d rsx/vm: Exclude events from VM mutex
Fixes a deadlock from a recent pull request, perhaps also some deadlocks with locking both IDM and VM mutex.
2024-11-01 07:37:57 +02:00
Elad
4206b022b6 Win32/File.cpp: Use ReplaceFile for hardlink overwrite 2024-11-01 07:37:57 +02:00
Elad
b87c891ec4 Fixup sys_event to check EBUSY only for PPU->PPU signals 2024-11-01 07:37:57 +02:00
Hasster
5eb4691cd6 Specify that you only need the qtmultimedia when using aqt 2024-10-31 03:45:12 +02:00
Hasster
bfcbc13b8a Add more info about Qt in BUILDING.md
Specify that Qt needs a "qtmultimedia" module and provide a link to an alternative download
2024-10-31 03:45:12 +02:00
Elad
5c5edb4785 sys_event: Implement EBUSY for disconnection 2024-10-30 21:15:16 +02:00
Elad
edfe940543 utils/sysinfo.cpp: Yield CPU time when measuring TSC freq 2024-10-30 10:06:49 +02:00
elad335
8b8396b945 Filesystem/Win32: Recreate hardlinks on fs::pending_file 2024-10-29 19:26:33 +02:00
elad335
97f2b6b701 Fix get_system_time() 2024-10-29 19:26:33 +02:00
elad335
92bf6ed0a7 Replace rsx::uclock with get_system_time() 2024-10-29 19:26:33 +02:00
elad335
29c1c3df1f sys_event_flag_set: Minor improvement 2024-10-29 19:26:33 +02:00
oltolm
cd8954db14 fix deprecation warnings in Qt 6.8 2024-10-28 23:42:02 +01:00
Megamouse
431221f172 Don't log "always" messages in fatal_error_listener until enabled
Opening the console breaks Qt cli popups
2024-10-25 20:10:46 +02:00
elad335
3ecb14dcda sys_event_flag_set: Break atomic operation dependencies 2024-10-25 15:53:53 +03:00
elad335
a325eb52bd Compilation hotfix 2024-10-25 13:21:49 +03:00
elad335
84217917d5 utils/sysinfo.cpp: New TSC calibration technique 2024-10-25 10:00:21 +03:00
elad335
af052b0627 RawSpu: Optimize START register/commands
START MFC proxy commands can be common even after their need, optimize their usage.
2024-10-24 21:03:06 +03:00
elad335
c70c08bb07 utils: Make get_tsc_freq() inlined and non-blocking 2024-10-24 21:03:06 +03:00
elad335
2e8029a45b get_system_time(): Add fast TSC-based path 2024-10-24 21:03:06 +03:00
elad335
a9a454faf7 asm: Fix utils::rational_mul optimization 2024-10-24 21:03:06 +03:00
Elad
3378b03c1f Optimize get_system_time using 128 bit math 2024-10-24 21:03:06 +03:00
elad335
8d9911e383 Implement u64_x_u64_=_u128 optimization 2024-10-24 21:03:06 +03:00
kd-11
60ae4c1121 rsx: Fix crash when host labels option is disabled 2024-10-23 19:28:32 +02:00
kd-11
5ed7d043c4 Fix build and cleanup 2024-10-23 16:33:44 +03:00
kd-11
c28ec457fd gl: Silence compiler warnings 2024-10-23 16:33:44 +03:00
kd-11
a79ef1efb2 gl: Fix check_state compilation error 2024-10-23 16:33:44 +03:00
kd-11
1299aa68b3 cmake: Update build files for GL DMA 2024-10-23 16:33:44 +03:00
kd-11
681debd8f6 gl: Finalize host labels implementation 2024-10-23 16:33:44 +03:00
kd-11
0db06964dc Whitespace 2024-10-23 16:33:44 +03:00
kd-11
6ce1816e3f rsx: Move the host job management into common code to share with GL 2024-10-23 16:33:44 +03:00
kd-11
7fdfbe3c52 gl: Implement basic DMA layer using AMD_pinned_memory 2024-10-23 16:33:44 +03:00
Elad Ashkenazi
3e516df214 SPU: Reimplement SPURS limiter 2024-10-17 13:59:56 +03:00
Zion Nimchuk
899b4aaeec Use system SDL by default since we don't properly support building with just builtin SDL 2024-10-17 09:01:46 +02:00
Zion Nimchuk
d2612bed3a Switch to focal for aarch64, update Qt 2024-10-17 09:01:46 +02:00
Zion Nimchuk
42b255a4a2 Fix checkrt bundling and remove legacy deploy script 2024-10-17 09:01:46 +02:00
Antonino Di Guardo
18c01f7151
Fixed compilation with cmake on Windows (#16184)
* Fixed compilation with cmake on Windows
* cleanup on post build actions for Windows on cmake solution + minor cleanup
* fix link error on IntelJITEvents
2024-10-15 17:53:31 +02:00
shinra-electric
4cd1d639ed
3rd Party: Bump MoltenVK to 1.2.11 (Vulkan SDK 1.3.296) (#16190) 2024-10-15 16:40:45 +02:00
Megamouse
2732d6c3dc Qt: Make sure that table columns and their actions have the same state after restoring the layout 2024-10-15 12:59:37 +02:00
nastys
8e4f5cc7b3 Update build-mac.sh 2024-10-15 10:28:00 +02:00
Elad Ashkenazi
e58a3ab7e0 sys_spu: Fix order of some checks 2024-10-15 10:42:22 +03:00
Elad Ashkenazi
e0e1c729cd Fix sys_spu_thread_group_disconnect_event 2024-10-15 10:42:22 +03:00
Elad Ashkenazi
7c6b558647 Improve sys_spu_thread_initialize 2024-10-15 09:36:36 +03:00
Elad Ashkenazi
217c924d42 Fix sys_vm_memory_map 2024-10-15 09:36:36 +03:00
Megamouse
7b92cbcb9a input: use std::array for sticks, sensors and motors
We always have the same amount of those.
So using a vector has always been a bit confusing.
2024-10-15 01:50:22 +02:00
Megamouse
c882f0baf0 input: fix segfault caused by lockless std::move of stick vector
The copy assignment seems to fix this
2024-10-15 01:50:22 +02:00
nastys
f1f124dcbf
macOS arm64 CI: Fix packages requiring curl, and fix Ventura (#16193) 2024-10-15 00:01:13 +02:00
Megamouse
d4ce5b86ec Improve log file creation error message
Early out in file_writer ctor instead of large if else
2024-10-14 21:29:51 +02:00
Megamouse
16c1b9ed73 Fix some narrowing warnings 2024-10-14 21:29:51 +02:00
Elad Ashkenazi
42ee2463c7 Initialize some spu_thread members 2024-10-14 20:15:14 +03:00
Elad Ashkenazi
2fc9ae5d28 sys_vm: Argument checking fixes 2024-10-14 20:15:14 +03:00
Elad Ashkenazi
28dc7356a8 sys_memory: Fix argument size type 2024-10-14 20:15:14 +03:00
Elad Ashkenazi
f6c585902a sys_spu: Fix SPU queue index type 2024-10-14 20:15:14 +03:00
Elad Ashkenazi
693cf9950f sys_spu: Minor fixes 2024-10-14 20:15:14 +03:00
Elad Ashkenazi
cef3ee2d80 SPU: More SPURS limiter fixes 2024-10-14 06:30:05 +03:00
Elad Ashkenazi
8fac136056 SPU: SPURS pause based average task order duration 2024-10-11 17:41:34 +03:00
Elad Ashkenazi
fa707047e6 SPU: Remove illegal SPURS setting value 2024-10-11 07:28:28 +03:00
Elad
c009215983 SPU: Fix "Max SPURS Threads" performance 2024-10-11 07:28:28 +03:00
Elad Ashkenazi
d51d5ce86d SPURS limiter tweaks 2024-10-07 15:02:23 +03:00
RipleyTom
36da83592a Improve AMD cpu detection 2024-10-07 05:36:19 +02:00
Megamouse
0a57c459b6 overlays: add friends list to home menu 2024-10-06 09:57:20 +02:00
Megamouse
73fe420d09 RPCN: add overlay messages on friend requests 2024-10-06 06:35:48 +02:00
Megamouse
a85cdb5947 Update FAudio to 24.10 2024-10-05 22:50:30 +02:00
Megamouse
511f8a91f1 Update SDL to 2.30.8 2024-10-05 22:50:30 +02:00
Megamouse
2d1da95bc1 VS: Fix zstd debug lib 2024-10-05 22:50:30 +02:00
Malcolm Jestadt
967adaf9db SPU LLVM: Compute frest exponent at runtime rather than using the lookup table
- Provides a small speedup and smaller codesize
2024-10-05 20:44:23 +03:00
Malcolm Jestadt
8ca60df1ab SPU LLVM: Add optimized path for spu_re_acc special cases
- Uses vfixupimmps (AVX-512), 5 instructions down to 1
2024-10-05 20:44:23 +03:00
RipleyTom
4832267307 Fixes audio buffering on non-windows platforms 2024-10-05 11:44:15 +03:00
Megamouse
6bb01066fb VS: Add new build scripts to filters 2024-10-03 15:35:20 +02:00
Megamouse
522124d695 Remove unused SPIRV submodules 2024-10-03 15:35:20 +02:00
Megamouse
d9c4e14c40 VS: fix debug builds 2024-10-03 15:35:20 +02:00
Megamouse
00944a5d71 VS: Add buildfiles to filter 2024-10-03 15:35:20 +02:00
kd-11
e9bc99253d rsx: Verify that channel remap is initialized before applying swizzles 2024-10-03 15:02:09 +03:00
kd-11
e9a45a6d06 rsx: Clarify OGL and VK difference when handling border texels 2024-10-03 15:02:09 +03:00
kd-11
497b9ba55b rsx: Make use of remapped border colors 2024-10-03 15:02:09 +03:00
kd-11
d1d04b1b32 rsx: Implement texture border color decode to remapped rgba 2024-10-03 15:02:09 +03:00
kd-11
826f805902 rsx: Use a proper struct to wrap around channel remap operations 2024-10-03 15:02:09 +03:00
kd-11
b1b0ac4433 rsx/vs: Restructure filters into functional units 2024-10-03 15:02:09 +03:00
kd-11
3f28f88a35 vk: Add support for explicit border colors 2024-10-03 15:02:09 +03:00
Zion
938306a7bc Bump linux x64 docker to 1.7.1, Qt 6.7.3 2024-10-02 07:09:02 +02:00
kd-11
1568366d9c Do not link intel JIT events when compiling LLVM for ARM64 2024-10-01 19:20:26 +03:00
kd-11
79614562b9 Move x64 appimage builder to its own legacy script 2024-10-01 19:20:26 +03:00
Megamouse
96e495c61d Qt/Overlays: Add home menu shortcut to game window 2024-10-01 03:25:36 +02:00
kd-11
e4dd957bbc linux/aarch64: Fix CI release upload 2024-10-01 03:03:14 +03:00
kd-11
aace685202 Typo fix 2024-10-01 01:14:40 +03:00
kd-11
fa6f999754 linux: Fix steam deck issues 2024-10-01 01:14:40 +03:00
kd-11
f18649567f Include compositor module in appimage for shell integrations 2024-09-30 18:33:54 +03:00
kd-11
ae580c7749 Enable artifact upload 2024-09-30 18:33:54 +03:00
kd-11
c711764850 Update building instructions for linux arm64 2024-09-30 18:33:54 +03:00
kd-11
7d5dc101fa Fix shellcheck 2024-09-30 18:33:54 +03:00
kd-11
252e69a6ba Add different suffix per architecture 2024-09-30 18:33:54 +03:00
kd-11
c4be603279 Deploy aarch64 linux appimages 2024-09-30 18:33:54 +03:00
kd-11
90bf35bb1e Fix deploy script 2024-09-30 18:33:54 +03:00
kd-11
47fb653044 Fix aarch64 build script 2024-09-30 18:33:54 +03:00
kd-11
4fe306c9ad aarch64: linux CI 2024-09-30 18:33:54 +03:00
kd-11
03a58d36da Do not attempt to link in intel JIT events 2024-09-30 18:33:54 +03:00
Megamouse
d379dd4c8d overlays: Ignore 14 in anisotropic settings
This value has no CELL equivalent
2024-09-29 19:17:39 +02:00
Megamouse
7fc31e20b3 Fix 120 fps frame limit 2024-09-29 19:17:39 +02:00
schm1dt ‎
d11fe09419 Use native theme on macOS, hide Dark Mode toggle 2024-09-29 13:49:28 +02:00
RipleyTom
c49ff490bc Fix scenp_score_record_score param check 2024-09-29 12:09:11 +03:00
Antonino Di Guardo
3f66297593
Fix crash on VFS Tool (#16146) 2024-09-29 03:11:27 +03:00
schm1dtxbox
37d2317b68 Update shortcut_utils.cpp 2024-09-28 13:14:18 +02:00
schm1dtxbox
a1d55e5a54 Update azure-pipelines.yml 2024-09-28 13:14:18 +02:00
Megamouse
0ba0f11c4a Qt: Try to fix classic stylesheet after Qt 6.7.3 update 2024-09-28 01:39:33 +02:00
Elad
f0c60b42c2
SPURS Task limit hotfix (#16140) 2024-09-27 22:15:06 +03:00
RipleyTom
88adaa9d2d Add some extra param handling for cellNetCtlGetInfo 2024-09-27 19:14:09 +02:00
RipleyTom
56099e79da Fix for clang 19 2024-09-27 19:14:09 +02:00
Megamouse
4ba4268282 Qt/shortcuts: add handler id to log messages 2024-09-27 17:57:49 +02:00
Megamouse
2661b6a71c Qt: Try to improve default stylesheet after Qt 6.7.3 update 2024-09-27 17:57:49 +02:00
Megamouse
e58a89af2d Qt: Enable game window shortcuts 2024-09-27 17:57:49 +02:00
Megamouse
ad3d8675e7 Qt 6.7.3 2024-09-27 15:06:40 +02:00
Megamouse
18d9ca5928 Qt 6.7.2 2024-09-27 15:06:40 +02:00
Megamouse
5ab955d9c4 Qt 6.7.1 2024-09-27 15:06:40 +02:00
Megamouse
2b4a90781a Qt 6.7.0
Also fix new stylesheet issue: windows11 style is now default.
This currently breaks custom stylesheets.
Use windowsvista style as default
2024-09-27 15:06:40 +02:00
Elad
10dece1c80 SPU: Improve SPURS Task limit algorithm 2024-09-27 12:43:44 +03:00
RipleyTom
9dd0b055d0 Fake sceNpMatching2GetLobbyInfoList 2024-09-26 21:12:10 +02:00
Megamouse
9e460ebe0a MacOs/Arm64/Shortcuts: Add more plist entries 2024-09-26 19:48:40 +02:00
Megamouse
7106bfcfb9 Shortcuts: Try to create shortcut link path if it doesn't exist 2024-09-26 19:48:40 +02:00
Megamouse
c936de7c20 VS: add mac and linux hidapi files for improved input debugging 2024-09-26 19:48:40 +02:00
Elad Ashkenazi
60b5adab63 SPU: SPURS limit update 2024-09-26 06:59:20 +03:00
Elad Ashkenazi
e3c8b3d524 GUI: Add SPURS limit to home menu 2024-09-26 06:59:20 +03:00
Elad Ashkenazi
8b79fd3da1 SPU: Make SPURS limit a dynamic setting 2024-09-26 06:59:20 +03:00
Megamouse
feedc183a4 Qt: Tiny improvements to Cam/Mic permissions 2024-09-25 20:09:39 +02:00
Megamouse
c4282e63fb Qt: Simplify some string conversion bloat 2024-09-25 20:09:39 +02:00
kd-11
82f97d33d1 aarch64: Correctly implement the null function trap 2024-09-25 15:48:36 +03:00
schm1dtxbox
c1d43aff05 Brute-force Qt cache invalidation
Needed for qtimageformats changes to kick in
2024-09-25 09:11:28 +02:00
schm1dtxbox
a14c166aab Ditto, but for arm64 ci 2024-09-25 09:11:28 +02:00
schm1dtxbox
7d39ac4e1e Download qtimageformats so that shortcut icons create successfully 2024-09-25 09:11:28 +02:00
schm1dtxbox
f40d8b669c Fix camera permission prompts
Apparently calling qt_finalize_target in the CMake list is needed for permissions-related stuff to work.
2024-09-25 09:11:28 +02:00
Elad Ashkenazi
4b0a5bd1b8 SPU: Fix callback leak 2024-09-24 10:31:37 +03:00
Elad Ashkenazi
6995467ff6 SPU: SPURS limiter algorithm update 2024-09-24 10:31:37 +03:00
Elad Ashkenazi
ad42a2b89a SPU: Task-based SPURS limiter 2024-09-24 10:31:37 +03:00
Megamouse
c4334f5142 Add AArch64 files to VS Project 2024-09-23 23:00:58 +02:00
Megamouse
4c3d243672 MacOs/Arm64: Fix warning 2024-09-23 23:00:58 +02:00
Megamouse
340c17f422 Update curl to 8.10.1 2024-09-23 21:59:01 +02:00
Megamouse
18a99a7d8f input: use static hid singleton for init and exit 2024-09-23 21:59:01 +02:00
Megamouse
31b133b012 Fix yet another warning 2024-09-23 21:59:01 +02:00
nastys
eb9acd9b56
macOS arm64 CI (#16070)
* Merge MacOS jobs
* Code signing
* rpath hack
* Upgrade macOS VM to 13
* Update llvm compiler
* Update to macOS Sonoma
* Update build-mac.sh
* Remove unnecessary version check
* Disable Homebrew cache
* Use macosx_version_min
* Downgrade min version and VM to 13
* Force -D__MAC_OS_X_VERSION_MIN_REQUIRED=130000
* Ignore -Welaborated-enum-base in display_sleep
* Move compiler version to env variable
* Enable auto-updater on macOS ARM64
2024-09-22 20:39:43 +02:00
Ani
02362a4807 spu: Do not apply a Max SPURS Threads limit to libSail
On all the tested games (e.g. Naruto Ultimate Ninja Storm, Catherine),
limiting SPURS threads for "_libsailCellSpursKernelGroup" causes video
playback to hang and the game to permanently freeze. These games still
function properly while limiting the other CellSpursKernelGroup groups,
as I've confirmed through manual thread pausing.

I have not found a single example that shows that 
_libsailCellSpursKernelGroup threads can be limited without the game 
freezing.

This allows the Max SPURS Threads setting to work with more games, or to 
work with a lower thread limit count for games where it already works.
2024-09-21 15:02:41 +02:00
Elad Ashkenazi
466a93dca5 Debugger: Fix thread-selection and refactoring 2024-09-20 23:52:37 +03:00
Megamouse
c89e30b3d9 cellMsgDialog: only abort dialogs that were actually spawned by cellMsgDialog 2024-09-20 20:43:57 +02:00
Megamouse
d88b7f6fde cellSaveData: improve logging for overlays 2024-09-20 20:43:57 +02:00
Megamouse
d0a13c1a5a Improve logging during RPCS3 updates 2024-09-20 15:53:00 +02:00
Antonino Di Guardo
df9275819e
Added reconciliation functions for game list file (games.yml) (#16061) 2024-09-20 08:46:51 +02:00
nastys
5b5bfaf696
Updater API V3 (macOS only) (#16086) 2024-09-19 21:58:00 +02:00
RipleyTom
3d9c8a670e Implement old matching API 2024-09-19 20:34:56 +02:00
Elad Ashkenazi
cf65571be7 SPU Analyzer Hotfix 2024-09-19 10:00:18 +03:00
capriots
66eae05e75 cellAtracXdec: fix FFmpeg warning 2024-09-18 07:57:10 +02:00
Antonino Di Guardo
d1648dd707
[TESTERS NEEDED] Improved contextual menu (#16038) 2024-09-14 21:51:42 +02:00
capriots
7f2534819e cellAtracXdec: review fixes 2024-09-14 19:37:21 +02:00
capriots
e678931cee cellAtracXdec: review fixes 2024-09-14 19:37:21 +02:00
capriots
965dbf2c12 cellAtracXdec: review fixes 2024-09-14 19:37:21 +02:00
capriots
624f34ae13 cellAtracXdec: review fixes 2024-09-14 19:37:21 +02:00
capriots
d60eced317 cellAtracXdec: set to HLE by default 2024-09-14 19:37:21 +02:00
capriots
c813c5e953 cellAtracXdec implementation 2024-09-14 19:37:21 +02:00
capriots
5ce9c5b09f cellAdec: add internal datatypes 2024-09-14 19:37:21 +02:00
Megamouse
7df33bc8c0 Update curl to 8.10.0 2024-09-14 18:12:02 +02:00
Megamouse
0abaac90a8 Update libpng to 1.6.44 2024-09-14 18:12:02 +02:00
Megamouse
e5a526e4d6 input: enable squircle settings in keyboard pad handler
Clamp squircled values to radius 1.
Also set kb and evdev default to 8000 as the others
2024-09-14 17:20:07 +02:00
Elad Ashkenazi
8131f40269 SPU Analyzer: Fix dereferencing freed reference 2024-09-13 19:32:15 +03:00
Elad Ashkenazi
743f9a9f51 rsx: Add 120fps and monitor refresh-rate frame limits 2024-09-12 13:49:03 +03:00
Megamouse
0a54e34a9b Update FFMPEG to properly rebased branch
The prior FFMPEG merge was not properly rebased to Vita3K master.
I created a backup branch arm64_old on the current commit.
I reset master to vita3k master and cherry picked our 5 commits.
Then I squashed the last 2 commits because one of them was obsolete.
2024-09-08 21:01:43 +02:00
Megamouse
53c84577c0 Set cellSysutilAvcExtInitOptionParam to notice 2024-09-08 20:04:30 +02:00
Megamouse
00e5d54be7 cellSysutilAvc: fix cellSysutilAvcEnumPlayers error check 2024-09-08 20:04:30 +02:00
Megamouse
d13acdb484 Fix some warning 2024-09-08 20:04:30 +02:00
kd-11
92c1a8c45d sysinfo/arm64: Improve code around registry access and document the fields 2024-09-08 17:41:29 +03:00
kd-11
939479f55e ci: Fix clang linux failure 2024-09-08 17:41:29 +03:00
kd-11
d19d0cb70d windows/arm64: Implement fallback OS version detection 2024-09-08 17:41:29 +03:00
kd-11
31ce32709e build: Disble fixed base for windows-on-arm 2024-09-08 17:41:29 +03:00
kd-11
4f27af9949 Fix compilation warning 2024-09-08 17:41:29 +03:00
kd-11
b31280e387 Fix GCC compilation for windows 2024-09-08 17:41:29 +03:00
Elad Ashkenazi
03980304cf SPU Analyser: Fix source termination of starting block 2024-09-08 06:51:57 +03:00
Ani
c852ae1a22 ffmpeg: Update submodule, supports linux arm64
Enables compatibility with linux arm64
2024-09-07 18:19:06 +02:00
schm1dtxbox
58f3841383 Fix arm64 RPCS3 being reported by macOS as an iOS app
macOS/Mac OS X reports arm64-only app bundles (so not Intel only or Universal) as being iOS apps in various places like Settings and System Information unless the bundle's Info.plist explicitly specifies it is only supported on Mac OS X.
2024-09-07 16:26:19 +02:00
Elad Ashkenazi
9385f0673b Debugger: Non-blocking thread list refresh 2024-09-06 20:28:11 +03:00
Megamouse
2bc0d19c9d cellSysutilAvcExt: add some param checks 2024-09-06 17:17:17 +02:00
Megamouse
fe1fa45956 cellSysutilAvcExt: fix some params and size of long (the disassembly makes zero sense with s64) 2024-09-06 17:17:17 +02:00
Megamouse
6fa993645e cellSysutilAvc: add param checks 2024-09-06 17:17:17 +02:00
Megamouse
144ff82402 Stub cellSysutilAvc 2024-09-06 17:17:17 +02:00
Megamouse
f285b0c053 Update FAudio to 24.09 2024-09-06 17:17:17 +02:00
Megamouse
7e9cf297ac cellPad: Remove obsolete comment 2024-09-06 17:17:17 +02:00
Megamouse
d780355784 cellPad: draw debug overlay for basic input debugging of port 0 2024-09-06 08:33:55 +02:00
Megamouse
b0194ba6af cellPad: scale emulated skateboard IR input down 2024-09-06 08:33:55 +02:00
Megamouse
deba582353 Qt: Force reset of debugger when a different game is running 2024-09-06 05:05:54 +03:00
Megamouse
303c6715dd Qt: Don't start the debug update timer in the constructor
This caused the timer to be active even when the debugger is initially hidden.
2024-09-06 05:05:54 +03:00
552eden
b4ff988bd8 Add support for SHRED dongle
changed support from ride dongle to ride + shred dongle
2024-09-05 18:23:51 +02:00
kd-11
7e3b8b5cdb c++-ify empty return 2024-09-04 07:49:49 +03:00
kd-11
7353696014 cpu: Format additions to sse2neon to match the rest of the file 2024-09-04 07:49:49 +03:00
kd-11
a60eab6e36 aarch64: Fix compilation for windows-on-arm 2024-09-04 07:49:49 +03:00
Megamouse
23f9eb57e5 patch_manager: set config_key_role to current key after handle_item_selected
The key was never changed if you selected different configurables in the same item.
This means that all configurables used the same value list.
2024-09-04 01:03:33 +02:00
snake
ad1eb93a05
cellMic: add 16-bit PCM to 32-bit float conversion for DSP stream (#16030) 2024-09-03 23:25:24 +02:00
Megamouse
2fb0c499ea Update SDL to 2.30.7 2024-09-03 03:18:21 +02:00
Megamouse
fbebdc09b7 Qt: ignore double clicks unless they are left clicks 2024-09-02 23:26:56 +02:00
Ani
e56164f1e3 rpcs3_version: Bump to 0.0.33 2024-08-31 21:46:33 +02:00
Ani
ff870ca088 BUILDING: Bump gcc/clang versions to the ones used in rpcs3-docker
gcc: 11 -> 13
clang: 12 -> 17
2024-08-31 17:54:48 +02:00
Ani
52d91c4772 BUILDING: Add qt6-svg for archlinux systems 2024-08-31 17:54:48 +02:00
kd-11
c80342e8d4 aarch64: Support calloc patch blocks 2024-08-31 13:55:58 +03:00
kd-11
4d193ecb6a Block parallel JIT allocation on macos 2024-08-29 13:08:23 +03:00
kd-11
ce9024efc5 Fix overlapping addresses returned by mmap 2024-08-29 13:08:23 +03:00
kd-11
23788b04c6 Restore comment 2024-08-29 13:08:23 +03:00
kd-11
c0e577c4dc Allow overcommit on macos 2024-08-29 13:08:23 +03:00
kd-11
00a0c4e69d rsx: Silence compiler warnings 2024-08-29 13:08:23 +03:00
kd-11
81f91e2095 Fix GL stencil tracking 2024-08-29 13:08:23 +03:00
Megamouse
3b36df48e9 Vk/Gl/Overlays: Do not blend the alpha channel when rendering overlays
When blending a source pixel with alpha less than 1 onto a texture, we will end up having even less alpha than before.
This can lead to ugly "holes" in the overlays, especially on the edges of glyphs with smooth fonts for example.
We can fix this by only blending the RGB values while keeping the destination's alpha value.
I haven't really seen this happen in RPCS3, but it's better to be safe than sorry.
2024-08-28 01:19:15 +03:00
Elad Ashkenazi
d1bfa9cd9c RSX: Fix RSX Captures 2024-08-27 06:51:55 +03:00
Megamouse
e5b03d9cbd Qt: check microphone permissions 2024-08-26 07:42:22 +02:00
Megamouse
3420cb0365 Qt: ask for camera permissions 2024-08-26 07:42:22 +02:00
Megamouse
4a4762654b Qt: sync gui settings by default after setting or removing values 2024-08-26 06:28:47 +02:00
kd-11
56d35bf409 Fix crash in JIT when compiling LLVM blocks 2024-08-25 22:04:45 +03:00
kd-11
4f97ea8da7 macos - Fix crash when running native arm64 LLVM 2024-08-25 22:04:45 +03:00
kd-11
f367703574 Use sysctlbyname 2024-08-25 22:04:45 +03:00
kd-11
8c64192ac7 Implement basic system info detection on macos using sysctl 2024-08-25 22:04:45 +03:00
Elad Ashkenazi
11e3aa660e SPU: Remove condition from GETLLAR spin detection 2024-08-25 18:29:30 +03:00
RipleyTom
3dc75dc3d1 Handle WSAENETRESET error 2024-08-25 13:04:44 +03:00
kd-11
be0ef0cc28 macos - Fix crash executing resolver 2024-08-24 14:13:14 +03:00
kd-11
470f8674df aarch64 - Support for apple exceptions 2024-08-24 14:13:14 +03:00
kd-11
4da30e9eca Add proper transform pass management 2024-08-24 14:13:14 +03:00
kd-11
09ea858dbf Minor fixes 2024-08-24 02:07:00 +03:00
kd-11
296c931d55 Fix v3dv workaround 2024-08-24 02:07:00 +03:00
kd-11
94b6e4598c Fix aarch64 compilation on macOS 2024-08-24 02:07:00 +03:00
kd-11
f5173ca9bf aarch64 - Decode CPU brand information 2024-08-24 02:07:00 +03:00
Elad Ashkenazi
1c16ada670 Debugger: Pointer comparison bugfix 2024-08-22 12:21:55 +03:00
Ani
67308bcf6f vk: Only allow unsupported textureCompressionBC for v3dv 2024-08-21 23:07:13 +03:00
Ani
0649da4cfb vk: Add driver vendor V3DV (Broadcom on Mesa)
VK_DRIVER_ID_MESA_V3DV
2024-08-21 23:07:13 +03:00
Ani
18df24d390 vk: Support v3dv, allow creating device without textureCompressionBC
v3dv supports BC1-BC3 which is all we require, support is reported as 
false since not all formats are supported
2024-08-21 23:07:13 +03:00
Ani
c2b275ddbc spu: Workaround GCC 14.1 compiler bug
Stumbled upon this issue with gcc 14.1.1+r1+g43b730b9134-1 on aarch64, 
failing compilation due to implicit fallthrough warnings being treated 
as errors
2024-08-21 21:48:53 +03:00
Ani
fc85c1a0c1 config: Set minimum allowed resolution scale to 25% 2024-08-21 21:48:53 +03:00
oltolm
7f30e52fda cmake: fix EGL and add USE_SYSTEM_CURL 2024-08-21 20:33:40 +03:00
kd-11
042a5481ca Formatting 2024-08-21 16:16:28 +03:00
kd-11
4bb79b6c31 Rework aarch64 signal handling 2024-08-21 16:16:28 +03:00
Elad Ashkenazi
d6acdc77e0 Debugger/SPU: Implement SPU Disassembler 2024-08-21 13:32:45 +03:00
Elad Ashkenazi
7c898c3e4e SPU: Improve some logging 2024-08-21 13:32:45 +03:00
kd-11
3ea24183b9 Improve "write" instruction detection. 2024-08-20 05:18:53 +03:00
kd-11
d0dbdb1ab5 Fix hang when compiling leaf blocks 2024-08-20 05:18:53 +03:00
kd-11
c2f5de1c55 Fix compiler warnings about unused args for aarch64 2024-08-20 05:18:53 +03:00
kd-11
fbcd8e32b8 Cleanup 2024-08-18 18:27:52 +03:00
kd-11
ca4fa1ac74 Use return-oriented trap approach 2024-08-18 18:27:52 +03:00
kd-11
fc415cf32a Move to a assembler wrapper for injected asm to better handle dependencies 2024-08-18 18:27:52 +03:00
kd-11
2faa61ac31 Refactor aarch64 JIT code 2024-08-18 18:27:52 +03:00
Megamouse
fd6ebe2895 Qt/input: Don't report two direction trigger values unless actually requested
Fixes a bug where you could map LT- even if you weren't pressing ALT before.
2024-08-18 10:49:26 +02:00
Megamouse
08f81160cc Input: Abbreviate some variable names and add min output interval
The abbreviation allows for easier diff between handlers.
2024-08-18 10:49:26 +02:00
Megamouse
9a071746ed input: log send_output_report hid error
Maybe helps to figure out some issues
2024-08-18 10:49:26 +02:00
Elad Ashkenazi
bd5fd66408 SPU: Reduce some logging 2024-08-17 06:38:49 +03:00
Elad Ashkenazi
1bd4565186 Implement thread_ctrl::wait_until() 2024-08-17 06:38:49 +03:00
Megamouse
b2877365de Qt: fix pad settings latency
Increase input timers back to 1000Hz. The DS4 lags if it's slower.
Decrease all pad UI update timers from 1000Hz to 100 Hz.
2024-08-16 09:06:42 +02:00
Elad Ashkenazi
981a1c56fb SPU: Disable transfer locking for RSX addresses 2024-08-15 14:05:25 +03:00
Elad Ashkenazi
ce92341e75 SPU: Unlock RSX list transfers 2024-08-15 14:05:25 +03:00
Elad Ashkenazi
46ceeed10d Debugger/PPU: Minor bugfix in CR register dump 2024-08-15 14:05:25 +03:00
Megamouse
456ff10f02 Qt/patches: don't allow duplicate app versions 2024-08-15 09:35:58 +02:00
Megamouse
dedda09560 Qt/patches: fix multi app version entry in patch creator 2024-08-15 09:35:58 +02:00
Megamouse
8371c445ce Qt/patches: check if app version is 5 characters long and like 01.00 2024-08-15 09:35:58 +02:00
Megamouse
93424d1adc Qt/patches: check if serial is 9 characters long and alphanumeric 2024-08-15 09:35:58 +02:00
Megamouse
d05d803f5e patches: use more std::move 2024-08-15 09:35:58 +02:00
Megamouse
963e283db5 Qt/patches: Use YAML emitter to escape characters 2024-08-15 09:35:58 +02:00
Megamouse
b78d76e1bb Qt/patches: allow to select text with the mouse
Lets you copy paste stuff
2024-08-15 09:35:58 +02:00
RipleyTom
50446e425d evdev: don't warn on disabled motion device 2024-08-15 08:58:09 +03:00
Megamouse
72cd146665 Qt: vfs tool dialog 2024-08-15 00:45:48 +02:00
Megamouse
f5d8786ffd Update 7zip to 24.08 2024-08-15 00:45:48 +02:00
Megamouse
ce5ae56f67 Qt/patches: delete message boxes on close 2024-08-14 20:21:55 +02:00
Megamouse
76c0df849a patches: improve error logging: add file paths to all errors 2024-08-14 20:21:55 +02:00
Megamouse
f64f0b2e33 Qt/patches: use show instead of exec 2024-08-14 20:21:55 +02:00
Megamouse
4051988403 Qt/patches: improve value validation 2024-08-14 20:21:55 +02:00
Megamouse
db102a5237 Qt/patches: uze const ref for YAML::Node params 2024-08-14 20:21:55 +02:00
Elad Ashkenazi
7f92d6003d sceNp: Silence a few functions 2024-08-14 11:53:00 +03:00
Elad Ashkenazi
6fb05be9da CELL: Remove performance hack for reservation
With the new notification method, we can remove this hack with micro-consequences. (though it comes with benefit of not breaking current reservations spuriously)
2024-08-14 11:53:00 +03:00
Elad Ashkenazi
d0ebba6c5e CELL: New reservation notifications mechanism 2024-08-14 11:53:00 +03:00
Elad Ashkenazi
29b0298f1e Fix sys_io thread deadlock
Co-Authored-By: Megamouse <23019877+Megamouse@users.noreply.github.com>
2024-08-14 08:56:40 +03:00
Megamouse
4d5897d519 keyboard: only map single buttons
key combos are not really supported at the moment
2024-08-13 20:58:04 +02:00
Megamouse
7bcaab4f3a Remove unused using declaration 2024-08-13 20:14:30 +02:00
Megamouse
93c21103aa xinput: allow to map triggers as positive or negative 2024-08-13 20:14:30 +02:00
kd-11
26a1a4418e rsx: Fix crash when CPU blit is enabled 2024-08-13 19:23:47 +03:00
kd-11
0b62385ddb aarch64/llvm: Handle processing of leaf nodes 2024-08-13 18:25:26 +03:00
Elad Ashkenazi
6535d461be Fix vm::reservation_update 2024-08-13 10:56:33 +03:00
Elad Ashkenazi
3fa8994f4e SPU: Fix "SPU Accurate Reservations" off 2024-08-13 10:56:33 +03:00
Megamouse
ff6a4bb72d Qt/input: add shortcut for toggling emulated mouse and keyboard 2024-08-12 23:19:23 +02:00
Megamouse
ff84e7c6e2 Fix overflow warning 2024-08-12 21:04:10 +02:00
Megamouse
3716ba2ba2 Qt: refactor pad preview updates to reduce duplicate code 2024-08-12 21:04:10 +02:00
kd-11
c7b2a21fcb Fix OpenGL behavior under wayland-egl 2024-08-12 04:55:26 +03:00
Ninetime
b0d07a75e5 Enable users to reject friend requests 2024-08-11 19:19:32 +03:00
Elad Ashkenazi
60b7448d8a SPU LLVM: Enable PUTLLC16 if accurate reservations is off 2024-08-11 17:55:56 +03:00
Elad Ashkenazi
f980c59860 Do not add usage stats for unused SPU programs 2024-08-11 17:55:56 +03:00
Elad Ashkenazi
6c791541ee SPU: Fix bug in GETLLAR 2024-08-11 17:55:56 +03:00
Megamouse
72cccb691c Qt/input: update buttons at 100 hz instead of 1000 hz.
This reduces cpu usage without any noticeable drawback.
2024-08-11 00:56:07 +02:00
Megamouse
cb122819ae evdev: try to fix first call behaviour
We don't have all the events in the first call to get_next_button_press.
So we have to set all the buttons to max on the first call.
We also have to make sure that we don't manipulate the values if we just
want to know the connection status.
2024-08-11 00:56:07 +02:00
Megamouse
0dfc622b58 Fix unused function warning 2024-08-11 00:56:07 +02:00
Ninetime
7d84d084a4
Enable user to change country code (#15884) 2024-08-10 22:33:38 +02:00
Megamouse
f2ef0966eb input: add analog limiter 2024-08-10 12:07:57 +02:00
Megamouse
2806348f73 evdev: simplify get_next_button_press 2024-08-09 20:01:50 +02:00
Megamouse
b95aa7a28c mmjoy: simplify get_next_button_press 2024-08-09 20:01:50 +02:00
Megamouse
961239ac8d Qt/input: make touch_threshold a member
Maybe we need will need it for a different handler in the future
2024-08-09 20:01:50 +02:00
Megamouse
326375ad9a Qt/input: clear min_button_values if we want to get the blacklist 2024-08-09 20:01:50 +02:00
Megamouse
16a6915525 Qt/input: ignore button press values unless they increase 2024-08-09 20:01:50 +02:00
Megamouse
28781d9bfb Qt/input: move preview_values into callback 2024-08-09 20:01:50 +02:00
kd-11
3ef8046f5c rsx: Fix fragment constants decoding for non-x86 platforms 2024-08-09 15:09:26 +03:00
Megamouse
03a612487d cellGem: Only allow each button to be used for one action unless it's the combo button. 2024-08-08 22:34:20 +02:00
Megamouse
60b90075ac input: ignore mouse handler events until initialized
And revert the now obsolete reload requests
2024-08-08 22:34:20 +02:00
Megamouse
bc23615508 Input: fix initial mouse config reload 2024-08-08 22:34:20 +02:00
Megamouse
548cc074f4 input: log all config file content if used 2024-08-08 22:34:20 +02:00
Darkhost1999
3970b7b754
Class "llvm:StringRef" has no member 'Startswith' (#15898) 2024-08-08 21:40:52 +02:00
Jérémy Francart
20598960a5
PINE: Fix socket naming for Mac and Linux to match protocol specification (#15906)
This commit fixes the socket file name for Mac and Linux users.
Essentially, the port is now only concatenated to the socket name if it
is different than the default port.
This change was made to match with the specification of the PINE
protocol and the other emulators implementing it.
2024-08-08 20:08:28 +02:00
kd-11
1200bbe7cc Address review comments 2024-08-08 13:40:07 +03:00
kd-11
fa7e0e4758 Do not include arm sources by default 2024-08-08 13:40:07 +03:00
kd-11
9d87e444ac Clear hv context 2024-08-08 13:40:07 +03:00
kd-11
294bebb4a7 Fix SPU compilation 2024-08-08 13:40:07 +03:00
kd-11
140fddbba8 Initial SPU bringup 2024-08-08 13:40:07 +03:00
kd-11
bc1b0eb41b Improve comments 2024-08-08 13:40:07 +03:00
kd-11
42d47b61a0 Fix dependency injection on terminators 2024-08-08 13:40:07 +03:00
kd-11
839a25e129 Bump scratch to 8k 2024-08-08 13:40:07 +03:00
kd-11
7979c5d9eb Finalize PPU migration to the frame pass system 2024-08-08 13:40:07 +03:00
kd-11
cba658baba Complete PPU support 2024-08-08 13:40:07 +03:00
kd-11
34549445a8 Migrate PPU to post-process execution model 2024-08-08 13:40:07 +03:00
kd-11
a976ac3353 jit: Add aarch64 JIT backend for pre-codegen transforms 2024-08-08 13:40:07 +03:00
kd-11
52c8b1ecbb Silence compiler noise on non-x86 architectures 2024-08-08 13:40:07 +03:00
kd-11
56cc5d9355 Initial PPU LLVM implementation for aarch64 2024-08-08 13:40:07 +03:00
Megamouse
a5f9256ac6 cellMic: skip alcCaptureSamples loop if num_samples is 0
Also use early out instead of ensure in get_data
2024-08-08 01:39:43 +02:00
Megamouse
9505f8116b cellMic: only allocate temp_buf if needed 2024-08-08 01:39:43 +02:00
Megamouse
a5bd22b0cf cellMic: free temp_buf if on mic close 2024-08-08 01:39:43 +02:00
Megamouse
1b5ec785f5 cellMic: do not copy samples to intermediate buffer unless necessary 2024-08-08 01:39:43 +02:00
Megamouse
80e1b1adf4 cellMic: only call get_data once 2024-08-08 01:39:43 +02:00
Megamouse
6a6cd82070 cellMic: simplify BE translation loop
We are looping over each channel of each sample without gaps.
So we can just make it a single loop.
2024-08-08 01:39:43 +02:00
Megamouse
161edbf2f6 cellMic: make bit_resolution and channel_size constexpr
This allows us to optimize and inline variable_byteswap
2024-08-08 01:39:43 +02:00
Megamouse
667db0f2de cellMic: remove duplicate code and add size checks 2024-08-08 01:39:43 +02:00
Megamouse
f09d22a00d cellMic: check device ptr and log openal error codes 2024-08-08 01:39:43 +02:00
Joshua de Reeper
f1d4e500ba sys_usbd: Default replies for Dimensions Color Commands 2024-08-06 20:42:28 +02:00
Megamouse
b5aac6d802 cellMic: fix type conversion warning 2024-08-06 00:42:24 +02:00
Megamouse
43c3a15a50 MSVC: Fix openal import warnings
Fixes warnings like: symbol 'alcGetString' defined in ... is imported by ...
2024-08-06 00:42:24 +02:00
Elad Ashkenazi
9f8d9c5d10 SPU LLVM: Revert store postponing restrictrictions 2024-08-05 19:36:26 +02:00
Megamouse
4084e6f584 Dimensions: default init figures 2024-08-05 16:07:55 +02:00
Megamouse
7fa2987bb9 Infinity: Early out instead of scope 2024-08-05 16:07:55 +02:00
Megamouse
09ead1b6ea Dimensions: try to fix out of bounds array access 2024-08-05 16:07:55 +02:00
Megamouse
bc07b9e659 Dimensions improve locks (maybe) 2024-08-05 16:07:55 +02:00
Megamouse
5bd2fd3391 Dimensions: make some functions static 2024-08-05 16:07:55 +02:00
kd-11
4030193f31
Case-insensitive path compare for module verifier (#15889) 2024-08-04 15:46:08 +02:00
Megamouse
a1dcf1f717 Qt/trophies: allow to delete a game's trophy directory 2024-08-04 11:46:16 +02:00
Megamouse
f0ce40dff3 Qt/savedata: remove call with unreachable case
The function does an early out if the index is -1 anyway.
2024-08-04 11:46:16 +02:00
kd-11
f6b5511546 Improved wayland support 2024-08-04 02:59:03 +03:00
kd-11
0be1c41e63 Improve AMD CPU detection 2024-08-03 21:35:10 +03:00
kd-11
c8e81a2dad Return zen4 for zen5+ until LLVM upgrade 2024-08-03 21:35:10 +03:00
kd-11
dd708166aa Improve intel and apple detection 2024-08-03 21:35:10 +03:00
kd-11
3e7c1e207d Add fallback CPU detection when llvm is not aware of the CPU model 2024-08-03 21:35:10 +03:00
future-figs
8f51b0907a
change PSMove mouse button bindings (#15860) 2024-08-02 23:59:51 +02:00
Megamouse
c4160a3887 Update MSVC redistributable URL 2024-08-02 21:40:30 +02:00
Megamouse
b76fd38854 Run platform sanity checks after creating the log and log windows path 2024-08-02 21:40:30 +02:00
Daniel López Guimaraes
9db68e7d39 cellMic: Handle value 0 on CELLMIC_DEVATTR_CHANVOL
If arg1 is zero, all channels of the device are affected.
2024-08-02 19:29:42 +02:00
Daniel López Guimaraes
ba3d16b48b cellMic: Fix CELLMIC_DEVATTR_CHANVOL handling
The microphone index given in `arg1` is 1-indexed, so we have to
subtract 1 from the index to access the proper value.

This wasn't caught up before since we were doing direct access of the
array instead of using `::at32` which wouldn't check that the value is
within bounds.

This allows the original SingStar game to boot up again, as it would
otherwise crash then trying to set the volume to the second channel due
to the index being out of bounds.
2024-08-02 19:29:42 +02:00
Megamouse
c8ad075372 Update SDL to 2.30.6 2024-08-02 17:31:13 +02:00
Megamouse
9912552a85 Update FAudio to 24.08 2024-08-02 17:31:13 +02:00
Megamouse
0088c0375a Update curl to 8.9.1 2024-08-02 17:31:13 +02:00
Elad Ashkenazi
70502a698e
types.hpp: Format C arrays too for assert errors 2024-08-02 14:11:05 +03:00
kd-11
a323e753ff gl: Fix hang on windows 2024-08-01 20:17:16 +03:00
Megamouse
e58ce626d5 Video Encode: do not set the frame_number
Fixes a deprecation warning, and it is supposed to be set by ffmpeg anyway.
2024-08-01 18:04:47 +02:00
Megamouse
106bf5145b Fix ffmpeg deprecation warnings 2024-08-01 18:04:47 +02:00
Elad Ashkenazi
c5c51ec0c1 types.hpp: Add argument formatter to assert errors 2024-08-01 16:32:09 +03:00
kd-11
f64c912d02 gl: Fixes for asahi linux 2024-08-01 14:14:56 +03:00
Megamouse
7884bcc21d Fix unused function warning 2024-08-01 02:44:01 +02:00
Megamouse
7ebfe5ce69 Remove unused variable 2024-08-01 02:44:01 +02:00
Megamouse
08168c39c8 Fix std::move warning 2024-08-01 02:44:01 +02:00
Megamouse
319c533196 Silence deprecation warnings on MacOs 2024-08-01 02:44:01 +02:00
Megamouse
56b6b7e732 raw_mouse: Fix button map out of bounds access
- Reload the mouse config when the index changes.
- Clear the button map before reloading the config.
- Check if the button really is in the map.
2024-08-01 01:17:01 +02:00
Megamouse
30f49a61df DS4/DualSense/SDL: add touchpad support 2024-07-31 08:45:25 +02:00
Joshua de Reeper
12fbff22b2
sys_usbd: Allow 'Moving' figure to same slot on Dimensions Toypad (#15850) 2024-07-29 17:50:20 +02:00
Elad Ashkenazi
02aac2c52e sys_fs: Non-existant overflow bugfix
It would technically never overflow.. but this add minimal protection against adding beyond [PPU thread-count + entries count]
This does not induce an atomic loop which limits until entries.size() but is slower.
2024-07-28 12:36:42 +03:00
Elad Ashkenazi
faabb9e111 Add SPU usage for program dump 2024-07-28 12:36:42 +03:00
Elad Ashkenazi
b639599ade reduce logging 2024-07-28 12:36:42 +03:00
Elad Ashkenazi
91b4aaf9e1 PPU: Fix potential overflow 2024-07-28 12:36:42 +03:00
Elad Ashkenazi
700334753d cellMic: Fix potential overflow 2024-07-28 12:36:42 +03:00
Elad Ashkenazi
d451c0867c Remove welcome dialog shortcut 2024-07-28 12:36:42 +03:00
Daniel López Guimaraes
501e9260b2 cellMic: Wake up upon registering emulated SingStar microphone
When using the emulated SingStar microphone, the device is only
registered when initializing `cellMic`. However, the `mic_context`
thread is only woken up when calling `register_device`. The registration
happens before initializing `cellMic`, so the thread is never woken up
after registering the device.

Add call to `wake_up` in `load_config_and_init` inside the emulated
SingStar microphone specific code to fix this issue, allowing the thread
to detect the device and update the microphone data.

This allows SingStar to receive the microphone data when using the
emulated SingStar microphone that it previously wasn't receiving.
2024-07-26 09:44:00 +03:00
kd-11
27047bb3dc vk: Fix VEGA float16 workaround 2024-07-25 14:23:36 +03:00
Megamouse
953af7589c Paint icons into rpcn status circles 2024-07-24 09:21:15 +02:00
Megamouse
14dea78ddc Add missing QPainter::end calls 2024-07-24 09:21:15 +02:00
Megamouse
5737ed3bce Fix some msvc warnings 2024-07-24 09:21:15 +02:00
Megamouse
82de139be5 Qt: Fix resolution dropdown if resolution flags of game are empty
Fixes custom config creation error for games that have no resolution.
Fixes empty dropdowns if resolution flags are 0 by adding all resolutions.
Make sure to keep 720p as option if the dropdown would be empty after all.
2024-07-22 23:41:40 +02:00
Megamouse
c533dc969d input: reload gui settings when the visibility or the active window changes 2024-07-22 22:44:42 +02:00
Megamouse
34506daff6 input: log used pad config 2024-07-22 22:44:42 +02:00
Silent
c0808448be sceNp: Fix sending partial results from sceNpScoreRecordGameData
Fixes Ghost Data in Ridge Racer 7
2024-07-22 21:52:33 +02:00
Megamouse
f8a729f4b4 Improve dimensions dialog layout 2024-07-22 20:52:40 +02:00
Megamouse
c021165483 Disable stereo render combobox if other resolutions than 720p are selected
Also move to custom configuration
2024-07-22 19:49:28 +02:00
Megamouse
a21740f260 Rename resolutions to better convey irrelevance of aspect ratio 2024-07-22 19:49:28 +02:00
Pierrick Bouvier
3ab8922143 Fixed compilation
missing optional header (from commmit 500bf0f3f5)
2024-07-21 08:43:12 +02:00
shinra-electric
c0edd1bf7a Bump mvk to 1.2.10 2024-07-20 22:41:49 +02:00
shinra-electric
25d71d818a Bump mvk to 1.2.10 in build script 2024-07-20 22:41:49 +02:00
Megamouse
5dc7a6a815 Fix MSVC filters 2024-07-20 07:37:17 +03:00
Megamouse
e0fce6cc5b Fix some warnings 2024-07-20 07:37:17 +03:00
Florin9doi
7fba56f27b USB: Replace if/else with switch 2024-07-19 22:10:11 +02:00
Florin9doi
33d2b27b91 USB: Top Shot Fearmaster device emulation 2024-07-19 22:10:11 +02:00
Florin9doi
088b594fa8 USB: Top Shot Elite device emulation 2024-07-19 22:10:11 +02:00
Florin9doi
a1a38b7b39 USB: Move uDraw GameTablet config from IO to Pads 2024-07-19 22:10:11 +02:00
Joshua de Reeper
500bf0f3f5 sys_usbd: Emulate Dimensions Toypad 2024-07-19 20:29:19 +02:00
Elad Ashkenazi
a2534263fe Savestates/PPU: Ensure correct PPU state on MMIO 2024-07-19 14:31:19 +03:00
Elad Ashkenazi
77e8f9a8ab SPU: Utilize Operating System sleep in detected RCHCNT loop 2024-07-19 14:31:19 +03:00
Silent
f3ceebabd9 sceNp: Improve SceNpCommunicationId logging 2024-07-18 21:42:07 +03:00
Silent
9e094fded6 Do not set the data size in sceNpBasicGetEvent for SCE_NP_BASIC_EVENT_OFFLINE
There is no data associated with this event,
size is not supposed to be set.
2024-07-18 21:42:07 +03:00
MSuih
ebcb403411 Remove Alipay link from FUNDING.yml 2024-07-18 20:44:04 +03:00
RipleyTom
dd9b3c651f Support old sceNpScoreRankData 2024-07-18 18:29:49 +02:00
oltolm
065a64371e improve CMake files
Signed-off-by: oltolm <oleg.tolmatcev@gmail.com>
2024-07-13 15:39:29 +02:00
Megamouse
99b44cf33a Update FAudio to 24.07 2024-07-09 19:15:50 +02:00
Megamouse
d6380a1084 Update Wolfssl to 5.7.2 2024-07-09 19:15:50 +02:00
Megamouse
dd4fde9599 Update SDL to 2.30.5 2024-07-09 19:15:50 +02:00
Megamouse
8236b58a29 cellGem: fix camera format conversions
Use interleaved RGBA format and get rid of BE/LE differences.
2024-07-08 23:11:03 +02:00
Megamouse
7ea64b53ad Qt: Fix camera id and format when default is selected 2024-07-08 20:16:23 +02:00
Megamouse
441b324afe Qt: Fix camera string comparison in settings_dialog
The id() contains a QByteArray, not a QString.
2024-07-08 20:16:23 +02:00
Elad Ashkenazi
669ce1faca Fixup compilation
And reduce limit for PUTLLC16 block scan
2024-07-08 10:06:56 +03:00
Elad Ashkenazi
f08d4a53b3 SPU: Make users tell what games matter for channel pattern 2024-07-08 10:06:56 +03:00
Elad Ashkenazi
7f8eec9dca Disable PUTLLC16 again 2024-07-08 10:06:56 +03:00
Elad Ashkenazi
8333830bd7 Progress Dialog: Stabilize remaining time 2024-07-08 10:06:56 +03:00
Elad Ashkenazi
2ca5d23aac SPU Analyzer: Make register state evaluation shorter 2024-07-08 10:06:56 +03:00
Elad Ashkenazi
aa5284c8f1 [WIP] SPU: Channel Loop Pattern Detection 2024-07-08 10:06:56 +03:00
Florin9doi
a1d2a72a78 USB: GunCon3 updates
-Process the mouse buttons even when x/y_max aren't yet determined.
 -Allows to start the calibration without shaking the mouse before.
-Extend support to 4 players. The games can't use more than 2, but it
allows more flexibility to mix DS3 and GC3.
-Avoid OOB for unsupported Pads
2024-07-07 18:34:52 +02:00
Florin9doi
58d27a9438 Pad: Simplify is_fake_pad logic 2024-07-07 18:34:52 +02:00
MSuih
b4e4aa9822
Improve error message when update cannot be installed due to version mismatch (#15773)
* Show the relevant versions whenever update fails to install due to version difference
2024-07-07 15:23:25 +02:00
Megamouse
856d8c303d Fix some visual studio filters 2024-07-07 01:09:45 +02:00
Megamouse
f0713c8940 Input/Overlays: show pressure intensity toggle hint 2024-07-06 19:58:53 +02:00
Megamouse
d23ac6f598 input: move player_id to pad struct 2024-07-06 19:58:53 +02:00
Megamouse
6948c0a30a Qt: disable battery LED settings if the pad handler doesn't support it 2024-07-06 18:55:48 +02:00
Megamouse
4c11554d2c Qt: fix player LED groupbox label 2024-07-06 18:55:48 +02:00
Megamouse
20f906bf9b input: add battery LED flag and some getters 2024-07-06 18:55:48 +02:00
Megamouse
1a61a7a39f input: allow running pad thread without emulation 2024-07-06 18:55:48 +02:00
Megamouse
0db7ab64ee Camera: copy JPG and RGBA data if needed 2024-07-06 18:55:48 +02:00
Elad Ashkenazi
33851d51ab Fixup and Improve CELL reservation notifications 2024-07-01 18:59:26 +03:00
5kft
6ddb21ab95
revert pull request #15618 2024-07-01 07:35:59 +03:00
Megamouse
289b70d276 input: implement HidDevice::close
Preparing for further ps move additions down the line.
2024-06-30 12:51:24 +02:00
Megamouse
eab1c1260c cellGem: Implement cellGemEnableMagnetometer2 2024-06-30 12:51:24 +02:00
Megamouse
61435d26dc VS: fix MouseHandler.cpp filter 2024-06-30 12:02:37 +02:00
Megamouse
fc0878e688 Fix midi drum config loading 2024-06-30 12:02:37 +02:00
Megamouse
352229efbd Fix some warnings 2024-06-30 12:02:37 +02:00
Megamouse
44e4e67aa8 Simplify duplicate mouse handler init code 2024-06-30 12:02:37 +02:00
Megamouse
c9a082614d input: ignore raw mouse double click when used as move handler 2024-06-30 12:02:37 +02:00
Elad Ashkenazi
f948a80242 CELL: More efficient reservation notificatins 2024-06-30 07:46:14 +03:00
Elad Ashkenazi
c71edc0719 Remove check_state() inside thread notifiatios
This was a flawed concept due to risk of deadlocks.
Worst case some we will focus o performanc regressins indvidually as we should and not accept this bug.
2024-06-29 14:02:12 +03:00
kd-11
71524271e9 rsx: Fix codegen when depth-conversion is enabled 2024-06-28 12:13:33 +02:00
Megamouse
d5923ef808 Fix weird new gcc namespace warning 2024-06-28 00:24:07 +02:00
kd-11
ef136acb6c Whitespace fix 2024-06-27 22:55:56 +02:00
kd-11
a5956cfa82 rsx: Fix wrapped/clamped MSAA sampling behavior with dynamic flags 2024-06-27 22:55:56 +02:00
Megamouse
703de01ebf input: actually initialize midi drum notes and combos 2024-06-27 22:14:35 +02:00
Megamouse
8343e35146 cellCamera: improve error logging 2024-06-27 19:12:34 +02:00
Megamouse
0679b502f2 input: allow dynamic change of midi drum config 2024-06-27 19:12:34 +02:00
Megamouse
e790842007 input: allow dynamic change of mouse configs 2024-06-27 19:12:34 +02:00
Elad Ashkenazi
a9d53e98de SPU LLVM: Fix LSA masking for PUTLLC16, disable RTIME checks 2024-06-27 16:58:23 +03:00
Elad Ashkenazi
908082e7c3 Silence some cellGem logging 2024-06-27 16:58:23 +03:00
Elad Ashkenazi
8ec6187dc7 SPU Analyzer: Fix support for multi-block value merge 2024-06-27 16:58:23 +03:00
shinra-electric
50ce4cbea5 Update build script to MoltenVK 1.2.9
Updates from 1.2.7 to 1.2.9
Homebrew had issues with 1.2.8, so we skipped that version.
2024-06-27 03:52:09 +02:00
shinra-electric
3904900243 Update MoltenVK
Updates from 1.2.7 to 1.2.9
Homebrew had problems with 1.2.8, so skip that version.
2024-06-27 03:52:09 +02:00
SuperSamus
33d6e6ce6c skylander_dialog: Fix Drill Sergeant's name 2024-06-27 03:13:17 +02:00
Megamouse
363a4dbdef Fix warning: dangling pointer (construct string_view from temporary string) 2024-06-27 03:21:35 +03:00
Megamouse
e635abe552 Fix warning: std::move of const variables 2024-06-27 03:21:35 +03:00
Megamouse
df6bec236f input: Use same dualsense gyro values as linux kernel 2024-06-27 01:15:23 +02:00
Megamouse
78cb7963fb input: invalidate ds4/dualsense calibration instead of disabling the controller 2024-06-27 01:15:23 +02:00
Megamouse
b251d81065 input: fix minimum turntable input
DJ Hero does not register input if the turntable is 0, so force it to 1.
This will happen if you map it to the left stick and push it all the way down,
or if you use a keyboard, which sends the max value on key press.
2024-06-26 23:45:00 +02:00
Megamouse
11ee80a070 input: add missing lock to keyboard handler ReleaseAllKeys
This should fix a segfault I encountered when closing a game.
I think the consumers were removed while the window went out of focus.
2024-06-26 22:19:56 +02:00
Megamouse
8050e1f853 input: fix ds3 gyro offset 2024-06-26 17:19:06 +02:00
Elad Ashkenazi
f18e3be4f2
Cut scenNpDrmIsAvailable sleep time by half 2024-06-25 10:02:53 +03:00
Elad Ashkenazi
87f5368d3c PPU: Fix access violation on logging 2024-06-23 19:29:13 +03:00
Megamouse
945bfaf0ea input: differentiate between left and right modifier keys 2024-06-23 15:54:13 +02:00
Megamouse
1cef7df006 input: add missing control key to basic keyboard
The meta key logic changed, so we now have to add it.
2024-06-23 15:54:13 +02:00
Megamouse
c2899ad4cb Replace sys_io log channel with cell module log channels
For more granular log filtering
2024-06-23 15:54:13 +02:00
MSuih
7e274a1ff4 Fix locale on linux 2024-06-23 12:15:42 +02:00
Megamouse
7e27e1420e input: try to fix macOS SDL crash 2024-06-23 09:31:48 +02:00
Megamouse
7367f72f4a Update SDL to 2.30.4 2024-06-23 08:25:45 +02:00
Megamouse
81f1f49d5d Update 7zip to 24.07 2024-06-23 08:25:45 +02:00
Elad Ashkenazi
bceaf46e2f Savestates/Mouse: Fix Mouse handler use 2024-06-20 20:25:07 +03:00
Elad Ashkenazi
649714429b SPU: Notify threads on RdEventStat properly 2024-06-20 00:51:51 +03:00
Elad Ashkenazi
dbb02241c5 SPU: Cleanup GETLLAR 2024-06-20 00:51:51 +03:00
Elad Ashkenazi
f228ca7961 SPU LLVM: Avoid sinking stores out of non-loops 2024-06-20 00:51:51 +03:00
Elad Ashkenazi
5b973448bf SPU: Better GETLLAR spin detection 2024-06-15 22:41:52 +03:00
Elad Ashkenazi
d5935a37bb SPU: Notify threads if data changed in RdEventStat 2024-06-15 22:41:52 +03:00
Elad Ashkenazi
5693cc9eb3 SPU: smart GETLLAR spin detection 2024-06-15 22:41:52 +03:00
RipleyTom
feff2ba09e Fix race in sys_net select and poll 2024-06-14 10:52:34 +03:00
Elad Ashkenazi
caf81f1367 LV2: Race condition fixup 2024-06-12 12:41:15 +03:00
Elad Ashkenazi
f58b418b7d LV2: Optimization for timeout 2024-06-12 11:31:56 +03:00
Elad Ashkenazi
cec976b70a Minor fix of sys_lwmutex_destroy 2024-06-12 11:31:56 +03:00
Elad Ashkenazi
1e5f6ba39c Fix sys_lwmutex_lock for SYS_SYNC_RETRY 2024-06-12 11:31:56 +03:00
Megamouse
b8452d29d6 input: move pad_state_notify_state_change to pad_thread 2024-06-12 08:24:12 +02:00
Megamouse
b0d4858e42 vm_ptr: return nullptr and add some nullptr deref checks 2024-06-12 06:48:48 +03:00
kd-11
8d6c957cbc rsx: Fix simple_array<T>::map 2024-06-12 04:02:12 +03:00
Megamouse
1e5cd7f140 sceNp: fix print_get_roomdata_external_list_resp pointer checks 2024-06-12 00:18:37 +02:00
Megamouse
e64d09b6f7 sceNpCommerce2: check sku_ids 2024-06-12 00:18:37 +02:00
Megamouse
4d09ba5080 sceNp: add some more rpcn array pointer checks
These probably return an error on real firmware...
2024-06-12 00:18:37 +02:00
Megamouse
c8e2b9cb99 sceNp: add some more array pointer checks 2024-06-12 00:18:37 +02:00
Megamouse
be863e763f sceNp: add array sanity checks to print functions 2024-06-12 00:18:37 +02:00
Megamouse
cc19685207 Qt: log error cause on shortcut icon creation 2024-06-11 22:31:47 +02:00
Megamouse
461862be46 rsx: make some functions const 2024-06-11 20:35:49 +02:00
Megamouse
1c7850de17 rsx: fix warnings and add missing default cases 2024-06-11 20:35:49 +02:00
Megamouse
f4622fac41 Fix yet another warning 2024-06-11 20:35:49 +02:00
Megamouse
244e9c96ad ds3: use input_report struct 2024-06-11 00:09:38 +02:00
Megamouse
645621b243 Dualsense/DS4: Replace buffers with human readable structs
Also don't turn off the lights when the game closes.
2024-06-11 00:09:38 +02:00
kd-11
2647a09790 rsx: Avoid the complex remapper checks if the texture isn't in the XINT8 group 2024-06-10 20:41:45 +03:00
kd-11
bee14cad16 rsx: Do not apply texture remapping operations to "1" overrides. 2024-06-10 20:41:45 +03:00
kd-11
e966289ddb rsx: Drop hard requirement for GL_EXT_shader_integer_mix 2024-06-10 20:41:45 +03:00
kd-11
32a5641ace Annotations 2024-06-10 20:41:45 +03:00
kd-11
d6ed56aed6 rsx: Fix refactoring mess 2024-06-10 20:41:45 +03:00
kd-11
14e1214645 rsx: Properly implement 8-bit signed renormalization for textures 2024-06-10 20:41:45 +03:00
Elad Ashkenazi
0b22423ab8 Minor fs::file usage fixes
Do not crash on file creation failure. Make some config writes atomic.
2024-06-10 13:45:23 +03:00
Elad Ashkenazi
4c9296c07f Game List: Add shortcut to open cache dir
Enabled whenever debug tab is in order to protect important caches such as PPU from accidental deletion.
2024-06-10 13:45:23 +03:00
Elad Ashkenazi
8b1e7c6a48 SPU: Enable PUTLLC16 with RTIME checks 2024-06-10 09:17:38 +03:00
brian218
c73302f715 sys_ppu_thread: Fixed up sys_ppu_thread_join()'s check for detached threads
sys_game: Corrected sys_game_set_system_sw_version()'s error code
2024-06-10 07:44:49 +03:00
Elad Ashkenazi
6fff22391c PPU Analyzer: Utilize exported functions 2024-06-08 14:09:37 +03:00
Elad Ashkenazi
6d280c5f3c Ensure PPU Compilation Hint is refreshed 2024-06-08 14:09:37 +03:00
Elad Ashkenazi
929be0b4e6 PPU LLVM: Implement OE for few instructions 2024-06-08 14:09:37 +03:00
Elad Ashkenazi
4e8e5a7fed PPU Debug: Dump decrypted PRX 2024-06-08 14:09:37 +03:00
Elad Ashkenazi
721e55458c PPU Analyzer: Fixes 2024-06-08 14:09:37 +03:00
Megamouse
5a13c02774 SPU: Silence some warnings 2024-06-08 01:54:24 +03:00
Megamouse
c15121377f Input: Implement anti deadzone 2024-06-07 21:18:37 +02:00
Megamouse
5b6f340a7b openal: add headers to msvc 2024-06-07 21:18:37 +02:00
Megamouse
b52deed4dd cellGem: Fix raw mouse connection state 2024-06-07 00:25:49 +02:00
Megamouse
2199aa0635 Fix some tooltips 2024-06-07 00:25:49 +02:00
Elad Ashkenazi
5c1a1a30ee SPU Analyzer: Fix BRA instruction targets 2024-06-06 21:13:24 +03:00
Elad Ashkenazi
47fe955d35 SPU LLVM: Ensure programs are written to disk irregardless of failure 2024-06-06 21:13:24 +03:00
Elad Ashkenazi
ac5d907002 SPU: Remove inaccurate GETLLAR option 2024-06-06 19:27:52 +03:00
Elad Ashkenazi
55ed95b42c SPU Analyzer: Minor PUTLLC16 bugfixes 2024-06-06 19:27:52 +03:00
RipleyTom
1ec523b018 Fix stb cmake build 2024-06-06 15:02:47 +02:00
Megamouse
d5747a61f1 Add stb submodule 2024-06-06 15:02:47 +02:00
Megamouse
eb574e8a35 Fix config_mouse.yml path on windows 2024-06-06 15:02:47 +02:00
Megamouse
ff3fb3da65 Use openal-soft submodule and link statically 2024-06-06 15:02:47 +02:00
Megamouse
57375ca13f zstd: fix msvc ProjectName 2024-06-06 15:02:47 +02:00
Megamouse
de48646581 Update FAudio to 24.06 2024-06-06 15:02:47 +02:00
Megamouse
f4bb7a9d29 Update 7zip to 24.06 2024-06-06 15:02:47 +02:00
Ani
bd8590212d OpenAL: Fix crash when loading certain audio devices
Updates the OpenAL binary from 1.19.1 to 1.23.1, the headers/libraries were updated in the past but the binary was forgotten. This fixes https://github.com/RPCS3/rpcs3/issues/14502.
2024-06-06 01:19:10 +02:00
Ani
c475c72ead Cirrus: Update to FreeBSD 13.3 2024-06-06 00:19:00 +02:00
Sanjay Govind
d9ec33f51e
USB: If a Santroller device is in use elsewhere, don't send it commands (#15655) 2024-06-04 01:17:33 +02:00
Elad Ashkenazi
64127b5c1b buffer_stream.hpp: Try to fix MacOS compilation 2024-06-03 09:55:24 +03:00
Elad Ashkenazi
4f1db9a00f Unix/Savestates: Fix savestates destination 2024-06-03 09:55:24 +03:00
trigger
ba29a37871 sys_net: properly return error in sendto 2024-06-03 04:31:45 +03:00
Elad Ashkenazi
e5ce88f007 SPU LLVM: Disable PUTLLC16 temporarily 2024-05-31 16:10:15 +03:00
kd-11
53b81af704 vk: Dump diagnostic messages if device creation fails 2024-05-30 21:16:12 +03:00
Elad Ashkenazi
67893fb8f8 PPU Progress Hint: Show it as long as it needs 2024-05-30 11:41:24 +03:00
Elad Ashkenazi
8fa23436f9 PPU Analyzer: Unuse per-instruction compilation on fallback 2024-05-30 11:41:24 +03:00
Elad Ashkenazi
e75eec7392 System.cpp: Fix crash on fatal error during Ready state
Also remove the assert from BlockingCallFromMainThread, in some cases it may even be correct. Each case needs to be inspected alone.
2024-05-30 11:41:24 +03:00
Elad Ashkenazi
26b21ed031 LLVM: Prevent crash on disk space shortage 2024-05-30 11:41:24 +03:00
Elad Ashkenazi
c556322fc5 LLVM: Fix nullptr deref when accessing broken cache files 2024-05-30 11:41:24 +03:00
Elad Ashkenazi
a6b2bf69f1 SPU Debug: Fix crash on missing directory 2024-05-30 11:41:24 +03:00
Elad Ashkenazi
0da51d25bc SPU: Add block prefix to log if available 2024-05-30 11:41:24 +03:00
KF
c47212ff90 fix typo from PR 15636 2024-05-29 14:14:13 +03:00
kd-11
9fb79b8930 vk: Fix typo 2024-05-29 03:28:18 +03:00
kd-11
d545aa01b2 vk: Add support for NVK driver 2024-05-29 03:28:18 +03:00
kd-11
2162b7e67f vk: Use std::set 2024-05-29 03:28:18 +03:00
kd-11
93040fc757 vk: Don't always preserve the renderpass for all drivers when doing transform hot-patch 2024-05-29 03:28:18 +03:00
Megamouse
a3457c29cb Overlays: allow ldd input even if len is 0
Rock Band 3 doesn't seem to care about the len. It's always 0.
2024-05-26 10:54:12 +02:00
Megamouse
c0ed56cba0 cellKbCnvRawCode: don't use caps lock as shift lock unless we are using the qwertz or azerty layout 2024-05-26 08:32:32 +02:00
Megamouse
4bc719470c osk: use cell key code in CellOskDialogKeyMessage (🤦 we don't need the Qt code) 2024-05-26 08:32:32 +02:00
Megamouse
c01f0bffde cellKb: Clarify cellKbCnvRawCode alphabet conversion 2024-05-26 08:32:32 +02:00
Megamouse
0e32f19de8 input: remove unused parameter 2024-05-25 22:23:15 +02:00
Megamouse
ab15584eed Add 7zip submodule 2024-05-25 22:23:15 +02:00
Megamouse
ed579fbb9c Remove 7z copy pasta repo 2024-05-25 22:23:15 +02:00
Megamouse
21c03b74b6 input: only unregister devices if there is no other handler registered
Also center mouse if a new device was added
2024-05-25 00:51:05 +02:00
Megamouse
657acc90e4 input: fix ingame raw mouse enumeration 2024-05-25 00:51:05 +02:00
Megamouse
fa144d3307 input/qt: enumerate raw mouse devices once a seconds in the config dialog 2024-05-25 00:51:05 +02:00
Megamouse
5cc05d082d qt: ignore right click to clear input config button if the button is disabled 2024-05-25 00:51:05 +02:00
Megamouse
49712f8f4e input/qt: increase max raw mouse devices to 16 2024-05-25 00:51:05 +02:00
Megamouse
b0550027c3 input: implement raw mouse hot swap 2024-05-25 00:51:05 +02:00
Megamouse
c78e717ef6 input: add mutex for raw mice 2024-05-25 00:51:05 +02:00
Megamouse
9c2e6a8f31 input: only unregister raw mouse devices if they were registered 2024-05-25 00:51:05 +02:00
Megamouse
898c92045d input: add all mice that were requested. only connect the ones that exist 2024-05-25 00:51:05 +02:00
Megamouse
b3df439c51 input: add timer to raw mouse enumeration 2024-05-25 00:51:05 +02:00
Megamouse
b56f9490f5 input: move raw mouse register logic to own function 2024-05-25 00:51:05 +02:00
Elad Ashkenazi
3dfbd14de2 SPU LLVM: Implement PUTLLC16 for accurate RSX reservations 2024-05-24 14:14:42 +03:00
Megamouse
e8899bf9fc Update curl to 8.8.0 2024-05-24 00:12:59 +02:00
Elad Ashkenazi
e94928318e SPU LLVM: Disable PUTLLC16 optimization on accurate RSX reservations 2024-05-23 19:38:31 +03:00
Elad Ashkenazi
d3ab62c4b1 RSX/SPU: Import and improve RSX accurate reservations functionality 2024-05-23 19:38:31 +03:00
Elad Ashkenazi
b3c9f7647f Savestates/SPU LLVM: Fix sinking store finally 2024-05-22 12:58:43 +03:00
Megamouse
5d6d42d15d input: fix now_connect in raw mouse handler 2024-05-21 23:35:35 +02:00
Megamouse
58863c0c41 input/qt: Keep configured raw mouse device in list even if it is not connected 2024-05-21 23:35:35 +02:00
Megamouse
13673d2c79 input/qt: fix out of bounds exception when using button ids in raw mouse config dialog 2024-05-21 23:35:35 +02:00
Megamouse
2978a9aa40 input: fix reading mouse buttons from guncon cfg 2024-05-21 23:35:35 +02:00
Megamouse
9ceacd4867 input: remove No Button string from raw mouse config 2024-05-21 23:35:35 +02:00
Megamouse
32a938abd2 input/qt: allow to map mouse buttons in the guncon config 2024-05-21 23:35:35 +02:00
Megamouse
5a08ae4f41 input/qt: let user choose raw mouse device 2024-05-21 23:35:35 +02:00
Megamouse
dae4eb2d0e raw_mouse: fix out of bounds error 2024-05-21 23:35:35 +02:00
Megamouse
1600ca2c03 input: add horizontal mouse scroll/tilt to mouse handlers 2024-05-21 23:35:35 +02:00
Megamouse
bf85902485 input: move mouse handler code to cpp 2024-05-21 23:35:35 +02:00
Megamouse
7ffb61f650 Qt: use mouse input to map basic mouse buttons 2024-05-21 23:35:35 +02:00
Megamouse
eb8ab8ef15 implement mouse handler config 2024-05-21 23:35:35 +02:00
deReeperJosh
3ba4c8a1c7 Add 2 more slots for Power Discs on Infinity Base 2024-05-21 18:59:55 +03:00
Elad Ashkenazi
afa7a27f33 SPU Analyzer: Minor bugfix 2024-05-21 16:37:54 +03:00
Elad Ashkenazi
e1a0887f51 SPU Analyzer: Implement loop analysis 2024-05-21 16:37:54 +03:00
Eladash
ff42459239 SPU Analyzer: Improve value propagation 2024-05-21 16:37:54 +03:00
Eladash
71dd22a55d SPU LLVM: Avoid notifications in cellSync SPU functions
Identify them using their unique error codes.
2024-05-21 16:37:54 +03:00
Eladash
f9345c7699 SPU LLVM: PUTLLC 16 Optimization
Also, do not check LR event if already raised in PUTLLC
2024-05-21 16:37:54 +03:00
Elad Ashkenazi
a2dcbb9c13 Replace src_loc with std::soource_location 2024-05-21 14:19:12 +03:00
Elad Ashkenazi
2d32ba5ca2 Rename Suspsend to Anti-Cheat Savestates
The original naming was derived from the Developer perspective, but it does not help the actual user.
2024-05-21 14:19:12 +03:00
Elad Ashkenazi
7b3c9bea58 StrFmt.h: Fix throw_exception log message 2024-05-21 14:19:12 +03:00
Elad Ashkenazi
351bf49d9f SPU Debug: Fix GUI thread halt on log massive messages 2024-05-21 14:19:12 +03:00
Elad Ashkenazi
164c3fa9cb sys_tty: Reduce thread dump log spam
Some games just log random errors.
2024-05-21 14:19:12 +03:00
Elad Ashkenazi
89299eb1f7 Reduce logging of some SPU debug data 2024-05-21 14:19:12 +03:00
Elad Ashkenazi
dae83c53fb rsx/vk: Derstroy shader workers on thread exit 2024-05-21 14:19:12 +03:00
Elad Ashkenazi
ad41796ddb Settings: Tell the user how to disable log limit 2024-05-21 14:19:12 +03:00
RipleyTom
e42ba05883 Improve match2 ctx context start 2024-05-19 20:06:49 +02:00
RipleyTom
b83f1e7694 Improve CB accuracy for Avc2 2024-05-19 19:16:30 +02:00
Elad Ashkenazi
6fbe4c3e2e cellSysutil: Implement dispatcher callback unloading 2024-05-19 09:26:26 +03:00
Piotr Paweł Stefaniak
fe9bb31b09 Avoid repeating the -march flag
Under the right circumstances, both -march=armv8.1-a and -march=native
were added. But it only makes sense to use one or the other.
2024-05-19 02:49:00 +02:00
Megamouse
8dac5e34be Fix GunCon3 encoding 2024-05-18 19:17:08 +02:00
Megamouse
9a8ed80026 memory_viewer_panel: use existing thread_class instead of extra enum 2024-05-18 16:16:08 +02:00
Megamouse
ee7726c4ec fix GunCon3 warnings 2024-05-18 16:16:08 +02:00
Megamouse
99eb84c104 Fix some warnings 2024-05-18 16:16:08 +02:00
Megamouse
25ce3880c4 Replace get_thread_class with static cast for performance reasons 2024-05-18 16:16:08 +02:00
Megamouse
b8f8d09f97 Fix spu_thread audit check 2024-05-18 16:16:08 +02:00
Megamouse
ab923bc2c3 Add comment for thread_scheduler_mode::old to get_affinity_mask 2024-05-18 16:16:08 +02:00
Megamouse
10d85d4f51 CPUThread: remove m_class member due to bad ppu cache design 2024-05-18 16:16:08 +02:00
Megamouse
2637dc35a7 rsx: Initialize some uninitialized members 2024-05-18 16:16:08 +02:00
Megamouse
dfee5b9a6c threads: replace magic number id_type with thread_class 2024-05-18 16:16:08 +02:00
Megamouse
aff2588cce overlays/input: allow ldd pad input 2024-05-18 14:34:08 +02:00
Florin9doi
dc05d38867 PAD: Fix ldd_data transfer 2024-05-18 12:30:15 +02:00
Joshua de Reeper
9ceb22a2c0 Add Skylander Dump File Types 2024-05-17 10:03:58 +02:00
Florin9doi
db89c1d8b8 USB: Add GunCon 3 config window 2024-05-17 08:58:14 +02:00
Florin9doi
ecedbc38ec Consolidate input products in a single place 2024-05-17 08:58:14 +02:00
RipleyTom
3e7ff4059e Add matching2 option handling 2024-05-16 22:38:11 +02:00
Megamouse
ba379ceba2 spullvm: fix compilation: reference to local binding 'b2' declared in enclosing function
Also optimize some unnecessary vector lookups
2024-05-16 03:05:17 +03:00
RipleyTom
0a956906de fix size calculation in get_member_and_attrs 2024-05-15 17:57:12 +03:00
kd-11
75d6765adc gl: Handle GCM_FORMAT_G8B8 readback compatibility check 2024-05-15 04:18:12 +03:00
Elad Ashkenazi
6bceebbb1a CMake fixes
Thanks to @RipleyTom

Co-Authored-By: RipleyTom <RipleyTom@users.noreply.github.com>
2024-05-14 19:36:48 +03:00
Elad Ashkenazi
6d8575d0d0 Savestates: Warn on invalid SPU save state 2024-05-14 19:36:48 +03:00
Elad Ashkenazi
32e01b5f1a Savestates/SPU LLVM: Fix sinking stores
Found thanks to mr spaces.
2024-05-14 19:36:48 +03:00
Elad Ashkenazi
302fe53704 Log SPU access violation in always-level 2024-05-14 19:36:48 +03:00
Elad Ashkenazi
66008d5ca4 Savestates: Multi-threaded compression, use ZSTD 2024-05-14 19:36:48 +03:00
Elad Ashkenazi
7c313703a2 Savestates: Fix SPU pause from access violation handler 2024-05-14 19:36:48 +03:00
Elad Ashkenazi
2eabc77deb Hide Game Window as soon as emulation closes 2024-05-14 19:36:48 +03:00
Elad Ashkenazi
22b566cb15 Progress Dialog: Extremely important text fix
Thanks to mr spaces.
2024-05-14 19:36:48 +03:00
Eladash
2243e22630 sys_fs: Fix race in file stream API 2024-05-14 19:36:48 +03:00
kd-11
781c5a76d9 rsx: Fix processing of deferred indexed draw parameter updates 2024-05-14 16:32:41 +03:00
Florin9doi
0e3fd6a582 Remove duplicated code for USB connection/disconnection 2024-05-14 09:05:03 +02:00
Florin9doi
d1b4d4b599 Remove the redundant config for GunCon3 2024-05-14 09:05:03 +02:00
Florin9doi
65455b454e Hotplug support for emulated devices 2024-05-14 09:05:03 +02:00
Florin9doi
941c87f6d7 Create a device class for GunCon3 which is ignored by cellPad 2024-05-14 09:05:03 +02:00
Florin9doi
aa8fbf8102 Rename is_fake_move to fit other devices 2024-05-14 09:05:03 +02:00
RipleyTom
a50683d6ca
sys_net improvements (#15584)
Also remove redundant ensures
2024-05-13 05:35:08 +03:00
kd-11
fc92aef4d1 vk: Perform the buffer update without splitting the renderpasses 2024-05-12 21:26:25 +03:00
kd-11
62eb9c2012 vk: Allow barriers to optionally skip renderpass splitting
- This is allowed by spec when we don't care about what happens outside the renderpass
2024-05-12 21:26:25 +03:00
kd-11
37c9392e59 rsx: Initialize some vars 2024-05-12 21:26:25 +03:00
kd-11
0d0fc23f9e rsx: Use range intersection to speed up xform constants patching 2024-05-12 21:26:25 +03:00
kd-11
b0375d9c9a rsx: Add a base class for vertex programs and implement range intersection for constant IDs 2024-05-12 21:26:25 +03:00
kd-11
cc313bfba1 gl: Implement transform constants patching 2024-05-12 21:26:25 +03:00
kd-11
4cf7b7022e gl: Memoize the bound range for a buffer 2024-05-12 21:26:25 +03:00
kd-11
3ef1eb8529 vk: Minor cleanup 2024-05-12 21:26:25 +03:00
kd-11
3a466d6fd2 vk: Whitespace fix 2024-05-12 21:26:25 +03:00
kd-11
3fa6064068 vk: Silence some warnings 2024-05-12 21:26:25 +03:00
kd-11
a09111052a rsx/vk: Implement batched transform constant updates 2024-05-12 21:26:25 +03:00
kd-11
ac6f77a744 rsx: Provide a supplementary argument to the command barriers 2024-05-12 21:26:25 +03:00
kd-11
9e1019b1cf rsx: Start splitting off some stuff into the graph backend class 2024-05-12 21:26:25 +03:00
kd-11
77b9e6560b vk: Fix a spec violation 2024-05-12 21:26:25 +03:00
kd-11
279393337e vk: Implement dynamic transform constant updates 2024-05-12 21:26:25 +03:00
kd-11
96793193b5 rsx: Implement deferred request size io buffer where we do not know the size beforehand. 2024-05-12 21:26:25 +03:00
kd-11
406a519400 rsx: Implement deferred transform constants load 2024-05-12 21:26:25 +03:00
Megamouse
70e40ce857 cellPad: don't report fake move pads as connected 2024-05-12 18:40:51 +02:00
Megamouse
5fb6be4bf6 vfs_directory: try to fix compilation on gcc 14.1 2024-05-11 18:40:55 +02:00
Florin9doi
7ac097255e USB: Disconnect the virtual device only for TRANSFER_NO_DEVICE error
Resolve: #15565
2024-05-10 06:56:02 +03:00
Megamouse
c02aae417a Update SDL to 2.30.3 2024-05-09 08:16:26 +02:00
Megamouse
068642e53b Update FAudio to 24.05 2024-05-09 08:16:26 +02:00
RipleyTom
b7a882f42b Split normal sockets and p2p sockets handling v2 2024-05-08 20:04:23 +03:00
Megamouse
04d6ff274b Move cache dir code to utils 2024-05-07 08:47:29 +02:00
Megamouse
c11c286206 Adust vsh cache dir criteria 2024-05-07 08:47:29 +02:00
Megamouse
bdeeae47a2 Qt: disable vsh removal options if vsh is running 2024-05-07 08:47:29 +02:00
Megamouse
453bb43629 Qt: allow to remove vsh cache in context menu 2024-05-07 08:47:29 +02:00
Megamouse
e35b2e5daa Qt: allow to batch remove vsh cache 2024-05-07 08:47:29 +02:00
Megamouse
f418ad74f5 VSH: move cache to /cache/vsh/ 2024-05-07 08:47:29 +02:00
oltolm
587d0b2c36 merge qt_music_error_handler into qt_music_handler 2024-05-06 01:57:52 +02:00
oltolm
86f86f516a merge qt_camera_error_handler into qt_camera_handler 2024-05-06 01:57:52 +02:00
Megamouse
11562c430a Qt: replace m_progress_dialog_timer with setMinimumDuration
No idea why this was done so complicated xD
2024-05-05 08:31:13 +02:00
Megamouse
5745862fa8 Qt: properly hide and show progress indicator
This was previously always shown, since we never really re-used the progress dialogs.
2024-05-05 08:31:13 +02:00
Megamouse
281f248d91 Qt: remove seemingly obsolete processEvents
Replace them with early outs on cancel.
The processEvents was probably added to allow user interaction.
But it works fine without it as far as I can tell.
2024-05-05 08:31:13 +02:00
Megamouse
d6d6ce9c5f Qt: Keep progress dialog alive to fix rare segfaults 2024-05-05 08:31:13 +02:00
Elad Ashkenazi
3856b77e15 Savestates: Fix avconf serialization 2024-05-05 06:57:11 +03:00
Elad Ashkenazi
91a54c11eb Savestates: Fixup file write 2024-05-05 06:57:11 +03:00
Megamouse
0fcb0b7d8e cellVideoOutGetDeviceInfo: Fix Interlace typo for 1080p 2024-05-05 01:38:54 +02:00
Megamouse
9f90ca1b48 Rename enum values to be more precise 2024-05-05 01:38:54 +02:00
Megamouse
ee8629835b Hide interlaced resolutions from the settings dialog 2024-05-05 01:38:54 +02:00
Megamouse
e164d462b4 cellVideoOut: support interlaced scan modes 2024-05-05 01:38:54 +02:00
Megamouse
8e5fec785e Remove p from resolution strings. The Param.sfo doesn't specificy progressive/interlaced 2024-05-05 01:38:54 +02:00
Megamouse
cebf6dcd01 Allow any 1080p selection if the game supports 1080p 2024-05-05 01:38:54 +02:00
Megamouse
4aa83d1350 sys: force resolution to 720p if the game does not support the configuration
Maybe prevents some issues with global config.
2024-05-05 01:38:54 +02:00
Megamouse
96104688e1 Qt: Replace custom config resolution string logic with enum values 2024-05-05 01:38:54 +02:00
Megamouse
32666b5ae8 HLE: use original filename for media exports
No idea what's the real logic here.
I was just winging it with the title before.
It's most likely just meant for metadata.
2024-05-04 22:18:44 +02:00
Elad Ashkenazi
6a776624ac Qt/Logs: Fixing spaces, optimize string to html conversion 2024-05-04 14:15:51 +03:00
Elad Ashkenazi
4fc7e27417 Add SPRX booting option 2024-05-04 14:15:51 +03:00
Elad Ashkenazi
e74cceb3f4 Add logging of exported SPRX functions on dummy load 2024-05-04 14:15:51 +03:00
Eladash
7bd4cfc5b3 Logging fix 2024-05-04 14:15:51 +03:00
Eladash
0791349455 Avoid calling std::vector::data() if empty 2024-05-04 14:15:51 +03:00
Eladash
b83e39a540 Fix some warnings 2024-05-04 14:15:51 +03:00
Eladash
4905cd425f Thread.cpp: Prevent repeatedly halting the debugger 2024-05-04 14:15:51 +03:00
Eladash
bef832f4e0 llvm_calli fix 2024-05-04 14:15:51 +03:00
Eladash
b55f38290b Win32: Fix deadlock on std::cerr usage 2024-05-04 14:15:51 +03:00
Eladash
51e1598e42 Savestates: Fix rare race 2024-05-04 14:15:51 +03:00
Eladash
6b906b9a9c Fixup SPU Profiler 2024-05-04 14:15:51 +03:00
Florin9doi
f1ef3bdcd7 USB: Allow UsbPspCm passthrough 2024-05-02 10:12:38 +03:00
Ani
c16e176fbe rpcs3_version: Bump to 0.0.32 2024-05-01 17:01:10 +02:00
Florin9doi
55fccf03fa USB: Update GameTablet 2024-05-01 09:52:30 +02:00
Florin9doi
d3f9ae4868 USB: GunCon 3 emulation 2024-05-01 09:52:30 +02:00
Florin9doi
debeafa36b USB: Update GameTablet
- Allows to use rawinput handler
- Use a struct to access the input data
2024-05-01 09:52:30 +02:00
Ani
39e946630d syscall: Register syscall 149 sys_time_get_system_time 2024-04-29 10:25:21 -07:00
RipleyTom
8d815e8ee0 Clamp spu_fi results 2024-04-29 05:21:49 +03:00
Elad Ashkenazi
430b57833d SPU LLVM: Remove wrong zero sign fixup 2024-04-28 20:39:57 +03:00
Megamouse
e32c48d0dd Camera: optimize some loops
Factor out some conditions in RAW8 loop.
Use floats YUV loop.
Replace pixel getters with simple pointers.
2024-04-27 14:23:56 +02:00
capriots
e2402b1c8f cellRtc: review fixes 2024-04-27 13:33:09 +02:00
capriots
36abdd7114 sys_time: review fixes 2024-04-27 13:33:09 +02:00
capriots
79f54771b5 cellRtc: set to HLE by default 2024-04-27 13:33:09 +02:00
capriots
2556f84752 cellRtc: replace vm::check_addr() with sys_memory_get_page_attribute() 2024-04-27 13:33:09 +02:00
capriots
c8e624850b cellRtc: improvements 2024-04-27 13:33:09 +02:00
capriots
56692e23f5 lv2: stub sys_time syscalls, add error code to sys_ss 2024-04-27 13:33:09 +02:00
RipleyTom
b38ce9452d Revert "Split normal sockets and p2p sockets handling"
This reverts commit 08c3a38b67.
2024-04-27 10:45:14 +02:00
Megamouse
fcba193a3c input: use keyboard consumers to seperate cell and overlay logic 2024-04-27 01:03:23 +02:00
RipleyTom
6fc7fa3b13 Logging improvements 2024-04-27 00:12:14 +02:00
Elad Ashkenazi
ad4216a3fc PPU LLVM: Do not crash on linkage of garbage code 2024-04-26 18:55:50 +03:00
RipleyTom
08c3a38b67 Split normal sockets and p2p sockets handling 2024-04-24 14:15:17 +03:00
Megamouse
b8165af054 rsx: optimize some loops 2024-04-24 12:16:45 +03:00
Elad Ashkenazi
90b6912daa
Compile AUDIT on release builds
In Release, compile the code in constexpr-disabled context. this way it does not risk generating actual code but still compiles.
2024-04-23 17:24:22 +03:00
oltolm
862727e9bf simplify template code like std::invoke_result<T>::type 2024-04-21 18:15:17 +03:00
oltolm
9e9a3262eb simplify template code like std::is_same<T>::value 2024-04-21 18:15:17 +03:00
Florin9doi
c268189e38 Don't crash the game if only a LDD controller is present 2024-04-21 12:05:24 +03:00
Megamouse
94431a7a33 Fix include on linux 2024-04-20 19:46:05 +02:00
Megamouse
b4d5b44e00 Don't create perf map files in linux unless enabled 2024-04-20 19:46:05 +02:00
Megamouse
16f006362e Move freopen to console.h 2024-04-20 17:23:10 +03:00
capriots
dfec577417
cellRtc: implement remaining parsers, improve formatters (#15451) 2024-04-20 15:41:42 +02:00
RipleyTom
33e2f8766a Update spurs_test.self 2024-04-20 13:31:12 +02:00
RipleyTom
31a080a9cb Warning cleanup 2024-04-20 13:31:12 +02:00
Megamouse
14e9c8954c cellMusic 2024-04-20 11:55:49 +02:00
Megamouse
dff7352e2e llvm: silence warning: dereferencing type-punned pointer might break strict-aliasing rules [-Wstrict-aliasing] 2024-04-20 01:38:11 +02:00
Megamouse
30bb6c9fb9 cellSysutilAvc2MicRead: Fix some nonsensical nullptr deref warning 2024-04-20 01:38:11 +02:00
Megamouse
7485ec2223 cellKb: fix missing slashes and brackets on japanese layout 2024-04-19 23:47:59 +02:00
Megamouse
60082864a6 cellKb: actually set the arrange member 2024-04-19 23:47:59 +02:00
Megamouse
dcb8f21b2b Use unordered map to store keyboard keys
This potentially reduces latency ever so slightly.
2024-04-19 23:47:59 +02:00
Eladash
b18a97e777 SPU Analyzer: Filter calls to calls 2024-04-19 20:51:37 +03:00
Eladash
c7d93bd470 PPU Analyzer: Look for functions using callers (fallback) 2024-04-19 20:51:37 +03:00
Eladash
7bf8917c08 PPU LLVM: Fix crash in Unity games 2024-04-19 20:51:37 +03:00
Eladash
093198e3d5 savestate_utils.cpp: Fixup a tiny bug 2024-04-19 20:51:37 +03:00
Megamouse
e48bd29584 Qt: try to fix sound effects
Don't re-use sound effect objects.
Allow 3 sounds simultaneously.
2024-04-19 17:29:40 +02:00
Megamouse
1444981bdc overlays/osk: Don't use meta out key code in the osk overlay
The out key code is simply used to store the meta key ID.
It is not meant to be a real key code.
2024-04-19 01:29:22 +02:00
Megamouse
e3f6bbfcc9 fix some warnings and typos 2024-04-19 01:29:22 +02:00
Megamouse
89922b254c cellSysutilAvc2: improve unload and some more stuff 2024-04-18 13:22:45 +02:00
Florin9doi
ea8918291b uDraw emulation [3] 2024-04-18 09:39:02 +02:00
Florin9doi
21445fa01a uDraw emulation [2] 2024-04-18 09:39:02 +02:00
Florin9doi
8d340eecc1 Sort IO files 2024-04-18 09:39:02 +02:00
Florin9doi
463826bf13 uDraw emulation 2024-04-18 09:39:02 +02:00
kd-11
40eda1b972 rsx: Make const explicitly unsigned
- Can silence some GLSL compiler noise in mesa
2024-04-17 22:22:37 +03:00
kd-11
a5c3e303c7 rsx: Improve ROP output rounding precision
- Lower 12 bits seem to be unused based on empirical sampling
2024-04-17 22:22:37 +03:00
Ikko Eltociear Ashimine
270a21ebae Fix typo in System.cpp
Enfore -> Enforce
2024-04-16 17:17:26 +02:00
trigger
6aa96e5f81 Fix OVL patching 2024-04-16 06:15:10 +03:00
kd-11
1792714901 rsx: Fix intra-draw-call barrier queueing
- Ignore latch since we may have another barrier queued. Barriers cost essentially nothing so there is no problem with extra pushes.
- Remove unnecessary use of "else" statements.
2024-04-16 04:38:49 +03:00
Florin9doi
54ab16ab35 Buzz update 2024-04-16 01:46:01 +02:00
Megamouse
c58959eba2 Fix some msvc for loop warning 2024-04-15 19:28:28 +02:00
Megamouse
2f53d58cd9 fix some warnings 2024-04-15 19:28:28 +02:00
Florin9doi
e0d6f8a311 Set a unique System Name 2024-04-15 08:06:21 +03:00
kd-11
e48ec75896 rsx: Fix vertex texture invalidation 2024-04-14 22:37:07 +03:00
kd-11
58d8c65990 rsx: Fix some broken latch checks 2024-04-14 22:37:07 +03:00
kd-11
dd66380132 vk: Always initialize internal objects 2024-04-14 22:37:07 +03:00
Zion
92dd801ecd Attempt at bundling wayland libraries 2024-04-13 20:57:11 +03:00
Eladash
fba1db29b3 Savestates: Fixup 2024-04-13 20:14:49 +03:00
Eladash
1111c1952b SPU: Add debug information when logging analyzer failures 2024-04-13 20:14:49 +03:00
Eladash
7833862342 Add SPU Profiler to GUI 2024-04-13 13:48:00 +03:00
Eladash
78c1a6f326 CPUThread.cpp: Add reservation sampling 2024-04-13 13:48:00 +03:00
Eladash
060ddca1ab SPU: Fixup breakpoints 2024-04-13 13:48:00 +03:00
Eladash
a9fd2f76d2 Savestates: serilialize avc2_settings 2024-04-13 13:48:00 +03:00
Eladash
d1837b54b4 Savestates: Add save stage names 2024-04-13 13:48:00 +03:00
Eladash
26746ac9ee Progress Dialog: Force update every 20 seconds 2024-04-13 13:48:00 +03:00
Eladash
c019b10aa8 savestate_utils.cpp: Fix out-of-range bug 2024-04-13 13:48:00 +03:00
Eladash
0cd316116b Savestates: Make non-existing versions 0 2024-04-13 13:48:00 +03:00
RipleyTom
c92a556093 Default constructor for avc2_settings 2024-04-13 05:40:10 +03:00
kd-11
d6f6752af0 Add missing newline 2024-04-13 03:29:57 +03:00
kd-11
d7e04e9b0a Update CMakelists.txt 2024-04-13 03:29:57 +03:00
kd-11
c1aaa1bcf6 Get reworked RSX to compile 2024-04-13 03:29:57 +03:00
kd-11
10fe14e783 rsx: Separate register context from RSX thread 2024-04-13 03:29:57 +03:00
RipleyTom
0231902a69 fix CellSysutilAvc2InitParam 2024-04-13 01:41:41 +02:00
Megamouse
dbeb8cfbec cellSysutilAvc2Load_shared: simplify max_video_windows check 2024-04-12 23:04:43 +02:00
Megamouse
96bd150518 cellSysutilAvc2Load_shared: re-arrange streaming_mode checks 2024-04-12 23:04:43 +02:00
Megamouse
cb1fb19dea cellSysutilAvc2Load_shared: review fixes 2024-04-12 23:04:43 +02:00
Megamouse
3b37f5b156 cellSysutilAvc2Load_shared: use utils::align for total_bitrate 2024-04-12 23:04:43 +02:00
Megamouse
a989634ba5 cellSysutilAvc2Load_shared: fix compilation 2024-04-12 23:04:43 +02:00
Megamouse
d865186f23 Only send cellSysutilAvc2LoadAsync callback with CELL_SYSUTIL_AVC2_VOICE_CHAT 2024-04-12 23:04:43 +02:00
Megamouse
e63245a6dc Fix callback_func check for CELL_SYSUTIL_AVC2_VIDEO_CHAT
This mode doesn't allow for the callback
2024-04-12 23:04:43 +02:00
Megamouse
682fd15441 move cellSysutilAvc2LoadAsync to cellSysutilAvc2Load 2024-04-12 23:04:43 +02:00
Megamouse
bbd81b9395 cellSysutilAvc2Load: param checks 2024-04-12 23:04:43 +02:00
RipleyTom
cb6186ea60 Initialize CB in cellSysutilAvc2Load 2024-04-12 21:16:11 +03:00
Eladash
12bfc7d56a SPU/Debugger: Use bitset for breakpoints 2024-04-12 17:13:11 +03:00
Eladash
7dc4ccc87d SPU: Use bitset to reduce memory for compiler instance 2024-04-12 17:13:11 +03:00
Eladash
622894a7e3 Logs: output always message level to debuggers 2024-04-12 09:58:30 +03:00
Eladash
965ec8ec81 GUI/CLI: Add setting to attach command line (Win32) 2024-04-12 09:58:30 +03:00
Eladash
103b2fe5fd PPU/reservations: send thread notification only if data changed 2024-04-12 09:58:30 +03:00
Florin9doi
b6bfde6d64 Handle R16G16B16X16_FLOAT
Fix Super Hero Squad
2024-04-12 01:01:14 +03:00
capriots
1ec2752ed2 cellRtc: review + warning fixes 2024-04-11 22:09:00 +02:00
capriots
a5b6b2e9b5 cellRtc: tick conversion improvements 2024-04-11 22:09:00 +02:00
Eladash
f51b100a8c SPU Analyzer: Do not terminate blocks on BRA 2024-04-09 06:26:03 +03:00
Megamouse
412db758e8 cellRtc: review fixes 2024-04-08 13:50:58 +02:00
Megamouse
f617f69be8 cellRtc: remove wrong duplicate pos++
This would have increased pos by one too many.
2024-04-08 13:50:58 +02:00
Megamouse
b81d278aee cellRtc: implement Rfc3339 part of cellRtcParseDateTime 2024-04-08 13:50:58 +02:00
Megamouse
aee4bfa369 cellRtc: simplify some disassembly code 2024-04-08 13:50:58 +02:00
nastys
517f0e1bac
Remove git brew package from macOS CI script (#15407) 2024-04-06 01:47:08 +02:00
Megamouse
08837d2cd0 cellGame: add some more error checks 2024-04-05 23:36:37 +02:00
Megamouse
9a4c823366 cellCamera: fix config from_string 2024-04-05 20:22:45 +02:00
Megamouse
7f3ad4fc2c lv2_socket: reset queue after move 2024-04-05 19:41:41 +02:00
Megamouse
9e7b759236 cellGame: Enable disc insert/eject based on disc mount state 2024-04-05 14:45:10 +02:00
Megamouse
67853b464c Update curl to 8.7.1 2024-04-05 01:51:08 +02:00
Megamouse
51ffd4a377 Update soundtouch to 2.3.3 2024-04-05 01:51:08 +02:00
Megamouse
dada2e85a2 Update SDL to 2.30.2 2024-04-05 01:51:08 +02:00
Megamouse
2a53824b02 Update FAudio to 20.04 2024-04-05 01:51:08 +02:00
Elad Ashkenazi
3dc1dfa4a2
Fix typo in lv2_socket_native 2024-04-04 22:47:01 +02:00
RipleyTom
95e0d1a560 Fix changelog size hack 2024-04-04 22:31:29 +03:00
Eladash
8effbf7e4d Savestates/Network: Feign connection failure on startup 2024-04-04 17:28:46 +03:00
RipleyTom
72ad1abd39 Fix updater message 2024-04-04 07:45:08 +03:00
Eladash
2a89d87fab Savestates/SPU: Fix MFC commands abort 2024-04-03 15:03:39 +03:00
Eladash
33eeee0ff2 SPU Debugger: Implement viewing block hash on request 2024-04-03 15:03:39 +03:00
Eladash
3c46388be5 SPU LLVM: Fix store elimination within common blocks
GPR register barriers were ignored in that case.
2024-04-03 15:03:39 +03:00
Eladash
d37b9497a2 Replace some URLs 2024-04-03 15:03:39 +03:00
Eladash
17512f2a28 Updater: Add RPCS3's Patreon link to update dialog 2024-04-02 21:48:08 +03:00
Eladash
597a9f6dd6 PPU Loader: Fix unload of HLEd PRX modules 2024-04-01 12:20:38 +03:00
Eladash
e90b399329 PPU LLVM: Fix leak of modules outside dev_flash/sys/internal
Cache path was not matching on removal
2024-03-30 21:58:26 +03:00
Eladash
7c8be662c6 SPU LLVM: Postpone runtime worker threads init
They may not be active at all unless a ps3 application is booted.
2024-03-30 21:58:26 +03:00
Eladash
e38b005a8b PPU LLVM: Unify memory limit for PRX and Overlay files 2024-03-30 21:58:26 +03:00
Eladash
f0abb4473e PPU LLVM: Fix memory leak on precompilation 2024-03-30 21:58:26 +03:00
oltolm
d62e90f5b4 use the pass manager instead of the legacy one 2024-03-30 05:06:29 +03:00
Eladash
4ecf8ecd06 Fix savestate reload functionality 2024-03-29 13:25:51 +03:00
Eladash
9a3b72f762 Savestates/SPU: Partially publicize SPU-Compatible functionality 2024-03-29 13:25:51 +03:00
Eladash
7285af4771 SaveStates: Add error messages on screen 2024-03-29 13:25:51 +03:00
kd-11
ec37e8f0dc rsx: Fix loading mid-draw call savestates 2024-03-29 08:15:38 +03:00
Eladash
41f05f6864 LV2: Silence logging of semaphore 2024-03-28 16:24:47 +02:00
Eladash
cc2fa94fa1 PPU: Fix logging of sys_interrupt syscalls 2024-03-28 16:24:47 +02:00
Eladash
2f579311b8 LV2: Silence logging of mutex and cond syscalls 2024-03-28 16:24:47 +02:00
oltolm
ac034040ce workaround Clang 18.1 crash 2024-03-28 08:45:20 +01:00
oltolm
59410b9d62 fix compiler warnings 2024-03-28 08:45:20 +01:00
oltolm
6f665da016 main.cpp: remove outdated code for MSVC 19.27 2024-03-28 08:45:20 +01:00
oltolm
c567c92d4b fix GCC warnings 2024-03-28 08:45:20 +01:00
oltolm
75b2dfa66d cmake: fix MSVC build 2024-03-28 08:45:20 +01:00
oltolm
c40826c140 llvm: update to 18 2024-03-28 08:45:20 +01:00
kd-11
175aa510c8 rsx: Make overlay manager default lock-state exclusive 2024-03-28 08:08:21 +01:00
kd-11
236ac7d062 rsx: Fix race conditions on removals 2024-03-28 08:08:21 +01:00
kd-11
00f1b2bfa7 rsx: Rewrite fragment shader invalidation test 2024-03-28 08:08:21 +01:00
kd-11
a9fad83971 rsx: Fix memory range invalidation 2024-03-28 08:08:21 +01:00
kd-11
1550dc7f1f Fix audit crash in games where hash strategy is heavily used 2024-03-28 08:08:21 +01:00
Megamouse
bbb4c109d7 audio: allow to choose channel layouts 2024-03-28 07:17:26 +01:00
Eladash
a6fa091ab3 Savestates/RSX: Save pending flip 2024-03-27 19:59:22 +02:00
Eladash
6a1fa88e15 PPU: Fixup savestate prio bit usage 2024-03-27 19:59:22 +02:00
Eladash
787e79c687 util\serialization_ext.cpp: Fixup 2024-03-27 19:59:22 +02:00
Eladash
7468d96c51 Savestates: safe saving while cellSaveData is active 2024-03-27 19:59:22 +02:00
Eladash
9c9ece3d95 SPU LLVM: Fix Forwarding GPR stores savestate safety 2024-03-27 19:59:22 +02:00
Eladash
316b3a8851 Thread.cpp: Reduce logging 2024-03-27 19:59:22 +02:00
Eladash
2023057fbb Savestates: Reduce logging 2024-03-27 19:59:22 +02:00
Eladash
94c048d018 SPU LLVM: Add assert for MFC abort 2024-03-27 19:59:22 +02:00
Eladash
e126af63ed Silence cellGemGetState 2024-03-27 19:59:22 +02:00
Eladash
750359d780 Fixup emulation stopping 2024-03-27 19:59:22 +02:00
Eladash
8588b2b11a vm: Fix writer lock leak 2024-03-27 19:59:22 +02:00
kd-11
4594c912a6
rsx: Move SPIRV stuff into common code 2024-03-27 19:20:21 +02:00
Megamouse
afcfd81496 GL: fix segfault in GLGSRender::flip 2024-03-27 16:44:52 +01:00
Megamouse
aa06aaab8e Add Legacy plugin to Building.md 2024-03-27 15:09:57 +01:00
Megamouse
fdca881e34 Remove Windows 7 reference 2024-03-27 15:09:57 +01:00
Megamouse
81de7a5863 Qt 6.6.3 2024-03-27 11:43:55 +01:00
Eladash
efbf044ea0 Savestates/PPU: Fix PRX relocations 2024-03-26 21:35:53 +02:00
Eladash
46a1c09abe Savestates: Minor logging message 2024-03-26 21:35:53 +02:00
Eladash
6a3e795d73 Fix shutting down emulation while save-stating 2024-03-26 21:35:53 +02:00
Eladash
e0f08cd5c1 SPU: Make STOP a safe return instruction 2024-03-26 21:35:53 +02:00
Eladash
a539308545 Savestates: Make locking SPU threads more reasonable
Avoid locking in hopeless cases. Extend waiting time to more than 2 seconds.
2024-03-26 21:35:53 +02:00
Eladash
3364a46139 PPU LLVM: Remove cast to constant 2024-03-26 21:35:53 +02:00
Eladash
fb4e64d15e Savestates/SPU: Extend RCHCNT safe returns 2024-03-26 21:35:53 +02:00
Eladash
68349e48cd Savestates: Save PPU running order 2024-03-26 21:35:53 +02:00
Eladash
4dff8b16f1 Silence logging of cellScreenShot 2024-03-26 21:35:53 +02:00
Megamouse
9245565085 cellAudio: log backend channel count 2024-03-26 16:56:17 +01:00
Megamouse
86ca381a3c Qt: Rename Navigation controller to PS Move Navigation 2024-03-26 16:56:17 +01:00
Megamouse
a7952e15c7 cellPad: simplify for loops 2024-03-26 16:56:17 +01:00
Megamouse
643f81b5db cellPad: move getters to where they are actually needed 2024-03-26 16:56:17 +01:00
Megamouse
cf5a66a204 cellMic: add nullptr check for data in cell_mic_read
Also rename S to Size for readability
2024-03-26 13:50:43 +01:00
Megamouse
e05239f3d9 Fix some warnings 2024-03-26 12:26:26 +01:00
Megamouse
0e73b58abf Update miniupnpd to 2.3.6 2024-03-26 12:26:26 +01:00
Megamouse
59dc5dcd54 Update wolfssl to 5.7.0 2024-03-26 12:26:26 +01:00
Elad Ashkenazi
adedc7c667 Savestates/SPU: Add RCHCNT as a safe return in compatiblity mode 2024-03-25 12:05:24 +02:00
Elad Ashkenazi
29ad568791 Fix ppu_thread::serialize_common 2024-03-25 12:05:24 +02:00
Elad Ashkenazi
453a3c4852 Fixup Savestate Segfault 2024-03-25 12:05:24 +02:00
Elad Ashkenazi
2e824827b7 Fixup Savestate Progress 2024-03-24 20:58:51 +02:00
Eladash
3393d13b67 Reduce compression level to 8 for faster compression 2024-03-24 16:19:06 +02:00
Eladash
1da7689526 util\serialization_ext.cpp: Fix queued data with no output 2024-03-24 16:19:06 +02:00
Eladash
806758d06f Fix NPD files decryption in decryption tool 2024-03-24 16:19:06 +02:00
Eladash
580f9bf03a GUI: Progress Dialog On Save State Creation 2024-03-24 16:19:06 +02:00
Eladash
707a648a4c utils: Fix shared_ptr::store/exchange 2024-03-24 16:19:06 +02:00
Eladash
213a19c9f3 Add logging for CallFromMainThread 2024-03-24 16:19:06 +02:00
Elad.Ash
e32ed90d21
PPU LLVM: Remove one external symbol resolve for BLR 2024-03-21 15:56:31 +02:00
Eladash
2f822abb47 PPU LLVM: Use symbol resolver function to resolve functions 2024-03-20 12:48:31 +02:00
Eladash
1ca83bc629 PPU DisAsm: Fixup conditional indirect branches disasm 2024-03-20 12:48:31 +02:00
RipleyTom
77485747f1 Enable WOLFSSL_ALT_CERT_CHAINS 2024-03-17 05:59:23 +02:00
Eladash
40adf4b944 HLE: clear lower bits of Free Disk Space value 2024-03-14 11:10:45 +01:00
Megamouse
2aad5a7f3a Qt: add search bar to save manager 2024-03-13 18:42:42 +01:00
Megamouse
0f29a5be9f Qt: replace refresh progress slot with timer
For some reason setValue crashes in the progressValueChanged slot for no apparent reason
2024-03-13 00:24:42 +01:00
RipleyTom
397c2698ae Fix sceNpScoreGetRankingByNpId 2024-03-12 09:36:31 +02:00
Megamouse
0f00bb77fe Qt: only connect refresh watcher signals once 2024-03-11 23:04:09 +01:00
Megamouse
a73303a047 Qt: remove redundant progress dialog code. This already happens in Refresh 2024-03-11 23:04:09 +01:00
Ani
0334243a69 appimage: Do not bundle libvulkan.so
Causes issues with gamescope, see 
https://github.com/RPCS3/rpcs3/issues/14917
2024-03-11 21:03:19 +01:00
Megamouse
bb809c865f VS: move libpng, libusb and hidapi lib output to proper build configiguration dir
This allows us to properly build debug and release without having to delete the libs in between
2024-03-11 12:39:39 +01:00
Megamouse
20750c260e VS: Fix libpng build configuration names 2024-03-11 12:39:39 +01:00
Megamouse
37dd1b3ed0 VS: fix linking XAudio in debug builds 2024-03-11 09:02:01 +01:00
Megamouse
f3ac3476cb VS: use MultiThreadedDebugDLL in debug builds
This fixes heap assertions caused by mixing static builds and dynamic Qt
2024-03-11 09:02:01 +01:00
Megamouse
67ae1c9f69 VS: use common RuntimeLibrary settings in 3rdparty 2024-03-11 09:02:01 +01:00
RipleyTom
fd583dbbc3 Cleanup and set -Werror=delete-non-virtual-dtor 2024-03-11 02:30:18 +02:00
Megamouse
d8d0af2bb3 rsx: Fix invalid iterator comparison (asserts on debug builds)
Also make ranged_map::count const
2024-03-11 00:03:00 +01:00
Megamouse
b176085e14 GL: fix debug build: creation of QOffscreenSurface sends signals from wrong thread 2024-03-11 00:03:00 +01:00
Elad.Ash
4cfdb71d3a
LV2: Longer thread creation delay for low prio threads 2024-03-09 23:37:35 +02:00
Megamouse
38590e321e Qt: accept downloader progress dialog instead of closing it
Otherwise we get the canceled signal which is only meant for user interaction
2024-03-09 20:07:37 +01:00
Megamouse
a09900a64f Qt: make sure to actually delete the progress dialog when it is closed
Also add some more cleanup code for the gamelist refresh progress dialog
2024-03-09 20:07:37 +01:00
Megamouse
4a7d982a2b Qt: make sure the gamelist refresh progress dialog runs on the main thread 2024-03-09 20:07:37 +01:00
Megamouse
ee69468104 Qt: replace sstr with regular toStdString 2024-03-09 20:07:37 +01:00
Megamouse
4739ab58cc Qt: fix weird return value warning on VS 2024-03-09 20:07:37 +01:00
Megamouse
be5b982e45 Qt: don't close the progress dialog if it is already being closed anyway
Maybe this fixes some strange crashes that appear for some people.
2024-03-09 15:18:20 +01:00
Megamouse
86ad4ed6c1 Qt: check for updates if the update message is empty
This happens for example if the user canceled the earlier check
after the update was already known, leaving us in a somewhat dirty state.
2024-03-09 15:18:20 +01:00
Megamouse
3056a4db83 Qt: don't deleteLater the progress_dialog
It's already deleted on close by Qt anyway.
Also, remove QObject from curl_handle.
2024-03-09 15:18:20 +01:00
Eladash
adc8a360ad SPU LLVM: More compilation threads 2024-03-08 11:40:38 +02:00
Eladash
719dafa679 SPU LLVM: Notify workers prematurely if there is considerable excess 2024-03-08 07:21:48 +02:00
Eladash
ecf7d4e59d SPU LLVM: Postpone cache writes until compiled 2024-03-08 07:21:48 +02:00
Eladash
45863bc7c5 SPU analyzer: Detect 'argument passing' block before the function 2024-03-07 18:46:51 +02:00
Eladash
ea0545779a SPU: Include BRSL following code in is_exec_code() 2024-03-07 18:46:51 +02:00
Eladash
e625bab7eb SPU Analyzer: Detect more tail calls by examining called code 2024-03-07 18:46:51 +02:00
Eladash
2930d609ea SPU: Detect invalid STOP codes (code mining) 2024-03-07 18:46:51 +02:00
Eladash
069ca214ff SPU: Improve compilation message 2024-03-07 18:46:51 +02:00
Eladash
d699db2d19 SPU Analyser: Detect invalid relative branches 2024-03-07 18:46:51 +02:00
Eladash
8e15de5c83 sys_tty: Try to avoid logging single newlines to log 2024-03-07 14:31:41 +02:00
Eladash
69a90ef9e7 rsx/cpu_thread: Fix cpu_thread::get_name() for RSX 2024-03-07 14:31:41 +02:00
Eladash
d39361705a report_fatal_error: Minor cleanup and improvement 2024-03-06 20:32:22 +02:00
Eladash
4512c10ce5 init_mutex.hpp: More fixes 2024-03-06 20:32:22 +02:00
Megamouse
5e24167d6c Update submodules 2024-03-06 18:58:23 +01:00
Ordinary205
64d28ba435 Increase vblank rate 2024-03-06 18:50:51 +02:00
nastys
7febbdf52b macOS CI: Don't upgrade installed dependents
This should speed up builds, and possibly prevent conflicts.
2024-03-06 17:04:43 +02:00
Eladash
b64b98490e init_mutex.hpp: Fixup 2024-03-06 16:06:04 +02:00
Eladash
f40602cc59 cellGame: Fix PPU deadlocks on concurrent execution 2024-03-06 09:45:37 +02:00
Ani
ef8afa7873 rpcs3_version: Bump to 0.0.31 2024-03-05 00:40:22 +01:00
nastys
df4fc947ec
Improve macOS < 14.3 Rosetta blocker message (#15258) 2024-03-01 20:01:21 +01:00
InvoxiPlayGames
eecfbf3fa6 add Wii Harmonix instruments to whitelist 2024-03-01 19:07:02 +01:00
Elad.Ash
cfbe7669b4 Update serialization.hpp 2024-03-01 14:58:48 +02:00
Elad.Ash
ccaeb87b01 Update serialization.hpp 2024-03-01 14:58:48 +02:00
Elad.Ash
fc98f35ea7 Update serialization.hpp 2024-03-01 14:58:48 +02:00
Elad Ashkenazi
998f867c29 serialization.hpp: Fix HLE serilization 2024-03-01 14:58:48 +02:00
capriots
eb8325afcb
cellPamf implementation (#15143) 2024-02-29 21:45:28 +01:00
RipleyTom
7674c29c78 Fix for sceNpScoreGetGameData 2024-02-29 15:12:22 +02:00
RipleyTom
573734fab8 Send initial presence for offline friends. 2024-02-28 17:41:25 +01:00
Megamouse
2cbd983b4c GL: remove unused params 2024-02-28 14:25:20 +01:00
Megamouse
18983f5476 Fix warnings: Remove unused decryption code 2024-02-28 14:25:20 +01:00
Elad.Ash
75ef154c12
SPU LLVM: Improve runtime SPU compilation preferences (#15250) 2024-02-28 08:28:49 +02:00
RipleyTom
414a354511 Improve cellSysutilAvc2SetAttribute logging 2024-02-28 02:14:37 +01:00
RipleyTom
2168511e5b Add check for score transactions being reused 2024-02-28 02:14:37 +01:00
Mrlinkwii
f64d6bc687 Misc: Update FW Latest Version 2024-02-27 12:52:53 +01:00
oltolm
3e83729cb2 xaudio2: use system library instead of xaudio2redist 2024-02-27 05:21:32 +02:00
kd-11
83256cdacb Make clang happy 2024-02-26 18:15:06 +03:00
kd-11
f748fe688c gl: Allow selecting FSR1 upscaling from the settings 2024-02-26 18:15:06 +03:00
kd-11
188f5c7c3c gl: FSR1 cleanup, making it functional 2024-02-26 18:15:06 +03:00
kd-11
838346e4f7 gl: Always log the current renderer visibly. 2024-02-26 18:15:06 +03:00
kd-11
12dc03a903 rsx: Improve simple array performance for small objects
- Also adds map/collect transformation
2024-02-26 18:15:06 +03:00
kd-11
e17c2f2397 gl: Fix compilation 2024-02-26 18:15:06 +03:00
kd-11
071baf63b0 rsx: Implement FSR1 integration for OpenGL 2024-02-26 18:15:06 +03:00
kd-11
1795d5bcc9 gl: Rework the upscalers a bit and define the FSR interface 2024-02-26 18:15:06 +03:00
kd-11
27125c6f72 gl: Remove upscaling 'dst' binding and clean up some awful code in GLPresent 2024-02-26 18:15:06 +03:00
kd-11
12694dcf69 gl: Introduce the concept of scaling passes to the backend 2024-02-26 18:15:06 +03:00
kd-11
e7d8ef924f rsx/vk: Refactor FSR integration to support multiple backends 2024-02-26 18:15:06 +03:00
RipleyTom
0f682b7da1 Fix Apple Clang build 2024-02-24 20:54:55 +02:00
nastys
2b385f28f0
Block Rosetta on macOS 14.0, 14.1, and 14.2 (#15237) 2024-02-24 15:15:19 +01:00
RipleyTom
ac8e914a25
improves sig_ctx handling, sys_net logging and fixes udpp2p protocol (#15235) 2024-02-24 12:40:53 +01:00
Megamouse
3067c86d65 gui/input: only init and quit SDL once for all instances
Calling SDL_Quit while two handlers are active can cause controllers to disconnect
2024-02-22 19:31:00 +01:00
Megamouse
96afc15fa2 gui/input; fix log message delta type 2024-02-22 19:31:00 +01:00
Megamouse
66f694bb39 gui/input: include Carbon.h on apple 2024-02-22 19:31:00 +01:00
Megamouse
06025cd19d gui/input: let pad handlers know whether they are part of emulation
Also fix unique_ptr vs shared_ptr nonsense in pad_threads
2024-02-22 19:31:00 +01:00
Megamouse
fc698a4df2 gui/input: implement pad navigation for maxOs 2024-02-22 19:31:00 +01:00
Megamouse
2cd47c0415 gui/input: use uinput for linux in gui_pad_thread 2024-02-22 19:31:00 +01:00
Megamouse
b032f2dd87 gui/input: add gui input with native events 2024-02-22 19:31:00 +01:00
RipleyTom
3acd442c2e sceNpBasicSendMessage fix 2024-02-22 05:33:29 +02:00
Megamouse
6b43e5c80e Qt: add Q_OBJECT macro to midi_creator
This fixes the localization of its strings
2024-02-20 10:06:02 +01:00
Megamouse
183380fe57 Qt: localize default pad names 2024-02-20 10:06:02 +01:00
kd-11
7abc5f3ead vk: Move driver properties to properties section from features section 2024-02-16 18:11:30 +03:00
Megamouse
1867f9aa1f Qt 6.6.2 2024-02-16 11:29:38 +01:00
Eladash
f47c7e0ef1 PPU LLVM: Relax MSELF entry name constraints
These names are a hint
2024-02-16 10:42:57 +02:00
Eladash
36ab866c2c SPU Analyzer: forgive invalid code, use interpreter 2024-02-16 10:42:57 +02:00
Eladash
f943deb2c3 PPU LLVM: Do not use possible duplicates in MSELF 2024-02-16 10:42:57 +02:00
Eladash
27ea25a999 Add debug info to ENOMEMs 2024-02-16 10:42:57 +02:00
Eladash
989b353fbd Fixup lv2_file::file_view::read() regression 2024-02-16 10:42:57 +02:00
Eladash
c1607d14dc Add debug info to sys_fs_lseek 2024-02-16 10:42:57 +02:00
Eladash
85884d14cd PPU LLVM: Add more MSELF file checks
Do not crash on invalid files.
2024-02-16 10:42:57 +02:00
Eladash
08cf275bc8 Fix lv2_file::file_view::size() 2024-02-16 10:42:57 +02:00
Eladash
88ba3c47c2 ELF.h: Avoid using seek operations 2024-02-16 10:42:57 +02:00
Eladash
4aee44b1c0 sys_prx/overlay: Add some debugging steps 2024-02-16 10:42:57 +02:00
Megamouse
e3d4c067df raw_mouse: adjust relative mouse position if the window size changed 2024-02-14 21:10:26 +01:00
kd-11
dfc626c99c rsx/vk: Fix WCB/Blit flush deadlock 2024-02-14 21:09:02 +03:00
kd-11
8786516c58 vk: Implement fast RSX release if there is no pending GPU work 2024-02-14 21:09:02 +03:00
Eladash
34e945128f Crypto\EDATA: Optimize decrypt_block to avoid an allocation 2024-02-14 15:11:52 +02:00
Eladash
7db6165b46 Fix lv2_file::file_view::read_at 2024-02-14 15:11:52 +02:00
Eladash
883f2e92ae EDATA: Add more logging 2024-02-14 15:11:52 +02:00
Eladash
3e8b003515 Add logging for cellFsSdataOpenByFd 2024-02-14 15:11:52 +02:00
Eladash
ed66e9e9b9 Fix EDATADecrypter::ReadData 2024-02-14 15:11:52 +02:00
Eladash
f87e11d16a Savestates/sys_fs: Save NPDRM decryption key 2024-02-14 15:11:52 +02:00
RipleyTom
5a64556fbf Add <optional> to RB3MidiDrums.h 2024-02-14 14:14:09 +02:00
Megamouse
d71f4b33d7 raw_mouse: center cursors on init 2024-02-14 01:13:44 +01:00
Megamouse
c91bc03532 sys_usbd: silence warning 2024-02-14 01:13:44 +01:00
Megamouse
348fab33a8 overlays: fix raw mouse debug overlay pos type 2024-02-14 01:13:44 +01:00
Megamouse
68f3df4975 input: implement raw_mouse_handler 2024-02-14 01:13:44 +01:00
Megamouse
f6f8996aa9 overlays: use signed short for position to allow negative positions 2024-02-14 00:12:55 +01:00
nswarm
8533f962c6
Add limited support for midi drums w/ rockband 3 (#15054)
* add support for midi drums
* rb3drums: use dpad to disambiguate cymbal/drum hits instead of staggering.
* rb3drums: configurable min velocity and hihat up behavior
* rb3drums: configurable combos, combo duration, note overrides
* rb3drums: move config to separate file.
* rb3drums: apply stagger to double cymbal hits
* rb3drums: support midi CC note mapping
* rb3drums: add config to cmakelists. only load rb3drums config once.
* rb3drums: HihatWithPedalUp defaults to yellow cymbal instead of blue
2024-02-13 23:08:22 +01:00
RipleyTom
af33c0c69f Revert FM(a*re_accurate) shortcut to relaxed 2024-02-13 20:08:03 +02:00
RipleyTom
50b1402d66 Fixes full fm(a, re_accurate) pattern 2024-02-13 11:37:20 +02:00
RipleyTom
cfd5c62386 Improve re_accurate 2024-02-13 11:37:20 +02:00
RipleyTom
569f72c360 Disable updates for local build 2024-02-12 19:02:52 +01:00
kd-11
df74d49f72 vk: Silence compiler warning 2024-02-12 12:28:16 +03:00
xujibbs
eac31dfd03 Update skylander_dialog.cpp
Make strings translatable
2024-02-12 09:54:07 +02:00
Megamouse
0b1a7ee346 overlays: localize sendmessage confirmation 2024-02-12 00:04:46 +01:00
Eladash
77ba2b40e7 Thread.cpp: Explicitly state difference type in thread_ctrl::wait_for_accurate 2024-02-11 23:01:40 +02:00
Eladash
94239f5526 Fixup HW thread switch delay condition for performance 2024-02-11 23:01:40 +02:00
Elad.Ash
148edc005a Improve cpu_flag::yield handling 2024-02-11 20:09:01 +02:00
Elad Ashkenazi
ec59f4d37e PPU/LV2: Implement HW threads switching delay when signaling higher priority threads
In real PS3 (it seems), when a thread with a higher priority than the caller is signaled and that there is available space on the running queue for the other hardware thread to start It prioritizes signaled thread caller's hardware thread switches instantly to the new thread code while signaling to the other hardware thread to execute the caller's code.
Resulting in a delay to the caller after such thread is signaled
2024-02-11 20:09:01 +02:00
kd-11
2c03878c3b vk: Don't panic on encountering the exotic mesa drivers 2024-02-11 17:21:56 +03:00
kd-11
c8c845a659 vk: Emit a strong warning if dozen is detected as the currently loaded driver.
- In most cases, the user does not intend to actually use dozen and has installed a compatibility pack by mistake.
2024-02-11 17:21:56 +03:00
kd-11
a54f1970f1 vk: Make more features "optional"
- This allows some non-conformant drivers to at least finish swapchain creation.
2024-02-11 17:21:56 +03:00
kd-11
7f602937a3 vk: Improve driver detection for dozen and lavapipe 2024-02-11 17:21:56 +03:00
kd-11
c2631c914d rsx: Lower some performance warnings to trace to reduce log spam 2024-02-11 14:24:33 +01:00
kd-11
c17014a055 Buildfiles improvements 2024-02-11 14:24:33 +01:00
kd-11
c572226b0d Stop including x86 intrinsics in other architectures 2024-02-11 14:24:33 +01:00
kd-11
6718b0683e Don't include x64 options when building arm64 2024-02-11 14:24:33 +01:00
RipleyTom
3735df4f53 Update CMake requirements in BUILDING.md 2024-02-11 10:09:24 +02:00
kd-11
4746ef09cd Fix linux build 2024-02-10 15:15:02 +03:00
kd-11
ed93bbd16d vk: Improve compute->compute barrier before detiling 2024-02-10 15:15:02 +03:00
kd-11
041daab068 vk: Tighten some memory bounds checks 2024-02-10 15:15:02 +03:00
kd-11
e5c831a800 rsx/vk: Fix GPU tile encoding
- Decoding also needs some love, but currently WIP
2024-02-10 15:15:02 +03:00
kd-11
b8ed3eb824 rsx: Fix cpu detiler 2024-02-10 15:15:02 +03:00
kd-11
95f9f04612 rsx: Provide tile alignment utility (align to 64 * pitch blocks) 2024-02-10 15:15:02 +03:00
kd-11
823c72bf27 rsx/vk: Redefine the (de)tiler config interface 2024-02-10 15:15:02 +03:00
RipleyTom
9b387485b5 Avoid modifying any memory on SYS_NET_EINTR cases 2024-02-09 18:07:18 +02:00
RipleyTom
56e27bdd49 Restrict file creation in /dev_hdd0 2024-02-09 16:13:46 +02:00
Elad.Ash
30e8c3e951
SPU LLVM: Allow swapped FMA and multiplications args in match context 2024-02-07 13:45:29 +02:00
Megamouse
96b7e4c67f Update libpng to 1.6.42 2024-02-06 22:13:22 +01:00
RipleyTom
65d93c97ea Add various SPU patterns 2024-02-06 22:08:44 +02:00
RipleyTom
a92b8acba7 Accurate FI 2024-02-06 22:08:44 +02:00
Megamouse
85f4c38b4e Update submodules
- Updates SDL to 2.30.0
- Updates curl to 8.6.0
- Updates libusb to 1.0.27
- Updates zlib to 1.3.1
- Updates FAudio to 24.02
2024-02-05 23:47:38 +01:00
Eladash
40c51a1f05 Crypto/unedat.cpp: remove extract_all_data 2024-02-05 21:56:04 +02:00
Eladash
a6c2e995af Crypto/PKG installer: Fix potential RAM shortage when extracing EDAT files 2024-02-05 21:56:04 +02:00
Eladash
596e671973 Crypto/sys_fs: Fix potential RAM shortage in NPDRM decryption
Previous code was structured very naively: if 8GB read is requested, it would allocate 8GB of memory. Without considering recycling memory for each block.
2024-02-05 21:56:04 +02:00
Eladash
d38b2eb8ef Crypto/sys_fs: Remove some seek operations 2024-02-05 21:56:04 +02:00
RipleyTom
bb9444e19a Add sceNpPlus to registered modules 2024-02-05 15:28:38 +01:00
RipleyTom
26d406fec3 RPCN 1.1 2024-02-05 09:44:29 +01:00
Megamouse
dda0b8af45 cellGem: Allow to use multiple controllers as fake PS-Move
- Allows to use the last 4 ports/players as PS Move in fake mode
- Should in theory react to re/disconnected controllers
- Should allow to use player 1-3 as normal controller simultaneously
2024-02-03 21:47:40 +01:00
Megamouse
d5ce4e0f6b sceNp: fix atomic type 2024-02-03 17:59:19 +01:00
Megamouse
e5cfe710fa sceNp: correct type for data attachment 2024-02-03 17:59:19 +01:00
Megamouse
2a0e2ce0a2 sceNp: don't preserve messages in sceNpBasicRecvMessageAttachment 2024-02-03 17:59:19 +01:00
Megamouse
ef56433684 overlays: ask for user confirmation before sending an invite
This shows subject and body as well
2024-02-03 17:59:19 +01:00
Megamouse
8bc3a39586 sceNp: implement sceNpBasicAbortGui 2024-02-03 17:59:19 +01:00
Megamouse
e13a671f86 sceNp: Implement sceNpBasicRecvMessageAttachment 2024-02-03 17:59:19 +01:00
Megamouse
48f82c75c1 np: fix signed/unsigned warning
who the heck thought returning signed on a counter makes sense...
2024-02-03 17:59:19 +01:00
Megamouse
a5955657c5 overlays: add subject and body to recvmessage dialog 2024-02-03 09:45:55 +01:00
RipleyTom
319657e815 Review fixes 2024-02-03 08:45:29 +01:00
RipleyTom
c589001dff Add player history 2024-02-03 08:45:29 +01:00
Megamouse
c04cd2228e Qt: Show NP ID in rpcn dialogs 2024-02-02 19:05:56 +01:00
Megamouse
cba51b4a5e rsx/glsl: use const for left/right 2024-02-02 10:07:23 +01:00
kd-11
8962ddca01 rsx/glsl: Fix typo 2024-02-02 10:07:23 +01:00
kd-11
1808a4373b rsx: Improvements to the video out passes
- Use shared VS for vulkan as well as GL
- Simplify binding model and give control back to the cpp side
2024-02-02 10:07:23 +01:00
kd-11
bb22afb7f1 gl: Vectorize GL_TEMP_IMAGE_SLOT expression 2024-02-02 10:07:23 +01:00
kd-11
ce571cb6ca vk: Allow indexed lookup for sampler and IA binding points in overlay passes 2024-02-02 10:07:23 +01:00
Megamouse
ac9afbfede glsl: use fragCoord to decide interlacing 2024-02-02 10:07:23 +01:00
Megamouse
4e8130bd99 glsl: use textureSize instead of height 2024-02-02 10:07:23 +01:00
Megamouse
00c9321b1d glsl: use const in for params 2024-02-02 10:07:23 +01:00
Megamouse
8e8b582747 glsl: move anaglpyh to separate functions 2024-02-02 10:07:23 +01:00
Megamouse
6f2e843193 vk/gl: add amber-blue anaglyph (ColorCode 3D) 2024-02-02 10:07:23 +01:00
Megamouse
7d9460a560 vk/gl: cleanup formatting in glsl, move some common magic numbers to variables 2024-02-02 10:07:23 +01:00
Megamouse
32f2b14429 vk/gl: add interlaced 3D mode 2024-02-02 10:07:23 +01:00
Megamouse
651f8512eb vk/gl: add more anaglyph 3D modes 2024-02-02 10:07:23 +01:00
Megamouse
3dac7d16e7 vk/gl: unite video_out_calibration_pass fragment shader to new glsl 2024-02-02 10:07:23 +01:00
Megamouse
240f80b467 gl: add missing else in calibration pass fragment shader 2024-02-02 10:07:23 +01:00
Megamouse
17b5a36b59 Add update_helper.sh to VS filters 2024-02-02 10:07:23 +01:00
Megamouse
ea326a5f29 overlays: clean up includes 2024-01-31 16:33:29 +01:00
Megamouse
c271415328 sceNp: decrease some log levels from todo to warning 2024-01-31 16:33:29 +01:00
Megamouse
f28c7d029c overlays: use timestamp for fade animations
Fixes jojo when using sceNp dialogs
2024-01-31 16:33:29 +01:00
Megamouse
d7f317fa58 Add UI to sceNpBasicSendMessageAttachment and sceNpBasicAddFriend 2024-01-31 16:33:29 +01:00
Megamouse
3f2c34edd2 sceNp: silence some errors 2024-01-31 16:33:29 +01:00
Megamouse
566a8ac5ac scnNp: add ppu wait before opening blocking dialogs 2024-01-31 16:33:29 +01:00
Megamouse
71b5bc4fe6 sceNp: add more error checks 2024-01-31 16:33:29 +01:00
Megamouse
a427783bac overlays: remove separators from send/recv dialogs 2024-01-31 16:33:29 +01:00
Megamouse
23dc6a44f6 overlays: implement native sendmessage dialog 2024-01-31 16:33:29 +01:00
Megamouse
9ef5a01de4 overlays: implement native recvmessage dialog 2024-01-31 16:33:29 +01:00
Megamouse
cdfe3ee7c8 Name some threads 2024-01-31 16:33:29 +01:00
kd-11
c3c73c7e24 rsx: Allow native UI render even when we have pending draw calls if FIFO queue is empty. 2024-01-30 16:36:58 +03:00
RipleyTom
af8d308a69 Terminate RPCN connection cleanly 2024-01-29 13:01:09 +01:00
Florin9doi
a7da245656 Don't search games when the dialog is cancelled 2024-01-28 13:18:35 +01:00
RipleyTom
e9713f9635 Fix sceNpCommerce2 init 2024-01-28 10:52:26 +01:00
Megamouse
3dbde04d18 sceNpCommerce: add init checks 2024-01-27 08:31:16 +01:00
Megamouse
1611588682 sceNpCommerce2: add some error checks 2024-01-27 08:31:16 +01:00
RipleyTom
93c72822a3 Fix Apple clang 2024-01-26 17:59:53 +01:00
RipleyTom
6f5bcf12c6 Arm version of trigger_write_page_fault 2024-01-26 09:32:15 +02:00
RipleyTom
07dba02897 FreeBSD workaround for libusb 2024-01-26 02:51:41 +01:00
RipleyTom
db685879af Return no file to TSS apis 2024-01-26 02:51:41 +01:00
RipleyTom
94e8d6fe13 Mini sceNpCommerce2Init fix 2024-01-25 22:53:21 +01:00
Megamouse
0d1fbfb755 VFS: Fix some potential .back() segfaults 2024-01-25 17:03:58 +01:00
Megamouse
10c52cf569 sys_usbd: add libusb log callback 2024-01-25 17:03:58 +01:00
RipleyTom
7661df0847 Enable Discord presence on Linux 2024-01-25 09:49:17 +01:00
pastalian
e8ad6ec673
Add missing headers (#15075)
Some systems must explicitly include these headers.
2024-01-24 17:22:37 +01:00
Steveice10
3ef48cbdd5 rpcs3qt: Add macOS support to the updater. 2024-01-24 09:44:56 +01:00
Megamouse
5fe36872c5 System: don't consider games as registered if they were already in games.yml
Also, show message if nothing was added
2024-01-24 08:18:57 +01:00
RipleyTom
d33955c290 Asmjit FI 2024-01-23 12:24:38 +02:00
RipleyTom
606a60e901 Accurate frest and frsqest 2024-01-23 12:24:38 +02:00
Megamouse
93f5154429 Qt: trim whitespace from textinput before writing to config 2024-01-22 22:25:06 +01:00
Megamouse
a6e046c6c3 update submodules 2024-01-22 22:25:06 +01:00
kd-11
8eae8cb86c rsx: Do not emit rounding code when not needed 2024-01-21 12:30:37 +03:00
kd-11
abe5013f1d rsx: Fix compiling of mixed-precision shaders 2024-01-21 12:30:37 +03:00
kd-11
ca7de4bcb1 rsx: Aesthetic changes 2024-01-21 12:30:37 +03:00
kd-11
9a9b5860df rsx: Forcefully disable writes to channels disabled on host
- Some formats may have dummy channels on host. Never write to them!
- This means that XRGB formats correctly only write 24 bits, not 32.
2024-01-21 12:30:37 +03:00
kd-11
0971636c07 rsx: More pipeine refactoring 2024-01-21 12:30:37 +03:00
Megamouse
50fcec63e0 fs: fix get_executable_dir 2024-01-21 00:11:16 +01:00
Megamouse
8a87dc63b1 Emu: Add more info to BlockingCallFromMainThread 2024-01-21 00:11:16 +01:00
Megamouse
efea3aa385 Qt: revert accidental settings_dialog check-in 2024-01-20 21:59:02 +01:00
Megamouse
86bab5b7c3 cellImeJp: fix character deletion after change to cursor 2024-01-20 21:59:02 +01:00
Megamouse
675ed82c0b cellImeJp: fix deadlock 2024-01-20 21:59:02 +01:00
Megamouse
58dd0198dd cellImeJp: add candidate list functions 2024-01-20 21:59:02 +01:00
Megamouse
16f833a516 cellImeJp: add cursor 2024-01-20 21:59:02 +01:00
Megamouse
0392830950 cellImeJp: fix focus area 2024-01-20 21:59:02 +01:00
Megamouse
04efc6b4a4 cellImeJp: static functions to silence annoying VS 2024-01-20 21:59:02 +01:00
Megamouse
8edd7d54cf fs: fix warning. fix size argument in report_fatal_error 2024-01-20 21:59:02 +01:00
Eladash
f19744ae88 Savestates: Fix restart when suspend mode is off
Add a new menu button for explicit exit (mostly for debug purposes)
2024-01-20 22:15:07 +02:00
Eladash
01ee119c59 Savestates: Dont patch memory on load 2024-01-20 22:15:07 +02:00
Eladash
4cd60aca22 Savestates: Add some logging for sys_overlay 2024-01-20 22:15:07 +02:00
Eladash
81ba791ee7 Simplify fatal dialog's error a bit 2024-01-20 22:15:07 +02:00
Eladash
c7a94a80df Savestates/net: fix P2P socket data saving 2024-01-20 22:15:07 +02:00
Eladash
c509226bab Firmware installer: Early protection against disk space shortage complications 2024-01-20 22:15:07 +02:00
Eladash
312b35051d sys_fs: Aggregate safe file reads (optimization) 2024-01-20 22:15:07 +02:00
Eladash
e401d85af7 progress dialog: minor fix 2024-01-20 22:15:07 +02:00
Eladash
e4c9af176b fixup hdd1 cache 2024-01-20 22:15:07 +02:00
Steveice10
9c354ee269
Utilities: Add support for portable user directory. (#15064) 2024-01-20 10:04:25 +02:00
kd-11
96d880839a rsx: Properly propagate surface properties on surface reuse. 2024-01-19 12:34:31 +03:00
Megamouse
e23db7efbd Mac: Update MoltenVk to 1.2.7
Remove deprecated extension VK_MVK_moltenvk
2024-01-16 22:52:57 +01:00
Megamouse
fd540f1820 Mac: silence deprecation warning 2024-01-16 22:52:57 +01:00
RipleyTom
7d55a85fa6 Replaces page fault triggers with assembly 2024-01-16 12:04:47 +02:00
Megamouse
fa7ef870dd sceNp: disable Canonicalize functions for RPCN 2024-01-14 22:55:03 +01:00
Megamouse
ecacb874e4 sceNpCommerce: more error checks 2024-01-14 22:55:03 +01:00
Megamouse
0b2e0a1b28 sceNpCommerce: add error constants 2024-01-14 22:55:03 +01:00
Megamouse
a08d60fbbe sceNpFriendlist: more checks 2024-01-14 22:55:03 +01:00
Megamouse
ef6041c14f sceNpMatching: simplify linked list for loops 2024-01-14 22:55:03 +01:00
Megamouse
25954758d7 sceNpMatching: add error checks 2024-01-14 22:55:03 +01:00
oltolm
0ae1578dce split JIT.cpp and SPURecompiler.cpp 2024-01-14 17:21:39 +01:00
oltolm
2039b85be3 prepare split 2024-01-14 17:21:39 +01:00
oltolm
8eae73dd02 add comments where to split 2024-01-14 17:21:39 +01:00
RipleyTom
fe9a24a1b8
RPCN 1.0 (#15045) 2024-01-14 12:36:23 +01:00
Megamouse
3d974eed03 fs: move buf from stack to heap to silence VS warning 2024-01-14 06:40:35 +01:00
Megamouse
329b58c8cd fs: remove duplicate to_utf8 function 2024-01-14 06:40:35 +01:00
Megamouse
2d82e3ef9a Qt: use fs::get_temp_dir during updates
GetTempPathW was falsely using size in bytes instead of string length.
2024-01-14 06:40:35 +01:00
Megamouse
faaf644331 Qt/input: show all mmjoy devices with connection in dropdown
This fixes weird issues with disconnected pads while also showing the status.
2024-01-14 02:50:45 +01:00
Megamouse
d7aedb439e Qt/Input: Keep configured device name in config when no pad is connected 2024-01-14 02:50:45 +01:00
Megamouse
9c11840e40 input: implement dynamic mmjoy device reconnection 2024-01-14 02:50:45 +01:00
RipleyTom
4c36b80300 Misc NP fixes 2024-01-13 15:44:28 +01:00
Megamouse
f7fa5aab70 media_utils: fix segfault when stopping a recording 2024-01-12 19:53:20 +01:00
Megamouse
17aeefe1b0 cellFont: some stubs 2024-01-11 22:35:00 +01:00
Eladash
825ae5b8aa Ensure HDD1 is never damaged or corrupted due to unexpected RPCS3/game termination 2024-01-11 20:24:53 +02:00
Megamouse
3513f6d83c cellMouse: silence some log spam 2024-01-10 22:34:13 +01:00
Megamouse
4ad4badcfe audio_decoder: fix more memleaks and dangling files 2024-01-10 22:34:13 +01:00
Megamouse
b67837c0ef cellMusicDecode: fix random pop at the end of a stream
Observed in SSX, which seems to ignore the readSize sometimes
2024-01-10 22:34:13 +01:00
Megamouse
b5f3f910f6 cellSearch: fix vfs music and video paths 2024-01-10 22:34:13 +01:00
Megamouse
b0a7448394 get_media_info: improve logging 2024-01-10 22:34:13 +01:00
Megamouse
bed7763a3b audio_decoder: ignore first invalid data error 2024-01-10 22:34:13 +01:00
Megamouse
572c075a4b audio_decoder: improve logging 2024-01-10 22:34:13 +01:00
Megamouse
bad7756af2 audio_decoder: properly free packets 2024-01-10 22:34:13 +01:00
Megamouse
45c89030ac audio_decoder: check for failed av_packet_alloc 2024-01-10 22:34:13 +01:00
Megamouse
7aad4f4253 overlays: decrease log level 2024-01-10 22:34:13 +01:00
Megamouse
9e9385a877 cellVideoExport: export movies to /video/ instead of /movie 2024-01-10 22:34:13 +01:00
Megamouse
431d69ac87 Windows: remove QtCore5Compat dependency 2024-01-10 22:34:13 +01:00
Megamouse
3be24f1e6f Update FAudio to 24.01 2024-01-10 22:34:13 +01:00
Megamouse
c45deb3f87 sdl: log version 2024-01-10 22:34:13 +01:00
brian218
213674511e sys_ss: Corrected sys_ss_update_manager(0x6011) version data format 2024-01-10 12:37:11 +01:00
brian218
6548e3f7d0 sys_fs: Improved get_device_root() path identifying security 2024-01-10 12:37:11 +01:00
brian218
a269ae7e30 sys_fs: Prevented duplicate device mounting 2024-01-10 12:37:11 +01:00
brian218
862295d9f3 sys_fs: Fixed sys_fs_unlink()'s failing to delete files in dev_usbXXX
sys_fs: Fixed get_mp() up for dev_usbXXX
2024-01-10 12:37:11 +01:00
RipleyTom
61e130e68c Honk if you knew memset(nullptr, 0, 0) was UB 2024-01-09 23:06:23 +01:00
RipleyTom
236e32fb3d Fix weird cmp in np_handler.cpp 2024-01-09 23:06:23 +01:00
RipleyTom
067ea68979 Fix games passing invalid npids 2024-01-09 23:06:23 +01:00
Megamouse
7504503d5f sceNp: don't return error if assignedReqId is null 2024-01-09 02:58:00 +01:00
Megamouse
108d0d49ec sceNp: add missing roomPassword check 2024-01-09 02:58:00 +01:00
Megamouse
2c424a0911 sceNp: add missing withPassword check 2024-01-09 02:58:00 +01:00
Megamouse
ffe1b287a8 sceNp: add missing check for roomSlotInfo 2024-01-09 02:58:00 +01:00
RipleyTom
485fca34b0 Misc NP fixes 2024-01-08 14:03:15 +01:00
RipleyTom
0b984e9a23 Add -Werror=implicit-fallthrough to cmake build 2024-01-07 17:29:43 +01:00
RipleyTom
74e084c893 Improve sceNpEula 2024-01-07 14:50:45 +01:00
RipleyTom
47ae192cf8 Impl sceNpBasicSendMessage 2024-01-07 13:36:27 +01:00
RipleyTom
80b7fd5f3f Check room event callback has been set before calling it 2024-01-05 22:34:52 +01:00
RipleyTom
0227b16d06 Fix sceNpBasicSetPresence when data is nullptr and size is 0 2024-01-05 22:34:52 +01:00
kd-11
2a1af17f67 vk: Force GPU texture processing if the input is already GPU-resident (Tiled RCB read) 2024-01-05 16:29:53 +03:00
RipleyTom
b6e9746198
RPCN 0.9 (#15002) 2024-01-05 09:43:26 +01:00
kd-11
bc141831f7 gl: Implement display output format correction 2024-01-04 13:03:32 +03:00
kd-11
acd3fd0c3e vk: Implement display output format correction 2024-01-04 13:03:32 +03:00
kd-11
2369266b8a rsx: Add an option to force hardware MSAA resolve 2024-01-03 19:32:45 +03:00
Ani
e707ff530d rpcs3_version: Bump to 0.0.30 2024-01-02 20:27:18 +00:00
Megamouse
9fe640b187 whitespace and format 2024-01-02 16:46:31 +01:00
Megamouse
750aa163c5 cellSearch: mount paths in /dev_hdd0/.tmp/ instead of /,tmp/ 2024-01-02 16:46:31 +01:00
Megamouse
018b1da2b9 cellSearch: fix mounting of files
Turns out you have to tell vfs::mount whether it's a file or directory.
2024-01-02 16:46:31 +01:00
Eladash
170e268199 Improve Emulator::GetBdvdDir
* Optimize to perform string validation before executing a filesystem check.
* Fix a bug when there is a roaming PS3_DISC.SFB file somewhere in upper directories. (main_dir_name was changed incorrectly)
* Add verbose logging in Emulator::IsValidSfb.
2024-01-02 15:56:06 +02:00
Eladash
5755a94cc1 Savestates: Experimental pads fix 2024-01-02 15:56:06 +02:00
Eladash
4f06024d9f Fix report_fatal_error duplicate messages 2024-01-02 15:56:06 +02:00
Eladash
2a1330083d Fix PPU progress dialog hint 2024-01-02 15:56:06 +02:00
Megamouse
d03393ffe9 sys: fix games.yml hdd paths 2024-01-02 10:18:23 +01:00
RipleyTom
d6dde225bd Warn on use of privileged port on Linux 2024-01-01 21:23:31 +01:00
kd-11
6c33c38c08 rsx: Fix RSX tiling when using optimized DMA views 2024-01-01 19:44:47 +03:00
nastys
4068423c48
macOS CI: downgrade ffmpeg (#14987) 2024-01-01 15:11:25 +00:00
Eladash
195e7e185a cellPad LDD fixup 2024-01-01 15:04:39 +02:00
Eladash
87140ab4cc Qt: Add build version, title, emulation state and date to fatal error dialog 2024-01-01 11:58:00 +02:00
Eladash
9aff2d5ee1 cellPad: Fix LDD pads registration 2024-01-01 11:58:00 +02:00
Eladash
858e493b52 Savestates/vm: Improve saving performance 2024-01-01 11:58:00 +02:00
Eladash
f0c93ae9dc sys_spu: Fix warning and theoretical bug 2024-01-01 11:58:00 +02:00
Eladash
9455bfe6c2 Savestates: Fix g_fxo->init for types which use a pointer 2024-01-01 11:58:00 +02:00
Eladash
467790c8d8 PPUTranslator: Try to fix a regression 2024-01-01 11:58:00 +02:00
Eladash
c2076373e8 Utilities\BitField.h: Try to fix some warnings
Cleanup and make bitfield extraction u32 if possible
2024-01-01 11:58:00 +02:00
Eladash
a4ab6126b0 Add more debug info in serial_breathe_and_tag() 2024-01-01 11:58:00 +02:00
Eladash
ce5f7bd4ff Savestates: Rename DeferDeserialization, add some asserts 2024-01-01 11:58:00 +02:00
Eladash
f5d39ef7f2 Fix a corner case in lv2_timer_thread abort 2024-01-01 11:58:00 +02:00
Eladash
89b8be98d6 Simplify lv2_timer_thread management 2024-01-01 11:58:00 +02:00
Eladash
87fc5e4923 Move initialize_timebased_time call to a safer spot 2024-01-01 11:58:00 +02:00
Eladash
e6f1e598a9 Fix pad_state_notify_state_change 2024-01-01 11:58:00 +02:00
Eladash
2398e753bf Savestates/cellPad: Save old controller state 2024-01-01 11:58:00 +02:00
Eladash
847b721558 Compression: Fix infinite loop
Always keep expanding the buffer even if avail_in is 0
2024-01-01 11:58:00 +02:00
Eladash
b00fe1d12f Compression: Improve async compression performance 2024-01-01 11:58:00 +02:00
Eladash
6214d0c9a5 Savestates/TAR: Fix huge files handling in TAR serialization 2024-01-01 11:58:00 +02:00
Eladash
4a8beb8588 SPU LLVM: Minor fixup 2024-01-01 11:58:00 +02:00
nastys
feca7412d2 Update deploy-mac.sh - libjxl_cms.0.9.dylib 2023-12-31 21:16:00 +02:00
Elad Ashkenazi
dfb163546b
HOTFIX for atomic wait 2023-12-30 22:33:57 +01:00
Megamouse
f45cbdd0f7 fixes 2023-12-30 21:14:26 +01:00
Megamouse
7a02787bee fix some more warnings 2023-12-30 21:14:26 +01:00
Megamouse
3059570404 Update wolfssl to v5.6.6 2023-12-30 19:53:51 +01:00
Megamouse
b501953d41 rsx: remove unused param 2023-12-30 19:07:35 +01:00
Megamouse
c5836e3525 fix more warnings 2023-12-30 19:07:35 +01:00
Megamouse
59c58aa3cf fix some warnings 2023-12-30 19:07:35 +01:00
Megamouse
b1c48e66c9 sceNp: fix size_t data types 2023-12-30 19:07:35 +01:00
kd-11
d4796c46b1 rsx: Fix detiler shader compilation 2023-12-30 12:35:23 +01:00
kd-11
2b9bfc0ec2 rsx: Pick tiler/detiler according to actual block size 2023-12-30 12:35:23 +01:00
kd-11
188eefeeac rsx: Avoid out of bounds write for tiled memory 2023-12-30 12:35:23 +01:00
Alexander Wilms
22d43c25b2 Metainfo: Update number of compatible games 2023-12-30 11:41:52 +01:00
Alexander Wilms
a7ae1c3b9c Metainfo: Add German translations and more URLs 2023-12-30 11:41:52 +01:00
Alexander Wilms
42cf8b0bc4 Metainfo: Sort tags with jdAppStreamEdit 2023-12-30 11:41:52 +01:00
Alexander Wilms
42348d6b43 Fix display_length tag and add screenshot caption 2023-12-30 11:41:52 +01:00
Megamouse
2c6f11fc1c msvc/debug: set mainCRTStartup as entry point 2023-12-30 04:51:40 +01:00
Megamouse
f0c2f9235e msvc/debug: remove outdated qtmaind.lib dependency 2023-12-30 04:51:40 +01:00
Megamouse
3a73f8f84f msvc/debug: Pass c++ standard to Qt 2023-12-30 04:51:40 +01:00
Tha_14
8e911101b7
Docs: Add clarifications regarding Visual Studio 2019 version requirements. 2023-12-30 03:23:19 +01:00
RipleyTom
a96f9d9bfb Fix sceNpManagerGetNetworkTime called before rpcn connection 2023-12-30 02:00:21 +01:00
RipleyTom
03761c5dd4 rpcn 0.8 2023-12-29 19:22:49 +01:00
Megamouse
d3298c422b sys/cellGame: Fix hdd game dir name
Some games are installed with other dir names than title_id
2023-12-29 18:10:00 +01:00
Megamouse
b0c1684ff3 Qt/input: separate num keys from other keys 2023-12-29 16:33:41 +01:00
Eladash
9f6c5381a1 SPU/Savestates: Remove reservation hack, allow its saving 2023-12-29 11:11:53 +02:00
Eladash
e209dc1229 Savestates: Save build version and creation time 2023-12-29 11:11:53 +02:00
Eladash
9df40a9b69 Suggest using SPU Savestates-Compatible Mode on failure to save 2023-12-29 11:11:53 +02:00
Eladash
bd687b41d3 SPU LLVM: Fix savestates with LLVM
Sneaky bug: allow invalidation from blocks that do not contain a store but do a gpr-state critical operation.
2023-12-29 11:11:53 +02:00
Eladash
526aaf7302 Fix idm::allocate_id at fixed position 2023-12-29 11:11:53 +02:00
Eladash
72ed2f1d43 Invalidate savestates 2023-12-29 11:11:53 +02:00
Eladash
e14cc69441 Savestates/vm: rewrite memory saving for better compression 2023-12-29 11:11:53 +02:00
Eladash
d78bbbf69a Savestates: Fix audio_out_configuration initialization 2023-12-29 11:11:53 +02:00
Eladash
f696107c90 Add savestate data validity asserts 2023-12-29 11:11:53 +02:00
kd-11
475191cf7f rsx: Fix typo 2023-12-27 21:25:46 +01:00
kd-11
69a463ad02 rsx: Support DMA tiling in the CPU blit path 2023-12-26 18:30:00 +03:00
kd-11
51fc193395 rsx: De-spaghettify nv3089::image_in
- This function was a disaster with random code added in without much thought over a decade.
- Restructures the logic into decode and transfer steps for easier management.
2023-12-26 18:30:00 +03:00
Megamouse
45c865ede8 Use asmjit main repo 2023-12-25 14:29:59 +01:00
Megamouse
3f5a80d692 Typemap: Set init to false after each individual destructor 2023-12-25 11:14:11 +02:00
RipleyTom
69238bfc23 Remove destructor dependencies on nph 2023-12-24 15:16:56 +02:00
kd-11
6a7fb4c10c Do not include profiling headers 2023-12-23 14:24:34 +02:00
RipleyTom
732d9b83ba Fix nph and nt interderp 2023-12-22 14:34:48 +01:00
Megamouse
50214a6a07 Qt: use default colors for native styles 2023-12-22 10:03:56 +01:00
Megamouse
bc9f0fe56c Qt: use initial style as default style 2023-12-22 01:20:14 +01:00
Eladash
40604f6076 Fixup np_handler ctor 2023-12-21 16:12:50 +02:00
Megamouse
b17b6e07ea Fix warning 2023-12-20 23:33:43 +01:00
Megamouse
3f2c75d920 overlays: move debug overlay to native overlay 2023-12-20 23:33:43 +01:00
Megamouse
d08c7a9b96 sceNpDrm: improve error handling of rap files 2023-12-20 22:22:51 +01:00
Eladash
8591529aad Fix sys_fs_fcntl default_sys_fs_container use 2023-12-20 19:58:21 +02:00
Eladash
33d46172a6 Game Settings: Add an option to create game config using default settings
Fix a potential crash on creating global config.
2023-12-20 18:27:47 +02:00
RipleyTom
dbd1f27862 Replace condition_variable with atomic_t 2023-12-20 15:28:47 +02:00
Megamouse
2eae0a9d3a Qt: allow to use native styles 2023-12-20 12:53:21 +01:00
Megamouse
8b6fa32d12 Do not allow running RPCS3 from Rar directories 2023-12-19 22:18:57 +01:00
Eladash
90b6f5613e Fix some warnings 2023-12-19 15:34:07 +02:00
Eladash
d1527710f9 Fix HLE sys_lwcond_signal_to 2023-12-19 15:34:07 +02:00
Eladash
657af10361 Savestates: Fix pair serialization 2023-12-19 15:34:07 +02:00
Eladash
7e853abc4b Fix tcp_timeout_monitor abort 2023-12-19 15:34:07 +02:00
Eladash
9f0cb9148f vm.h: Cleanup and fix some warnings 2023-12-19 15:34:07 +02:00
Eladash
edf74313ef Remove some fxo->need calls 2023-12-19 15:34:07 +02:00
Elad Ashkenazi
14c92efd38 Util/fixed_typemap.hpp: Fix thread-safety issue with init
Now safe as long as no- object is created
2023-12-19 15:34:07 +02:00
Eladash
2190419b83 Util/fixed_typemap.hpp: set unitialiazed data to trap values 2023-12-19 15:34:07 +02:00
Eladash
0c410f8a14 Postpone thread launching on g_fxo->init 2023-12-19 15:34:07 +02:00
Megamouse
a4bcba8971 Fix some warnings 2023-12-19 00:50:57 +01:00
Megamouse
24dbec71f8 Update asmjit 2023-12-19 00:50:57 +01:00
Megamouse
763744268d update_manager: replace deprecated LookToRead2_Init nonsense with regular c++ default initializer 2023-12-19 00:50:57 +01:00
Megamouse
00a80adfae Update 7z to 23.01 2023-12-19 00:50:57 +01:00
kd-11
98b7642232 rsx: Avoid data loss in blit engine when WCB/WDB + RCB/RDB is active 2023-12-18 17:08:33 +03:00
brian218
19d1e4dcc9 sys_usbd: Fix up sys_usbd_get_descriptor() error handling according to hardware test
usb_device_emulated: Allow partial copy of desscriptors
2023-12-17 19:38:40 +02:00
brian218
d18f929faf sys_usbd: Prevent sys_usbd_get_descriptor() from buffer overflow
sys_usbd: Add some more arguments to sys_usbd_attach()'s logging for better debugging
2023-12-16 16:24:55 +02:00
brian218
04ef8b8de5 Correct the link of glslanglibs_mt.7z in BUILDING.md according to #14870 2023-12-16 16:24:55 +02:00
Megamouse
f8e0c9e27a Start/Stop IPC when changing the config setting 2023-12-15 18:08:07 +01:00
Megamouse
907e0fa8c8 Fix fxo dependencies 2023-12-15 18:08:07 +01:00
Megamouse
47fcb9562f Trophy Manager: allow to lock/unlock trophies 2023-12-15 00:31:49 +01:00
RipleyTom
cee6d03033 Fix initialization order for network_thread 2023-12-14 19:34:14 +01:00
Megamouse
57cc7037f6 input/evdev: handle flatness deadzone value
This may fix issues with sticky axis on evdev.
Also refactors some redundant axis scaling functions.
2023-12-14 15:51:11 +01:00
Megamouse
7c9a38e0f3 rsxaudio: fix ensure order 2023-12-14 15:51:11 +01:00
Megamouse
f594f485a4 Update soundtouch to 2.3.2
Also adds an extra fix for time stretching:
Fix receiveSamples buffer advance if maxSamples is bigger than samplesInBuffer
2023-12-14 01:55:30 +01:00
RipleyTom
f709a5747a Force sending a FIN packet on rpcn disconnect 2023-12-13 12:42:38 +02:00
Eladash
75494066ea Qt: Cleanup game-install assistant pull request
Use paths instead of IDs,  disable typemap.
2023-12-12 21:23:33 +02:00
Eladash
60baa49007 sceNp/vm: Fix strings read, implement safe string reader 2023-12-12 21:23:33 +02:00
Megamouse
8ebb7b4952 windows/glslang: remove build dir after clean 2023-12-12 01:23:05 +01:00
kd-11
bbea303fbc build/ci: Fix glslang build on msvc 2023-12-12 01:23:05 +01:00
kd-11
83eb07959d build/ci: Pick latest glslang from rpcs3 glslang fork 2023-12-12 01:23:05 +01:00
Megamouse
e830b3cffe Update Vulkan SDK to 1.3.268.0 2023-12-12 01:23:05 +01:00
Megamouse
15cd05cdfb curl: use native CA store instead of deploying cacert.pem 2023-12-12 01:23:05 +01:00
Megamouse
a9eebe3b71 Update curl to 8.5.0 2023-12-12 01:23:05 +01:00
Megamouse
fa4a90f905 Update FAudio to 23.12 2023-12-12 01:23:05 +01:00
nastys
96e5a2909d
macOS CI: use 7-Zip for artifacts (#14881) 2023-12-11 19:21:06 +01:00
Eladash
a6839e823e Qt: Post Game-Installation Assistant 2023-12-11 07:47:52 +02:00
oltolm
cb4a688e02 asm.hpp: fix usage of _mm_prefetch 2023-12-11 06:26:40 +02:00
kd-11
ab6bcd32a9 rsx: Improve strict mode check in 308a::color
- The chances that someone is using strict mode is lower than the odds of having default ZCULL
2023-12-09 22:34:02 +03:00
kd-11
67f97b0e15 rsx: Let 308a::color have a synchronization side-effect in strict mode
- Some games use 308a::color to implement custom sync primitives (ETQW).
- When the color data is written, the engine assumes all occlusion reports are ready which can cause severe flickering if we don't flush the pipeline.
2023-12-09 22:34:02 +03:00
Zion Nimchuk
f824be6b7b Mac CI: Install python before updating 2023-12-07 01:36:25 +01:00
Elad Ashkenazi
fbeaa1c487 Savestates: Fix compressed serialization handler deadlock 2023-12-05 12:34:52 +02:00
Megamouse
57ee3c6a6d cellRec: Remove outdated frame size check
We are rescaling the images to the desired output format in the encoder.
The frames themselves are not a fixed container anymore.
2023-12-05 08:37:34 +01:00
Megamouse
a4011376e0 Qt: only allow double leftclick in screenshot manager 2023-12-05 08:37:34 +01:00
Eladash
69ef9c8a6a PPU/sys_dbg: Implement self-modifying code 2023-12-03 12:57:21 +02:00
Megamouse
8ef844ca53 Qt: Remove default "Unknown" in GameInfo struct
There is no need to initialize these anymore.
The game list already uses its own fallback string constants if needed.
2023-12-03 01:05:28 +01:00
Megamouse
a97bad97ae Qt: Properly use ICON1.PAM from game data dir if available
Fixes hover movie for disc games that have game data installed.
2023-12-03 01:05:28 +01:00
Megamouse
c245637c38 Qt: force hover event handling for flow widget items
Fixes hover movies for stylesheets that didn't have a game grid item style set for the hover state.
2023-11-30 22:10:32 +01:00
Megamouse
4a4f537ee8 recording: Implement audio recording for rsx audio 2023-11-30 09:55:36 +01:00
Megamouse
44585b98cc audio: fix time stretching regression 2023-11-30 00:34:32 +01:00
Megamouse
4520f7646f recording: use scoped_lock 2023-11-30 00:34:32 +01:00
Megamouse
bebac4773a cellRec: only access global video provider if necessary
We do not necessarily use the video provider object in cellRec...
2023-11-30 00:34:32 +01:00
Megamouse
9e76e14a79 recording: optimize access to video recorder
Use separate locks for audio and video
Fix audio mutex usage in cellRec.
Removes can_consume_sample, since we don't do any processing
between can_consume_sample and present_samples.
Use get_system_time for consistency.
Move pts reset to set_video_sink.
Make start time atomic.
Remove frame and sample counts.
Use m_active to early out to reduce mutex locks.
Do not try to present samples if the recording mode is stopped anyway.
2023-11-30 00:34:32 +01:00
Megamouse
826cdbb507 Qt 6.6.1 2023-11-29 22:44:57 +01:00
Megamouse
4dfda3240c Qt: implement hover pam in game list 2023-11-29 20:11:45 +01:00
Megamouse
aae155e954 Qt: use vector for camera video sink buffer 2023-11-29 20:11:45 +01:00
oltolm
fdcb481f07 fix Clang warnings 2023-11-29 19:02:34 +01:00
kd-11
1c78584f41 rsx: Remove unnecessary "else" clauses 2023-11-29 19:52:16 +03:00
kd-11
685b3ee41b rsx: Code quality and readability improvements 2023-11-29 19:52:16 +03:00
Eladash
b674e332fc SPU: Fixup SPU Cache progress in first game boot 2023-11-29 10:51:32 +02:00
Megamouse
57324f1703 Qt: notify progress dialog cancelation when closing the game window 2023-11-29 00:46:20 +01:00
Megamouse
ac869ec855 Qt: fix random segfaults when canceling batch operations
It occasionally happened that the progress_dialog object was deleted before we reached the end of the function.
2023-11-29 00:46:20 +01:00
Eladash
b774ba9888 serialization.hpp: Fix some warning 2023-11-28 21:18:18 +02:00
Eladash
54a6f2f51b SPU LLVM: Do not wait for Progress Dialog to clear before starting 2023-11-28 21:18:18 +02:00
Eladash
d449420a45 PPU Progress Dialog: Add "Applying PPU Code" stage 2023-11-28 21:18:18 +02:00
nastys
bafac95266
macOS CI: link ffmpeg after building it from source (#14843) 2023-11-28 18:56:39 +01:00
Eladash
3bd27d5695 TAR: Improve logging 2023-11-28 16:46:44 +02:00
Eladash
0416f6361c Fix file_view::read_at and file_view::get_stat 2023-11-28 16:46:44 +02:00
Eladash
9abf0b7176 Savestates: Asynchronous compression 2023-11-28 16:46:44 +02:00
Eladash
aaf776ddc9 Fixup Firmware install 2023-11-28 16:46:44 +02:00
Eladash
79465334fe Savestates: Add basic statistics in log 2023-11-28 16:46:44 +02:00
Eladash
f8ca5cdf56 vm: Minor optimization for memory serialization 2023-11-28 16:46:44 +02:00
Eladash
ac19a50f5f Rewrite global zipping buffer function
Take advantage of the new method, remove a method that is not recommended for use.
2023-11-28 16:46:44 +02:00
Zion Nimchuk
8e31f7fb07 Explicitly add qtsvg to freebsd 2023-11-27 23:07:21 +01:00
Eladash
fdb2fecd45 Savestates: Add errored state for compressed stream 2023-11-27 12:36:17 +02:00
Eladash
a0b521ba8e Savestates: Add TAR and VM assert 2023-11-27 12:36:17 +02:00
Eladash
5dbeb68ed2 Savestates: Fix optional_savestate_state use 2023-11-27 12:36:17 +02:00
Eladash
c7c2baae03 Savestates: Implement 'autostart off' mode for debugging 2023-11-27 12:36:17 +02:00
Eladash
f60bdbaece Savestates: Compressed state files 2023-11-27 12:36:17 +02:00
Darkhost1999
91dbd92193 Change PPU/SPU Cache
Enable minimizing the LLVM batch creation window and keep modal permissions
2023-11-25 03:20:57 +01:00
Megamouse
099ec16403 Qt: add trophy count column to trophy manager game list 2023-11-25 01:47:32 +01:00
Megamouse
23316d4e1e cellRec: fix pausing and resuming 2023-11-23 21:19:31 +01:00
Megamouse
966def13c5 cellRec: fix downmix 2023-11-23 21:19:31 +01:00
Megamouse
0899723510 recording: add h264/aac, better logging of output formats 2023-11-23 21:19:31 +01:00
Megamouse
434a63a98a recording: rename audio_sample to audio_frame 2023-11-23 21:19:31 +01:00
Megamouse
d27d021913 recording: fix subsequent recordings, reset sample counter to 0 2023-11-23 21:19:31 +01:00
Megamouse
a84c261ff3 cellRec: fix member reset between recordings 2023-11-23 21:19:31 +01:00
Megamouse
ff434f9d38 recording: cleanup audio config members
and fix some annyoing msvc warnings
2023-11-23 21:19:31 +01:00
Megamouse
49f910a56b recording: improve pts accuracy and consistency
Also clean up some logging
2023-11-23 21:19:31 +01:00
Megamouse
90846013c2 cellRec: fix internal video frame ringbuffer pts 2023-11-23 21:19:31 +01:00
Megamouse
b2d9da0b4b recording: Fix flush. We want to clear the whole queue... 2023-11-23 21:19:31 +01:00
Megamouse
3cec3b866d cellRec: implement audio mixing 2023-11-23 21:19:31 +01:00
Megamouse
6ba204a259 recording: decrease log spam 2023-11-23 21:19:31 +01:00
Megamouse
51d0df97d3 cellRec: implement audio encoding (no mixing yet) 2023-11-23 21:19:31 +01:00
Megamouse
4c14290694 cellRec: Don't present frames/samples if external audio/video is used 2023-11-23 21:19:31 +01:00
Megamouse
5fa77b04ea recording: remove unused duration member variable 2023-11-23 21:19:31 +01:00
Megamouse
dbbf318e1c recording: fix warning 2023-11-23 21:19:31 +01:00
Megamouse
9e3763e6e5 recording: use av_interleaved_write_frame 2023-11-23 21:19:31 +01:00
Megamouse
42cd7df813 recording: fix default sample rate 2023-11-23 21:19:31 +01:00
Megamouse
64529cefa5 cellRec: use constant for block samples 2023-11-23 21:19:31 +01:00
Megamouse
70c35642a4 recording: initial audio recording 2023-11-23 21:19:31 +01:00
kd-11
ebf48800e6 rsx: Always enable ROP output rounding if shader precision is higher than low
- Hardware behavior is inconsistent so let's just emulate this when possible
2023-11-21 13:49:16 +03:00
kd-11
673660d362 gl: Fix static sampler bindings
- VS states come before FS mirrors
2023-11-21 13:49:16 +03:00
kd-11
ab8a12e211 rsx: Fix vertex input validation failure
- We switched from a allocate-per-draw-call to reusing the vertex input data. We need to make sure previous state does not affect validation results.
- Memcpy is too slow at this level of frequency, so just reset the attributes you're using before using them.
- Also changes the validation routine to only check attributes we're actually using.
2023-11-15 20:15:03 +03:00
oltolm
8c0debfe65
Fix file_view::read_at 2023-11-10 18:40:17 +02:00
Megamouse
71f497947e Don't close moved file 2023-11-10 12:58:38 +02:00
Megamouse
06bdaf1fb1 rsx: fix reading zipped captures 2023-11-10 12:58:38 +02:00
Megamouse
840455b872 rsx: zip and unzip rsx captures 2023-11-10 09:05:16 +01:00
Eladash
66d01b688c Savestates: Implement initial RAM ventilation system 2023-11-10 08:45:49 +02:00
Eladash
2db607c716 Replace some fmt::format with fmt::append 2023-11-10 08:45:49 +02:00
kd-11
c41130080d rsx/vp: Emit more efficient code
- Applies more aggressive DCE in the analyser. Dead-code in tails could happen before in some cases.
2023-11-09 21:05:54 +03:00
kd-11
85cefec5a3 rsx: Fix vertex program analyser bug 2023-11-09 21:05:54 +03:00
Megamouse
1b1756de22 Update dependencies
- Update FAudio to 23.11
- Update SDL to 2.28.5
- Update wolfssl to 5.6.4
2023-11-08 19:37:47 +01:00
Megamouse
648bf25557 Midi: improve error handling 2023-11-08 17:10:57 +01:00
Zion Nimchuk
e8a3ac592d Switch official AppImage deployment to clang 2023-11-08 05:47:25 +01:00
Darkhost1999
151738a4cb Fix Firmware tree checkboxes
Make it look like the rest of the file to communicate with the user correctly
2023-11-07 13:24:36 +01:00
Megamouse
e26d4e1762 sys_net: fix some warnings
move some data to heap
2023-10-31 15:11:43 +02:00
oltolm
b7fe35a2af fix Clang compilation warnings 2023-10-26 09:29:32 +03:00
Megamouse
3c93509471 fix deprecation warning 2023-10-25 21:44:31 +02:00
Megamouse
f11c1613bd fix unused parameter warning 2023-10-25 21:44:31 +02:00
Megamouse
ecfa77f6e7 unzip: check deflateInit and inflateInit results 2023-10-25 21:44:31 +02:00
Megamouse
132bb6db29 Update moltenvk comment 2023-10-25 21:44:31 +02:00
shinra-electric
f40168e614 Add MVK 1.2.6 to the Mac build script 2023-10-25 20:22:25 +02:00
shinra-electric
7b7cb959f9 Bump MVK to 1.2.6 2023-10-25 20:22:25 +02:00
kd-11
dfa83314df vk: Add chip detection for INTEL DG2 cards
- No specific optimizations yet, but they're becoming more popular so that may be necessary soon.
2023-10-25 20:06:04 +03:00
kd-11
867153c5ea vk: Drop obsolete ANV workaround 2023-10-25 20:06:04 +03:00
kd-11
0612b52881 rsx: Add note explaining padding behavior in linear-swizzle conversion fallback code. 2023-10-25 20:06:04 +03:00
Megamouse
a4d8091625 Reduce log level for missing gamecontrollerdb.txt to warning 2023-10-25 07:13:12 +02:00
Megamouse
aa9f364dc6 cellPhotoImport: better log channel name for string search in logs 2023-10-25 07:13:12 +02:00
Megamouse
7cb4521082 overlays/media_list_dialog: Fix path logging 2023-10-25 07:13:12 +02:00
Megamouse
07da8d5e36 cellPhotoDecodeFromFile: allow decoding files inside dev_hdd1 2023-10-25 07:13:12 +02:00
Eladash
f9d213650c Utilities/Thread.cpp: Fix threads memory leak 2023-10-24 22:14:12 +03:00
Eladash
eb407e3b5c SPU/MFC: Add block has to command history 2023-10-24 22:14:12 +03:00
brian218
23cb67e0a1 [Bugfix] USIO: Fixed switch-kind buttons got released when game window lost focus 2023-10-21 02:24:16 +02:00
Megamouse
b3864f2d10 cellSaveData: Fix SAVEDATA_OP_LIST_DELETE
- The savedata parameter checks were missing conditions for SAVEDATA_OP_LIST_DELETE (and the unimplemented import/export functions)
- This caused the 'delete savedata' menu entry in Bonk's Adventure to be inaccessible since we always returned an error no matter the arguments.
- Additionally, the game uses an asterisk as prefix to load the savedata list, which is actually a valid thing to do based on the disassembly for this exact function (and maybe others?). I only report the savedata for the current title ID for now though, since I fear I'll accidentally delete some other savedata.
2023-10-16 21:19:44 +02:00
Elad Ashkenazi
927685fd63 VFS: fix rename 2023-10-16 14:47:50 +03:00
RipleyTom
0448b8e3ae Disables jack being forcibly linked by rtmidi 2023-10-15 06:18:43 +02:00
Megamouse
8ff95a71dd Update curl
Update curl to 8.4.0 (I forgot this in the last commit)
2023-10-14 19:26:44 +02:00
Megamouse
ec916d1f5f Update dependencies
Update Qt to 6.6.0
Update yaml-cpp to 0.8.0 (support for more data types, cmake changes)
Update FAudio to 23.10 (now defaults to WASAPI on Win10+)
Update pugixml 1.14 (better error handling)
Update SDL to 2.28.4 (third-party DualSense fix)
2023-10-14 15:40:05 +02:00
Johnny Doe
e3613e7dc1 Add --parents to mkdir to avoid error if directory exists 2023-10-13 15:19:11 +02:00
oltolm
50df01d00e llvm: add support for LLVM 17 2023-10-13 14:27:48 +02:00
Megamouse
7bb94227be Qt: allow to use zipped logs in config checker 2023-10-13 09:30:42 +02:00
Megamouse
76629e1b52 Qt: Allow to use .gz files in Log viewer
Log viewer can open .gz files
Log viewer can save log as .gz
Refactored most instances of zip and unzip code to seperate functions
2023-10-13 07:45:16 +02:00
kd-11
e95cff0bde rsx: Detiler improvements
- Detile on blit src read
- Improve blit engine integration
2023-10-12 15:25:47 +03:00
Elad Ashkenazi
9dca70ec9e PPU Loader: Fix relocation offset verification
Kernel aligns segment memory to 256 bytes internally.
2023-10-12 13:53:30 +03:00
nastys
75d239356a
macOS CI: force install Python 3.11 2023-10-10 00:16:48 +02:00
Megamouse
982e09a486 Qt: Remember last game window position and visibility
- Remembers the last game window geometry and tries to apply it on boot
- Remembers the last minimized/maximized/windowed/fullscreen state and tries to apply it on boot
- All existing game window settings keep priority
- Should work with multi-monitor setups as well
- Ignored if the user forced a different screen with cli commands
2023-10-09 11:20:21 +02:00
oltolm
8bd05871d0 CMake: fix curl build 2023-10-07 08:33:35 +02:00
Zion Nimchuk
2f99fda88e Update Docker to 6.5.3 2023-10-06 23:41:41 +02:00
Megamouse
2a0fa53c0d GL: check QOpenGlContext::create result 2023-10-06 08:42:26 +02:00
Megamouse
f7d8993a1f Qt 6.5.3 2023-10-06 08:42:26 +02:00
Megamouse
9fce70809e Input: Fix "," key in keyboard pad handler 2023-10-06 03:12:16 +02:00
Megamouse
830b1a8a8d CMAKE: try to fix curl 2023-10-06 01:58:43 +02:00
Eladash
d335d356ca IdManager.h: Savestate fix part 2 2023-10-05 05:07:46 +03:00
Eladash
b2e969eb8f Savestates: Fix rsxaudio 2023-10-05 05:07:46 +03:00
Eladash
6db8b84048 Improve savestate version mismatch message 2023-10-05 05:07:46 +03:00
Eladash
0240a7d43d sys_fs: Savestate fixup 2023-10-05 05:07:46 +03:00
nastys
f88443afa3 macOS CI: set build timeout to 180 minutes 2023-10-03 22:07:25 +03:00
Eladash
c3f1d39563 Improve vfs::host::rename 2023-10-03 15:50:46 +03:00
Eladash
ce3d7f90fd VFS: Fix recursive locking 2023-10-03 05:32:39 +03:00
Eladash
4b827a8d9c sys_fs: Optimize concurrent file reads 2023-10-02 21:18:08 +03:00
Eladash
f07e17f6aa sceNp: Cut inactive time of DrmIsAvailable in half 2023-10-02 21:18:08 +03:00
Eladash
257b0f0d69 Improve lv2_file::file_view::read 2023-10-02 15:38:58 +03:00
Eladash
dd518fcafb Savestates/sys_fs: Fix file saving 2023-10-02 15:38:58 +03:00
Eladash
020bff1485 Savestates: add sys_rsxaudio 2023-10-02 15:38:58 +03:00
Eladash
96d31cf64e IdManager.h: Savestate fix 2023-10-02 15:38:58 +03:00
oltolm
f35ca71454 cmake: fix libcurl compilation 2023-10-02 09:47:49 +03:00
Malcolm Jestadt
d1bea790f3 SPU LLVM: Optimize GB/GBH/GBB with a GFNI path
- Abuses GFNI to extract bits from bytes, from 5->2 instructions in most cases
2023-10-01 23:05:28 +03:00
Megamouse
0140925e65 Update curl to 8.3.0 2023-10-01 13:52:32 +03:00
Eladash
5baec6cb58 Add Savestate-Compatible mode 2023-10-01 12:00:41 +03:00
Eladash
948ee96f1a SPU LLVM: Fix savestates 2023-10-01 12:00:41 +03:00
Eladash
099c74481d Savestates: Optimize SPU pausing 2023-10-01 12:00:41 +03:00
kd-11
2381e33236 Add config to the UI 2023-09-27 14:52:59 +03:00
kd-11
09476fa6e5 Add the tiling toggle to core 2023-09-27 14:52:59 +03:00
kd-11
061c10ea69 vk: Fix memory initialization order in RCB/RDB path 2023-09-27 14:52:59 +03:00
kd-11
cb21fefbd9 rsx: Fix bpp when working with DMA-only (null) memory sections 2023-09-27 14:52:59 +03:00
kd-11
c1c3be8b4e rsx: Skip CPU optimization if writing to tiled region 2023-09-27 14:52:59 +03:00
kd-11
41ff76a6af msvc: Tabs to spaces 2023-09-27 14:52:59 +03:00
kd-11
a95e87d14d rsx::io_buffer cleanup 2023-09-27 14:52:59 +03:00
kd-11
725bad0963 vk: Revert more debugging code 2023-09-27 14:52:59 +03:00
kd-11
e31859a5ed vk: Remove debug visualization code 2023-09-27 14:52:59 +03:00
kd-11
ab99400f9d vk: Restore CPU fallback on the upload path 2023-09-27 14:52:59 +03:00
kd-11
603e549c85 Fix msvc filters 2023-09-27 14:52:59 +03:00
kd-11
1e09bfca09 Fix linux build 2023-09-27 14:52:59 +03:00
kd-11
59812b947a vk: Load DMA before decode operation 2023-09-27 14:52:59 +03:00
kd-11
ca054644ef rsx/vk: Support ingesting pre-processed GPU data as texture input 2023-09-27 14:52:59 +03:00
kd-11
bef7d793d3 rsx: Make the texture source an io-buffer 2023-09-27 14:52:59 +03:00
kd-11
ffc61e01f7 rsx/vk: Support mismatched pitch (padded) and fix the overscan problem 2023-09-27 14:52:59 +03:00
kd-11
647f7ddeec rsx/vk: Initial hw-accelerated tile decoder 2023-09-27 14:52:59 +03:00
kd-11
6a7386ddb8 rsx: Refactor out more junk from rsx::thread 2023-09-27 14:52:59 +03:00
kd-11
3afc379746 rsx: Import, rebase and clean up the old detiling patches from 2021 2023-09-27 14:52:59 +03:00
nastys
5b46db5e6b
macOS CI: reinstall jpeg-xl and other dependencies from source (#14673)
* macOS CI: uninstall jpeg-xl before building it from source
* macOS CI: disable 7z artifact
2023-09-26 17:08:36 +02:00
Eladash
6908d20128 Debugger/PPU: Add Go-To from function pointer 2023-09-26 11:06:01 +03:00
Eladash
6dc9e9659d Debugger/Logs: Allow to display thread from thread ID on log 2023-09-26 11:06:01 +03:00
Eladash
e79fc867c5 Patches: Add savable breakpoints patch type 2023-09-26 11:06:01 +03:00
Darkhost1999
b2c6958750
Add restart option to home menu 2023-09-25 17:59:57 +03:00
Malcolm Jestadt
05b6108c66 SPU LLVM: Optimize remaining rotate instructions which take a twos compliment value as input
ROTQMBYBI looks for -7 for it's twos compliment construction
2023-09-23 08:00:09 +03:00
Megamouse
a70f278117 Add Azure Build Status back to Readme.md 2023-09-23 00:02:48 +02:00
Megamouse
ae786a016d Remove unused variable 2023-09-23 00:02:48 +02:00
Eladash
8e4945ab28 Avoid log spam of CPU usage when Emu is paused 2023-09-22 10:03:51 +03:00
Eladash
167528d70f GUI: Add Patreon Link Button
For continued improvements of RPCS3, please become a part of our Patreon support group!
2023-09-22 10:03:51 +03:00
Eladash
ecb45ef6df Welcome Dialog: Add ability to set Dark Theme 2023-09-22 10:03:51 +03:00
Eladash
1e1d6f6437 PPU Analyzer: Fixup 2023-09-22 10:03:51 +03:00
Eladash
99c2d37b8c gitignore: Add sublime projects 2023-09-22 10:03:51 +03:00
kd-11
fe1bc18ac9 vk: Fix section merge calculations when using a temp resource 2023-09-21 19:52:15 +03:00
Zion Nimchuk
3c70573be0 Mac build on Azure 2023-09-21 08:41:44 +02:00
Megamouse
cf20526f9f cellMic: Improve cellMicGetDeviceAttr 2023-09-21 07:52:00 +02:00
Megamouse
f398f1113d Microphone enumeration: warn user if ALC_ENUMERATION_EXT is missing. 2023-09-12 20:55:55 +02:00
Megamouse
2a32ded575 Update OpenAl from 1.20.1 to 1.23.1 2023-09-12 20:55:55 +02:00
Megamouse
a74f037a49 FFmpeg: rebase to improve artifact creation 2023-09-12 20:13:19 +02:00
Eladash
c7c81ed95d PPU: Limit concurrent OVL files processing to 2 2023-09-11 15:44:33 +03:00
Eladash
7a4ee286be Rewrite Utilitis/sema.cpp 2023-09-11 15:44:33 +03:00
Eladash
37ba19776a PPU LLVM: Fixup pdone count 2023-09-10 18:58:34 +03:00
Eladash
4b4ffba080 Fix OVL file preview loading 2023-09-10 18:58:34 +03:00
Eladash
62b880cb78 SPU LLVM: Avoid excess cache threads 2023-09-10 18:58:34 +03:00
Eladash
bdceb24fd9 PPU: Try to reduce wait for other threads 2023-09-10 18:58:34 +03:00
Eladash
b4fc43d787 PPU LLVM: Re-add multi-threaded overlay module compilation 2023-09-10 18:58:34 +03:00
Eladash
d399bd5b6a PPU Analyzer: Another fixup 2023-09-10 18:58:34 +03:00
Eladash
6b05fcf704 vm_ptr.h: Fix warning
/rpcs3/rpcs3/Emu/Cell/../Memory/vm_ptr.h:135:32: warning: invalid application of 'sizeof' to a void type [-Wpointer-arith]
  135 |                         return sizeof(T);
      |                                ^~~~~~~~~
2023-09-10 18:58:34 +03:00
brian218
009d8e13da USIO: Support up to 4 players for Tekken Tag Tournament 2 Pair Play mode 2023-09-06 18:17:06 +02:00
Elad Ashkenazi
52495c17d6
PPU Analyzer: Fixup 2023-09-06 06:53:10 +03:00
Megamouse
93ac75cddb Update FAudio to 23.09 2023-09-06 01:34:21 +02:00
Megamouse
fe08d4e851 Update SDL to 2.28.3 2023-09-06 01:34:21 +02:00
nastys
7524a35751 macOS CI: build jpeg-xl from source 2023-09-05 23:59:50 +02:00
Megamouse
055c7db5a4 progress dialog: Fix remaining time 2023-09-05 22:53:44 +02:00
Eladash
6beb421a35 asm.hpp: Compilation fixup 2023-09-05 22:53:44 +02:00
Elad Ashkenazi
312fd57772
PPU/Progress Dialog: Improve remaining time approximation 2023-09-05 22:03:35 +03:00
Eladash
44c08c3a73 PPU/Progress Dialog: Improve remaining time calculation 2023-09-05 22:02:47 +03:00
Megamouse
0bb5974ab6 input: try to add tony hawk RIDE Skateboard 2023-09-05 20:41:39 +02:00
Eladash
6dcdf6ec76 Add approximation to remaining compilation time 2023-09-05 14:58:46 +03:00
Eladash
ff4485d8ae PPU LLVM: Patch unregistered BLRs
Fixes "Unregistered PPU Function" in "Jak and Daxter Collection"
2023-09-05 06:20:57 +03:00
Eladash
eacfa36fe6 SPU/DisAsm: Fix constant propagation with non-GPR-writing instructions 2023-09-05 06:20:57 +03:00
Eladash
fdbb0b0e2f PPU LLVM: Optimize branch list 2023-09-05 06:20:57 +03:00
Eladash
cf6eb64f0b SPU LLVM: Improve space-filling for function discovery 2023-09-05 06:20:57 +03:00
Eladash
85773ad869 PPU LLVM: Optimize traps a bit 2023-09-05 06:20:57 +03:00
Eladash
a02c168a0d PPU Analyzer: Fixup greedy instruction search 2023-09-05 06:20:57 +03:00
Eladash
53ba38e98d Thread.cpp: Flush log and make thread context dump on exception 2023-09-05 06:20:57 +03:00
Megamouse
6bc7d7c698 fs::utime: fallback to 01/01/1980 00:00:00 if the date is too low 2023-09-04 10:07:23 +03:00
nastys
f16d4f0523 Update build-mac.sh 2023-09-03 22:32:11 +02:00
Megamouse
b5dac0c333 Progress dialog: show analysing... while no files or modules are known yet. 2023-09-03 15:25:19 +02:00
Eladash
1c8f1b2c27 SPU LLVM: Sad workaround for precompilation
Disable progress dialog for when only precompilation is required.
2023-09-02 22:14:53 +03:00
Eladash
8d9e9eaff9 PPU Precompilation: Fixup file counter 2023-09-02 22:14:53 +03:00
Eladash
b900c43ceb PPU: Precompile only encrypted executeables
Improve sys_prx_load_module and sys_overlay_load_module error checking.
2023-09-02 22:14:53 +03:00
Eladash
d62d6cc852 Progress Dialog: Force-update counter when complete
This confuses both the user and the developer at times.
2023-09-02 22:14:53 +03:00
Eladash
150afecc29 Fixup spu_thread::discover_functions 2023-09-02 22:14:53 +03:00
Elad Ashkenazi
ea57984912
SPU LLVM: Fill space between functions using targets (Precompilation)
* Revert "PPU Analyzer: Revert TRAP detection change"
2023-09-02 15:56:34 +03:00
Eladash
11006dac35 sys_rsx: Fix local memory size reported in driver info 2023-09-02 12:55:34 +03:00
Eladash
dd4840caf6 SPU LLVM: Add CRC check for cache 2023-09-02 12:31:11 +03:00
Eladash
66b6bae596 Win32/File.cpp: Avoid potential race in concurrent writes
Uninitialized data is better than overwritten data. Affects SPU Cache (unprotected writes).
2023-09-02 12:31:11 +03:00
Eladash
3f7afb8375 SPU LLVM: Fix crashes on corrupted cache file
* Fix OOM if size is too high.
* Fix out-of-bounds access beyond SPU_LS_SIZE.
2023-09-02 12:31:11 +03:00
Eladash
deacf76ca4 PPU Analyzer: Revert TRAP detection change 2023-09-02 12:31:11 +03:00
Eladash
5e110f2844 SPU LLVM: Try to precompile filler-sapce between functions 2023-09-02 12:31:11 +03:00
Eladash
7c0d8fc29c Improve spu_thread::is_exec_code 2023-09-02 12:31:11 +03:00
Eladash
a626ccfcad SPU LLVM: Initial precompilation of tail-calls 2023-09-02 12:31:11 +03:00
Eladash
a9810ccb72 SPU LLVM: Another fix for Game Collection's precompilation 2023-09-02 12:31:11 +03:00
Eladash
26b3970485 debugger_list: Fix key up/down direction 2023-09-02 12:31:11 +03:00
Eladash
90ad129b83 Debugger: Fix GOTO and intruction stepping 2023-09-02 12:31:11 +03:00
Eladash
e851c044b5 SPU: Function discovery fix
Do not detect branch to next.
2023-09-02 12:31:11 +03:00
Megamouse
a597368c46 SPU: fix some wierd typos (may be wrong, no idea) 2023-09-02 12:10:36 +03:00
Megamouse
105c694903 Windows: update some comments and echos in git-version-gen.cmd 2023-09-02 10:39:25 +02:00
Megamouse
d7b2453980 VS: Add scripts to filters 2023-09-02 10:39:25 +02:00
Zion Nimchuk
d4b1d5c938 Actually fix build id issue 2023-09-02 09:58:01 +02:00
Zion Nimchuk
7e281a3354 Set azure variables 2023-09-02 05:12:50 +02:00
Eladash
f9f2657c98 SPU LLVM: Optimize spu_idisable 2023-09-01 18:08:15 +03:00
kd-11
1c793edf7d Fix excluded sections check mismatch 2023-09-01 13:35:20 +03:00
kd-11
133ddb118c rsx/texture-cache: Remove archaic short-circuit during purge-xxxxx routines 2023-08-31 07:23:10 +03:00
Eladash
af850dac99 Crypto: Fix endianess, avoid crashing on invalid values 2023-08-31 01:32:28 +02:00
Megamouse
f554b444c0 Qt: rename pad profiles to config files 2023-08-31 00:36:48 +02:00
Zion Nimchuk
cb8aa21fb1 Make sure to enable PR builds 2023-08-30 22:23:29 +02:00
Zion Nimchuk
c0a7db8899 More cleanup 2023-08-30 22:43:46 +03:00
Zion Nimchuk
dd4df6a46b Update linux Azure and re-enable GitHub pushing 2023-08-30 22:43:46 +03:00
Eladash
02b5cae2ad Precompile PRX/ELF extension 2023-08-30 16:47:45 +03:00
Eladash
ba41e466cf Hotfix SPU Cache Spam For Game Collections 2023-08-30 16:47:45 +03:00
Eladash
6d0390bad9 Fixup Create PPU Cache 2023-08-30 08:45:29 +03:00
Eladash
ee9477dc21 SPU: support pure SPU code precompilation discovery 2023-08-30 08:45:29 +03:00
Eladash
37212a632c SPU: Refactor function discovery 2023-08-30 08:45:29 +03:00
Elad Ashkenazi
105c5759f3 Add SPU Precompilation to Create PPU Cache 2023-08-30 08:45:29 +03:00
Megamouse
7144e92ce2 Qt: fix pressure intensity deadzone enabled state 2023-08-29 21:11:46 +02:00
nastys
565a208f20
macOS CI: build ffmpeg and gnutls from source, and fix deploy script (#14563) 2023-08-29 04:18:36 +02:00
Megamouse
452a4654da input: add SDL_GameControllerDB 2023-08-29 03:19:41 +02:00
shinra-electric
d105b0bd9f Update MVK
MVK 1.2.5 was updated without changing the tag. 
This uses the latest version,
2023-08-29 01:11:02 +02:00
shinra-electric
4c7aee75c1 Update homebrew mvk on build script
MVK was updated without a new tag. 
This updates to the later release.
2023-08-29 01:11:02 +02:00
Ivan Chikish
4acd819478 [DS4] Proper USB/BT detection 2023-08-28 22:51:38 +02:00
Elad Ashkenazi
3d2229ca05 SPU LLVM Precompilation Fixup 2023-08-28 13:33:43 +03:00
Eladash
b5faf5800b SPU LLVM Precompilation
Implement function SPU function discovery in images or random SPU code
2023-08-28 09:03:56 +03:00
Malcolm Jestadt
290ff5b839 Zero register optimization for AVX-512-VBMI
- Take advantage of the fact that AVX instructions zero the upper 128 bits for a nice optimization when one input vector is zeroed
2023-08-28 05:09:30 +03:00
Eladash
be0a789e7d PPU Analyzer: Fix OPD section validation 2023-08-27 02:11:01 +03:00
Megamouse
75af7dc269 cellPad: fix lost status during cellPad_NotifyStateChange
CELL_PAD_STATUS_CUSTOM_CONTROLLER was lost when setting reported_status.
2023-08-27 00:18:23 +02:00
Megamouse
9d88102520 cellPad: fix potential out of bounds read and u32 warnings 2023-08-27 00:18:23 +02:00
Megamouse
656f971823 cellPad: some readability updates 2023-08-27 00:18:23 +02:00
Megamouse
dad07da2e9 Midi: fix data type warnings 2023-08-27 00:18:23 +02:00
Megamouse
08d9cbfe48 cellPad: implement cellPadPeriphGetData default logic and add some comments 2023-08-26 22:10:15 +02:00
Megamouse
a101f6490f input: Use pad class instead of index in pad settings dialog
While not a bug, it's not very elegant to use the index as long as
there isn't any gap between the values. So let's use the class instead.
2023-08-26 22:10:15 +02:00
Megamouse
b248483841 input: implement pressure intensity deadzone 2023-08-26 14:40:56 +02:00
Megamouse
c727795881 input: clamp 0-1 in NormalizeDirectedInput
If you called this function with a value smaller than threshold, you
would get an overflow. This never happened, because we always passed
values bigger than threshold. Let's better fix this anyway.
2023-08-26 14:40:56 +02:00
Megamouse
f4c2b4cc7e GHLtar: fix guitar tilt
fixes #14454 🤦
2023-08-25 23:27:15 +02:00
Dark
bf8621c921 Update rpcs3/Emu/Io/RB3MidiKeyboard.cpp
Co-authored-by: Megamouse <studienricky89@googlemail.com>
2023-08-25 21:13:06 +02:00
Dark
8bd9a52de3 RB3MidiKeyboard.cpp: fix some note off messages being processed incorrectly
Some keyboards send a note on message with zero velocity instead of a
note off. As the MIDI spec permits this, it needs to be handled here.
2023-08-25 21:13:06 +02:00
Eladash
eb61ae37ae rsx: Optimize RET returning to following CALL 2023-08-25 20:36:39 +03:00
Eladash
82c5c4d285 PPU Analyzer: Analyze whole segment 0 when patches are applied
Improve greedy instruction search.
2023-08-25 12:52:02 +03:00
Eladash
68c70dd1b9 Savestates: Fix config_event_entry compatibility 2023-08-25 12:52:02 +03:00
Eladash
5fde96d563 rsx: Discard color mask writes with reserved bits 2023-08-25 05:41:54 +03:00
Megamouse
8772219492 Remove unused variable in PPUThread.cpp 2023-08-23 21:42:59 +02:00
Megamouse
6b7f4cbe17 cellPad: remove unused variables 2023-08-23 21:42:59 +02:00
Megamouse
06e4b6251c Fix Vulkan link in README 2023-08-23 21:42:59 +02:00
Megamouse
d8af3ea855 overlays: fix some warnings, simplify code, use move and references 2023-08-23 21:42:59 +02:00
Eladash
4794869bd8 sceNpDrm: Slow down sceNpDrmIsAvailable 2023-08-23 10:14:29 +03:00
Eladash
4462b7be5c cellGame: Make cellGameDataCheck slower
* Turns out cellGameBootCheck is actually quite fast.
* cellGameDataCheck is incredibly slow, slower for DISC type.
* Set 0 sizeKB for when RET_NONE is about to be returned.
2023-08-23 10:14:29 +03:00
Eladash
756ab1191e PPU Analyzer: Fix for unaligned sections 2023-08-23 10:14:29 +03:00
Eladash
e2d4d400ff rsx: Fixup calculate_required_range 2023-08-22 14:26:14 +03:00
Eladash
2022098b13 Progress Dialog: Fix race when PPU compilation is super fast 2023-08-22 14:26:14 +03:00
Eladash
a26b8dff18 rsx: Fix index vertex array range with modulo calculation 2023-08-22 09:41:23 +03:00
Eladash
ee3c7f335f Progress Dialog: Avoid PPU compilation pop-up on short linkage 2023-08-22 09:01:15 +03:00
Eladash
bf93f9f987 Progress Dialog: Fix race that could lead to ever-inaccurate results 2023-08-22 09:01:15 +03:00
Eladash
a001e6ef09 Progress Dialog: Fix race on PPU compilation status 2023-08-22 05:40:53 +03:00
Megamouse
36dce454dd input: fix dance mat PID
It seems this ID was wrong for some reason.
2023-08-21 23:48:56 +02:00
Megamouse
e28b705f0d Input: Add PS Move navigation controller
Add the ps move navigation controller to pad types.
Use proper pad class profiles.
2023-08-21 23:48:56 +02:00
Megamouse
f3b631fbb4 qt/utils: support full path in get_dir_entries 2023-08-21 22:46:38 +02:00
Eladash
16c8f8c9cd Game List: Add initials-only search 2023-08-21 16:38:41 +03:00
Eladash
1843a27c2a LV2/Loader: Fix kernel regions addresses 2023-08-21 14:36:54 +03:00
Eladash
7a0185dbcc PPU/debugger: Fixup 2023-08-21 14:36:54 +03:00
Eladash
17302a9422 Debugger/PPU: Superior Callstack Detection 2023-08-20 22:43:41 +03:00
nkarl7
78f2d44a0e
CLI - install multiple pkgs from folder (#14516) 2023-08-20 17:51:24 +02:00
Darkhost1999
eb978a74f2
Update BUILDING.md (#14515) 2023-08-19 22:32:44 +02:00
oltolm
66aa02a382 xaudio2: enable IID_IXAudio2Extension for mingw-w64 2023-08-19 21:31:19 +02:00
Eladash
8236a0fa2d Fixup cellPadPeriphGetInfo 2023-08-19 17:18:40 +03:00
Eladash
9635417ae5 Replace some utils::bless usages 2023-08-19 17:18:40 +03:00
oltolm
373e502501
Workaround for Clang: move bless to its own header file 2023-08-19 13:30:46 +03:00
Eladash
f1d9e89418 Cg Disasm: Fix instruction highlighting patter
Highlighted wrongly the "Loading..." because L is an uppercase letter.
2023-08-19 04:21:37 +03:00
Eladash
cd98e84ca5 Debugger/RSX: Add FP/VP hash of current shader 2023-08-19 04:21:37 +03:00
shinra-electric
454cb69700 Add link for homebrew MVK 1.2.5 to Mac build script 2023-08-18 21:09:16 +02:00
shinra-electric
e8b9d20865 Bump MoltenVK to 1.2.5 2023-08-18 21:09:16 +02:00
Megamouse
bc09af4ad3 Update submodules
Update rtmidi to 6.0.0
Update zlib to 1.3
Update SDL to 2.28.2
2023-08-18 20:26:25 +02:00
Eladash
730badd378 cellAudio: Move and partially fix _mxr000 hack 2023-08-18 11:37:29 +03:00
Zion Nimchuk
e410841f10 Update focal 2023-08-17 21:17:38 +02:00
Eladash
8b212f2169 PPU: Fix LVRX bad memory access 2023-08-17 17:59:45 +03:00
Eladash
c8f8ecc4d6 LV2: Fixup reservation notifications 2023-08-17 13:02:57 +03:00
Eladash
dacb0bd87f utils/endian.hpp: Use std::byteswap 2023-08-17 13:02:57 +03:00
Eladash
6adc7f9ee6 SPU: Use usermode waiting for busy GETLLAR loop 2023-08-17 09:02:28 +03:00
Eladash
dddd12f66b CELL: Postponed address notifications 2023-08-17 09:02:28 +03:00
Ivan Chikish
384c807d6a Fixup atomic wait (Linux) 2023-08-16 23:29:09 +03:00
oltolm
01a05502e8 cmake: replace add_compile_definitions with target_compile_definitions 2023-08-15 20:56:39 +02:00
oltolm
d062fc1d31 sys_net.cpp: fix compiler warning 2023-08-15 20:56:39 +02:00
oltolm
a01a7a44cd qt6: fix mingw-w64 build 2023-08-15 20:56:39 +02:00
oltolm
d25d5327e5 remove unnecessary defines 2023-08-15 20:56:39 +02:00
Elad Ashkenazi
968762c135 Fix PPU SELF Precompilation 2023-08-14 18:47:20 +03:00
Megamouse
0e23b89352 cellRec: add more encoder options 2023-08-13 21:35:07 +02:00
Elad Ashkenazi
219ee76bf2 cellPad: Fixup sys_config management 2023-08-13 14:20:39 +03:00
Megamouse
39bbf17caf cellRec: fix width of encoder frames
Turns out the pitch was accidentally used as width, leading to an out of bounds read/write.
I kept the pitch in the struct for completeness' sake. It may be needed later, if only for error checks.
2023-08-13 00:37:19 +02:00
Megamouse
f40a6d496a home menu: remove non-dynamic SPU Loop Detection 2023-08-12 23:56:26 +02:00
Malcolm Jestadt
f2e782f5dd SPU LLVM: Inline timer reads for WrDec and RdDec
- Uses RDTSC to emulate the spu decrementer
2023-08-13 00:16:35 +03:00
Megamouse
f199ad7a42 patches: Improve location logging for invalid note sequence 2023-08-12 14:43:47 +02:00
Megamouse
d760e66fdb VS: Fix compilation on Visual Studio 17.7.0 2023-08-12 13:53:40 +02:00
Malcolm Jestadt
512f0a814c SPU LLVM: Fix for AVX-512 CFLTU path
- vcvvtps2udq doesn't turn negative numbers into 0, fix by using signed integer max with 0 instead of vrangeps
2023-08-12 02:55:08 +03:00
Elad Ashkenazi
5668b1bd7a
PPU Loader: Fixup stack alignment after envp fix 2023-08-12 02:03:24 +03:00
Ivan Chikish
c6dcf3f1d3 (Linux) Fixup futex_waitv 2023-08-11 11:54:41 +03:00
Eladash
eae1c5afdd PPU Loader: Fix main()'s envp 2023-08-11 05:07:27 +03:00
Eladash
4bbe885f35 LV2/cellPad: Implement priority-based connection updates 2023-08-10 09:31:49 +03:00
Eladash
a2416bf7f5 cellPad: Fix max_connect in GetInfo
This value is saved and loaded from cellPadInit as is.
2023-08-10 09:31:49 +03:00
kd-11
58e9e54b7f rsx: Remove unused code (argb<->bgra modifier) and refactor a bit 2023-08-09 00:25:50 +03:00
kd-11
767979ea44 rsx: Implement image copy between 2D -> 3C/CUBE with scaling support. 2023-08-09 00:25:50 +03:00
Eladash
bd7715b180 ELF.h: fix warning 2023-08-08 10:22:05 +03:00
Eladash
df24305698 PPU/Debugger: Fix op_branch_targets 2023-08-08 10:22:05 +03:00
Eladash
cdc0441405 PPU: Fixup interpreter and analyzer 2023-08-08 10:22:05 +03:00
Eladash
edf4f7eacc PPU/Patches: Fix CALLOC patch with interpreter 2023-08-07 19:01:38 +03:00
Eladash
8e75e940dd cellSaveData: Fix check 58, implement checks 77 and 76 2023-08-07 19:01:38 +03:00
Eladash
d694600146 PPU Loader: Fixup virtual load for non PRX 2023-08-07 19:01:38 +03:00
Eladash
0989f62256 cellGame: Add some LV2 sleep
Those functions are supposed to take a really long time, and in this time the caller PPU waits for VSH.
2023-08-07 10:56:15 +03:00
Eladash
63f045ef2e Add some error checking to sys_fs_chmod 2023-08-07 10:56:15 +03:00
Eladash
91b68f3b45 PPU Analyzer: Fixup verify_func 2023-08-07 06:48:44 +03:00
Eladash
39910885d9 PPU: fix leak when precompiling SELF files 2023-08-06 21:37:10 +03:00
Eladash
506ec0f947 PPU Loader: Fix imports/exports in virtual mode 2023-08-06 21:37:10 +03:00
Eladash
c96f3a877f PPU Analyzer: Add more function constraints 2023-08-06 21:37:10 +03:00
Eladash
2a0278fbb1 Fixup SPU/PPU Cache Abortion 2023-08-06 21:37:10 +03:00
Eladash
ee869a49f4 PPU Precompilation Fixup 2023-08-06 10:38:40 +03:00
Megamouse
343ba8733b Merge xfloat options 2023-08-06 09:30:53 +03:00
Eladash
e6009794ee vm.cpp: Fixup race in range_lock_internal 2023-08-06 08:26:17 +03:00
Eladash
971c12b937 Fixup log message in sys_memory_allocate 2023-08-06 08:26:17 +03:00
Eladash
849af08ee9 System.cpp: Fixup spu.log/tty.log dumping 2023-08-06 08:26:17 +03:00
Eladash
6547fa9cc3 PPU LLVM: Fixup VSH Precompilation 2023-08-06 08:26:17 +03:00
Eladash
4eaa03e9ba PPU: A few more minor bugfixes 2023-08-06 08:26:17 +03:00
Eladash
d0b3891002 PPU LLVM Cache Fixup 2023-08-06 08:26:17 +03:00
Eladash
e25936c1f1 PPU LLVM/RawSPU: Fixup MMIO crossing-out 2023-08-06 08:26:17 +03:00
Ani
6672499dde vk: Fix detection of RADV on get_driver_vendor()
Since Mesa 22.2.0 (2022-09-21), commit 
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11027/diffs?commit_id=f06da59fd75d7ce7708d159753fcdbc11de16f9e, 
the deviceName property has included the name of the GPU, thus 
invalidating our previous method of detecting RADV as a driver vendor

Before: "AMD RADV NAVY_FLOUNDER"
After: "AMD Radeon RX 6700M (RADV NAVI22)"

Before: "AMD RADV RENOIR"
After: "AMD Radeon Graphics (RADV RENOIR)"
2023-08-06 01:08:06 +02:00
nastys
dea24c905b Make experimental build warning modal 2023-08-05 12:40:59 +02:00
Margen67
7e4cb20ac3 CI: Don't silence curl errors
-f: https://curl.se/docs/manpage.html#-f
Only redirect stdout so stderr isn't lost. (stdin isn't needed?)
2023-08-05 11:58:22 +02:00
Whatcookie
d4cf12bc17
LV2: Improve sys_timer_usleep by using CPU usermode waiting
* Linux: set timerslack to minimum value
- Linux delays the wakeup of threads to save power, this feature isn't needed for this application

* Utils: Add detection for waitpkg and monitorx extensions
- These instructions are used for user mode wait instructions

* lv2: Use user mode wait instructions instead of yielding when appropriate
2023-08-05 11:49:30 +03:00
nastys
aee97e414f macOS CI: use lzma compression for the DMG 2023-08-05 01:28:14 +02:00
nastys
96d94d6217 macOS CI: use faudio from submodule 2023-08-05 00:42:07 +02:00
nastys
0a673129ac macOS CI: build faudio from source 2023-08-05 00:42:07 +02:00
trigger
51a8d2235c osk: ignore input based on ignore_device_events 2023-08-04 21:32:04 +02:00
kd-11
26ecd88074 rsx: Rebuild shader texture state if we detect a silent mismatch 2023-08-04 19:23:06 +03:00
MSuih
65685d4525 Fix current date format 2023-08-04 11:22:44 +03:00
Eladash
744a1528cc Optimize memory usage of ELF loader
Do not duplicate shdr memory when it is present in phdr.
2023-08-03 16:19:55 +03:00
Eladash
bb92154145 Auto-dump decrypted binaries if PPU debug is enabled 2023-08-03 16:19:55 +03:00
Eladash
8057773c4f Fix decrypt_binaries_t::done() 2023-08-03 16:19:55 +03:00
Eladash
9f625de51a vm.cpp/Non-TSX: Fixup potential deadlock 2023-08-03 15:04:37 +03:00
Eladash
06c9b95e09 PPU LLVM/SPU/Non-TSX: Obnoxiously responsive and obedient PPU for SPU requests 2023-08-03 15:04:37 +03:00
Ivan Chikish
804665df69 Fixup futex_waitv redefinition 2023-08-03 14:32:46 +03:00
trigger
0f3dfec7f2 direct return in ppu_check 2023-08-03 12:35:06 +03:00
Ivan Chikish
39a0ff99b2 Fix lf_queue regression 2023-08-03 06:56:50 +03:00
Ivan Chikish
d34287b2cc Linux: use futex_waitv syscall for atomic waiting
In order to make this possible, some unnecessary features were removed.
2023-08-02 21:46:06 +03:00
Ivan Chikish
831a9fe012 Remove thread pool
Prevents implementing thread priority on Linux.
2023-08-02 21:46:06 +03:00
Ivan Chikish
15e2ec2cf0 Reset broken LLCM_CCACHE_BUILD change 2023-08-02 21:46:06 +03:00
Ivan Chikish
9ad7c8e95b Don't require Qt 6.4.0 (works with 6.2.4) 2023-08-02 21:46:06 +03:00
Megamouse
bb2d7063c4 Update ffmpeg 2023-08-02 08:21:47 +02:00
Megamouse
70e127b219 Update dependencies 2023-08-02 00:42:20 +02:00
Megamouse
ef12da774e rsx: fix register_vertex_printer value func 2023-07-31 23:14:02 +02:00
1423 changed files with 137878 additions and 134857 deletions

View file

@ -1,23 +1,10 @@
#!/bin/sh -ex
# Pull all the submodules except llvm
# Pull all the submodules except some
# 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/ && !/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-16.0.1/llvm-project-16.0.1.src.tar.xz
tar xf llvm*.tar.xz
export CC=clang16 CXX=clang++16
cmake -B libcxx_build -G Ninja -S llvm*/libcxx \
-DLLVM_CCACHE_BUILD=ON \
-DLIBCXX_INCLUDE_BENCHMARKS=OFF \
-DCMAKE_INSTALL_PREFIX:PATH=libcxx_prefix
cmake --build libcxx_build
cmake --install libcxx_build
export CXXFLAGS="$CXXFLAGS -nostdinc++ -isystem$PWD/libcxx_prefix/include/c++/v1"
export LDFLAGS="$LDFLAGS -nostdlib++ -L$PWD/libcxx_prefix/lib -l:libc++.a -lcxxrt"
git config --global --add safe.directory .
git submodule -q update --init --depth 1 $(awk '/path/ && !/llvm/ && !/opencv/ && !/libpng/ && !/libsdl-org/ && !/curl/ && !/zlib/ && !/libusb/ { print $3 }' .gitmodules)
CONFIGURE_ARGS="
-DWITH_LLVM=ON
@ -27,8 +14,13 @@ CONFIGURE_ARGS="
-DUSE_SYSTEM_FFMPEG=ON
-DUSE_SYSTEM_CURL=ON
-DUSE_SYSTEM_LIBPNG=ON
-DUSE_SYSTEM_LIBUSB=ON
-DUSE_SYSTEM_OPENCV=ON
"
# base Clang workaround (missing clang-scan-deps)
CONFIGURE_ARGS="$CONFIGURE_ARGS -DCMAKE_CXX_SCAN_FOR_MODULES=OFF"
# shellcheck disable=SC2086
cmake -B build -G Ninja $CONFIGURE_ARGS
cmake --build build

55
.ci/build-linux-aarch64.sh Executable file
View file

@ -0,0 +1,55 @@
#!/bin/sh -ex
cd rpcs3 || exit 1
shellcheck .ci/*.sh
git config --global --add safe.directory '*'
# Pull all the submodules except some
# shellcheck disable=SC2046
git submodule -q update --init $(awk '/path/ && !/llvm/ && !/opencv/ && !/libsdl-org/ && !/curl/ && !/zlib/ { print $3 }' .gitmodules)
mkdir build && cd build || exit 1
if [ "$COMPILER" = "gcc" ]; then
# These are set in the dockerfile
export CC="${GCC_BINARY}"
export CXX="${GXX_BINARY}"
export LINKER=gold
else
export CC="${CLANG_BINARY}"
export CXX="${CLANGXX_BINARY}"
export LINKER="${LLD_BINARY}"
fi
export LINKER_FLAG="-fuse-ld=${LINKER}"
cmake .. \
-DCMAKE_INSTALL_PREFIX=/usr \
-DUSE_NATIVE_INSTRUCTIONS=OFF \
-DUSE_PRECOMPILED_HEADERS=OFF \
-DCMAKE_EXE_LINKER_FLAGS="${LINKER_FLAG}" \
-DCMAKE_MODULE_LINKER_FLAGS="${LINKER_FLAG}" \
-DCMAKE_SHARED_LINKER_FLAGS="${LINKER_FLAG}" \
-DUSE_SYSTEM_CURL=ON \
-DUSE_SDL=ON \
-DUSE_SYSTEM_SDL=ON \
-DUSE_SYSTEM_FFMPEG=OFF \
-DUSE_SYSTEM_OPENCV=ON \
-DUSE_DISCORD_RPC=ON \
-DOpenGL_GL_PREFERENCE=LEGACY \
-DLLVM_DIR=/opt/llvm/lib/cmake/llvm \
-DSTATIC_LINK_LLVM=ON \
-DBUILD_RPCS3_TESTS="${RUN_UNIT_TESTS}" \
-DRUN_RPCS3_TESTS="${RUN_UNIT_TESTS}" \
-G Ninja
ninja; build_status=$?;
cd ..
# If it compiled succesfully let's deploy.
if [ "$build_status" -eq 0 ]; then
.ci/deploy-linux.sh "aarch64"
fi

View file

@ -1,13 +1,15 @@
#!/bin/sh -ex
if [ -z "$CIRRUS_CI" ]; then
cd rpcs3 || exit 1
fi
cd rpcs3 || exit 1
# Pull all the submodules except llvm
shellcheck .ci/*.sh
git config --global --add safe.directory '*'
# Pull all the submodules except some
# Note: Tried to use git submodule status, but it takes over 20 seconds
# shellcheck disable=SC2046
git submodule -q update --init $(awk '/path/ && !/llvm/ && !/SPIRV/ { print $3 }' .gitmodules)
git submodule -q update --init $(awk '/path/ && !/llvm/ && !/opencv/ && !/libsdl-org/ && !/curl/ && !/zlib/ { print $3 }' .gitmodules)
mkdir build && cd build || exit 1
@ -28,7 +30,7 @@ else
export RANLIB=/usr/bin/llvm-ranlib-"$LLVMVER"
fi
export CFLAGS="$CFLAGS -fuse-ld=${LINKER}"
export LINKER_FLAG="-fuse-ld=${LINKER}"
cmake .. \
-DCMAKE_INSTALL_PREFIX=/usr \
@ -36,26 +38,29 @@ cmake .. \
-DUSE_PRECOMPILED_HEADERS=OFF \
-DCMAKE_C_FLAGS="$CFLAGS" \
-DCMAKE_CXX_FLAGS="$CFLAGS" \
-DCMAKE_EXE_LINKER_FLAGS="${LINKER_FLAG}" \
-DCMAKE_MODULE_LINKER_FLAGS="${LINKER_FLAG}" \
-DCMAKE_SHARED_LINKER_FLAGS="${LINKER_FLAG}" \
-DCMAKE_AR="$AR" \
-DCMAKE_RANLIB="$RANLIB" \
-DUSE_SYSTEM_CURL=ON \
-DUSE_SDL=ON \
-DUSE_SYSTEM_SDL=ON \
-DUSE_SYSTEM_FFMPEG=OFF \
-DUSE_SYSTEM_OPENCV=ON \
-DUSE_DISCORD_RPC=ON \
-DOpenGL_GL_PREFERENCE=LEGACY \
-DLLVM_DIR=/opt/llvm/lib/cmake/llvm \
-DSTATIC_LINK_LLVM=ON \
-DBUILD_RPCS3_TESTS="${RUN_UNIT_TESTS}" \
-DRUN_RPCS3_TESTS="${RUN_UNIT_TESTS}" \
-G Ninja
ninja; build_status=$?;
cd ..
shellcheck .ci/*.sh
# If it compiled succesfully let's deploy.
# Azure and Cirrus publish PRs as artifacts only.
{ [ "$CI_HAS_ARTIFACTS" = "true" ];
} && SHOULD_DEPLOY="true" || SHOULD_DEPLOY="false"
if [ "$build_status" -eq 0 ] && [ "$SHOULD_DEPLOY" = "true" ]; then
.ci/deploy-linux.sh
if [ "$build_status" -eq 0 ]; then
.ci/deploy-linux.sh "x86_64"
fi

121
.ci/build-mac-arm64.sh Executable file
View file

@ -0,0 +1,121 @@
#!/bin/sh -ex
# shellcheck disable=SC2086
export HOMEBREW_NO_AUTO_UPDATE=1
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
export HOMEBREW_NO_ENV_HINTS=1
export HOMEBREW_NO_INSTALL_CLEANUP=1
/opt/homebrew/bin/brew install -f --overwrite --quiet nasm ninja p7zip ccache pipenv gnutls freetype googletest #create-dmg
/opt/homebrew/bin/brew install -f --quiet ffmpeg@5
/opt/homebrew/bin/brew install --quiet "llvm@$LLVM_COMPILER_VER" glew cmake sdl3 vulkan-headers coreutils
/opt/homebrew/bin/brew link -f --quiet "llvm@$LLVM_COMPILER_VER" ffmpeg@5
# moltenvk based on commit for 1.3.0 release
wget https://raw.githubusercontent.com/Homebrew/homebrew-core/7255441cbcafabaa8950f67c7ec55ff499dbb2d3/Formula/m/molten-vk.rb
/opt/homebrew/bin/brew install -f --overwrite --formula --quiet ./molten-vk.rb
export CXX=clang++
export CC=clang
export BREW_PATH;
BREW_PATH="$(brew --prefix)"
export BREW_BIN="/opt/homebrew/bin"
export BREW_SBIN="/opt/homebrew/sbin"
export CMAKE_EXTRA_OPTS='-DLLVM_TARGETS_TO_BUILD=arm64'
export WORKDIR;
WORKDIR="$(pwd)"
# Get Qt
if [ ! -d "/tmp/Qt/$QT_VER" ]; then
mkdir -p "/tmp/Qt"
git clone https://github.com/engnr/qt-downloader.git
cd qt-downloader
git checkout f52efee0f18668c6d6de2dec0234b8c4bc54c597
# nested Qt 6.9.1 URL workaround
# sed -i '' "s/'qt{0}_{0}{1}{2}'.format(major, minor, patch)]))/'qt{0}_{0}{1}{2}'.format(major, minor, patch), 'qt{0}_{0}{1}{2}'.format(major, minor, patch)]))/g" qt-downloader
# sed -i '' "s/'{}\/{}\/qt{}_{}\/'/'{0}\/{1}\/qt{2}_{3}\/qt{2}_{3}\/'/g" qt-downloader
# archived Qt 6.7.3 URL workaround
sed -i '' "s/official_releases/archive/g" qt-downloader
cd "/tmp/Qt"
arch -arm64 "$BREW_PATH/bin/pipenv" run pip3 uninstall py7zr requests semantic_version lxml
arch -arm64 "$BREW_PATH/bin/pipenv" run pip3 install py7zr requests semantic_version lxml --no-cache
mkdir -p "$QT_VER/macos" ; ln -s "macos" "$QT_VER/clang_64"
# sed -i '' 's/args\.version \/ derive_toolchain_dir(args) \/ //g' "$WORKDIR/qt-downloader/qt-downloader" # Qt 6.9.1 workaround
arch -arm64 "$BREW_PATH/bin/pipenv" run "$WORKDIR/qt-downloader/qt-downloader" macos desktop "$QT_VER" clang_64 --opensource --addons qtmultimedia qtimageformats # -o "$QT_VER/clang_64"
fi
cd "$WORKDIR"
ditto "/tmp/Qt/$QT_VER" "qt-downloader/$QT_VER"
export Qt6_DIR="$WORKDIR/qt-downloader/$QT_VER/clang_64/lib/cmake/Qt$QT_VER_MAIN"
export SDL3_DIR="$BREW_PATH/opt/sdl3/lib/cmake/SDL3"
export PATH="$BREW_PATH/opt/llvm@$LLVM_COMPILER_VER/bin:$WORKDIR/qt-downloader/$QT_VER/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_PATH/lib $BREW_PATH/opt/ffmpeg@5/lib/libavcodec.dylib $BREW_PATH/opt/ffmpeg@5/lib/libavformat.dylib $BREW_PATH/opt/ffmpeg@5/lib/libavutil.dylib $BREW_PATH/opt/ffmpeg@5/lib/libswscale.dylib $BREW_PATH/opt/ffmpeg@5/lib/libswresample.dylib $BREW_PATH/opt/llvm@$LLVM_COMPILER_VER/lib/c++/libc++.1.dylib $BREW_PATH/lib/libSDL3.dylib $BREW_PATH/lib/libGLEW.dylib $BREW_PATH/opt/llvm@$LLVM_COMPILER_VER/lib/unwind/libunwind.1.dylib -Wl,-rpath,$BREW_PATH/lib"
export CPPFLAGS="-I$BREW_PATH/include -I$BREW_PATH/include -no-pie -D__MAC_OS_X_VERSION_MIN_REQUIRED=140000"
export CFLAGS="-D__MAC_OS_X_VERSION_MIN_REQUIRED=140000"
export LIBRARY_PATH="$BREW_PATH/lib"
export LD_LIBRARY_PATH="$BREW_PATH/lib"
export VULKAN_SDK
VULKAN_SDK="$BREW_PATH/opt/molten-vk"
ln -s "$VULKAN_SDK/lib/libMoltenVK.dylib" "$VULKAN_SDK/lib/libvulkan.dylib" || true
export VK_ICD_FILENAMES="$VULKAN_SDK/share/vulkan/icd.d/MoltenVK_icd.json"
export LLVM_DIR
LLVM_DIR="$BREW_PATH/opt/llvm@$LLVM_COMPILER_VER"
# exclude ffmpeg, LLVM, opencv, and sdl from submodule update
# shellcheck disable=SC2046
git submodule -q update --init --depth=1 --jobs=8 $(awk '/path/ && !/ffmpeg/ && !/llvm/ && !/opencv/ && !/SDL/ { print $3 }' .gitmodules)
# 3rdparty fixes
sed -i '' "s/extern const double NSAppKitVersionNumber;/const double NSAppKitVersionNumber = 1343;/g" 3rdparty/hidapi/hidapi/mac/hid.c
mkdir build && cd build || exit 1
export MACOSX_DEPLOYMENT_TARGET=14.0
"$BREW_PATH/bin/cmake" .. \
-DBUILD_RPCS3_TESTS="${RUN_UNIT_TESTS}" \
-DRUN_RPCS3_TESTS="${RUN_UNIT_TESTS}" \
-DUSE_SDL=ON \
-DUSE_DISCORD_RPC=ON \
-DUSE_VULKAN=ON \
-DUSE_ALSA=OFF \
-DUSE_PULSE=OFF \
-DUSE_AUDIOUNIT=ON \
-DUSE_SYSTEM_FFMPEG=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=ON \
-DUSE_SYSTEM_FAUDIO=OFF \
-DUSE_SYSTEM_SDL=ON \
-DUSE_SYSTEM_OPENCV=ON \
"$CMAKE_EXTRA_OPTS" \
-DLLVM_TARGET_ARCH=arm64 \
-DCMAKE_OSX_ARCHITECTURES=arm64 \
-DCMAKE_IGNORE_PATH="$BREW_PATH/lib" \
-DCMAKE_IGNORE_PREFIX_PATH=/opt/homebrew/opt \
-DCMAKE_CXX_FLAGS="-D__MAC_OS_X_VERSION_MIN_REQUIRED=140000" \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
-DCMAKE_OSX_SYSROOT="$(xcrun --sdk macosx --show-sdk-path)" \
-G Ninja
"$BREW_PATH/bin/ninja"; build_status=$?;
cd ..
# If it compiled succesfully let's deploy.
if [ "$build_status" -eq 0 ]; then
.ci/deploy-mac-arm64.sh
fi

View file

@ -1,23 +1,26 @@
#!/bin/sh -ex
# shellcheck disable=SC2086
export HOMEBREW_NO_AUTO_UPDATE=1
brew install -f --overwrite nasm ninja git p7zip create-dmg ccache pipenv
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
export HOMEBREW_NO_ENV_HINTS=1
export HOMEBREW_NO_INSTALL_CLEANUP=1
#/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/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
arch -x86_64 /usr/local/bin/brew install -f --overwrite --quiet python || arch -x86_64 /usr/local/bin/brew link --overwrite python
arch -x86_64 /usr/local/bin/brew install -f --overwrite --quiet nasm ninja p7zip ccache pipenv gnutls freetype #create-dmg
arch -x86_64 /usr/local/bin/brew install -f --quiet ffmpeg@5
arch -x86_64 /usr/local/bin/brew install --quiet "llvm@$LLVM_COMPILER_VER" glew cmake sdl3 vulkan-headers coreutils
arch -x86_64 /usr/local/bin/brew link -f --quiet "llvm@$LLVM_COMPILER_VER" ffmpeg@5
# 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
# moltenvk based on commit for 1.3.0 release
wget https://raw.githubusercontent.com/Homebrew/homebrew-core/7255441cbcafabaa8950f67c7ec55ff499dbb2d3/Formula/m/molten-vk.rb
arch -x86_64 /usr/local/bin/brew install -f --overwrite --formula --quiet ./molten-vk.rb
export CXX=clang++
export CC=clang
export BREW_PATH;
BREW_PATH="$(brew --prefix)"
export BREW_X64_PATH;
BREW_X64_PATH="$("/usr/local/bin/brew" --prefix)"
export BREW_BIN="/usr/local/bin"
@ -33,21 +36,28 @@ if [ ! -d "/tmp/Qt/$QT_VER" ]; then
git clone https://github.com/engnr/qt-downloader.git
cd qt-downloader
git checkout f52efee0f18668c6d6de2dec0234b8c4bc54c597
# nested Qt 6.9.1 URL workaround
# sed -i '' "s/'qt{0}_{0}{1}{2}'.format(major, minor, patch)]))/'qt{0}_{0}{1}{2}'.format(major, minor, patch), 'qt{0}_{0}{1}{2}'.format(major, minor, patch)]))/g" qt-downloader
# sed -i '' "s/'{}\/{}\/qt{}_{}\/'/'{0}\/{1}\/qt{2}_{3}\/qt{2}_{3}\/'/g" qt-downloader
# archived Qt 6.7.3 URL workaround
sed -i '' "s/official_releases/archive/g" qt-downloader
cd "/tmp/Qt"
"/opt/homebrew/bin/pipenv" run pip3 install py7zr requests semantic_version lxml
arch -x86_64 "$BREW_X64_PATH/bin/pipenv" --python "$BREW_X64_PATH/bin/python3" run pip3 install py7zr requests semantic_version lxml
mkdir -p "$QT_VER/macos" ; ln -s "macos" "$QT_VER/clang_64"
"/opt/homebrew/bin/pipenv" run "$WORKDIR/qt-downloader/qt-downloader" macos desktop "$QT_VER" clang_64 --opensource --addons qtmultimedia
# sed -i '' 's/args\.version \/ derive_toolchain_dir(args) \/ //g' "$WORKDIR/qt-downloader/qt-downloader" # Qt 6.9.1 workaround
arch -x86_64 "$BREW_X64_PATH/bin/pipenv" --python "$BREW_X64_PATH/bin/python3" run "$WORKDIR/qt-downloader/qt-downloader" macos desktop "$QT_VER" clang_64 --opensource --addons qtmultimedia qtimageformats # -o "$QT_VER/clang_64"
fi
cd "$WORKDIR"
ditto "/tmp/Qt/$QT_VER" "qt-downloader/$QT_VER"
export Qt6_DIR="$WORKDIR/qt-downloader/$QT_VER/clang_64/lib/cmake/Qt$QT_VER_MAIN"
export SDL2_DIR="$BREW_X64_PATH/opt/sdl2/lib/cmake/SDL2"
export SDL3_DIR="$BREW_X64_PATH/opt/sdl3/lib/cmake/SDL3"
export PATH="$BREW_X64_PATH/opt/llvm@16/bin:$WORKDIR/qt-downloader/$QT_VER/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@$LLVM_COMPILER_VER/bin:$WORKDIR/qt-downloader/$QT_VER/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 CPPFLAGS="-I$BREW_X64_PATH/include -msse -msse2 -mcx16 -no-pie -D__MAC_OS_X_VERSION_MIN_REQUIRED=140000"
export CFLAGS="-D__MAC_OS_X_VERSION_MIN_REQUIRED=140000"
export LIBRARY_PATH="$BREW_X64_PATH/lib"
export LD_LIBRARY_PATH="$BREW_X64_PATH/lib"
@ -57,23 +67,28 @@ 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
LLVM_DIR="BREW_X64_PATH/opt/llvm@$LLVM_COMPILER_VER"
# exclude ffmpeg, LLVM, opencv, 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)
git submodule -q update --init --depth=1 --jobs=8 $(awk '/path/ && !/ffmpeg/ && !/llvm/ && !/opencv/ && !/SDL/ { print $3 }' .gitmodules)
# 3rdparty fixes
sed -i '' "s/extern const double NSAppKitVersionNumber;/const double NSAppKitVersionNumber = 1343;/g" 3rdparty/hidapi/hidapi/mac/hid.c
mkdir build && cd build || exit 1
export MACOSX_DEPLOYMENT_TARGET=14.0
"$BREW_X64_PATH/bin/cmake" .. \
-DBUILD_RPCS3_TESTS=OFF \
-DRUN_RPCS3_TESTS=OFF \
-DUSE_SDL=ON \
-DUSE_DISCORD_RPC=ON \
-DUSE_VULKAN=ON \
-DUSE_ALSA=OFF \
-DUSE_PULSE=OFF \
-DUSE_AUDIOUNIT=ON \
-DUSE_SYSTEM_FFMPEG=ON \
-DLLVM_CCACHE_BUILD=OFF \
-DLLVM_BUILD_RUNTIME=OFF \
-DLLVM_BUILD_TOOLS=OFF \
@ -86,21 +101,24 @@ mkdir build && cd build || exit 1
-DLLVM_ENABLE_Z3_SOLVER=OFF \
-DUSE_NATIVE_INSTRUCTIONS=OFF \
-DUSE_SYSTEM_MVK=ON \
-DUSE_SYSTEM_FAUDIO=ON \
-DUSE_SYSTEM_FAUDIO=OFF \
-DUSE_SYSTEM_SDL=ON \
$CMAKE_EXTRA_OPTS \
-DUSE_SYSTEM_OPENCV=ON \
"$CMAKE_EXTRA_OPTS" \
-DLLVM_TARGET_ARCH=X86_64 \
-DCMAKE_OSX_ARCHITECTURES=x86_64 \
-DCMAKE_IGNORE_PATH="$BREW_PATH/lib" \
-DCMAKE_IGNORE_PATH="$BREW_X64_PATH/lib" \
-DCMAKE_IGNORE_PREFIX_PATH=/usr/local/opt \
-DCMAKE_CXX_FLAGS="-D__MAC_OS_X_VERSION_MIN_REQUIRED=140000" \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
-DCMAKE_OSX_SYSROOT="$(xcrun --sdk macosx --show-sdk-path)" \
-G Ninja
"$BREW_PATH/bin/ninja"; build_status=$?;
"$BREW_X64_PATH/bin/ninja"; build_status=$?;
cd ..
{ [ "$CI_HAS_ARTIFACTS" = "true" ];
} && SHOULD_DEPLOY="true" || SHOULD_DEPLOY="false"
if [ "$build_status" -eq 0 ] && [ "$SHOULD_DEPLOY" = "true" ]; then
# If it compiled succesfully let's deploy.
if [ "$build_status" -eq 0 ]; then
.ci/deploy-mac.sh
fi

View file

@ -0,0 +1,61 @@
#!/bin/sh -ex
git config --global --add safe.directory '*'
# Pull all the submodules except some
# Note: Tried to use git submodule status, but it takes over 20 seconds
# shellcheck disable=SC2046
git submodule -q update --init $(awk '/path/ && !/llvm/ && !/opencv/ && !/ffmpeg/ && !/curl/ && !/FAudio/ && !/zlib/ { print $3 }' .gitmodules)
mkdir build && cd build || exit 1
export CC="clang"
export CXX="clang++"
export LINKER=lld
export LINKER_FLAG="-fuse-ld=${LINKER}"
if [ -n "$LLVMVER" ]; then
export AR="llvm-ar-$LLVMVER"
export RANLIB="llvm-ranlib-$LLVMVER"
else
export AR="llvm-ar"
export RANLIB="llvm-ranlib"
fi
cmake .. \
-DCMAKE_PREFIX_PATH=/clang64 \
-DCMAKE_INSTALL_PREFIX=/usr \
-DUSE_NATIVE_INSTRUCTIONS=OFF \
-DUSE_PRECOMPILED_HEADERS=OFF \
-DCMAKE_C_FLAGS="$CFLAGS" \
-DCMAKE_CXX_FLAGS="$CFLAGS" \
-DCMAKE_EXE_LINKER_FLAGS="${LINKER_FLAG}" \
-DCMAKE_MODULE_LINKER_FLAGS="${LINKER_FLAG}" \
-DCMAKE_SHARED_LINKER_FLAGS="${LINKER_FLAG}" \
-DCMAKE_AR="$AR" \
-DCMAKE_RANLIB="$RANLIB" \
-DUSE_SYSTEM_CURL=ON \
-DUSE_FAUDIO=OFF \
-DUSE_SDL=ON \
-DUSE_SYSTEM_SDL=OFF \
-DUSE_SYSTEM_FFMPEG=ON \
-DUSE_SYSTEM_OPENCV=ON \
-DUSE_SYSTEM_OPENAL=OFF \
-DUSE_DISCORD_RPC=ON \
-DOpenGL_GL_PREFERENCE=LEGACY \
-DWITH_LLVM=ON \
-DLLVM_DIR=/clang64/lib/cmake/llvm \
-DVulkan_LIBRARY=/clang64/lib/libvulkan-1.dll.a \
-DSTATIC_LINK_LLVM=ON \
-DBUILD_RPCS3_TESTS=OFF \
-DRUN_RPCS3_TESTS=OFF \
-G Ninja
ninja; build_status=$?;
cd ..
# If it compiled succesfully let's deploy.
if [ "$build_status" -eq 0 ]; then
.ci/deploy-windows-clang.sh "x86_64"
fi

View file

@ -2,33 +2,51 @@
cd build || exit 1
CPU_ARCH="${1:-x86_64}"
if [ "$DEPLOY_APPIMAGE" = "true" ]; then
DESTDIR=AppDir ninja install
curl -sL -o /usr/bin/linuxdeploy https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
curl -fsSLo /usr/bin/linuxdeploy "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-$CPU_ARCH.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
curl -fsSLo /usr/bin/linuxdeploy-plugin-qt "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-$CPU_ARCH.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
curl -fsSLo linuxdeploy-plugin-checkrt.sh https://github.com/darealshinji/linuxdeploy-plugin-checkrt/releases/download/continuous/linuxdeploy-plugin-checkrt.sh
chmod +x ./linuxdeploy-plugin-checkrt.sh
EXTRA_QT_PLUGINS="svg;" APPIMAGE_EXTRACT_AND_RUN=1 linuxdeploy --appdir AppDir --plugin qt
export EXTRA_PLATFORM_PLUGINS="libqwayland-egl.so;libqwayland-generic.so"
export EXTRA_QT_PLUGINS="svg;wayland-decoration-client;wayland-graphics-integration-client;wayland-shell-integration;waylandcompositor"
APPIMAGE_EXTRACT_AND_RUN=1 linuxdeploy --appdir AppDir --plugin qt --plugin checkrt
# Remove libwayland-client because it has platform-dependent exports and breaks other OSes
rm -f ./AppDir/usr/lib/libwayland-client.so*
# Remove libvulkan because it causes issues with gamescope
rm -f ./AppDir/usr/lib/libvulkan.so*
# Remove unused Qt6 libraries
rm -f ./AppDir/usr/lib/libQt6VirtualKeyboard.so*
rm -f ./AppDir/usr/plugins/platforminputcontexts/libqtvirtualkeyboardplugin.so*
# Remove git directory containing local commit history file
rm -rf ./AppDir/usr/share/rpcs3/git
./linuxdeploy-plugin-checkrt.sh --appdir AppDir
curl -fsSLo /uruntime "https://github.com/VHSgunzo/uruntime/releases/download/v0.3.4/uruntime-appimage-dwarfs-$CPU_ARCH"
chmod +x /uruntime
/uruntime --appimage-mkdwarfs -f --set-owner 0 --set-group 0 --no-history --no-create-timestamp \
--compression zstd:level=22 -S26 -B32 --header /uruntime -i AppDir -o RPCS3.AppImage
linuxdeploy --appimage-extract
./squashfs-root/plugins/linuxdeploy-plugin-appimage/usr/bin/appimagetool AppDir -g
APPIMAGE_SUFFIX="linux_${CPU_ARCH}"
if [ "$CPU_ARCH" = "x86_64" ]; then
# Preserve back compat. Previous versions never included the full arch.
APPIMAGE_SUFFIX="linux64"
fi
COMM_TAG=$(awk '/version{.*}/ { printf("%d.%d.%d", $5, $6, $7) }' ../rpcs3/rpcs3_version.cpp)
COMM_COUNT="$(git rev-list --count HEAD)"
COMM_HASH="$(git rev-parse --short=8 HEAD)"
RPCS3_APPIMAGE="rpcs3-v${COMM_TAG}-${COMM_COUNT}-${COMM_HASH}_linux64.AppImage"
RPCS3_APPIMAGE="rpcs3-v${COMM_TAG}-${COMM_COUNT}-${COMM_HASH}_${APPIMAGE_SUFFIX}.AppImage"
mv ./RPCS3*.AppImage "$RPCS3_APPIMAGE"

20
.ci/deploy-llvm.sh Normal file
View file

@ -0,0 +1,20 @@
#!/bin/sh -ex
# First let's print some info about our caches
"$(cygpath -u "$CCACHE_BIN_DIR")"/ccache.exe --show-stats -v
# BUILD_blablabla is Azure specific, so we wrap it for portability
ARTIFACT_DIR="$BUILD_ARTIFACTSTAGINGDIRECTORY"
BUILD="llvmlibs_mt.7z"
# Package artifacts
7z a -m0=LZMA2 -mx9 "$BUILD" ./build/lib/Release-x64/llvm_build
# Generate sha256 hashes
# Write to file for GitHub releases
sha256sum "$BUILD" | awk '{ print $1 }' | tee "$BUILD.sha256"
echo "$(cat "$BUILD.sha256");$(stat -c %s "$BUILD")B" > GitHubReleaseMessage.txt
# Move files to publishing directory
cp -- "$BUILD" "$ARTIFACT_DIR"
cp -- "$BUILD.sha256" "$ARTIFACT_DIR"

74
.ci/deploy-mac-arm64.sh Executable file
View file

@ -0,0 +1,74 @@
#!/bin/sh -ex
# shellcheck disable=SC2086
cd build || exit 1
# Gather explicit version number and number of commits
COMM_TAG=$(awk '/version{.*}/ { printf("%d.%d.%d", $5, $6, $7) }' ../rpcs3/rpcs3_version.cpp)
COMM_COUNT=$(git rev-list --count HEAD)
COMM_HASH=$(git rev-parse --short=8 HEAD)
AVVER="${COMM_TAG}-${COMM_COUNT}"
# AVVER is used for GitHub releases, it is the version number.
echo "AVVER=$AVVER" >> ../.ci/ci-vars.env
cd bin
mkdir "rpcs3.app/Contents/lib/" || true
cp "$(realpath /opt/homebrew/opt/llvm@$LLVM_COMPILER_VER/lib/c++/libc++abi.1.0.dylib)" "rpcs3.app/Contents/Frameworks/libc++abi.1.dylib"
cp "$(realpath /opt/homebrew/lib/libsharpyuv.0.dylib)" "rpcs3.app/Contents/lib/libsharpyuv.0.dylib"
cp "$(realpath /opt/homebrew/lib/libintl.8.dylib)" "rpcs3.app/Contents/lib/libintl.8.dylib"
rm -rf "rpcs3.app/Contents/Frameworks/QtPdf.framework" \
"rpcs3.app/Contents/Frameworks/QtQml.framework" \
"rpcs3.app/Contents/Frameworks/QtQmlModels.framework" \
"rpcs3.app/Contents/Frameworks/QtQuick.framework" \
"rpcs3.app/Contents/Frameworks/QtVirtualKeyboard.framework" \
"rpcs3.app/Contents/Plugins/platforminputcontexts" \
"rpcs3.app/Contents/Plugins/virtualkeyboard" \
"rpcs3.app/Contents/Resources/git"
../../.ci/optimize-mac.sh rpcs3.app
# Hack
install_name_tool \
-delete_rpath /opt/homebrew/lib \
-delete_rpath /opt/homebrew/opt/llvm@$LLVM_COMPILER_VER/lib RPCS3.app/Contents/MacOS/rpcs3
#-delete_rpath /opt/homebrew1/Cellar/sdl3/3.2.8/lib
# Need to do this rename hack due to case insensitive filesystem
mv rpcs3.app RPCS3_.app
mv RPCS3_.app RPCS3.app
# NOTE: "--deep" is deprecated
codesign --deep -fs - RPCS3.app
echo "[InternetShortcut]" > Quickstart.url
echo "URL=https://rpcs3.net/quickstart" >> Quickstart.url
echo "IconIndex=0" >> Quickstart.url
#DMG_FILEPATH="$BUILD_ARTIFACTSTAGINGDIRECTORY/rpcs3-v${COMM_TAG}-${COMM_COUNT}-${COMM_HASH}_macos_arm64.dmg"
#"$BREW_X64_PATH/bin/create-dmg" --volname RPCS3 \
#--window-size 800 400 \
#--icon-size 100 \
#--icon rpcs3.app 200 190 \
#--add-file Quickstart.url Quickstart.url 400 20 \
#--hide-extension rpcs3.app \
#--hide-extension Quickstart.url \
#--app-drop-link 600 185 \
#--skip-jenkins \
#--format ULMO \
#"$DMG_FILEPATH" \
#RPCS3.app
#FILESIZE=$(stat -f %z "$DMG_FILEPATH")
#SHA256SUM=$(shasum -a 256 "$DMG_FILEPATH" | awk '{ print $1 }')
ARCHIVE_FILEPATH="$BUILD_ARTIFACTSTAGINGDIRECTORY/rpcs3-v${COMM_TAG}-${COMM_COUNT}-${COMM_HASH}_macos_arm64.7z"
"$BREW_PATH/bin/7z" a -mx9 "$ARCHIVE_FILEPATH" RPCS3.app Quickstart.url
FILESIZE=$(stat -f %z "$ARCHIVE_FILEPATH")
SHA256SUM=$(shasum -a 256 "$ARCHIVE_FILEPATH" | awk '{ print $1 }')
cd ..
echo "${SHA256SUM};${FILESIZE}B" > "$RELEASE_MESSAGE"
cd bin

View file

@ -1,5 +1,6 @@
#!/bin/sh -ex
# shellcheck disable=SC2086
cd build || exit 1
# Gather explicit version number and number of commits
@ -15,7 +16,9 @@ echo "AVVER=$AVVER" >> ../.ci/ci-vars.env
cd bin
mkdir "rpcs3.app/Contents/lib/"
cp "/usr/local/opt/llvm@16/lib/c++/libc++abi.1.0.dylib" "rpcs3.app/Contents/lib/libc++abi.1.dylib"
cp "/usr/local/opt/llvm@$LLVM_COMPILER_VER/lib/c++/libc++abi.1.0.dylib" "rpcs3.app/Contents/lib/libc++abi.1.dylib"
cp "$(realpath /usr/local/lib/libsharpyuv.0.dylib)" "rpcs3.app/Contents/lib/libsharpyuv.0.dylib"
cp "$(realpath /usr/local/lib/libintl.8.dylib)" "rpcs3.app/Contents/lib/libintl.8.dylib"
rm -rf "rpcs3.app/Contents/Frameworks/QtPdf.framework" \
"rpcs3.app/Contents/Frameworks/QtQml.framework" \
@ -26,34 +29,46 @@ rm -rf "rpcs3.app/Contents/Frameworks/QtPdf.framework" \
"rpcs3.app/Contents/Plugins/virtualkeyboard" \
"rpcs3.app/Contents/Resources/git"
../../.ci/optimize-mac.sh rpcs3.app
# Need to do this rename hack due to case insensitive filesystem
mv rpcs3.app RPCS3_.app
mv RPCS3_.app RPCS3.app
# Hack
install_name_tool \
-delete_rpath /usr/local/lib \
-delete_rpath /usr/local/opt/llvm@$LLVM_COMPILER_VER/lib RPCS3.app/Contents/MacOS/rpcs3
#-delete_rpath /usr/local/Cellar/sdl3/3.2.8/lib
# NOTE: "--deep" is deprecated
codesign --deep -fs - RPCS3.app
echo "[InternetShortcut]" > Quickstart.url
echo "URL=https://rpcs3.net/quickstart" >> Quickstart.url
echo "IconIndex=0" >> Quickstart.url
DMG_FILEPATH="$BUILD_ARTIFACTSTAGINGDIRECTORY/rpcs3-v${COMM_TAG}-${COMM_COUNT}-${COMM_HASH}_macos.dmg"
#DMG_FILEPATH="$BUILD_ARTIFACTSTAGINGDIRECTORY/rpcs3-v${COMM_TAG}-${COMM_COUNT}-${COMM_HASH}_macos.dmg"
#"$BREW_X64_PATH/bin/create-dmg" --volname RPCS3 \
#--window-size 800 400 \
#--icon-size 100 \
#--icon rpcs3.app 200 190 \
#--add-file Quickstart.url Quickstart.url 400 20 \
#--hide-extension rpcs3.app \
#--hide-extension Quickstart.url \
#--app-drop-link 600 185 \
#--skip-jenkins \
#--format ULMO \
#"$DMG_FILEPATH" \
#RPCS3.app
#FILESIZE=$(stat -f %z "$DMG_FILEPATH")
#SHA256SUM=$(shasum -a 256 "$DMG_FILEPATH" | awk '{ print $1 }')
/opt/homebrew/bin/create-dmg --volname RPCS3 \
--window-size 800 400 \
--icon-size 100 \
--icon rpcs3.app 200 190 \
--add-file Quickstart.url Quickstart.url 400 20 \
--hide-extension rpcs3.app \
--hide-extension Quickstart.url \
--app-drop-link 600 185 \
--skip-jenkins \
"$DMG_FILEPATH" \
RPCS3.app
ARCHIVE_FILEPATH="$BUILD_ARTIFACTSTAGINGDIRECTORY/rpcs3-v${COMM_TAG}-${COMM_COUNT}-${COMM_HASH}_macos.7z"
"$BREW_X64_PATH/bin/7z" a -mx9 "$ARCHIVE_FILEPATH" RPCS3.app Quickstart.url
FILESIZE=$(stat -f %z "$ARCHIVE_FILEPATH")
SHA256SUM=$(shasum -a 256 "$ARCHIVE_FILEPATH" | awk '{ print $1 }')
/opt/homebrew/bin/7z a -mx9 rpcs3-v"${COMM_TAG}"-"${COMM_COUNT}"-"${COMM_HASH}"_macos.7z RPCS3.app
FILESIZE=$(stat -f %z "$DMG_FILEPATH")
SHA256SUM=$(shasum -a 256 "$DMG_FILEPATH" | awk '{ print $1 }')
cd ..
echo "${SHA256SUM};${FILESIZE}B" > "$RELEASE_MESSAGE"
cd bin
mv ./rpcs3*_macos.7z "$ARTDIR"

View file

@ -0,0 +1,38 @@
#!/bin/sh -ex
# source ci-vars.env
# shellcheck disable=SC1091
. .ci/ci-vars.env
cd build || exit 1
CPU_ARCH="${1:-x86_64}"
echo "Deploying rpcs3 windows clang $CPU_ARCH"
# BUILD_blablabla is CI specific, so we wrap it for portability
ARTIFACT_DIR=$(cygpath -u "$BUILD_ARTIFACTSTAGINGDIRECTORY")
MSYS2_CLANG_BIN=$(cygpath -w /clang64/bin)
MSYS2_USR_BIN=$(cygpath -w /usr/bin)
echo "Installing dependencies of: ./bin/rpcs3.exe (MSYS2 dir is '$MSYS2_CLANG_BIN', usr dir is '$MSYS2_USR_BIN')"
cmake -DMSYS2_CLANG_BIN="$MSYS2_CLANG_BIN" -DMSYS2_USR_BIN="$MSYS2_USR_BIN" -Dexe=./bin/rpcs3.exe -P ../buildfiles/cmake/CopyRuntimeDependencies.cmake
# Prepare compatibility and SDL database for packaging
mkdir ./bin/config
mkdir ./bin/config/input_configs
curl -fsSL 'https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt' 1> ./bin/config/input_configs/gamecontrollerdb.txt
curl -fsSL 'https://rpcs3.net/compatibility?api=v1&export' | iconv -t UTF-8 1> ./bin/GuiConfigs/compat_database.dat
# Package artifacts
7z a -m0=LZMA2 -mx9 "$BUILD" ./bin/*
# Generate sha256 hashes
# Write to file for GitHub releases
sha256sum "$BUILD" | awk '{ print $1 }' | tee "$BUILD.sha256"
echo "$(cat "$BUILD.sha256");$(stat -c %s "$BUILD")B" > GitHubReleaseMessage.txt
# Move files to publishing directory
mkdir -p "$ARTIFACT_DIR"
cp -- "$BUILD" "$ARTIFACT_DIR"
cp -- "$BUILD.sha256" "$ARTIFACT_DIR"

View file

@ -1,16 +1,22 @@
#!/bin/sh -ex
# BUILD_blablabla is Azure specific, so we wrap it for portability
# First let's print some info about our caches
"$(cygpath -u "$CCACHE_BIN_DIR")"/ccache.exe --show-stats -v
# BUILD_blablabla is CI specific, so we wrap it for portability
ARTIFACT_DIR="$BUILD_ARTIFACTSTAGINGDIRECTORY"
# Remove unecessary files
rm -f ./bin/rpcs3.exp ./bin/rpcs3.lib ./bin/rpcs3.pdb ./bin/vc_redist.x64.exe
rm -rf ./bin/git
# Prepare compatibility database for packaging, as well as
# certificate for ssl (auto-updater)
curl -sL 'https://rpcs3.net/compatibility?api=v1&export' | iconv -t UTF-8 > ./bin/GuiConfigs/compat_database.dat
curl -sL 'https://curl.haxx.se/ca/cacert.pem' > ./bin/cacert.pem
# Prepare compatibility and SDL database for packaging
mkdir ./bin/config
mkdir ./bin/config/input_configs
curl -fsSL 'https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt' 1> ./bin/config/input_configs/gamecontrollerdb.txt
curl -fsSL 'https://rpcs3.net/compatibility?api=v1&export' | iconv -t UTF-8 1> ./bin/GuiConfigs/compat_database.dat
# Download SSL certificate (not needed with CURLSSLOPT_NATIVE_CA)
#curl -fsSL 'https://curl.haxx.se/ca/cacert.pem' 1> ./bin/cacert.pem
# Package artifacts
7z a -m0=LZMA2 -mx9 "$BUILD" ./bin/*

View file

@ -1,5 +1,4 @@
# Variables set by Azure Pipelines
CI_HAS_ARTIFACTS
# Variables set by CI
BUILD_REASON
BUILD_SOURCEVERSION
BUILD_ARTIFACTSTAGINGDIRECTORY
@ -8,6 +7,7 @@ BUILD_SOURCEBRANCHNAME
APPDIR
ARTDIR
RELEASE_MESSAGE
RUN_UNIT_TESTS
# Variables for build matrix
COMPILER
DEPLOY_APPIMAGE

View file

@ -1,13 +0,0 @@
#!/bin/sh -e
# Export variables for later stages of the Azure pipeline
# Values done in this manner will appear as environment variables
# in later stages.
# From pure-sh-bible
# Setting 'IFS' tells 'read' where to split the string.
while IFS='=' read -r key val; do
# Skip over lines containing comments.
[ "${key##\#*}" ] || continue
echo "##vso[task.setvariable variable=$key]$val"
done < ".ci/ci-vars.env"

View file

@ -1,13 +0,0 @@
#!/bin/sh -e
# Export variables for later stages of the Cirrus pipeline
# Values done in this manner will appear as environment variables
# in later stages.
# From pure-sh-bible
# Setting 'IFS' tells 'read' where to split the string.
while IFS='=' read -r key val; do
# Skip over lines containing comments.
[ "${key##\#*}" ] || continue
export "$key"="$val"
done < ".ci/ci-vars.env"

13
.ci/generate-qt-ts.sh Executable file
View file

@ -0,0 +1,13 @@
#!/bin/sh -ex
mkdir -p ../translations
LUPDATE_PATH=$(find /usr -name lupdate -type f 2>/dev/null | head -n 1)
if [ -z "$LUPDATE_PATH" ]; then
echo "Error: lupdate not found!"
exit 1
else
echo "lupdate found at: $LUPDATE_PATH"
$LUPDATE_PATH -recursive . -ts ../translations/rpcs3_template.ts
sed -i 's|filename="\.\./|filename="./|g' ../translations/rpcs3_template.ts
fi

3
.ci/get_keys-windows.sh Normal file → Executable file
View file

@ -1,4 +1,3 @@
#!/bin/sh -ex
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"
curl -fLo "./llvm.lock" "https://github.com/RPCS3/llvm-mirror/releases/download/custom-build-win-${LLVM_VER}/llvmlibs_mt.7z.sha256"

View file

@ -16,7 +16,7 @@ generate_post_data()
EOF
}
curl -s \
curl -fsS \
-H "Authorization: token ${RPCS3_TOKEN}" \
-H "Accept: application/vnd.github.v3+json" \
--data "$(generate_post_data)" "https://api.github.com/repos/$UPLOAD_REPO_FULL_NAME/releases" >> release.json
@ -28,7 +28,7 @@ echo "${id:?}"
upload_file()
{
curl -s \
curl -fsS \
-H "Authorization: token ${RPCS3_TOKEN}" \
-H "Accept: application/vnd.github.v3+json" \
-H "Content-Type: application/octet-stream" \

View file

@ -8,11 +8,11 @@ sed -i '' 's/quarterly/latest/' /etc/pkg/FreeBSD.conf
export ASSUME_ALWAYS_YES=true
pkg info # debug
# Prefer newer Clang than in base system (see also .ci/build-freebsd.sh)
pkg install llvm16
# WITH_LLVM
pkg install "llvm$LLVM_COMPILER_VER"
# Mandatory dependencies (qt6-base and qt6-svg are pulled via qt6-multimedia)
pkg install git ccache cmake ninja qt6-multimedia glew openal-soft ffmpeg
# Mandatory dependencies (qtX-base is pulled via qtX-multimedia)
pkg install git ccache cmake ninja "qt$QT_VER_MAIN-multimedia" "qt$QT_VER_MAIN-svg" glew openal-soft ffmpeg
# Optional dependencies (libevdev is pulled by qt6-base)
pkg install pkgconf alsa-lib pulseaudio sdl2 evdev-proto vulkan-headers vulkan-loader
# Optional dependencies (libevdev is pulled by qtX-base)
pkg install pkgconf alsa-lib pulseaudio sdl3 evdev-proto vulkan-headers vulkan-loader opencv

21
.ci/optimize-mac.sh Executable file
View file

@ -0,0 +1,21 @@
#!/bin/sh
file_path=$(find "$1/Contents/MacOS" -type f -print0 | head -n 1)
if [ -z "$file_path" ]; then
echo "No executable file found in $1/Contents/MacOS" >&2
exit 1
fi
target_architecture="$(lipo "$file_path" -archs)"
if [ -z "$target_architecture" ]; then
exit 1
fi
# shellcheck disable=SC3045
find "$1" -type f -print0 | while IFS= read -r -d '' file; do
echo Thinning "$file" -> "$target_architecture"
lipo "$file" -thin "$target_architecture" -output "$file" || true
done

63
.ci/setup-llvm.sh Normal file
View file

@ -0,0 +1,63 @@
#!/bin/sh -ex
# Resource/dependency URLs
CCACHE_URL="https://github.com/ccache/ccache/releases/download/v4.11.2/ccache-4.11.2-windows-x86_64.zip"
DEP_URLS=" \
$CCACHE_URL"
# CI doesn't make a cache dir if it doesn't exist, so we do it manually
[ -d "$DEPS_CACHE_DIR" ] || mkdir "$DEPS_CACHE_DIR"
# Pull the llvm submodule
# shellcheck disable=SC2046
git submodule -q update --init --depth=1 -- 3rdparty/llvm
# Git bash doesn't have rev, so here it is
rev()
{
echo "$1" | awk '{ for(i = length($0); i != 0; --i) { a = a substr($0, i, 1); } } END { print a }'
}
# Usage: download_and_verify url checksum algo file
# Check to see if a file is already cached, and the checksum matches. If not, download it.
# Tries up to 3 times
download_and_verify()
{
url="$1"
correctChecksum="$2"
algo="$3"
fileName="$4"
for _ in 1 2 3; do
[ -e "$DEPS_CACHE_DIR/$fileName" ] || curl -fLo "$DEPS_CACHE_DIR/$fileName" "$url"
fileChecksum=$("${algo}sum" "$DEPS_CACHE_DIR/$fileName" | awk '{ print $1 }')
[ "$fileChecksum" = "$correctChecksum" ] && return 0
done
return 1;
}
# Some dependencies install here
[ -d "./build/lib_ext/Release-x64" ] || mkdir -p "./build/lib_ext/Release-x64"
for url in $DEP_URLS; do
# Get the filename from the URL and remove query strings (?arg=something).
fileName="$(rev "$(rev "$url" | cut -d'/' -f1)" | cut -d'?' -f1)"
[ -z "$fileName" ] && echo "Unable to parse url: $url" && exit 1
# shellcheck disable=SC1003
case "$url" in
*ccache*) checksum=$CCACHE_SHA; algo="sha256"; outDir="$CCACHE_BIN_DIR" ;;
*) echo "Unknown url resource: $url"; exit 1 ;;
esac
download_and_verify "$url" "$checksum" "$algo" "$fileName"
7z x -y "$DEPS_CACHE_DIR/$fileName" -aos -o"$outDir"
done
# Setup ccache tool
[ -d "$CCACHE_DIR" ] || mkdir -p "$(cygpath -u "$CCACHE_DIR")"
CCACHE_SH_DIR=$(cygpath -u "$CCACHE_BIN_DIR")
mv "$CCACHE_SH_DIR"/ccache-*/* "$CCACHE_SH_DIR"
cp "$CCACHE_SH_DIR"/ccache.exe "$CCACHE_SH_DIR"/cl.exe

View file

@ -0,0 +1,39 @@
#!/bin/sh -ex
CPU_ARCH="${1:-win64}"
COMPILER="${2:-msvc}"
# These are CI specific, so we wrap them for portability
REPO_NAME="$BUILD_REPOSITORY_NAME"
REPO_BRANCH="$BUILD_SOURCEBRANCHNAME"
PR_NUMBER="$BUILD_PR_NUMBER"
# Gather explicit version number and number of commits
COMM_TAG=$(awk '/version{.*}/ { printf("%d.%d.%d", $5, $6, $7) }' ./rpcs3/rpcs3_version.cpp)
COMM_COUNT=$(git rev-list --count HEAD)
COMM_HASH=$(git rev-parse --short=8 HEAD)
# Format the above into filenames
if [ -n "$PR_NUMBER" ]; then
AVVER="${COMM_TAG}-${COMM_HASH}"
BUILD_RAW="rpcs3-v${AVVER}_${CPU_ARCH}_${COMPILER}"
BUILD="${BUILD_RAW}.7z"
else
AVVER="${COMM_TAG}-${COMM_COUNT}"
BUILD_RAW="rpcs3-v${AVVER}-${COMM_HASH}_${CPU_ARCH}_${COMPILER}"
BUILD="${BUILD_RAW}.7z"
fi
# BRANCH is used for experimental build warnings for pr builds, used in main_window.cpp.
# BUILD is the name of the release artifact
# BUILD_RAW is just filename
# AVVER is used for GitHub releases, it is the version number.
BRANCH="${REPO_NAME}/${REPO_BRANCH}"
# SC2129
{
echo "BRANCH=$BRANCH"
echo "BUILD=$BUILD"
echo "BUILD_RAW=$BUILD_RAW"
echo "AVVER=$AVVER"
} >> .ci/ci-vars.env

View file

@ -1,28 +1,22 @@
#!/bin/sh -ex
# These are Azure specific, so we wrap them for portability
REPO_NAME="$BUILD_REPOSITORY_NAME"
REPO_BRANCH="$SYSTEM_PULLREQUEST_SOURCEBRANCH"
PR_NUMBER="$SYSTEM_PULLREQUEST_PULLREQUESTID"
# Resource/dependency URLs
# Qt mirrors can be volatile and slow, so we list 2
#QT_HOST="http://mirrors.ocf.berkeley.edu/qt/"
QT_HOST="http://qt.mirror.constant.com/"
QT_URL_VER=$(echo "$QT_VER" | sed "s/\.//g")
QT_VER_MSVC_UP=$(echo "${QT_VER_MSVC}" | tr '[:lower:]' '[:upper:]')
QT_PREFIX="online/qtsdkrepository/windows_x86/desktop/qt${QT_VER_MAIN}_${QT_URL_VER}/qt.qt${QT_VER_MAIN}.${QT_URL_VER}."
QT_PREFIX="online/qtsdkrepository/windows_x86/desktop/qt${QT_VER_MAIN}_${QT_URL_VER}/qt${QT_VER_MAIN}_${QT_URL_VER}/qt.qt${QT_VER_MAIN}.${QT_URL_VER}."
QT_PREFIX_2="win64_${QT_VER_MSVC}_64/${QT_VER}-0-${QT_DATE}"
QT_SUFFIX="-Windows-Windows_10_22H2-${QT_VER_MSVC_UP}-Windows-Windows_10_22H2-X86_64.7z"
QT_SUFFIX="-Windows-Windows_11_23H2-${QT_VER_MSVC_UP}-Windows-Windows_11_23H2-X86_64.7z"
QT_BASE_URL="${QT_HOST}${QT_PREFIX}${QT_PREFIX_2}qtbase${QT_SUFFIX}"
QT_DECL_URL="${QT_HOST}${QT_PREFIX}${QT_PREFIX_2}qtdeclarative${QT_SUFFIX}"
QT_TOOL_URL="${QT_HOST}${QT_PREFIX}${QT_PREFIX_2}qttools${QT_SUFFIX}"
QT_MM_URL="${QT_HOST}${QT_PREFIX}addons.qtmultimedia.${QT_PREFIX_2}qtmultimedia${QT_SUFFIX}"
QT_SVG_URL="${QT_HOST}${QT_PREFIX}${QT_PREFIX_2}qtsvg${QT_SUFFIX}"
QT_5CMP_URL="${QT_HOST}${QT_PREFIX}qt5compat.${QT_PREFIX_2}qt5compat${QT_SUFFIX}"
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"
LLVMLIBS_URL="https://github.com/RPCS3/llvm-mirror/releases/download/custom-build-win-${LLVM_VER}/llvmlibs_mt.7z"
VULKAN_SDK_URL="https://www.dropbox.com/scl/fi/sjjh0fc4ld281pjbl2xzu/VulkanSDK-${VULKAN_VER}-Installer.exe?rlkey=f6wzc0lvms5vwkt2z3qabfv9d&dl=1"
CCACHE_URL="https://github.com/ccache/ccache/releases/download/v4.11.2/ccache-4.11.2-windows-x86_64.zip"
DEP_URLS=" \
$QT_BASE_URL \
@ -30,18 +24,17 @@ DEP_URLS=" \
$QT_TOOL_URL \
$QT_MM_URL \
$QT_SVG_URL \
$QT_5CMP_URL \
$LLVMLIBS_URL \
$GLSLANG_URL \
$VULKAN_SDK_URL"
$VULKAN_SDK_URL\
$CCACHE_URL"
# Azure pipelines doesn't make a cache dir if it doesn't exist, so we do it manually
[ -d "$CACHE_DIR" ] || mkdir "$CACHE_DIR"
# CI doesn't make a cache dir if it doesn't exist, so we do it manually
[ -d "$DEPS_CACHE_DIR" ] || mkdir "$DEPS_CACHE_DIR"
# Pull all the submodules except llvm, since it is built separately and we just download that build
# Note: Tried to use git submodule status, but it takes over 20 seconds
# shellcheck disable=SC2046
git submodule -q update --init --depth=1 --jobs=8 $(awk '/path/ && !/FAudio/ && !/llvm/ && !/SPIRV/ { print $3 }' .gitmodules)
git submodule -q update --init --depth=1 --jobs=8 $(awk '/path/ && !/FAudio/ && !/llvm/ { print $3 }' .gitmodules)
# Git bash doesn't have rev, so here it is
rev()
@ -60,33 +53,32 @@ download_and_verify()
fileName="$4"
for _ in 1 2 3; do
[ -e "$CACHE_DIR/$fileName" ] || curl -L -o "$CACHE_DIR/$fileName" "$url"
fileChecksum=$("${algo}sum" "$CACHE_DIR/$fileName" | awk '{ print $1 }')
[ -e "$DEPS_CACHE_DIR/$fileName" ] || curl -fLo "$DEPS_CACHE_DIR/$fileName" "$url"
fileChecksum=$("${algo}sum" "$DEPS_CACHE_DIR/$fileName" | awk '{ print $1 }')
[ "$fileChecksum" = "$correctChecksum" ] && return 0
rm "$CACHE_DIR/$fileName"
done
return 1;
}
# Some dependencies install here
[ -d "./lib" ] || mkdir "./lib"
[ -d "./build/lib_ext/Release-x64" ] || mkdir -p "./build/lib_ext/Release-x64"
for url in $DEP_URLS; do
# Get the filename from the URL. Breaks if urls have js args, so don't do that pls
fileName="$(rev "$(rev "$url" | cut -d'/' -f1)")"
# Get the filename from the URL and remove query strings (?arg=something).
fileName="$(rev "$(rev "$url" | cut -d'/' -f1)" | cut -d'?' -f1)"
[ -z "$fileName" ] && echo "Unable to parse url: $url" && exit 1
# shellcheck disable=SC1003
case "$url" in
*qt*) checksum=$(curl -L "${url}.sha1"); algo="sha1"; outDir='C:\Qt\' ;;
*llvm*) checksum=$(curl -L "${url}.sha256"); algo="sha256"; outDir="./3rdparty/llvm" ;;
*glslang*) checksum=$(curl -L "${url}.sha256"); algo="sha256"; outDir="./lib/Release-x64" ;;
*qt*) checksum=$(curl -fL "${url}.sha1"); algo="sha1"; outDir="$QTDIR/" ;;
*llvm*) checksum=$(curl -fL "${url}.sha256"); algo="sha256"; outDir="./build/lib_ext/Release-x64" ;;
*ccache*) checksum=$CCACHE_SHA; algo="sha256"; outDir="$CCACHE_BIN_DIR" ;;
*Vulkan*)
# Vulkan setup needs to be run in batch environment
# Need to subshell this or else it doesn't wait
download_and_verify "$url" "$VULKAN_SDK_SHA" "sha256" "$fileName"
cp "$CACHE_DIR/$fileName" .
cp "$DEPS_CACHE_DIR/$fileName" .
_=$(echo "$fileName --accept-licenses --default-answer --confirm-command install" | cmd)
continue
;;
@ -94,27 +86,11 @@ for url in $DEP_URLS; do
esac
download_and_verify "$url" "$checksum" "$algo" "$fileName"
7z x -y "$CACHE_DIR/$fileName" -aos -o"$outDir"
7z x -y "$DEPS_CACHE_DIR/$fileName" -aos -o"$outDir"
done
# Gather explicit version number and number of commits
COMM_TAG=$(awk '/version{.*}/ { printf("%d.%d.%d", $5, $6, $7) }' ./rpcs3/rpcs3_version.cpp)
COMM_COUNT=$(git rev-list --count HEAD)
COMM_HASH=$(git rev-parse --short=8 HEAD)
# Format the above into filenames
if [ -n "$PR_NUMBER" ]; then
AVVER="${COMM_TAG}-${COMM_HASH}"
BUILD="rpcs3-v${AVVER}_win64.7z"
else
AVVER="${COMM_TAG}-${COMM_COUNT}"
BUILD="rpcs3-v${AVVER}-${COMM_HASH}_win64.7z"
fi
# BRANCH is used for experimental build warnings for pr builds, used in main_window.cpp.
# BUILD is the name of the release artifact
# AVVER is used for GitHub releases, it is the version number.
BRANCH="${REPO_NAME}/${REPO_BRANCH}"
echo "BRANCH=$BRANCH" > .ci/ci-vars.env
echo "BUILD=$BUILD" >> .ci/ci-vars.env
echo "AVVER=$AVVER" >> .ci/ci-vars.env
# Setup ccache tool
[ -d "$CCACHE_DIR" ] || mkdir -p "$(cygpath -u "$CCACHE_DIR")"
CCACHE_SH_DIR=$(cygpath -u "$CCACHE_BIN_DIR")
mv "$CCACHE_SH_DIR"/ccache-*/* "$CCACHE_SH_DIR"
cp "$CCACHE_SH_DIR"/ccache.exe "$CCACHE_SH_DIR"/cl.exe

View file

@ -1,155 +0,0 @@
env:
CIRRUS_CLONE_DEPTH: 0 # Unshallow clone to obtain proper GIT_VERSION
BUILD_REPOSITORY_NAME: $CIRRUS_REPO_FULL_NAME
SYSTEM_PULLREQUEST_SOURCEBRANCH: $CIRRUS_BRANCH
SYSTEM_PULLREQUEST_PULLREQUESTID: $CIRRUS_PR
BUILD_SOURCEVERSION: $CIRRUS_CHANGE_IN_REPO
BUILD_SOURCEBRANCHNAME: $CIRRUS_BRANCH
RPCS3_TOKEN: ENCRYPTED[!a4c3850e29ab150692286a74bec29819d25971a7ec431b86de2a35f7ed90c5b2ab3c93469f9298e30924d843599110e9!]
QT_VER_MAIN: '6'
QT_VER: '6.5.2'
windows_task:
matrix:
- name: Cirrus Windows
windows_container:
image: cirrusci/windowsservercore:visualstudio2019
cpu: 8
memory: 16G
env:
CIRRUS_SHELL: "bash"
COMPILER: msvc
BUILD_ARTIFACTSTAGINGDIRECTORY: ${CIRRUS_WORKING_DIR}\artifacts\
QT_VER_MSVC: 'msvc2019'
QT_DATE: '202307080351'
QTDIR: C:\Qt\${QT_VER}\${QT_VER_MSVC}_64
VULKAN_VER: '1.3.224.1'
VULKAN_SDK_SHA: '2029e652e39ee6a6036cff3765da31e1e6c595fd2413d3cd111dfab7855621ea'
VULKAN_SDK: C:\VulkanSDK\${VULKAN_VER}
CACHE_DIR: "./cache"
UPLOAD_COMMIT_HASH: 7d09e3be30805911226241afbb14f8cdc2eb054e
UPLOAD_REPO_FULL_NAME: "rpcs3/rpcs3-binaries-win"
deps_cache:
folder: "./cache"
#obj_cache:
# folder: "./tmp"
#obj2_cache:
# folder: "./rpcs3/x64"
setup_script:
- './.ci/get_keys-windows.sh'
- './.ci/setup-windows.sh'
# - choco install -y python # Needed for SPIRV, use either this or make a new Docker image
# spirv_script:
# - export PATH=${PATH}:"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin"
# - cd "${CIRRUS_WORKING_DIR}/3rdparty/SPIRV"
# - msbuild.exe spirv.vcxproj //p:Configuration=Release //m
rpcs3_script:
- export PATH=${PATH}:"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin"
- msbuild.exe rpcs3.sln //p:Configuration=Release //m
deploy_script:
- mkdir artifacts
- source './.ci/export-cirrus-vars.sh'
- './.ci/deploy-windows.sh'
artifacts:
name: Artifact
path: "*.7z*"
push_script: |
if [ "$CIRRUS_REPO_OWNER" = "RPCS3" ] && [ -z "$CIRRUS_PR" ] && [ "$CIRRUS_BRANCH" = "master" ]; then
source './.ci/export-cirrus-vars.sh'
'./.ci/github-upload.sh'
fi;
linux_task:
container:
image: rpcs3/rpcs3-ci-focal:1.0
cpu: 4
memory: 16G
env:
BUILD_ARTIFACTSTAGINGDIRECTORY: ${CIRRUS_WORKING_DIR}/artifacts
ARTDIR: ${CIRRUS_WORKING_DIR}/artifacts/
CCACHE_DIR: "/tmp/ccache_dir"
CCACHE_MAXSIZE: 300M
CI_HAS_ARTIFACTS: true
UPLOAD_COMMIT_HASH: d812f1254a1157c80fd402f94446310560f54e5f
UPLOAD_REPO_FULL_NAME: "rpcs3/rpcs3-binaries-linux"
DEPLOY_APPIMAGE: true
APPDIR: "./appdir"
RELEASE_MESSAGE: "../GitHubReleaseMessage.txt"
ccache_cache:
folder: "/tmp/ccache_dir"
matrix:
- name: Cirrus Linux GCC
env:
COMPILER: gcc
gcc_script:
- mkdir artifacts
- ".ci/build-linux.sh"
- name: Cirrus Linux Clang
env:
COMPILER: clang
clang_script:
- mkdir artifacts
- ".ci/build-linux.sh"
artifacts:
name: Artifact
path: "artifacts/*"
push_script: |
if [ "$CIRRUS_REPO_OWNER" = "RPCS3" ] && [ -z "$CIRRUS_PR" ] && [ "$CIRRUS_BRANCH" = "master" ] && [ "$COMPILER" = "gcc" ]; then
COMM_TAG=$(awk '/version{.*}/ { printf("%d.%d.%d", $5, $6, $7) }' ./rpcs3/rpcs3_version.cpp)
COMM_COUNT=$(git rev-list --count HEAD)
COMM_HASH=$(git rev-parse --short=8 HEAD)
export AVVER="${COMM_TAG}-${COMM_COUNT}"
.ci/github-upload.sh
fi;
freebsd_task:
matrix:
- name: Cirrus FreeBSD
freebsd_instance:
image_family: freebsd-13-2
cpu: 8
memory: 8G
env:
CCACHE_MAXSIZE: 300M # 3x clean build, rounded
CCACHE_DIR: /tmp/ccache_dir
ccache_cache:
folder: /tmp/ccache_dir
install_script: "sh -ex ./.ci/install-freebsd.sh"
script: "./.ci/build-freebsd.sh"
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:latest
mac_script:
- mkdir artifacts
- chmod +x ".ci/build-mac.sh"
- chmod +x ".ci/deploy-mac.sh"
- ".ci/build-mac.sh"
env:
BUILD_ARTIFACTSTAGINGDIRECTORY: ${CIRRUS_WORKING_DIR}/artifacts
ARTDIR: ${CIRRUS_WORKING_DIR}/artifacts/
CCACHE_DIR: "/tmp/ccache_dir"
CCACHE_MAXSIZE: 300M
CI_HAS_ARTIFACTS: true
UPLOAD_COMMIT_HASH: 51ae32f468089a8169aaf1567de355ff4a3e0842
UPLOAD_REPO_FULL_NAME: "rpcs3/rpcs3-binaries-mac"
RELEASE_MESSAGE: "../GitHubReleaseMessage.txt"
artifacts:
name: Artifact
path: "artifacts/*"
push_script: |
if [ "$CIRRUS_REPO_OWNER" = "RPCS3" ] && [ -z "$CIRRUS_PR" ] && [ "$CIRRUS_BRANCH" = "master" ]; then
source './.ci/export-cirrus-vars.sh'
.ci/github-upload.sh
fi;

View file

@ -16,4 +16,4 @@ Submitting your test results for Commercial Games must be done on our forums. Pl
# Contributing
Check the [Coding Style Guidelines](https://github.com/RPCS3/rpcs3/wiki/Coding-Style) and [Developer Information](https://github.com/RPCS3/rpcs3/wiki/Developer-Information). If you have any questions, hit us up on our [Discord Server](https://discord.me/RPCS3) in the **#development** channel.
Check the [Coding Style Guidelines](https://github.com/RPCS3/rpcs3/wiki/Coding-Style) and [Developer Information](https://github.com/RPCS3/rpcs3/wiki/Developer-Information). If you have any questions, hit us up on our [Discord Server](https://discord.gg/rpcs3) in the **#development** channel.

1
.github/FUNDING.yml vendored
View file

@ -1,2 +1 @@
patreon: Nekotekina
custom: https://rpcs3.net/alipay

View file

@ -7,7 +7,7 @@ body:
attributes:
value: |
# Summary
Please do not ask for help or report compatibility regressions here, use [RPCS3 Discord server](https://discord.me/RPCS3) or [forums](https://forums.rpcs3.net/) instead.
Please do not ask for help or report compatibility regressions here, use [RPCS3 Discord server](https://discord.gg/rpcs3) or [forums](https://forums.rpcs3.net/) instead.
- type: textarea
id: quick-summary
attributes:
@ -50,7 +50,7 @@ body:
* Completely close RPCS3 and locate the log file.
RPCS3's Log file will be ```RPCS3.log.gz``` (sometimes shows as RPCS3.log with zip icon) or ```RPCS3.log``` (sometimes shows as RPCS3 wtih notepad icon).
* On Windows it will be in the RPCS3 directory near the executable
* On Windows it will be in the ```log``` folder inside your RPCS3 folder.
* On Linux it will be in ```~/.cache/rpcs3/```
* On MacOS it will be in ```~/Library/Caches/rpcs3```. If you're unable to locate it copy paste the path in Spotlight and hit enter.
- type: textarea

View file

@ -7,7 +7,7 @@ body:
attributes:
value: |
# Summary
Please do not ask for help or report compatibility regressions here, use [RPCS3 Discord server](https://discord.me/RPCS3) or [forums](https://forums.rpcs3.net/) instead.
Please do not ask for help or report compatibility regressions here, use [RPCS3 Discord server](https://discord.gg/rpcs3) or [forums](https://forums.rpcs3.net/) instead.
- type: textarea
id: quick-summary
attributes:
@ -36,7 +36,7 @@ body:
* Completely close RPCS3 and locate the log file.
RPCS3's Log file will be ```RPCS3.log.gz``` (sometimes shows as RPCS3.log with zip icon) or ```RPCS3.log``` (sometimes shows as RPCS3 wtih notepad icon).
* On Windows it will be in the RPCS3 directory near the executable
* On Windows it will be in the ```log``` folder inside your RPCS3 folder.
* On Linux it will be in ```~/.cache/rpcs3/```
* On MacOS it will be in ```~/Library/Caches/rpcs3```. If you're unable to locate it copy paste the path in Spotlight and hit enter.
- type: textarea

View file

@ -6,7 +6,7 @@ body:
- type: markdown
attributes:
value: |
Please do not ask for help or report compatibility regressions here, use [RPCS3 Discord server](https://discord.me/RPCS3) or [forums](https://forums.rpcs3.net/) instead.
Please do not ask for help or report compatibility regressions here, use [RPCS3 Discord server](https://discord.gg/rpcs3) or [forums](https://forums.rpcs3.net/) instead.
- type: textarea
id: quick-summary
attributes:
@ -31,6 +31,6 @@ body:
* If this feature is something that a game is trying to use, upload a log file for it.
RPCS3's Log file will be ```RPCS3.log.gz``` (sometimes shows as RPCS3.log with zip icon) or ```RPCS3.log``` (sometimes shows as RPCS3 wtih notepad icon).
* On Windows it will be in the RPCS3 directory near the executable
* On Windows it will be in the ```log``` folder inside your RPCS3 folder.
* On Linux it will be in ```~/.cache/rpcs3/```
* On MacOS it will be in ```~/Library/Caches/rpcs3```. If you're unable to locate it copy paste the path in Spotlight and hit enter.

View file

@ -7,7 +7,7 @@ assignees: ''
---
## Please do not ask for help or report compatibility regressions here, use [RPCS3 Discord server](https://discord.me/RPCS3) or [forums](https://forums.rpcs3.net/) instead.
## Please do not ask for help or report compatibility regressions here, use [RPCS3 Discord server](https://discord.gg/rpcs3) or [forums](https://forums.rpcs3.net/) instead.
You're using the advanced template. You're expected to know what to write in order to fill in all the required information for proper report.

View file

@ -4,7 +4,7 @@ contact_links:
url: https://rpcs3.net/quickstart
about: Everything you need to know to install and configure emulator, and add games
- name: Ask for help
url: https://discord.me/RPCS3
url: https://discord.gg/rpcs3
about: If you have some questions or need help, please use our Discord server instead of GitHub
- name: Report game compatibility
url: https://forums.rpcs3.net/thread-196671.html

18
.github/PR-BUILD.md vendored
View file

@ -1,18 +0,0 @@
## How to test a PR build
Please take into account, that RPCS3 build usually takes some time (about 15 mins), so you can't access a build if a PR was just submitted.
- Open a PR you want to test
- Scroll to the very bottom and locate the **Checks** section
- Click on **Show all checks**
You are supposed to see something like this
![image](https://user-images.githubusercontent.com/10283761/116630952-2cd99e00-a94c-11eb-933e-986d6020ca92.png)
- Click on __Details__ on either **Cirrus Linux GCC** or **Cirrus Windows**
- Click **View more details on Cirrus CI** at the very bottom
![image](https://user-images.githubusercontent.com/10283761/116631111-5e526980-a94c-11eb-95f7-751e6f15e1ea.png)
- Click on the download button for **Artifact** on the **Artifacts** block
![image](https://user-images.githubusercontent.com/10283761/116631322-bee1a680-a94c-11eb-89a3-be365783582e.png)
- Congratulations! You are now downloading an RPCS3 build for that specific PR.
__Please note that PR builds are not supposed to be stable because they contain new changesets.__

View file

@ -1,3 +0,0 @@
<!-- Please include a summary of the change and which issue is fixed. -->
[How to test this PR](.github/PR-BUILD.md)

72
.github/workflows/llvm.yml vendored Normal file
View file

@ -0,0 +1,72 @@
name: Build LLVM
defaults:
run:
shell: bash
on:
workflow_dispatch:
concurrency:
group: ${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true
env:
BUILD_ARTIFACTSTAGINGDIRECTORY: ${{ github.workspace }}/artifacts/
jobs:
Windows_Build:
if: github.event_name == 'workflow_dispatch'
name: LLVM Windows (MSVC)
runs-on: windows-2025
env:
COMPILER: msvc
CCACHE_SHA: '1f39f3ad5aae3fe915e99ad1302633bc8f6718e58fa7c0de2b0ba7e080f0f08c'
CCACHE_BIN_DIR: 'C:\ccache_bin'
CCACHE_DIR: 'C:\ccache'
CCACHE_INODECACHE: 'true'
CCACHE_SLOPPINESS: 'time_macros'
DEPS_CACHE_DIR: ./dependency_cache
steps:
- name: Checkout repository
uses: actions/checkout@main
with:
fetch-depth: 0
- name: Restore Dependencies Cache
uses: actions/cache/restore@main
id: restore-dependencies-cache
with:
path: ${{ env.DEPS_CACHE_DIR }}
key: "${{ runner.os }}-${{ env.COMPILER }}-llvm-${{ env.CCACHE_SHA }}"
restore-keys: ${{ runner.os }}-${{ env.COMPILER }}-llvm
- name: Download and unpack dependencies
run: .ci/setup-llvm.sh
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@main
- name: Compile LLVM
shell: pwsh
run: msbuild 3rdparty\llvm\llvm_build.vcxproj /p:SolutionDir="$(pwd)/" /p:Configuration=Release /v:minimal /p:Platform=x64 /p:PreferredToolArchitecture=x64 /p:CLToolPath=${{ env.CCACHE_BIN_DIR }} /p:UseMultiToolTask=true /p:CustomAfterMicrosoftCommonTargets="${{ github.workspace }}\buildfiles\msvc\ci_only.targets"
- name: Pack up build artifacts
run: |
mkdir -p "${{ env.BUILD_ARTIFACTSTAGINGDIRECTORY }}"
.ci/deploy-llvm.sh
- name: Upload artifacts (7z)
uses: actions/upload-artifact@main
with:
name: LLVM for Windows (MSVC)
path: ${{ env.BUILD_ARTIFACTSTAGINGDIRECTORY }}
compression-level: 0
if-no-files-found: error
- name: Save Dependencies Cache
if: github.ref == 'refs/heads/master'
uses: actions/cache/save@main
with:
path: ${{ env.DEPS_CACHE_DIR }}
key: ${{ steps.restore-dependencies-cache.outputs.cache-primary-key }}

34
.github/workflows/qt-ts.yml vendored Normal file
View file

@ -0,0 +1,34 @@
name: Generate Translation Template
on:
workflow_dispatch:
push:
branches:
- master
paths:
- 'rpcs3/**'
jobs:
Generate_Translation_Template:
name: Generate Translation Template
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@main
- name: Install Qt Tools
run: |
sudo apt update
sudo apt install -y qt6-l10n-tools
- name: Generate .ts file using lupdate (Qt)
working-directory: rpcs3
run: |
../.ci/generate-qt-ts.sh
- name: Upload translation template
uses: actions/upload-artifact@main
with:
name: RPCS3_Translation_Template
path: translations/rpcs3_template.ts
compression-level: 0

444
.github/workflows/rpcs3.yml vendored Normal file
View file

@ -0,0 +1,444 @@
name: Build RPCS3
defaults:
run:
shell: bash
on:
push:
branches:
- master # Only trigger push event on 'master' branch
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true
env:
BUILD_REPOSITORY_NAME: ${{ github.repository }}
BUILD_SOURCEBRANCHNAME: ${{ github.ref_name }}
BUILD_PR_NUMBER: ${{ github.event.pull_request.number }}
BUILD_SOURCEVERSION: ${{ github.sha }}
BUILD_ARTIFACTSTAGINGDIRECTORY: ${{ github.workspace }}/artifacts/
jobs:
Linux_Build:
# Only run push event on master branch of main repo, but run all PRs
if: github.event_name != 'push' || (github.repository == 'RPCS3/rpcs3' && github.ref_name == 'master')
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-24.04
docker_img: "rpcs3/rpcs3-ci-jammy:1.6"
build_sh: "/rpcs3/.ci/build-linux.sh"
compiler: clang
UPLOAD_COMMIT_HASH: d812f1254a1157c80fd402f94446310560f54e5f
UPLOAD_REPO_FULL_NAME: "rpcs3/rpcs3-binaries-linux"
- os: ubuntu-24.04
docker_img: "rpcs3/rpcs3-ci-jammy:1.6"
build_sh: "/rpcs3/.ci/build-linux.sh"
compiler: gcc
- os: ubuntu-24.04-arm
docker_img: "rpcs3/rpcs3-ci-jammy-aarch64:1.6"
build_sh: "/rpcs3/.ci/build-linux-aarch64.sh"
compiler: clang
UPLOAD_COMMIT_HASH: a1d35836e8d45bfc6f63c26f0a3e5d46ef622fe1
UPLOAD_REPO_FULL_NAME: "rpcs3/rpcs3-binaries-linux-arm64"
- os: ubuntu-24.04-arm
docker_img: "rpcs3/rpcs3-ci-jammy-aarch64:1.6"
build_sh: "/rpcs3/.ci/build-linux-aarch64.sh"
compiler: gcc
name: RPCS3 Linux ${{ matrix.os }} ${{ matrix.compiler }}
runs-on: ${{ matrix.os }}
env:
CCACHE_DIR: ${{ github.workspace }}/ccache
DEPLOY_APPIMAGE: true
APPDIR: "/rpcs3/build/appdir"
ARTDIR: "/root/artifacts"
RELEASE_MESSAGE: "/rpcs3/GitHubReleaseMessage.txt"
COMPILER: ${{ matrix.compiler }}
UPLOAD_COMMIT_HASH: ${{ matrix.UPLOAD_COMMIT_HASH }}
UPLOAD_REPO_FULL_NAME: ${{ matrix.UPLOAD_REPO_FULL_NAME }}
RUN_UNIT_TESTS: github.event_name == 'pull_request' && 'ON' || 'OFF'
steps:
- name: Checkout repository
uses: actions/checkout@main
with:
fetch-depth: 0
- name: Restore build Ccache
uses: actions/cache/restore@main
id: restore-build-ccache
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ runner.os }}-ccache-${{ matrix.compiler }}-${{ runner.arch }}-${{github.run_id}}
restore-keys: ${{ runner.os }}-ccache-${{ matrix.compiler }}-${{ runner.arch }}-
- name: Docker setup and build
run: |
docker pull --quiet ${{ matrix.docker_img }}
docker run \
-v $PWD:/rpcs3 \
--env-file .ci/docker.env \
-v ${{ env.CCACHE_DIR }}:/root/.ccache \
-v ${{ env.BUILD_ARTIFACTSTAGINGDIRECTORY }}:${{ env.ARTDIR }} \
${{ matrix.docker_img }} \
${{ matrix.build_sh }}
- name: Upload artifacts
uses: actions/upload-artifact@main
with:
name: RPCS3 for Linux (${{ runner.arch }}, ${{ matrix.compiler }})
path: ${{ env.BUILD_ARTIFACTSTAGINGDIRECTORY }}/*.AppImage
compression-level: 0
- name: Deploy master build to GitHub Releases
if: |
github.event_name != 'pull_request' &&
github.repository == 'RPCS3/rpcs3' &&
github.ref == 'refs/heads/master' &&
matrix.compiler == 'clang'
env:
RPCS3_TOKEN: ${{ secrets.RPCS3_TOKEN }}
run: |
COMM_TAG=$(awk '/version{.*}/ { printf("%d.%d.%d", $5, $6, $7) }' ./rpcs3/rpcs3_version.cpp)
COMM_COUNT=$(git rev-list --count HEAD)
COMM_HASH=$(git rev-parse --short=8 HEAD)
export AVVER="${COMM_TAG}-${COMM_COUNT}"
.ci/github-upload.sh
- name: Save build Ccache
if: github.ref == 'refs/heads/master'
uses: actions/cache/save@main
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ steps.restore-build-ccache.outputs.cache-primary-key }}
Mac_Build:
# Only run push event on master branch of main repo, but run all PRs
if: github.event_name != 'push' || (github.repository == 'RPCS3/rpcs3' && github.ref_name == 'master')
strategy:
fail-fast: false
matrix:
include:
- name: Intel
build_sh: "arch -X86_64 .ci/build-mac.sh"
UPLOAD_COMMIT_HASH: 51ae32f468089a8169aaf1567de355ff4a3e0842
UPLOAD_REPO_FULL_NAME: rpcs3/rpcs3-binaries-mac
- name: Apple Silicon
build_sh: .ci/build-mac-arm64.sh
UPLOAD_COMMIT_HASH: 8e21bdbc40711a3fccd18fbf17b742348b0f4281
UPLOAD_REPO_FULL_NAME: rpcs3/rpcs3-binaries-mac-arm64
name: RPCS3 Mac ${{ matrix.name }}
runs-on: macos-14
env:
CCACHE_DIR: /tmp/ccache_dir
QT_VER: '6.7.3'
QT_VER_MAIN: '6'
LLVM_COMPILER_VER: '19'
RELEASE_MESSAGE: ../GitHubReleaseMessage.txt
UPLOAD_COMMIT_HASH: ${{ matrix.UPLOAD_COMMIT_HASH }}
UPLOAD_REPO_FULL_NAME: ${{ matrix.UPLOAD_REPO_FULL_NAME }}
RUN_UNIT_TESTS: github.event_name == 'pull_request' && 'ON' || 'OFF'
steps:
- name: Checkout repository
uses: actions/checkout@main
with:
fetch-depth: 0
- name: Restore Build Ccache
uses: actions/cache/restore@main
id: restore-build-ccache
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ runner.os }}-ccache-${{ matrix.name }}-${{github.run_id}}
restore-keys: ${{ runner.os }}-ccache-${{ matrix.name }}-
- name: Restore Qt Cache
uses: actions/cache/restore@main
id: restore-qt-cache
with:
path: /tmp/Qt
key: ${{ runner.os }}-qt-${{ matrix.name }}-${{ env.QT_VER }}
restore-keys: ${{ runner.os }}-qt-${{ matrix.name }}-${{ env.QT_VER }}
- name: Build
run: ${{ matrix.build_sh }}
- name: Upload artifacts
uses: actions/upload-artifact@main
with:
name: RPCS3 for Mac (${{ matrix.name }})
path: ${{ env.BUILD_ARTIFACTSTAGINGDIRECTORY }}
compression-level: 0
- name: Export Variables
run: |
while IFS='=' read -r key val; do
# Skip lines that are empty or start with '#'
[[ -z "$key" || "$key" =~ ^# ]] && continue
echo "$key=$val" >> "${{ github.env }}"
done < .ci/ci-vars.env
- name: Deploy master build to GitHub Releases
if: |
github.event_name != 'pull_request' &&
github.repository == 'RPCS3/rpcs3' &&
github.ref == 'refs/heads/master'
env:
RPCS3_TOKEN: ${{ secrets.RPCS3_TOKEN }}
run: .ci/github-upload.sh
- name: Save Build Ccache
if: github.ref == 'refs/heads/master'
uses: actions/cache/save@main
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ steps.restore-build-ccache.outputs.cache-primary-key }}
- name: Save Qt Cache
if: github.ref == 'refs/heads/master'
uses: actions/cache/save@main
with:
path: /tmp/Qt
key: ${{ steps.restore-qt-cache.outputs.cache-primary-key }}
Windows_Build:
# Only run push event on master branch of main repo, but run all PRs
if: github.event_name != 'push' || (github.repository == 'RPCS3/rpcs3' && github.ref_name == 'master')
name: RPCS3 Windows
runs-on: windows-2025
env:
COMPILER: msvc
QT_VER_MAIN: '6'
QT_VER: '6.9.1'
QT_VER_MSVC: 'msvc2022'
QT_DATE: '202505291653'
LLVM_VER: '19.1.7'
VULKAN_VER: '1.3.268.0'
VULKAN_SDK_SHA: '8459ef49bd06b697115ddd3d97c9aec729e849cd775f5be70897718a9b3b9db5'
CCACHE_SHA: '1f39f3ad5aae3fe915e99ad1302633bc8f6718e58fa7c0de2b0ba7e080f0f08c'
CCACHE_BIN_DIR: 'C:\ccache_bin'
CCACHE_DIR: 'C:\ccache'
CCACHE_INODECACHE: 'true'
CCACHE_SLOPPINESS: 'time_macros'
DEPS_CACHE_DIR: ./dependency_cache
UPLOAD_COMMIT_HASH: 7d09e3be30805911226241afbb14f8cdc2eb054e
UPLOAD_REPO_FULL_NAME: "RPCS3/rpcs3-binaries-win"
steps:
- name: Checkout repository
uses: actions/checkout@main
with:
fetch-depth: 0
- name: Setup NuGet
uses: nuget/setup-nuget@v2
- name: Restore NuGet packages
run: nuget restore rpcs3.sln
- name: Setup env
shell: pwsh
run: |
echo "QTDIR=C:\Qt\${{ env.QT_VER }}\${{ env.QT_VER_MSVC }}_64" >> ${{ github.env }}
echo "VULKAN_SDK=C:\VulkanSDK\${{ env.VULKAN_VER }}" >> ${{ github.env }}
- name: Get Cache Keys
run: .ci/get_keys-windows.sh
- name: Restore Build Ccache
uses: actions/cache/restore@main
id: restore-build-ccache
with:
path: ${{ env.CCACHE_DIR }}
key: "${{ runner.os }}-ccache-${{ env.COMPILER }}-${{github.run_id}}"
restore-keys: ${{ runner.os }}-ccache-${{ env.COMPILER }}-
- name: Restore Dependencies Cache
uses: actions/cache/restore@main
id: restore-dependencies-cache
with:
path: ${{ env.DEPS_CACHE_DIR }}
key: "${{ runner.os }}-${{ env.COMPILER }}-${{ env.QT_VER }}-${{ env.VULKAN_SDK_SHA }}-${{ env.CCACHE_SHA }}-${{ hashFiles('llvm.lock') }}"
restore-keys: ${{ runner.os }}-${{ env.COMPILER }}-
- name: Download and unpack dependencies
run: |
.ci/setup-windows.sh
.ci/setup-windows-ci-vars.sh win64 msvc
- name: Export Variables
run: |
while IFS='=' read -r key val; do
# Skip lines that are empty or start with '#'
[[ -z "$key" || "$key" =~ ^# ]] && continue
echo "$key=$val" >> "${{ github.env }}"
done < .ci/ci-vars.env
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@main
- name: Compile RPCS3
shell: pwsh
run: msbuild rpcs3.sln /p:Configuration=Release /v:minimal /p:Platform=x64 /p:PreferredToolArchitecture=x64 /p:CLToolPath=${{ env.CCACHE_BIN_DIR }} /p:UseMultiToolTask=true /p:CustomAfterMicrosoftCommonTargets="${{ github.workspace }}\buildfiles\msvc\ci_only.targets"
- name: Run Unit Tests
if: github.event_name == 'pull_request'
shell: pwsh
run: build\lib\Release-x64\rpcs3_test.exe
- name: Pack up build artifacts
run: |
mkdir -p "${{ env.BUILD_ARTIFACTSTAGINGDIRECTORY }}"
.ci/deploy-windows.sh
- name: Upload artifacts (7z)
uses: actions/upload-artifact@main
with:
name: RPCS3 for Windows (MSVC)
path: ${{ env.BUILD_ARTIFACTSTAGINGDIRECTORY }}
compression-level: 0
if-no-files-found: error
- name: Deploy master build to GitHub Releases
if: |
github.event_name != 'pull_request' &&
github.repository == 'RPCS3/rpcs3' &&
github.ref == 'refs/heads/master'
env:
RPCS3_TOKEN: ${{ secrets.RPCS3_TOKEN }}
run: .ci/github-upload.sh
- name: Save Build Ccache
if: github.ref == 'refs/heads/master'
uses: actions/cache/save@main
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ steps.restore-build-ccache.outputs.cache-primary-key }}
- name: Save Dependencies Cache
if: github.ref == 'refs/heads/master'
uses: actions/cache/save@main
with:
path: ${{ env.DEPS_CACHE_DIR }}
key: ${{ steps.restore-dependencies-cache.outputs.cache-primary-key }}
Windows_Build_Clang:
# Only run push event on master branch of main repo, but run all PRs
if: github.event_name != 'push' || (github.repository == 'RPCS3/rpcs3' && github.ref_name == 'master')
name: RPCS3 Windows Clang
runs-on: windows-2025
strategy:
matrix:
include:
- msys2: clang64
compiler: clang
arch: win64
env:
CCACHE_DIR: 'C:\ccache'
steps:
- name: Checkout repository
uses: actions/checkout@main
with:
fetch-depth: 0
- name: Setup msys2
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.msys2 }}
update: true
cache: true
install: |
mingw-w64-clang-x86_64-clang
mingw-w64-clang-x86_64-ccache
mingw-w64-clang-x86_64-cmake
mingw-w64-clang-x86_64-lld
mingw-w64-clang-x86_64-ninja
mingw-w64-clang-x86_64-llvm
mingw-w64-clang-x86_64-ffmpeg
mingw-w64-clang-x86_64-opencv
mingw-w64-clang-x86_64-glew
mingw-w64-clang-x86_64-vulkan
mingw-w64-clang-x86_64-vulkan-headers
mingw-w64-clang-x86_64-vulkan-loader
mingw-w64-clang-x86_64-gtest
mingw-w64-clang-x86_64-qt6-base
mingw-w64-clang-x86_64-qt6-declarative
mingw-w64-clang-x86_64-qt6-multimedia
mingw-w64-clang-x86_64-qt6-svg
base-devel
curl
git
p7zip
- name: Restore build Ccache
uses: actions/cache/restore@main
id: restore-build-ccache
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ runner.os }}-ccache-${{ matrix.compiler }}-${{ runner.arch }}-${{ github.run_id }}
restore-keys: ${{ runner.os }}-ccache-${{ matrix.compiler }}-${{ runner.arch }}-
- name: Build RPCS3
shell: msys2 {0}
run: |
export CCACHE_DIR=$(cygpath -u "$CCACHE_DIR")
echo "CCACHE_DIR=$CCACHE_DIR"
.ci/setup-windows-ci-vars.sh ${{ matrix.arch }} ${{ matrix.compiler }}
.ci/build-windows-clang.sh
- name: Save build Ccache
if: github.ref == 'refs/heads/master'
uses: actions/cache/save@main
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ steps.restore-build-ccache.outputs.cache-primary-key }}
- name: Upload artifacts
uses: actions/upload-artifact@main
with:
name: RPCS3 for Windows (${{ runner.arch }}, ${{ matrix.compiler }})
path: ${{ env.BUILD_ARTIFACTSTAGINGDIRECTORY }}
compression-level: 0
if-no-files-found: error
FreeBSD_Build:
# Only run push event on master branch of main repo, but run all PRs
if: github.event_name != 'push' || (github.repository == 'RPCS3/rpcs3' && github.ref_name == 'master')
name: RPCS3 FreeBSD
runs-on: ubuntu-latest
timeout-minutes: 60
env:
CCACHE_DIR: ${{ github.workspace }}/ccache
QT_VER_MAIN: '6'
LLVM_COMPILER_VER: '19'
steps:
- name: Checkout repository
uses: actions/checkout@main
with:
fetch-depth: 0
- name: Restore Build Ccache
uses: actions/cache/restore@main
id: restore-build-ccache
with:
path: ${{ env.CCACHE_DIR }}
key: FreeBSD-ccache-${{github.run_id}}
restore-keys: FreeBSD-ccache-
- name: FreeBSD build
id: root
uses: vmactions/freebsd-vm@v1
with:
envs: 'QT_VER_MAIN LLVM_COMPILER_VER CCACHE_DIR'
usesh: true
run: .ci/install-freebsd.sh && .ci/build-freebsd.sh
- name: Save Build Ccache
if: github.ref == 'refs/heads/master'
uses: actions/cache/save@main
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ steps.restore-build-ccache.outputs.cache-primary-key }}

27
.gitignore vendored
View file

@ -35,6 +35,7 @@
/lib
/tmp
/ipch
/packages
/rpcs3/Debug
/rpcs3/Release
@ -55,9 +56,6 @@
/bin/GuiConfigs/*.dat
/bin/GuiConfigs/*.dat.*
# Some data from git
!/bin/git/
# Visual Studio Files
.vs/*
.vscode/*
@ -106,6 +104,10 @@ rpcs3/rpcs3_autogen/*
CMakeLists.txt.user
*.autosave
# Sublime Text
*.sublime-project
*.sublime-workspace
# CLion
/.idea/*
/cmake-build-*/
@ -113,28 +115,9 @@ CMakeLists.txt.user
# macOS
.DS_Store
# 7zlib
/3rdparty/7z/**/*.lib
# yaml-cpp
yaml-cpp.pc
# libusb
/3rdparty/libusb_cmake/config.h
/3rdparty/libusb_cmake/libusb-1.0.pc
# miniupnp
/3rdparty/miniupnp/x64/*
# llvm
/3rdparty/llvm/llvm_build
# legacy llvm
/llvm_build
# ssl certificate
cacert.pem
_ReSharper.*/
CMakeUserPresets.json

49
.gitmodules vendored
View file

@ -4,8 +4,8 @@
ignore = dirty
[submodule "asmjit"]
path = 3rdparty/asmjit/asmjit
url = ../../RPCS3/asmjit.git
branch = aarch64
url = ../../asmjit/asmjit.git
branch = master
ignore = dirty
[submodule "3rdparty/llvm/llvm"]
path = 3rdparty/llvm/llvm
@ -15,14 +15,6 @@
path = 3rdparty/glslang/glslang
url = ../../KhronosGroup/glslang.git
ignore = dirty
[submodule "3rdparty/SPIRV-Tools"]
path = 3rdparty/SPIRV/SPIRV-Tools
url = ../../KhronosGroup/SPIRV-Tools.git
ignore = dirty
[submodule "3rdparty/SPIRV-Headers"]
path = 3rdparty/SPIRV/SPIRV-Headers
url = ../../KhronosGroup/SPIRV-Headers.git
ignore = dirty
[submodule "3rdparty/zlib"]
path = 3rdparty/zlib/zlib
url = ../../madler/zlib
@ -36,10 +28,6 @@
path = 3rdparty/pugixml
url = ../../zeux/pugixml.git
ignore = dirty
[submodule "3rdparty/xxHash"]
path = 3rdparty/xxHash
url = ../../Cyan4973/xxHash.git
ignore = dirty
[submodule "3rdparty/yaml-cpp"]
path = 3rdparty/yaml-cpp/yaml-cpp
url = ../../RPCS3/yaml-cpp.git
@ -87,3 +75,36 @@
[submodule "3rdparty/rtmidi/rtmidi"]
path = 3rdparty/rtmidi/rtmidi
url = ../../thestk/rtmidi
ignore = dirty
[submodule "3rdparty/zstd/zstd"]
path = 3rdparty/zstd/zstd
url = ../../facebook/zstd
ignore = dirty
[submodule "3rdparty/7zip/7zip"]
path = 3rdparty/7zip/7zip
url = ../../ip7z/7zip.git
ignore = dirty
[submodule "3rdparty/OpenAL/openal-soft"]
path = 3rdparty/OpenAL/openal-soft
url = ../../kcat/openal-soft.git
ignore = dirty
[submodule "3rdparty/stblib/stb"]
path = 3rdparty/stblib/stb
url = ../../nothings/stb.git
ignore = dirty
[submodule "3rdparty/opencv/opencv"]
path = 3rdparty/opencv/opencv
url = ../../Megamouse/opencv_minimal.git
ignore = dirty
[submodule "3rdparty/fusion/fusion"]
path = 3rdparty/fusion/fusion
url = ../../xioTechnologies/Fusion.git
ignore = dirty
[submodule "3rdparty/discord-rpc/discord-rpc"]
path = 3rdparty/discord-rpc/discord-rpc
url = ../../Vestrel/discord-rpc
ignore = dirty
[submodule "3rdparty/GPUOpen/VulkanMemoryAllocator"]
path = 3rdparty/GPUOpen/VulkanMemoryAllocator
url = ../../GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git
ignore = dirty

View file

@ -1,264 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include"src\7z.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include"src\7zAlloc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include"src\7zBuf.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include"src\7zCrc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include"src\7zFile.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include"src\7zTypes.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include"src\7zVersion.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include"src\Aes.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include"src\Alloc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include"src\Bcj2.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include"src\Bra.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include"src\Compiler.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include"src\CpuArch.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include"src\Delta.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include"src\DllSecur.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include"src\LzFind.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include"src\LzFindMt.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include"src\LzHash.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include"src\Lzma2Dec.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include"src\Lzma2DecMt.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include"src\Lzma2Enc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include"src\Lzma86.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include"src\LzmaDec.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include"src\LzmaEnc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include"src\LzmaLib.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include"src\MtCoder.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include"src\MtDec.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include"src\Ppmd.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include"src\Ppmd7.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include"src\Precomp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include"src\RotateDefs.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include"src\Sha256.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include"src\Sort.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include"src\Threads.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include"src\Xz.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include"src\XzCrc64.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include"src\XzEnc.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include"src\7zAlloc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include"src\7zArcIn.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include"src\7zBuf.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include"src\7zBuf2.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include"src\7zCrc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include"src\7zCrcOpt.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include"src\7zDec.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include"src\7zFile.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include"src\7zStream.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include"src\Aes.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include"src\AesOpt.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include"src\Alloc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include"src\Bcj2.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include"src\Bcj2Enc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include"src\Bra.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include"src\Bra86.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include"src\BraIA64.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include"src\CpuArch.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include"src\Delta.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include"src\DllSecur.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include"src\LzFind.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include"src\LzFindMt.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include"src\Lzma2Dec.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include"src\Lzma2DecMt.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include"src\Lzma2Enc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include"src\Lzma86Dec.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include"src\Lzma86Enc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include"src\LzmaDec.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include"src\LzmaEnc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include"src\LzmaLib.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include"src\MtCoder.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include"src\MtDec.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include"src\Ppmd7.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include"src\Ppmd7Dec.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include"src\Ppmd7Enc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include"src\Sha256.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include"src\Sort.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include"src\Threads.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include"src\Xz.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include"src\XzCrc64.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include"src\XzCrc64Opt.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include"src\XzDec.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include"src\XzEnc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include"src\XzIn.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View file

@ -1,58 +0,0 @@
# 7z sdk
if(WIN32)
add_library(3rdparty_7z STATIC EXCLUDE_FROM_ALL
src/Sha256.c
src/Ppmd7Dec.c
src/XzDec.c
src/XzEnc.c
src/Lzma2Dec.c
src/XzCrc64.c
src/DllSecur.c
src/Lzma2DecMt.c
src/BraIA64.c
src/7zFile.c
src/7zStream.c
src/Lzma86Enc.c
src/Threads.c
src/7zAlloc.c
src/LzmaEnc.c
src/MtCoder.c
src/Lzma86Dec.c
src/Sort.c
src/LzFindMt.c
src/7zDec.c
src/Bcj2.c
src/Ppmd7.c
src/Bra86.c
src/Bcj2Enc.c
src/7zBuf.c
src/Aes.c
src/AesOpt.c
src/XzCrc64Opt.c
src/7zArcIn.c
src/Lzma2Enc.c
src/Bra.c
src/7zCrcOpt.c
src/7zBuf2.c
src/LzFind.c
src/Ppmd7Enc.c
src/CpuArch.c
src/Delta.c
src/XzIn.c
src/Alloc.c
src/Xz.c
src/LzmaDec.c
src/LzmaLib.c
src/7zCrc.c
src/MtDec.c)
target_include_directories(3rdparty_7z INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
$<INSTALL_INTERFACE:/src>)
target_include_directories(3rdparty_7z INTERFACE 7z)
set_property(TARGET 3rdparty_7z PROPERTY FOLDER "3rdparty/")
else()
add_library(3rdparty_7z INTERFACE)
endif()

204
3rdparty/7z/src/7z.h vendored
View file

@ -1,204 +0,0 @@
/* 7z.h -- 7z interface
2018-07-02 : Igor Pavlov : Public domain */
#ifndef __7Z_H
#define __7Z_H
#include "7zTypes.h"
EXTERN_C_BEGIN
#define k7zStartHeaderSize 0x20
#define k7zSignatureSize 6
extern const Byte k7zSignature[k7zSignatureSize];
typedef struct
{
const Byte *Data;
size_t Size;
} CSzData;
/* CSzCoderInfo & CSzFolder support only default methods */
typedef struct
{
size_t PropsOffset;
UInt32 MethodID;
Byte NumStreams;
Byte PropsSize;
} CSzCoderInfo;
typedef struct
{
UInt32 InIndex;
UInt32 OutIndex;
} CSzBond;
#define SZ_NUM_CODERS_IN_FOLDER_MAX 4
#define SZ_NUM_BONDS_IN_FOLDER_MAX 3
#define SZ_NUM_PACK_STREAMS_IN_FOLDER_MAX 4
typedef struct
{
UInt32 NumCoders;
UInt32 NumBonds;
UInt32 NumPackStreams;
UInt32 UnpackStream;
UInt32 PackStreams[SZ_NUM_PACK_STREAMS_IN_FOLDER_MAX];
CSzBond Bonds[SZ_NUM_BONDS_IN_FOLDER_MAX];
CSzCoderInfo Coders[SZ_NUM_CODERS_IN_FOLDER_MAX];
} CSzFolder;
SRes SzGetNextFolderItem(CSzFolder *f, CSzData *sd);
typedef struct
{
UInt32 Low;
UInt32 High;
} CNtfsFileTime;
typedef struct
{
Byte *Defs; /* MSB 0 bit numbering */
UInt32 *Vals;
} CSzBitUi32s;
typedef struct
{
Byte *Defs; /* MSB 0 bit numbering */
// UInt64 *Vals;
CNtfsFileTime *Vals;
} CSzBitUi64s;
#define SzBitArray_Check(p, i) (((p)[(i) >> 3] & (0x80 >> ((i) & 7))) != 0)
#define SzBitWithVals_Check(p, i) ((p)->Defs && ((p)->Defs[(i) >> 3] & (0x80 >> ((i) & 7))) != 0)
typedef struct
{
UInt32 NumPackStreams;
UInt32 NumFolders;
UInt64 *PackPositions; // NumPackStreams + 1
CSzBitUi32s FolderCRCs; // NumFolders
size_t *FoCodersOffsets; // NumFolders + 1
UInt32 *FoStartPackStreamIndex; // NumFolders + 1
UInt32 *FoToCoderUnpackSizes; // NumFolders + 1
Byte *FoToMainUnpackSizeIndex; // NumFolders
UInt64 *CoderUnpackSizes; // for all coders in all folders
Byte *CodersData;
UInt64 RangeLimit;
} CSzAr;
UInt64 SzAr_GetFolderUnpackSize(const CSzAr *p, UInt32 folderIndex);
SRes SzAr_DecodeFolder(const CSzAr *p, UInt32 folderIndex,
ILookInStream *stream, UInt64 startPos,
Byte *outBuffer, size_t outSize,
ISzAllocPtr allocMain);
typedef struct
{
CSzAr db;
UInt64 startPosAfterHeader;
UInt64 dataPos;
UInt32 NumFiles;
UInt64 *UnpackPositions; // NumFiles + 1
// Byte *IsEmptyFiles;
Byte *IsDirs;
CSzBitUi32s CRCs;
CSzBitUi32s Attribs;
// CSzBitUi32s Parents;
CSzBitUi64s MTime;
CSzBitUi64s CTime;
UInt32 *FolderToFile; // NumFolders + 1
UInt32 *FileToFolder; // NumFiles
size_t *FileNameOffsets; /* in 2-byte steps */
Byte *FileNames; /* UTF-16-LE */
} CSzArEx;
#define SzArEx_IsDir(p, i) (SzBitArray_Check((p)->IsDirs, i))
#define SzArEx_GetFileSize(p, i) ((p)->UnpackPositions[(i) + 1] - (p)->UnpackPositions[i])
void SzArEx_Init(CSzArEx *p);
void SzArEx_Free(CSzArEx *p, ISzAllocPtr alloc);
UInt64 SzArEx_GetFolderStreamPos(const CSzArEx *p, UInt32 folderIndex, UInt32 indexInFolder);
int SzArEx_GetFolderFullPackSize(const CSzArEx *p, UInt32 folderIndex, UInt64 *resSize);
/*
if dest == NULL, the return value specifies the required size of the buffer,
in 16-bit characters, including the null-terminating character.
if dest != NULL, the return value specifies the number of 16-bit characters that
are written to the dest, including the null-terminating character. */
size_t SzArEx_GetFileNameUtf16(const CSzArEx *p, size_t fileIndex, UInt16 *dest);
/*
size_t SzArEx_GetFullNameLen(const CSzArEx *p, size_t fileIndex);
UInt16 *SzArEx_GetFullNameUtf16_Back(const CSzArEx *p, size_t fileIndex, UInt16 *dest);
*/
/*
SzArEx_Extract extracts file from archive
*outBuffer must be 0 before first call for each new archive.
Extracting cache:
If you need to decompress more than one file, you can send
these values from previous call:
*blockIndex,
*outBuffer,
*outBufferSize
You can consider "*outBuffer" as cache of solid block. If your archive is solid,
it will increase decompression speed.
If you use external function, you can declare these 3 cache variables
(blockIndex, outBuffer, outBufferSize) as static in that external function.
Free *outBuffer and set *outBuffer to 0, if you want to flush cache.
*/
SRes SzArEx_Extract(
const CSzArEx *db,
ILookInStream *inStream,
UInt32 fileIndex, /* index of file */
UInt32 *blockIndex, /* index of solid block */
Byte **outBuffer, /* pointer to pointer to output buffer (allocated with allocMain) */
size_t *outBufferSize, /* buffer size for output buffer */
size_t *offset, /* offset of stream for required file in *outBuffer */
size_t *outSizeProcessed, /* size of file in *outBuffer */
ISzAllocPtr allocMain,
ISzAllocPtr allocTemp);
/*
SzArEx_Open Errors:
SZ_ERROR_NO_ARCHIVE
SZ_ERROR_ARCHIVE
SZ_ERROR_UNSUPPORTED
SZ_ERROR_MEM
SZ_ERROR_CRC
SZ_ERROR_INPUT_EOF
SZ_ERROR_FAIL
*/
SRes SzArEx_Open(CSzArEx *p, ILookInStream *inStream,
ISzAllocPtr allocMain, ISzAllocPtr allocTemp);
EXTERN_C_END
#endif

View file

@ -1,80 +0,0 @@
/* 7zAlloc.c -- Allocation functions
2017-04-03 : Igor Pavlov : Public domain */
#include "Precomp.h"
#include <stdlib.h>
#include "7zAlloc.h"
/* #define _SZ_ALLOC_DEBUG */
/* use _SZ_ALLOC_DEBUG to debug alloc/free operations */
#ifdef _SZ_ALLOC_DEBUG
#ifdef _WIN32
#include <windows.h>
#endif
#include <stdio.h>
int g_allocCount = 0;
int g_allocCountTemp = 0;
#endif
void *SzAlloc(ISzAllocPtr p, size_t size)
{
UNUSED_VAR(p);
if (size == 0)
return 0;
#ifdef _SZ_ALLOC_DEBUG
fprintf(stderr, "\nAlloc %10u bytes; count = %10d", (unsigned)size, g_allocCount);
g_allocCount++;
#endif
return malloc(size);
}
void SzFree(ISzAllocPtr p, void *address)
{
UNUSED_VAR(p);
#ifdef _SZ_ALLOC_DEBUG
if (address != 0)
{
g_allocCount--;
fprintf(stderr, "\nFree; count = %10d", g_allocCount);
}
#endif
free(address);
}
void *SzAllocTemp(ISzAllocPtr p, size_t size)
{
UNUSED_VAR(p);
if (size == 0)
return 0;
#ifdef _SZ_ALLOC_DEBUG
fprintf(stderr, "\nAlloc_temp %10u bytes; count = %10d", (unsigned)size, g_allocCountTemp);
g_allocCountTemp++;
#ifdef _WIN32
return HeapAlloc(GetProcessHeap(), 0, size);
#endif
#endif
return malloc(size);
}
void SzFreeTemp(ISzAllocPtr p, void *address)
{
UNUSED_VAR(p);
#ifdef _SZ_ALLOC_DEBUG
if (address != 0)
{
g_allocCountTemp--;
fprintf(stderr, "\nFree_temp; count = %10d", g_allocCountTemp);
}
#ifdef _WIN32
HeapFree(GetProcessHeap(), 0, address);
return;
#endif
#endif
free(address);
}

View file

@ -1,19 +0,0 @@
/* 7zAlloc.h -- Allocation functions
2017-04-03 : Igor Pavlov : Public domain */
#ifndef __7Z_ALLOC_H
#define __7Z_ALLOC_H
#include "7zTypes.h"
EXTERN_C_BEGIN
void *SzAlloc(ISzAllocPtr p, size_t size);
void SzFree(ISzAllocPtr p, void *address);
void *SzAllocTemp(ISzAllocPtr p, size_t size);
void SzFreeTemp(ISzAllocPtr p, void *address);
EXTERN_C_END
#endif

File diff suppressed because it is too large Load diff

View file

@ -1,36 +0,0 @@
/* 7zBuf.c -- Byte Buffer
2017-04-03 : Igor Pavlov : Public domain */
#include "Precomp.h"
#include "7zBuf.h"
void Buf_Init(CBuf *p)
{
p->data = 0;
p->size = 0;
}
int Buf_Create(CBuf *p, size_t size, ISzAllocPtr alloc)
{
p->size = 0;
if (size == 0)
{
p->data = 0;
return 1;
}
p->data = (Byte *)ISzAlloc_Alloc(alloc, size);
if (p->data)
{
p->size = size;
return 1;
}
return 0;
}
void Buf_Free(CBuf *p, ISzAllocPtr alloc)
{
ISzAlloc_Free(alloc, p->data);
p->data = 0;
p->size = 0;
}

View file

@ -1,35 +0,0 @@
/* 7zBuf.h -- Byte Buffer
2017-04-03 : Igor Pavlov : Public domain */
#ifndef __7Z_BUF_H
#define __7Z_BUF_H
#include "7zTypes.h"
EXTERN_C_BEGIN
typedef struct
{
Byte *data;
size_t size;
} CBuf;
void Buf_Init(CBuf *p);
int Buf_Create(CBuf *p, size_t size, ISzAllocPtr alloc);
void Buf_Free(CBuf *p, ISzAllocPtr alloc);
typedef struct
{
Byte *data;
size_t size;
size_t pos;
} CDynBuf;
void DynBuf_Construct(CDynBuf *p);
void DynBuf_SeekToBeg(CDynBuf *p);
int DynBuf_Write(CDynBuf *p, const Byte *buf, size_t size, ISzAllocPtr alloc);
void DynBuf_Free(CDynBuf *p, ISzAllocPtr alloc);
EXTERN_C_END
#endif

View file

@ -1,52 +0,0 @@
/* 7zBuf2.c -- Byte Buffer
2017-04-03 : Igor Pavlov : Public domain */
#include "Precomp.h"
#include <string.h>
#include "7zBuf.h"
void DynBuf_Construct(CDynBuf *p)
{
p->data = 0;
p->size = 0;
p->pos = 0;
}
void DynBuf_SeekToBeg(CDynBuf *p)
{
p->pos = 0;
}
int DynBuf_Write(CDynBuf *p, const Byte *buf, size_t size, ISzAllocPtr alloc)
{
if (size > p->size - p->pos)
{
size_t newSize = p->pos + size;
Byte *data;
newSize += newSize / 4;
data = (Byte *)ISzAlloc_Alloc(alloc, newSize);
if (!data)
return 0;
p->size = newSize;
if (p->pos != 0)
memcpy(data, p->data, p->pos);
ISzAlloc_Free(alloc, p->data);
p->data = data;
}
if (size != 0)
{
memcpy(p->data + p->pos, buf, size);
p->pos += size;
}
return 1;
}
void DynBuf_Free(CDynBuf *p, ISzAllocPtr alloc)
{
ISzAlloc_Free(alloc, p->data);
p->data = 0;
p->size = 0;
p->pos = 0;
}

View file

@ -1,322 +0,0 @@
/* 7zCrc.c -- CRC32 init
2021-04-01 : Igor Pavlov : Public domain */
#include "Precomp.h"
#include "7zCrc.h"
#include "CpuArch.h"
#define kCrcPoly 0xEDB88320
#ifdef MY_CPU_LE
#define CRC_NUM_TABLES 8
#else
#define CRC_NUM_TABLES 9
#define CRC_UINT32_SWAP(v) ((v >> 24) | ((v >> 8) & 0xFF00) | ((v << 8) & 0xFF0000) | (v << 24))
UInt32 MY_FAST_CALL CrcUpdateT1_BeT4(UInt32 v, const void *data, size_t size, const UInt32 *table);
UInt32 MY_FAST_CALL CrcUpdateT1_BeT8(UInt32 v, const void *data, size_t size, const UInt32 *table);
#endif
#ifndef MY_CPU_BE
UInt32 MY_FAST_CALL CrcUpdateT4(UInt32 v, const void *data, size_t size, const UInt32 *table);
UInt32 MY_FAST_CALL CrcUpdateT8(UInt32 v, const void *data, size_t size, const UInt32 *table);
#endif
typedef UInt32 (MY_FAST_CALL *CRC_FUNC)(UInt32 v, const void *data, size_t size, const UInt32 *table);
extern
CRC_FUNC g_CrcUpdateT4;
CRC_FUNC g_CrcUpdateT4;
extern
CRC_FUNC g_CrcUpdateT8;
CRC_FUNC g_CrcUpdateT8;
extern
CRC_FUNC g_CrcUpdateT0_32;
CRC_FUNC g_CrcUpdateT0_32;
extern
CRC_FUNC g_CrcUpdateT0_64;
CRC_FUNC g_CrcUpdateT0_64;
extern
CRC_FUNC g_CrcUpdate;
CRC_FUNC g_CrcUpdate;
UInt32 g_CrcTable[256 * CRC_NUM_TABLES];
UInt32 MY_FAST_CALL CrcUpdate(UInt32 v, const void *data, size_t size)
{
return g_CrcUpdate(v, data, size, g_CrcTable);
}
UInt32 MY_FAST_CALL CrcCalc(const void *data, size_t size)
{
return g_CrcUpdate(CRC_INIT_VAL, data, size, g_CrcTable) ^ CRC_INIT_VAL;
}
#define CRC_UPDATE_BYTE_2(crc, b) (table[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8))
UInt32 MY_FAST_CALL CrcUpdateT1(UInt32 v, const void *data, size_t size, const UInt32 *table);
UInt32 MY_FAST_CALL CrcUpdateT1(UInt32 v, const void *data, size_t size, const UInt32 *table)
{
const Byte *p = (const Byte *)data;
const Byte *pEnd = p + size;
for (; p != pEnd; p++)
v = CRC_UPDATE_BYTE_2(v, *p);
return v;
}
/* ---------- hardware CRC ---------- */
#ifdef MY_CPU_LE
#if defined(MY_CPU_ARM_OR_ARM64)
// #pragma message("ARM*")
#if defined(_MSC_VER)
#if defined(MY_CPU_ARM64)
#if (_MSC_VER >= 1910)
#define USE_ARM64_CRC
#endif
#endif
#elif (defined(__clang__) && (__clang_major__ >= 3)) \
|| (defined(__GNUC__) && (__GNUC__ > 4))
#if !defined(__ARM_FEATURE_CRC32)
#define __ARM_FEATURE_CRC32 1
#if (!defined(__clang__) || (__clang_major__ > 3)) // fix these numbers
#define ATTRIB_CRC __attribute__((__target__("arch=armv8-a+crc")))
#endif
#endif
#if defined(__ARM_FEATURE_CRC32)
#define USE_ARM64_CRC
#include <arm_acle.h>
#endif
#endif
#else
// no hardware CRC
// #define USE_CRC_EMU
#ifdef USE_CRC_EMU
#pragma message("ARM64 CRC emulation")
MY_FORCE_INLINE
UInt32 __crc32b(UInt32 v, UInt32 data)
{
const UInt32 *table = g_CrcTable;
v = CRC_UPDATE_BYTE_2(v, (Byte)data);
return v;
}
MY_FORCE_INLINE
UInt32 __crc32w(UInt32 v, UInt32 data)
{
const UInt32 *table = g_CrcTable;
v = CRC_UPDATE_BYTE_2(v, (Byte)data); data >>= 8;
v = CRC_UPDATE_BYTE_2(v, (Byte)data); data >>= 8;
v = CRC_UPDATE_BYTE_2(v, (Byte)data); data >>= 8;
v = CRC_UPDATE_BYTE_2(v, (Byte)data); data >>= 8;
return v;
}
MY_FORCE_INLINE
UInt32 __crc32d(UInt32 v, UInt64 data)
{
const UInt32 *table = g_CrcTable;
v = CRC_UPDATE_BYTE_2(v, (Byte)data); data >>= 8;
v = CRC_UPDATE_BYTE_2(v, (Byte)data); data >>= 8;
v = CRC_UPDATE_BYTE_2(v, (Byte)data); data >>= 8;
v = CRC_UPDATE_BYTE_2(v, (Byte)data); data >>= 8;
v = CRC_UPDATE_BYTE_2(v, (Byte)data); data >>= 8;
v = CRC_UPDATE_BYTE_2(v, (Byte)data); data >>= 8;
v = CRC_UPDATE_BYTE_2(v, (Byte)data); data >>= 8;
v = CRC_UPDATE_BYTE_2(v, (Byte)data); data >>= 8;
return v;
}
#endif // USE_CRC_EMU
#endif // defined(MY_CPU_ARM64) && defined(MY_CPU_LE)
#if defined(USE_ARM64_CRC) || defined(USE_CRC_EMU)
#define T0_32_UNROLL_BYTES (4 * 4)
#define T0_64_UNROLL_BYTES (4 * 8)
#ifndef ATTRIB_CRC
#define ATTRIB_CRC
#endif
// #pragma message("USE ARM HW CRC")
ATTRIB_CRC
UInt32 MY_FAST_CALL CrcUpdateT0_32(UInt32 v, const void *data, size_t size, const UInt32 *table);
ATTRIB_CRC
UInt32 MY_FAST_CALL CrcUpdateT0_32(UInt32 v, const void *data, size_t size, const UInt32 *table)
{
const Byte *p = (const Byte *)data;
UNUSED_VAR(table);
for (; size != 0 && ((unsigned)(ptrdiff_t)p & (T0_32_UNROLL_BYTES - 1)) != 0; size--)
v = __crc32b(v, *p++);
if (size >= T0_32_UNROLL_BYTES)
{
const Byte *lim = p + size;
size &= (T0_32_UNROLL_BYTES - 1);
lim -= size;
do
{
v = __crc32w(v, *(const UInt32 *)(const void *)(p));
v = __crc32w(v, *(const UInt32 *)(const void *)(p + 4)); p += 2 * 4;
v = __crc32w(v, *(const UInt32 *)(const void *)(p));
v = __crc32w(v, *(const UInt32 *)(const void *)(p + 4)); p += 2 * 4;
}
while (p != lim);
}
for (; size != 0; size--)
v = __crc32b(v, *p++);
return v;
}
ATTRIB_CRC
UInt32 MY_FAST_CALL CrcUpdateT0_64(UInt32 v, const void *data, size_t size, const UInt32 *table);
ATTRIB_CRC
UInt32 MY_FAST_CALL CrcUpdateT0_64(UInt32 v, const void *data, size_t size, const UInt32 *table)
{
const Byte *p = (const Byte *)data;
UNUSED_VAR(table);
for (; size != 0 && ((unsigned)(ptrdiff_t)p & (T0_64_UNROLL_BYTES - 1)) != 0; size--)
v = __crc32b(v, *p++);
if (size >= T0_64_UNROLL_BYTES)
{
const Byte *lim = p + size;
size &= (T0_64_UNROLL_BYTES - 1);
lim -= size;
do
{
v = __crc32d(v, *(const UInt64 *)(const void *)(p));
v = __crc32d(v, *(const UInt64 *)(const void *)(p + 8)); p += 2 * 8;
v = __crc32d(v, *(const UInt64 *)(const void *)(p));
v = __crc32d(v, *(const UInt64 *)(const void *)(p + 8)); p += 2 * 8;
}
while (p != lim);
}
for (; size != 0; size--)
v = __crc32b(v, *p++);
return v;
}
#endif // defined(USE_ARM64_CRC) || defined(USE_CRC_EMU)
#endif // MY_CPU_LE
void MY_FAST_CALL CrcGenerateTable()
{
UInt32 i;
for (i = 0; i < 256; i++)
{
UInt32 r = i;
unsigned j;
for (j = 0; j < 8; j++)
r = (r >> 1) ^ (kCrcPoly & ((UInt32)0 - (r & 1)));
g_CrcTable[i] = r;
}
for (i = 256; i < 256 * CRC_NUM_TABLES; i++)
{
UInt32 r = g_CrcTable[(size_t)i - 256];
g_CrcTable[i] = g_CrcTable[r & 0xFF] ^ (r >> 8);
}
#if CRC_NUM_TABLES < 4
g_CrcUpdate = CrcUpdateT1;
#else
#ifdef MY_CPU_LE
g_CrcUpdateT4 = CrcUpdateT4;
g_CrcUpdate = CrcUpdateT4;
#if CRC_NUM_TABLES >= 8
g_CrcUpdateT8 = CrcUpdateT8;
#ifdef MY_CPU_X86_OR_AMD64
if (!CPU_Is_InOrder())
#endif
g_CrcUpdate = CrcUpdateT8;
#endif
#else
{
#ifndef MY_CPU_BE
UInt32 k = 0x01020304;
const Byte *p = (const Byte *)&k;
if (p[0] == 4 && p[1] == 3)
{
g_CrcUpdateT4 = CrcUpdateT4;
g_CrcUpdate = CrcUpdateT4;
#if CRC_NUM_TABLES >= 8
g_CrcUpdateT8 = CrcUpdateT8;
g_CrcUpdate = CrcUpdateT8;
#endif
}
else if (p[0] != 1 || p[1] != 2)
g_CrcUpdate = CrcUpdateT1;
else
#endif
{
for (i = 256 * CRC_NUM_TABLES - 1; i >= 256; i--)
{
UInt32 x = g_CrcTable[(size_t)i - 256];
g_CrcTable[i] = CRC_UINT32_SWAP(x);
}
g_CrcUpdateT4 = CrcUpdateT1_BeT4;
g_CrcUpdate = CrcUpdateT1_BeT4;
#if CRC_NUM_TABLES >= 8
g_CrcUpdateT8 = CrcUpdateT1_BeT8;
g_CrcUpdate = CrcUpdateT1_BeT8;
#endif
}
}
#endif
#endif
#ifdef MY_CPU_LE
#ifdef USE_ARM64_CRC
if (CPU_IsSupported_CRC32())
{
g_CrcUpdateT0_32 = CrcUpdateT0_32;
g_CrcUpdateT0_64 = CrcUpdateT0_64;
g_CrcUpdate =
#if defined(MY_CPU_ARM)
CrcUpdateT0_32;
#else
CrcUpdateT0_64;
#endif
}
#endif
#ifdef USE_CRC_EMU
g_CrcUpdateT0_32 = CrcUpdateT0_32;
g_CrcUpdateT0_64 = CrcUpdateT0_64;
g_CrcUpdate = CrcUpdateT0_64;
#endif
#endif
}

View file

@ -1,25 +0,0 @@
/* 7zCrc.h -- CRC32 calculation
2013-01-18 : Igor Pavlov : Public domain */
#ifndef __7Z_CRC_H
#define __7Z_CRC_H
#include "7zTypes.h"
EXTERN_C_BEGIN
extern UInt32 g_CrcTable[];
/* Call CrcGenerateTable one time before other CRC functions */
void MY_FAST_CALL CrcGenerateTable(void);
#define CRC_INIT_VAL 0xFFFFFFFF
#define CRC_GET_DIGEST(crc) ((crc) ^ CRC_INIT_VAL)
#define CRC_UPDATE_BYTE(crc, b) (g_CrcTable[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8))
UInt32 MY_FAST_CALL CrcUpdate(UInt32 crc, const void *data, size_t size);
UInt32 MY_FAST_CALL CrcCalc(const void *data, size_t size);
EXTERN_C_END
#endif

View file

@ -1,117 +0,0 @@
/* 7zCrcOpt.c -- CRC32 calculation
2021-02-09 : Igor Pavlov : Public domain */
#include "Precomp.h"
#include "CpuArch.h"
#ifndef MY_CPU_BE
#define CRC_UPDATE_BYTE_2(crc, b) (table[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8))
UInt32 MY_FAST_CALL CrcUpdateT4(UInt32 v, const void *data, size_t size, const UInt32 *table);
UInt32 MY_FAST_CALL CrcUpdateT4(UInt32 v, const void *data, size_t size, const UInt32 *table)
{
const Byte *p = (const Byte *)data;
for (; size > 0 && ((unsigned)(ptrdiff_t)p & 3) != 0; size--, p++)
v = CRC_UPDATE_BYTE_2(v, *p);
for (; size >= 4; size -= 4, p += 4)
{
v ^= *(const UInt32 *)(const void *)p;
v =
(table + 0x300)[((v ) & 0xFF)]
^ (table + 0x200)[((v >> 8) & 0xFF)]
^ (table + 0x100)[((v >> 16) & 0xFF)]
^ (table + 0x000)[((v >> 24))];
}
for (; size > 0; size--, p++)
v = CRC_UPDATE_BYTE_2(v, *p);
return v;
}
UInt32 MY_FAST_CALL CrcUpdateT8(UInt32 v, const void *data, size_t size, const UInt32 *table);
UInt32 MY_FAST_CALL CrcUpdateT8(UInt32 v, const void *data, size_t size, const UInt32 *table)
{
const Byte *p = (const Byte *)data;
for (; size > 0 && ((unsigned)(ptrdiff_t)p & 7) != 0; size--, p++)
v = CRC_UPDATE_BYTE_2(v, *p);
for (; size >= 8; size -= 8, p += 8)
{
UInt32 d;
v ^= *(const UInt32 *)(const void *)p;
v =
(table + 0x700)[((v ) & 0xFF)]
^ (table + 0x600)[((v >> 8) & 0xFF)]
^ (table + 0x500)[((v >> 16) & 0xFF)]
^ (table + 0x400)[((v >> 24))];
d = *((const UInt32 *)(const void *)p + 1);
v ^=
(table + 0x300)[((d ) & 0xFF)]
^ (table + 0x200)[((d >> 8) & 0xFF)]
^ (table + 0x100)[((d >> 16) & 0xFF)]
^ (table + 0x000)[((d >> 24))];
}
for (; size > 0; size--, p++)
v = CRC_UPDATE_BYTE_2(v, *p);
return v;
}
#endif
#ifndef MY_CPU_LE
#define CRC_UINT32_SWAP(v) ((v >> 24) | ((v >> 8) & 0xFF00) | ((v << 8) & 0xFF0000) | (v << 24))
#define CRC_UPDATE_BYTE_2_BE(crc, b) (table[(((crc) >> 24) ^ (b))] ^ ((crc) << 8))
UInt32 MY_FAST_CALL CrcUpdateT1_BeT4(UInt32 v, const void *data, size_t size, const UInt32 *table)
{
const Byte *p = (const Byte *)data;
table += 0x100;
v = CRC_UINT32_SWAP(v);
for (; size > 0 && ((unsigned)(ptrdiff_t)p & 3) != 0; size--, p++)
v = CRC_UPDATE_BYTE_2_BE(v, *p);
for (; size >= 4; size -= 4, p += 4)
{
v ^= *(const UInt32 *)(const void *)p;
v =
(table + 0x000)[((v ) & 0xFF)]
^ (table + 0x100)[((v >> 8) & 0xFF)]
^ (table + 0x200)[((v >> 16) & 0xFF)]
^ (table + 0x300)[((v >> 24))];
}
for (; size > 0; size--, p++)
v = CRC_UPDATE_BYTE_2_BE(v, *p);
return CRC_UINT32_SWAP(v);
}
UInt32 MY_FAST_CALL CrcUpdateT1_BeT8(UInt32 v, const void *data, size_t size, const UInt32 *table)
{
const Byte *p = (const Byte *)data;
table += 0x100;
v = CRC_UINT32_SWAP(v);
for (; size > 0 && ((unsigned)(ptrdiff_t)p & 7) != 0; size--, p++)
v = CRC_UPDATE_BYTE_2_BE(v, *p);
for (; size >= 8; size -= 8, p += 8)
{
UInt32 d;
v ^= *(const UInt32 *)(const void *)p;
v =
(table + 0x400)[((v ) & 0xFF)]
^ (table + 0x500)[((v >> 8) & 0xFF)]
^ (table + 0x600)[((v >> 16) & 0xFF)]
^ (table + 0x700)[((v >> 24))];
d = *((const UInt32 *)(const void *)p + 1);
v ^=
(table + 0x000)[((d ) & 0xFF)]
^ (table + 0x100)[((d >> 8) & 0xFF)]
^ (table + 0x200)[((d >> 16) & 0xFF)]
^ (table + 0x300)[((d >> 24))];
}
for (; size > 0; size--, p++)
v = CRC_UPDATE_BYTE_2_BE(v, *p);
return CRC_UINT32_SWAP(v);
}
#endif

View file

@ -1,600 +0,0 @@
/* 7zDec.c -- Decoding from 7z folder
2021-02-09 : Igor Pavlov : Public domain */
#include "Precomp.h"
#include <string.h>
/* #define _7ZIP_PPMD_SUPPPORT */
#include "7z.h"
#include "7zCrc.h"
#include "Bcj2.h"
#include "Bra.h"
#include "CpuArch.h"
#include "Delta.h"
#include "LzmaDec.h"
#include "Lzma2Dec.h"
#ifdef _7ZIP_PPMD_SUPPPORT
#include "Ppmd7.h"
#endif
#define k_Copy 0
#ifndef _7Z_NO_METHOD_LZMA2
#define k_LZMA2 0x21
#endif
#define k_LZMA 0x30101
#define k_BCJ2 0x303011B
#ifndef _7Z_NO_METHODS_FILTERS
#define k_Delta 3
#define k_BCJ 0x3030103
#define k_PPC 0x3030205
#define k_IA64 0x3030401
#define k_ARM 0x3030501
#define k_ARMT 0x3030701
#define k_SPARC 0x3030805
#endif
#ifdef _7ZIP_PPMD_SUPPPORT
#define k_PPMD 0x30401
typedef struct
{
IByteIn vt;
const Byte *cur;
const Byte *end;
const Byte *begin;
UInt64 processed;
BoolInt extra;
SRes res;
const ILookInStream *inStream;
} CByteInToLook;
static Byte ReadByte(const IByteIn *pp)
{
CByteInToLook *p = CONTAINER_FROM_VTBL(pp, CByteInToLook, vt);
if (p->cur != p->end)
return *p->cur++;
if (p->res == SZ_OK)
{
size_t size = (size_t)(p->cur - p->begin);
p->processed += size;
p->res = ILookInStream_Skip(p->inStream, size);
size = (1 << 25);
p->res = ILookInStream_Look(p->inStream, (const void **)&p->begin, &size);
p->cur = p->begin;
p->end = p->begin + size;
if (size != 0)
return *p->cur++;;
}
p->extra = True;
return 0;
}
static SRes SzDecodePpmd(const Byte *props, unsigned propsSize, UInt64 inSize, const ILookInStream *inStream,
Byte *outBuffer, SizeT outSize, ISzAllocPtr allocMain)
{
CPpmd7 ppmd;
CByteInToLook s;
SRes res = SZ_OK;
s.vt.Read = ReadByte;
s.inStream = inStream;
s.begin = s.end = s.cur = NULL;
s.extra = False;
s.res = SZ_OK;
s.processed = 0;
if (propsSize != 5)
return SZ_ERROR_UNSUPPORTED;
{
unsigned order = props[0];
UInt32 memSize = GetUi32(props + 1);
if (order < PPMD7_MIN_ORDER ||
order > PPMD7_MAX_ORDER ||
memSize < PPMD7_MIN_MEM_SIZE ||
memSize > PPMD7_MAX_MEM_SIZE)
return SZ_ERROR_UNSUPPORTED;
Ppmd7_Construct(&ppmd);
if (!Ppmd7_Alloc(&ppmd, memSize, allocMain))
return SZ_ERROR_MEM;
Ppmd7_Init(&ppmd, order);
}
{
ppmd.rc.dec.Stream = &s.vt;
if (!Ppmd7z_RangeDec_Init(&ppmd.rc.dec))
res = SZ_ERROR_DATA;
else if (!s.extra)
{
Byte *buf = outBuffer;
const Byte *lim = buf + outSize;
for (; buf != lim; buf++)
{
int sym = Ppmd7z_DecodeSymbol(&ppmd);
if (s.extra || sym < 0)
break;
*buf = (Byte)sym;
}
if (buf != lim)
res = SZ_ERROR_DATA;
else if (!Ppmd7z_RangeDec_IsFinishedOK(&ppmd.rc.dec))
{
/* if (Ppmd7z_DecodeSymbol(&ppmd) != PPMD7_SYM_END || !Ppmd7z_RangeDec_IsFinishedOK(&ppmd.rc.dec)) */
res = SZ_ERROR_DATA;
}
}
if (s.extra)
res = (s.res != SZ_OK ? s.res : SZ_ERROR_DATA);
else if (s.processed + (size_t)(s.cur - s.begin) != inSize)
res = SZ_ERROR_DATA;
}
Ppmd7_Free(&ppmd, allocMain);
return res;
}
#endif
static SRes SzDecodeLzma(const Byte *props, unsigned propsSize, UInt64 inSize, ILookInStream *inStream,
Byte *outBuffer, SizeT outSize, ISzAllocPtr allocMain)
{
CLzmaDec state;
SRes res = SZ_OK;
LzmaDec_Construct(&state);
RINOK(LzmaDec_AllocateProbs(&state, props, propsSize, allocMain));
state.dic = outBuffer;
state.dicBufSize = outSize;
LzmaDec_Init(&state);
for (;;)
{
const void *inBuf = NULL;
size_t lookahead = (1 << 18);
if (lookahead > inSize)
lookahead = (size_t)inSize;
res = ILookInStream_Look(inStream, &inBuf, &lookahead);
if (res != SZ_OK)
break;
{
SizeT inProcessed = (SizeT)lookahead, dicPos = state.dicPos;
ELzmaStatus status;
res = LzmaDec_DecodeToDic(&state, outSize, (const Byte *)inBuf, &inProcessed, LZMA_FINISH_END, &status);
lookahead -= inProcessed;
inSize -= inProcessed;
if (res != SZ_OK)
break;
if (status == LZMA_STATUS_FINISHED_WITH_MARK)
{
if (outSize != state.dicPos || inSize != 0)
res = SZ_ERROR_DATA;
break;
}
if (outSize == state.dicPos && inSize == 0 && status == LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK)
break;
if (inProcessed == 0 && dicPos == state.dicPos)
{
res = SZ_ERROR_DATA;
break;
}
res = ILookInStream_Skip(inStream, inProcessed);
if (res != SZ_OK)
break;
}
}
LzmaDec_FreeProbs(&state, allocMain);
return res;
}
#ifndef _7Z_NO_METHOD_LZMA2
static SRes SzDecodeLzma2(const Byte *props, unsigned propsSize, UInt64 inSize, ILookInStream *inStream,
Byte *outBuffer, SizeT outSize, ISzAllocPtr allocMain)
{
CLzma2Dec state;
SRes res = SZ_OK;
Lzma2Dec_Construct(&state);
if (propsSize != 1)
return SZ_ERROR_DATA;
RINOK(Lzma2Dec_AllocateProbs(&state, props[0], allocMain));
state.decoder.dic = outBuffer;
state.decoder.dicBufSize = outSize;
Lzma2Dec_Init(&state);
for (;;)
{
const void *inBuf = NULL;
size_t lookahead = (1 << 18);
if (lookahead > inSize)
lookahead = (size_t)inSize;
res = ILookInStream_Look(inStream, &inBuf, &lookahead);
if (res != SZ_OK)
break;
{
SizeT inProcessed = (SizeT)lookahead, dicPos = state.decoder.dicPos;
ELzmaStatus status;
res = Lzma2Dec_DecodeToDic(&state, outSize, (const Byte *)inBuf, &inProcessed, LZMA_FINISH_END, &status);
lookahead -= inProcessed;
inSize -= inProcessed;
if (res != SZ_OK)
break;
if (status == LZMA_STATUS_FINISHED_WITH_MARK)
{
if (outSize != state.decoder.dicPos || inSize != 0)
res = SZ_ERROR_DATA;
break;
}
if (inProcessed == 0 && dicPos == state.decoder.dicPos)
{
res = SZ_ERROR_DATA;
break;
}
res = ILookInStream_Skip(inStream, inProcessed);
if (res != SZ_OK)
break;
}
}
Lzma2Dec_FreeProbs(&state, allocMain);
return res;
}
#endif
static SRes SzDecodeCopy(UInt64 inSize, ILookInStream *inStream, Byte *outBuffer)
{
while (inSize > 0)
{
const void *inBuf;
size_t curSize = (1 << 18);
if (curSize > inSize)
curSize = (size_t)inSize;
RINOK(ILookInStream_Look(inStream, &inBuf, &curSize));
if (curSize == 0)
return SZ_ERROR_INPUT_EOF;
memcpy(outBuffer, inBuf, curSize);
outBuffer += curSize;
inSize -= curSize;
RINOK(ILookInStream_Skip(inStream, curSize));
}
return SZ_OK;
}
static BoolInt IS_MAIN_METHOD(UInt32 m)
{
switch (m)
{
case k_Copy:
case k_LZMA:
#ifndef _7Z_NO_METHOD_LZMA2
case k_LZMA2:
#endif
#ifdef _7ZIP_PPMD_SUPPPORT
case k_PPMD:
#endif
return True;
}
return False;
}
static BoolInt IS_SUPPORTED_CODER(const CSzCoderInfo *c)
{
return
c->NumStreams == 1
/* && c->MethodID <= (UInt32)0xFFFFFFFF */
&& IS_MAIN_METHOD((UInt32)c->MethodID);
}
#define IS_BCJ2(c) ((c)->MethodID == k_BCJ2 && (c)->NumStreams == 4)
static SRes CheckSupportedFolder(const CSzFolder *f)
{
if (f->NumCoders < 1 || f->NumCoders > 4)
return SZ_ERROR_UNSUPPORTED;
if (!IS_SUPPORTED_CODER(&f->Coders[0]))
return SZ_ERROR_UNSUPPORTED;
if (f->NumCoders == 1)
{
if (f->NumPackStreams != 1 || f->PackStreams[0] != 0 || f->NumBonds != 0)
return SZ_ERROR_UNSUPPORTED;
return SZ_OK;
}
#ifndef _7Z_NO_METHODS_FILTERS
if (f->NumCoders == 2)
{
const CSzCoderInfo *c = &f->Coders[1];
if (
/* c->MethodID > (UInt32)0xFFFFFFFF || */
c->NumStreams != 1
|| f->NumPackStreams != 1
|| f->PackStreams[0] != 0
|| f->NumBonds != 1
|| f->Bonds[0].InIndex != 1
|| f->Bonds[0].OutIndex != 0)
return SZ_ERROR_UNSUPPORTED;
switch ((UInt32)c->MethodID)
{
case k_Delta:
case k_BCJ:
case k_PPC:
case k_IA64:
case k_SPARC:
case k_ARM:
case k_ARMT:
break;
default:
return SZ_ERROR_UNSUPPORTED;
}
return SZ_OK;
}
#endif
if (f->NumCoders == 4)
{
if (!IS_SUPPORTED_CODER(&f->Coders[1])
|| !IS_SUPPORTED_CODER(&f->Coders[2])
|| !IS_BCJ2(&f->Coders[3]))
return SZ_ERROR_UNSUPPORTED;
if (f->NumPackStreams != 4
|| f->PackStreams[0] != 2
|| f->PackStreams[1] != 6
|| f->PackStreams[2] != 1
|| f->PackStreams[3] != 0
|| f->NumBonds != 3
|| f->Bonds[0].InIndex != 5 || f->Bonds[0].OutIndex != 0
|| f->Bonds[1].InIndex != 4 || f->Bonds[1].OutIndex != 1
|| f->Bonds[2].InIndex != 3 || f->Bonds[2].OutIndex != 2)
return SZ_ERROR_UNSUPPORTED;
return SZ_OK;
}
return SZ_ERROR_UNSUPPORTED;
}
#ifndef _7Z_NO_METHODS_FILTERS
#define CASE_BRA_CONV(isa) case k_ ## isa: isa ## _Convert(outBuffer, outSize, 0, 0); break;
#endif
static SRes SzFolder_Decode2(const CSzFolder *folder,
const Byte *propsData,
const UInt64 *unpackSizes,
const UInt64 *packPositions,
ILookInStream *inStream, UInt64 startPos,
Byte *outBuffer, SizeT outSize, ISzAllocPtr allocMain,
Byte *tempBuf[])
{
UInt32 ci;
SizeT tempSizes[3] = { 0, 0, 0};
SizeT tempSize3 = 0;
Byte *tempBuf3 = 0;
RINOK(CheckSupportedFolder(folder));
for (ci = 0; ci < folder->NumCoders; ci++)
{
const CSzCoderInfo *coder = &folder->Coders[ci];
if (IS_MAIN_METHOD((UInt32)coder->MethodID))
{
UInt32 si = 0;
UInt64 offset;
UInt64 inSize;
Byte *outBufCur = outBuffer;
SizeT outSizeCur = outSize;
if (folder->NumCoders == 4)
{
UInt32 indices[] = { 3, 2, 0 };
UInt64 unpackSize = unpackSizes[ci];
si = indices[ci];
if (ci < 2)
{
Byte *temp;
outSizeCur = (SizeT)unpackSize;
if (outSizeCur != unpackSize)
return SZ_ERROR_MEM;
temp = (Byte *)ISzAlloc_Alloc(allocMain, outSizeCur);
if (!temp && outSizeCur != 0)
return SZ_ERROR_MEM;
outBufCur = tempBuf[1 - ci] = temp;
tempSizes[1 - ci] = outSizeCur;
}
else if (ci == 2)
{
if (unpackSize > outSize) /* check it */
return SZ_ERROR_PARAM;
tempBuf3 = outBufCur = outBuffer + (outSize - (size_t)unpackSize);
tempSize3 = outSizeCur = (SizeT)unpackSize;
}
else
return SZ_ERROR_UNSUPPORTED;
}
offset = packPositions[si];
inSize = packPositions[(size_t)si + 1] - offset;
RINOK(LookInStream_SeekTo(inStream, startPos + offset));
if (coder->MethodID == k_Copy)
{
if (inSize != outSizeCur) /* check it */
return SZ_ERROR_DATA;
RINOK(SzDecodeCopy(inSize, inStream, outBufCur));
}
else if (coder->MethodID == k_LZMA)
{
RINOK(SzDecodeLzma(propsData + coder->PropsOffset, coder->PropsSize, inSize, inStream, outBufCur, outSizeCur, allocMain));
}
#ifndef _7Z_NO_METHOD_LZMA2
else if (coder->MethodID == k_LZMA2)
{
RINOK(SzDecodeLzma2(propsData + coder->PropsOffset, coder->PropsSize, inSize, inStream, outBufCur, outSizeCur, allocMain));
}
#endif
#ifdef _7ZIP_PPMD_SUPPPORT
else if (coder->MethodID == k_PPMD)
{
RINOK(SzDecodePpmd(propsData + coder->PropsOffset, coder->PropsSize, inSize, inStream, outBufCur, outSizeCur, allocMain));
}
#endif
else
return SZ_ERROR_UNSUPPORTED;
}
else if (coder->MethodID == k_BCJ2)
{
UInt64 offset = packPositions[1];
UInt64 s3Size = packPositions[2] - offset;
if (ci != 3)
return SZ_ERROR_UNSUPPORTED;
tempSizes[2] = (SizeT)s3Size;
if (tempSizes[2] != s3Size)
return SZ_ERROR_MEM;
tempBuf[2] = (Byte *)ISzAlloc_Alloc(allocMain, tempSizes[2]);
if (!tempBuf[2] && tempSizes[2] != 0)
return SZ_ERROR_MEM;
RINOK(LookInStream_SeekTo(inStream, startPos + offset));
RINOK(SzDecodeCopy(s3Size, inStream, tempBuf[2]));
if ((tempSizes[0] & 3) != 0 ||
(tempSizes[1] & 3) != 0 ||
tempSize3 + tempSizes[0] + tempSizes[1] != outSize)
return SZ_ERROR_DATA;
{
CBcj2Dec p;
p.bufs[0] = tempBuf3; p.lims[0] = tempBuf3 + tempSize3;
p.bufs[1] = tempBuf[0]; p.lims[1] = tempBuf[0] + tempSizes[0];
p.bufs[2] = tempBuf[1]; p.lims[2] = tempBuf[1] + tempSizes[1];
p.bufs[3] = tempBuf[2]; p.lims[3] = tempBuf[2] + tempSizes[2];
p.dest = outBuffer;
p.destLim = outBuffer + outSize;
Bcj2Dec_Init(&p);
RINOK(Bcj2Dec_Decode(&p));
{
unsigned i;
for (i = 0; i < 4; i++)
if (p.bufs[i] != p.lims[i])
return SZ_ERROR_DATA;
if (!Bcj2Dec_IsFinished(&p))
return SZ_ERROR_DATA;
if (p.dest != p.destLim
|| p.state != BCJ2_STREAM_MAIN)
return SZ_ERROR_DATA;
}
}
}
#ifndef _7Z_NO_METHODS_FILTERS
else if (ci == 1)
{
if (coder->MethodID == k_Delta)
{
if (coder->PropsSize != 1)
return SZ_ERROR_UNSUPPORTED;
{
Byte state[DELTA_STATE_SIZE];
Delta_Init(state);
Delta_Decode(state, (unsigned)(propsData[coder->PropsOffset]) + 1, outBuffer, outSize);
}
}
else
{
if (coder->PropsSize != 0)
return SZ_ERROR_UNSUPPORTED;
switch (coder->MethodID)
{
case k_BCJ:
{
UInt32 state;
x86_Convert_Init(state);
x86_Convert(outBuffer, outSize, 0, &state, 0);
break;
}
CASE_BRA_CONV(PPC)
CASE_BRA_CONV(IA64)
CASE_BRA_CONV(SPARC)
CASE_BRA_CONV(ARM)
CASE_BRA_CONV(ARMT)
default:
return SZ_ERROR_UNSUPPORTED;
}
}
}
#endif
else
return SZ_ERROR_UNSUPPORTED;
}
return SZ_OK;
}
SRes SzAr_DecodeFolder(const CSzAr *p, UInt32 folderIndex,
ILookInStream *inStream, UInt64 startPos,
Byte *outBuffer, size_t outSize,
ISzAllocPtr allocMain)
{
SRes res;
CSzFolder folder;
CSzData sd;
const Byte *data = p->CodersData + p->FoCodersOffsets[folderIndex];
sd.Data = data;
sd.Size = p->FoCodersOffsets[(size_t)folderIndex + 1] - p->FoCodersOffsets[folderIndex];
res = SzGetNextFolderItem(&folder, &sd);
if (res != SZ_OK)
return res;
if (sd.Size != 0
|| folder.UnpackStream != p->FoToMainUnpackSizeIndex[folderIndex]
|| outSize != SzAr_GetFolderUnpackSize(p, folderIndex))
return SZ_ERROR_FAIL;
{
unsigned i;
Byte *tempBuf[3] = { 0, 0, 0};
res = SzFolder_Decode2(&folder, data,
&p->CoderUnpackSizes[p->FoToCoderUnpackSizes[folderIndex]],
p->PackPositions + p->FoStartPackStreamIndex[folderIndex],
inStream, startPos,
outBuffer, (SizeT)outSize, allocMain, tempBuf);
for (i = 0; i < 3; i++)
ISzAlloc_Free(allocMain, tempBuf[i]);
if (res == SZ_OK)
if (SzBitWithVals_Check(&p->FolderCRCs, folderIndex))
if (CrcCalc(outBuffer, outSize) != p->FolderCRCs.Vals[folderIndex])
res = SZ_ERROR_CRC;
return res;
}
}

View file

@ -1,442 +0,0 @@
/* 7zFile.c -- File IO
2021-04-29 : Igor Pavlov : Public domain */
#include "Precomp.h"
#include "7zFile.h"
#ifndef USE_WINDOWS_FILE
#include <errno.h>
#ifndef USE_FOPEN
#include <stdio.h>
#include <fcntl.h>
#ifdef _WIN32
#include <io.h>
typedef int ssize_t;
typedef int off_t;
#else
#include <unistd.h>
#endif
#endif
#else
/*
ReadFile and WriteFile functions in Windows have BUG:
If you Read or Write 64MB or more (probably min_failure_size = 64MB - 32KB + 1)
from/to Network file, it returns ERROR_NO_SYSTEM_RESOURCES
(Insufficient system resources exist to complete the requested service).
Probably in some version of Windows there are problems with other sizes:
for 32 MB (maybe also for 16 MB).
And message can be "Network connection was lost"
*/
#endif
#define kChunkSizeMax (1 << 22)
void File_Construct(CSzFile *p)
{
#ifdef USE_WINDOWS_FILE
p->handle = INVALID_HANDLE_VALUE;
#elif defined(USE_FOPEN)
p->file = NULL;
#else
p->fd = -1;
#endif
}
#if !defined(UNDER_CE) || !defined(USE_WINDOWS_FILE)
static WRes File_Open(CSzFile *p, const char *name, int writeMode)
{
#ifdef USE_WINDOWS_FILE
p->handle = CreateFileA(name,
writeMode ? GENERIC_WRITE : GENERIC_READ,
FILE_SHARE_READ, NULL,
writeMode ? CREATE_ALWAYS : OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL, NULL);
return (p->handle != INVALID_HANDLE_VALUE) ? 0 : GetLastError();
#elif defined(USE_FOPEN)
p->file = fopen(name, writeMode ? "wb+" : "rb");
return (p->file != 0) ? 0 :
#ifdef UNDER_CE
2; /* ENOENT */
#else
errno;
#endif
#else
int flags = (writeMode ? (O_CREAT | O_EXCL | O_WRONLY) : O_RDONLY);
#ifdef O_BINARY
flags |= O_BINARY;
#endif
p->fd = open(name, flags, 0666);
return (p->fd != -1) ? 0 : errno;
#endif
}
WRes InFile_Open(CSzFile *p, const char *name) { return File_Open(p, name, 0); }
WRes OutFile_Open(CSzFile *p, const char *name)
{
#if defined(USE_WINDOWS_FILE) || defined(USE_FOPEN)
return File_Open(p, name, 1);
#else
p->fd = creat(name, 0666);
return (p->fd != -1) ? 0 : errno;
#endif
}
#endif
#ifdef USE_WINDOWS_FILE
static WRes File_OpenW(CSzFile *p, const WCHAR *name, int writeMode)
{
p->handle = CreateFileW(name,
writeMode ? GENERIC_WRITE : GENERIC_READ,
FILE_SHARE_READ, NULL,
writeMode ? CREATE_ALWAYS : OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL, NULL);
return (p->handle != INVALID_HANDLE_VALUE) ? 0 : GetLastError();
}
WRes InFile_OpenW(CSzFile *p, const WCHAR *name) { return File_OpenW(p, name, 0); }
WRes OutFile_OpenW(CSzFile *p, const WCHAR *name) { return File_OpenW(p, name, 1); }
#endif
WRes File_Close(CSzFile *p)
{
#ifdef USE_WINDOWS_FILE
if (p->handle != INVALID_HANDLE_VALUE)
{
if (!CloseHandle(p->handle))
return GetLastError();
p->handle = INVALID_HANDLE_VALUE;
}
#elif defined(USE_FOPEN)
if (p->file != NULL)
{
int res = fclose(p->file);
if (res != 0)
{
if (res == EOF)
return errno;
return res;
}
p->file = NULL;
}
#else
if (p->fd != -1)
{
if (close(p->fd) != 0)
return errno;
p->fd = -1;
}
#endif
return 0;
}
WRes File_Read(CSzFile *p, void *data, size_t *size)
{
size_t originalSize = *size;
*size = 0;
if (originalSize == 0)
return 0;
#ifdef USE_WINDOWS_FILE
do
{
const DWORD curSize = (originalSize > kChunkSizeMax) ? kChunkSizeMax : (DWORD)originalSize;
DWORD processed = 0;
const BOOL res = ReadFile(p->handle, data, curSize, &processed, NULL);
data = (void *)((Byte *)data + processed);
originalSize -= processed;
*size += processed;
if (!res)
return GetLastError();
// debug : we can break here for partial reading mode
if (processed == 0)
break;
}
while (originalSize > 0);
#elif defined(USE_FOPEN)
do
{
const size_t curSize = (originalSize > kChunkSizeMax) ? kChunkSizeMax : originalSize;
const size_t processed = fread(data, 1, curSize, p->file);
data = (void *)((Byte *)data + (size_t)processed);
originalSize -= processed;
*size += processed;
if (processed != curSize)
return ferror(p->file);
// debug : we can break here for partial reading mode
if (processed == 0)
break;
}
while (originalSize > 0);
#else
do
{
const size_t curSize = (originalSize > kChunkSizeMax) ? kChunkSizeMax : originalSize;
const ssize_t processed = read(p->fd, data, curSize);
if (processed == -1)
return errno;
if (processed == 0)
break;
data = (void *)((Byte *)data + (size_t)processed);
originalSize -= (size_t)processed;
*size += (size_t)processed;
// debug : we can break here for partial reading mode
// break;
}
while (originalSize > 0);
#endif
return 0;
}
WRes File_Write(CSzFile *p, const void *data, size_t *size)
{
size_t originalSize = *size;
*size = 0;
if (originalSize == 0)
return 0;
#ifdef USE_WINDOWS_FILE
do
{
const DWORD curSize = (originalSize > kChunkSizeMax) ? kChunkSizeMax : (DWORD)originalSize;
DWORD processed = 0;
const BOOL res = WriteFile(p->handle, data, curSize, &processed, NULL);
data = (const void *)((const Byte *)data + processed);
originalSize -= processed;
*size += processed;
if (!res)
return GetLastError();
if (processed == 0)
break;
}
while (originalSize > 0);
#elif defined(USE_FOPEN)
do
{
const size_t curSize = (originalSize > kChunkSizeMax) ? kChunkSizeMax : originalSize;
const size_t processed = fwrite(data, 1, curSize, p->file);
data = (void *)((Byte *)data + (size_t)processed);
originalSize -= processed;
*size += processed;
if (processed != curSize)
return ferror(p->file);
if (processed == 0)
break;
}
while (originalSize > 0);
#else
do
{
const size_t curSize = (originalSize > kChunkSizeMax) ? kChunkSizeMax : originalSize;
const ssize_t processed = write(p->fd, data, curSize);
if (processed == -1)
return errno;
if (processed == 0)
break;
data = (void *)((Byte *)data + (size_t)processed);
originalSize -= (size_t)processed;
*size += (size_t)processed;
}
while (originalSize > 0);
#endif
return 0;
}
WRes File_Seek(CSzFile *p, Int64 *pos, ESzSeek origin)
{
#ifdef USE_WINDOWS_FILE
DWORD moveMethod;
UInt32 low = (UInt32)*pos;
LONG high = (LONG)((UInt64)*pos >> 16 >> 16); /* for case when UInt64 is 32-bit only */
switch (origin)
{
case SZ_SEEK_SET: moveMethod = FILE_BEGIN; break;
case SZ_SEEK_CUR: moveMethod = FILE_CURRENT; break;
case SZ_SEEK_END: moveMethod = FILE_END; break;
default: return ERROR_INVALID_PARAMETER;
}
low = SetFilePointer(p->handle, (LONG)low, &high, moveMethod);
if (low == (UInt32)0xFFFFFFFF)
{
WRes res = GetLastError();
if (res != NO_ERROR)
return res;
}
*pos = ((Int64)high << 32) | low;
return 0;
#else
int moveMethod; // = origin;
switch (origin)
{
case SZ_SEEK_SET: moveMethod = SEEK_SET; break;
case SZ_SEEK_CUR: moveMethod = SEEK_CUR; break;
case SZ_SEEK_END: moveMethod = SEEK_END; break;
default: return EINVAL;
}
#if defined(USE_FOPEN)
{
int res = fseek(p->file, (long)*pos, moveMethod);
if (res == -1)
return errno;
*pos = ftell(p->file);
if (*pos == -1)
return errno;
return 0;
}
#else
{
off_t res = lseek(p->fd, (off_t)*pos, moveMethod);
if (res == -1)
return errno;
*pos = res;
return 0;
}
#endif // USE_FOPEN
#endif // USE_WINDOWS_FILE
}
WRes File_GetLength(CSzFile *p, UInt64 *length)
{
#ifdef USE_WINDOWS_FILE
DWORD sizeHigh;
DWORD sizeLow = GetFileSize(p->handle, &sizeHigh);
if (sizeLow == 0xFFFFFFFF)
{
DWORD res = GetLastError();
if (res != NO_ERROR)
return res;
}
*length = (((UInt64)sizeHigh) << 32) + sizeLow;
return 0;
#elif defined(USE_FOPEN)
long pos = ftell(p->file);
int res = fseek(p->file, 0, SEEK_END);
*length = ftell(p->file);
fseek(p->file, pos, SEEK_SET);
return res;
#else
off_t pos;
*length = 0;
pos = lseek(p->fd, 0, SEEK_CUR);
if (pos != -1)
{
const off_t len2 = lseek(p->fd, 0, SEEK_END);
const off_t res2 = lseek(p->fd, pos, SEEK_SET);
if (len2 != -1)
{
*length = (UInt64)len2;
if (res2 != -1)
return 0;
}
}
return errno;
#endif
}
/* ---------- FileSeqInStream ---------- */
static SRes FileSeqInStream_Read(const ISeqInStream *pp, void *buf, size_t *size)
{
CFileSeqInStream *p = CONTAINER_FROM_VTBL(pp, CFileSeqInStream, vt);
WRes wres = File_Read(&p->file, buf, size);
p->wres = wres;
return (wres == 0) ? SZ_OK : SZ_ERROR_READ;
}
void FileSeqInStream_CreateVTable(CFileSeqInStream *p)
{
p->vt.Read = FileSeqInStream_Read;
}
/* ---------- FileInStream ---------- */
static SRes FileInStream_Read(const ISeekInStream *pp, void *buf, size_t *size)
{
CFileInStream *p = CONTAINER_FROM_VTBL(pp, CFileInStream, vt);
WRes wres = File_Read(&p->file, buf, size);
p->wres = wres;
return (wres == 0) ? SZ_OK : SZ_ERROR_READ;
}
static SRes FileInStream_Seek(const ISeekInStream *pp, Int64 *pos, ESzSeek origin)
{
CFileInStream *p = CONTAINER_FROM_VTBL(pp, CFileInStream, vt);
WRes wres = File_Seek(&p->file, pos, origin);
p->wres = wres;
return (wres == 0) ? SZ_OK : SZ_ERROR_READ;
}
void FileInStream_CreateVTable(CFileInStream *p)
{
p->vt.Read = FileInStream_Read;
p->vt.Seek = FileInStream_Seek;
}
/* ---------- FileOutStream ---------- */
static size_t FileOutStream_Write(const ISeqOutStream *pp, const void *data, size_t size)
{
CFileOutStream *p = CONTAINER_FROM_VTBL(pp, CFileOutStream, vt);
WRes wres = File_Write(&p->file, data, &size);
p->wres = wres;
return size;
}
void FileOutStream_CreateVTable(CFileOutStream *p)
{
p->vt.Write = FileOutStream_Write;
}

View file

@ -1,91 +0,0 @@
/* 7zFile.h -- File IO
2021-02-15 : Igor Pavlov : Public domain */
#ifndef __7Z_FILE_H
#define __7Z_FILE_H
#ifdef _WIN32
#define USE_WINDOWS_FILE
// #include <windows.h>
#endif
#ifdef USE_WINDOWS_FILE
#include <windows.h>
#else
// note: USE_FOPEN mode is limited to 32-bit file size
// #define USE_FOPEN
// #include <stdio.h>
#endif
#include "7zTypes.h"
EXTERN_C_BEGIN
/* ---------- File ---------- */
typedef struct
{
#ifdef USE_WINDOWS_FILE
HANDLE handle;
#elif defined(USE_FOPEN)
FILE *file;
#else
int fd;
#endif
} CSzFile;
void File_Construct(CSzFile *p);
#if !defined(UNDER_CE) || !defined(USE_WINDOWS_FILE)
WRes InFile_Open(CSzFile *p, const char *name);
WRes OutFile_Open(CSzFile *p, const char *name);
#endif
#ifdef USE_WINDOWS_FILE
WRes InFile_OpenW(CSzFile *p, const WCHAR *name);
WRes OutFile_OpenW(CSzFile *p, const WCHAR *name);
#endif
WRes File_Close(CSzFile *p);
/* reads max(*size, remain file's size) bytes */
WRes File_Read(CSzFile *p, void *data, size_t *size);
/* writes *size bytes */
WRes File_Write(CSzFile *p, const void *data, size_t *size);
WRes File_Seek(CSzFile *p, Int64 *pos, ESzSeek origin);
WRes File_GetLength(CSzFile *p, UInt64 *length);
/* ---------- FileInStream ---------- */
typedef struct
{
ISeqInStream vt;
CSzFile file;
WRes wres;
} CFileSeqInStream;
void FileSeqInStream_CreateVTable(CFileSeqInStream *p);
typedef struct
{
ISeekInStream vt;
CSzFile file;
WRes wres;
} CFileInStream;
void FileInStream_CreateVTable(CFileInStream *p);
typedef struct
{
ISeqOutStream vt;
CSzFile file;
WRes wres;
} CFileOutStream;
void FileOutStream_CreateVTable(CFileOutStream *p);
EXTERN_C_END
#endif

View file

@ -1,176 +0,0 @@
/* 7zStream.c -- 7z Stream functions
2021-02-09 : Igor Pavlov : Public domain */
#include "Precomp.h"
#include <string.h>
#include "7zTypes.h"
SRes SeqInStream_Read2(const ISeqInStream *stream, void *buf, size_t size, SRes errorType)
{
while (size != 0)
{
size_t processed = size;
RINOK(ISeqInStream_Read(stream, buf, &processed));
if (processed == 0)
return errorType;
buf = (void *)((Byte *)buf + processed);
size -= processed;
}
return SZ_OK;
}
SRes SeqInStream_Read(const ISeqInStream *stream, void *buf, size_t size)
{
return SeqInStream_Read2(stream, buf, size, SZ_ERROR_INPUT_EOF);
}
SRes SeqInStream_ReadByte(const ISeqInStream *stream, Byte *buf)
{
size_t processed = 1;
RINOK(ISeqInStream_Read(stream, buf, &processed));
return (processed == 1) ? SZ_OK : SZ_ERROR_INPUT_EOF;
}
SRes LookInStream_SeekTo(const ILookInStream *stream, UInt64 offset)
{
Int64 t = (Int64)offset;
return ILookInStream_Seek(stream, &t, SZ_SEEK_SET);
}
SRes LookInStream_LookRead(const ILookInStream *stream, void *buf, size_t *size)
{
const void *lookBuf;
if (*size == 0)
return SZ_OK;
RINOK(ILookInStream_Look(stream, &lookBuf, size));
memcpy(buf, lookBuf, *size);
return ILookInStream_Skip(stream, *size);
}
SRes LookInStream_Read2(const ILookInStream *stream, void *buf, size_t size, SRes errorType)
{
while (size != 0)
{
size_t processed = size;
RINOK(ILookInStream_Read(stream, buf, &processed));
if (processed == 0)
return errorType;
buf = (void *)((Byte *)buf + processed);
size -= processed;
}
return SZ_OK;
}
SRes LookInStream_Read(const ILookInStream *stream, void *buf, size_t size)
{
return LookInStream_Read2(stream, buf, size, SZ_ERROR_INPUT_EOF);
}
#define GET_LookToRead2 CLookToRead2 *p = CONTAINER_FROM_VTBL(pp, CLookToRead2, vt);
static SRes LookToRead2_Look_Lookahead(const ILookInStream *pp, const void **buf, size_t *size)
{
SRes res = SZ_OK;
GET_LookToRead2
size_t size2 = p->size - p->pos;
if (size2 == 0 && *size != 0)
{
p->pos = 0;
p->size = 0;
size2 = p->bufSize;
res = ISeekInStream_Read(p->realStream, p->buf, &size2);
p->size = size2;
}
if (*size > size2)
*size = size2;
*buf = p->buf + p->pos;
return res;
}
static SRes LookToRead2_Look_Exact(const ILookInStream *pp, const void **buf, size_t *size)
{
SRes res = SZ_OK;
GET_LookToRead2
size_t size2 = p->size - p->pos;
if (size2 == 0 && *size != 0)
{
p->pos = 0;
p->size = 0;
if (*size > p->bufSize)
*size = p->bufSize;
res = ISeekInStream_Read(p->realStream, p->buf, size);
size2 = p->size = *size;
}
if (*size > size2)
*size = size2;
*buf = p->buf + p->pos;
return res;
}
static SRes LookToRead2_Skip(const ILookInStream *pp, size_t offset)
{
GET_LookToRead2
p->pos += offset;
return SZ_OK;
}
static SRes LookToRead2_Read(const ILookInStream *pp, void *buf, size_t *size)
{
GET_LookToRead2
size_t rem = p->size - p->pos;
if (rem == 0)
return ISeekInStream_Read(p->realStream, buf, size);
if (rem > *size)
rem = *size;
memcpy(buf, p->buf + p->pos, rem);
p->pos += rem;
*size = rem;
return SZ_OK;
}
static SRes LookToRead2_Seek(const ILookInStream *pp, Int64 *pos, ESzSeek origin)
{
GET_LookToRead2
p->pos = p->size = 0;
return ISeekInStream_Seek(p->realStream, pos, origin);
}
void LookToRead2_CreateVTable(CLookToRead2 *p, int lookahead)
{
p->vt.Look = lookahead ?
LookToRead2_Look_Lookahead :
LookToRead2_Look_Exact;
p->vt.Skip = LookToRead2_Skip;
p->vt.Read = LookToRead2_Read;
p->vt.Seek = LookToRead2_Seek;
}
static SRes SecToLook_Read(const ISeqInStream *pp, void *buf, size_t *size)
{
CSecToLook *p = CONTAINER_FROM_VTBL(pp, CSecToLook, vt);
return LookInStream_LookRead(p->realStream, buf, size);
}
void SecToLook_CreateVTable(CSecToLook *p)
{
p->vt.Read = SecToLook_Read;
}
static SRes SecToRead_Read(const ISeqInStream *pp, void *buf, size_t *size)
{
CSecToRead *p = CONTAINER_FROM_VTBL(pp, CSecToRead, vt);
return ILookInStream_Read(p->realStream, buf, size);
}
void SecToRead_CreateVTable(CSecToRead *p)
{
p->vt.Read = SecToRead_Read;
}

View file

@ -1,529 +0,0 @@
/* 7zTypes.h -- Basic types
2022-04-01 : Igor Pavlov : Public domain */
#ifndef __7Z_TYPES_H
#define __7Z_TYPES_H
#ifdef _WIN32
/* #include <windows.h> */
#else
#include <errno.h>
#endif
#include <stddef.h>
#ifndef EXTERN_C_BEGIN
#ifdef __cplusplus
#define EXTERN_C_BEGIN extern "C" {
#define EXTERN_C_END }
#else
#define EXTERN_C_BEGIN
#define EXTERN_C_END
#endif
#endif
EXTERN_C_BEGIN
#define SZ_OK 0
#define SZ_ERROR_DATA 1
#define SZ_ERROR_MEM 2
#define SZ_ERROR_CRC 3
#define SZ_ERROR_UNSUPPORTED 4
#define SZ_ERROR_PARAM 5
#define SZ_ERROR_INPUT_EOF 6
#define SZ_ERROR_OUTPUT_EOF 7
#define SZ_ERROR_READ 8
#define SZ_ERROR_WRITE 9
#define SZ_ERROR_PROGRESS 10
#define SZ_ERROR_FAIL 11
#define SZ_ERROR_THREAD 12
#define SZ_ERROR_ARCHIVE 16
#define SZ_ERROR_NO_ARCHIVE 17
typedef int SRes;
#ifdef _MSC_VER
#if _MSC_VER > 1200
#define MY_ALIGN(n) __declspec(align(n))
#else
#define MY_ALIGN(n)
#endif
#else
#define MY_ALIGN(n) __attribute__ ((aligned(n)))
#endif
#ifdef _WIN32
/* typedef DWORD WRes; */
typedef unsigned WRes;
#define MY_SRes_HRESULT_FROM_WRes(x) HRESULT_FROM_WIN32(x)
// #define MY_HRES_ERROR__INTERNAL_ERROR MY_SRes_HRESULT_FROM_WRes(ERROR_INTERNAL_ERROR)
#else // _WIN32
// #define ENV_HAVE_LSTAT
typedef int WRes;
// (FACILITY_ERRNO = 0x800) is 7zip's FACILITY constant to represent (errno) errors in HRESULT
#define MY__FACILITY_ERRNO 0x800
#define MY__FACILITY_WIN32 7
#define MY__FACILITY__WRes MY__FACILITY_ERRNO
#define MY_HRESULT_FROM_errno_CONST_ERROR(x) ((HRESULT)( \
( (HRESULT)(x) & 0x0000FFFF) \
| (MY__FACILITY__WRes << 16) \
| (HRESULT)0x80000000 ))
#define MY_SRes_HRESULT_FROM_WRes(x) \
((HRESULT)(x) <= 0 ? ((HRESULT)(x)) : MY_HRESULT_FROM_errno_CONST_ERROR(x))
// we call macro HRESULT_FROM_WIN32 for system errors (WRes) that are (errno)
#define HRESULT_FROM_WIN32(x) MY_SRes_HRESULT_FROM_WRes(x)
/*
#define ERROR_FILE_NOT_FOUND 2L
#define ERROR_ACCESS_DENIED 5L
#define ERROR_NO_MORE_FILES 18L
#define ERROR_LOCK_VIOLATION 33L
#define ERROR_FILE_EXISTS 80L
#define ERROR_DISK_FULL 112L
#define ERROR_NEGATIVE_SEEK 131L
#define ERROR_ALREADY_EXISTS 183L
#define ERROR_DIRECTORY 267L
#define ERROR_TOO_MANY_POSTS 298L
#define ERROR_INTERNAL_ERROR 1359L
#define ERROR_INVALID_REPARSE_DATA 4392L
#define ERROR_REPARSE_TAG_INVALID 4393L
#define ERROR_REPARSE_TAG_MISMATCH 4394L
*/
// we use errno equivalents for some WIN32 errors:
#define ERROR_INVALID_PARAMETER EINVAL
#define ERROR_INVALID_FUNCTION EINVAL
#define ERROR_ALREADY_EXISTS EEXIST
#define ERROR_FILE_EXISTS EEXIST
#define ERROR_PATH_NOT_FOUND ENOENT
#define ERROR_FILE_NOT_FOUND ENOENT
#define ERROR_DISK_FULL ENOSPC
// #define ERROR_INVALID_HANDLE EBADF
// we use FACILITY_WIN32 for errors that has no errno equivalent
// Too many posts were made to a semaphore.
#define ERROR_TOO_MANY_POSTS ((HRESULT)0x8007012AL)
#define ERROR_INVALID_REPARSE_DATA ((HRESULT)0x80071128L)
#define ERROR_REPARSE_TAG_INVALID ((HRESULT)0x80071129L)
// if (MY__FACILITY__WRes != FACILITY_WIN32),
// we use FACILITY_WIN32 for COM errors:
#define E_OUTOFMEMORY ((HRESULT)0x8007000EL)
#define E_INVALIDARG ((HRESULT)0x80070057L)
#define MY__E_ERROR_NEGATIVE_SEEK ((HRESULT)0x80070083L)
/*
// we can use FACILITY_ERRNO for some COM errors, that have errno equivalents:
#define E_OUTOFMEMORY MY_HRESULT_FROM_errno_CONST_ERROR(ENOMEM)
#define E_INVALIDARG MY_HRESULT_FROM_errno_CONST_ERROR(EINVAL)
#define MY__E_ERROR_NEGATIVE_SEEK MY_HRESULT_FROM_errno_CONST_ERROR(EINVAL)
*/
#define TEXT(quote) quote
#define FILE_ATTRIBUTE_READONLY 0x0001
#define FILE_ATTRIBUTE_HIDDEN 0x0002
#define FILE_ATTRIBUTE_SYSTEM 0x0004
#define FILE_ATTRIBUTE_DIRECTORY 0x0010
#define FILE_ATTRIBUTE_ARCHIVE 0x0020
#define FILE_ATTRIBUTE_DEVICE 0x0040
#define FILE_ATTRIBUTE_NORMAL 0x0080
#define FILE_ATTRIBUTE_TEMPORARY 0x0100
#define FILE_ATTRIBUTE_SPARSE_FILE 0x0200
#define FILE_ATTRIBUTE_REPARSE_POINT 0x0400
#define FILE_ATTRIBUTE_COMPRESSED 0x0800
#define FILE_ATTRIBUTE_OFFLINE 0x1000
#define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x2000
#define FILE_ATTRIBUTE_ENCRYPTED 0x4000
#define FILE_ATTRIBUTE_UNIX_EXTENSION 0x8000 /* trick for Unix */
#endif
#ifndef RINOK
#define RINOK(x) { int __result__ = (x); if (__result__ != 0) return __result__; }
#endif
#ifndef RINOK_WRes
#define RINOK_WRes(x) { WRes __result__ = (x); if (__result__ != 0) return __result__; }
#endif
typedef unsigned char Byte;
typedef short Int16;
typedef unsigned short UInt16;
#ifdef _LZMA_UINT32_IS_ULONG
typedef long Int32;
typedef unsigned long UInt32;
#else
typedef int Int32;
typedef unsigned int UInt32;
#endif
#ifndef _WIN32
typedef int INT;
typedef Int32 INT32;
typedef unsigned int UINT;
typedef UInt32 UINT32;
typedef INT32 LONG; // LONG, ULONG and DWORD must be 32-bit for _WIN32 compatibility
typedef UINT32 ULONG;
#undef DWORD
typedef UINT32 DWORD;
#define VOID void
#define HRESULT LONG
typedef void *LPVOID;
// typedef void VOID;
// typedef ULONG_PTR DWORD_PTR, *PDWORD_PTR;
// gcc / clang on Unix : sizeof(long==sizeof(void*) in 32 or 64 bits)
typedef long INT_PTR;
typedef unsigned long UINT_PTR;
typedef long LONG_PTR;
typedef unsigned long DWORD_PTR;
typedef size_t SIZE_T;
#endif // _WIN32
#define MY_HRES_ERROR__INTERNAL_ERROR ((HRESULT)0x8007054FL)
#ifdef _SZ_NO_INT_64
/* define _SZ_NO_INT_64, if your compiler doesn't support 64-bit integers.
NOTES: Some code will work incorrectly in that case! */
typedef long Int64;
typedef unsigned long UInt64;
#else
#if defined(_MSC_VER) || defined(__BORLANDC__)
typedef __int64 Int64;
typedef unsigned __int64 UInt64;
#define UINT64_CONST(n) n
#else
typedef long long int Int64;
typedef unsigned long long int UInt64;
#define UINT64_CONST(n) n ## ULL
#endif
#endif
#ifdef _LZMA_NO_SYSTEM_SIZE_T
typedef UInt32 SizeT;
#else
typedef size_t SizeT;
#endif
typedef int BoolInt;
/* typedef BoolInt Bool; */
#define True 1
#define False 0
#ifdef _WIN32
#define MY_STD_CALL __stdcall
#else
#define MY_STD_CALL
#endif
#ifdef _MSC_VER
#if _MSC_VER >= 1300
#define MY_NO_INLINE __declspec(noinline)
#else
#define MY_NO_INLINE
#endif
#define MY_FORCE_INLINE __forceinline
#define MY_CDECL __cdecl
#define MY_FAST_CALL __fastcall
#else // _MSC_VER
#if (defined(__GNUC__) && (__GNUC__ >= 4)) \
|| (defined(__clang__) && (__clang_major__ >= 4)) \
|| defined(__INTEL_COMPILER) \
|| defined(__xlC__)
#define MY_NO_INLINE __attribute__((noinline))
// #define MY_FORCE_INLINE __attribute__((always_inline)) inline
#else
#define MY_NO_INLINE
#endif
#define MY_FORCE_INLINE
#define MY_CDECL
#if defined(_M_IX86) \
|| defined(__i386__)
// #define MY_FAST_CALL __attribute__((fastcall))
// #define MY_FAST_CALL __attribute__((cdecl))
#define MY_FAST_CALL
#elif defined(MY_CPU_AMD64)
// #define MY_FAST_CALL __attribute__((ms_abi))
#define MY_FAST_CALL
#else
#define MY_FAST_CALL
#endif
#endif // _MSC_VER
/* The following interfaces use first parameter as pointer to structure */
typedef struct IByteIn IByteIn;
struct IByteIn
{
Byte (*Read)(const IByteIn *p); /* reads one byte, returns 0 in case of EOF or error */
};
#define IByteIn_Read(p) (p)->Read(p)
typedef struct IByteOut IByteOut;
struct IByteOut
{
void (*Write)(const IByteOut *p, Byte b);
};
#define IByteOut_Write(p, b) (p)->Write(p, b)
typedef struct ISeqInStream ISeqInStream;
struct ISeqInStream
{
SRes (*Read)(const ISeqInStream *p, void *buf, size_t *size);
/* if (input(*size) != 0 && output(*size) == 0) means end_of_stream.
(output(*size) < input(*size)) is allowed */
};
#define ISeqInStream_Read(p, buf, size) (p)->Read(p, buf, size)
/* it can return SZ_ERROR_INPUT_EOF */
SRes SeqInStream_Read(const ISeqInStream *stream, void *buf, size_t size);
SRes SeqInStream_Read2(const ISeqInStream *stream, void *buf, size_t size, SRes errorType);
SRes SeqInStream_ReadByte(const ISeqInStream *stream, Byte *buf);
typedef struct ISeqOutStream ISeqOutStream;
struct ISeqOutStream
{
size_t (*Write)(const ISeqOutStream *p, const void *buf, size_t size);
/* Returns: result - the number of actually written bytes.
(result < size) means error */
};
#define ISeqOutStream_Write(p, buf, size) (p)->Write(p, buf, size)
typedef enum
{
SZ_SEEK_SET = 0,
SZ_SEEK_CUR = 1,
SZ_SEEK_END = 2
} ESzSeek;
typedef struct ISeekInStream ISeekInStream;
struct ISeekInStream
{
SRes (*Read)(const ISeekInStream *p, void *buf, size_t *size); /* same as ISeqInStream::Read */
SRes (*Seek)(const ISeekInStream *p, Int64 *pos, ESzSeek origin);
};
#define ISeekInStream_Read(p, buf, size) (p)->Read(p, buf, size)
#define ISeekInStream_Seek(p, pos, origin) (p)->Seek(p, pos, origin)
typedef struct ILookInStream ILookInStream;
struct ILookInStream
{
SRes (*Look)(const ILookInStream *p, const void **buf, size_t *size);
/* if (input(*size) != 0 && output(*size) == 0) means end_of_stream.
(output(*size) > input(*size)) is not allowed
(output(*size) < input(*size)) is allowed */
SRes (*Skip)(const ILookInStream *p, size_t offset);
/* offset must be <= output(*size) of Look */
SRes (*Read)(const ILookInStream *p, void *buf, size_t *size);
/* reads directly (without buffer). It's same as ISeqInStream::Read */
SRes (*Seek)(const ILookInStream *p, Int64 *pos, ESzSeek origin);
};
#define ILookInStream_Look(p, buf, size) (p)->Look(p, buf, size)
#define ILookInStream_Skip(p, offset) (p)->Skip(p, offset)
#define ILookInStream_Read(p, buf, size) (p)->Read(p, buf, size)
#define ILookInStream_Seek(p, pos, origin) (p)->Seek(p, pos, origin)
SRes LookInStream_LookRead(const ILookInStream *stream, void *buf, size_t *size);
SRes LookInStream_SeekTo(const ILookInStream *stream, UInt64 offset);
/* reads via ILookInStream::Read */
SRes LookInStream_Read2(const ILookInStream *stream, void *buf, size_t size, SRes errorType);
SRes LookInStream_Read(const ILookInStream *stream, void *buf, size_t size);
typedef struct
{
ILookInStream vt;
const ISeekInStream *realStream;
size_t pos;
size_t size; /* it's data size */
/* the following variables must be set outside */
Byte *buf;
size_t bufSize;
} CLookToRead2;
void LookToRead2_CreateVTable(CLookToRead2 *p, int lookahead);
#define LookToRead2_Init(p) { (p)->pos = (p)->size = 0; }
typedef struct
{
ISeqInStream vt;
const ILookInStream *realStream;
} CSecToLook;
void SecToLook_CreateVTable(CSecToLook *p);
typedef struct
{
ISeqInStream vt;
const ILookInStream *realStream;
} CSecToRead;
void SecToRead_CreateVTable(CSecToRead *p);
typedef struct ICompressProgress ICompressProgress;
struct ICompressProgress
{
SRes (*Progress)(const ICompressProgress *p, UInt64 inSize, UInt64 outSize);
/* Returns: result. (result != SZ_OK) means break.
Value (UInt64)(Int64)-1 for size means unknown value. */
};
#define ICompressProgress_Progress(p, inSize, outSize) (p)->Progress(p, inSize, outSize)
typedef struct ISzAlloc ISzAlloc;
typedef const ISzAlloc * ISzAllocPtr;
struct ISzAlloc
{
void *(*Alloc)(ISzAllocPtr p, size_t size);
void (*Free)(ISzAllocPtr p, void *address); /* address can be 0 */
};
#define ISzAlloc_Alloc(p, size) (p)->Alloc(p, size)
#define ISzAlloc_Free(p, a) (p)->Free(p, a)
/* deprecated */
#define IAlloc_Alloc(p, size) ISzAlloc_Alloc(p, size)
#define IAlloc_Free(p, a) ISzAlloc_Free(p, a)
#ifndef MY_offsetof
#ifdef offsetof
#define MY_offsetof(type, m) offsetof(type, m)
/*
#define MY_offsetof(type, m) FIELD_OFFSET(type, m)
*/
#else
#define MY_offsetof(type, m) ((size_t)&(((type *)0)->m))
#endif
#endif
#ifndef MY_container_of
/*
#define MY_container_of(ptr, type, m) container_of(ptr, type, m)
#define MY_container_of(ptr, type, m) CONTAINING_RECORD(ptr, type, m)
#define MY_container_of(ptr, type, m) ((type *)((char *)(ptr) - offsetof(type, m)))
#define MY_container_of(ptr, type, m) (&((type *)0)->m == (ptr), ((type *)(((char *)(ptr)) - MY_offsetof(type, m))))
*/
/*
GCC shows warning: "perhaps the 'offsetof' macro was used incorrectly"
GCC 3.4.4 : classes with constructor
GCC 4.8.1 : classes with non-public variable members"
*/
#define MY_container_of(ptr, type, m) ((type *)(void *)((char *)(void *)(1 ? (ptr) : &((type *)0)->m) - MY_offsetof(type, m)))
#endif
#define CONTAINER_FROM_VTBL_SIMPLE(ptr, type, m) ((type *)(void *)(ptr))
/*
#define CONTAINER_FROM_VTBL(ptr, type, m) CONTAINER_FROM_VTBL_SIMPLE(ptr, type, m)
*/
#define CONTAINER_FROM_VTBL(ptr, type, m) MY_container_of(ptr, type, m)
#define CONTAINER_FROM_VTBL_CLS(ptr, type, m) CONTAINER_FROM_VTBL_SIMPLE(ptr, type, m)
/*
#define CONTAINER_FROM_VTBL_CLS(ptr, type, m) CONTAINER_FROM_VTBL(ptr, type, m)
*/
#define MY_memset_0_ARRAY(a) memset((a), 0, sizeof(a))
#ifdef _WIN32
#define CHAR_PATH_SEPARATOR '\\'
#define WCHAR_PATH_SEPARATOR L'\\'
#define STRING_PATH_SEPARATOR "\\"
#define WSTRING_PATH_SEPARATOR L"\\"
#else
#define CHAR_PATH_SEPARATOR '/'
#define WCHAR_PATH_SEPARATOR L'/'
#define STRING_PATH_SEPARATOR "/"
#define WSTRING_PATH_SEPARATOR L"/"
#endif
#define k_PropVar_TimePrec_0 0
#define k_PropVar_TimePrec_Unix 1
#define k_PropVar_TimePrec_DOS 2
#define k_PropVar_TimePrec_HighPrec 3
#define k_PropVar_TimePrec_Base 16
#define k_PropVar_TimePrec_100ns (k_PropVar_TimePrec_Base + 7)
#define k_PropVar_TimePrec_1ns (k_PropVar_TimePrec_Base + 9)
EXTERN_C_END
#endif

View file

@ -1,27 +0,0 @@
#define MY_VER_MAJOR 22
#define MY_VER_MINOR 01
#define MY_VER_BUILD 0
#define MY_VERSION_NUMBERS "22.01"
#define MY_VERSION MY_VERSION_NUMBERS
#ifdef MY_CPU_NAME
#define MY_VERSION_CPU MY_VERSION " (" MY_CPU_NAME ")"
#else
#define MY_VERSION_CPU MY_VERSION
#endif
#define MY_DATE "2022-07-15"
#undef MY_COPYRIGHT
#undef MY_VERSION_COPYRIGHT_DATE
#define MY_AUTHOR_NAME "Igor Pavlov"
#define MY_COPYRIGHT_PD "Igor Pavlov : Public domain"
#define MY_COPYRIGHT_CR "Copyright (c) 1999-2022 Igor Pavlov"
#ifdef USE_COPYRIGHT_CR
#define MY_COPYRIGHT MY_COPYRIGHT_CR
#else
#define MY_COPYRIGHT MY_COPYRIGHT_PD
#endif
#define MY_COPYRIGHT_DATE MY_COPYRIGHT " : " MY_DATE
#define MY_VERSION_COPYRIGHT_DATE MY_VERSION_CPU " : " MY_COPYRIGHT " : " MY_DATE

View file

@ -1,55 +0,0 @@
#define MY_VS_FFI_FILEFLAGSMASK 0x0000003FL
#define MY_VOS_NT_WINDOWS32 0x00040004L
#define MY_VOS_CE_WINDOWS32 0x00050004L
#define MY_VFT_APP 0x00000001L
#define MY_VFT_DLL 0x00000002L
// #include <WinVer.h>
#ifndef MY_VERSION
#include "7zVersion.h"
#endif
#define MY_VER MY_VER_MAJOR,MY_VER_MINOR,MY_VER_BUILD,0
#ifdef DEBUG
#define DBG_FL VS_FF_DEBUG
#else
#define DBG_FL 0
#endif
#define MY_VERSION_INFO(fileType, descr, intName, origName) \
LANGUAGE 9, 1 \
1 VERSIONINFO \
FILEVERSION MY_VER \
PRODUCTVERSION MY_VER \
FILEFLAGSMASK MY_VS_FFI_FILEFLAGSMASK \
FILEFLAGS DBG_FL \
FILEOS MY_VOS_NT_WINDOWS32 \
FILETYPE fileType \
FILESUBTYPE 0x0L \
BEGIN \
BLOCK "StringFileInfo" \
BEGIN \
BLOCK "040904b0" \
BEGIN \
VALUE "CompanyName", "Igor Pavlov" \
VALUE "FileDescription", descr \
VALUE "FileVersion", MY_VERSION \
VALUE "InternalName", intName \
VALUE "LegalCopyright", MY_COPYRIGHT \
VALUE "OriginalFilename", origName \
VALUE "ProductName", "7-Zip" \
VALUE "ProductVersion", MY_VERSION \
END \
END \
BLOCK "VarFileInfo" \
BEGIN \
VALUE "Translation", 0x409, 1200 \
END \
END
#define MY_VERSION_INFO_APP(descr, intName) MY_VERSION_INFO(MY_VFT_APP, descr, intName, intName ".exe")
#define MY_VERSION_INFO_DLL(descr, intName) MY_VERSION_INFO(MY_VFT_DLL, descr, intName, intName ".dll")

375
3rdparty/7z/src/Aes.c vendored
View file

@ -1,375 +0,0 @@
/* Aes.c -- AES encryption / decryption
2021-05-13 : Igor Pavlov : Public domain */
#include "Precomp.h"
#include "CpuArch.h"
#include "Aes.h"
AES_CODE_FUNC g_AesCbc_Decode;
#ifndef _SFX
AES_CODE_FUNC g_AesCbc_Encode;
AES_CODE_FUNC g_AesCtr_Code;
UInt32 g_Aes_SupportedFunctions_Flags;
#endif
static UInt32 T[256 * 4];
static const Byte Sbox[256] = {
0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76,
0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0,
0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15,
0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75,
0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84,
0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf,
0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8,
0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2,
0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73,
0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb,
0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79,
0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08,
0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a,
0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e,
0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf,
0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16};
static UInt32 D[256 * 4];
static Byte InvS[256];
#define xtime(x) ((((x) << 1) ^ (((x) & 0x80) != 0 ? 0x1B : 0)) & 0xFF)
#define Ui32(a0, a1, a2, a3) ((UInt32)(a0) | ((UInt32)(a1) << 8) | ((UInt32)(a2) << 16) | ((UInt32)(a3) << 24))
#define gb0(x) ( (x) & 0xFF)
#define gb1(x) (((x) >> ( 8)) & 0xFF)
#define gb2(x) (((x) >> (16)) & 0xFF)
#define gb3(x) (((x) >> (24)))
#define gb(n, x) gb ## n(x)
#define TT(x) (T + (x << 8))
#define DD(x) (D + (x << 8))
// #define _SHOW_AES_STATUS
#ifdef MY_CPU_X86_OR_AMD64
#define USE_HW_AES
#elif defined(MY_CPU_ARM_OR_ARM64) && defined(MY_CPU_LE)
#if defined(__clang__)
#if (__clang_major__ >= 8) // fix that check
#define USE_HW_AES
#endif
#elif defined(__GNUC__)
#if (__GNUC__ >= 6) // fix that check
#define USE_HW_AES
#endif
#elif defined(_MSC_VER)
#if _MSC_VER >= 1910
#define USE_HW_AES
#endif
#endif
#endif
#ifdef USE_HW_AES
#ifdef _SHOW_AES_STATUS
#include <stdio.h>
#define _PRF(x) x
#else
#define _PRF(x)
#endif
#endif
void AesGenTables(void)
{
unsigned i;
for (i = 0; i < 256; i++)
InvS[Sbox[i]] = (Byte)i;
for (i = 0; i < 256; i++)
{
{
UInt32 a1 = Sbox[i];
UInt32 a2 = xtime(a1);
UInt32 a3 = a2 ^ a1;
TT(0)[i] = Ui32(a2, a1, a1, a3);
TT(1)[i] = Ui32(a3, a2, a1, a1);
TT(2)[i] = Ui32(a1, a3, a2, a1);
TT(3)[i] = Ui32(a1, a1, a3, a2);
}
{
UInt32 a1 = InvS[i];
UInt32 a2 = xtime(a1);
UInt32 a4 = xtime(a2);
UInt32 a8 = xtime(a4);
UInt32 a9 = a8 ^ a1;
UInt32 aB = a8 ^ a2 ^ a1;
UInt32 aD = a8 ^ a4 ^ a1;
UInt32 aE = a8 ^ a4 ^ a2;
DD(0)[i] = Ui32(aE, a9, aD, aB);
DD(1)[i] = Ui32(aB, aE, a9, aD);
DD(2)[i] = Ui32(aD, aB, aE, a9);
DD(3)[i] = Ui32(a9, aD, aB, aE);
}
}
{
AES_CODE_FUNC d = AesCbc_Decode;
#ifndef _SFX
AES_CODE_FUNC e = AesCbc_Encode;
AES_CODE_FUNC c = AesCtr_Code;
UInt32 flags = 0;
#endif
#ifdef USE_HW_AES
if (CPU_IsSupported_AES())
{
// #pragma message ("AES HW")
_PRF(printf("\n===AES HW\n"));
d = AesCbc_Decode_HW;
#ifndef _SFX
e = AesCbc_Encode_HW;
c = AesCtr_Code_HW;
flags = k_Aes_SupportedFunctions_HW;
#endif
#ifdef MY_CPU_X86_OR_AMD64
if (CPU_IsSupported_VAES_AVX2())
{
_PRF(printf("\n===vaes avx2\n"));
d = AesCbc_Decode_HW_256;
#ifndef _SFX
c = AesCtr_Code_HW_256;
flags |= k_Aes_SupportedFunctions_HW_256;
#endif
}
#endif
}
#endif
g_AesCbc_Decode = d;
#ifndef _SFX
g_AesCbc_Encode = e;
g_AesCtr_Code = c;
g_Aes_SupportedFunctions_Flags = flags;
#endif
}
}
#define HT(i, x, s) TT(x)[gb(x, s[(i + x) & 3])]
#define HT4(m, i, s, p) m[i] = \
HT(i, 0, s) ^ \
HT(i, 1, s) ^ \
HT(i, 2, s) ^ \
HT(i, 3, s) ^ w[p + i]
#define HT16(m, s, p) \
HT4(m, 0, s, p); \
HT4(m, 1, s, p); \
HT4(m, 2, s, p); \
HT4(m, 3, s, p); \
#define FT(i, x) Sbox[gb(x, m[(i + x) & 3])]
#define FT4(i) dest[i] = Ui32(FT(i, 0), FT(i, 1), FT(i, 2), FT(i, 3)) ^ w[i];
#define HD(i, x, s) DD(x)[gb(x, s[(i - x) & 3])]
#define HD4(m, i, s, p) m[i] = \
HD(i, 0, s) ^ \
HD(i, 1, s) ^ \
HD(i, 2, s) ^ \
HD(i, 3, s) ^ w[p + i];
#define HD16(m, s, p) \
HD4(m, 0, s, p); \
HD4(m, 1, s, p); \
HD4(m, 2, s, p); \
HD4(m, 3, s, p); \
#define FD(i, x) InvS[gb(x, m[(i - x) & 3])]
#define FD4(i) dest[i] = Ui32(FD(i, 0), FD(i, 1), FD(i, 2), FD(i, 3)) ^ w[i];
void MY_FAST_CALL Aes_SetKey_Enc(UInt32 *w, const Byte *key, unsigned keySize)
{
unsigned i, m;
const UInt32 *wLim;
UInt32 t;
UInt32 rcon = 1;
keySize /= 4;
w[0] = ((UInt32)keySize / 2) + 3;
w += 4;
for (i = 0; i < keySize; i++, key += 4)
w[i] = GetUi32(key);
t = w[(size_t)keySize - 1];
wLim = w + (size_t)keySize * 3 + 28;
m = 0;
do
{
if (m == 0)
{
t = Ui32(Sbox[gb1(t)] ^ rcon, Sbox[gb2(t)], Sbox[gb3(t)], Sbox[gb0(t)]);
rcon <<= 1;
if (rcon & 0x100)
rcon = 0x1b;
m = keySize;
}
else if (m == 4 && keySize > 6)
t = Ui32(Sbox[gb0(t)], Sbox[gb1(t)], Sbox[gb2(t)], Sbox[gb3(t)]);
m--;
t ^= w[0];
w[keySize] = t;
}
while (++w != wLim);
}
void MY_FAST_CALL Aes_SetKey_Dec(UInt32 *w, const Byte *key, unsigned keySize)
{
unsigned i, num;
Aes_SetKey_Enc(w, key, keySize);
num = keySize + 20;
w += 8;
for (i = 0; i < num; i++)
{
UInt32 r = w[i];
w[i] =
DD(0)[Sbox[gb0(r)]] ^
DD(1)[Sbox[gb1(r)]] ^
DD(2)[Sbox[gb2(r)]] ^
DD(3)[Sbox[gb3(r)]];
}
}
/* Aes_Encode and Aes_Decode functions work with little-endian words.
src and dest are pointers to 4 UInt32 words.
src and dest can point to same block */
// MY_FORCE_INLINE
static void Aes_Encode(const UInt32 *w, UInt32 *dest, const UInt32 *src)
{
UInt32 s[4];
UInt32 m[4];
UInt32 numRounds2 = w[0];
w += 4;
s[0] = src[0] ^ w[0];
s[1] = src[1] ^ w[1];
s[2] = src[2] ^ w[2];
s[3] = src[3] ^ w[3];
w += 4;
for (;;)
{
HT16(m, s, 0);
if (--numRounds2 == 0)
break;
HT16(s, m, 4);
w += 8;
}
w += 4;
FT4(0); FT4(1); FT4(2); FT4(3);
}
MY_FORCE_INLINE
static void Aes_Decode(const UInt32 *w, UInt32 *dest, const UInt32 *src)
{
UInt32 s[4];
UInt32 m[4];
UInt32 numRounds2 = w[0];
w += 4 + numRounds2 * 8;
s[0] = src[0] ^ w[0];
s[1] = src[1] ^ w[1];
s[2] = src[2] ^ w[2];
s[3] = src[3] ^ w[3];
for (;;)
{
w -= 8;
HD16(m, s, 4);
if (--numRounds2 == 0)
break;
HD16(s, m, 0);
}
FD4(0); FD4(1); FD4(2); FD4(3);
}
void AesCbc_Init(UInt32 *p, const Byte *iv)
{
unsigned i;
for (i = 0; i < 4; i++)
p[i] = GetUi32(iv + i * 4);
}
void MY_FAST_CALL AesCbc_Encode(UInt32 *p, Byte *data, size_t numBlocks)
{
for (; numBlocks != 0; numBlocks--, data += AES_BLOCK_SIZE)
{
p[0] ^= GetUi32(data);
p[1] ^= GetUi32(data + 4);
p[2] ^= GetUi32(data + 8);
p[3] ^= GetUi32(data + 12);
Aes_Encode(p + 4, p, p);
SetUi32(data, p[0]);
SetUi32(data + 4, p[1]);
SetUi32(data + 8, p[2]);
SetUi32(data + 12, p[3]);
}
}
void MY_FAST_CALL AesCbc_Decode(UInt32 *p, Byte *data, size_t numBlocks)
{
UInt32 in[4], out[4];
for (; numBlocks != 0; numBlocks--, data += AES_BLOCK_SIZE)
{
in[0] = GetUi32(data);
in[1] = GetUi32(data + 4);
in[2] = GetUi32(data + 8);
in[3] = GetUi32(data + 12);
Aes_Decode(p + 4, out, in);
SetUi32(data, p[0] ^ out[0]);
SetUi32(data + 4, p[1] ^ out[1]);
SetUi32(data + 8, p[2] ^ out[2]);
SetUi32(data + 12, p[3] ^ out[3]);
p[0] = in[0];
p[1] = in[1];
p[2] = in[2];
p[3] = in[3];
}
}
void MY_FAST_CALL AesCtr_Code(UInt32 *p, Byte *data, size_t numBlocks)
{
for (; numBlocks != 0; numBlocks--)
{
UInt32 temp[4];
unsigned i;
if (++p[0] == 0)
p[1]++;
Aes_Encode(p + 4, temp, p);
for (i = 0; i < 4; i++, data += 4)
{
UInt32 t = temp[i];
#ifdef MY_CPU_LE_UNALIGN
*((UInt32 *)(void *)data) ^= t;
#else
data[0] = (Byte)(data[0] ^ (t & 0xFF));
data[1] = (Byte)(data[1] ^ ((t >> 8) & 0xFF));
data[2] = (Byte)(data[2] ^ ((t >> 16) & 0xFF));
data[3] = (Byte)(data[3] ^ ((t >> 24)));
#endif
}
}
}

60
3rdparty/7z/src/Aes.h vendored
View file

@ -1,60 +0,0 @@
/* Aes.h -- AES encryption / decryption
2018-04-28 : Igor Pavlov : Public domain */
#ifndef __AES_H
#define __AES_H
#include "7zTypes.h"
EXTERN_C_BEGIN
#define AES_BLOCK_SIZE 16
/* Call AesGenTables one time before other AES functions */
void AesGenTables(void);
/* UInt32 pointers must be 16-byte aligned */
/* 16-byte (4 * 32-bit words) blocks: 1 (IV) + 1 (keyMode) + 15 (AES-256 roundKeys) */
#define AES_NUM_IVMRK_WORDS ((1 + 1 + 15) * 4)
/* aes - 16-byte aligned pointer to keyMode+roundKeys sequence */
/* keySize = 16 or 24 or 32 (bytes) */
typedef void (MY_FAST_CALL *AES_SET_KEY_FUNC)(UInt32 *aes, const Byte *key, unsigned keySize);
void MY_FAST_CALL Aes_SetKey_Enc(UInt32 *aes, const Byte *key, unsigned keySize);
void MY_FAST_CALL Aes_SetKey_Dec(UInt32 *aes, const Byte *key, unsigned keySize);
/* ivAes - 16-byte aligned pointer to iv+keyMode+roundKeys sequence: UInt32[AES_NUM_IVMRK_WORDS] */
void AesCbc_Init(UInt32 *ivAes, const Byte *iv); /* iv size is AES_BLOCK_SIZE */
/* data - 16-byte aligned pointer to data */
/* numBlocks - the number of 16-byte blocks in data array */
typedef void (MY_FAST_CALL *AES_CODE_FUNC)(UInt32 *ivAes, Byte *data, size_t numBlocks);
extern AES_CODE_FUNC g_AesCbc_Decode;
#ifndef _SFX
extern AES_CODE_FUNC g_AesCbc_Encode;
extern AES_CODE_FUNC g_AesCtr_Code;
#define k_Aes_SupportedFunctions_HW (1 << 2)
#define k_Aes_SupportedFunctions_HW_256 (1 << 3)
extern UInt32 g_Aes_SupportedFunctions_Flags;
#endif
#define DECLARE__AES_CODE_FUNC(funcName) \
void MY_FAST_CALL funcName(UInt32 *ivAes, Byte *data, size_t numBlocks);
DECLARE__AES_CODE_FUNC (AesCbc_Encode)
DECLARE__AES_CODE_FUNC (AesCbc_Decode)
DECLARE__AES_CODE_FUNC (AesCtr_Code)
DECLARE__AES_CODE_FUNC (AesCbc_Encode_HW)
DECLARE__AES_CODE_FUNC (AesCbc_Decode_HW)
DECLARE__AES_CODE_FUNC (AesCtr_Code_HW)
DECLARE__AES_CODE_FUNC (AesCbc_Decode_HW_256)
DECLARE__AES_CODE_FUNC (AesCtr_Code_HW_256)
EXTERN_C_END
#endif

View file

@ -1,776 +0,0 @@
/* AesOpt.c -- AES optimized code for x86 AES hardware instructions
2021-04-01 : Igor Pavlov : Public domain */
#include "Precomp.h"
#include "CpuArch.h"
#ifdef MY_CPU_X86_OR_AMD64
#if defined(__clang__)
#if __clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 8)
#define USE_INTEL_AES
#define ATTRIB_AES __attribute__((__target__("aes")))
#if (__clang_major__ >= 8)
#define USE_INTEL_VAES
#define ATTRIB_VAES __attribute__((__target__("aes,vaes,avx2")))
#endif
#endif
#elif defined(__GNUC__)
#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
#define USE_INTEL_AES
#ifndef __AES__
#define ATTRIB_AES __attribute__((__target__("aes")))
#endif
#if (__GNUC__ >= 8)
#define USE_INTEL_VAES
#define ATTRIB_VAES __attribute__((__target__("aes,vaes,avx2")))
#endif
#endif
#elif defined(__INTEL_COMPILER)
#if (__INTEL_COMPILER >= 1110)
#define USE_INTEL_AES
#if (__INTEL_COMPILER >= 1900)
#define USE_INTEL_VAES
#endif
#endif
#elif defined(_MSC_VER)
#if (_MSC_VER > 1500) || (_MSC_FULL_VER >= 150030729)
#define USE_INTEL_AES
#if (_MSC_VER >= 1910)
#define USE_INTEL_VAES
#endif
#endif
#endif
#ifndef ATTRIB_AES
#define ATTRIB_AES
#endif
#ifndef ATTRIB_VAES
#define ATTRIB_VAES
#endif
#ifdef USE_INTEL_AES
#include <wmmintrin.h>
#ifndef USE_INTEL_VAES
#define AES_TYPE_keys __m128i
#define AES_TYPE_data __m128i
#endif
#define AES_FUNC_START(name) \
void MY_FAST_CALL name(__m128i *p, __m128i *data, size_t numBlocks)
#define AES_FUNC_START2(name) \
AES_FUNC_START (name); \
ATTRIB_AES \
AES_FUNC_START (name)
#define MM_OP(op, dest, src) dest = op(dest, src);
#define MM_OP_m(op, src) MM_OP(op, m, src);
#define MM_XOR( dest, src) MM_OP(_mm_xor_si128, dest, src);
#define AVX_XOR(dest, src) MM_OP(_mm256_xor_si256, dest, src);
AES_FUNC_START2 (AesCbc_Encode_HW)
{
__m128i m = *p;
const __m128i k0 = p[2];
const __m128i k1 = p[3];
const UInt32 numRounds2 = *(const UInt32 *)(p + 1) - 1;
for (; numBlocks != 0; numBlocks--, data++)
{
UInt32 r = numRounds2;
const __m128i *w = p + 4;
__m128i temp = *data;
MM_XOR (temp, k0);
MM_XOR (m, temp);
MM_OP_m (_mm_aesenc_si128, k1);
do
{
MM_OP_m (_mm_aesenc_si128, w[0]);
MM_OP_m (_mm_aesenc_si128, w[1]);
w += 2;
}
while (--r);
MM_OP_m (_mm_aesenclast_si128, w[0]);
*data = m;
}
*p = m;
}
#define WOP_1(op)
#define WOP_2(op) WOP_1 (op) op (m1, 1);
#define WOP_3(op) WOP_2 (op) op (m2, 2);
#define WOP_4(op) WOP_3 (op) op (m3, 3);
#ifdef MY_CPU_AMD64
#define WOP_5(op) WOP_4 (op) op (m4, 4);
#define WOP_6(op) WOP_5 (op) op (m5, 5);
#define WOP_7(op) WOP_6 (op) op (m6, 6);
#define WOP_8(op) WOP_7 (op) op (m7, 7);
#endif
/*
#define WOP_9(op) WOP_8 (op) op (m8, 8);
#define WOP_10(op) WOP_9 (op) op (m9, 9);
#define WOP_11(op) WOP_10(op) op (m10, 10);
#define WOP_12(op) WOP_11(op) op (m11, 11);
#define WOP_13(op) WOP_12(op) op (m12, 12);
#define WOP_14(op) WOP_13(op) op (m13, 13);
*/
#ifdef MY_CPU_AMD64
#define NUM_WAYS 8
#define WOP_M1 WOP_8
#else
#define NUM_WAYS 4
#define WOP_M1 WOP_4
#endif
#define WOP(op) op (m0, 0); WOP_M1(op)
#define DECLARE_VAR(reg, ii) __m128i reg
#define LOAD_data( reg, ii) reg = data[ii];
#define STORE_data( reg, ii) data[ii] = reg;
#if (NUM_WAYS > 1)
#define XOR_data_M1(reg, ii) MM_XOR (reg, data[ii- 1]);
#endif
#define AVX__DECLARE_VAR(reg, ii) __m256i reg
#define AVX__LOAD_data( reg, ii) reg = ((const __m256i *)(const void *)data)[ii];
#define AVX__STORE_data( reg, ii) ((__m256i *)(void *)data)[ii] = reg;
#define AVX__XOR_data_M1(reg, ii) AVX_XOR (reg, (((const __m256i *)(const void *)(data - 1))[ii]));
#define MM_OP_key(op, reg) MM_OP(op, reg, key);
#define AES_DEC( reg, ii) MM_OP_key (_mm_aesdec_si128, reg)
#define AES_DEC_LAST( reg, ii) MM_OP_key (_mm_aesdeclast_si128, reg)
#define AES_ENC( reg, ii) MM_OP_key (_mm_aesenc_si128, reg)
#define AES_ENC_LAST( reg, ii) MM_OP_key (_mm_aesenclast_si128, reg)
#define AES_XOR( reg, ii) MM_OP_key (_mm_xor_si128, reg)
#define AVX__AES_DEC( reg, ii) MM_OP_key (_mm256_aesdec_epi128, reg)
#define AVX__AES_DEC_LAST( reg, ii) MM_OP_key (_mm256_aesdeclast_epi128, reg)
#define AVX__AES_ENC( reg, ii) MM_OP_key (_mm256_aesenc_epi128, reg)
#define AVX__AES_ENC_LAST( reg, ii) MM_OP_key (_mm256_aesenclast_epi128, reg)
#define AVX__AES_XOR( reg, ii) MM_OP_key (_mm256_xor_si256, reg)
#define CTR_START(reg, ii) MM_OP (_mm_add_epi64, ctr, one); reg = ctr;
#define CTR_END( reg, ii) MM_XOR (data[ii], reg);
#define AVX__CTR_START(reg, ii) MM_OP (_mm256_add_epi64, ctr2, two); reg = _mm256_xor_si256(ctr2, key);
#define AVX__CTR_END( reg, ii) AVX_XOR (((__m256i *)(void *)data)[ii], reg);
#define WOP_KEY(op, n) { \
const __m128i key = w[n]; \
WOP(op); }
#define AVX__WOP_KEY(op, n) { \
const __m256i key = w[n]; \
WOP(op); }
#define WIDE_LOOP_START \
dataEnd = data + numBlocks; \
if (numBlocks >= NUM_WAYS) \
{ dataEnd -= NUM_WAYS; do { \
#define WIDE_LOOP_END \
data += NUM_WAYS; \
} while (data <= dataEnd); \
dataEnd += NUM_WAYS; } \
#define SINGLE_LOOP \
for (; data < dataEnd; data++)
#define NUM_AES_KEYS_MAX 15
#define WIDE_LOOP_START_AVX(OP) \
dataEnd = data + numBlocks; \
if (numBlocks >= NUM_WAYS * 2) \
{ __m256i keys[NUM_AES_KEYS_MAX]; \
UInt32 ii; \
OP \
for (ii = 0; ii < numRounds; ii++) \
keys[ii] = _mm256_broadcastsi128_si256(p[ii]); \
dataEnd -= NUM_WAYS * 2; do { \
#define WIDE_LOOP_END_AVX(OP) \
data += NUM_WAYS * 2; \
} while (data <= dataEnd); \
dataEnd += NUM_WAYS * 2; \
OP \
_mm256_zeroupper(); \
} \
/* MSVC for x86: If we don't call _mm256_zeroupper(), and -arch:IA32 is not specified,
MSVC still can insert vzeroupper instruction. */
AES_FUNC_START2 (AesCbc_Decode_HW)
{
__m128i iv = *p;
const __m128i *wStart = p + *(const UInt32 *)(p + 1) * 2 + 2 - 1;
const __m128i *dataEnd;
p += 2;
WIDE_LOOP_START
{
const __m128i *w = wStart;
WOP (DECLARE_VAR)
WOP (LOAD_data);
WOP_KEY (AES_XOR, 1)
do
{
WOP_KEY (AES_DEC, 0)
w--;
}
while (w != p);
WOP_KEY (AES_DEC_LAST, 0)
MM_XOR (m0, iv);
WOP_M1 (XOR_data_M1)
iv = data[NUM_WAYS - 1];
WOP (STORE_data);
}
WIDE_LOOP_END
SINGLE_LOOP
{
const __m128i *w = wStart - 1;
__m128i m = _mm_xor_si128 (w[2], *data);
do
{
MM_OP_m (_mm_aesdec_si128, w[1]);
MM_OP_m (_mm_aesdec_si128, w[0]);
w -= 2;
}
while (w != p);
MM_OP_m (_mm_aesdec_si128, w[1]);
MM_OP_m (_mm_aesdeclast_si128, w[0]);
MM_XOR (m, iv);
iv = *data;
*data = m;
}
p[-2] = iv;
}
AES_FUNC_START2 (AesCtr_Code_HW)
{
__m128i ctr = *p;
UInt32 numRoundsMinus2 = *(const UInt32 *)(p + 1) * 2 - 1;
const __m128i *dataEnd;
__m128i one = _mm_cvtsi32_si128(1);
p += 2;
WIDE_LOOP_START
{
const __m128i *w = p;
UInt32 r = numRoundsMinus2;
WOP (DECLARE_VAR)
WOP (CTR_START);
WOP_KEY (AES_XOR, 0)
w += 1;
do
{
WOP_KEY (AES_ENC, 0)
w += 1;
}
while (--r);
WOP_KEY (AES_ENC_LAST, 0)
WOP (CTR_END);
}
WIDE_LOOP_END
SINGLE_LOOP
{
UInt32 numRounds2 = *(const UInt32 *)(p - 2 + 1) - 1;
const __m128i *w = p;
__m128i m;
MM_OP (_mm_add_epi64, ctr, one);
m = _mm_xor_si128 (ctr, p[0]);
w += 1;
do
{
MM_OP_m (_mm_aesenc_si128, w[0]);
MM_OP_m (_mm_aesenc_si128, w[1]);
w += 2;
}
while (--numRounds2);
MM_OP_m (_mm_aesenc_si128, w[0]);
MM_OP_m (_mm_aesenclast_si128, w[1]);
MM_XOR (*data, m);
}
p[-2] = ctr;
}
#ifdef USE_INTEL_VAES
#if defined(__clang__) && defined(_MSC_VER)
#define __SSE4_2__
#define __AES__
#define __AVX__
#define __AVX2__
#define __VAES__
#define __AVX512F__
#define __AVX512VL__
#endif
#include <immintrin.h>
#define VAES_FUNC_START2(name) \
AES_FUNC_START (name); \
ATTRIB_VAES \
AES_FUNC_START (name)
VAES_FUNC_START2 (AesCbc_Decode_HW_256)
{
__m128i iv = *p;
const __m128i *dataEnd;
UInt32 numRounds = *(const UInt32 *)(p + 1) * 2 + 1;
p += 2;
WIDE_LOOP_START_AVX(;)
{
const __m256i *w = keys + numRounds - 2;
WOP (AVX__DECLARE_VAR)
WOP (AVX__LOAD_data);
AVX__WOP_KEY (AVX__AES_XOR, 1)
do
{
AVX__WOP_KEY (AVX__AES_DEC, 0)
w--;
}
while (w != keys);
AVX__WOP_KEY (AVX__AES_DEC_LAST, 0)
AVX_XOR (m0, _mm256_setr_m128i(iv, data[0]));
WOP_M1 (AVX__XOR_data_M1)
iv = data[NUM_WAYS * 2 - 1];
WOP (AVX__STORE_data);
}
WIDE_LOOP_END_AVX(;)
SINGLE_LOOP
{
const __m128i *w = p + *(const UInt32 *)(p + 1 - 2) * 2 + 1 - 3;
__m128i m = _mm_xor_si128 (w[2], *data);
do
{
MM_OP_m (_mm_aesdec_si128, w[1]);
MM_OP_m (_mm_aesdec_si128, w[0]);
w -= 2;
}
while (w != p);
MM_OP_m (_mm_aesdec_si128, w[1]);
MM_OP_m (_mm_aesdeclast_si128, w[0]);
MM_XOR (m, iv);
iv = *data;
*data = m;
}
p[-2] = iv;
}
/*
SSE2: _mm_cvtsi32_si128 : movd
AVX: _mm256_setr_m128i : vinsertf128
AVX2: _mm256_add_epi64 : vpaddq ymm, ymm, ymm
_mm256_extracti128_si256 : vextracti128
_mm256_broadcastsi128_si256 : vbroadcasti128
*/
#define AVX__CTR_LOOP_START \
ctr2 = _mm256_setr_m128i(_mm_sub_epi64(ctr, one), ctr); \
two = _mm256_setr_m128i(one, one); \
two = _mm256_add_epi64(two, two); \
// two = _mm256_setr_epi64x(2, 0, 2, 0);
#define AVX__CTR_LOOP_ENC \
ctr = _mm256_extracti128_si256 (ctr2, 1); \
VAES_FUNC_START2 (AesCtr_Code_HW_256)
{
__m128i ctr = *p;
UInt32 numRounds = *(const UInt32 *)(p + 1) * 2 + 1;
const __m128i *dataEnd;
__m128i one = _mm_cvtsi32_si128(1);
__m256i ctr2, two;
p += 2;
WIDE_LOOP_START_AVX (AVX__CTR_LOOP_START)
{
const __m256i *w = keys;
UInt32 r = numRounds - 2;
WOP (AVX__DECLARE_VAR)
AVX__WOP_KEY (AVX__CTR_START, 0);
w += 1;
do
{
AVX__WOP_KEY (AVX__AES_ENC, 0)
w += 1;
}
while (--r);
AVX__WOP_KEY (AVX__AES_ENC_LAST, 0)
WOP (AVX__CTR_END);
}
WIDE_LOOP_END_AVX (AVX__CTR_LOOP_ENC)
SINGLE_LOOP
{
UInt32 numRounds2 = *(const UInt32 *)(p - 2 + 1) - 1;
const __m128i *w = p;
__m128i m;
MM_OP (_mm_add_epi64, ctr, one);
m = _mm_xor_si128 (ctr, p[0]);
w += 1;
do
{
MM_OP_m (_mm_aesenc_si128, w[0]);
MM_OP_m (_mm_aesenc_si128, w[1]);
w += 2;
}
while (--numRounds2);
MM_OP_m (_mm_aesenc_si128, w[0]);
MM_OP_m (_mm_aesenclast_si128, w[1]);
MM_XOR (*data, m);
}
p[-2] = ctr;
}
#endif // USE_INTEL_VAES
#else // USE_INTEL_AES
/* no USE_INTEL_AES */
#pragma message("AES HW_SW stub was used")
#define AES_TYPE_keys UInt32
#define AES_TYPE_data Byte
#define AES_FUNC_START(name) \
void MY_FAST_CALL name(UInt32 *p, Byte *data, size_t numBlocks) \
#define AES_COMPAT_STUB(name) \
AES_FUNC_START(name); \
AES_FUNC_START(name ## _HW) \
{ name(p, data, numBlocks); }
AES_COMPAT_STUB (AesCbc_Encode)
AES_COMPAT_STUB (AesCbc_Decode)
AES_COMPAT_STUB (AesCtr_Code)
#endif // USE_INTEL_AES
#ifndef USE_INTEL_VAES
#pragma message("VAES HW_SW stub was used")
#define VAES_COMPAT_STUB(name) \
void MY_FAST_CALL name ## _256(UInt32 *p, Byte *data, size_t numBlocks); \
void MY_FAST_CALL name ## _256(UInt32 *p, Byte *data, size_t numBlocks) \
{ name((AES_TYPE_keys *)(void *)p, (AES_TYPE_data *)(void *)data, numBlocks); }
VAES_COMPAT_STUB (AesCbc_Decode_HW)
VAES_COMPAT_STUB (AesCtr_Code_HW)
#endif // ! USE_INTEL_VAES
#elif defined(MY_CPU_ARM_OR_ARM64) && defined(MY_CPU_LE)
#if defined(__clang__)
#if (__clang_major__ >= 8) // fix that check
#define USE_HW_AES
#endif
#elif defined(__GNUC__)
#if (__GNUC__ >= 6) // fix that check
#define USE_HW_AES
#endif
#elif defined(_MSC_VER)
#if _MSC_VER >= 1910
#define USE_HW_AES
#endif
#endif
#ifdef USE_HW_AES
// #pragma message("=== AES HW === ")
#if defined(__clang__) || defined(__GNUC__)
#ifdef MY_CPU_ARM64
#define ATTRIB_AES __attribute__((__target__("+crypto")))
#else
#define ATTRIB_AES __attribute__((__target__("fpu=crypto-neon-fp-armv8")))
#endif
#else
// _MSC_VER
// for arm32
#define _ARM_USE_NEW_NEON_INTRINSICS
#endif
#ifndef ATTRIB_AES
#define ATTRIB_AES
#endif
#if defined(_MSC_VER) && defined(MY_CPU_ARM64)
#include <arm64_neon.h>
#else
#include <arm_neon.h>
#endif
typedef uint8x16_t v128;
#define AES_FUNC_START(name) \
void MY_FAST_CALL name(v128 *p, v128 *data, size_t numBlocks)
#define AES_FUNC_START2(name) \
AES_FUNC_START (name); \
ATTRIB_AES \
AES_FUNC_START (name)
#define MM_OP(op, dest, src) dest = op(dest, src);
#define MM_OP_m(op, src) MM_OP(op, m, src);
#define MM_OP1_m(op) m = op(m);
#define MM_XOR( dest, src) MM_OP(veorq_u8, dest, src);
#define MM_XOR_m( src) MM_XOR(m, src);
#define AES_E_m(k) MM_OP_m (vaeseq_u8, k);
#define AES_E_MC_m(k) AES_E_m (k); MM_OP1_m(vaesmcq_u8);
AES_FUNC_START2 (AesCbc_Encode_HW)
{
v128 m = *p;
const v128 k0 = p[2];
const v128 k1 = p[3];
const v128 k2 = p[4];
const v128 k3 = p[5];
const v128 k4 = p[6];
const v128 k5 = p[7];
const v128 k6 = p[8];
const v128 k7 = p[9];
const v128 k8 = p[10];
const v128 k9 = p[11];
const UInt32 numRounds2 = *(const UInt32 *)(p + 1);
const v128 *w = p + ((size_t)numRounds2 * 2);
const v128 k_z1 = w[1];
const v128 k_z0 = w[2];
for (; numBlocks != 0; numBlocks--, data++)
{
MM_XOR_m (*data);
AES_E_MC_m (k0)
AES_E_MC_m (k1)
AES_E_MC_m (k2)
AES_E_MC_m (k3)
AES_E_MC_m (k4)
AES_E_MC_m (k5)
AES_E_MC_m (k6)
AES_E_MC_m (k7)
AES_E_MC_m (k8)
if (numRounds2 >= 6)
{
AES_E_MC_m (k9)
AES_E_MC_m (p[12])
if (numRounds2 != 6)
{
AES_E_MC_m (p[13])
AES_E_MC_m (p[14])
}
}
AES_E_m (k_z1);
MM_XOR_m (k_z0);
*data = m;
}
*p = m;
}
#define WOP_1(op)
#define WOP_2(op) WOP_1 (op) op (m1, 1);
#define WOP_3(op) WOP_2 (op) op (m2, 2);
#define WOP_4(op) WOP_3 (op) op (m3, 3);
#define WOP_5(op) WOP_4 (op) op (m4, 4);
#define WOP_6(op) WOP_5 (op) op (m5, 5);
#define WOP_7(op) WOP_6 (op) op (m6, 6);
#define WOP_8(op) WOP_7 (op) op (m7, 7);
#define NUM_WAYS 8
#define WOP_M1 WOP_8
#define WOP(op) op (m0, 0); WOP_M1(op)
#define DECLARE_VAR(reg, ii) v128 reg
#define LOAD_data( reg, ii) reg = data[ii];
#define STORE_data( reg, ii) data[ii] = reg;
#if (NUM_WAYS > 1)
#define XOR_data_M1(reg, ii) MM_XOR (reg, data[ii- 1]);
#endif
#define MM_OP_key(op, reg) MM_OP (op, reg, key);
#define AES_D_m(k) MM_OP_m (vaesdq_u8, k);
#define AES_D_IMC_m(k) AES_D_m (k); MM_OP1_m (vaesimcq_u8);
#define AES_XOR( reg, ii) MM_OP_key (veorq_u8, reg)
#define AES_D( reg, ii) MM_OP_key (vaesdq_u8, reg)
#define AES_E( reg, ii) MM_OP_key (vaeseq_u8, reg)
#define AES_D_IMC( reg, ii) AES_D (reg, ii); reg = vaesimcq_u8(reg)
#define AES_E_MC( reg, ii) AES_E (reg, ii); reg = vaesmcq_u8(reg)
#define CTR_START(reg, ii) MM_OP (vaddq_u64, ctr, one); reg = vreinterpretq_u8_u64(ctr);
#define CTR_END( reg, ii) MM_XOR (data[ii], reg);
#define WOP_KEY(op, n) { \
const v128 key = w[n]; \
WOP(op); }
#define WIDE_LOOP_START \
dataEnd = data + numBlocks; \
if (numBlocks >= NUM_WAYS) \
{ dataEnd -= NUM_WAYS; do { \
#define WIDE_LOOP_END \
data += NUM_WAYS; \
} while (data <= dataEnd); \
dataEnd += NUM_WAYS; } \
#define SINGLE_LOOP \
for (; data < dataEnd; data++)
AES_FUNC_START2 (AesCbc_Decode_HW)
{
v128 iv = *p;
const v128 *wStart = p + ((size_t)*(const UInt32 *)(p + 1)) * 2;
const v128 *dataEnd;
p += 2;
WIDE_LOOP_START
{
const v128 *w = wStart;
WOP (DECLARE_VAR)
WOP (LOAD_data);
WOP_KEY (AES_D_IMC, 2)
do
{
WOP_KEY (AES_D_IMC, 1)
WOP_KEY (AES_D_IMC, 0)
w -= 2;
}
while (w != p);
WOP_KEY (AES_D, 1)
WOP_KEY (AES_XOR, 0)
MM_XOR (m0, iv);
WOP_M1 (XOR_data_M1)
iv = data[NUM_WAYS - 1];
WOP (STORE_data);
}
WIDE_LOOP_END
SINGLE_LOOP
{
const v128 *w = wStart;
v128 m = *data;
AES_D_IMC_m (w[2])
do
{
AES_D_IMC_m (w[1]);
AES_D_IMC_m (w[0]);
w -= 2;
}
while (w != p);
AES_D_m (w[1]);
MM_XOR_m (w[0]);
MM_XOR_m (iv);
iv = *data;
*data = m;
}
p[-2] = iv;
}
AES_FUNC_START2 (AesCtr_Code_HW)
{
uint64x2_t ctr = vreinterpretq_u64_u8(*p);
const v128 *wEnd = p + ((size_t)*(const UInt32 *)(p + 1)) * 2;
const v128 *dataEnd;
uint64x2_t one = vdupq_n_u64(0);
one = vsetq_lane_u64(1, one, 0);
p += 2;
WIDE_LOOP_START
{
const v128 *w = p;
WOP (DECLARE_VAR)
WOP (CTR_START);
do
{
WOP_KEY (AES_E_MC, 0)
WOP_KEY (AES_E_MC, 1)
w += 2;
}
while (w != wEnd);
WOP_KEY (AES_E_MC, 0)
WOP_KEY (AES_E, 1)
WOP_KEY (AES_XOR, 2)
WOP (CTR_END);
}
WIDE_LOOP_END
SINGLE_LOOP
{
const v128 *w = p;
v128 m;
CTR_START (m, 0);
do
{
AES_E_MC_m (w[0]);
AES_E_MC_m (w[1]);
w += 2;
}
while (w != wEnd);
AES_E_MC_m (w[0]);
AES_E_m (w[1]);
MM_XOR_m (w[2]);
CTR_END (m, 0);
}
p[-2] = vreinterpretq_u8_u64(ctr);
}
#endif // USE_HW_AES
#endif // MY_CPU_ARM_OR_ARM64

View file

@ -1,463 +0,0 @@
/* Alloc.c -- Memory allocation functions
2021-07-13 : Igor Pavlov : Public domain */
#include "Precomp.h"
#include <stdio.h>
#ifdef _WIN32
#include <Windows.h>
#endif
#include <stdlib.h>
#include "Alloc.h"
/* #define _SZ_ALLOC_DEBUG */
/* use _SZ_ALLOC_DEBUG to debug alloc/free operations */
#ifdef _SZ_ALLOC_DEBUG
#include <stdio.h>
int g_allocCount = 0;
int g_allocCountMid = 0;
int g_allocCountBig = 0;
#define CONVERT_INT_TO_STR(charType, tempSize) \
unsigned char temp[tempSize]; unsigned i = 0; \
while (val >= 10) { temp[i++] = (unsigned char)('0' + (unsigned)(val % 10)); val /= 10; } \
*s++ = (charType)('0' + (unsigned)val); \
while (i != 0) { i--; *s++ = temp[i]; } \
*s = 0;
static void ConvertUInt64ToString(UInt64 val, char *s)
{
CONVERT_INT_TO_STR(char, 24);
}
#define GET_HEX_CHAR(t) ((char)(((t < 10) ? ('0' + t) : ('A' + (t - 10)))))
static void ConvertUInt64ToHex(UInt64 val, char *s)
{
UInt64 v = val;
unsigned i;
for (i = 1;; i++)
{
v >>= 4;
if (v == 0)
break;
}
s[i] = 0;
do
{
unsigned t = (unsigned)(val & 0xF);
val >>= 4;
s[--i] = GET_HEX_CHAR(t);
}
while (i);
}
#define DEBUG_OUT_STREAM stderr
static void Print(const char *s)
{
fputs(s, DEBUG_OUT_STREAM);
}
static void PrintAligned(const char *s, size_t align)
{
size_t len = strlen(s);
for(;;)
{
fputc(' ', DEBUG_OUT_STREAM);
if (len >= align)
break;
++len;
}
Print(s);
}
static void PrintLn()
{
Print("\n");
}
static void PrintHex(UInt64 v, size_t align)
{
char s[32];
ConvertUInt64ToHex(v, s);
PrintAligned(s, align);
}
static void PrintDec(UInt64 v, size_t align)
{
char s[32];
ConvertUInt64ToString(v, s);
PrintAligned(s, align);
}
static void PrintAddr(void *p)
{
PrintHex((UInt64)(size_t)(ptrdiff_t)p, 12);
}
#define PRINT_ALLOC(name, cnt, size, ptr) \
Print(name " "); \
PrintDec(cnt++, 10); \
PrintHex(size, 10); \
PrintAddr(ptr); \
PrintLn();
#define PRINT_FREE(name, cnt, ptr) if (ptr) { \
Print(name " "); \
PrintDec(--cnt, 10); \
PrintAddr(ptr); \
PrintLn(); }
#else
#define PRINT_ALLOC(name, cnt, size, ptr)
#define PRINT_FREE(name, cnt, ptr)
#define Print(s)
#define PrintLn()
#define PrintHex(v, align)
#define PrintAddr(p)
#endif
void *MyAlloc(size_t size)
{
if (size == 0)
return NULL;
PRINT_ALLOC("Alloc ", g_allocCount, size, NULL);
#ifdef _SZ_ALLOC_DEBUG
{
void *p = malloc(size);
// PRINT_ALLOC("Alloc ", g_allocCount, size, p);
return p;
}
#else
return malloc(size);
#endif
}
void MyFree(void *address)
{
PRINT_FREE("Free ", g_allocCount, address);
free(address);
}
#ifdef _WIN32
void *MidAlloc(size_t size)
{
if (size == 0)
return NULL;
PRINT_ALLOC("Alloc-Mid", g_allocCountMid, size, NULL);
return VirtualAlloc(NULL, size, MEM_COMMIT, PAGE_READWRITE);
}
void MidFree(void *address)
{
PRINT_FREE("Free-Mid", g_allocCountMid, address);
if (!address)
return;
VirtualFree(address, 0, MEM_RELEASE);
}
#ifdef _7ZIP_LARGE_PAGES
#ifdef MEM_LARGE_PAGES
#define MY__MEM_LARGE_PAGES MEM_LARGE_PAGES
#else
#define MY__MEM_LARGE_PAGES 0x20000000
#endif
extern
SIZE_T g_LargePageSize;
SIZE_T g_LargePageSize = 0;
typedef SIZE_T (WINAPI *GetLargePageMinimumP)(VOID);
#endif // _7ZIP_LARGE_PAGES
void SetLargePageSize()
{
#ifdef _7ZIP_LARGE_PAGES
SIZE_T size;
GetLargePageMinimumP largePageMinimum = (GetLargePageMinimumP)
GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "GetLargePageMinimum");
if (!largePageMinimum)
return;
size = largePageMinimum();
if (size == 0 || (size & (size - 1)) != 0)
return;
g_LargePageSize = size;
#endif
}
void *BigAlloc(size_t size)
{
if (size == 0)
return NULL;
PRINT_ALLOC("Alloc-Big", g_allocCountBig, size, NULL);
#ifdef _7ZIP_LARGE_PAGES
{
SIZE_T ps = g_LargePageSize;
if (ps != 0 && ps <= (1 << 30) && size > (ps / 2))
{
size_t size2;
ps--;
size2 = (size + ps) & ~ps;
if (size2 >= size)
{
void *res = VirtualAlloc(NULL, size2, MEM_COMMIT | MY__MEM_LARGE_PAGES, PAGE_READWRITE);
if (res)
return res;
}
}
}
#endif
return VirtualAlloc(NULL, size, MEM_COMMIT, PAGE_READWRITE);
}
void BigFree(void *address)
{
PRINT_FREE("Free-Big", g_allocCountBig, address);
if (!address)
return;
VirtualFree(address, 0, MEM_RELEASE);
}
#endif
static void *SzAlloc(ISzAllocPtr p, size_t size) { UNUSED_VAR(p); return MyAlloc(size); }
static void SzFree(ISzAllocPtr p, void *address) { UNUSED_VAR(p); MyFree(address); }
const ISzAlloc g_Alloc = { SzAlloc, SzFree };
#ifdef _WIN32
static void *SzMidAlloc(ISzAllocPtr p, size_t size) { UNUSED_VAR(p); return MidAlloc(size); }
static void SzMidFree(ISzAllocPtr p, void *address) { UNUSED_VAR(p); MidFree(address); }
static void *SzBigAlloc(ISzAllocPtr p, size_t size) { UNUSED_VAR(p); return BigAlloc(size); }
static void SzBigFree(ISzAllocPtr p, void *address) { UNUSED_VAR(p); BigFree(address); }
const ISzAlloc g_MidAlloc = { SzMidAlloc, SzMidFree };
const ISzAlloc g_BigAlloc = { SzBigAlloc, SzBigFree };
#endif
/*
uintptr_t : <stdint.h> C99 (optional)
: unsupported in VS6
*/
#ifdef _WIN32
typedef UINT_PTR UIntPtr;
#else
/*
typedef uintptr_t UIntPtr;
*/
typedef ptrdiff_t UIntPtr;
#endif
#define ADJUST_ALLOC_SIZE 0
/*
#define ADJUST_ALLOC_SIZE (sizeof(void *) - 1)
*/
/*
Use (ADJUST_ALLOC_SIZE = (sizeof(void *) - 1)), if
MyAlloc() can return address that is NOT multiple of sizeof(void *).
*/
/*
#define MY_ALIGN_PTR_DOWN(p, align) ((void *)((char *)(p) - ((size_t)(UIntPtr)(p) & ((align) - 1))))
*/
#define MY_ALIGN_PTR_DOWN(p, align) ((void *)((((UIntPtr)(p)) & ~((UIntPtr)(align) - 1))))
#if !defined(_WIN32) && defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200112L)
#define USE_posix_memalign
#endif
#ifndef USE_posix_memalign
#define MY_ALIGN_PTR_UP_PLUS(p, align) MY_ALIGN_PTR_DOWN(((char *)(p) + (align) + ADJUST_ALLOC_SIZE), align)
#endif
/*
This posix_memalign() is for test purposes only.
We also need special Free() function instead of free(),
if this posix_memalign() is used.
*/
/*
static int posix_memalign(void **ptr, size_t align, size_t size)
{
size_t newSize = size + align;
void *p;
void *pAligned;
*ptr = NULL;
if (newSize < size)
return 12; // ENOMEM
p = MyAlloc(newSize);
if (!p)
return 12; // ENOMEM
pAligned = MY_ALIGN_PTR_UP_PLUS(p, align);
((void **)pAligned)[-1] = p;
*ptr = pAligned;
return 0;
}
*/
/*
ALLOC_ALIGN_SIZE >= sizeof(void *)
ALLOC_ALIGN_SIZE >= cache_line_size
*/
#define ALLOC_ALIGN_SIZE ((size_t)1 << 7)
static void *SzAlignedAlloc(ISzAllocPtr pp, size_t size)
{
#ifndef USE_posix_memalign
void *p;
void *pAligned;
size_t newSize;
UNUSED_VAR(pp);
/* also we can allocate additional dummy ALLOC_ALIGN_SIZE bytes after aligned
block to prevent cache line sharing with another allocated blocks */
newSize = size + ALLOC_ALIGN_SIZE * 1 + ADJUST_ALLOC_SIZE;
if (newSize < size)
return NULL;
p = MyAlloc(newSize);
if (!p)
return NULL;
pAligned = MY_ALIGN_PTR_UP_PLUS(p, ALLOC_ALIGN_SIZE);
Print(" size="); PrintHex(size, 8);
Print(" a_size="); PrintHex(newSize, 8);
Print(" ptr="); PrintAddr(p);
Print(" a_ptr="); PrintAddr(pAligned);
PrintLn();
((void **)pAligned)[-1] = p;
return pAligned;
#else
void *p;
UNUSED_VAR(pp);
if (posix_memalign(&p, ALLOC_ALIGN_SIZE, size))
return NULL;
Print(" posix_memalign="); PrintAddr(p);
PrintLn();
return p;
#endif
}
static void SzAlignedFree(ISzAllocPtr pp, void *address)
{
UNUSED_VAR(pp);
#ifndef USE_posix_memalign
if (address)
MyFree(((void **)address)[-1]);
#else
free(address);
#endif
}
const ISzAlloc g_AlignedAlloc = { SzAlignedAlloc, SzAlignedFree };
#define MY_ALIGN_PTR_DOWN_1(p) MY_ALIGN_PTR_DOWN(p, sizeof(void *))
/* we align ptr to support cases where CAlignOffsetAlloc::offset is not multiply of sizeof(void *) */
#define REAL_BLOCK_PTR_VAR(p) ((void **)MY_ALIGN_PTR_DOWN_1(p))[-1]
/*
#define REAL_BLOCK_PTR_VAR(p) ((void **)(p))[-1]
*/
static void *AlignOffsetAlloc_Alloc(ISzAllocPtr pp, size_t size)
{
CAlignOffsetAlloc *p = CONTAINER_FROM_VTBL(pp, CAlignOffsetAlloc, vt);
void *adr;
void *pAligned;
size_t newSize;
size_t extra;
size_t alignSize = (size_t)1 << p->numAlignBits;
if (alignSize < sizeof(void *))
alignSize = sizeof(void *);
if (p->offset >= alignSize)
return NULL;
/* also we can allocate additional dummy ALLOC_ALIGN_SIZE bytes after aligned
block to prevent cache line sharing with another allocated blocks */
extra = p->offset & (sizeof(void *) - 1);
newSize = size + alignSize + extra + ADJUST_ALLOC_SIZE;
if (newSize < size)
return NULL;
adr = ISzAlloc_Alloc(p->baseAlloc, newSize);
if (!adr)
return NULL;
pAligned = (char *)MY_ALIGN_PTR_DOWN((char *)adr +
alignSize - p->offset + extra + ADJUST_ALLOC_SIZE, alignSize) + p->offset;
PrintLn();
Print("- Aligned: ");
Print(" size="); PrintHex(size, 8);
Print(" a_size="); PrintHex(newSize, 8);
Print(" ptr="); PrintAddr(adr);
Print(" a_ptr="); PrintAddr(pAligned);
PrintLn();
REAL_BLOCK_PTR_VAR(pAligned) = adr;
return pAligned;
}
static void AlignOffsetAlloc_Free(ISzAllocPtr pp, void *address)
{
if (address)
{
CAlignOffsetAlloc *p = CONTAINER_FROM_VTBL(pp, CAlignOffsetAlloc, vt);
PrintLn();
Print("- Aligned Free: ");
PrintLn();
ISzAlloc_Free(p->baseAlloc, REAL_BLOCK_PTR_VAR(address));
}
}
void AlignOffsetAlloc_CreateVTable(CAlignOffsetAlloc *p)
{
p->vt.Alloc = AlignOffsetAlloc_Alloc;
p->vt.Free = AlignOffsetAlloc_Free;
}

View file

@ -1,58 +0,0 @@
/* Alloc.h -- Memory allocation functions
2021-07-13 : Igor Pavlov : Public domain */
#ifndef __COMMON_ALLOC_H
#define __COMMON_ALLOC_H
#include "7zTypes.h"
EXTERN_C_BEGIN
void *MyAlloc(size_t size);
void MyFree(void *address);
#ifdef _WIN32
void SetLargePageSize(void);
void *MidAlloc(size_t size);
void MidFree(void *address);
void *BigAlloc(size_t size);
void BigFree(void *address);
#else
#define MidAlloc(size) MyAlloc(size)
#define MidFree(address) MyFree(address)
#define BigAlloc(size) MyAlloc(size)
#define BigFree(address) MyFree(address)
#endif
extern const ISzAlloc g_Alloc;
#ifdef _WIN32
extern const ISzAlloc g_BigAlloc;
extern const ISzAlloc g_MidAlloc;
#else
#define g_BigAlloc g_AlignedAlloc
#define g_MidAlloc g_AlignedAlloc
#endif
extern const ISzAlloc g_AlignedAlloc;
typedef struct
{
ISzAlloc vt;
ISzAllocPtr baseAlloc;
unsigned numAlignBits; /* ((1 << numAlignBits) >= sizeof(void *)) */
size_t offset; /* (offset == (k * sizeof(void *)) && offset < (1 << numAlignBits) */
} CAlignOffsetAlloc;
void AlignOffsetAlloc_CreateVTable(CAlignOffsetAlloc *p);
EXTERN_C_END
#endif

257
3rdparty/7z/src/Bcj2.c vendored
View file

@ -1,257 +0,0 @@
/* Bcj2.c -- BCJ2 Decoder (Converter for x86 code)
2021-02-09 : Igor Pavlov : Public domain */
#include "Precomp.h"
#include "Bcj2.h"
#include "CpuArch.h"
#define CProb UInt16
#define kTopValue ((UInt32)1 << 24)
#define kNumModelBits 11
#define kBitModelTotal (1 << kNumModelBits)
#define kNumMoveBits 5
#define _IF_BIT_0 ttt = *prob; bound = (p->range >> kNumModelBits) * ttt; if (p->code < bound)
#define _UPDATE_0 p->range = bound; *prob = (CProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits));
#define _UPDATE_1 p->range -= bound; p->code -= bound; *prob = (CProb)(ttt - (ttt >> kNumMoveBits));
void Bcj2Dec_Init(CBcj2Dec *p)
{
unsigned i;
p->state = BCJ2_DEC_STATE_OK;
p->ip = 0;
p->temp[3] = 0;
p->range = 0;
p->code = 0;
for (i = 0; i < sizeof(p->probs) / sizeof(p->probs[0]); i++)
p->probs[i] = kBitModelTotal >> 1;
}
SRes Bcj2Dec_Decode(CBcj2Dec *p)
{
if (p->range <= 5)
{
p->state = BCJ2_DEC_STATE_OK;
for (; p->range != 5; p->range++)
{
if (p->range == 1 && p->code != 0)
return SZ_ERROR_DATA;
if (p->bufs[BCJ2_STREAM_RC] == p->lims[BCJ2_STREAM_RC])
{
p->state = BCJ2_STREAM_RC;
return SZ_OK;
}
p->code = (p->code << 8) | *(p->bufs[BCJ2_STREAM_RC])++;
}
if (p->code == 0xFFFFFFFF)
return SZ_ERROR_DATA;
p->range = 0xFFFFFFFF;
}
else if (p->state >= BCJ2_DEC_STATE_ORIG_0)
{
while (p->state <= BCJ2_DEC_STATE_ORIG_3)
{
Byte *dest = p->dest;
if (dest == p->destLim)
return SZ_OK;
*dest = p->temp[(size_t)p->state - BCJ2_DEC_STATE_ORIG_0];
p->state++;
p->dest = dest + 1;
}
}
/*
if (BCJ2_IS_32BIT_STREAM(p->state))
{
const Byte *cur = p->bufs[p->state];
if (cur == p->lims[p->state])
return SZ_OK;
p->bufs[p->state] = cur + 4;
{
UInt32 val;
Byte *dest;
SizeT rem;
p->ip += 4;
val = GetBe32(cur) - p->ip;
dest = p->dest;
rem = p->destLim - dest;
if (rem < 4)
{
SizeT i;
SetUi32(p->temp, val);
for (i = 0; i < rem; i++)
dest[i] = p->temp[i];
p->dest = dest + rem;
p->state = BCJ2_DEC_STATE_ORIG_0 + (unsigned)rem;
return SZ_OK;
}
SetUi32(dest, val);
p->temp[3] = (Byte)(val >> 24);
p->dest = dest + 4;
p->state = BCJ2_DEC_STATE_OK;
}
}
*/
for (;;)
{
if (BCJ2_IS_32BIT_STREAM(p->state))
p->state = BCJ2_DEC_STATE_OK;
else
{
if (p->range < kTopValue)
{
if (p->bufs[BCJ2_STREAM_RC] == p->lims[BCJ2_STREAM_RC])
{
p->state = BCJ2_STREAM_RC;
return SZ_OK;
}
p->range <<= 8;
p->code = (p->code << 8) | *(p->bufs[BCJ2_STREAM_RC])++;
}
{
const Byte *src = p->bufs[BCJ2_STREAM_MAIN];
const Byte *srcLim;
Byte *dest;
SizeT num = (SizeT)(p->lims[BCJ2_STREAM_MAIN] - src);
if (num == 0)
{
p->state = BCJ2_STREAM_MAIN;
return SZ_OK;
}
dest = p->dest;
if (num > (SizeT)(p->destLim - dest))
{
num = (SizeT)(p->destLim - dest);
if (num == 0)
{
p->state = BCJ2_DEC_STATE_ORIG;
return SZ_OK;
}
}
srcLim = src + num;
if (p->temp[3] == 0x0F && (src[0] & 0xF0) == 0x80)
*dest = src[0];
else for (;;)
{
Byte b = *src;
*dest = b;
if (b != 0x0F)
{
if ((b & 0xFE) == 0xE8)
break;
dest++;
if (++src != srcLim)
continue;
break;
}
dest++;
if (++src == srcLim)
break;
if ((*src & 0xF0) != 0x80)
continue;
*dest = *src;
break;
}
num = (SizeT)(src - p->bufs[BCJ2_STREAM_MAIN]);
if (src == srcLim)
{
p->temp[3] = src[-1];
p->bufs[BCJ2_STREAM_MAIN] = src;
p->ip += (UInt32)num;
p->dest += num;
p->state =
p->bufs[BCJ2_STREAM_MAIN] ==
p->lims[BCJ2_STREAM_MAIN] ?
(unsigned)BCJ2_STREAM_MAIN :
(unsigned)BCJ2_DEC_STATE_ORIG;
return SZ_OK;
}
{
UInt32 bound, ttt;
CProb *prob;
Byte b = src[0];
Byte prev = (Byte)(num == 0 ? p->temp[3] : src[-1]);
p->temp[3] = b;
p->bufs[BCJ2_STREAM_MAIN] = src + 1;
num++;
p->ip += (UInt32)num;
p->dest += num;
prob = p->probs + (unsigned)(b == 0xE8 ? 2 + (unsigned)prev : (b == 0xE9 ? 1 : 0));
_IF_BIT_0
{
_UPDATE_0
continue;
}
_UPDATE_1
}
}
}
{
UInt32 val;
unsigned cj = (p->temp[3] == 0xE8) ? BCJ2_STREAM_CALL : BCJ2_STREAM_JUMP;
const Byte *cur = p->bufs[cj];
Byte *dest;
SizeT rem;
if (cur == p->lims[cj])
{
p->state = cj;
break;
}
val = GetBe32(cur);
p->bufs[cj] = cur + 4;
p->ip += 4;
val -= p->ip;
dest = p->dest;
rem = (SizeT)(p->destLim - dest);
if (rem < 4)
{
p->temp[0] = (Byte)val; if (rem > 0) dest[0] = (Byte)val; val >>= 8;
p->temp[1] = (Byte)val; if (rem > 1) dest[1] = (Byte)val; val >>= 8;
p->temp[2] = (Byte)val; if (rem > 2) dest[2] = (Byte)val; val >>= 8;
p->temp[3] = (Byte)val;
p->dest = dest + rem;
p->state = BCJ2_DEC_STATE_ORIG_0 + (unsigned)rem;
break;
}
SetUi32(dest, val);
p->temp[3] = (Byte)(val >> 24);
p->dest = dest + 4;
}
}
if (p->range < kTopValue && p->bufs[BCJ2_STREAM_RC] != p->lims[BCJ2_STREAM_RC])
{
p->range <<= 8;
p->code = (p->code << 8) | *(p->bufs[BCJ2_STREAM_RC])++;
}
return SZ_OK;
}

146
3rdparty/7z/src/Bcj2.h vendored
View file

@ -1,146 +0,0 @@
/* Bcj2.h -- BCJ2 Converter for x86 code
2014-11-10 : Igor Pavlov : Public domain */
#ifndef __BCJ2_H
#define __BCJ2_H
#include "7zTypes.h"
EXTERN_C_BEGIN
#define BCJ2_NUM_STREAMS 4
enum
{
BCJ2_STREAM_MAIN,
BCJ2_STREAM_CALL,
BCJ2_STREAM_JUMP,
BCJ2_STREAM_RC
};
enum
{
BCJ2_DEC_STATE_ORIG_0 = BCJ2_NUM_STREAMS,
BCJ2_DEC_STATE_ORIG_1,
BCJ2_DEC_STATE_ORIG_2,
BCJ2_DEC_STATE_ORIG_3,
BCJ2_DEC_STATE_ORIG,
BCJ2_DEC_STATE_OK
};
enum
{
BCJ2_ENC_STATE_ORIG = BCJ2_NUM_STREAMS,
BCJ2_ENC_STATE_OK
};
#define BCJ2_IS_32BIT_STREAM(s) ((s) == BCJ2_STREAM_CALL || (s) == BCJ2_STREAM_JUMP)
/*
CBcj2Dec / CBcj2Enc
bufs sizes:
BUF_SIZE(n) = lims[n] - bufs[n]
bufs sizes for BCJ2_STREAM_CALL and BCJ2_STREAM_JUMP must be mutliply of 4:
(BUF_SIZE(BCJ2_STREAM_CALL) & 3) == 0
(BUF_SIZE(BCJ2_STREAM_JUMP) & 3) == 0
*/
/*
CBcj2Dec:
dest is allowed to overlap with bufs[BCJ2_STREAM_MAIN], with the following conditions:
bufs[BCJ2_STREAM_MAIN] >= dest &&
bufs[BCJ2_STREAM_MAIN] - dest >= tempReserv +
BUF_SIZE(BCJ2_STREAM_CALL) +
BUF_SIZE(BCJ2_STREAM_JUMP)
tempReserv = 0 : for first call of Bcj2Dec_Decode
tempReserv = 4 : for any other calls of Bcj2Dec_Decode
overlap with offset = 1 is not allowed
*/
typedef struct
{
const Byte *bufs[BCJ2_NUM_STREAMS];
const Byte *lims[BCJ2_NUM_STREAMS];
Byte *dest;
const Byte *destLim;
unsigned state; /* BCJ2_STREAM_MAIN has more priority than BCJ2_STATE_ORIG */
UInt32 ip;
Byte temp[4];
UInt32 range;
UInt32 code;
UInt16 probs[2 + 256];
} CBcj2Dec;
void Bcj2Dec_Init(CBcj2Dec *p);
/* Returns: SZ_OK or SZ_ERROR_DATA */
SRes Bcj2Dec_Decode(CBcj2Dec *p);
#define Bcj2Dec_IsFinished(_p_) ((_p_)->code == 0)
typedef enum
{
BCJ2_ENC_FINISH_MODE_CONTINUE,
BCJ2_ENC_FINISH_MODE_END_BLOCK,
BCJ2_ENC_FINISH_MODE_END_STREAM
} EBcj2Enc_FinishMode;
typedef struct
{
Byte *bufs[BCJ2_NUM_STREAMS];
const Byte *lims[BCJ2_NUM_STREAMS];
const Byte *src;
const Byte *srcLim;
unsigned state;
EBcj2Enc_FinishMode finishMode;
Byte prevByte;
Byte cache;
UInt32 range;
UInt64 low;
UInt64 cacheSize;
UInt32 ip;
/* 32-bit ralative offset in JUMP/CALL commands is
- (mod 4 GB) in 32-bit mode
- signed Int32 in 64-bit mode
We use (mod 4 GB) check for fileSize.
Use fileSize up to 2 GB, if you want to support 32-bit and 64-bit code conversion. */
UInt32 fileIp;
UInt32 fileSize; /* (fileSize <= ((UInt32)1 << 31)), 0 means no_limit */
UInt32 relatLimit; /* (relatLimit <= ((UInt32)1 << 31)), 0 means desable_conversion */
UInt32 tempTarget;
unsigned tempPos;
Byte temp[4 * 2];
unsigned flushPos;
UInt16 probs[2 + 256];
} CBcj2Enc;
void Bcj2Enc_Init(CBcj2Enc *p);
void Bcj2Enc_Encode(CBcj2Enc *p);
#define Bcj2Enc_Get_InputData_Size(p) ((SizeT)((p)->srcLim - (p)->src) + (p)->tempPos)
#define Bcj2Enc_IsFinished(p) ((p)->flushPos == 5)
#define BCJ2_RELAT_LIMIT_NUM_BITS 26
#define BCJ2_RELAT_LIMIT ((UInt32)1 << BCJ2_RELAT_LIMIT_NUM_BITS)
/* limit for CBcj2Enc::fileSize variable */
#define BCJ2_FileSize_MAX ((UInt32)1 << 31)
EXTERN_C_END
#endif

View file

@ -1,311 +0,0 @@
/* Bcj2Enc.c -- BCJ2 Encoder (Converter for x86 code)
2021-02-09 : Igor Pavlov : Public domain */
#include "Precomp.h"
/* #define SHOW_STAT */
#ifdef SHOW_STAT
#include <stdio.h>
#define PRF(x) x
#else
#define PRF(x)
#endif
#include <string.h>
#include "Bcj2.h"
#include "CpuArch.h"
#define CProb UInt16
#define kTopValue ((UInt32)1 << 24)
#define kNumModelBits 11
#define kBitModelTotal (1 << kNumModelBits)
#define kNumMoveBits 5
void Bcj2Enc_Init(CBcj2Enc *p)
{
unsigned i;
p->state = BCJ2_ENC_STATE_OK;
p->finishMode = BCJ2_ENC_FINISH_MODE_CONTINUE;
p->prevByte = 0;
p->cache = 0;
p->range = 0xFFFFFFFF;
p->low = 0;
p->cacheSize = 1;
p->ip = 0;
p->fileIp = 0;
p->fileSize = 0;
p->relatLimit = BCJ2_RELAT_LIMIT;
p->tempPos = 0;
p->flushPos = 0;
for (i = 0; i < sizeof(p->probs) / sizeof(p->probs[0]); i++)
p->probs[i] = kBitModelTotal >> 1;
}
static BoolInt MY_FAST_CALL RangeEnc_ShiftLow(CBcj2Enc *p)
{
if ((UInt32)p->low < (UInt32)0xFF000000 || (UInt32)(p->low >> 32) != 0)
{
Byte *buf = p->bufs[BCJ2_STREAM_RC];
do
{
if (buf == p->lims[BCJ2_STREAM_RC])
{
p->state = BCJ2_STREAM_RC;
p->bufs[BCJ2_STREAM_RC] = buf;
return True;
}
*buf++ = (Byte)(p->cache + (Byte)(p->low >> 32));
p->cache = 0xFF;
}
while (--p->cacheSize);
p->bufs[BCJ2_STREAM_RC] = buf;
p->cache = (Byte)((UInt32)p->low >> 24);
}
p->cacheSize++;
p->low = (UInt32)p->low << 8;
return False;
}
static void Bcj2Enc_Encode_2(CBcj2Enc *p)
{
if (BCJ2_IS_32BIT_STREAM(p->state))
{
Byte *cur = p->bufs[p->state];
if (cur == p->lims[p->state])
return;
SetBe32(cur, p->tempTarget);
p->bufs[p->state] = cur + 4;
}
p->state = BCJ2_ENC_STATE_ORIG;
for (;;)
{
if (p->range < kTopValue)
{
if (RangeEnc_ShiftLow(p))
return;
p->range <<= 8;
}
{
{
const Byte *src = p->src;
const Byte *srcLim;
Byte *dest;
SizeT num = (SizeT)(p->srcLim - src);
if (p->finishMode == BCJ2_ENC_FINISH_MODE_CONTINUE)
{
if (num <= 4)
return;
num -= 4;
}
else if (num == 0)
break;
dest = p->bufs[BCJ2_STREAM_MAIN];
if (num > (SizeT)(p->lims[BCJ2_STREAM_MAIN] - dest))
{
num = (SizeT)(p->lims[BCJ2_STREAM_MAIN] - dest);
if (num == 0)
{
p->state = BCJ2_STREAM_MAIN;
return;
}
}
srcLim = src + num;
if (p->prevByte == 0x0F && (src[0] & 0xF0) == 0x80)
*dest = src[0];
else for (;;)
{
Byte b = *src;
*dest = b;
if (b != 0x0F)
{
if ((b & 0xFE) == 0xE8)
break;
dest++;
if (++src != srcLim)
continue;
break;
}
dest++;
if (++src == srcLim)
break;
if ((*src & 0xF0) != 0x80)
continue;
*dest = *src;
break;
}
num = (SizeT)(src - p->src);
if (src == srcLim)
{
p->prevByte = src[-1];
p->bufs[BCJ2_STREAM_MAIN] = dest;
p->src = src;
p->ip += (UInt32)num;
continue;
}
{
Byte context = (Byte)(num == 0 ? p->prevByte : src[-1]);
BoolInt needConvert;
p->bufs[BCJ2_STREAM_MAIN] = dest + 1;
p->ip += (UInt32)num + 1;
src++;
needConvert = False;
if ((SizeT)(p->srcLim - src) >= 4)
{
UInt32 relatVal = GetUi32(src);
if ((p->fileSize == 0 || (UInt32)(p->ip + 4 + relatVal - p->fileIp) < p->fileSize)
&& ((relatVal + p->relatLimit) >> 1) < p->relatLimit)
needConvert = True;
}
{
UInt32 bound;
unsigned ttt;
Byte b = src[-1];
CProb *prob = p->probs + (unsigned)(b == 0xE8 ? 2 + (unsigned)context : (b == 0xE9 ? 1 : 0));
ttt = *prob;
bound = (p->range >> kNumModelBits) * ttt;
if (!needConvert)
{
p->range = bound;
*prob = (CProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits));
p->src = src;
p->prevByte = b;
continue;
}
p->low += bound;
p->range -= bound;
*prob = (CProb)(ttt - (ttt >> kNumMoveBits));
{
UInt32 relatVal = GetUi32(src);
UInt32 absVal;
p->ip += 4;
absVal = p->ip + relatVal;
p->prevByte = src[3];
src += 4;
p->src = src;
{
unsigned cj = (b == 0xE8) ? BCJ2_STREAM_CALL : BCJ2_STREAM_JUMP;
Byte *cur = p->bufs[cj];
if (cur == p->lims[cj])
{
p->state = cj;
p->tempTarget = absVal;
return;
}
SetBe32(cur, absVal);
p->bufs[cj] = cur + 4;
}
}
}
}
}
}
}
if (p->finishMode != BCJ2_ENC_FINISH_MODE_END_STREAM)
return;
for (; p->flushPos < 5; p->flushPos++)
if (RangeEnc_ShiftLow(p))
return;
p->state = BCJ2_ENC_STATE_OK;
}
void Bcj2Enc_Encode(CBcj2Enc *p)
{
PRF(printf("\n"));
PRF(printf("---- ip = %8d tempPos = %8d src = %8d\n", p->ip, p->tempPos, p->srcLim - p->src));
if (p->tempPos != 0)
{
unsigned extra = 0;
for (;;)
{
const Byte *src = p->src;
const Byte *srcLim = p->srcLim;
EBcj2Enc_FinishMode finishMode = p->finishMode;
p->src = p->temp;
p->srcLim = p->temp + p->tempPos;
if (src != srcLim)
p->finishMode = BCJ2_ENC_FINISH_MODE_CONTINUE;
PRF(printf(" ip = %8d tempPos = %8d src = %8d\n", p->ip, p->tempPos, p->srcLim - p->src));
Bcj2Enc_Encode_2(p);
{
unsigned num = (unsigned)(p->src - p->temp);
unsigned tempPos = p->tempPos - num;
unsigned i;
p->tempPos = tempPos;
for (i = 0; i < tempPos; i++)
p->temp[i] = p->temp[(size_t)i + num];
p->src = src;
p->srcLim = srcLim;
p->finishMode = finishMode;
if (p->state != BCJ2_ENC_STATE_ORIG || src == srcLim)
return;
if (extra >= tempPos)
{
p->src = src - tempPos;
p->tempPos = 0;
break;
}
p->temp[tempPos] = src[0];
p->tempPos = tempPos + 1;
p->src = src + 1;
extra++;
}
}
}
PRF(printf("++++ ip = %8d tempPos = %8d src = %8d\n", p->ip, p->tempPos, p->srcLim - p->src));
Bcj2Enc_Encode_2(p);
if (p->state == BCJ2_ENC_STATE_ORIG)
{
const Byte *src = p->src;
unsigned rem = (unsigned)(p->srcLim - src);
unsigned i;
for (i = 0; i < rem; i++)
p->temp[i] = src[i];
p->tempPos = rem;
p->src = src + rem;
}
}

230
3rdparty/7z/src/Bra.c vendored
View file

@ -1,230 +0,0 @@
/* Bra.c -- Converters for RISC code
2021-02-09 : Igor Pavlov : Public domain */
#include "Precomp.h"
#include "CpuArch.h"
#include "Bra.h"
SizeT ARM_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
{
Byte *p;
const Byte *lim;
size &= ~(size_t)3;
ip += 4;
p = data;
lim = data + size;
if (encoding)
for (;;)
{
for (;;)
{
if (p >= lim)
return (SizeT)(p - data);
p += 4;
if (p[-1] == 0xEB)
break;
}
{
UInt32 v = GetUi32(p - 4);
v <<= 2;
v += ip + (UInt32)(p - data);
v >>= 2;
v &= 0x00FFFFFF;
v |= 0xEB000000;
SetUi32(p - 4, v);
}
}
for (;;)
{
for (;;)
{
if (p >= lim)
return (SizeT)(p - data);
p += 4;
if (p[-1] == 0xEB)
break;
}
{
UInt32 v = GetUi32(p - 4);
v <<= 2;
v -= ip + (UInt32)(p - data);
v >>= 2;
v &= 0x00FFFFFF;
v |= 0xEB000000;
SetUi32(p - 4, v);
}
}
}
SizeT ARMT_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
{
Byte *p;
const Byte *lim;
size &= ~(size_t)1;
p = data;
lim = data + size - 4;
if (encoding)
for (;;)
{
UInt32 b1;
for (;;)
{
UInt32 b3;
if (p > lim)
return (SizeT)(p - data);
b1 = p[1];
b3 = p[3];
p += 2;
b1 ^= 8;
if ((b3 & b1) >= 0xF8)
break;
}
{
UInt32 v =
((UInt32)b1 << 19)
+ (((UInt32)p[1] & 0x7) << 8)
+ (((UInt32)p[-2] << 11))
+ (p[0]);
p += 2;
{
UInt32 cur = (ip + (UInt32)(p - data)) >> 1;
v += cur;
}
p[-4] = (Byte)(v >> 11);
p[-3] = (Byte)(0xF0 | ((v >> 19) & 0x7));
p[-2] = (Byte)v;
p[-1] = (Byte)(0xF8 | (v >> 8));
}
}
for (;;)
{
UInt32 b1;
for (;;)
{
UInt32 b3;
if (p > lim)
return (SizeT)(p - data);
b1 = p[1];
b3 = p[3];
p += 2;
b1 ^= 8;
if ((b3 & b1) >= 0xF8)
break;
}
{
UInt32 v =
((UInt32)b1 << 19)
+ (((UInt32)p[1] & 0x7) << 8)
+ (((UInt32)p[-2] << 11))
+ (p[0]);
p += 2;
{
UInt32 cur = (ip + (UInt32)(p - data)) >> 1;
v -= cur;
}
/*
SetUi16(p - 4, (UInt16)(((v >> 11) & 0x7FF) | 0xF000));
SetUi16(p - 2, (UInt16)(v | 0xF800));
*/
p[-4] = (Byte)(v >> 11);
p[-3] = (Byte)(0xF0 | ((v >> 19) & 0x7));
p[-2] = (Byte)v;
p[-1] = (Byte)(0xF8 | (v >> 8));
}
}
}
SizeT PPC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
{
Byte *p;
const Byte *lim;
size &= ~(size_t)3;
ip -= 4;
p = data;
lim = data + size;
for (;;)
{
for (;;)
{
if (p >= lim)
return (SizeT)(p - data);
p += 4;
/* if ((v & 0xFC000003) == 0x48000001) */
if ((p[-4] & 0xFC) == 0x48 && (p[-1] & 3) == 1)
break;
}
{
UInt32 v = GetBe32(p - 4);
if (encoding)
v += ip + (UInt32)(p - data);
else
v -= ip + (UInt32)(p - data);
v &= 0x03FFFFFF;
v |= 0x48000000;
SetBe32(p - 4, v);
}
}
}
SizeT SPARC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
{
Byte *p;
const Byte *lim;
size &= ~(size_t)3;
ip -= 4;
p = data;
lim = data + size;
for (;;)
{
for (;;)
{
if (p >= lim)
return (SizeT)(p - data);
/*
v = GetBe32(p);
p += 4;
m = v + ((UInt32)5 << 29);
m ^= (UInt32)7 << 29;
m += (UInt32)1 << 22;
if ((m & ((UInt32)0x1FF << 23)) == 0)
break;
*/
p += 4;
if ((p[-4] == 0x40 && (p[-3] & 0xC0) == 0) ||
(p[-4] == 0x7F && (p[-3] >= 0xC0)))
break;
}
{
UInt32 v = GetBe32(p - 4);
v <<= 2;
if (encoding)
v += ip + (UInt32)(p - data);
else
v -= ip + (UInt32)(p - data);
v &= 0x01FFFFFF;
v -= (UInt32)1 << 24;
v ^= 0xFF000000;
v >>= 2;
v |= 0x40000000;
SetBe32(p - 4, v);
}
}
}

64
3rdparty/7z/src/Bra.h vendored
View file

@ -1,64 +0,0 @@
/* Bra.h -- Branch converters for executables
2013-01-18 : Igor Pavlov : Public domain */
#ifndef __BRA_H
#define __BRA_H
#include "7zTypes.h"
EXTERN_C_BEGIN
/*
These functions convert relative addresses to absolute addresses
in CALL instructions to increase the compression ratio.
In:
data - data buffer
size - size of data
ip - current virtual Instruction Pinter (IP) value
state - state variable for x86 converter
encoding - 0 (for decoding), 1 (for encoding)
Out:
state - state variable for x86 converter
Returns:
The number of processed bytes. If you call these functions with multiple calls,
you must start next call with first byte after block of processed bytes.
Type Endian Alignment LookAhead
x86 little 1 4
ARMT little 2 2
ARM little 4 0
PPC big 4 0
SPARC big 4 0
IA64 little 16 0
size must be >= Alignment + LookAhead, if it's not last block.
If (size < Alignment + LookAhead), converter returns 0.
Example:
UInt32 ip = 0;
for ()
{
; size must be >= Alignment + LookAhead, if it's not last block
SizeT processed = Convert(data, size, ip, 1);
data += processed;
size -= processed;
ip += processed;
}
*/
#define x86_Convert_Init(state) { state = 0; }
SizeT x86_Convert(Byte *data, SizeT size, UInt32 ip, UInt32 *state, int encoding);
SizeT ARM_Convert(Byte *data, SizeT size, UInt32 ip, int encoding);
SizeT ARMT_Convert(Byte *data, SizeT size, UInt32 ip, int encoding);
SizeT PPC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding);
SizeT SPARC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding);
SizeT IA64_Convert(Byte *data, SizeT size, UInt32 ip, int encoding);
EXTERN_C_END
#endif

View file

@ -1,82 +0,0 @@
/* Bra86.c -- Converter for x86 code (BCJ)
2021-02-09 : Igor Pavlov : Public domain */
#include "Precomp.h"
#include "Bra.h"
#define Test86MSByte(b) ((((b) + 1) & 0xFE) == 0)
SizeT x86_Convert(Byte *data, SizeT size, UInt32 ip, UInt32 *state, int encoding)
{
SizeT pos = 0;
UInt32 mask = *state & 7;
if (size < 5)
return 0;
size -= 4;
ip += 5;
for (;;)
{
Byte *p = data + pos;
const Byte *limit = data + size;
for (; p < limit; p++)
if ((*p & 0xFE) == 0xE8)
break;
{
SizeT d = (SizeT)(p - data) - pos;
pos = (SizeT)(p - data);
if (p >= limit)
{
*state = (d > 2 ? 0 : mask >> (unsigned)d);
return pos;
}
if (d > 2)
mask = 0;
else
{
mask >>= (unsigned)d;
if (mask != 0 && (mask > 4 || mask == 3 || Test86MSByte(p[(size_t)(mask >> 1) + 1])))
{
mask = (mask >> 1) | 4;
pos++;
continue;
}
}
}
if (Test86MSByte(p[4]))
{
UInt32 v = ((UInt32)p[4] << 24) | ((UInt32)p[3] << 16) | ((UInt32)p[2] << 8) | ((UInt32)p[1]);
UInt32 cur = ip + (UInt32)pos;
pos += 5;
if (encoding)
v += cur;
else
v -= cur;
if (mask != 0)
{
unsigned sh = (mask & 6) << 2;
if (Test86MSByte((Byte)(v >> sh)))
{
v ^= (((UInt32)0x100 << sh) - 1);
if (encoding)
v += cur;
else
v -= cur;
}
mask = 0;
}
p[1] = (Byte)v;
p[2] = (Byte)(v >> 8);
p[3] = (Byte)(v >> 16);
p[4] = (Byte)(0 - ((v >> 24) & 1));
}
else
{
mask = (mask >> 1) | 4;
pos++;
}
}
}

View file

@ -1,53 +0,0 @@
/* BraIA64.c -- Converter for IA-64 code
2017-01-26 : Igor Pavlov : Public domain */
#include "Precomp.h"
#include "CpuArch.h"
#include "Bra.h"
SizeT IA64_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
{
SizeT i;
if (size < 16)
return 0;
size -= 16;
i = 0;
do
{
unsigned m = ((UInt32)0x334B0000 >> (data[i] & 0x1E)) & 3;
if (m)
{
m++;
do
{
Byte *p = data + (i + (size_t)m * 5 - 8);
if (((p[3] >> m) & 15) == 5
&& (((p[-1] | ((UInt32)p[0] << 8)) >> m) & 0x70) == 0)
{
unsigned raw = GetUi32(p);
unsigned v = raw >> m;
v = (v & 0xFFFFF) | ((v & (1 << 23)) >> 3);
v <<= 4;
if (encoding)
v += ip + (UInt32)i;
else
v -= ip + (UInt32)i;
v >>= 4;
v &= 0x1FFFFF;
v += 0x700000;
v &= 0x8FFFFF;
raw &= ~((UInt32)0x8FFFFF << m);
raw |= (v << m);
SetUi32(p, raw);
}
}
while (++m <= 4);
}
i += 16;
}
while (i <= size);
return i;
}

View file

@ -1,43 +0,0 @@
/* Compiler.h
2021-01-05 : Igor Pavlov : Public domain */
#ifndef __7Z_COMPILER_H
#define __7Z_COMPILER_H
#ifdef __clang__
#pragma clang diagnostic ignored "-Wunused-private-field"
#endif
#ifdef _MSC_VER
#ifdef UNDER_CE
#define RPC_NO_WINDOWS_H
/* #pragma warning(disable : 4115) // '_RPC_ASYNC_STATE' : named type definition in parentheses */
#pragma warning(disable : 4201) // nonstandard extension used : nameless struct/union
#pragma warning(disable : 4214) // nonstandard extension used : bit field types other than int
#endif
#if _MSC_VER >= 1300
#pragma warning(disable : 4996) // This function or variable may be unsafe
#else
#pragma warning(disable : 4511) // copy constructor could not be generated
#pragma warning(disable : 4512) // assignment operator could not be generated
#pragma warning(disable : 4514) // unreferenced inline function has been removed
#pragma warning(disable : 4702) // unreachable code
#pragma warning(disable : 4710) // not inlined
#pragma warning(disable : 4714) // function marked as __forceinline not inlined
#pragma warning(disable : 4786) // identifier was truncated to '255' characters in the debug information
#endif
#ifdef __clang__
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#pragma clang diagnostic ignored "-Wmicrosoft-exception-spec"
// #pragma clang diagnostic ignored "-Wreserved-id-macro"
#endif
#endif
#define UNUSED_VAR(x) (void)x;
/* #define UNUSED_VAR(x) x=x; */
#endif

View file

@ -1,478 +0,0 @@
/* CpuArch.c -- CPU specific code
2021-07-13 : Igor Pavlov : Public domain */
#include "Precomp.h"
#include "CpuArch.h"
#ifdef MY_CPU_X86_OR_AMD64
#if (defined(_MSC_VER) && !defined(MY_CPU_AMD64)) || defined(__GNUC__)
#define USE_ASM
#endif
#if !defined(USE_ASM) && _MSC_VER >= 1500
#include <intrin.h>
#endif
#if defined(USE_ASM) && !defined(MY_CPU_AMD64)
static UInt32 CheckFlag(UInt32 flag)
{
#ifdef _MSC_VER
__asm pushfd;
__asm pop EAX;
__asm mov EDX, EAX;
__asm xor EAX, flag;
__asm push EAX;
__asm popfd;
__asm pushfd;
__asm pop EAX;
__asm xor EAX, EDX;
__asm push EDX;
__asm popfd;
__asm and flag, EAX;
#else
__asm__ __volatile__ (
"pushf\n\t"
"pop %%EAX\n\t"
"movl %%EAX,%%EDX\n\t"
"xorl %0,%%EAX\n\t"
"push %%EAX\n\t"
"popf\n\t"
"pushf\n\t"
"pop %%EAX\n\t"
"xorl %%EDX,%%EAX\n\t"
"push %%EDX\n\t"
"popf\n\t"
"andl %%EAX, %0\n\t":
"=c" (flag) : "c" (flag) :
"%eax", "%edx");
#endif
return flag;
}
#define CHECK_CPUID_IS_SUPPORTED if (CheckFlag(1 << 18) == 0 || CheckFlag(1 << 21) == 0) return False;
#else
#define CHECK_CPUID_IS_SUPPORTED
#endif
#ifndef USE_ASM
#ifdef _MSC_VER
#if _MSC_VER >= 1600
#define MY__cpuidex __cpuidex
#else
/*
__cpuid (function == 4) requires subfunction number in ECX.
MSDN: The __cpuid intrinsic clears the ECX register before calling the cpuid instruction.
__cpuid() in new MSVC clears ECX.
__cpuid() in old MSVC (14.00) doesn't clear ECX
We still can use __cpuid for low (function) values that don't require ECX,
but __cpuid() in old MSVC will be incorrect for some function values: (function == 4).
So here we use the hack for old MSVC to send (subFunction) in ECX register to cpuid instruction,
where ECX value is first parameter for FAST_CALL / NO_INLINE function,
So the caller of MY__cpuidex_HACK() sets ECX as subFunction, and
old MSVC for __cpuid() doesn't change ECX and cpuid instruction gets (subFunction) value.
DON'T remove MY_NO_INLINE and MY_FAST_CALL for MY__cpuidex_HACK() !!!
*/
static
MY_NO_INLINE
void MY_FAST_CALL MY__cpuidex_HACK(UInt32 subFunction, int *CPUInfo, UInt32 function)
{
UNUSED_VAR(subFunction);
__cpuid(CPUInfo, function);
}
#define MY__cpuidex(info, func, func2) MY__cpuidex_HACK(func2, info, func)
#pragma message("======== MY__cpuidex_HACK WAS USED ========")
#endif
#else
#define MY__cpuidex(info, func, func2) __cpuid(info, func)
#pragma message("======== (INCORRECT ?) cpuid WAS USED ========")
#endif
#endif
void MyCPUID(UInt32 function, UInt32 *a, UInt32 *b, UInt32 *c, UInt32 *d)
{
#ifdef USE_ASM
#ifdef _MSC_VER
UInt32 a2, b2, c2, d2;
__asm xor EBX, EBX;
__asm xor ECX, ECX;
__asm xor EDX, EDX;
__asm mov EAX, function;
__asm cpuid;
__asm mov a2, EAX;
__asm mov b2, EBX;
__asm mov c2, ECX;
__asm mov d2, EDX;
*a = a2;
*b = b2;
*c = c2;
*d = d2;
#else
__asm__ __volatile__ (
#if defined(MY_CPU_AMD64) && defined(__PIC__)
"mov %%rbx, %%rdi;"
"cpuid;"
"xchg %%rbx, %%rdi;"
: "=a" (*a) ,
"=D" (*b) ,
#elif defined(MY_CPU_X86) && defined(__PIC__)
"mov %%ebx, %%edi;"
"cpuid;"
"xchgl %%ebx, %%edi;"
: "=a" (*a) ,
"=D" (*b) ,
#else
"cpuid"
: "=a" (*a) ,
"=b" (*b) ,
#endif
"=c" (*c) ,
"=d" (*d)
: "0" (function), "c"(0) ) ;
#endif
#else
int CPUInfo[4];
MY__cpuidex(CPUInfo, (int)function, 0);
*a = (UInt32)CPUInfo[0];
*b = (UInt32)CPUInfo[1];
*c = (UInt32)CPUInfo[2];
*d = (UInt32)CPUInfo[3];
#endif
}
BoolInt x86cpuid_CheckAndRead(Cx86cpuid *p)
{
CHECK_CPUID_IS_SUPPORTED
MyCPUID(0, &p->maxFunc, &p->vendor[0], &p->vendor[2], &p->vendor[1]);
MyCPUID(1, &p->ver, &p->b, &p->c, &p->d);
return True;
}
static const UInt32 kVendors[][3] =
{
{ 0x756E6547, 0x49656E69, 0x6C65746E},
{ 0x68747541, 0x69746E65, 0x444D4163},
{ 0x746E6543, 0x48727561, 0x736C7561}
};
int x86cpuid_GetFirm(const Cx86cpuid *p)
{
unsigned i;
for (i = 0; i < sizeof(kVendors) / sizeof(kVendors[i]); i++)
{
const UInt32 *v = kVendors[i];
if (v[0] == p->vendor[0] &&
v[1] == p->vendor[1] &&
v[2] == p->vendor[2])
return (int)i;
}
return -1;
}
BoolInt CPU_Is_InOrder()
{
Cx86cpuid p;
int firm;
UInt32 family, model;
if (!x86cpuid_CheckAndRead(&p))
return True;
family = x86cpuid_GetFamily(p.ver);
model = x86cpuid_GetModel(p.ver);
firm = x86cpuid_GetFirm(&p);
switch (firm)
{
case CPU_FIRM_INTEL: return (family < 6 || (family == 6 && (
/* In-Order Atom CPU */
model == 0x1C /* 45 nm, N4xx, D4xx, N5xx, D5xx, 230, 330 */
|| model == 0x26 /* 45 nm, Z6xx */
|| model == 0x27 /* 32 nm, Z2460 */
|| model == 0x35 /* 32 nm, Z2760 */
|| model == 0x36 /* 32 nm, N2xxx, D2xxx */
)));
case CPU_FIRM_AMD: return (family < 5 || (family == 5 && (model < 6 || model == 0xA)));
case CPU_FIRM_VIA: return (family < 6 || (family == 6 && model < 0xF));
}
return True;
}
#if !defined(MY_CPU_AMD64) && defined(_WIN32)
#include <Windows.h>
static BoolInt CPU_Sys_Is_SSE_Supported()
{
OSVERSIONINFO vi;
vi.dwOSVersionInfoSize = sizeof(vi);
if (!GetVersionEx(&vi))
return False;
return (vi.dwMajorVersion >= 5);
}
#define CHECK_SYS_SSE_SUPPORT if (!CPU_Sys_Is_SSE_Supported()) return False;
#else
#define CHECK_SYS_SSE_SUPPORT
#endif
static UInt32 X86_CPUID_ECX_Get_Flags()
{
Cx86cpuid p;
CHECK_SYS_SSE_SUPPORT
if (!x86cpuid_CheckAndRead(&p))
return 0;
return p.c;
}
BoolInt CPU_IsSupported_AES()
{
return (X86_CPUID_ECX_Get_Flags() >> 25) & 1;
}
BoolInt CPU_IsSupported_SSSE3()
{
return (X86_CPUID_ECX_Get_Flags() >> 9) & 1;
}
BoolInt CPU_IsSupported_SSE41()
{
return (X86_CPUID_ECX_Get_Flags() >> 19) & 1;
}
BoolInt CPU_IsSupported_SHA()
{
Cx86cpuid p;
CHECK_SYS_SSE_SUPPORT
if (!x86cpuid_CheckAndRead(&p))
return False;
if (p.maxFunc < 7)
return False;
{
UInt32 d[4] = { 0 };
MyCPUID(7, &d[0], &d[1], &d[2], &d[3]);
return (d[1] >> 29) & 1;
}
}
// #include <stdio.h>
#ifdef _WIN32
#include <Windows.h>
#endif
BoolInt CPU_IsSupported_AVX2()
{
Cx86cpuid p;
CHECK_SYS_SSE_SUPPORT
#ifdef _WIN32
#define MY__PF_XSAVE_ENABLED 17
if (!IsProcessorFeaturePresent(MY__PF_XSAVE_ENABLED))
return False;
#endif
if (!x86cpuid_CheckAndRead(&p))
return False;
if (p.maxFunc < 7)
return False;
{
UInt32 d[4] = { 0 };
MyCPUID(7, &d[0], &d[1], &d[2], &d[3]);
// printf("\ncpuid(7): ebx=%8x ecx=%8x\n", d[1], d[2]);
return 1
& (d[1] >> 5); // avx2
}
}
BoolInt CPU_IsSupported_VAES_AVX2()
{
Cx86cpuid p;
CHECK_SYS_SSE_SUPPORT
#ifdef _WIN32
#define MY__PF_XSAVE_ENABLED 17
if (!IsProcessorFeaturePresent(MY__PF_XSAVE_ENABLED))
return False;
#endif
if (!x86cpuid_CheckAndRead(&p))
return False;
if (p.maxFunc < 7)
return False;
{
UInt32 d[4] = { 0 };
MyCPUID(7, &d[0], &d[1], &d[2], &d[3]);
// printf("\ncpuid(7): ebx=%8x ecx=%8x\n", d[1], d[2]);
return 1
& (d[1] >> 5) // avx2
// & (d[1] >> 31) // avx512vl
& (d[2] >> 9); // vaes // VEX-256/EVEX
}
}
BoolInt CPU_IsSupported_PageGB()
{
Cx86cpuid cpuid;
if (!x86cpuid_CheckAndRead(&cpuid))
return False;
{
UInt32 d[4] = { 0 };
MyCPUID(0x80000000, &d[0], &d[1], &d[2], &d[3]);
if (d[0] < 0x80000001)
return False;
}
{
UInt32 d[4] = { 0 };
MyCPUID(0x80000001, &d[0], &d[1], &d[2], &d[3]);
return (d[3] >> 26) & 1;
}
}
#elif defined(MY_CPU_ARM_OR_ARM64)
#ifdef _WIN32
#include <Windows.h>
BoolInt CPU_IsSupported_CRC32() { return IsProcessorFeaturePresent(PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE) ? 1 : 0; }
BoolInt CPU_IsSupported_CRYPTO() { return IsProcessorFeaturePresent(PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE) ? 1 : 0; }
BoolInt CPU_IsSupported_NEON() { return IsProcessorFeaturePresent(PF_ARM_NEON_INSTRUCTIONS_AVAILABLE) ? 1 : 0; }
#else
#if defined(__APPLE__)
/*
#include <stdio.h>
#include <string.h>
static void Print_sysctlbyname(const char *name)
{
size_t bufSize = 256;
char buf[256];
int res = sysctlbyname(name, &buf, &bufSize, NULL, 0);
{
int i;
printf("\nres = %d : %s : '%s' : bufSize = %d, numeric", res, name, buf, (unsigned)bufSize);
for (i = 0; i < 20; i++)
printf(" %2x", (unsigned)(Byte)buf[i]);
}
}
*/
static BoolInt My_sysctlbyname_Get_BoolInt(const char *name)
{
UInt32 val = 0;
if (My_sysctlbyname_Get_UInt32(name, &val) == 0 && val == 1)
return 1;
return 0;
}
/*
Print_sysctlbyname("hw.pagesize");
Print_sysctlbyname("machdep.cpu.brand_string");
*/
BoolInt CPU_IsSupported_CRC32(void)
{
return My_sysctlbyname_Get_BoolInt("hw.optional.armv8_crc32");
}
BoolInt CPU_IsSupported_NEON(void)
{
return My_sysctlbyname_Get_BoolInt("hw.optional.neon");
}
#ifdef MY_CPU_ARM64
#define APPLE_CRYPTO_SUPPORT_VAL 1
#else
#define APPLE_CRYPTO_SUPPORT_VAL 0
#endif
BoolInt CPU_IsSupported_SHA1(void) { return APPLE_CRYPTO_SUPPORT_VAL; }
BoolInt CPU_IsSupported_SHA2(void) { return APPLE_CRYPTO_SUPPORT_VAL; }
BoolInt CPU_IsSupported_AES (void) { return APPLE_CRYPTO_SUPPORT_VAL; }
#else // __APPLE__
#include <sys/auxv.h>
#define USE_HWCAP
#ifdef USE_HWCAP
#include <asm/hwcap.h>
#define MY_HWCAP_CHECK_FUNC_2(name1, name2) \
BoolInt CPU_IsSupported_ ## name1() { return (getauxval(AT_HWCAP) & (HWCAP_ ## name2)) ? 1 : 0; }
#ifdef MY_CPU_ARM64
#define MY_HWCAP_CHECK_FUNC(name) \
MY_HWCAP_CHECK_FUNC_2(name, name)
MY_HWCAP_CHECK_FUNC_2(NEON, ASIMD)
// MY_HWCAP_CHECK_FUNC (ASIMD)
#elif defined(MY_CPU_ARM)
#define MY_HWCAP_CHECK_FUNC(name) \
BoolInt CPU_IsSupported_ ## name() { return (getauxval(AT_HWCAP2) & (HWCAP2_ ## name)) ? 1 : 0; }
MY_HWCAP_CHECK_FUNC_2(NEON, NEON)
#endif
#else // USE_HWCAP
#define MY_HWCAP_CHECK_FUNC(name) \
BoolInt CPU_IsSupported_ ## name() { return 0; }
MY_HWCAP_CHECK_FUNC(NEON)
#endif // USE_HWCAP
MY_HWCAP_CHECK_FUNC (CRC32)
MY_HWCAP_CHECK_FUNC (SHA1)
MY_HWCAP_CHECK_FUNC (SHA2)
MY_HWCAP_CHECK_FUNC (AES)
#endif // __APPLE__
#endif // _WIN32
#endif // MY_CPU_ARM_OR_ARM64
#ifdef __APPLE__
#include <sys/sysctl.h>
int My_sysctlbyname_Get(const char *name, void *buf, size_t *bufSize)
{
return sysctlbyname(name, buf, bufSize, NULL, 0);
}
int My_sysctlbyname_Get_UInt32(const char *name, UInt32 *val)
{
size_t bufSize = sizeof(*val);
int res = My_sysctlbyname_Get(name, val, &bufSize);
if (res == 0 && bufSize != sizeof(*val))
return EFAULT;
return res;
}
#endif

View file

@ -1,445 +0,0 @@
/* CpuArch.h -- CPU specific code
2022-07-15 : Igor Pavlov : Public domain */
#ifndef __CPU_ARCH_H
#define __CPU_ARCH_H
#include "7zTypes.h"
EXTERN_C_BEGIN
/*
MY_CPU_LE means that CPU is LITTLE ENDIAN.
MY_CPU_BE means that CPU is BIG ENDIAN.
If MY_CPU_LE and MY_CPU_BE are not defined, we don't know about ENDIANNESS of platform.
MY_CPU_LE_UNALIGN means that CPU is LITTLE ENDIAN and CPU supports unaligned memory accesses.
MY_CPU_64BIT means that processor can work with 64-bit registers.
MY_CPU_64BIT can be used to select fast code branch
MY_CPU_64BIT doesn't mean that (sizeof(void *) == 8)
*/
#if defined(_M_X64) \
|| defined(_M_AMD64) \
|| defined(__x86_64__) \
|| defined(__AMD64__) \
|| defined(__amd64__)
#define MY_CPU_AMD64
#ifdef __ILP32__
#define MY_CPU_NAME "x32"
#define MY_CPU_SIZEOF_POINTER 4
#else
#define MY_CPU_NAME "x64"
#define MY_CPU_SIZEOF_POINTER 8
#endif
#define MY_CPU_64BIT
#endif
#if defined(_M_IX86) \
|| defined(__i386__)
#define MY_CPU_X86
#define MY_CPU_NAME "x86"
/* #define MY_CPU_32BIT */
#define MY_CPU_SIZEOF_POINTER 4
#endif
#if defined(_M_ARM64) \
|| defined(__AARCH64EL__) \
|| defined(__AARCH64EB__) \
|| defined(__aarch64__)
#define MY_CPU_ARM64
#define MY_CPU_NAME "arm64"
#define MY_CPU_64BIT
#endif
#if defined(_M_ARM) \
|| defined(_M_ARM_NT) \
|| defined(_M_ARMT) \
|| defined(__arm__) \
|| defined(__thumb__) \
|| defined(__ARMEL__) \
|| defined(__ARMEB__) \
|| defined(__THUMBEL__) \
|| defined(__THUMBEB__)
#define MY_CPU_ARM
#if defined(__thumb__) || defined(__THUMBEL__) || defined(_M_ARMT)
#define MY_CPU_NAME "armt"
#else
#define MY_CPU_NAME "arm"
#endif
/* #define MY_CPU_32BIT */
#define MY_CPU_SIZEOF_POINTER 4
#endif
#if defined(_M_IA64) \
|| defined(__ia64__)
#define MY_CPU_IA64
#define MY_CPU_NAME "ia64"
#define MY_CPU_64BIT
#endif
#if defined(__mips64) \
|| defined(__mips64__) \
|| (defined(__mips) && (__mips == 64 || __mips == 4 || __mips == 3))
#define MY_CPU_NAME "mips64"
#define MY_CPU_64BIT
#elif defined(__mips__)
#define MY_CPU_NAME "mips"
/* #define MY_CPU_32BIT */
#endif
#if defined(__ppc64__) \
|| defined(__powerpc64__) \
|| defined(__ppc__) \
|| defined(__powerpc__) \
|| defined(__PPC__) \
|| defined(_POWER)
#if defined(__ppc64__) \
|| defined(__powerpc64__) \
|| defined(_LP64) \
|| defined(__64BIT__)
#ifdef __ILP32__
#define MY_CPU_NAME "ppc64-32"
#define MY_CPU_SIZEOF_POINTER 4
#else
#define MY_CPU_NAME "ppc64"
#define MY_CPU_SIZEOF_POINTER 8
#endif
#define MY_CPU_64BIT
#else
#define MY_CPU_NAME "ppc"
#define MY_CPU_SIZEOF_POINTER 4
/* #define MY_CPU_32BIT */
#endif
#endif
#if defined(__riscv) \
|| defined(__riscv__)
#if __riscv_xlen == 32
#define MY_CPU_NAME "riscv32"
#elif __riscv_xlen == 64
#define MY_CPU_NAME "riscv64"
#else
#define MY_CPU_NAME "riscv"
#endif
#endif
#if defined(MY_CPU_X86) || defined(MY_CPU_AMD64)
#define MY_CPU_X86_OR_AMD64
#endif
#if defined(MY_CPU_ARM) || defined(MY_CPU_ARM64)
#define MY_CPU_ARM_OR_ARM64
#endif
#ifdef _WIN32
#ifdef MY_CPU_ARM
#define MY_CPU_ARM_LE
#endif
#ifdef MY_CPU_ARM64
#define MY_CPU_ARM64_LE
#endif
#ifdef _M_IA64
#define MY_CPU_IA64_LE
#endif
#endif
#if defined(MY_CPU_X86_OR_AMD64) \
|| defined(MY_CPU_ARM_LE) \
|| defined(MY_CPU_ARM64_LE) \
|| defined(MY_CPU_IA64_LE) \
|| defined(__LITTLE_ENDIAN__) \
|| defined(__ARMEL__) \
|| defined(__THUMBEL__) \
|| defined(__AARCH64EL__) \
|| defined(__MIPSEL__) \
|| defined(__MIPSEL) \
|| defined(_MIPSEL) \
|| defined(__BFIN__) \
|| (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__))
#define MY_CPU_LE
#endif
#if defined(__BIG_ENDIAN__) \
|| defined(__ARMEB__) \
|| defined(__THUMBEB__) \
|| defined(__AARCH64EB__) \
|| defined(__MIPSEB__) \
|| defined(__MIPSEB) \
|| defined(_MIPSEB) \
|| defined(__m68k__) \
|| defined(__s390__) \
|| defined(__s390x__) \
|| defined(__zarch__) \
|| (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__))
#define MY_CPU_BE
#endif
#if defined(MY_CPU_LE) && defined(MY_CPU_BE)
#error Stop_Compiling_Bad_Endian
#endif
#if defined(MY_CPU_32BIT) && defined(MY_CPU_64BIT)
#error Stop_Compiling_Bad_32_64_BIT
#endif
#ifdef __SIZEOF_POINTER__
#ifdef MY_CPU_SIZEOF_POINTER
#if MY_CPU_SIZEOF_POINTER != __SIZEOF_POINTER__
#error Stop_Compiling_Bad_MY_CPU_PTR_SIZE
#endif
#else
#define MY_CPU_SIZEOF_POINTER __SIZEOF_POINTER__
#endif
#endif
#if defined(MY_CPU_SIZEOF_POINTER) && (MY_CPU_SIZEOF_POINTER == 4)
#if defined (_LP64)
#error Stop_Compiling_Bad_MY_CPU_PTR_SIZE
#endif
#endif
#ifdef _MSC_VER
#if _MSC_VER >= 1300
#define MY_CPU_pragma_pack_push_1 __pragma(pack(push, 1))
#define MY_CPU_pragma_pop __pragma(pack(pop))
#else
#define MY_CPU_pragma_pack_push_1
#define MY_CPU_pragma_pop
#endif
#else
#ifdef __xlC__
#define MY_CPU_pragma_pack_push_1 _Pragma("pack(1)")
#define MY_CPU_pragma_pop _Pragma("pack()")
#else
#define MY_CPU_pragma_pack_push_1 _Pragma("pack(push, 1)")
#define MY_CPU_pragma_pop _Pragma("pack(pop)")
#endif
#endif
#ifndef MY_CPU_NAME
#ifdef MY_CPU_LE
#define MY_CPU_NAME "LE"
#elif defined(MY_CPU_BE)
#define MY_CPU_NAME "BE"
#else
/*
#define MY_CPU_NAME ""
*/
#endif
#endif
#ifdef MY_CPU_LE
#if defined(MY_CPU_X86_OR_AMD64) \
|| defined(MY_CPU_ARM64)
#define MY_CPU_LE_UNALIGN
#define MY_CPU_LE_UNALIGN_64
#elif defined(__ARM_FEATURE_UNALIGNED)
/* gcc9 for 32-bit arm can use LDRD instruction that requires 32-bit alignment.
So we can't use unaligned 64-bit operations. */
#define MY_CPU_LE_UNALIGN
#endif
#endif
#ifdef MY_CPU_LE_UNALIGN
#define GetUi16(p) (*(const UInt16 *)(const void *)(p))
#define GetUi32(p) (*(const UInt32 *)(const void *)(p))
#ifdef MY_CPU_LE_UNALIGN_64
#define GetUi64(p) (*(const UInt64 *)(const void *)(p))
#endif
#define SetUi16(p, v) { *(UInt16 *)(void *)(p) = (v); }
#define SetUi32(p, v) { *(UInt32 *)(void *)(p) = (v); }
#ifdef MY_CPU_LE_UNALIGN_64
#define SetUi64(p, v) { *(UInt64 *)(void *)(p) = (v); }
#endif
#else
#define GetUi16(p) ( (UInt16) ( \
((const Byte *)(p))[0] | \
((UInt16)((const Byte *)(p))[1] << 8) ))
#define GetUi32(p) ( \
((const Byte *)(p))[0] | \
((UInt32)((const Byte *)(p))[1] << 8) | \
((UInt32)((const Byte *)(p))[2] << 16) | \
((UInt32)((const Byte *)(p))[3] << 24))
#define SetUi16(p, v) { Byte *_ppp_ = (Byte *)(p); UInt32 _vvv_ = (v); \
_ppp_[0] = (Byte)_vvv_; \
_ppp_[1] = (Byte)(_vvv_ >> 8); }
#define SetUi32(p, v) { Byte *_ppp_ = (Byte *)(p); UInt32 _vvv_ = (v); \
_ppp_[0] = (Byte)_vvv_; \
_ppp_[1] = (Byte)(_vvv_ >> 8); \
_ppp_[2] = (Byte)(_vvv_ >> 16); \
_ppp_[3] = (Byte)(_vvv_ >> 24); }
#endif
#ifndef MY_CPU_LE_UNALIGN_64
#define GetUi64(p) (GetUi32(p) | ((UInt64)GetUi32(((const Byte *)(p)) + 4) << 32))
#define SetUi64(p, v) { Byte *_ppp2_ = (Byte *)(p); UInt64 _vvv2_ = (v); \
SetUi32(_ppp2_ , (UInt32)_vvv2_); \
SetUi32(_ppp2_ + 4, (UInt32)(_vvv2_ >> 32)); }
#endif
#ifdef __has_builtin
#define MY__has_builtin(x) __has_builtin(x)
#else
#define MY__has_builtin(x) 0
#endif
#if defined(MY_CPU_LE_UNALIGN) && /* defined(_WIN64) && */ defined(_MSC_VER) && (_MSC_VER >= 1300)
/* Note: we use bswap instruction, that is unsupported in 386 cpu */
#include <stdlib.h>
#pragma intrinsic(_byteswap_ushort)
#pragma intrinsic(_byteswap_ulong)
#pragma intrinsic(_byteswap_uint64)
/* #define GetBe16(p) _byteswap_ushort(*(const UInt16 *)(const Byte *)(p)) */
#define GetBe32(p) _byteswap_ulong (*(const UInt32 *)(const void *)(p))
#define GetBe64(p) _byteswap_uint64(*(const UInt64 *)(const void *)(p))
#define SetBe32(p, v) (*(UInt32 *)(void *)(p)) = _byteswap_ulong(v)
#elif defined(MY_CPU_LE_UNALIGN) && ( \
(defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))) \
|| (defined(__clang__) && MY__has_builtin(__builtin_bswap16)) )
/* #define GetBe16(p) __builtin_bswap16(*(const UInt16 *)(const void *)(p)) */
#define GetBe32(p) __builtin_bswap32(*(const UInt32 *)(const void *)(p))
#define GetBe64(p) __builtin_bswap64(*(const UInt64 *)(const void *)(p))
#define SetBe32(p, v) (*(UInt32 *)(void *)(p)) = __builtin_bswap32(v)
#else
#define GetBe32(p) ( \
((UInt32)((const Byte *)(p))[0] << 24) | \
((UInt32)((const Byte *)(p))[1] << 16) | \
((UInt32)((const Byte *)(p))[2] << 8) | \
((const Byte *)(p))[3] )
#define GetBe64(p) (((UInt64)GetBe32(p) << 32) | GetBe32(((const Byte *)(p)) + 4))
#define SetBe32(p, v) { Byte *_ppp_ = (Byte *)(p); UInt32 _vvv_ = (v); \
_ppp_[0] = (Byte)(_vvv_ >> 24); \
_ppp_[1] = (Byte)(_vvv_ >> 16); \
_ppp_[2] = (Byte)(_vvv_ >> 8); \
_ppp_[3] = (Byte)_vvv_; }
#endif
#ifndef GetBe16
#define GetBe16(p) ( (UInt16) ( \
((UInt16)((const Byte *)(p))[0] << 8) | \
((const Byte *)(p))[1] ))
#endif
#ifdef MY_CPU_X86_OR_AMD64
typedef struct
{
UInt32 maxFunc;
UInt32 vendor[3];
UInt32 ver;
UInt32 b;
UInt32 c;
UInt32 d;
} Cx86cpuid;
enum
{
CPU_FIRM_INTEL,
CPU_FIRM_AMD,
CPU_FIRM_VIA
};
void MyCPUID(UInt32 function, UInt32 *a, UInt32 *b, UInt32 *c, UInt32 *d);
BoolInt x86cpuid_CheckAndRead(Cx86cpuid *p);
int x86cpuid_GetFirm(const Cx86cpuid *p);
#define x86cpuid_GetFamily(ver) (((ver >> 16) & 0xFF0) | ((ver >> 8) & 0xF))
#define x86cpuid_GetModel(ver) (((ver >> 12) & 0xF0) | ((ver >> 4) & 0xF))
#define x86cpuid_GetStepping(ver) (ver & 0xF)
BoolInt CPU_Is_InOrder(void);
BoolInt CPU_IsSupported_AES(void);
BoolInt CPU_IsSupported_AVX2(void);
BoolInt CPU_IsSupported_VAES_AVX2(void);
BoolInt CPU_IsSupported_SSSE3(void);
BoolInt CPU_IsSupported_SSE41(void);
BoolInt CPU_IsSupported_SHA(void);
BoolInt CPU_IsSupported_PageGB(void);
#elif defined(MY_CPU_ARM_OR_ARM64)
BoolInt CPU_IsSupported_CRC32(void);
BoolInt CPU_IsSupported_NEON(void);
#if defined(_WIN32)
BoolInt CPU_IsSupported_CRYPTO(void);
#define CPU_IsSupported_SHA1 CPU_IsSupported_CRYPTO
#define CPU_IsSupported_SHA2 CPU_IsSupported_CRYPTO
#define CPU_IsSupported_AES CPU_IsSupported_CRYPTO
#else
BoolInt CPU_IsSupported_SHA1(void);
BoolInt CPU_IsSupported_SHA2(void);
BoolInt CPU_IsSupported_AES(void);
#endif
#endif
#if defined(__APPLE__)
int My_sysctlbyname_Get(const char *name, void *buf, size_t *bufSize);
int My_sysctlbyname_Get_UInt32(const char *name, UInt32 *val);
#endif
EXTERN_C_END
#endif

View file

@ -1,169 +0,0 @@
/* Delta.c -- Delta converter
2021-02-09 : Igor Pavlov : Public domain */
#include "Precomp.h"
#include "Delta.h"
void Delta_Init(Byte *state)
{
unsigned i;
for (i = 0; i < DELTA_STATE_SIZE; i++)
state[i] = 0;
}
void Delta_Encode(Byte *state, unsigned delta, Byte *data, SizeT size)
{
Byte temp[DELTA_STATE_SIZE];
if (size == 0)
return;
{
unsigned i = 0;
do
temp[i] = state[i];
while (++i != delta);
}
if (size <= delta)
{
unsigned i = 0, k;
do
{
Byte b = *data;
*data++ = (Byte)(b - temp[i]);
temp[i] = b;
}
while (++i != size);
k = 0;
do
{
if (i == delta)
i = 0;
state[k] = temp[i++];
}
while (++k != delta);
return;
}
{
Byte *p = data + size - delta;
{
unsigned i = 0;
do
state[i] = *p++;
while (++i != delta);
}
{
const Byte *lim = data + delta;
ptrdiff_t dif = -(ptrdiff_t)delta;
if (((ptrdiff_t)size + dif) & 1)
{
--p; *p = (Byte)(*p - p[dif]);
}
while (p != lim)
{
--p; *p = (Byte)(*p - p[dif]);
--p; *p = (Byte)(*p - p[dif]);
}
dif = -dif;
do
{
--p; *p = (Byte)(*p - temp[--dif]);
}
while (dif != 0);
}
}
}
void Delta_Decode(Byte *state, unsigned delta, Byte *data, SizeT size)
{
unsigned i;
const Byte *lim;
if (size == 0)
return;
i = 0;
lim = data + size;
if (size <= delta)
{
do
*data = (Byte)(*data + state[i++]);
while (++data != lim);
for (; delta != i; state++, delta--)
*state = state[i];
data -= i;
}
else
{
/*
#define B(n) b ## n
#define I(n) Byte B(n) = state[n];
#define U(n) { B(n) = (Byte)((B(n)) + *data++); data[-1] = (B(n)); }
#define F(n) if (data != lim) { U(n) }
if (delta == 1)
{
I(0)
if ((lim - data) & 1) { U(0) }
while (data != lim) { U(0) U(0) }
data -= 1;
}
else if (delta == 2)
{
I(0) I(1)
lim -= 1; while (data < lim) { U(0) U(1) }
lim += 1; F(0)
data -= 2;
}
else if (delta == 3)
{
I(0) I(1) I(2)
lim -= 2; while (data < lim) { U(0) U(1) U(2) }
lim += 2; F(0) F(1)
data -= 3;
}
else if (delta == 4)
{
I(0) I(1) I(2) I(3)
lim -= 3; while (data < lim) { U(0) U(1) U(2) U(3) }
lim += 3; F(0) F(1) F(2)
data -= 4;
}
else
*/
{
do
{
*data = (Byte)(*data + state[i++]);
data++;
}
while (i != delta);
{
ptrdiff_t dif = -(ptrdiff_t)delta;
do
*data = (Byte)(*data + data[dif]);
while (++data != lim);
data += dif;
}
}
}
do
*state++ = *data;
while (++data != lim);
}

View file

@ -1,19 +0,0 @@
/* Delta.h -- Delta converter
2013-01-18 : Igor Pavlov : Public domain */
#ifndef __DELTA_H
#define __DELTA_H
#include "7zTypes.h"
EXTERN_C_BEGIN
#define DELTA_STATE_SIZE 256
void Delta_Init(Byte *state);
void Delta_Encode(Byte *state, unsigned delta, Byte *data, SizeT size);
void Delta_Decode(Byte *state, unsigned delta, Byte *data, SizeT size);
EXTERN_C_END
#endif

View file

@ -1,114 +0,0 @@
/* DllSecur.c -- DLL loading security
2022-07-15 : Igor Pavlov : Public domain */
#include "Precomp.h"
#ifdef _WIN32
#include <Windows.h>
#include "DllSecur.h"
#ifndef UNDER_CE
#if defined(__GNUC__) && (__GNUC__ >= 8)
#pragma GCC diagnostic ignored "-Wcast-function-type"
#endif
typedef BOOL (WINAPI *Func_SetDefaultDllDirectories)(DWORD DirectoryFlags);
#define MY_LOAD_LIBRARY_SEARCH_USER_DIRS 0x400
#define MY_LOAD_LIBRARY_SEARCH_SYSTEM32 0x800
static const char * const g_Dlls =
#ifndef _CONSOLE
"UXTHEME\0"
#endif
"USERENV\0"
"SETUPAPI\0"
"APPHELP\0"
"PROPSYS\0"
"DWMAPI\0"
"CRYPTBASE\0"
"OLEACC\0"
"CLBCATQ\0"
"VERSION\0"
;
#endif
// #define MY_CAST_FUNC (void(*)())
#define MY_CAST_FUNC
void My_SetDefaultDllDirectories()
{
#ifndef UNDER_CE
OSVERSIONINFO vi;
vi.dwOSVersionInfoSize = sizeof(vi);
if (!GetVersionEx(&vi) || vi.dwMajorVersion != 6 || vi.dwMinorVersion != 0)
{
Func_SetDefaultDllDirectories setDllDirs = (Func_SetDefaultDllDirectories)
MY_CAST_FUNC GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "SetDefaultDllDirectories");
if (setDllDirs)
if (setDllDirs(MY_LOAD_LIBRARY_SEARCH_SYSTEM32 | MY_LOAD_LIBRARY_SEARCH_USER_DIRS))
return;
}
#endif
}
void LoadSecurityDlls()
{
#ifndef UNDER_CE
wchar_t buf[MAX_PATH + 100];
{
// at Vista (ver 6.0) : CoCreateInstance(CLSID_ShellLink, ...) doesn't work after SetDefaultDllDirectories() : Check it ???
OSVERSIONINFO vi;
vi.dwOSVersionInfoSize = sizeof(vi);
if (!GetVersionEx(&vi) || vi.dwMajorVersion != 6 || vi.dwMinorVersion != 0)
{
Func_SetDefaultDllDirectories setDllDirs = (Func_SetDefaultDllDirectories)
MY_CAST_FUNC GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "SetDefaultDllDirectories");
if (setDllDirs)
if (setDllDirs(MY_LOAD_LIBRARY_SEARCH_SYSTEM32 | MY_LOAD_LIBRARY_SEARCH_USER_DIRS))
return;
}
}
{
unsigned len = GetSystemDirectoryW(buf, MAX_PATH + 2);
if (len == 0 || len > MAX_PATH)
return;
}
{
const char *dll;
unsigned pos = (unsigned)lstrlenW(buf);
if (buf[pos - 1] != '\\')
buf[pos++] = '\\';
for (dll = g_Dlls; dll[0] != 0;)
{
unsigned k = 0;
for (;;)
{
char c = *dll++;
buf[pos + k] = (Byte)c;
k++;
if (c == 0)
break;
}
lstrcatW(buf, L".dll");
LoadLibraryExW(buf, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
}
}
#endif
}
#endif

View file

@ -1,20 +0,0 @@
/* DllSecur.h -- DLL loading for security
2018-02-19 : Igor Pavlov : Public domain */
#ifndef __DLL_SECUR_H
#define __DLL_SECUR_H
#include "7zTypes.h"
EXTERN_C_BEGIN
#ifdef _WIN32
void My_SetDefaultDllDirectories(void);
void LoadSecurityDlls(void);
#endif
EXTERN_C_END
#endif

1628
3rdparty/7z/src/LzFind.c vendored

File diff suppressed because it is too large Load diff

View file

@ -1,136 +0,0 @@
/* LzFind.h -- Match finder for LZ algorithms
2021-07-13 : Igor Pavlov : Public domain */
#ifndef __LZ_FIND_H
#define __LZ_FIND_H
#include "7zTypes.h"
EXTERN_C_BEGIN
typedef UInt32 CLzRef;
typedef struct _CMatchFinder
{
Byte *buffer;
UInt32 pos;
UInt32 posLimit;
UInt32 streamPos; /* wrap over Zero is allowed (streamPos < pos). Use (UInt32)(streamPos - pos) */
UInt32 lenLimit;
UInt32 cyclicBufferPos;
UInt32 cyclicBufferSize; /* it must be = (historySize + 1) */
Byte streamEndWasReached;
Byte btMode;
Byte bigHash;
Byte directInput;
UInt32 matchMaxLen;
CLzRef *hash;
CLzRef *son;
UInt32 hashMask;
UInt32 cutValue;
Byte *bufferBase;
ISeqInStream *stream;
UInt32 blockSize;
UInt32 keepSizeBefore;
UInt32 keepSizeAfter;
UInt32 numHashBytes;
size_t directInputRem;
UInt32 historySize;
UInt32 fixedHashSize;
UInt32 hashSizeSum;
SRes result;
UInt32 crc[256];
size_t numRefs;
UInt64 expectedDataSize;
} CMatchFinder;
#define Inline_MatchFinder_GetPointerToCurrentPos(p) ((const Byte *)(p)->buffer)
#define Inline_MatchFinder_GetNumAvailableBytes(p) ((UInt32)((p)->streamPos - (p)->pos))
/*
#define Inline_MatchFinder_IsFinishedOK(p) \
((p)->streamEndWasReached \
&& (p)->streamPos == (p)->pos \
&& (!(p)->directInput || (p)->directInputRem == 0))
*/
int MatchFinder_NeedMove(CMatchFinder *p);
/* Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p); */
void MatchFinder_MoveBlock(CMatchFinder *p);
void MatchFinder_ReadIfRequired(CMatchFinder *p);
void MatchFinder_Construct(CMatchFinder *p);
/* Conditions:
historySize <= 3 GB
keepAddBufferBefore + matchMaxLen + keepAddBufferAfter < 511MB
*/
int MatchFinder_Create(CMatchFinder *p, UInt32 historySize,
UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter,
ISzAllocPtr alloc);
void MatchFinder_Free(CMatchFinder *p, ISzAllocPtr alloc);
void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, size_t numItems);
// void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue);
/*
#define Inline_MatchFinder_InitPos(p, val) \
(p)->pos = (val); \
(p)->streamPos = (val);
*/
#define Inline_MatchFinder_ReduceOffsets(p, subValue) \
(p)->pos -= (subValue); \
(p)->streamPos -= (subValue);
UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *buffer, CLzRef *son,
size_t _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 _cutValue,
UInt32 *distances, UInt32 maxLen);
/*
Conditions:
Mf_GetNumAvailableBytes_Func must be called before each Mf_GetMatchLen_Func.
Mf_GetPointerToCurrentPos_Func's result must be used only before any other function
*/
typedef void (*Mf_Init_Func)(void *object);
typedef UInt32 (*Mf_GetNumAvailableBytes_Func)(void *object);
typedef const Byte * (*Mf_GetPointerToCurrentPos_Func)(void *object);
typedef UInt32 * (*Mf_GetMatches_Func)(void *object, UInt32 *distances);
typedef void (*Mf_Skip_Func)(void *object, UInt32);
typedef struct _IMatchFinder
{
Mf_Init_Func Init;
Mf_GetNumAvailableBytes_Func GetNumAvailableBytes;
Mf_GetPointerToCurrentPos_Func GetPointerToCurrentPos;
Mf_GetMatches_Func GetMatches;
Mf_Skip_Func Skip;
} IMatchFinder2;
void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder2 *vTable);
void MatchFinder_Init_LowHash(CMatchFinder *p);
void MatchFinder_Init_HighHash(CMatchFinder *p);
void MatchFinder_Init_4(CMatchFinder *p);
void MatchFinder_Init(CMatchFinder *p);
UInt32* Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances);
UInt32* Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances);
void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num);
void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num);
void LzFindPrepare(void);
EXTERN_C_END
#endif

File diff suppressed because it is too large Load diff

View file

@ -1,109 +0,0 @@
/* LzFindMt.h -- multithreaded Match finder for LZ algorithms
2021-07-12 : Igor Pavlov : Public domain */
#ifndef __LZ_FIND_MT_H
#define __LZ_FIND_MT_H
#include "LzFind.h"
#include "Threads.h"
EXTERN_C_BEGIN
typedef struct _CMtSync
{
UInt32 numProcessedBlocks;
CThread thread;
UInt64 affinity;
BoolInt wasCreated;
BoolInt needStart;
BoolInt csWasInitialized;
BoolInt csWasEntered;
BoolInt exit;
BoolInt stopWriting;
CAutoResetEvent canStart;
CAutoResetEvent wasStopped;
CSemaphore freeSemaphore;
CSemaphore filledSemaphore;
CCriticalSection cs;
// UInt32 numBlocks_Sent;
} CMtSync;
typedef UInt32 * (*Mf_Mix_Matches)(void *p, UInt32 matchMinPos, UInt32 *distances);
/* kMtCacheLineDummy must be >= size_of_CPU_cache_line */
#define kMtCacheLineDummy 128
typedef void (*Mf_GetHeads)(const Byte *buffer, UInt32 pos,
UInt32 *hash, UInt32 hashMask, UInt32 *heads, UInt32 numHeads, const UInt32 *crc);
typedef struct _CMatchFinderMt
{
/* LZ */
const Byte *pointerToCurPos;
UInt32 *btBuf;
const UInt32 *btBufPos;
const UInt32 *btBufPosLimit;
UInt32 lzPos;
UInt32 btNumAvailBytes;
UInt32 *hash;
UInt32 fixedHashSize;
// UInt32 hash4Mask;
UInt32 historySize;
const UInt32 *crc;
Mf_Mix_Matches MixMatchesFunc;
UInt32 failure_LZ_BT; // failure in BT transfered to LZ
// UInt32 failure_LZ_LZ; // failure in LZ tables
UInt32 failureBuf[1];
// UInt32 crc[256];
/* LZ + BT */
CMtSync btSync;
Byte btDummy[kMtCacheLineDummy];
/* BT */
UInt32 *hashBuf;
UInt32 hashBufPos;
UInt32 hashBufPosLimit;
UInt32 hashNumAvail;
UInt32 failure_BT;
CLzRef *son;
UInt32 matchMaxLen;
UInt32 numHashBytes;
UInt32 pos;
const Byte *buffer;
UInt32 cyclicBufferPos;
UInt32 cyclicBufferSize; /* it must be = (historySize + 1) */
UInt32 cutValue;
/* BT + Hash */
CMtSync hashSync;
/* Byte hashDummy[kMtCacheLineDummy]; */
/* Hash */
Mf_GetHeads GetHeadsFunc;
CMatchFinder *MatchFinder;
// CMatchFinder MatchFinder;
} CMatchFinderMt;
// only for Mt part
void MatchFinderMt_Construct(CMatchFinderMt *p);
void MatchFinderMt_Destruct(CMatchFinderMt *p, ISzAllocPtr alloc);
SRes MatchFinderMt_Create(CMatchFinderMt *p, UInt32 historySize, UInt32 keepAddBufferBefore,
UInt32 matchMaxLen, UInt32 keepAddBufferAfter, ISzAllocPtr alloc);
void MatchFinderMt_CreateVTable(CMatchFinderMt *p, IMatchFinder2 *vTable);
/* call MatchFinderMt_InitMt() before IMatchFinder::Init() */
SRes MatchFinderMt_InitMt(CMatchFinderMt *p);
void MatchFinderMt_ReleaseStream(CMatchFinderMt *p);
EXTERN_C_END
#endif

View file

@ -1,578 +0,0 @@
/* LzFindOpt.c -- multithreaded Match finder for LZ algorithms
2021-07-13 : Igor Pavlov : Public domain */
#include "Precomp.h"
#include "CpuArch.h"
#include "LzFind.h"
// #include "LzFindMt.h"
// #define LOG_ITERS
// #define LOG_THREAD
#ifdef LOG_THREAD
#include <stdio.h>
#define PRF(x) x
#else
// #define PRF(x)
#endif
#ifdef LOG_ITERS
#include <stdio.h>
UInt64 g_NumIters_Tree;
UInt64 g_NumIters_Loop;
UInt64 g_NumIters_Bytes;
#define LOG_ITER(x) x
#else
#define LOG_ITER(x)
#endif
// ---------- BT THREAD ----------
#define USE_SON_PREFETCH
#define USE_LONG_MATCH_OPT
#define kEmptyHashValue 0
// #define CYC_TO_POS_OFFSET 0
// #define CYC_TO_POS_OFFSET 1 // for debug
/*
MY_NO_INLINE
UInt32 * MY_FAST_CALL GetMatchesSpecN_1(const Byte *lenLimit, size_t pos, const Byte *cur, CLzRef *son,
UInt32 _cutValue, UInt32 *d, size_t _maxLen, const UInt32 *hash, const UInt32 *limit, const UInt32 *size, UInt32 *posRes)
{
do
{
UInt32 delta;
if (hash == size)
break;
delta = *hash++;
if (delta == 0 || delta > (UInt32)pos)
return NULL;
lenLimit++;
if (delta == (UInt32)pos)
{
CLzRef *ptr1 = son + ((size_t)pos << 1) - CYC_TO_POS_OFFSET * 2;
*d++ = 0;
ptr1[0] = kEmptyHashValue;
ptr1[1] = kEmptyHashValue;
}
else
{
UInt32 *_distances = ++d;
CLzRef *ptr0 = son + ((size_t)(pos) << 1) - CYC_TO_POS_OFFSET * 2 + 1;
CLzRef *ptr1 = son + ((size_t)(pos) << 1) - CYC_TO_POS_OFFSET * 2;
const Byte *len0 = cur, *len1 = cur;
UInt32 cutValue = _cutValue;
const Byte *maxLen = cur + _maxLen;
for (LOG_ITER(g_NumIters_Tree++);;)
{
LOG_ITER(g_NumIters_Loop++);
{
const ptrdiff_t diff = (ptrdiff_t)0 - (ptrdiff_t)delta;
CLzRef *pair = son + ((size_t)(((ptrdiff_t)pos - CYC_TO_POS_OFFSET) + diff) << 1);
const Byte *len = (len0 < len1 ? len0 : len1);
#ifdef USE_SON_PREFETCH
const UInt32 pair0 = *pair;
#endif
if (len[diff] == len[0])
{
if (++len != lenLimit && len[diff] == len[0])
while (++len != lenLimit)
{
LOG_ITER(g_NumIters_Bytes++);
if (len[diff] != len[0])
break;
}
if (maxLen < len)
{
maxLen = len;
*d++ = (UInt32)(len - cur);
*d++ = delta - 1;
if (len == lenLimit)
{
const UInt32 pair1 = pair[1];
*ptr1 =
#ifdef USE_SON_PREFETCH
pair0;
#else
pair[0];
#endif
*ptr0 = pair1;
_distances[-1] = (UInt32)(d - _distances);
#ifdef USE_LONG_MATCH_OPT
if (hash == size || *hash != delta || lenLimit[diff] != lenLimit[0] || d >= limit)
break;
{
for (;;)
{
hash++;
pos++;
cur++;
lenLimit++;
{
CLzRef *ptr = son + ((size_t)(pos) << 1) - CYC_TO_POS_OFFSET * 2;
#if 0
*(UInt64 *)(void *)ptr = ((const UInt64 *)(const void *)ptr)[diff];
#else
const UInt32 p0 = ptr[0 + (diff * 2)];
const UInt32 p1 = ptr[1 + (diff * 2)];
ptr[0] = p0;
ptr[1] = p1;
// ptr[0] = ptr[0 + (diff * 2)];
// ptr[1] = ptr[1 + (diff * 2)];
#endif
}
// PrintSon(son + 2, pos - 1);
// printf("\npos = %x delta = %x\n", pos, delta);
len++;
*d++ = 2;
*d++ = (UInt32)(len - cur);
*d++ = delta - 1;
if (hash == size || *hash != delta || lenLimit[diff] != lenLimit[0] || d >= limit)
break;
}
}
#endif
break;
}
}
}
{
const UInt32 curMatch = (UInt32)pos - delta; // (UInt32)(pos + diff);
if (len[diff] < len[0])
{
delta = pair[1];
if (delta >= curMatch)
return NULL;
*ptr1 = curMatch;
ptr1 = pair + 1;
len1 = len;
}
else
{
delta = *pair;
if (delta >= curMatch)
return NULL;
*ptr0 = curMatch;
ptr0 = pair;
len0 = len;
}
delta = (UInt32)pos - delta;
if (--cutValue == 0 || delta >= pos)
{
*ptr0 = *ptr1 = kEmptyHashValue;
_distances[-1] = (UInt32)(d - _distances);
break;
}
}
}
} // for (tree iterations)
}
pos++;
cur++;
}
while (d < limit);
*posRes = (UInt32)pos;
return d;
}
*/
/* define cbs if you use 2 functions.
GetMatchesSpecN_1() : (pos < _cyclicBufferSize)
GetMatchesSpecN_2() : (pos >= _cyclicBufferSize)
do not define cbs if you use 1 function:
GetMatchesSpecN_2()
*/
// #define cbs _cyclicBufferSize
/*
we use size_t for (pos) and (_cyclicBufferPos_ instead of UInt32
to eliminate "movsx" BUG in old MSVC x64 compiler.
*/
UInt32 * MY_FAST_CALL GetMatchesSpecN_2(const Byte *lenLimit, size_t pos, const Byte *cur, CLzRef *son,
UInt32 _cutValue, UInt32 *d, size_t _maxLen, const UInt32 *hash, const UInt32 *limit, const UInt32 *size,
size_t _cyclicBufferPos, UInt32 _cyclicBufferSize,
UInt32 *posRes);
MY_NO_INLINE
UInt32 * MY_FAST_CALL GetMatchesSpecN_2(const Byte *lenLimit, size_t pos, const Byte *cur, CLzRef *son,
UInt32 _cutValue, UInt32 *d, size_t _maxLen, const UInt32 *hash, const UInt32 *limit, const UInt32 *size,
size_t _cyclicBufferPos, UInt32 _cyclicBufferSize,
UInt32 *posRes)
{
do // while (hash != size)
{
UInt32 delta;
#ifndef cbs
UInt32 cbs;
#endif
if (hash == size)
break;
delta = *hash++;
if (delta == 0)
return NULL;
lenLimit++;
#ifndef cbs
cbs = _cyclicBufferSize;
if ((UInt32)pos < cbs)
{
if (delta > (UInt32)pos)
return NULL;
cbs = (UInt32)pos;
}
#endif
if (delta >= cbs)
{
CLzRef *ptr1 = son + ((size_t)_cyclicBufferPos << 1);
*d++ = 0;
ptr1[0] = kEmptyHashValue;
ptr1[1] = kEmptyHashValue;
}
else
{
UInt32 *_distances = ++d;
CLzRef *ptr0 = son + ((size_t)_cyclicBufferPos << 1) + 1;
CLzRef *ptr1 = son + ((size_t)_cyclicBufferPos << 1);
UInt32 cutValue = _cutValue;
const Byte *len0 = cur, *len1 = cur;
const Byte *maxLen = cur + _maxLen;
// if (cutValue == 0) { *ptr0 = *ptr1 = kEmptyHashValue; } else
for (LOG_ITER(g_NumIters_Tree++);;)
{
LOG_ITER(g_NumIters_Loop++);
{
// SPEC code
CLzRef *pair = son + ((size_t)((ptrdiff_t)_cyclicBufferPos - (ptrdiff_t)delta
+ (ptrdiff_t)(UInt32)(_cyclicBufferPos < delta ? cbs : 0)
) << 1);
const ptrdiff_t diff = (ptrdiff_t)0 - (ptrdiff_t)delta;
const Byte *len = (len0 < len1 ? len0 : len1);
#ifdef USE_SON_PREFETCH
const UInt32 pair0 = *pair;
#endif
if (len[diff] == len[0])
{
if (++len != lenLimit && len[diff] == len[0])
while (++len != lenLimit)
{
LOG_ITER(g_NumIters_Bytes++);
if (len[diff] != len[0])
break;
}
if (maxLen < len)
{
maxLen = len;
*d++ = (UInt32)(len - cur);
*d++ = delta - 1;
if (len == lenLimit)
{
const UInt32 pair1 = pair[1];
*ptr1 =
#ifdef USE_SON_PREFETCH
pair0;
#else
pair[0];
#endif
*ptr0 = pair1;
_distances[-1] = (UInt32)(d - _distances);
#ifdef USE_LONG_MATCH_OPT
if (hash == size || *hash != delta || lenLimit[diff] != lenLimit[0] || d >= limit)
break;
{
for (;;)
{
*d++ = 2;
*d++ = (UInt32)(lenLimit - cur);
*d++ = delta - 1;
cur++;
lenLimit++;
// SPEC
_cyclicBufferPos++;
{
// SPEC code
CLzRef *dest = son + ((size_t)(_cyclicBufferPos) << 1);
const CLzRef *src = dest + ((diff
+ (ptrdiff_t)(UInt32)((_cyclicBufferPos < delta) ? cbs : 0)) << 1);
// CLzRef *ptr = son + ((size_t)(pos) << 1) - CYC_TO_POS_OFFSET * 2;
#if 0
*(UInt64 *)(void *)dest = *((const UInt64 *)(const void *)src);
#else
const UInt32 p0 = src[0];
const UInt32 p1 = src[1];
dest[0] = p0;
dest[1] = p1;
#endif
}
pos++;
hash++;
if (hash == size || *hash != delta || lenLimit[diff] != lenLimit[0] || d >= limit)
break;
} // for() end for long matches
}
#endif
break; // break from TREE iterations
}
}
}
{
const UInt32 curMatch = (UInt32)pos - delta; // (UInt32)(pos + diff);
if (len[diff] < len[0])
{
delta = pair[1];
*ptr1 = curMatch;
ptr1 = pair + 1;
len1 = len;
if (delta >= curMatch)
return NULL;
}
else
{
delta = *pair;
*ptr0 = curMatch;
ptr0 = pair;
len0 = len;
if (delta >= curMatch)
return NULL;
}
delta = (UInt32)pos - delta;
if (--cutValue == 0 || delta >= cbs)
{
*ptr0 = *ptr1 = kEmptyHashValue;
_distances[-1] = (UInt32)(d - _distances);
break;
}
}
}
} // for (tree iterations)
}
pos++;
_cyclicBufferPos++;
cur++;
}
while (d < limit);
*posRes = (UInt32)pos;
return d;
}
/*
typedef UInt32 uint32plus; // size_t
UInt32 * MY_FAST_CALL GetMatchesSpecN_3(uint32plus lenLimit, size_t pos, const Byte *cur, CLzRef *son,
UInt32 _cutValue, UInt32 *d, uint32plus _maxLen, const UInt32 *hash, const UInt32 *limit, const UInt32 *size,
size_t _cyclicBufferPos, UInt32 _cyclicBufferSize,
UInt32 *posRes)
{
do // while (hash != size)
{
UInt32 delta;
#ifndef cbs
UInt32 cbs;
#endif
if (hash == size)
break;
delta = *hash++;
if (delta == 0)
return NULL;
#ifndef cbs
cbs = _cyclicBufferSize;
if ((UInt32)pos < cbs)
{
if (delta > (UInt32)pos)
return NULL;
cbs = (UInt32)pos;
}
#endif
if (delta >= cbs)
{
CLzRef *ptr1 = son + ((size_t)_cyclicBufferPos << 1);
*d++ = 0;
ptr1[0] = kEmptyHashValue;
ptr1[1] = kEmptyHashValue;
}
else
{
CLzRef *ptr0 = son + ((size_t)_cyclicBufferPos << 1) + 1;
CLzRef *ptr1 = son + ((size_t)_cyclicBufferPos << 1);
UInt32 *_distances = ++d;
uint32plus len0 = 0, len1 = 0;
UInt32 cutValue = _cutValue;
uint32plus maxLen = _maxLen;
// lenLimit++; // const Byte *lenLimit = cur + _lenLimit;
for (LOG_ITER(g_NumIters_Tree++);;)
{
LOG_ITER(g_NumIters_Loop++);
{
// const ptrdiff_t diff = (ptrdiff_t)0 - (ptrdiff_t)delta;
CLzRef *pair = son + ((size_t)((ptrdiff_t)_cyclicBufferPos - delta
+ (ptrdiff_t)(UInt32)(_cyclicBufferPos < delta ? cbs : 0)
) << 1);
const Byte *pb = cur - delta;
uint32plus len = (len0 < len1 ? len0 : len1);
#ifdef USE_SON_PREFETCH
const UInt32 pair0 = *pair;
#endif
if (pb[len] == cur[len])
{
if (++len != lenLimit && pb[len] == cur[len])
while (++len != lenLimit)
if (pb[len] != cur[len])
break;
if (maxLen < len)
{
maxLen = len;
*d++ = (UInt32)len;
*d++ = delta - 1;
if (len == lenLimit)
{
{
const UInt32 pair1 = pair[1];
*ptr0 = pair1;
*ptr1 =
#ifdef USE_SON_PREFETCH
pair0;
#else
pair[0];
#endif
}
_distances[-1] = (UInt32)(d - _distances);
#ifdef USE_LONG_MATCH_OPT
if (hash == size || *hash != delta || pb[lenLimit] != cur[lenLimit] || d >= limit)
break;
{
const ptrdiff_t diff = (ptrdiff_t)0 - (ptrdiff_t)delta;
for (;;)
{
*d++ = 2;
*d++ = (UInt32)lenLimit;
*d++ = delta - 1;
_cyclicBufferPos++;
{
CLzRef *dest = son + ((size_t)_cyclicBufferPos << 1);
const CLzRef *src = dest + ((diff +
(ptrdiff_t)(UInt32)(_cyclicBufferPos < delta ? cbs : 0)) << 1);
#if 0
*(UInt64 *)(void *)dest = *((const UInt64 *)(const void *)src);
#else
const UInt32 p0 = src[0];
const UInt32 p1 = src[1];
dest[0] = p0;
dest[1] = p1;
#endif
}
hash++;
pos++;
cur++;
pb++;
if (hash == size || *hash != delta || pb[lenLimit] != cur[lenLimit] || d >= limit)
break;
}
}
#endif
break;
}
}
}
{
const UInt32 curMatch = (UInt32)pos - delta;
if (pb[len] < cur[len])
{
delta = pair[1];
*ptr1 = curMatch;
ptr1 = pair + 1;
len1 = len;
}
else
{
delta = *pair;
*ptr0 = curMatch;
ptr0 = pair;
len0 = len;
}
{
if (delta >= curMatch)
return NULL;
delta = (UInt32)pos - delta;
if (delta >= cbs
// delta >= _cyclicBufferSize || delta >= pos
|| --cutValue == 0)
{
*ptr0 = *ptr1 = kEmptyHashValue;
_distances[-1] = (UInt32)(d - _distances);
break;
}
}
}
}
} // for (tree iterations)
}
pos++;
_cyclicBufferPos++;
cur++;
}
while (d < limit);
*posRes = (UInt32)pos;
return d;
}
*/

View file

@ -1,34 +0,0 @@
/* LzHash.h -- HASH functions for LZ algorithms
2019-10-30 : Igor Pavlov : Public domain */
#ifndef __LZ_HASH_H
#define __LZ_HASH_H
/*
(kHash2Size >= (1 << 8)) : Required
(kHash3Size >= (1 << 16)) : Required
*/
#define kHash2Size (1 << 10)
#define kHash3Size (1 << 16)
// #define kHash4Size (1 << 20)
#define kFix3HashSize (kHash2Size)
#define kFix4HashSize (kHash2Size + kHash3Size)
// #define kFix5HashSize (kHash2Size + kHash3Size + kHash4Size)
/*
We use up to 3 crc values for hash:
crc0
crc1 << Shift_1
crc2 << Shift_2
(Shift_1 = 5) and (Shift_2 = 10) is good tradeoff.
Small values for Shift are not good for collision rate.
Big value for Shift_2 increases the minimum size
of hash table, that will be slow for small files.
*/
#define kLzHash_CrcShift_1 5
#define kLzHash_CrcShift_2 10
#endif

View file

@ -1,489 +0,0 @@
/* Lzma2Dec.c -- LZMA2 Decoder
2021-02-09 : Igor Pavlov : Public domain */
/* #define SHOW_DEBUG_INFO */
#include "Precomp.h"
#ifdef SHOW_DEBUG_INFO
#include <stdio.h>
#endif
#include <string.h>
#include "Lzma2Dec.h"
/*
00000000 - End of data
00000001 U U - Uncompressed, reset dic, need reset state and set new prop
00000010 U U - Uncompressed, no reset
100uuuuu U U P P - LZMA, no reset
101uuuuu U U P P - LZMA, reset state
110uuuuu U U P P S - LZMA, reset state + set new prop
111uuuuu U U P P S - LZMA, reset state + set new prop, reset dic
u, U - Unpack Size
P - Pack Size
S - Props
*/
#define LZMA2_CONTROL_COPY_RESET_DIC 1
#define LZMA2_IS_UNCOMPRESSED_STATE(p) (((p)->control & (1 << 7)) == 0)
#define LZMA2_LCLP_MAX 4
#define LZMA2_DIC_SIZE_FROM_PROP(p) (((UInt32)2 | ((p) & 1)) << ((p) / 2 + 11))
#ifdef SHOW_DEBUG_INFO
#define PRF(x) x
#else
#define PRF(x)
#endif
typedef enum
{
LZMA2_STATE_CONTROL,
LZMA2_STATE_UNPACK0,
LZMA2_STATE_UNPACK1,
LZMA2_STATE_PACK0,
LZMA2_STATE_PACK1,
LZMA2_STATE_PROP,
LZMA2_STATE_DATA,
LZMA2_STATE_DATA_CONT,
LZMA2_STATE_FINISHED,
LZMA2_STATE_ERROR
} ELzma2State;
static SRes Lzma2Dec_GetOldProps(Byte prop, Byte *props)
{
UInt32 dicSize;
if (prop > 40)
return SZ_ERROR_UNSUPPORTED;
dicSize = (prop == 40) ? 0xFFFFFFFF : LZMA2_DIC_SIZE_FROM_PROP(prop);
props[0] = (Byte)LZMA2_LCLP_MAX;
props[1] = (Byte)(dicSize);
props[2] = (Byte)(dicSize >> 8);
props[3] = (Byte)(dicSize >> 16);
props[4] = (Byte)(dicSize >> 24);
return SZ_OK;
}
SRes Lzma2Dec_AllocateProbs(CLzma2Dec *p, Byte prop, ISzAllocPtr alloc)
{
Byte props[LZMA_PROPS_SIZE];
RINOK(Lzma2Dec_GetOldProps(prop, props));
return LzmaDec_AllocateProbs(&p->decoder, props, LZMA_PROPS_SIZE, alloc);
}
SRes Lzma2Dec_Allocate(CLzma2Dec *p, Byte prop, ISzAllocPtr alloc)
{
Byte props[LZMA_PROPS_SIZE];
RINOK(Lzma2Dec_GetOldProps(prop, props));
return LzmaDec_Allocate(&p->decoder, props, LZMA_PROPS_SIZE, alloc);
}
void Lzma2Dec_Init(CLzma2Dec *p)
{
p->state = LZMA2_STATE_CONTROL;
p->needInitLevel = 0xE0;
p->isExtraMode = False;
p->unpackSize = 0;
// p->decoder.dicPos = 0; // we can use it instead of full init
LzmaDec_Init(&p->decoder);
}
// ELzma2State
static unsigned Lzma2Dec_UpdateState(CLzma2Dec *p, Byte b)
{
switch (p->state)
{
case LZMA2_STATE_CONTROL:
p->isExtraMode = False;
p->control = b;
PRF(printf("\n %8X", (unsigned)p->decoder.dicPos));
PRF(printf(" %02X", (unsigned)b));
if (b == 0)
return LZMA2_STATE_FINISHED;
if (LZMA2_IS_UNCOMPRESSED_STATE(p))
{
if (b == LZMA2_CONTROL_COPY_RESET_DIC)
p->needInitLevel = 0xC0;
else if (b > 2 || p->needInitLevel == 0xE0)
return LZMA2_STATE_ERROR;
}
else
{
if (b < p->needInitLevel)
return LZMA2_STATE_ERROR;
p->needInitLevel = 0;
p->unpackSize = (UInt32)(b & 0x1F) << 16;
}
return LZMA2_STATE_UNPACK0;
case LZMA2_STATE_UNPACK0:
p->unpackSize |= (UInt32)b << 8;
return LZMA2_STATE_UNPACK1;
case LZMA2_STATE_UNPACK1:
p->unpackSize |= (UInt32)b;
p->unpackSize++;
PRF(printf(" %7u", (unsigned)p->unpackSize));
return LZMA2_IS_UNCOMPRESSED_STATE(p) ? LZMA2_STATE_DATA : LZMA2_STATE_PACK0;
case LZMA2_STATE_PACK0:
p->packSize = (UInt32)b << 8;
return LZMA2_STATE_PACK1;
case LZMA2_STATE_PACK1:
p->packSize |= (UInt32)b;
p->packSize++;
// if (p->packSize < 5) return LZMA2_STATE_ERROR;
PRF(printf(" %5u", (unsigned)p->packSize));
return (p->control & 0x40) ? LZMA2_STATE_PROP : LZMA2_STATE_DATA;
case LZMA2_STATE_PROP:
{
unsigned lc, lp;
if (b >= (9 * 5 * 5))
return LZMA2_STATE_ERROR;
lc = b % 9;
b /= 9;
p->decoder.prop.pb = (Byte)(b / 5);
lp = b % 5;
if (lc + lp > LZMA2_LCLP_MAX)
return LZMA2_STATE_ERROR;
p->decoder.prop.lc = (Byte)lc;
p->decoder.prop.lp = (Byte)lp;
return LZMA2_STATE_DATA;
}
}
return LZMA2_STATE_ERROR;
}
static void LzmaDec_UpdateWithUncompressed(CLzmaDec *p, const Byte *src, SizeT size)
{
memcpy(p->dic + p->dicPos, src, size);
p->dicPos += size;
if (p->checkDicSize == 0 && p->prop.dicSize - p->processedPos <= size)
p->checkDicSize = p->prop.dicSize;
p->processedPos += (UInt32)size;
}
void LzmaDec_InitDicAndState(CLzmaDec *p, BoolInt initDic, BoolInt initState);
SRes Lzma2Dec_DecodeToDic(CLzma2Dec *p, SizeT dicLimit,
const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status)
{
SizeT inSize = *srcLen;
*srcLen = 0;
*status = LZMA_STATUS_NOT_SPECIFIED;
while (p->state != LZMA2_STATE_ERROR)
{
SizeT dicPos;
if (p->state == LZMA2_STATE_FINISHED)
{
*status = LZMA_STATUS_FINISHED_WITH_MARK;
return SZ_OK;
}
dicPos = p->decoder.dicPos;
if (dicPos == dicLimit && finishMode == LZMA_FINISH_ANY)
{
*status = LZMA_STATUS_NOT_FINISHED;
return SZ_OK;
}
if (p->state != LZMA2_STATE_DATA && p->state != LZMA2_STATE_DATA_CONT)
{
if (*srcLen == inSize)
{
*status = LZMA_STATUS_NEEDS_MORE_INPUT;
return SZ_OK;
}
(*srcLen)++;
p->state = Lzma2Dec_UpdateState(p, *src++);
if (dicPos == dicLimit && p->state != LZMA2_STATE_FINISHED)
break;
continue;
}
{
SizeT inCur = inSize - *srcLen;
SizeT outCur = dicLimit - dicPos;
ELzmaFinishMode curFinishMode = LZMA_FINISH_ANY;
if (outCur >= p->unpackSize)
{
outCur = (SizeT)p->unpackSize;
curFinishMode = LZMA_FINISH_END;
}
if (LZMA2_IS_UNCOMPRESSED_STATE(p))
{
if (inCur == 0)
{
*status = LZMA_STATUS_NEEDS_MORE_INPUT;
return SZ_OK;
}
if (p->state == LZMA2_STATE_DATA)
{
BoolInt initDic = (p->control == LZMA2_CONTROL_COPY_RESET_DIC);
LzmaDec_InitDicAndState(&p->decoder, initDic, False);
}
if (inCur > outCur)
inCur = outCur;
if (inCur == 0)
break;
LzmaDec_UpdateWithUncompressed(&p->decoder, src, inCur);
src += inCur;
*srcLen += inCur;
p->unpackSize -= (UInt32)inCur;
p->state = (p->unpackSize == 0) ? LZMA2_STATE_CONTROL : LZMA2_STATE_DATA_CONT;
}
else
{
SRes res;
if (p->state == LZMA2_STATE_DATA)
{
BoolInt initDic = (p->control >= 0xE0);
BoolInt initState = (p->control >= 0xA0);
LzmaDec_InitDicAndState(&p->decoder, initDic, initState);
p->state = LZMA2_STATE_DATA_CONT;
}
if (inCur > p->packSize)
inCur = (SizeT)p->packSize;
res = LzmaDec_DecodeToDic(&p->decoder, dicPos + outCur, src, &inCur, curFinishMode, status);
src += inCur;
*srcLen += inCur;
p->packSize -= (UInt32)inCur;
outCur = p->decoder.dicPos - dicPos;
p->unpackSize -= (UInt32)outCur;
if (res != 0)
break;
if (*status == LZMA_STATUS_NEEDS_MORE_INPUT)
{
if (p->packSize == 0)
break;
return SZ_OK;
}
if (inCur == 0 && outCur == 0)
{
if (*status != LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK
|| p->unpackSize != 0
|| p->packSize != 0)
break;
p->state = LZMA2_STATE_CONTROL;
}
*status = LZMA_STATUS_NOT_SPECIFIED;
}
}
}
*status = LZMA_STATUS_NOT_SPECIFIED;
p->state = LZMA2_STATE_ERROR;
return SZ_ERROR_DATA;
}
ELzma2ParseStatus Lzma2Dec_Parse(CLzma2Dec *p,
SizeT outSize,
const Byte *src, SizeT *srcLen,
int checkFinishBlock)
{
SizeT inSize = *srcLen;
*srcLen = 0;
while (p->state != LZMA2_STATE_ERROR)
{
if (p->state == LZMA2_STATE_FINISHED)
return (ELzma2ParseStatus)LZMA_STATUS_FINISHED_WITH_MARK;
if (outSize == 0 && !checkFinishBlock)
return (ELzma2ParseStatus)LZMA_STATUS_NOT_FINISHED;
if (p->state != LZMA2_STATE_DATA && p->state != LZMA2_STATE_DATA_CONT)
{
if (*srcLen == inSize)
return (ELzma2ParseStatus)LZMA_STATUS_NEEDS_MORE_INPUT;
(*srcLen)++;
p->state = Lzma2Dec_UpdateState(p, *src++);
if (p->state == LZMA2_STATE_UNPACK0)
{
// if (p->decoder.dicPos != 0)
if (p->control == LZMA2_CONTROL_COPY_RESET_DIC || p->control >= 0xE0)
return LZMA2_PARSE_STATUS_NEW_BLOCK;
// if (outSize == 0) return LZMA_STATUS_NOT_FINISHED;
}
// The following code can be commented.
// It's not big problem, if we read additional input bytes.
// It will be stopped later in LZMA2_STATE_DATA / LZMA2_STATE_DATA_CONT state.
if (outSize == 0 && p->state != LZMA2_STATE_FINISHED)
{
// checkFinishBlock is true. So we expect that block must be finished,
// We can return LZMA_STATUS_NOT_SPECIFIED or LZMA_STATUS_NOT_FINISHED here
// break;
return (ELzma2ParseStatus)LZMA_STATUS_NOT_FINISHED;
}
if (p->state == LZMA2_STATE_DATA)
return LZMA2_PARSE_STATUS_NEW_CHUNK;
continue;
}
if (outSize == 0)
return (ELzma2ParseStatus)LZMA_STATUS_NOT_FINISHED;
{
SizeT inCur = inSize - *srcLen;
if (LZMA2_IS_UNCOMPRESSED_STATE(p))
{
if (inCur == 0)
return (ELzma2ParseStatus)LZMA_STATUS_NEEDS_MORE_INPUT;
if (inCur > p->unpackSize)
inCur = p->unpackSize;
if (inCur > outSize)
inCur = outSize;
p->decoder.dicPos += inCur;
src += inCur;
*srcLen += inCur;
outSize -= inCur;
p->unpackSize -= (UInt32)inCur;
p->state = (p->unpackSize == 0) ? LZMA2_STATE_CONTROL : LZMA2_STATE_DATA_CONT;
}
else
{
p->isExtraMode = True;
if (inCur == 0)
{
if (p->packSize != 0)
return (ELzma2ParseStatus)LZMA_STATUS_NEEDS_MORE_INPUT;
}
else if (p->state == LZMA2_STATE_DATA)
{
p->state = LZMA2_STATE_DATA_CONT;
if (*src != 0)
{
// first byte of lzma chunk must be Zero
*srcLen += 1;
p->packSize--;
break;
}
}
if (inCur > p->packSize)
inCur = (SizeT)p->packSize;
src += inCur;
*srcLen += inCur;
p->packSize -= (UInt32)inCur;
if (p->packSize == 0)
{
SizeT rem = outSize;
if (rem > p->unpackSize)
rem = p->unpackSize;
p->decoder.dicPos += rem;
p->unpackSize -= (UInt32)rem;
outSize -= rem;
if (p->unpackSize == 0)
p->state = LZMA2_STATE_CONTROL;
}
}
}
}
p->state = LZMA2_STATE_ERROR;
return (ELzma2ParseStatus)LZMA_STATUS_NOT_SPECIFIED;
}
SRes Lzma2Dec_DecodeToBuf(CLzma2Dec *p, Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status)
{
SizeT outSize = *destLen, inSize = *srcLen;
*srcLen = *destLen = 0;
for (;;)
{
SizeT inCur = inSize, outCur, dicPos;
ELzmaFinishMode curFinishMode;
SRes res;
if (p->decoder.dicPos == p->decoder.dicBufSize)
p->decoder.dicPos = 0;
dicPos = p->decoder.dicPos;
curFinishMode = LZMA_FINISH_ANY;
outCur = p->decoder.dicBufSize - dicPos;
if (outCur >= outSize)
{
outCur = outSize;
curFinishMode = finishMode;
}
res = Lzma2Dec_DecodeToDic(p, dicPos + outCur, src, &inCur, curFinishMode, status);
src += inCur;
inSize -= inCur;
*srcLen += inCur;
outCur = p->decoder.dicPos - dicPos;
memcpy(dest, p->decoder.dic + dicPos, outCur);
dest += outCur;
outSize -= outCur;
*destLen += outCur;
if (res != 0)
return res;
if (outCur == 0 || outSize == 0)
return SZ_OK;
}
}
SRes Lzma2Decode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,
Byte prop, ELzmaFinishMode finishMode, ELzmaStatus *status, ISzAllocPtr alloc)
{
CLzma2Dec p;
SRes res;
SizeT outSize = *destLen, inSize = *srcLen;
*destLen = *srcLen = 0;
*status = LZMA_STATUS_NOT_SPECIFIED;
Lzma2Dec_Construct(&p);
RINOK(Lzma2Dec_AllocateProbs(&p, prop, alloc));
p.decoder.dic = dest;
p.decoder.dicBufSize = outSize;
Lzma2Dec_Init(&p);
*srcLen = inSize;
res = Lzma2Dec_DecodeToDic(&p, outSize, src, srcLen, finishMode, status);
*destLen = p.decoder.dicPos;
if (res == SZ_OK && *status == LZMA_STATUS_NEEDS_MORE_INPUT)
res = SZ_ERROR_INPUT_EOF;
Lzma2Dec_FreeProbs(&p, alloc);
return res;
}

View file

@ -1,120 +0,0 @@
/* Lzma2Dec.h -- LZMA2 Decoder
2018-02-19 : Igor Pavlov : Public domain */
#ifndef __LZMA2_DEC_H
#define __LZMA2_DEC_H
#include "LzmaDec.h"
EXTERN_C_BEGIN
/* ---------- State Interface ---------- */
typedef struct
{
unsigned state;
Byte control;
Byte needInitLevel;
Byte isExtraMode;
Byte _pad_;
UInt32 packSize;
UInt32 unpackSize;
CLzmaDec decoder;
} CLzma2Dec;
#define Lzma2Dec_Construct(p) LzmaDec_Construct(&(p)->decoder)
#define Lzma2Dec_FreeProbs(p, alloc) LzmaDec_FreeProbs(&(p)->decoder, alloc)
#define Lzma2Dec_Free(p, alloc) LzmaDec_Free(&(p)->decoder, alloc)
SRes Lzma2Dec_AllocateProbs(CLzma2Dec *p, Byte prop, ISzAllocPtr alloc);
SRes Lzma2Dec_Allocate(CLzma2Dec *p, Byte prop, ISzAllocPtr alloc);
void Lzma2Dec_Init(CLzma2Dec *p);
/*
finishMode:
It has meaning only if the decoding reaches output limit (*destLen or dicLimit).
LZMA_FINISH_ANY - use smallest number of input bytes
LZMA_FINISH_END - read EndOfStream marker after decoding
Returns:
SZ_OK
status:
LZMA_STATUS_FINISHED_WITH_MARK
LZMA_STATUS_NOT_FINISHED
LZMA_STATUS_NEEDS_MORE_INPUT
SZ_ERROR_DATA - Data error
*/
SRes Lzma2Dec_DecodeToDic(CLzma2Dec *p, SizeT dicLimit,
const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
SRes Lzma2Dec_DecodeToBuf(CLzma2Dec *p, Byte *dest, SizeT *destLen,
const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
/* ---------- LZMA2 block and chunk parsing ---------- */
/*
Lzma2Dec_Parse() parses compressed data stream up to next independent block or next chunk data.
It can return LZMA_STATUS_* code or LZMA2_PARSE_STATUS_* code:
- LZMA2_PARSE_STATUS_NEW_BLOCK - there is new block, and 1 additional byte (control byte of next block header) was read from input.
- LZMA2_PARSE_STATUS_NEW_CHUNK - there is new chunk, and only lzma2 header of new chunk was read.
CLzma2Dec::unpackSize contains unpack size of that chunk
*/
typedef enum
{
/*
LZMA_STATUS_NOT_SPECIFIED // data error
LZMA_STATUS_FINISHED_WITH_MARK
LZMA_STATUS_NOT_FINISHED //
LZMA_STATUS_NEEDS_MORE_INPUT
LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK // unused
*/
LZMA2_PARSE_STATUS_NEW_BLOCK = LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK + 1,
LZMA2_PARSE_STATUS_NEW_CHUNK
} ELzma2ParseStatus;
ELzma2ParseStatus Lzma2Dec_Parse(CLzma2Dec *p,
SizeT outSize, // output size
const Byte *src, SizeT *srcLen,
int checkFinishBlock // set (checkFinishBlock = 1), if it must read full input data, if decoder.dicPos reaches blockMax position.
);
/*
LZMA2 parser doesn't decode LZMA chunks, so we must read
full input LZMA chunk to decode some part of LZMA chunk.
Lzma2Dec_GetUnpackExtra() returns the value that shows
max possible number of output bytes that can be output by decoder
at current input positon.
*/
#define Lzma2Dec_GetUnpackExtra(p) ((p)->isExtraMode ? (p)->unpackSize : 0);
/* ---------- One Call Interface ---------- */
/*
finishMode:
It has meaning only if the decoding reaches output limit (*destLen).
LZMA_FINISH_ANY - use smallest number of input bytes
LZMA_FINISH_END - read EndOfStream marker after decoding
Returns:
SZ_OK
status:
LZMA_STATUS_FINISHED_WITH_MARK
LZMA_STATUS_NOT_FINISHED
SZ_ERROR_DATA - Data error
SZ_ERROR_MEM - Memory allocation error
SZ_ERROR_UNSUPPORTED - Unsupported properties
SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src).
*/
SRes Lzma2Decode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,
Byte prop, ELzmaFinishMode finishMode, ELzmaStatus *status, ISzAllocPtr alloc);
EXTERN_C_END
#endif

File diff suppressed because it is too large Load diff

View file

@ -1,79 +0,0 @@
/* Lzma2DecMt.h -- LZMA2 Decoder Multi-thread
2018-02-17 : Igor Pavlov : Public domain */
#ifndef __LZMA2_DEC_MT_H
#define __LZMA2_DEC_MT_H
#include "7zTypes.h"
EXTERN_C_BEGIN
typedef struct
{
size_t inBufSize_ST;
size_t outStep_ST;
#ifndef _7ZIP_ST
unsigned numThreads;
size_t inBufSize_MT;
size_t outBlockMax;
size_t inBlockMax;
#endif
} CLzma2DecMtProps;
/* init to single-thread mode */
void Lzma2DecMtProps_Init(CLzma2DecMtProps *p);
/* ---------- CLzma2DecMtHandle Interface ---------- */
/* Lzma2DecMt_ * functions can return the following exit codes:
SRes:
SZ_OK - OK
SZ_ERROR_MEM - Memory allocation error
SZ_ERROR_PARAM - Incorrect paramater in props
SZ_ERROR_WRITE - ISeqOutStream write callback error
// SZ_ERROR_OUTPUT_EOF - output buffer overflow - version with (Byte *) output
SZ_ERROR_PROGRESS - some break from progress callback
SZ_ERROR_THREAD - error in multithreading functions (only for Mt version)
*/
typedef void * CLzma2DecMtHandle;
CLzma2DecMtHandle Lzma2DecMt_Create(ISzAllocPtr alloc, ISzAllocPtr allocMid);
void Lzma2DecMt_Destroy(CLzma2DecMtHandle p);
SRes Lzma2DecMt_Decode(CLzma2DecMtHandle p,
Byte prop,
const CLzma2DecMtProps *props,
ISeqOutStream *outStream,
const UInt64 *outDataSize, // NULL means undefined
int finishMode, // 0 - partial unpacking is allowed, 1 - if lzma2 stream must be finished
// Byte *outBuf, size_t *outBufSize,
ISeqInStream *inStream,
// const Byte *inData, size_t inDataSize,
// out variables:
UInt64 *inProcessed,
int *isMT, /* out: (*isMT == 0), if single thread decoding was used */
// UInt64 *outProcessed,
ICompressProgress *progress);
/* ---------- Read from CLzma2DecMtHandle Interface ---------- */
SRes Lzma2DecMt_Init(CLzma2DecMtHandle pp,
Byte prop,
const CLzma2DecMtProps *props,
const UInt64 *outDataSize, int finishMode,
ISeqInStream *inStream);
SRes Lzma2DecMt_Read(CLzma2DecMtHandle pp,
Byte *data, size_t *outSize,
UInt64 *inStreamProcessed);
EXTERN_C_END
#endif

View file

@ -1,803 +0,0 @@
/* Lzma2Enc.c -- LZMA2 Encoder
2021-02-09 : Igor Pavlov : Public domain */
#include "Precomp.h"
#include <string.h>
/* #define _7ZIP_ST */
#include "Lzma2Enc.h"
#ifndef _7ZIP_ST
#include "MtCoder.h"
#else
#define MTCODER__THREADS_MAX 1
#endif
#define LZMA2_CONTROL_LZMA (1 << 7)
#define LZMA2_CONTROL_COPY_NO_RESET 2
#define LZMA2_CONTROL_COPY_RESET_DIC 1
#define LZMA2_CONTROL_EOF 0
#define LZMA2_LCLP_MAX 4
#define LZMA2_DIC_SIZE_FROM_PROP(p) (((UInt32)2 | ((p) & 1)) << ((p) / 2 + 11))
#define LZMA2_PACK_SIZE_MAX (1 << 16)
#define LZMA2_COPY_CHUNK_SIZE LZMA2_PACK_SIZE_MAX
#define LZMA2_UNPACK_SIZE_MAX (1 << 21)
#define LZMA2_KEEP_WINDOW_SIZE LZMA2_UNPACK_SIZE_MAX
#define LZMA2_CHUNK_SIZE_COMPRESSED_MAX ((1 << 16) + 16)
#define PRF(x) /* x */
/* ---------- CLimitedSeqInStream ---------- */
typedef struct
{
ISeqInStream vt;
ISeqInStream *realStream;
UInt64 limit;
UInt64 processed;
int finished;
} CLimitedSeqInStream;
static void LimitedSeqInStream_Init(CLimitedSeqInStream *p)
{
p->limit = (UInt64)(Int64)-1;
p->processed = 0;
p->finished = 0;
}
static SRes LimitedSeqInStream_Read(const ISeqInStream *pp, void *data, size_t *size)
{
CLimitedSeqInStream *p = CONTAINER_FROM_VTBL(pp, CLimitedSeqInStream, vt);
size_t size2 = *size;
SRes res = SZ_OK;
if (p->limit != (UInt64)(Int64)-1)
{
UInt64 rem = p->limit - p->processed;
if (size2 > rem)
size2 = (size_t)rem;
}
if (size2 != 0)
{
res = ISeqInStream_Read(p->realStream, data, &size2);
p->finished = (size2 == 0 ? 1 : 0);
p->processed += size2;
}
*size = size2;
return res;
}
/* ---------- CLzma2EncInt ---------- */
typedef struct
{
CLzmaEncHandle enc;
Byte propsAreSet;
Byte propsByte;
Byte needInitState;
Byte needInitProp;
UInt64 srcPos;
} CLzma2EncInt;
static SRes Lzma2EncInt_InitStream(CLzma2EncInt *p, const CLzma2EncProps *props)
{
if (!p->propsAreSet)
{
SizeT propsSize = LZMA_PROPS_SIZE;
Byte propsEncoded[LZMA_PROPS_SIZE];
RINOK(LzmaEnc_SetProps(p->enc, &props->lzmaProps));
RINOK(LzmaEnc_WriteProperties(p->enc, propsEncoded, &propsSize));
p->propsByte = propsEncoded[0];
p->propsAreSet = True;
}
return SZ_OK;
}
static void Lzma2EncInt_InitBlock(CLzma2EncInt *p)
{
p->srcPos = 0;
p->needInitState = True;
p->needInitProp = True;
}
SRes LzmaEnc_PrepareForLzma2(CLzmaEncHandle pp, ISeqInStream *inStream, UInt32 keepWindowSize,
ISzAllocPtr alloc, ISzAllocPtr allocBig);
SRes LzmaEnc_MemPrepare(CLzmaEncHandle pp, const Byte *src, SizeT srcLen,
UInt32 keepWindowSize, ISzAllocPtr alloc, ISzAllocPtr allocBig);
SRes LzmaEnc_CodeOneMemBlock(CLzmaEncHandle pp, BoolInt reInit,
Byte *dest, size_t *destLen, UInt32 desiredPackSize, UInt32 *unpackSize);
const Byte *LzmaEnc_GetCurBuf(CLzmaEncHandle pp);
void LzmaEnc_Finish(CLzmaEncHandle pp);
void LzmaEnc_SaveState(CLzmaEncHandle pp);
void LzmaEnc_RestoreState(CLzmaEncHandle pp);
/*
UInt32 LzmaEnc_GetNumAvailableBytes(CLzmaEncHandle pp);
*/
static SRes Lzma2EncInt_EncodeSubblock(CLzma2EncInt *p, Byte *outBuf,
size_t *packSizeRes, ISeqOutStream *outStream)
{
size_t packSizeLimit = *packSizeRes;
size_t packSize = packSizeLimit;
UInt32 unpackSize = LZMA2_UNPACK_SIZE_MAX;
unsigned lzHeaderSize = 5 + (p->needInitProp ? 1 : 0);
BoolInt useCopyBlock;
SRes res;
*packSizeRes = 0;
if (packSize < lzHeaderSize)
return SZ_ERROR_OUTPUT_EOF;
packSize -= lzHeaderSize;
LzmaEnc_SaveState(p->enc);
res = LzmaEnc_CodeOneMemBlock(p->enc, p->needInitState,
outBuf + lzHeaderSize, &packSize, LZMA2_PACK_SIZE_MAX, &unpackSize);
PRF(printf("\npackSize = %7d unpackSize = %7d ", packSize, unpackSize));
if (unpackSize == 0)
return res;
if (res == SZ_OK)
useCopyBlock = (packSize + 2 >= unpackSize || packSize > (1 << 16));
else
{
if (res != SZ_ERROR_OUTPUT_EOF)
return res;
res = SZ_OK;
useCopyBlock = True;
}
if (useCopyBlock)
{
size_t destPos = 0;
PRF(printf("################# COPY "));
while (unpackSize > 0)
{
UInt32 u = (unpackSize < LZMA2_COPY_CHUNK_SIZE) ? unpackSize : LZMA2_COPY_CHUNK_SIZE;
if (packSizeLimit - destPos < u + 3)
return SZ_ERROR_OUTPUT_EOF;
outBuf[destPos++] = (Byte)(p->srcPos == 0 ? LZMA2_CONTROL_COPY_RESET_DIC : LZMA2_CONTROL_COPY_NO_RESET);
outBuf[destPos++] = (Byte)((u - 1) >> 8);
outBuf[destPos++] = (Byte)(u - 1);
memcpy(outBuf + destPos, LzmaEnc_GetCurBuf(p->enc) - unpackSize, u);
unpackSize -= u;
destPos += u;
p->srcPos += u;
if (outStream)
{
*packSizeRes += destPos;
if (ISeqOutStream_Write(outStream, outBuf, destPos) != destPos)
return SZ_ERROR_WRITE;
destPos = 0;
}
else
*packSizeRes = destPos;
/* needInitState = True; */
}
LzmaEnc_RestoreState(p->enc);
return SZ_OK;
}
{
size_t destPos = 0;
UInt32 u = unpackSize - 1;
UInt32 pm = (UInt32)(packSize - 1);
unsigned mode = (p->srcPos == 0) ? 3 : (p->needInitState ? (p->needInitProp ? 2 : 1) : 0);
PRF(printf(" "));
outBuf[destPos++] = (Byte)(LZMA2_CONTROL_LZMA | (mode << 5) | ((u >> 16) & 0x1F));
outBuf[destPos++] = (Byte)(u >> 8);
outBuf[destPos++] = (Byte)u;
outBuf[destPos++] = (Byte)(pm >> 8);
outBuf[destPos++] = (Byte)pm;
if (p->needInitProp)
outBuf[destPos++] = p->propsByte;
p->needInitProp = False;
p->needInitState = False;
destPos += packSize;
p->srcPos += unpackSize;
if (outStream)
if (ISeqOutStream_Write(outStream, outBuf, destPos) != destPos)
return SZ_ERROR_WRITE;
*packSizeRes = destPos;
return SZ_OK;
}
}
/* ---------- Lzma2 Props ---------- */
void Lzma2EncProps_Init(CLzma2EncProps *p)
{
LzmaEncProps_Init(&p->lzmaProps);
p->blockSize = LZMA2_ENC_PROPS__BLOCK_SIZE__AUTO;
p->numBlockThreads_Reduced = -1;
p->numBlockThreads_Max = -1;
p->numTotalThreads = -1;
}
void Lzma2EncProps_Normalize(CLzma2EncProps *p)
{
UInt64 fileSize;
int t1, t1n, t2, t2r, t3;
{
CLzmaEncProps lzmaProps = p->lzmaProps;
LzmaEncProps_Normalize(&lzmaProps);
t1n = lzmaProps.numThreads;
}
t1 = p->lzmaProps.numThreads;
t2 = p->numBlockThreads_Max;
t3 = p->numTotalThreads;
if (t2 > MTCODER__THREADS_MAX)
t2 = MTCODER__THREADS_MAX;
if (t3 <= 0)
{
if (t2 <= 0)
t2 = 1;
t3 = t1n * t2;
}
else if (t2 <= 0)
{
t2 = t3 / t1n;
if (t2 == 0)
{
t1 = 1;
t2 = t3;
}
if (t2 > MTCODER__THREADS_MAX)
t2 = MTCODER__THREADS_MAX;
}
else if (t1 <= 0)
{
t1 = t3 / t2;
if (t1 == 0)
t1 = 1;
}
else
t3 = t1n * t2;
p->lzmaProps.numThreads = t1;
t2r = t2;
fileSize = p->lzmaProps.reduceSize;
if ( p->blockSize != LZMA2_ENC_PROPS__BLOCK_SIZE__SOLID
&& p->blockSize != LZMA2_ENC_PROPS__BLOCK_SIZE__AUTO
&& (p->blockSize < fileSize || fileSize == (UInt64)(Int64)-1))
p->lzmaProps.reduceSize = p->blockSize;
LzmaEncProps_Normalize(&p->lzmaProps);
p->lzmaProps.reduceSize = fileSize;
t1 = p->lzmaProps.numThreads;
if (p->blockSize == LZMA2_ENC_PROPS__BLOCK_SIZE__SOLID)
{
t2r = t2 = 1;
t3 = t1;
}
else if (p->blockSize == LZMA2_ENC_PROPS__BLOCK_SIZE__AUTO && t2 <= 1)
{
/* if there is no block multi-threading, we use SOLID block */
p->blockSize = LZMA2_ENC_PROPS__BLOCK_SIZE__SOLID;
}
else
{
if (p->blockSize == LZMA2_ENC_PROPS__BLOCK_SIZE__AUTO)
{
const UInt32 kMinSize = (UInt32)1 << 20;
const UInt32 kMaxSize = (UInt32)1 << 28;
const UInt32 dictSize = p->lzmaProps.dictSize;
UInt64 blockSize = (UInt64)dictSize << 2;
if (blockSize < kMinSize) blockSize = kMinSize;
if (blockSize > kMaxSize) blockSize = kMaxSize;
if (blockSize < dictSize) blockSize = dictSize;
blockSize += (kMinSize - 1);
blockSize &= ~(UInt64)(kMinSize - 1);
p->blockSize = blockSize;
}
if (t2 > 1 && fileSize != (UInt64)(Int64)-1)
{
UInt64 numBlocks = fileSize / p->blockSize;
if (numBlocks * p->blockSize != fileSize)
numBlocks++;
if (numBlocks < (unsigned)t2)
{
t2r = (int)numBlocks;
if (t2r == 0)
t2r = 1;
t3 = t1 * t2r;
}
}
}
p->numBlockThreads_Max = t2;
p->numBlockThreads_Reduced = t2r;
p->numTotalThreads = t3;
}
static SRes Progress(ICompressProgress *p, UInt64 inSize, UInt64 outSize)
{
return (p && ICompressProgress_Progress(p, inSize, outSize) != SZ_OK) ? SZ_ERROR_PROGRESS : SZ_OK;
}
/* ---------- Lzma2 ---------- */
typedef struct
{
Byte propEncoded;
CLzma2EncProps props;
UInt64 expectedDataSize;
Byte *tempBufLzma;
ISzAllocPtr alloc;
ISzAllocPtr allocBig;
CLzma2EncInt coders[MTCODER__THREADS_MAX];
#ifndef _7ZIP_ST
ISeqOutStream *outStream;
Byte *outBuf;
size_t outBuf_Rem; /* remainder in outBuf */
size_t outBufSize; /* size of allocated outBufs[i] */
size_t outBufsDataSizes[MTCODER__BLOCKS_MAX];
BoolInt mtCoder_WasConstructed;
CMtCoder mtCoder;
Byte *outBufs[MTCODER__BLOCKS_MAX];
#endif
} CLzma2Enc;
CLzma2EncHandle Lzma2Enc_Create(ISzAllocPtr alloc, ISzAllocPtr allocBig)
{
CLzma2Enc *p = (CLzma2Enc *)ISzAlloc_Alloc(alloc, sizeof(CLzma2Enc));
if (!p)
return NULL;
Lzma2EncProps_Init(&p->props);
Lzma2EncProps_Normalize(&p->props);
p->expectedDataSize = (UInt64)(Int64)-1;
p->tempBufLzma = NULL;
p->alloc = alloc;
p->allocBig = allocBig;
{
unsigned i;
for (i = 0; i < MTCODER__THREADS_MAX; i++)
p->coders[i].enc = NULL;
}
#ifndef _7ZIP_ST
p->mtCoder_WasConstructed = False;
{
unsigned i;
for (i = 0; i < MTCODER__BLOCKS_MAX; i++)
p->outBufs[i] = NULL;
p->outBufSize = 0;
}
#endif
return p;
}
#ifndef _7ZIP_ST
static void Lzma2Enc_FreeOutBufs(CLzma2Enc *p)
{
unsigned i;
for (i = 0; i < MTCODER__BLOCKS_MAX; i++)
if (p->outBufs[i])
{
ISzAlloc_Free(p->alloc, p->outBufs[i]);
p->outBufs[i] = NULL;
}
p->outBufSize = 0;
}
#endif
void Lzma2Enc_Destroy(CLzma2EncHandle pp)
{
CLzma2Enc *p = (CLzma2Enc *)pp;
unsigned i;
for (i = 0; i < MTCODER__THREADS_MAX; i++)
{
CLzma2EncInt *t = &p->coders[i];
if (t->enc)
{
LzmaEnc_Destroy(t->enc, p->alloc, p->allocBig);
t->enc = NULL;
}
}
#ifndef _7ZIP_ST
if (p->mtCoder_WasConstructed)
{
MtCoder_Destruct(&p->mtCoder);
p->mtCoder_WasConstructed = False;
}
Lzma2Enc_FreeOutBufs(p);
#endif
ISzAlloc_Free(p->alloc, p->tempBufLzma);
p->tempBufLzma = NULL;
ISzAlloc_Free(p->alloc, pp);
}
SRes Lzma2Enc_SetProps(CLzma2EncHandle pp, const CLzma2EncProps *props)
{
CLzma2Enc *p = (CLzma2Enc *)pp;
CLzmaEncProps lzmaProps = props->lzmaProps;
LzmaEncProps_Normalize(&lzmaProps);
if (lzmaProps.lc + lzmaProps.lp > LZMA2_LCLP_MAX)
return SZ_ERROR_PARAM;
p->props = *props;
Lzma2EncProps_Normalize(&p->props);
return SZ_OK;
}
void Lzma2Enc_SetDataSize(CLzmaEncHandle pp, UInt64 expectedDataSiize)
{
CLzma2Enc *p = (CLzma2Enc *)pp;
p->expectedDataSize = expectedDataSiize;
}
Byte Lzma2Enc_WriteProperties(CLzma2EncHandle pp)
{
CLzma2Enc *p = (CLzma2Enc *)pp;
unsigned i;
UInt32 dicSize = LzmaEncProps_GetDictSize(&p->props.lzmaProps);
for (i = 0; i < 40; i++)
if (dicSize <= LZMA2_DIC_SIZE_FROM_PROP(i))
break;
return (Byte)i;
}
static SRes Lzma2Enc_EncodeMt1(
CLzma2Enc *me,
CLzma2EncInt *p,
ISeqOutStream *outStream,
Byte *outBuf, size_t *outBufSize,
ISeqInStream *inStream,
const Byte *inData, size_t inDataSize,
int finished,
ICompressProgress *progress)
{
UInt64 unpackTotal = 0;
UInt64 packTotal = 0;
size_t outLim = 0;
CLimitedSeqInStream limitedInStream;
if (outBuf)
{
outLim = *outBufSize;
*outBufSize = 0;
}
if (!p->enc)
{
p->propsAreSet = False;
p->enc = LzmaEnc_Create(me->alloc);
if (!p->enc)
return SZ_ERROR_MEM;
}
limitedInStream.realStream = inStream;
if (inStream)
{
limitedInStream.vt.Read = LimitedSeqInStream_Read;
}
if (!outBuf)
{
// outStream version works only in one thread. So we use CLzma2Enc::tempBufLzma
if (!me->tempBufLzma)
{
me->tempBufLzma = (Byte *)ISzAlloc_Alloc(me->alloc, LZMA2_CHUNK_SIZE_COMPRESSED_MAX);
if (!me->tempBufLzma)
return SZ_ERROR_MEM;
}
}
RINOK(Lzma2EncInt_InitStream(p, &me->props));
for (;;)
{
SRes res = SZ_OK;
size_t inSizeCur = 0;
Lzma2EncInt_InitBlock(p);
LimitedSeqInStream_Init(&limitedInStream);
limitedInStream.limit = me->props.blockSize;
if (inStream)
{
UInt64 expected = (UInt64)(Int64)-1;
// inStream version works only in one thread. So we use CLzma2Enc::expectedDataSize
if (me->expectedDataSize != (UInt64)(Int64)-1
&& me->expectedDataSize >= unpackTotal)
expected = me->expectedDataSize - unpackTotal;
if (me->props.blockSize != LZMA2_ENC_PROPS__BLOCK_SIZE__SOLID
&& expected > me->props.blockSize)
expected = (size_t)me->props.blockSize;
LzmaEnc_SetDataSize(p->enc, expected);
RINOK(LzmaEnc_PrepareForLzma2(p->enc,
&limitedInStream.vt,
LZMA2_KEEP_WINDOW_SIZE,
me->alloc,
me->allocBig));
}
else
{
inSizeCur = inDataSize - (size_t)unpackTotal;
if (me->props.blockSize != LZMA2_ENC_PROPS__BLOCK_SIZE__SOLID
&& inSizeCur > me->props.blockSize)
inSizeCur = (size_t)me->props.blockSize;
// LzmaEnc_SetDataSize(p->enc, inSizeCur);
RINOK(LzmaEnc_MemPrepare(p->enc,
inData + (size_t)unpackTotal, inSizeCur,
LZMA2_KEEP_WINDOW_SIZE,
me->alloc,
me->allocBig));
}
for (;;)
{
size_t packSize = LZMA2_CHUNK_SIZE_COMPRESSED_MAX;
if (outBuf)
packSize = outLim - (size_t)packTotal;
res = Lzma2EncInt_EncodeSubblock(p,
outBuf ? outBuf + (size_t)packTotal : me->tempBufLzma, &packSize,
outBuf ? NULL : outStream);
if (res != SZ_OK)
break;
packTotal += packSize;
if (outBuf)
*outBufSize = (size_t)packTotal;
res = Progress(progress, unpackTotal + p->srcPos, packTotal);
if (res != SZ_OK)
break;
/*
if (LzmaEnc_GetNumAvailableBytes(p->enc) == 0)
break;
*/
if (packSize == 0)
break;
}
LzmaEnc_Finish(p->enc);
unpackTotal += p->srcPos;
RINOK(res);
if (p->srcPos != (inStream ? limitedInStream.processed : inSizeCur))
return SZ_ERROR_FAIL;
if (inStream ? limitedInStream.finished : (unpackTotal == inDataSize))
{
if (finished)
{
if (outBuf)
{
const size_t destPos = *outBufSize;
if (destPos >= outLim)
return SZ_ERROR_OUTPUT_EOF;
outBuf[destPos] = LZMA2_CONTROL_EOF; // 0
*outBufSize = destPos + 1;
}
else
{
const Byte b = LZMA2_CONTROL_EOF; // 0;
if (ISeqOutStream_Write(outStream, &b, 1) != 1)
return SZ_ERROR_WRITE;
}
}
return SZ_OK;
}
}
}
#ifndef _7ZIP_ST
static SRes Lzma2Enc_MtCallback_Code(void *pp, unsigned coderIndex, unsigned outBufIndex,
const Byte *src, size_t srcSize, int finished)
{
CLzma2Enc *me = (CLzma2Enc *)pp;
size_t destSize = me->outBufSize;
SRes res;
CMtProgressThunk progressThunk;
Byte *dest = me->outBufs[outBufIndex];
me->outBufsDataSizes[outBufIndex] = 0;
if (!dest)
{
dest = (Byte *)ISzAlloc_Alloc(me->alloc, me->outBufSize);
if (!dest)
return SZ_ERROR_MEM;
me->outBufs[outBufIndex] = dest;
}
MtProgressThunk_CreateVTable(&progressThunk);
progressThunk.mtProgress = &me->mtCoder.mtProgress;
progressThunk.inSize = 0;
progressThunk.outSize = 0;
res = Lzma2Enc_EncodeMt1(me,
&me->coders[coderIndex],
NULL, dest, &destSize,
NULL, src, srcSize,
finished,
&progressThunk.vt);
me->outBufsDataSizes[outBufIndex] = destSize;
return res;
}
static SRes Lzma2Enc_MtCallback_Write(void *pp, unsigned outBufIndex)
{
CLzma2Enc *me = (CLzma2Enc *)pp;
size_t size = me->outBufsDataSizes[outBufIndex];
const Byte *data = me->outBufs[outBufIndex];
if (me->outStream)
return ISeqOutStream_Write(me->outStream, data, size) == size ? SZ_OK : SZ_ERROR_WRITE;
if (size > me->outBuf_Rem)
return SZ_ERROR_OUTPUT_EOF;
memcpy(me->outBuf, data, size);
me->outBuf_Rem -= size;
me->outBuf += size;
return SZ_OK;
}
#endif
SRes Lzma2Enc_Encode2(CLzma2EncHandle pp,
ISeqOutStream *outStream,
Byte *outBuf, size_t *outBufSize,
ISeqInStream *inStream,
const Byte *inData, size_t inDataSize,
ICompressProgress *progress)
{
CLzma2Enc *p = (CLzma2Enc *)pp;
if (inStream && inData)
return SZ_ERROR_PARAM;
if (outStream && outBuf)
return SZ_ERROR_PARAM;
{
unsigned i;
for (i = 0; i < MTCODER__THREADS_MAX; i++)
p->coders[i].propsAreSet = False;
}
#ifndef _7ZIP_ST
if (p->props.numBlockThreads_Reduced > 1)
{
IMtCoderCallback2 vt;
if (!p->mtCoder_WasConstructed)
{
p->mtCoder_WasConstructed = True;
MtCoder_Construct(&p->mtCoder);
}
vt.Code = Lzma2Enc_MtCallback_Code;
vt.Write = Lzma2Enc_MtCallback_Write;
p->outStream = outStream;
p->outBuf = NULL;
p->outBuf_Rem = 0;
if (!outStream)
{
p->outBuf = outBuf;
p->outBuf_Rem = *outBufSize;
*outBufSize = 0;
}
p->mtCoder.allocBig = p->allocBig;
p->mtCoder.progress = progress;
p->mtCoder.inStream = inStream;
p->mtCoder.inData = inData;
p->mtCoder.inDataSize = inDataSize;
p->mtCoder.mtCallback = &vt;
p->mtCoder.mtCallbackObject = p;
p->mtCoder.blockSize = (size_t)p->props.blockSize;
if (p->mtCoder.blockSize != p->props.blockSize)
return SZ_ERROR_PARAM; /* SZ_ERROR_MEM */
{
size_t destBlockSize = p->mtCoder.blockSize + (p->mtCoder.blockSize >> 10) + 16;
if (destBlockSize < p->mtCoder.blockSize)
return SZ_ERROR_PARAM;
if (p->outBufSize != destBlockSize)
Lzma2Enc_FreeOutBufs(p);
p->outBufSize = destBlockSize;
}
p->mtCoder.numThreadsMax = (unsigned)p->props.numBlockThreads_Max;
p->mtCoder.expectedDataSize = p->expectedDataSize;
{
SRes res = MtCoder_Code(&p->mtCoder);
if (!outStream)
*outBufSize = (size_t)(p->outBuf - outBuf);
return res;
}
}
#endif
return Lzma2Enc_EncodeMt1(p,
&p->coders[0],
outStream, outBuf, outBufSize,
inStream, inData, inDataSize,
True, /* finished */
progress);
}

View file

@ -1,55 +0,0 @@
/* Lzma2Enc.h -- LZMA2 Encoder
2017-07-27 : Igor Pavlov : Public domain */
#ifndef __LZMA2_ENC_H
#define __LZMA2_ENC_H
#include "LzmaEnc.h"
EXTERN_C_BEGIN
#define LZMA2_ENC_PROPS__BLOCK_SIZE__AUTO 0
#define LZMA2_ENC_PROPS__BLOCK_SIZE__SOLID ((UInt64)(Int64)-1)
typedef struct
{
CLzmaEncProps lzmaProps;
UInt64 blockSize;
int numBlockThreads_Reduced;
int numBlockThreads_Max;
int numTotalThreads;
} CLzma2EncProps;
void Lzma2EncProps_Init(CLzma2EncProps *p);
void Lzma2EncProps_Normalize(CLzma2EncProps *p);
/* ---------- CLzmaEnc2Handle Interface ---------- */
/* Lzma2Enc_* functions can return the following exit codes:
SRes:
SZ_OK - OK
SZ_ERROR_MEM - Memory allocation error
SZ_ERROR_PARAM - Incorrect paramater in props
SZ_ERROR_WRITE - ISeqOutStream write callback error
SZ_ERROR_OUTPUT_EOF - output buffer overflow - version with (Byte *) output
SZ_ERROR_PROGRESS - some break from progress callback
SZ_ERROR_THREAD - error in multithreading functions (only for Mt version)
*/
typedef void * CLzma2EncHandle;
CLzma2EncHandle Lzma2Enc_Create(ISzAllocPtr alloc, ISzAllocPtr allocBig);
void Lzma2Enc_Destroy(CLzma2EncHandle p);
SRes Lzma2Enc_SetProps(CLzma2EncHandle p, const CLzma2EncProps *props);
void Lzma2Enc_SetDataSize(CLzma2EncHandle p, UInt64 expectedDataSiize);
Byte Lzma2Enc_WriteProperties(CLzma2EncHandle p);
SRes Lzma2Enc_Encode2(CLzma2EncHandle p,
ISeqOutStream *outStream,
Byte *outBuf, size_t *outBufSize,
ISeqInStream *inStream,
const Byte *inData, size_t inDataSize,
ICompressProgress *progress);
EXTERN_C_END
#endif

View file

@ -1,111 +0,0 @@
/* Lzma86.h -- LZMA + x86 (BCJ) Filter
2013-01-18 : Igor Pavlov : Public domain */
#ifndef __LZMA86_H
#define __LZMA86_H
#include "7zTypes.h"
EXTERN_C_BEGIN
#define LZMA86_SIZE_OFFSET (1 + 5)
#define LZMA86_HEADER_SIZE (LZMA86_SIZE_OFFSET + 8)
/*
It's an example for LZMA + x86 Filter use.
You can use .lzma86 extension, if you write that stream to file.
.lzma86 header adds one additional byte to standard .lzma header.
.lzma86 header (14 bytes):
Offset Size Description
0 1 = 0 - no filter, pure LZMA
= 1 - x86 filter + LZMA
1 1 lc, lp and pb in encoded form
2 4 dictSize (little endian)
6 8 uncompressed size (little endian)
Lzma86_Encode
-------------
level - compression level: 0 <= level <= 9, the default value for "level" is 5.
dictSize - The dictionary size in bytes. The maximum value is
128 MB = (1 << 27) bytes for 32-bit version
1 GB = (1 << 30) bytes for 64-bit version
The default value is 16 MB = (1 << 24) bytes, for level = 5.
It's recommended to use the dictionary that is larger than 4 KB and
that can be calculated as (1 << N) or (3 << N) sizes.
For better compression ratio dictSize must be >= inSize.
filterMode:
SZ_FILTER_NO - no Filter
SZ_FILTER_YES - x86 Filter
SZ_FILTER_AUTO - it tries both alternatives to select best.
Encoder will use 2 or 3 passes:
2 passes when FILTER_NO provides better compression.
3 passes when FILTER_YES provides better compression.
Lzma86Encode allocates Data with MyAlloc functions.
RAM Requirements for compressing:
RamSize = dictionarySize * 11.5 + 6MB + FilterBlockSize
filterMode FilterBlockSize
SZ_FILTER_NO 0
SZ_FILTER_YES inSize
SZ_FILTER_AUTO inSize
Return code:
SZ_OK - OK
SZ_ERROR_MEM - Memory allocation error
SZ_ERROR_PARAM - Incorrect paramater
SZ_ERROR_OUTPUT_EOF - output buffer overflow
SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version)
*/
enum ESzFilterMode
{
SZ_FILTER_NO,
SZ_FILTER_YES,
SZ_FILTER_AUTO
};
SRes Lzma86_Encode(Byte *dest, size_t *destLen, const Byte *src, size_t srcLen,
int level, UInt32 dictSize, int filterMode);
/*
Lzma86_GetUnpackSize:
In:
src - input data
srcLen - input data size
Out:
unpackSize - size of uncompressed stream
Return code:
SZ_OK - OK
SZ_ERROR_INPUT_EOF - Error in headers
*/
SRes Lzma86_GetUnpackSize(const Byte *src, SizeT srcLen, UInt64 *unpackSize);
/*
Lzma86_Decode:
In:
dest - output data
destLen - output data size
src - input data
srcLen - input data size
Out:
destLen - processed output size
srcLen - processed input size
Return code:
SZ_OK - OK
SZ_ERROR_DATA - Data error
SZ_ERROR_MEM - Memory allocation error
SZ_ERROR_UNSUPPORTED - unsupported file
SZ_ERROR_INPUT_EOF - it needs more bytes in input buffer
*/
SRes Lzma86_Decode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen);
EXTERN_C_END
#endif

View file

@ -1,54 +0,0 @@
/* Lzma86Dec.c -- LZMA + x86 (BCJ) Filter Decoder
2016-05-16 : Igor Pavlov : Public domain */
#include "Precomp.h"
#include "Lzma86.h"
#include "Alloc.h"
#include "Bra.h"
#include "LzmaDec.h"
SRes Lzma86_GetUnpackSize(const Byte *src, SizeT srcLen, UInt64 *unpackSize)
{
unsigned i;
if (srcLen < LZMA86_HEADER_SIZE)
return SZ_ERROR_INPUT_EOF;
*unpackSize = 0;
for (i = 0; i < sizeof(UInt64); i++)
*unpackSize += ((UInt64)src[LZMA86_SIZE_OFFSET + i]) << (8 * i);
return SZ_OK;
}
SRes Lzma86_Decode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen)
{
SRes res;
int useFilter;
SizeT inSizePure;
ELzmaStatus status;
if (*srcLen < LZMA86_HEADER_SIZE)
return SZ_ERROR_INPUT_EOF;
useFilter = src[0];
if (useFilter > 1)
{
*destLen = 0;
return SZ_ERROR_UNSUPPORTED;
}
inSizePure = *srcLen - LZMA86_HEADER_SIZE;
res = LzmaDecode(dest, destLen, src + LZMA86_HEADER_SIZE, &inSizePure,
src + 1, LZMA_PROPS_SIZE, LZMA_FINISH_ANY, &status, &g_Alloc);
*srcLen = inSizePure + LZMA86_HEADER_SIZE;
if (res != SZ_OK)
return res;
if (useFilter == 1)
{
UInt32 x86State;
x86_Convert_Init(x86State);
x86_Convert(dest, *destLen, 0, &x86State, 0);
}
return SZ_OK;
}

View file

@ -1,104 +0,0 @@
/* Lzma86Enc.c -- LZMA + x86 (BCJ) Filter Encoder
2018-07-04 : Igor Pavlov : Public domain */
#include "Precomp.h"
#include <string.h>
#include "Lzma86.h"
#include "Alloc.h"
#include "Bra.h"
#include "LzmaEnc.h"
int Lzma86_Encode(Byte *dest, size_t *destLen, const Byte *src, size_t srcLen,
int level, UInt32 dictSize, int filterMode)
{
size_t outSize2 = *destLen;
Byte *filteredStream;
BoolInt useFilter;
int mainResult = SZ_ERROR_OUTPUT_EOF;
CLzmaEncProps props;
LzmaEncProps_Init(&props);
props.level = level;
props.dictSize = dictSize;
*destLen = 0;
if (outSize2 < LZMA86_HEADER_SIZE)
return SZ_ERROR_OUTPUT_EOF;
{
int i;
UInt64 t = srcLen;
for (i = 0; i < 8; i++, t >>= 8)
dest[LZMA86_SIZE_OFFSET + i] = (Byte)t;
}
filteredStream = 0;
useFilter = (filterMode != SZ_FILTER_NO);
if (useFilter)
{
if (srcLen != 0)
{
filteredStream = (Byte *)MyAlloc(srcLen);
if (filteredStream == 0)
return SZ_ERROR_MEM;
memcpy(filteredStream, src, srcLen);
}
{
UInt32 x86State;
x86_Convert_Init(x86State);
x86_Convert(filteredStream, srcLen, 0, &x86State, 1);
}
}
{
size_t minSize = 0;
BoolInt bestIsFiltered = False;
/* passes for SZ_FILTER_AUTO:
0 - BCJ + LZMA
1 - LZMA
2 - BCJ + LZMA agaian, if pass 0 (BCJ + LZMA) is better.
*/
int numPasses = (filterMode == SZ_FILTER_AUTO) ? 3 : 1;
int i;
for (i = 0; i < numPasses; i++)
{
size_t outSizeProcessed = outSize2 - LZMA86_HEADER_SIZE;
size_t outPropsSize = 5;
SRes curRes;
BoolInt curModeIsFiltered = (numPasses > 1 && i == numPasses - 1);
if (curModeIsFiltered && !bestIsFiltered)
break;
if (useFilter && i == 0)
curModeIsFiltered = True;
curRes = LzmaEncode(dest + LZMA86_HEADER_SIZE, &outSizeProcessed,
curModeIsFiltered ? filteredStream : src, srcLen,
&props, dest + 1, &outPropsSize, 0,
NULL, &g_Alloc, &g_Alloc);
if (curRes != SZ_ERROR_OUTPUT_EOF)
{
if (curRes != SZ_OK)
{
mainResult = curRes;
break;
}
if (outSizeProcessed <= minSize || mainResult != SZ_OK)
{
minSize = outSizeProcessed;
bestIsFiltered = curModeIsFiltered;
mainResult = SZ_OK;
}
}
}
dest[0] = (Byte)(bestIsFiltered ? 1 : 0);
*destLen = LZMA86_HEADER_SIZE + minSize;
}
if (useFilter)
MyFree(filteredStream);
return mainResult;
}

File diff suppressed because it is too large Load diff

View file

@ -1,236 +0,0 @@
/* LzmaDec.h -- LZMA Decoder
2020-03-19 : Igor Pavlov : Public domain */
#ifndef __LZMA_DEC_H
#define __LZMA_DEC_H
#include "7zTypes.h"
EXTERN_C_BEGIN
/* #define _LZMA_PROB32 */
/* _LZMA_PROB32 can increase the speed on some CPUs,
but memory usage for CLzmaDec::probs will be doubled in that case */
typedef
#ifdef _LZMA_PROB32
UInt32
#else
UInt16
#endif
CLzmaProb;
/* ---------- LZMA Properties ---------- */
#define LZMA_PROPS_SIZE 5
typedef struct _CLzmaProps
{
Byte lc;
Byte lp;
Byte pb;
Byte _pad_;
UInt32 dicSize;
} CLzmaProps;
/* LzmaProps_Decode - decodes properties
Returns:
SZ_OK
SZ_ERROR_UNSUPPORTED - Unsupported properties
*/
SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size);
/* ---------- LZMA Decoder state ---------- */
/* LZMA_REQUIRED_INPUT_MAX = number of required input bytes for worst case.
Num bits = log2((2^11 / 31) ^ 22) + 26 < 134 + 26 = 160; */
#define LZMA_REQUIRED_INPUT_MAX 20
typedef struct
{
/* Don't change this structure. ASM code can use it. */
CLzmaProps prop;
CLzmaProb *probs;
CLzmaProb *probs_1664;
Byte *dic;
SizeT dicBufSize;
SizeT dicPos;
const Byte *buf;
UInt32 range;
UInt32 code;
UInt32 processedPos;
UInt32 checkDicSize;
UInt32 reps[4];
UInt32 state;
UInt32 remainLen;
UInt32 numProbs;
unsigned tempBufSize;
Byte tempBuf[LZMA_REQUIRED_INPUT_MAX];
} CLzmaDec;
#define LzmaDec_Construct(p) { (p)->dic = NULL; (p)->probs = NULL; }
void LzmaDec_Init(CLzmaDec *p);
/* There are two types of LZMA streams:
- Stream with end mark. That end mark adds about 6 bytes to compressed size.
- Stream without end mark. You must know exact uncompressed size to decompress such stream. */
typedef enum
{
LZMA_FINISH_ANY, /* finish at any point */
LZMA_FINISH_END /* block must be finished at the end */
} ELzmaFinishMode;
/* ELzmaFinishMode has meaning only if the decoding reaches output limit !!!
You must use LZMA_FINISH_END, when you know that current output buffer
covers last bytes of block. In other cases you must use LZMA_FINISH_ANY.
If LZMA decoder sees end marker before reaching output limit, it returns SZ_OK,
and output value of destLen will be less than output buffer size limit.
You can check status result also.
You can use multiple checks to test data integrity after full decompression:
1) Check Result and "status" variable.
2) Check that output(destLen) = uncompressedSize, if you know real uncompressedSize.
3) Check that output(srcLen) = compressedSize, if you know real compressedSize.
You must use correct finish mode in that case. */
typedef enum
{
LZMA_STATUS_NOT_SPECIFIED, /* use main error code instead */
LZMA_STATUS_FINISHED_WITH_MARK, /* stream was finished with end mark. */
LZMA_STATUS_NOT_FINISHED, /* stream was not finished */
LZMA_STATUS_NEEDS_MORE_INPUT, /* you must provide more input bytes */
LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK /* there is probability that stream was finished without end mark */
} ELzmaStatus;
/* ELzmaStatus is used only as output value for function call */
/* ---------- Interfaces ---------- */
/* There are 3 levels of interfaces:
1) Dictionary Interface
2) Buffer Interface
3) One Call Interface
You can select any of these interfaces, but don't mix functions from different
groups for same object. */
/* There are two variants to allocate state for Dictionary Interface:
1) LzmaDec_Allocate / LzmaDec_Free
2) LzmaDec_AllocateProbs / LzmaDec_FreeProbs
You can use variant 2, if you set dictionary buffer manually.
For Buffer Interface you must always use variant 1.
LzmaDec_Allocate* can return:
SZ_OK
SZ_ERROR_MEM - Memory allocation error
SZ_ERROR_UNSUPPORTED - Unsupported properties
*/
SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAllocPtr alloc);
void LzmaDec_FreeProbs(CLzmaDec *p, ISzAllocPtr alloc);
SRes LzmaDec_Allocate(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAllocPtr alloc);
void LzmaDec_Free(CLzmaDec *p, ISzAllocPtr alloc);
/* ---------- Dictionary Interface ---------- */
/* You can use it, if you want to eliminate the overhead for data copying from
dictionary to some other external buffer.
You must work with CLzmaDec variables directly in this interface.
STEPS:
LzmaDec_Construct()
LzmaDec_Allocate()
for (each new stream)
{
LzmaDec_Init()
while (it needs more decompression)
{
LzmaDec_DecodeToDic()
use data from CLzmaDec::dic and update CLzmaDec::dicPos
}
}
LzmaDec_Free()
*/
/* LzmaDec_DecodeToDic
The decoding to internal dictionary buffer (CLzmaDec::dic).
You must manually update CLzmaDec::dicPos, if it reaches CLzmaDec::dicBufSize !!!
finishMode:
It has meaning only if the decoding reaches output limit (dicLimit).
LZMA_FINISH_ANY - Decode just dicLimit bytes.
LZMA_FINISH_END - Stream must be finished after dicLimit.
Returns:
SZ_OK
status:
LZMA_STATUS_FINISHED_WITH_MARK
LZMA_STATUS_NOT_FINISHED
LZMA_STATUS_NEEDS_MORE_INPUT
LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK
SZ_ERROR_DATA - Data error
SZ_ERROR_FAIL - Some unexpected error: internal error of code, memory corruption or hardware failure
*/
SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit,
const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
/* ---------- Buffer Interface ---------- */
/* It's zlib-like interface.
See LzmaDec_DecodeToDic description for information about STEPS and return results,
but you must use LzmaDec_DecodeToBuf instead of LzmaDec_DecodeToDic and you don't need
to work with CLzmaDec variables manually.
finishMode:
It has meaning only if the decoding reaches output limit (*destLen).
LZMA_FINISH_ANY - Decode just destLen bytes.
LZMA_FINISH_END - Stream must be finished after (*destLen).
*/
SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen,
const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
/* ---------- One Call Interface ---------- */
/* LzmaDecode
finishMode:
It has meaning only if the decoding reaches output limit (*destLen).
LZMA_FINISH_ANY - Decode just destLen bytes.
LZMA_FINISH_END - Stream must be finished after (*destLen).
Returns:
SZ_OK
status:
LZMA_STATUS_FINISHED_WITH_MARK
LZMA_STATUS_NOT_FINISHED
LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK
SZ_ERROR_DATA - Data error
SZ_ERROR_MEM - Memory allocation error
SZ_ERROR_UNSUPPORTED - Unsupported properties
SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src).
SZ_ERROR_FAIL - Some unexpected error: internal error of code, memory corruption or hardware failure
*/
SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,
const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode,
ELzmaStatus *status, ISzAllocPtr alloc);
EXTERN_C_END
#endif

File diff suppressed because it is too large Load diff

View file

@ -1,78 +0,0 @@
/* LzmaEnc.h -- LZMA Encoder
2019-10-30 : Igor Pavlov : Public domain */
#ifndef __LZMA_ENC_H
#define __LZMA_ENC_H
#include "7zTypes.h"
EXTERN_C_BEGIN
#define LZMA_PROPS_SIZE 5
typedef struct _CLzmaEncProps
{
int level; /* 0 <= level <= 9 */
UInt32 dictSize; /* (1 << 12) <= dictSize <= (1 << 27) for 32-bit version
(1 << 12) <= dictSize <= (3 << 29) for 64-bit version
default = (1 << 24) */
int lc; /* 0 <= lc <= 8, default = 3 */
int lp; /* 0 <= lp <= 4, default = 0 */
int pb; /* 0 <= pb <= 4, default = 2 */
int algo; /* 0 - fast, 1 - normal, default = 1 */
int fb; /* 5 <= fb <= 273, default = 32 */
int btMode; /* 0 - hashChain Mode, 1 - binTree mode - normal, default = 1 */
int numHashBytes; /* 2, 3 or 4, default = 4 */
UInt32 mc; /* 1 <= mc <= (1 << 30), default = 32 */
unsigned writeEndMark; /* 0 - do not write EOPM, 1 - write EOPM, default = 0 */
int numThreads; /* 1 or 2, default = 2 */
UInt64 reduceSize; /* estimated size of data that will be compressed. default = (UInt64)(Int64)-1.
Encoder uses this value to reduce dictionary size */
UInt64 affinity;
} CLzmaEncProps;
void LzmaEncProps_Init(CLzmaEncProps *p);
void LzmaEncProps_Normalize(CLzmaEncProps *p);
UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2);
/* ---------- CLzmaEncHandle Interface ---------- */
/* LzmaEnc* functions can return the following exit codes:
SRes:
SZ_OK - OK
SZ_ERROR_MEM - Memory allocation error
SZ_ERROR_PARAM - Incorrect paramater in props
SZ_ERROR_WRITE - ISeqOutStream write callback error
SZ_ERROR_OUTPUT_EOF - output buffer overflow - version with (Byte *) output
SZ_ERROR_PROGRESS - some break from progress callback
SZ_ERROR_THREAD - error in multithreading functions (only for Mt version)
*/
typedef void * CLzmaEncHandle;
CLzmaEncHandle LzmaEnc_Create(ISzAllocPtr alloc);
void LzmaEnc_Destroy(CLzmaEncHandle p, ISzAllocPtr alloc, ISzAllocPtr allocBig);
SRes LzmaEnc_SetProps(CLzmaEncHandle p, const CLzmaEncProps *props);
void LzmaEnc_SetDataSize(CLzmaEncHandle p, UInt64 expectedDataSiize);
SRes LzmaEnc_WriteProperties(CLzmaEncHandle p, Byte *properties, SizeT *size);
unsigned LzmaEnc_IsWriteEndMark(CLzmaEncHandle p);
SRes LzmaEnc_Encode(CLzmaEncHandle p, ISeqOutStream *outStream, ISeqInStream *inStream,
ICompressProgress *progress, ISzAllocPtr alloc, ISzAllocPtr allocBig);
SRes LzmaEnc_MemEncode(CLzmaEncHandle p, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
int writeEndMark, ICompressProgress *progress, ISzAllocPtr alloc, ISzAllocPtr allocBig);
/* ---------- One Call Interface ---------- */
SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark,
ICompressProgress *progress, ISzAllocPtr alloc, ISzAllocPtr allocBig);
EXTERN_C_END
#endif

View file

@ -1,40 +0,0 @@
/* LzmaLib.c -- LZMA library wrapper
2015-06-13 : Igor Pavlov : Public domain */
#include "Alloc.h"
#include "LzmaDec.h"
#include "LzmaEnc.h"
#include "LzmaLib.h"
MY_STDAPI LzmaCompress(unsigned char *dest, size_t *destLen, const unsigned char *src, size_t srcLen,
unsigned char *outProps, size_t *outPropsSize,
int level, /* 0 <= level <= 9, default = 5 */
unsigned dictSize, /* use (1 << N) or (3 << N). 4 KB < dictSize <= 128 MB */
int lc, /* 0 <= lc <= 8, default = 3 */
int lp, /* 0 <= lp <= 4, default = 0 */
int pb, /* 0 <= pb <= 4, default = 2 */
int fb, /* 5 <= fb <= 273, default = 32 */
int numThreads /* 1 or 2, default = 2 */
)
{
CLzmaEncProps props;
LzmaEncProps_Init(&props);
props.level = level;
props.dictSize = dictSize;
props.lc = lc;
props.lp = lp;
props.pb = pb;
props.fb = fb;
props.numThreads = numThreads;
return LzmaEncode(dest, destLen, src, srcLen, &props, outProps, outPropsSize, 0,
NULL, &g_Alloc, &g_Alloc);
}
MY_STDAPI LzmaUncompress(unsigned char *dest, size_t *destLen, const unsigned char *src, size_t *srcLen,
const unsigned char *props, size_t propsSize)
{
ELzmaStatus status;
return LzmaDecode(dest, destLen, src, srcLen, props, (unsigned)propsSize, LZMA_FINISH_ANY, &status, &g_Alloc);
}

View file

@ -1,138 +0,0 @@
/* LzmaLib.h -- LZMA library interface
2021-04-03 : Igor Pavlov : Public domain */
#ifndef __LZMA_LIB_H
#define __LZMA_LIB_H
#include "7zTypes.h"
EXTERN_C_BEGIN
#define MY_STDAPI int MY_STD_CALL
#define LZMA_PROPS_SIZE 5
/*
RAM requirements for LZMA:
for compression: (dictSize * 11.5 + 6 MB) + state_size
for decompression: dictSize + state_size
state_size = (4 + (1.5 << (lc + lp))) KB
by default (lc=3, lp=0), state_size = 16 KB.
LZMA properties (5 bytes) format
Offset Size Description
0 1 lc, lp and pb in encoded form.
1 4 dictSize (little endian).
*/
/*
LzmaCompress
------------
outPropsSize -
In: the pointer to the size of outProps buffer; *outPropsSize = LZMA_PROPS_SIZE = 5.
Out: the pointer to the size of written properties in outProps buffer; *outPropsSize = LZMA_PROPS_SIZE = 5.
LZMA Encoder will use defult values for any parameter, if it is
-1 for any from: level, loc, lp, pb, fb, numThreads
0 for dictSize
level - compression level: 0 <= level <= 9;
level dictSize algo fb
0: 64 KB 0 32
1: 256 KB 0 32
2: 1 MB 0 32
3: 4 MB 0 32
4: 16 MB 0 32
5: 16 MB 1 32
6: 32 MB 1 32
7: 32 MB 1 64
8: 64 MB 1 64
9: 64 MB 1 64
The default value for "level" is 5.
algo = 0 means fast method
algo = 1 means normal method
dictSize - The dictionary size in bytes. The maximum value is
128 MB = (1 << 27) bytes for 32-bit version
1 GB = (1 << 30) bytes for 64-bit version
The default value is 16 MB = (1 << 24) bytes.
It's recommended to use the dictionary that is larger than 4 KB and
that can be calculated as (1 << N) or (3 << N) sizes.
lc - The number of literal context bits (high bits of previous literal).
It can be in the range from 0 to 8. The default value is 3.
Sometimes lc=4 gives the gain for big files.
lp - The number of literal pos bits (low bits of current position for literals).
It can be in the range from 0 to 4. The default value is 0.
The lp switch is intended for periodical data when the period is equal to 2^lp.
For example, for 32-bit (4 bytes) periodical data you can use lp=2. Often it's
better to set lc=0, if you change lp switch.
pb - The number of pos bits (low bits of current position).
It can be in the range from 0 to 4. The default value is 2.
The pb switch is intended for periodical data when the period is equal 2^pb.
fb - Word size (the number of fast bytes).
It can be in the range from 5 to 273. The default value is 32.
Usually, a big number gives a little bit better compression ratio and
slower compression process.
numThreads - The number of thereads. 1 or 2. The default value is 2.
Fast mode (algo = 0) can use only 1 thread.
In:
dest - output data buffer
destLen - output data buffer size
src - input data
srcLen - input data size
Out:
destLen - processed output size
Returns:
SZ_OK - OK
SZ_ERROR_MEM - Memory allocation error
SZ_ERROR_PARAM - Incorrect paramater
SZ_ERROR_OUTPUT_EOF - output buffer overflow
SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version)
*/
MY_STDAPI LzmaCompress(unsigned char *dest, size_t *destLen, const unsigned char *src, size_t srcLen,
unsigned char *outProps, size_t *outPropsSize, /* *outPropsSize must be = 5 */
int level, /* 0 <= level <= 9, default = 5 */
unsigned dictSize, /* default = (1 << 24) */
int lc, /* 0 <= lc <= 8, default = 3 */
int lp, /* 0 <= lp <= 4, default = 0 */
int pb, /* 0 <= pb <= 4, default = 2 */
int fb, /* 5 <= fb <= 273, default = 32 */
int numThreads /* 1 or 2, default = 2 */
);
/*
LzmaUncompress
--------------
In:
dest - output data buffer
destLen - output data buffer size
src - input data
srcLen - input data size
Out:
destLen - processed output size
srcLen - processed input size
Returns:
SZ_OK - OK
SZ_ERROR_DATA - Data error
SZ_ERROR_MEM - Memory allocation arror
SZ_ERROR_UNSUPPORTED - Unsupported properties
SZ_ERROR_INPUT_EOF - it needs more bytes in input buffer (src)
*/
MY_STDAPI LzmaUncompress(unsigned char *dest, size_t *destLen, const unsigned char *src, SizeT *srcLen,
const unsigned char *props, size_t propsSize);
EXTERN_C_END
#endif

View file

@ -1,595 +0,0 @@
/* MtCoder.c -- Multi-thread Coder
2021-12-21 : Igor Pavlov : Public domain */
#include "Precomp.h"
#include "MtCoder.h"
#ifndef _7ZIP_ST
static SRes MtProgressThunk_Progress(const ICompressProgress *pp, UInt64 inSize, UInt64 outSize)
{
CMtProgressThunk *thunk = CONTAINER_FROM_VTBL(pp, CMtProgressThunk, vt);
UInt64 inSize2 = 0;
UInt64 outSize2 = 0;
if (inSize != (UInt64)(Int64)-1)
{
inSize2 = inSize - thunk->inSize;
thunk->inSize = inSize;
}
if (outSize != (UInt64)(Int64)-1)
{
outSize2 = outSize - thunk->outSize;
thunk->outSize = outSize;
}
return MtProgress_ProgressAdd(thunk->mtProgress, inSize2, outSize2);
}
void MtProgressThunk_CreateVTable(CMtProgressThunk *p)
{
p->vt.Progress = MtProgressThunk_Progress;
}
#define RINOK_THREAD(x) { if ((x) != 0) return SZ_ERROR_THREAD; }
static WRes ArEvent_OptCreate_And_Reset(CEvent *p)
{
if (Event_IsCreated(p))
return Event_Reset(p);
return AutoResetEvent_CreateNotSignaled(p);
}
static THREAD_FUNC_DECL ThreadFunc(void *pp);
static SRes MtCoderThread_CreateAndStart(CMtCoderThread *t)
{
WRes wres = ArEvent_OptCreate_And_Reset(&t->startEvent);
if (wres == 0)
{
t->stop = False;
if (!Thread_WasCreated(&t->thread))
wres = Thread_Create(&t->thread, ThreadFunc, t);
if (wres == 0)
wres = Event_Set(&t->startEvent);
}
if (wres == 0)
return SZ_OK;
return MY_SRes_HRESULT_FROM_WRes(wres);
}
static void MtCoderThread_Destruct(CMtCoderThread *t)
{
if (Thread_WasCreated(&t->thread))
{
t->stop = 1;
Event_Set(&t->startEvent);
Thread_Wait_Close(&t->thread);
}
Event_Close(&t->startEvent);
if (t->inBuf)
{
ISzAlloc_Free(t->mtCoder->allocBig, t->inBuf);
t->inBuf = NULL;
}
}
static SRes FullRead(ISeqInStream *stream, Byte *data, size_t *processedSize)
{
size_t size = *processedSize;
*processedSize = 0;
while (size != 0)
{
size_t cur = size;
SRes res = ISeqInStream_Read(stream, data, &cur);
*processedSize += cur;
data += cur;
size -= cur;
RINOK(res);
if (cur == 0)
return SZ_OK;
}
return SZ_OK;
}
/*
ThreadFunc2() returns:
SZ_OK - in all normal cases (even for stream error or memory allocation error)
SZ_ERROR_THREAD - in case of failure in system synch function
*/
static SRes ThreadFunc2(CMtCoderThread *t)
{
CMtCoder *mtc = t->mtCoder;
for (;;)
{
unsigned bi;
SRes res;
SRes res2;
BoolInt finished;
unsigned bufIndex;
size_t size;
const Byte *inData;
UInt64 readProcessed = 0;
RINOK_THREAD(Event_Wait(&mtc->readEvent))
/* after Event_Wait(&mtc->readEvent) we must call Event_Set(&mtc->readEvent) in any case to unlock another threads */
if (mtc->stopReading)
{
return Event_Set(&mtc->readEvent) == 0 ? SZ_OK : SZ_ERROR_THREAD;
}
res = MtProgress_GetError(&mtc->mtProgress);
size = 0;
inData = NULL;
finished = True;
if (res == SZ_OK)
{
size = mtc->blockSize;
if (mtc->inStream)
{
if (!t->inBuf)
{
t->inBuf = (Byte *)ISzAlloc_Alloc(mtc->allocBig, mtc->blockSize);
if (!t->inBuf)
res = SZ_ERROR_MEM;
}
if (res == SZ_OK)
{
res = FullRead(mtc->inStream, t->inBuf, &size);
readProcessed = mtc->readProcessed + size;
mtc->readProcessed = readProcessed;
}
if (res != SZ_OK)
{
mtc->readRes = res;
/* after reading error - we can stop encoding of previous blocks */
MtProgress_SetError(&mtc->mtProgress, res);
}
else
finished = (size != mtc->blockSize);
}
else
{
size_t rem;
readProcessed = mtc->readProcessed;
rem = mtc->inDataSize - (size_t)readProcessed;
if (size > rem)
size = rem;
inData = mtc->inData + (size_t)readProcessed;
readProcessed += size;
mtc->readProcessed = readProcessed;
finished = (mtc->inDataSize == (size_t)readProcessed);
}
}
/* we must get some block from blocksSemaphore before Event_Set(&mtc->readEvent) */
res2 = SZ_OK;
if (Semaphore_Wait(&mtc->blocksSemaphore) != 0)
{
res2 = SZ_ERROR_THREAD;
if (res == SZ_OK)
{
res = res2;
// MtProgress_SetError(&mtc->mtProgress, res);
}
}
bi = mtc->blockIndex;
if (++mtc->blockIndex >= mtc->numBlocksMax)
mtc->blockIndex = 0;
bufIndex = (unsigned)(int)-1;
if (res == SZ_OK)
res = MtProgress_GetError(&mtc->mtProgress);
if (res != SZ_OK)
finished = True;
if (!finished)
{
if (mtc->numStartedThreads < mtc->numStartedThreadsLimit
&& mtc->expectedDataSize != readProcessed)
{
res = MtCoderThread_CreateAndStart(&mtc->threads[mtc->numStartedThreads]);
if (res == SZ_OK)
mtc->numStartedThreads++;
else
{
MtProgress_SetError(&mtc->mtProgress, res);
finished = True;
}
}
}
if (finished)
mtc->stopReading = True;
RINOK_THREAD(Event_Set(&mtc->readEvent))
if (res2 != SZ_OK)
return res2;
if (res == SZ_OK)
{
CriticalSection_Enter(&mtc->cs);
bufIndex = mtc->freeBlockHead;
mtc->freeBlockHead = mtc->freeBlockList[bufIndex];
CriticalSection_Leave(&mtc->cs);
res = mtc->mtCallback->Code(mtc->mtCallbackObject, t->index, bufIndex,
mtc->inStream ? t->inBuf : inData, size, finished);
// MtProgress_Reinit(&mtc->mtProgress, t->index);
if (res != SZ_OK)
MtProgress_SetError(&mtc->mtProgress, res);
}
{
CMtCoderBlock *block = &mtc->blocks[bi];
block->res = res;
block->bufIndex = bufIndex;
block->finished = finished;
}
#ifdef MTCODER__USE_WRITE_THREAD
RINOK_THREAD(Event_Set(&mtc->writeEvents[bi]))
#else
{
unsigned wi;
{
CriticalSection_Enter(&mtc->cs);
wi = mtc->writeIndex;
if (wi == bi)
mtc->writeIndex = (unsigned)(int)-1;
else
mtc->ReadyBlocks[bi] = True;
CriticalSection_Leave(&mtc->cs);
}
if (wi != bi)
{
if (res != SZ_OK || finished)
return 0;
continue;
}
if (mtc->writeRes != SZ_OK)
res = mtc->writeRes;
for (;;)
{
if (res == SZ_OK && bufIndex != (unsigned)(int)-1)
{
res = mtc->mtCallback->Write(mtc->mtCallbackObject, bufIndex);
if (res != SZ_OK)
{
mtc->writeRes = res;
MtProgress_SetError(&mtc->mtProgress, res);
}
}
if (++wi >= mtc->numBlocksMax)
wi = 0;
{
BoolInt isReady;
CriticalSection_Enter(&mtc->cs);
if (bufIndex != (unsigned)(int)-1)
{
mtc->freeBlockList[bufIndex] = mtc->freeBlockHead;
mtc->freeBlockHead = bufIndex;
}
isReady = mtc->ReadyBlocks[wi];
if (isReady)
mtc->ReadyBlocks[wi] = False;
else
mtc->writeIndex = wi;
CriticalSection_Leave(&mtc->cs);
RINOK_THREAD(Semaphore_Release1(&mtc->blocksSemaphore))
if (!isReady)
break;
}
{
CMtCoderBlock *block = &mtc->blocks[wi];
if (res == SZ_OK && block->res != SZ_OK)
res = block->res;
bufIndex = block->bufIndex;
finished = block->finished;
}
}
}
#endif
if (finished || res != SZ_OK)
return 0;
}
}
static THREAD_FUNC_DECL ThreadFunc(void *pp)
{
CMtCoderThread *t = (CMtCoderThread *)pp;
for (;;)
{
if (Event_Wait(&t->startEvent) != 0)
return (THREAD_FUNC_RET_TYPE)SZ_ERROR_THREAD;
if (t->stop)
return 0;
{
SRes res = ThreadFunc2(t);
CMtCoder *mtc = t->mtCoder;
if (res != SZ_OK)
{
MtProgress_SetError(&mtc->mtProgress, res);
}
#ifndef MTCODER__USE_WRITE_THREAD
{
unsigned numFinished = (unsigned)InterlockedIncrement(&mtc->numFinishedThreads);
if (numFinished == mtc->numStartedThreads)
if (Event_Set(&mtc->finishedEvent) != 0)
return (THREAD_FUNC_RET_TYPE)SZ_ERROR_THREAD;
}
#endif
}
}
}
void MtCoder_Construct(CMtCoder *p)
{
unsigned i;
p->blockSize = 0;
p->numThreadsMax = 0;
p->expectedDataSize = (UInt64)(Int64)-1;
p->inStream = NULL;
p->inData = NULL;
p->inDataSize = 0;
p->progress = NULL;
p->allocBig = NULL;
p->mtCallback = NULL;
p->mtCallbackObject = NULL;
p->allocatedBufsSize = 0;
Event_Construct(&p->readEvent);
Semaphore_Construct(&p->blocksSemaphore);
for (i = 0; i < MTCODER__THREADS_MAX; i++)
{
CMtCoderThread *t = &p->threads[i];
t->mtCoder = p;
t->index = i;
t->inBuf = NULL;
t->stop = False;
Event_Construct(&t->startEvent);
Thread_Construct(&t->thread);
}
#ifdef MTCODER__USE_WRITE_THREAD
for (i = 0; i < MTCODER__BLOCKS_MAX; i++)
Event_Construct(&p->writeEvents[i]);
#else
Event_Construct(&p->finishedEvent);
#endif
CriticalSection_Init(&p->cs);
CriticalSection_Init(&p->mtProgress.cs);
}
static void MtCoder_Free(CMtCoder *p)
{
unsigned i;
/*
p->stopReading = True;
if (Event_IsCreated(&p->readEvent))
Event_Set(&p->readEvent);
*/
for (i = 0; i < MTCODER__THREADS_MAX; i++)
MtCoderThread_Destruct(&p->threads[i]);
Event_Close(&p->readEvent);
Semaphore_Close(&p->blocksSemaphore);
#ifdef MTCODER__USE_WRITE_THREAD
for (i = 0; i < MTCODER__BLOCKS_MAX; i++)
Event_Close(&p->writeEvents[i]);
#else
Event_Close(&p->finishedEvent);
#endif
}
void MtCoder_Destruct(CMtCoder *p)
{
MtCoder_Free(p);
CriticalSection_Delete(&p->cs);
CriticalSection_Delete(&p->mtProgress.cs);
}
SRes MtCoder_Code(CMtCoder *p)
{
unsigned numThreads = p->numThreadsMax;
unsigned numBlocksMax;
unsigned i;
SRes res = SZ_OK;
if (numThreads > MTCODER__THREADS_MAX)
numThreads = MTCODER__THREADS_MAX;
numBlocksMax = MTCODER__GET_NUM_BLOCKS_FROM_THREADS(numThreads);
if (p->blockSize < ((UInt32)1 << 26)) numBlocksMax++;
if (p->blockSize < ((UInt32)1 << 24)) numBlocksMax++;
if (p->blockSize < ((UInt32)1 << 22)) numBlocksMax++;
if (numBlocksMax > MTCODER__BLOCKS_MAX)
numBlocksMax = MTCODER__BLOCKS_MAX;
if (p->blockSize != p->allocatedBufsSize)
{
for (i = 0; i < MTCODER__THREADS_MAX; i++)
{
CMtCoderThread *t = &p->threads[i];
if (t->inBuf)
{
ISzAlloc_Free(p->allocBig, t->inBuf);
t->inBuf = NULL;
}
}
p->allocatedBufsSize = p->blockSize;
}
p->readRes = SZ_OK;
MtProgress_Init(&p->mtProgress, p->progress);
#ifdef MTCODER__USE_WRITE_THREAD
for (i = 0; i < numBlocksMax; i++)
{
RINOK_THREAD(ArEvent_OptCreate_And_Reset(&p->writeEvents[i]));
}
#else
RINOK_THREAD(ArEvent_OptCreate_And_Reset(&p->finishedEvent));
#endif
{
RINOK_THREAD(ArEvent_OptCreate_And_Reset(&p->readEvent));
RINOK_THREAD(Semaphore_OptCreateInit(&p->blocksSemaphore, numBlocksMax, numBlocksMax));
}
for (i = 0; i < MTCODER__BLOCKS_MAX - 1; i++)
p->freeBlockList[i] = i + 1;
p->freeBlockList[MTCODER__BLOCKS_MAX - 1] = (unsigned)(int)-1;
p->freeBlockHead = 0;
p->readProcessed = 0;
p->blockIndex = 0;
p->numBlocksMax = numBlocksMax;
p->stopReading = False;
#ifndef MTCODER__USE_WRITE_THREAD
p->writeIndex = 0;
p->writeRes = SZ_OK;
for (i = 0; i < MTCODER__BLOCKS_MAX; i++)
p->ReadyBlocks[i] = False;
p->numFinishedThreads = 0;
#endif
p->numStartedThreadsLimit = numThreads;
p->numStartedThreads = 0;
// for (i = 0; i < numThreads; i++)
{
CMtCoderThread *nextThread = &p->threads[p->numStartedThreads++];
RINOK(MtCoderThread_CreateAndStart(nextThread));
}
RINOK_THREAD(Event_Set(&p->readEvent))
#ifdef MTCODER__USE_WRITE_THREAD
{
unsigned bi = 0;
for (;; bi++)
{
if (bi >= numBlocksMax)
bi = 0;
RINOK_THREAD(Event_Wait(&p->writeEvents[bi]))
{
const CMtCoderBlock *block = &p->blocks[bi];
unsigned bufIndex = block->bufIndex;
BoolInt finished = block->finished;
if (res == SZ_OK && block->res != SZ_OK)
res = block->res;
if (bufIndex != (unsigned)(int)-1)
{
if (res == SZ_OK)
{
res = p->mtCallback->Write(p->mtCallbackObject, bufIndex);
if (res != SZ_OK)
MtProgress_SetError(&p->mtProgress, res);
}
CriticalSection_Enter(&p->cs);
{
p->freeBlockList[bufIndex] = p->freeBlockHead;
p->freeBlockHead = bufIndex;
}
CriticalSection_Leave(&p->cs);
}
RINOK_THREAD(Semaphore_Release1(&p->blocksSemaphore))
if (finished)
break;
}
}
}
#else
{
WRes wres = Event_Wait(&p->finishedEvent);
res = MY_SRes_HRESULT_FROM_WRes(wres);
}
#endif
if (res == SZ_OK)
res = p->readRes;
if (res == SZ_OK)
res = p->mtProgress.res;
#ifndef MTCODER__USE_WRITE_THREAD
if (res == SZ_OK)
res = p->writeRes;
#endif
if (res != SZ_OK)
MtCoder_Free(p);
return res;
}
#endif

View file

@ -1,141 +0,0 @@
/* MtCoder.h -- Multi-thread Coder
2018-07-04 : Igor Pavlov : Public domain */
#ifndef __MT_CODER_H
#define __MT_CODER_H
#include "MtDec.h"
EXTERN_C_BEGIN
/*
if ( defined MTCODER__USE_WRITE_THREAD) : main thread writes all data blocks to output stream
if (not defined MTCODER__USE_WRITE_THREAD) : any coder thread can write data blocks to output stream
*/
/* #define MTCODER__USE_WRITE_THREAD */
#ifndef _7ZIP_ST
#define MTCODER__GET_NUM_BLOCKS_FROM_THREADS(numThreads) ((numThreads) + (numThreads) / 8 + 1)
#define MTCODER__THREADS_MAX 64
#define MTCODER__BLOCKS_MAX (MTCODER__GET_NUM_BLOCKS_FROM_THREADS(MTCODER__THREADS_MAX) + 3)
#else
#define MTCODER__THREADS_MAX 1
#define MTCODER__BLOCKS_MAX 1
#endif
#ifndef _7ZIP_ST
typedef struct
{
ICompressProgress vt;
CMtProgress *mtProgress;
UInt64 inSize;
UInt64 outSize;
} CMtProgressThunk;
void MtProgressThunk_CreateVTable(CMtProgressThunk *p);
#define MtProgressThunk_Init(p) { (p)->inSize = 0; (p)->outSize = 0; }
struct _CMtCoder;
typedef struct
{
struct _CMtCoder *mtCoder;
unsigned index;
int stop;
Byte *inBuf;
CAutoResetEvent startEvent;
CThread thread;
} CMtCoderThread;
typedef struct
{
SRes (*Code)(void *p, unsigned coderIndex, unsigned outBufIndex,
const Byte *src, size_t srcSize, int finished);
SRes (*Write)(void *p, unsigned outBufIndex);
} IMtCoderCallback2;
typedef struct
{
SRes res;
unsigned bufIndex;
BoolInt finished;
} CMtCoderBlock;
typedef struct _CMtCoder
{
/* input variables */
size_t blockSize; /* size of input block */
unsigned numThreadsMax;
UInt64 expectedDataSize;
ISeqInStream *inStream;
const Byte *inData;
size_t inDataSize;
ICompressProgress *progress;
ISzAllocPtr allocBig;
IMtCoderCallback2 *mtCallback;
void *mtCallbackObject;
/* internal variables */
size_t allocatedBufsSize;
CAutoResetEvent readEvent;
CSemaphore blocksSemaphore;
BoolInt stopReading;
SRes readRes;
#ifdef MTCODER__USE_WRITE_THREAD
CAutoResetEvent writeEvents[MTCODER__BLOCKS_MAX];
#else
CAutoResetEvent finishedEvent;
SRes writeRes;
unsigned writeIndex;
Byte ReadyBlocks[MTCODER__BLOCKS_MAX];
LONG numFinishedThreads;
#endif
unsigned numStartedThreadsLimit;
unsigned numStartedThreads;
unsigned numBlocksMax;
unsigned blockIndex;
UInt64 readProcessed;
CCriticalSection cs;
unsigned freeBlockHead;
unsigned freeBlockList[MTCODER__BLOCKS_MAX];
CMtProgress mtProgress;
CMtCoderBlock blocks[MTCODER__BLOCKS_MAX];
CMtCoderThread threads[MTCODER__THREADS_MAX];
} CMtCoder;
void MtCoder_Construct(CMtCoder *p);
void MtCoder_Destruct(CMtCoder *p);
SRes MtCoder_Code(CMtCoder *p);
#endif
EXTERN_C_END
#endif

1139
3rdparty/7z/src/MtDec.c vendored

File diff suppressed because it is too large Load diff

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