Commit Graph

27261 Commits

Author SHA1 Message Date
Zephyron
2e739c8692 service/am: Implement friend invitation storage channel
Implements TryPopFromFriendInvitationStorageChannel to properly handle
friend invitation data storage and retrieval. This includes:

- Add ResultNoData error code to am_results.h
- Add friend_invitation_storage_channel storage queue to Applet struct
- Implement proper data handling in TryPopFromFriendInvitationStorageChannel

The implementation now properly manages a queue of friend invitation data
and returns appropriate results based on data availability.
2025-05-11 12:17:03 +01:00
Zephyron
ea4ff742ce discord: Improve game image handling and UI presentation
Updates the Discord Rich Presence implementation to use Tinfoil's media
server for game images and improves the overall presentation.

Technical changes:
- Switch to Tinfoil media server for game images
- Add proper title ID handling and display
- Improve error handling for image requests
- Increase network timeout to 10 seconds
- Cache URL to prevent string destruction
- Update Discord client ID
- Clean up code formatting and organization

UI/UX improvements:
- Remove title ID from game state display
- Update default text to be more descriptive
- Improve error logging for failed image fetches
- Maintain image persistence between updates

This change provides better game image support and a cleaner Discord
presence display while improving reliability of the integration.
2025-05-11 12:17:03 +01:00
Zephyron
78067cf62f common: Use consistent cache line size in RingBuffer
Replace hardcoded 128-byte alignment with a defined CACHE_LINE_SIZE constant
of 64 bytes for the atomic indices in RingBuffer. This value is more
appropriate for most modern CPU architectures and simplifies the
implementation by using a consistent value regardless of compiler support
for hardware_interference_size.

Changes:
- Add CACHE_LINE_SIZE constant set to 64 bytes
- Use CACHE_LINE_SIZE for atomic index alignment in both code paths
- Remove outdated TODO comment about hardware_destructive_interference_size
2025-05-11 12:17:03 +01:00
Zephyron
f1afe954ec nvdrv: Fix incorrect IoctlZbcSetTable structure size assertion
Resolves a build failure caused by a mismatch between the defined and expected size of the `IoctlZbcSetTable` structure in `nvhost_ctrl_gpu`. The `static_assert` incorrectly expected the size to be 44 bytes, while the actual size was 48 bytes.

Changes include:
- Updated `static_assert` to correctly reflect the 48-byte size of `IoctlZbcSetTable`.
- Verified packing and alignment to ensure compliance with hardware specifications.
- Reviewed and confirmed correctness of `u32` type definitions.

This fix addresses a regression introduced in commit 9be4bf9aa5, which implemented ZBCSetTable functionality, and ensures successful compilation and adherence to the ZBC table implementation's design.
2025-05-11 12:17:03 +01:00
Zephyron
de5f95c477 nvdrv: Implement ZBCSetTable functionality
Implements basic Zero Bandwidth Clear (ZBC) table support in nvhost_ctrl_gpu.
This adds storage and validation for both color and depth clear values,
replacing the previous stub implementation. ZBC is a hardware optimization
technique used by NVIDIA GPUs to efficiently handle buffer clearing operations.

Changes include:
- Added ZBC table storage structures
- Implemented parameter validation
- Added separate handling for color and depth modes
- Improved debug logging
- Added documentation explaining ZBC functionality
2025-05-11 12:17:03 +01:00
Zephyron
57fee6e570 core: Add support for 10GB and 12GB memory configurations
- Add Memory_10Gb and Memory_12Gb to MemoryLayout enum
- Update memory layout settings to support up to 12GB
- Add SMC enums for 10GB and 12GB memory sizes and arrangements
- Increase MainMemorySizeMax from 8GB to 12GB
- Add memory pool size calculations for 10GB and 12GB configurations
- Update UI translations for new memory options
2025-05-11 12:17:03 +01:00
Zephyron
8c4ab7cd0e submodules(vcpkg): Update To Latest Commit 2025-05-11 12:17:03 +01:00
Zephyron
bb334b4307 Audio Core: Add support tags for compressor stats and volume reset
Added two new audio feature support tags with their corresponding revision
numbers:
- AudioCompressorStatistics (rev 16): For tracking compressor statistics
- AudioVolumeResetSupport (rev 17): For volume reset functionality

These features align with the documented Nintendo Switch audio service
capabilities and maintain compatibility with the existing feature support
system.
2025-05-11 12:17:03 +01:00
Zephyron
53be20f4ea buffer_cache: Fix storage buffer memory validation and size detection
Fixes the StorageBufferBinding function to properly handle memory validation
and size detection. Key changes include:

- Fix ReadBlock usage to properly handle void return values
- Implement safer memory validation using byte-level reads
- Improve size detection logic for storage buffers
- Fix NVN buffer size reading
- Add proper bounds checking for device memory addresses
- Add better error logging for invalid conditions

This addresses the "Failed to find storage buffer for cbuf index 0" errors
by implementing more robust memory validation and size detection. The changes
ensure proper handling of invalid memory addresses and prevent crashes from
accessing out-of-bounds memory.
2025-05-11 12:17:03 +01:00
Zephyron
001e337260 arm: Skip duplicate consecutive addresses in backtrace output
Adds logic to track and skip duplicate consecutive addresses when logging
backtraces. This improves log readability by removing redundant entries
that point to the same address in sequence.
2025-05-11 12:17:03 +01:00
Zephyron
b0d4e76b0a impl(Multiplayer): Switched API To Enable Multiplayer 2025-05-11 12:17:03 +01:00
Zephyron
47d0548557 vulkan: Update To 1.4.304 2025-05-11 12:17:03 +01:00
Zephyron
8830df1b9f video_core: Enforce safe memory reads for compute dispatch
- Modify DmaPusher to use safe memory reads when handling compute
  operations at High GPU accuracy
- Prevent potential memory corruption issues that could lead to
  invalid dispatch parameters
- Previously, unsafe reads could result in corrupted launch_description
  data in KeplerCompute::ProcessLaunch, causing invalid vkCmdDispatch
  calls
- By enforcing safe reads specifically for compute operations, we
  maintain performance for other GPU tasks while ensuring compute
  dispatch stability

This change requires >= High GPU accuracy level to take effect.
2025-05-11 12:17:03 +01:00
Zephyron
ed96014ce3 shader_recompiler: Fix ISBERD instruction implementation
- Simplify ISBERD instruction to handle register-to-register moves
- Remove incorrect CompositeConstruct usage
- Replace with direct register value passing
- Fix compilation errors in internal stage buffer handling
2025-05-11 12:17:03 +01:00
Zephyron
25b6629f66 shader_recompiler: Use FPRecip in FSWZADD implementation
Simplifies the negative reciprocal calculation in FSWZADD by using the
dedicated FPRecip operation instead of manually constructing a division.
This change:

- Replaces FPDiv(Imm32(f32(1.0f)), src_b) with FPRecip(src_b)
- Results in more efficient code for calculating 1.0/x
- Fixes build errors from undefined IR emitter methods
2025-05-11 12:17:03 +01:00
Zephyron
729c65618c shader_recompiler: Fix method names in FSWZADD implementation
Fixes incorrect method names in the floating point swizzled add implementation:
- FNeg -> FPNeg
- FDiv -> FPDiv
- FImm32(1.0f) -> Imm32(ir.f32(1.0f))

These changes align with the correct IR emitter interface naming conventions,
where floating-point operations use the 'FP' prefix and immediate values are
properly constructed using f32().
2025-05-11 12:17:03 +01:00
Zephyron
810572fdbb shader_recompiler: Implement ISBERD instruction
Implements the Internal Stage Buffer Entry Read (ISBERD) instruction in the
Maxwell shader recompiler. This replaces the previous stubbed implementation
with actual buffer reading functionality.

The implementation:
- Validates unsupported features (skew, o, mode, shift)
- Performs buffer read using IR::InternalStageBufferRead
- Stores the read value to the destination register

This removes the "(STUBBED) called" warning messages that were previously
being logged during shader compilation.
2025-05-11 12:17:03 +01:00
Zephyron
4b1aa6ce74 shader_recompiler: Implement ISBERD instruction modes and shifts
Implements the ISBERD (Internal Stage Buffer Entry Read) instruction's
mode and shift options that were previously throwing NotImplemented
exceptions. This includes:

- Patch mode for reading patch data
- Prim mode for reading primitive data
- Attr mode for reading attribute data
- U16 shift for 16-bit unsigned values
- B32 shift for 32-bit values

The implementation follows Maxwell's ISA specification for handling
different buffer read modes and data shifts.
2025-05-11 12:17:03 +01:00
Zephyron
feac7a4b49 audio_core: Add comprehensive audio feature support tags
Added new feature support tags to track audio functionality across firmware
versions. Changes include:

- Added Audio Out/In Auto buffer support tags (3.0.0+)
- Added Final Output Recorder features including work buffer (3.0.0+, 9.0.0+)
- Added Audio Renderer features like manual execution and voice drop
- Added Audio Device features including notifications and auto volume
- Added Hardware Opus decoder features including large frame support
- Added System Audio features like master volume and hearing protection

This provides more complete feature detection for audio functionality
introduced in firmware versions 3.0.0 through 19.0.1.
2025-05-11 12:17:03 +01:00
yuzubot
f4b721ac06 "Merge Tagged PR 13018" 2025-05-11 12:17:03 +01:00
Mike Lothian
b9dbc79659 externals: Update dynarmic to 6.7.2 2025-05-11 12:17:03 +01:00
Mike Lothian
94e793150a Pass optimisations to CMake via build.gradle.kts
This passes compiler flags from Gradle to CMake
2025-05-11 12:17:03 +01:00
Mike Lothian
150f59256b Qt6 no longer requires these 2025-05-11 12:17:03 +01:00
Mike Lothian
8c7ffef57d Update libadrenotools 2025-05-11 12:17:03 +01:00
Mike Lothian
eadbf00fdb Remove old links 2025-05-11 12:17:03 +01:00
Mike Lothian
e2da935917 Boost: Fix building against Boost 1.88.0 2025-05-11 12:16:29 +01:00
Mike Lothian
8874d08d3e Boost: Fix building against Boost 1.87.0 2024-12-20 15:24:58 +00:00
Andrew Udvare
c403a0027e Boost: Fix building against Boost 1.86.0 2024-12-20 15:24:58 +00:00
Zuckerwatte1
30cf1e08c5 Add 12gb DRAM option (#90)
This adds the option to allow the emulator to use 12gb of RAM for something like really big texture packs.

Co-authored-by: smiRaphi <neogt404@gmail.com>
Reviewed-on: http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu/pulls/90
Co-authored-by: Zuckerwatte1 <zuckerwatte1@noreply.localhost>
Co-committed-by: Zuckerwatte1 <zuckerwatte1@noreply.localhost>
2024-12-20 15:24:58 +00:00
EmulationEnjoyer
f2bb52a22a shader/recompiler: Revert NVN storage buffer bias range
- Return to original NVN bias values which better cover the full range of storage buffer accesses:
- offset_begin: 0x110 -> 0x100
- offset_end: 0x610 -> 0x700

The wider range ensures we catch all valid storage buffer accesses
while maintaining the same alignment requirements.

ref: 2564e721df
2024-12-20 15:24:58 +00:00
EmulationEnjoyer
65202006a2 arm: Skip duplicate consecutive addresses in backtrace output
ref: aa56430f2a
2024-12-20 15:24:58 +00:00
EmulationEnjoyer
a8405749cb chore(HLE): Update HLE API version constants
- Updated Horizon OS version to 19.0.1 and NintendoSDK version to 1.0. Adjusted `VERSION_HASH`, `DISPLAY_VERSION`, and `DISPLAY_TITLE` to match the new firmware versions.

ref: fcb6444037
2024-12-20 15:24:58 +00:00
EmulationEnjoyer
3f6fbc21a6 perf(VideoCore): Refactor DispatchIndirect
- Added automatic safe or unsafe processing for better emulation accuracy.

ref: 8cae0310e3
2024-12-20 15:24:58 +00:00
EmulationEnjoyer
2fbd6346f9 feat(shader): implement geometry shader invocation info
- Update EmitInvocationInfo in SPIRV backend to handle geometry shader stage

ref: 1266fad681 (diff-4cbf73a98ed4ad649a4a6f38b569bc31fcf68cf7)
2024-12-20 15:24:58 +00:00
EmulationEnjoyer
8f4e5de1a4 core: Add new error modules to ErrorModule enum
- Add support for homebrew error modules to improve error handling
2024-12-20 15:24:58 +00:00
EmulationEnjoyer
84c4150886 Update src/audio_core/common/feature_support.h
Updated AudioCore Revision from 11 -> 13
2024-12-20 15:24:58 +00:00
EmulationEnjoyer
f0d0c16733 feat: update HLE API version constants to Horizon OS 19.0.0
- Updated Horizon OS version constants from 12.1.0 to 19.0.0.
- Changed the version hash from `76b10c2dab7d3aa73fc162f8dff1655e6a21caf4` to `52971eebbba7ab9e6e23d73753aa63e0c3794b16`.
- Updated `DISPLAY_TITLE` and `DISPLAY_VERSION` to reflect the new firmware version "NintendoSDK Firmware for NX 19.0.0-4.0".
- Incremented Atmosphere release version constants to 1.8.0.

ref: 3276bf8780
2024-12-20 15:24:58 +00:00
anon
f0ec85c514 dma_pusher.cpp: remove now unused variable that breaks the android build (#76)
Completes http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu/pulls/71

Discovered when building android version on debian via command line.

Reviewed-on: http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu/pulls/76
Co-authored-by: anon <anon@noreply.localhost>
Co-committed-by: anon <anon@noreply.localhost>
2024-12-20 15:24:58 +00:00
lui
b76a6a79bc externals: update fmt to 11.0.2 and vcpkg to 2024.09.30 (#68)
Updated to fmt 11 with the required source changes for it to work.

Also updated vcpkg for this, and as an added benefit it fixes the `Unable to find a valid Visual Studio instance` error, and the VS 2019 build tools are no longer required. Just make sure to delete the existing downloaded vcpkg tool and binaries in `externals/vcpkg` if you have compiled before, or else it will continue to use the old version and give the error.

Reviewed-on: http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu/pulls/68
Co-authored-by: lui <lui@vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion>
Co-committed-by: lui <lui@vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion>
2024-12-20 15:24:58 +00:00
cow
6179cc0588 kepler_compute: use safe memory read
If unsafe read is done there can sometimes be corrupt data in the
KeplerCompute::ProcessLaunch qmd structure.

Fixes GPU crashes in 'Princess Peach: Showtime!' when using vulkan
renderer. Requires using "Accuracy Level High" (crashes will still
happen if using "Normal").

Tested on Radeon 6750XT, Linux 6.11.2, Mesa 24.2.5 (RADV driver).

Unsafe read was introduced in 115792158d
"VideoCore: Implement DispatchIndirect"

How did I debug this:
- Used VK_LAYER_KHRONOS_validation which found invalid vkCmdDispatch
  (along with a lot of other noise!)
- Instrumented all calls to vulkan Dispatch(), set breakpoint when
  grid_dim_x > 1024 (an obviously invalid value). Found dispatch came
  from RasterizerVulkan::DispatchCompute().
- Commented out DispatchCompute() entirely, game runs with no crashes
  but some graphics effects are missing.
- Keep going one layer up, observe corrupted `launch_description` in
  KeplerCompute::ProcessLaunch()
- Attempted safe ReadBlock (`which = VideoCommon::CacheType::All`)
  instead of ReadBlockUnsafe in KeplerCompute::ProcessLaunch(), did not
  help
- Go one layer up to DmaPusher. Switch to safe_process(). No more
  corrupt `launch_description`.
2024-12-20 15:24:58 +00:00
anon
dd0f9e32bc Remove "/DEBUG" flag from CMAKE_EXE_LINKER_FLAGS_RELEASE
lol, has the emulator been running in a slower debug mode, even in release builds, ever since it was yuzu? This has been there since 4176. I was wondering why *.pdb debugging files still get generated.
2024-12-20 15:24:58 +00:00
lui
bbcd39bc19 configuration: break up tooltip for 'VRAM Usage Mode' into multiple lines 2024-12-20 15:24:58 +00:00
lui
d9004884ab configuration: increase default height of per-game configuration window 2024-12-20 15:24:58 +00:00
lui
c1c5100eb0 configure_graphics: use stylesheet for background button color
Keeps things consistent with the color picker from d6ca4f11c1 and joycon color picker buttons
2024-12-20 15:24:58 +00:00
Samuliak
80d83abcf3 mark format functions as const 2024-12-20 15:24:58 +00:00
lui
6dbbe4225b renderer: add area sampling scaling method (#57)
Adds Area Sampling to the list of scaling options. Works well to achieve a high-quality, smooth super-sampling effect. Dolphin has had this for a while, and now Ryujinx has recently added it too, so I decided to port it.

Not sure if adding the extra uniform to the OpenGL WindowAdaptPass was a good idea or not, or if using the push constants under Vulkan was either, but I wasn't sure about the best way to get the window size for use in the shader, and other scaling methods still work fine. Implementation seems to work fine under both Vulkan and OpenGL, but might still need some minor tweaks to the shader. Should definitely do some testing before merging, I have tested on an Nvidia RTX 3080 under Windows.

Adapted from these two PRs:
https://github.com/Ryujinx/Ryujinx/pull/7304
https://github.com/dolphin-emu/dolphin/pull/11999

Reviewed-on: http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu/pulls/57
Co-authored-by: lui <lui@vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion>
Co-committed-by: lui <lui@vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion>
2024-12-20 15:24:58 +00:00
lui
d65c49bc79 profile_manager: Implement firmware avatar selector (#56)
Adds an option to set a user's profile image from the avatars in the firmware. Background color can be changed with a color picker. Also modifies profile image saving to account for this, and as a result images are now saved as JPEG with 100% quality. Any PNG, JPEG, or BMP can now also be used in the image file picker instead of just JPEG.

Also of note: I am not a C/C++ developer so please let me know if anything should be changed. Used ryujinx's implementation and other parts of the yuzu codebase for reference.

Reviewed-on: http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu/pulls/56
Co-authored-by: lui <lui@vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion>
Co-committed-by: lui <lui@vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion>
2024-12-20 15:24:58 +00:00
echosys
15b173988a Fix Android crash caused by incorrect type in progress dialog callbacks (#58)
Bug discovered via an incomplete fix in Sudachi.

Some Progress Dialog callbacks pass the wrong type (Double instead of Long) from C++ to Java code causing a crash at runtime.
To fix this a new function is implemented to convert to a Java Long and that is used instead of the function that converts to a Double.

Reviewed-on: http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu/pulls/58
Co-authored-by: echosys <echosys@noreply.localhost>
Co-committed-by: echosys <echosys@noreply.localhost>
2024-12-20 15:24:58 +00:00
chaphidoesstuff
2ed4e7a2ae audio_core: increment current revision, Courtesy of Sudachi Dev
Originally from 39effa1011/src/audio_core/common/feature_support.h# and my mirror
2024-12-20 15:24:58 +00:00
Herman Semenov
7bebaad1bf Using reserve() for optimization inserts, marked unused pair items and minor code refactor 2024-12-20 15:24:58 +00:00