4063 Commits

Author SHA1 Message Date
KorewaWatchful 0244eae5a1 mem: split host/guest page sizes to support 16kib page devices 2026-04-25 13:33:53 -04:00
bookmist 0e9e3a2cf8 gui: custom config check now doesn't read disk on every frame 2026-04-24 16:51:42 +03:00
Zangetsu38 2f50abb528 gui/main menubar: Fix crash on exit by using SDL quit event.
- Using exit(0) skip the event loop, preventing the normal shutdown sequence.
gui/information bar: No disable it when setting dialog is open.
2026-04-24 00:55:50 +02:00
nishinji 3a86f6d1e6 modules/ngs: Fix ngs was not properly disabled when set to disabled (#3894)
Co-authored-by: nishinji <nishinji@users.noreply.github.com>
2026-04-23 10:22:14 -03:00
Zangetsu38 caf39d8918 gui/settings dialog: Complete UI redesign.
- Replaced the old ImGui tab-based layout with a cleaner switch-driven structure.
- The settings dialog now runs in full-screen mode with the app’s settings background image.
- Fixed an issue caused by buttons being too small in certain languages.
2026-04-22 23:32:53 +02:00
Zangetsu38 9916d8655f bgm_player: Decouple BGM player implementation from GUI.
- The BGM player was already standalone and the GUI only forwarded the calls.
- Fix inversed condition of resume bgm when back to live area.
2026-04-20 19:08:33 +02:00
Sergi (セルジ) 9bb15e0eb3 cpu: Move exclusive monitor entirely into Dynarmic backend 2026-04-18 13:08:23 -04:00
Sergi (セルジ) cafbb379c8 Fix integer arg spill layout 2026-04-18 13:08:05 -04:00
Sergi (セルジ) 2356890ae3 module/bridge: HLE compile-time dispatch, avoid extra pointer indirection
The HLE dispatching bridge is now a stateless lambda that the compiler generates per-export via a NTTP,
with the ARM calling convention layout computed at compile-time time so all register and
stack argument reads are resolved at compile time with no runtime dispatch.

Also replace std::function with a plain function pointer for ImportFn to
avoid possible heap-allocation and indirection.

Before: two functions, runtime dispatch, indirect call through captured fn ptr.
Example: `_sceKernelCancelEventFlag(SceUID event_id, SceUInt pattern, SceUInt32 *num_wait_thread)`

```
; std::_Function_handler::_M_invoke -- unwraps the std::function heap object
_ZNSt17_Function_handlerI...bridge<int,(int,uint,uint*)>...M_invoke...:
        pushq   %rax
        movq    (%rdi), %rdx            ; load captured state from heap
        movq    (%rdx), %rdi
        movq    8(%rdx), %rax           ; load captured export_fn ptr
        leaq    16(%rdx), %rcx          ; load captured args_layout ptr
        callq   _Z4call<int,(int,uint,uint*)>...
        retq

; call<> -- dispatches each arg through a runtime switch on arg.location
_Z4call<int,(int,uint,uint*)>...:
        movl    (%rdx), %eax
        cmpl    $1, %eax                ; arg[0]: gpr or stack?
        je      .stack_path_0
        testl   %eax, %eax
        jne     .done_0
        movq    8(%r14), %rsi
        callq   read_reg
        movl    16(%r14), %eax
        cmpl    $1, %eax                ; arg[1]: gpr or stack?
        je      .stack_path_1
        testl   %eax, %eax
        jne     .done_1
        movq    24(%r14), %rsi
        callq   read_reg
        movl    32(%r14), %eax
        cmpl    $1, %eax                ; arg[2]: gpr or stack?
        je      .stack_path_2
        testl   %eax, %eax
        jne     .done_2
        movq    40(%r14), %rsi
        callq   read_reg
        callq   *%r10                   ; indirect call through captured fn ptr
        jmp     write_return_value
```

After: single function with register indices hardcoded (generated at compile-time), direct call.

```
; make_bridge<&export__sceKernelCancelEventFlag>(...).__invoke
_ZZ11make_bridge<&export__sceKernelCancelEventFlag>...NUl...8__invoke...:
        xorl    %esi, %esi
        callq   read_reg                ; r0 -> SceUID (index 0, hardcoded)
        movl    $1, %esi
        callq   read_reg                ; r1 -> SceUInt (index 1, hardcoded)
        movl    $2, %esi
        callq   read_reg                ; r2 -> Ptr<SceUInt32> (index 2, hardcoded)
        callq   eventflag_cancel        ; direct call, resolved at compile time
        jmp     write_return_value
```
2026-04-18 13:08:05 -04:00
Macdu 34b8c1efcd audio: Increase SDL audio buffer size 2026-04-18 13:07:42 -04:00
Zangetsu38 c90728728f gui: Fix scroll all slider item in ScrollWhenDragging. 2026-04-18 13:10:45 +02:00
Zangetsu38 7cfe7cc229 gui/start screen: Fix open user with controller.
- Small refactor for blocking double click on button.
- Fix hide info bar when option is disable.
- Fix input is now also blocked on controller while the gate animation is playing.
2026-04-18 13:07:40 +02:00
Zangetsu38 5ad523fc9a gui/settings dialog: Add Custom audio backend. 2026-04-18 13:06:43 +02:00
Zangetsu38 30c8039664 audio/sdl: increase audio output prebuffer threshold on Android.
- Fix audio quality in android with sdl backend.
2026-04-17 15:13:43 +02:00
Sergi (セルジ) de3df2dd45 kernel/thread: Fix data race on to_do field
The previous fix (a93e009a) changed the inner do-while loop into a
while-at-top loop, checking exit conditions before the first
execution. But those conditions (res, hit_breakpoint, etc.) only
make sense after execution — checking them first caused the loop
to break immediately without executing any guest code (0 fps).

Restore do-while semantics: always execute at least once, then
check the loop condition under the mutex. The to_do read at the
top of each iteration (step vs run decision) and the exit
condition at the bottom are both protected by the mutex.

Also fix suspend() to hold the mutex before modifying to_do,
matching what resume() and exit_delete() already do.
2026-04-11 11:28:13 -04:00
Sergi・セルジ a52df7f4f1 Fix CPU/thread bugs (#3871)
* kernel/thread: Fix wrong SVC number passed to call_svc

cpu->svc_called (a bool, always 1) was passed instead of cpu->svc
(the actual SVC number). This meant debugger trampoline SVCs (0x53
and 0x54) could never be recognized, since the svc parameter was
always 1. The normal import path was unaffected because it reads
the NID from memory at pc+4, not from the SVC number.

Found by @imWatchful

* cpu/dynarmic: Fix stop() to actually halt JIT execution

stop() only set an exit_request flag that was never checked by
anything. This meant suspend() and exit_delete() could not
interrupt guest execution — the JIT kept running until it
happened to hit an SVC or exception. For tight guest loops
without SVCs, this could hang.

Replace with jit->HaltExecution() which is the Dynarmic API
for cross-thread execution interruption. Remove the unused
exit_request field.

* kernel/thread: Fix data race on to_do field

The inner execution loop in run_loop() reads and writes to_do
without holding the mutex, while exit_delete() and suspend()
modify it from other threads. This is a data race.

Restructure the inner loop so that every access to to_do is
under the mutex. The lock is acquired briefly to snapshot or
modify to_do, then released before guest execution. The lock
is held when the loop breaks out, matching the original post-loop
lock state.
2026-04-11 09:19:29 -04:00
nishinji 6ed8fbec09 vita3k/gui: Changed the BGM disabled by default 2026-04-08 09:00:36 -04:00
Zangetsu38 ba5c2029c9 gui/initial setup: Add Bgm setting options.
- Allow Disable and change volume of it during this first step.
- Change default volume to 65 % accorded to real hw.
- No restart emu anymore after finish this first step.
2026-04-06 18:53:25 +02:00
bookmist 3f29189bdb audio: fix crackling audio 2026-04-05 00:47:25 +02:00
bookmist 68220f6711 audio: Rewrite SDL backend to use condvar wait
modules/SceAudio: fix crackling audio, if empty buffer is used too often

Co-authored-by: eagleflo <aku.kotkavuo@gmail.com>
2026-04-04 13:56:50 +02:00
Dicot0721 e9769da5e8 mem&util/log: Bugfixes for log utils
- Avoid dereferencing the address of `si_addr` after converting it to `uint64 *`.
- Prohibit to use initialization expressions when using `LOG_XXX_IF`.
- Handle null exception pointer in terminate handler.
2026-04-04 13:04:15 +02:00
nishinji f1ce62af8a vita3k/io: Adjust the time by adding the UNIX epoch
- RtcTicksToPspTime expects the number of ticks since the year 1 AD
2026-04-04 13:01:50 +02:00
Kumiko7 f780c68abb ctrl: Added support for alternate key bindings for keyboard controls 2026-04-01 23:31:57 +03:00
Zangetsu38 0bf11b6995 shader/usse utilities: implement FX10 pack function for C10 format. 2026-04-01 16:05:24 +02:00
nishinji 23f07a73bc gui/allocations_dialog: Fixed Disassembly could not be opened with the correct address. 2026-04-01 13:19:19 +02:00
nishinji ea7d05f808 patch: slightly modified 2026-04-01 13:18:11 +02:00
ikhoeyZX 0f92954300 renderer/vulkan: fix deep stencil for powerVR. 2026-03-30 19:05:51 +02:00
Macdu 99694acd96 renderer: Fix renderer finish on vulkan without memory mapping (#3849) 2026-03-14 16:26:17 +01:00
Dicot0721 09d532ac13 renderer/vulkan: Change GPU priority
- Old: discrete > other.
- New: discrete > integrated > other.
2026-03-08 00:57:21 +01:00
Dicot0721 066ad61ad3 ci: Optimize Android build cache setup
- Restore vcpkg package cache before install packages.
- Separate Gradle cache and vcpkg package cache (for vcpkg android-x64).
2026-03-08 00:56:24 +01:00
olistarri 96b0b22b40 renderer/vulkan: Drain VK wait thread queue in sceGxmFinish (#3840)
* renderer/vulkan: Drain VK wait thread queue in sceGxmFinish

renderer::finish() only waited for the renderer command thread (via Nop),
but the VK wait thread that writes notification values after GPU fences
complete runs asynchronously. This caused a race where sceGxmFinish
returned before all notifications were written, allowing late writes to
overwrite values the game expected to be final (e.g. display callback
resets to 0), resulting in deadlocks during scene transitions.

* renderer/vulkan: Address review comments for VK wait thread drain

- Push a dummy CallbackRequest before wait_empty to ensure the last
  request on the queue has been fully processed, not just dequeued
- Use static_cast instead of reinterpret_cast
2026-03-07 17:15:52 +01:00
Zangetsu38 328a79dee1 gui/app_context: Add menu item to decrypt all SELF file of the app.
package/sce_utils: Some refactor on decrypt fself.
2026-03-01 15:34:29 +01:00
dependabot[bot] c4a097bfec build(deps): bump the ci-deps group with 2 updates
Bumps the ci-deps group with 2 updates: [actions/upload-artifact](https://github.com/actions/upload-artifact) and [actions/download-artifact](https://github.com/actions/download-artifact).


Updates `actions/upload-artifact` from 6 to 7
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v6...v7)

Updates `actions/download-artifact` from 7 to 8
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v7...v8)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ci-deps
- dependency-name: actions/download-artifact
  dependency-version: '8'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ci-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-01 07:25:41 +01:00
Aku Kotkavuo e96ca869dc audio: Return early from audio_output with null buf 2026-02-25 23:56:59 +03:00
bookmist 276bfaffd4 renderer: fix immediate OpenGL crash on unusual/virtualized GPUs 2026-02-25 18:23:56 +03:00
bookmist 45b77ff683 build: install dependencies from SDL3 readme (#3837) 2026-02-24 12:26:42 -03:00
双子叶植物 7cacb002e3 Revert "renderer/vulkan: Change the automatic detection order of GPUs"
This reverts commit 32ac86a3a9.
2026-02-23 17:30:28 +01:00
Dicot0721 32ac86a3a9 renderer/vulkan: Change the automatic detection order of GPUs
- The first GPU is usually the best one, so searching backward ensures the first one is used when there is no discrete GPU.
2026-02-22 07:10:00 +01:00
bookmist ad481fd0f7 gui: settings_dialog/debug: Add "Select all" toggle for Tracy modules list 2026-02-21 20:06:31 +03:00
nishinji f52f6e0899 .github/workflows: use sccache 2026-02-19 17:33:50 +01:00
Dicot0721 3b42fa3587 gui/settings_dialog: Fix incorrect IP addresses display
- If after 'emplace_back()' the new 'size()' is greater than old 'capacity()' a reallocation takes place, in which case all references to the elements are invalidated.
2026-02-16 14:52:08 +01:00
Pedro Montes Alcalde 98f2267789 ci: Use ghr action instead of bash script (#3826)
Co-authored-by: 双子叶植物 <149964080+Dicot0721@users.noreply.github.com>
2026-02-15 21:09:37 +01:00
nishinji 733796acd1 gui/app_context_menu: Disable the report creation function 2026-02-15 21:07:13 +01:00
Aku Kotkavuo ec76b0c98b mem: Add most_restrictive_perm inside add_protect 2026-02-13 05:01:46 +01:00
Aku Kotkavuo 1286ff85cf renderer/vulkan: Add dirty flag to ColorSurfaceCacheInfo
While investigating #2733, I noticed that Vita3K would render an
_ancient_ frame from a previous scene transition (with a red hue)
whenever a new scene transition occurred.

This happens because `surface_cache` includes a stale texture from the
previous transition. By adding a `dirty` flag to the cache entries by
trapping writes to texture memory we can skip the `surface_cache` for
stale textures and pass through to `texture_cache` instead.

Also, set `can_mprotect_mapped_memory` if using double buffering.

Fixes #2733.
2026-02-13 05:01:46 +01:00
Zangetsu38 3936b6cf03 gui/settings: implement option to allow disable bgm.
- With small refactor.
2026-02-12 22:18:27 +01:00
Dicot0721 10df77a19b util: Optimize usage of Boost Describe
- Optimize the commit 73f05100.
2026-02-11 20:32:58 +03:00
nishinji 1167cb63ac vita3k: add some SDL_Error log 2026-02-04 17:03:52 +01:00
Zangetsu38 9b6a0089d1 external: fix link for prebuild of openssl. 2026-02-04 15:37:52 +01:00
Dicot0721 3a9cbd0cde external: Update Android Vulkan validation layer to SDK v1.4.341.0
- To support Android 16 & 16 KB page sizes.
2026-02-04 14:31:40 +01:00