Commit graph

8358 commits

Author SHA1 Message Date
Gliniak
dfd450fcbb [UI] Slightly improved performance of on screen notifications and achievements 2026-03-15 00:08:29 +01:00
Adrian
3f74dfef10 [XAM] Improved gamertag validation 2026-03-14 23:47:45 +01:00
Gliniak
8ccf01d151 [UI] Update gamertag input field only on change
No need to validate gamertag every frame
2026-03-14 23:25:09 +01:00
Gliniak
d37c22aad0 [HID] Redesigned support for Portals
- Added hotplug support on Windows
- Added support for XamInputNonControllerGetRawEx & XamInputNonControllerSetRawEx
2026-03-14 23:01:38 +01:00
Herman S.
3b8debcf5b [Memory] Fix watch race condition causing crashes on Linux
When two threads fault on the same watched page, the second thread may
find the watch already cleared by the first. TriggerCallbacks returned
false in this case, leaving the SIGSEGV unhandled. Return true instead
so the instruction retries — the page is already unprotected.

This is the signal-safe equivalent of the QueryProtect check that
handles the same race on Windows. Fixes a regression from dbd58b.
2026-03-12 15:32:07 +09:00
Gliniak
5f62db9289 [Kernel] Added kHighFrequency for RtlInitializeCriticalSectionAndSpinCount 2026-03-11 19:54:19 +01:00
Gliniak
10f66a47f6 Revert "place locals on backend pages"
This reverts commit fe7dc26e3f.

Reason:
- It gives no real performance impact, but introduces issues
2026-03-11 19:50:32 +01:00
Herman S.
b24ea8ef99 [CPU/XThread] Add DWARF .eh_frame unwind info for JIT code on Linux
Generate per-function CIE+FDE records and register them via
__register_frame so the C++ exception unwinder can propagate through
JIT frames. Replace setjmp/longjmp fiber reentry with throw/catch
on Linux to ensure destructors and RAII guards run during fiber
stack switches.
2026-03-11 00:02:34 +09:00
Herman S.
f45a254774 [Linux/Threading] Self-suspend with condition variable instead of spin 2026-03-11 00:02:26 +09:00
Herman S.
9f8961c185 [XThread] Fix TLS pointer bug
Guest code may directly read the tls_address field from thread
structure to access TLS, and it expects the dynamic TLS area pointer
2026-03-11 00:02:16 +09:00
Herman S.
22f21fada9 [XThread] Replace guest exception handling with setjmp/longjmp 2026-03-11 00:01:35 +09:00
Herman S.
dac9883473 [Emulator] Add access violation details to crash dump messages 2026-03-10 23:55:50 +09:00
Herman S.
4a78428c6b [CPU] Skip QueryProtect in SIGSEGV handler on Linux
std::ifstream read of /proc/self/maps is not async-signal-safe and runs
on every access violation fault. Skip the race-condition check and go
straight to the callback, which handles cleared watches correctly.

Fixes severe performance issues seen in MFSMW, MCLA, etc.
2026-03-10 23:55:41 +09:00
Herman S.
6f18c98502 [Thread/Posix] Fix thread suspend deadlock
Replace std::mutex/condition_variable with sem_wait/sem_post for thread
suspension, as WaitSuspended is called from the SIGRTMIN signal handler
where pthread_mutex_lock is not async-signal-safe.
2026-03-10 23:55:27 +09:00
Herman S.
4f1394bbaa [Kernel/Threading] Fix some kernel threading issues
- broken atomic exchange on linux
- spinlock release memory buffer
- race in thread suspension
- removed misleading volatile qualifiers
2026-03-10 23:53:03 +09:00
Herman S.
c4bd0c3f33 [Testing] Inclrease timer test timeout and update default test targets
The threading test is verifying that the timer fires, not that it fires
within a specific timeout, so increasing to 100 to keep it from failing
randomly. Also removing xenia-cpu-ppc-tests from list of default targets
as they take forever to run, they can still be run run using xb test
with --target xenia-cpu-ppc-tests explicitly.
2026-03-10 16:49:41 +09:00
Herman S.
3585b6e592 [Kernel] Replace BCrypt RSA with portable bignum implementation
Removes the Windows-only BCrypt dependency from XeCryptBnQwNeRsaPubCrypt
and replaces it with a portable modular exponentiation implementation
using 64-bit arithmetic, enabling RSA signature verification on all
platforms. Adds Catch2 tests validating the implementation with a
2048-bit RSA key.
2026-03-10 16:20:38 +09:00
Herman S.
b15cd5b164 [Build] Add --build-tests and --cmake-define flags to xenia-build.py 2026-03-10 15:38:21 +09:00
Gliniak
d1ad597939 [GPU] Vulkan: Fixed FSI render target path
AlphaToMask was causing crashes on linux due to missing SelectionMerge
2026-03-09 21:52:00 +01:00
Gliniak
ce94f7fc03 [Base] Win-Style assertion on linux. No more forced termination while debugging 2026-03-09 19:40:20 +01:00
Herman S.
64e51c544e [GPU] Add vulkan shader disk storage / startup loading
Big refactor of the shader storage to allow both backends to share code
2026-03-10 00:49:56 +09:00
Herman S.
5845f3437b [GPU] Async shader compilation for D3D12 and Vulkan
Adds async_shader_compilation cvar (default true) that forces new
pipelines to be created async from the main thread, skips draws entirely
on D3D12 and on vulkan replaces pixel shader with placeholder until the
real one is ready. Causes some visual artifacts on first load but
greatly reduces load times and stutter.
2026-03-10 00:24:26 +09:00
Herman S.
ccf8fb66f5 [Vulkan] Add thread pool for async shader compilation
Uses priority queue with higher priority on shaders with visible
render targets
2026-03-10 00:21:10 +09:00
Herman S.
19c5401eda [GPU] Revert SPIR-V version back to 1.0 for internal shaders 2026-03-09 21:34:22 +09:00
Herman S.
50ef5c2691 [Kernel] Fix data race on XFile position 2026-03-09 16:14:22 +09:00
disjtqz
74ab7339a3 [CPU/Thread] setup r[2] constant value, only used by HV afaik 2026-03-09 14:20:10 +09:00
Herman S.
341d3b66a8 [Kernel] Thread safety fixes for xfile, xmutant, and xtimer objects 2026-03-09 14:15:14 +09:00
Herman S.
0efd3a9610 [APU] Move XmaContext::Block() to base class with RAII locking 2026-03-09 14:15:14 +09:00
Herman S.
b0a387c6ea [XboxKrnl] Don't crash the host on guest trap 2026-03-09 14:15:14 +09:00
Herman S.
9371e73d92 [APU] Fix audio crashes during shutdown 2026-03-09 14:15:14 +09:00
Herman S.
6203d382e2 [Kernel] Clear object handles before release in ObjectTable::Reset
During bulk teardown, objects still had stale handle entries when
Release() triggered their destructors, hitting the handles_.empty()
assertion.
2026-03-09 14:15:14 +09:00
Herman S.
a00fd0eb12 [Kernel] Remove some log spam 2026-03-09 14:15:14 +09:00
Herman S.
5ac07f686d [Xboxkrnl] Remove devkit memory access assert and replace with warning 2026-03-09 14:15:14 +09:00
Herman S.
341a735142 [x64] Fix vector mask issue and add missing tests 2026-03-09 14:15:14 +09:00
Herman S.
f41ea1296b [x64/Debug] Fix TrapDebugPrint to properly terminate string 2026-03-09 14:15:14 +09:00
Herman S.
7e0254b36c [CPU] Check for null when returning machine code ptr 2026-03-09 14:15:14 +09:00
Herman S.
bf6e1a81eb [Posix] Fix DeallocFixed crashes / memory leaks
BaseHeap::Dispose() walks the page table and calls
DeallocFixed(addr, 0, kRelease) for every allocated page region.
These addresses are within file-backed view mappings (i.e. guest memory).
On Windows, VirtualFree on file-mapped pages silently returns FALSE.
On POSIX, the code hit assert_always() and crashed. Changed to return false
to match Windows behavior.

Memory leaks from munmap(addr, 0):

Callers passed length=0 to DeallocFixed(kRelease). On Windows this works because
VirtualFree(addr, 0, MEM_RELEASE) means "release the entire region" — Windows
ignores the length parameter for MEM_RELEASE and always frees the whole
allocation. On POSIX, munmap(addr, 0) fails with EINVAL, so the memory was
silently leaked every time.
2026-03-09 13:43:56 +09:00
Herman S.
b7add3e0ec [CPU/PPC] Add Linux workaround for fdiv instruction format
On Linux, these instructions appear to use A format (FRA, FRB, FRT)
instead of the standard X format (RA, RB, RT). Need to verify if this
is needed on Windows or is Linux specific.
2026-03-09 13:43:56 +09:00
Herman S.
52297ea8f8 [Linux] Implement fast mutex similar to Windows version 2026-03-09 13:43:56 +09:00
Herman S.
92b07391df [Linux/Threading] change self-suspend to wait to be resumed 2026-03-09 13:43:56 +09:00
Herman S.
15483b02af [Memory] Linux cleanup shm files on exit
Prevents running out of /dev/shm space and crashing the whole system.
2026-03-09 13:43:56 +09:00
Herman S.
ae1706d1dc [Threads] Ensure proper RTTI/vtable emission for PosixWaitHandle 2026-03-09 13:43:56 +09:00
Herman S.
174d2d4205 [Posix Threading] Robust mutexes 2026-03-09 13:43:56 +09:00
Herman S.
1ae82023ea [Posix Threads] Refactored condition variables from static to per-instance members and replaced deadlock-prone predicate-based WaitMultiple with polling using try_lock. 2026-03-09 13:43:56 +09:00
Herman S.
c9eba5daf8 [Threading] Signal handler / self-suspension improvements 2026-03-09 13:43:56 +09:00
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