Commit graph

8313 commits

Author SHA1 Message Date
Herman S.
137baa2b9f [Kernel] Ensure file mutex is initialized 2026-03-09 13:43:56 +09:00
Herman S.
81dd887e74 [Kernel] Thread suspend for posix to match windows semantics 2026-03-09 13:43:56 +09:00
Herman S.
32b8c341ee [Kernel] ReleaseSemaphore for Posix to match Windows semantics 2026-03-09 13:43:56 +09:00
Herman S.
28e48410c5 Fix potential buffer overflow in posix memory handling 2026-03-09 13:43:56 +09:00
Herman S.
bc3585d0ef Keep threads from trying to suspend themselves on Linux
Avoids certain sporadic lockups (usually on startup)
2026-03-09 13:43:56 +09:00
Herman S.
37fabb9346 [GPU] Ensure vsync works correctly on Linux.
Linux scheduler quantum is 4-10ms so requesting 15ms sleep ends
up sleeping 16-19ms and overshoots our target causing games to run
at 57fps
2026-03-09 12:41:53 +09:00
Herman S.
9a704bff1e Fix menu hotkeys on Linux 2026-03-09 09:41:47 +09:00
Herman S.
02fccd9113 [Kernel/XMP] Add title-specific file I/O hooks for XMP volume sync
Some games persist BGM volume through their own save files but never
call XMPSetVolume. Add a TitlePatch system that intercepts NtReadFile/
NtWriteFile to apply game-specific logic as well as logic to identify
the memory location that the volume data is read into and monitor that
memory location for changes, updating XMP player volume if it changes
during gameplay.

Includes patches for known games with this issue:
Dead or Alive Xtreme 2 (544307D2), PGR4 (4D5307F9) and PGR3 (4D5307D1)
2026-03-09 08:59:15 +09:00
Gliniak
54400cbc2c [Build] Integration with CLion 2026-03-08 22:01:06 +01:00
Gliniak
6dfb323fe6 [Cmake] Filter Configuration presets. This removes VS preset visibility on linux 2026-03-08 16:52:50 +01:00
Herman S.
77535b7cec [Base] Replace CRITICAL_SECTION with SRWLOCK based mutexes
xe_fast_mutex now also asserts on recursive lock attempts
2026-03-09 00:19:32 +09:00
Herman S.
de63bb18a6 [Base] Use function-local static for global_mutex
File-scope static initialization order is undefined across translation
units. Code that acquires the global critical region during early startup
could run before the mutex constructor, operating on uninitialized state.
A function-local static is constructed on first use, guaranteeing the
mutex is initialized before any caller can access it.
2026-03-09 00:18:08 +09:00
Herman S.
eb914ae77d [Kernel] Return null on handle type mismatch instead of asserting 2026-03-09 00:07:45 +09:00
Gliniak
b5a7767aae [XAM] Added some missing user settings.
Names put according to findings in: 54510896
2026-03-07 23:39:39 +01:00
Gliniak
9e5fc57f66 [Cmake] Added directory tree to VS solution.
This recreates structure from premake almost 1:1
2026-03-07 20:26:45 +01:00
Gliniak
6bb5453110 [Build] Removed hardcoded generator for VS2022
Thanks tam098782
2026-03-07 20:24:16 +01:00
Herman S.
a26bbaa674 [3PP] Update FFmpeg version to include latest updates 2026-03-07 20:08:00 +09:00
AllanCat
10cecae4c2 [XMA] Fixed min output space gating to match Consume() write granularity
The decoder gate required a full frame of free blocks (4 mono / 8 stereo +
padding) before allowing a decode pass, but Consume() only writes
subframe_decode_count blocks per call. Games like TGM Ace with
subframe_decode_count=2 on a small ring buffer could never meet the old
threshold, causing a permanent decoder stall.
2026-03-07 11:46:21 +09:00
AllanCat
e8263d3672 [XboxKrnl/Audio] Corrected XMASetLoopData's pointer type.
Fixed an issue where bgm was not looping for games that uses looping feature.
2026-03-07 11:02:23 +09:00
Gliniak
4b0007bfe5 [XMP] Fixed error caused by incorrect audio allocation for FFMPEG 2026-03-06 20:48:25 +01:00
Gliniak
6446150a5e [Cmake] Moved tests to separate folders 2026-03-06 19:59:38 +01:00
Herman S.
2912da02fe [D3D12] Fix gamma_unorm16 render target transfer shaders
Gamma stored as R16G16B16A16_UNORM is 64bpp in host memory but
represents a single 32bpp pixel, unlike true 64bpp formats which pack
two 32bpp pixels together. Separate dest_is_gamma_unorm16 from
dest_is_64bpp to avoid incorrect coordinate transforms.

Add output paths for gamma_unorm16 destinations:
- gamma→gamma: direct passthrough (already linear in R16G16B16A16)
- k_8_8_8_8→gamma: convert gamma-encoded source to linear
- Cross-format packed EDRAM: midpoint encoding to survive UNORM16
  quantization round-trip through PreSaturatedLinearToPWLGamma

Fixes red bleeding in Halo Reach, image halving in Just Cause 2,
Portal not rendering, and black rock/plant textures in Halo Reach.
2026-03-06 23:05:39 +09:00
Herman S.
65d42843b6 Merge remote-tracking branch 'xenia-master/master' into canary_experimental 2026-03-06 23:05:24 +09:00
Herman S.
086decfa6e [Build] Enable test discovery in VS Test Explorer 2026-03-05 16:18:23 +09:00
Herman S.
16d2cc05c5 [GPU] Use UNorm not signed EDRAM encoding in k_16_16 resolve packing.
The original commit (2eea146b) correctly added kXenosFormat_16_16_EDRAM
case labels and fixed the unpack clamp from -1.0 to -32.0, but
incorrectly changed the resolve pack functions from UNorm to signed EDRAM
encoding. The resolve destination is a regular texture sampled as UNorm
[0,1], not EDRAM. Using EDRAM packing double-encodes the [-32,32]
scaling, crushing all values by ~64x and caused visual issues
particularly in UE3 titles.

The bytecode submitted with the change was actually correct, but the
source had additional incorrect pieces that only manifested when shaders
were rebuilt.
2026-03-05 15:11:22 +09:00
Herman S.
545b8bb8e9 [Docs] Add spirv-tools related installation info for linux 2026-03-05 09:41:56 +09:00
Gliniak
e576f3d924 [Cmake] Added directory split in Visual studio (and probably other IDEs)
Back as it was:
- src
- third_party

There is CmakePredefinedTargets, but it cannot be hidden
There is also an issue with tests as they aren't visible
2026-03-04 20:12:09 +01:00
Herman S.
a1710699cd [UI] Fix use-after-free in NoProfileDialog when closing 2026-03-04 20:58:00 +09:00
Herman S.
4bd93883ac [Build] Convert buildshaders to custom build rules 2026-03-04 20:57:42 +09:00
Herman S.
a09292c98f [Build] Fix VS to send Debug build output to the same place as Ninja 2026-03-04 20:57:41 +09:00
Gliniak
2de05ef1c1 [3PP] Removed reference to premake modules 2026-03-04 11:57:55 +01:00
Herman S.
71c5702ee8 [Build] Convert build system to raw cmake and remove premake layer 2026-03-04 17:37:36 +09:00
Ylederman153
f1bfb9416d
[Build] Remove /all_resources_bound from FXC shader compilation flags (#901)
The /all_resources_bound flag alters the generated DXBC bytecode by changing dcl_globalFlags, register allocation and instruction scheduling. This causes rendering artifacts (blue lightning/flash glitches) at scaled draw resolutions. The other FXC flags (/O3, /Qstrip_*, /Gfp) are retained as they do not affect the executable shader bytecode.
2026-03-04 13:49:27 +09:00
Herman S.
4757ab0931 [APU] Fix ffmpeg upgrade related logspam 2026-03-04 13:05:37 +09:00
Herman S.
cd5df622a9 [3PP] Switch FFmpeg to latest release with port of xmaframes codec
And pull out all the xenia specific build junk into
third_party/ffmpeg-xenia rather than keeping it checked in the
submodule
2026-03-04 13:05:31 +09:00
Herman S.
d6ed83f1ea [Build] Ensure shaders are generated on devenv 2026-03-04 10:14:40 +09:00
Herman S.
3a54274076 [Docs] Add VulkanSDK dependency 2026-03-04 10:04:54 +09:00
Adrian
a7f1a3f18a [XAM] Added profile and create content enumerator wrappers 2026-03-03 22:31:42 +01:00
Adrian
54be3c57a0 [XAM] Validate buffer_size limit in XamEnumerate 2026-03-03 22:31:42 +01:00
Adrian
8351eec1ec [APP] Fixed potential conflicting ImGUI ID in profile menu 2026-03-03 21:19:54 +01:00
Herman S.
dbfe216754 [Vulkan] Implement extended range for f32 to f16 conversion in memexport 2026-03-03 17:16:37 +09:00
Ylederman153
02c6bc6e61 [D3D12] Implement extended range for f32 to f16 conversion in memexport (#899)
Resolves TODO(Triang3l) by implementing a mathematical workaround to allow exponent 31 for extended float16 range up to +/-131008.0f as expected by the native Xbox 360 hardware, bypassing standard D3D12 f32tof16 boundaries which incorrectly clamp/inf values.
2026-03-03 17:16:05 +09:00
Herman S.
f2ac39cfd9 [Build] Generate shaders on build instead of having them checked in 2026-03-03 16:21:30 +09:00
Ylederman153
2eea146b1b [GPU] Fix k_16_16 and k_16_16_16_16 EDRAM packing clamping (#898)
Replaces the UNorm packing functions with custom Edram functions to preserve the native [-32.0, 32.0] float range and scale mathematically instead of using saturate(). Fixes displaced water meshes in games like Mercenaries 2.
2026-03-03 14:27:04 +09:00
Herman S.
48111e8fba [D3D12] Fix device lost with resolution scaling in 3D-as-2D textures 2026-03-01 16:41:50 +09:00
Adrian
d4b295a578 [XAM] Fixed memcpy in XamProfileFindAccount 2026-02-28 22:45:32 +01:00
Adrian
b1aa0de766 [UI] Extend ImGUI glyph ranges 2026-02-27 21:23:51 +01:00
Herman S.
125b4c8c05 [GPU] Ensure force_special_view checks swizzle signs before using signed
This was causing unnecessary logspam in Blue Dragon due to
incorrectly trying to request signed when the fetch constants are
unsigned
2026-02-26 14:36:08 +09:00
Herman S.
0c8d1b763f [D3D12] Pre-create 3D-as-2D textures before draw setup 2026-02-26 14:22:46 +09:00
Herman S.
0e2967cdb0 [D3D12] Fix 3D-to-2D texture crash under Wine/VKD3D 2026-02-26 14:22:46 +09:00