Commit graph

27189 commits

Author SHA1 Message Date
Zephyron
4d50d2ba16 Revert "audio: refactor SDL2 sink implementation"
This reverts commit 3aa9c0d151.
2025-02-20 16:54:43 +10:00
Zephyron
0576d40bf0 Remove redundant TranslateIPv4 function
Remove the TranslateIPv4 function that converts in_addr to IPv4Address, as it
appears to be unused or redundant. The functionality might be handled elsewhere
in the codebase or no longer needed.
2025-02-19 19:53:35 +10:00
Zephyron
6917530ba5 Updated submodule discord-rpc to commit 20cc99aeffa08a4834f156b6ab49ed68618cf94a 2025-02-19 15:19:47 +10:00
Zephyron
43495b6045 network: Improve network interface handling and address resolution
- Return loopback address (127.0.0.1) when no network interface is selected
- Improve IPv4 address string conversion and handling
- Add explicit handling for "None" network interface selection
- Change IsAnyInternetRequestAccepted logging from ERROR to DEBUG
- Simplify internet request acceptance check to assume availability

This change makes the network interface handling more robust by providing
fallback behaviors and improving address resolution. It also reduces
unnecessary error logging for expected scenarios.
2025-02-17 21:59:15 +10:00
Zephyron
c5e480e55d feat: Add Home Menu launch support and system improvements
This commit adds support for launching the system Home Menu and implements
several system-level improvements:

- Add Home Menu launch functionality through new UI action
- Implement shutdown/reboot sequence handlers in GlobalStateController
- Add support for reserved region extra size in page tables
- Enhance audio controller with output management
- Expand parental control service capabilities
- Add profile service improvements for user management

Technical changes:
- Add OnHomeMenu() handler to launch QLaunch system applet
- Implement m_alias_region_extra_size tracking in page tables
- Add new CreateProcessFlag for reserved region extra size
- Expand audio controller interface with output management
- Add self-controller methods to various services
- Implement play timer and profile service improvements

The changes primarily focus on system menu integration and core service
improvements to better support system functionality.
2025-02-17 17:33:10 +10:00
Zephyron
1c9e17496b texture_cache: Add equality operators for ImageInfo and ImageViewInfo
- Add operator== to ImageInfo and ImageViewInfo classes to enable direct equality comparisons. The implementations use std::tie to perform member-wise comparisons of all relevant fields in a safe and efficient manner.

This allows for easier comparison of texture cache entries and view
information, which can be useful for cache management and debugging.
2025-02-16 18:30:50 +10:00
Zephyron
7730d14b4a build: upgrade fmt and SDL2
Update fmt library to version 11.0.2 and make necessary adjustments:
- Replace fmt/format.h includes with fmt/ranges.h
- Add const qualifiers to formatter::format functions
- Update CMake to require fmt version 11

Additional dependency updates:
- Update SDL2 bundled version from 2.28.2 to 2.32.0
- Update catch2 to version 3.8.0
- Update vcpkg baseline to c82f74667287d3dc386bce81e44964370c91a289
2025-02-16 13:38:05 +10:00
Zephyron
677b8f476a service/am: Implement SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled
- Removes STUBBED designation as implementation is now complete
- Changes log level from WARNING to DEBUG
- Properly sets the exit request flag under lock protection
2025-02-16 12:02:52 +10:00
Zephyron
5cbde61d3c service/am: Implement CreateManagedDisplaySeparableLayer
- Removes STUBBED designation as implementation is now complete
- Changes log level from WARNING to DEBUG
- Adds proper locking when accessing the display layer manager
- Fixes parameter alignment in function declaration
2025-02-16 12:01:27 +10:00
Zephyron
33a1996ca4 service/nvnflinger: Unstub GetNativeHandle
Removes the STUBBED designation from GetNativeHandle in IHOSBinderDriver
as the implementation is now complete. Changes the log level from WARNING
to DEBUG to reflect this status.

The function properly handles binder ID validation and returns the
appropriate handle as documented in switchbrew.
2025-02-16 11:59:08 +10:00
Zephyron
a7af4d001b service/vi: Improve OpenDisplay validation
Updates the OpenDisplay function in IApplicationDisplayService to properly
validate display names. Instead of only accepting "Default", now validates
against all known valid display names: "Default", "External", "Edid",
"Internal", and "Null".

- Changes log level from WARNING to DEBUG since this is no longer stubbed
- Adds proper validation for all valid display names
- Returns ResultOperationFailed for invalid display names
- Improves logging by including the requested display name
2025-02-16 11:57:23 +10:00
Zephyron
ef884ce39c service/aoc: Implement CheckAddOnContentMountStatus
Implements the CheckAddOnContentMountStatus command for the aoc:u service.
This function checks whether add-on content (DLC) is currently mounted.

Currently returns false as we don't yet track mounted content state.
Changed log level from WARNING to DEBUG since this is no longer stubbed.
2025-02-16 11:55:13 +10:00
Zephyron
1aad9fd4e3 revert f45f339ef9
revert deps: update SDL2 and FFmpeg versions

Update bundled dependencies to their latest stable versions:
- SDL2: 2.28.2 -> 2.30.12
- FFmpeg: 6.0 -> 6.1.2

Also add citron copyright header to FFmpeg CMakeLists.txt
2025-02-13 11:48:41 +00:00
Zephyron
f45f339ef9 deps: update SDL2 and FFmpeg versions
Update bundled dependencies to their latest stable versions:
- SDL2: 2.28.2 -> 2.30.12
- FFmpeg: 6.0 -> 6.1.2

Also add citron copyright header to FFmpeg CMakeLists.txt
2025-02-12 17:59:32 +10:00
Zephyron
298e797592 Update external dependencies
Updated the following submodules to their latest versions:
- vcpkg: 74ec888 → 33e9c99
- cpp-httplib: a609330 → 39a64fb
- cpp-jwt: 10ef573 → 4a970bc
- discord-rpc: 20cc99a → 2acd05a
- enet: 39a72ab → 657eaf9
- libusb: c060e9c → de38189
- oaknut: 9d09110 → 94c726c
- opus: 101a71e → 734aed0
- simpleini: 382ddbb → 6048871
2025-02-12 15:58:47 +10:00
Zephyron
8bfafb4755 build: Update NASM and clang-format versions, fix download URLs
- Update NASM version from 2.16.01 to 2.16.03
- Change NASM download URL to use official nasm.us source
- Update clang-format version from 15 to 18
- Update compatibility list and clang-format download URLs to use citron-emu.org

Thanks to Mangax for suggesting these updates.
2025-02-11 19:25:59 +10:00
Zephyron
33d54e595f cmake: update Qt configuration and externals URL
- Simplify Qt version selection to always use 6.8.2 instead of conditional versions
- Update bundled externals URL to use git.citron-emu.org/Citron
- Update MSVC toolchain references from 2019 to 2022 for Qt paths

This change streamlines Qt version management and updates the infrastructure
to use newer MSVC toolchain paths.
2025-02-10 19:55:16 +10:00
Zephyron
13ada2d705
cmake: Use Qt 6.7.3 for MSVC builds
Forces Qt 6.7.3 for MSVC builds while keeping 6.8.2 for other platforms.
This fixes Windows compilation issues with newer Qt versions.
2025-02-09 18:57:35 +10:00
Zephyron
8bf4660bac
android: Disable RAM Overlay By Default
- TODO
2025-02-09 18:51:20 +10:00
Zephyron
b07751ed43
android: Update build toolchain to NDK 28 and Java 21
Update Android build configuration to use the latest NDK version 28.0.13004108
and Java JDK 21. This includes:

- Updating ndkVersion from 26.3.11579264 to 28.0.13004108
- Upgrading Java compatibility from Java 17 to Java 21
- Setting Kotlin JVM target from 17 to 21

These changes modernize the Android build toolchain and ensure compatibility
with the latest development tools.
2025-02-09 18:24:45 +10:00
Zephyron
b3c60b4cbe
vulkan: Rename resolve_image to resolve_image_holder
Fix Android compilation with latest NDK (28.0.13004108) and Java JDK 21 by
renaming the resolve_image variable to resolve_image_holder to avoid potential
naming conflicts. This change helps maintain compatibility with the updated
build toolchain while keeping the core functionality intact.

The change affects the MSAA image copy operation in the Vulkan texture cache
implementation.
2025-02-09 18:22:36 +10:00
Zephyron
dcf6f9a071
Revert "Replace yuzu identifiers with citron"
This reverts commit d4ad55ed21.
2025-02-09 18:19:08 +10:00
Zephyron
b42a0fb227
network: Fix 0.0 FPS bug on Android (Part 2)
- Add network interface enumeration support for Android
- Implement fallback loopback interface when no interfaces are detected
- Add ability to force offline mode on critical network errors
- Improve socket initialization with better error handling
- Add socket state tracking (domain, type, protocol)
- Make translation functions static and mark as maybe_unused
- Add detailed logging for network initialization failures

Part 2 of the Android FPS bug fix focuses on network resilience,
particularly handling cases where network initialization fails.
Instead of hanging the emulator, it now gracefully falls back to
offline mode and provides better diagnostic information.
2025-02-09 15:44:43 +10:00
Zephyron
5af4803e42
common: Enhance memory mapping safety and debugging
- Reduce max_memory_size from 512GB to 1GB for safer allocation limits
- Add memory operation logging for debugging purposes
- Implement MapMemory() with additional safety checks and large allocation handling
- Add validation checks for memory mappings
- Introduce chunked allocation strategy for large memory requests
- Add detailed error logging for memory operations
2025-02-09 15:40:24 +10:00
Zephyron
becaf850ab
Update Qt and Vulkan Headers versions
- Update VulkanHeaders requirement from 1.4.304.1 to 1.4.307
- Update Qt download version from 6.7.3 to 6.8.2
2025-02-09 15:38:41 +10:00
Zephyron
d4ad55ed21
Replace yuzu identifiers with citron
Update magic numbers and default identifiers across codebase:
- UUID default value
- Thread magic number
- Amiibo name
- Vulkan cache magic number
- Shader cache magic number
2025-02-09 12:07:50 +10:00
Zephyron
6e16a8db1c
service/nvdrv: Implement NVGPU_GPU_IOCTL_NUM_VSMS
- Add IoctlNumVsms struct definition
- Implement ioctl 0x13 to return number of SM units (2 for Tegra X1)
2025-02-09 11:43:08 +10:00
Zephyron
384a18927b
service/friend: Clean up friend service implementation
- Remove unused function stubs
- Improve GetCompletionEvent implementation
- Clean up response builder naming
2025-02-09 11:40:46 +10:00
Zephyron
76716b5248
service/audio: Clean up audio controller implementation
- Remove Unknown5000 function and related debug commands
- Fix incorrect service name in log message
2025-02-09 11:39:16 +10:00
Zephyron
6917a22a2c
service/acc: Clean up account service implementation
- Remove unused function stubs
- Add version information comments
- Add clang-format markers
- Remove duplicate TrySelectUserWithoutInteraction function
- Fix formatting and code style
2025-02-09 11:36:58 +10:00
Zephyron
646af3c143
Downgrade Qt version from 6.8.2 to 6.7.3
- Changes the downloaded Qt version from 6.8.2 to 6.7.3 when not using system Qt.
- This rolls back to a more stable release version of Qt.
2025-02-09 11:33:06 +10:00
Zephyron
d1b7aebe8c
Update submodule URLs from yuzu-mirror to Citron repositories
Change the remote URLs for the following submodules to point to Citron's Git server:
- dynarmic
- discord-rpc
- sirit
- mbedtls
- breakpad
- oaknut

This migrates these dependencies from yuzu-mirror GitHub repositories to
Citron's self-hosted Git server while maintaining the same codebase.
2025-02-09 11:31:40 +10:00
Zephyron
d783806b1e
service/friend: implement additional friend service functions
- Add implementations for previously stubbed functions:
  * Cancel - Handle operation cancellation
  * RequestSyncFriendList - Friend list synchronization
  * GetUserPresenceView - User presence information
  * LoadUserSetting - User settings loading
- Improve GetCompletionEvent implementation:
  * Add proper event signaling
  * Use clearer variable names
  * Improve debug logging
- Enhance logging messages:
  * Add more descriptive debug messages
  * Include user ID in presence view logging
  * Use consistent naming in response builders
- Fix response builder formatting for consistency

These changes improve the friend service implementation by adding
support for more friend-related functionality while enhancing
the debugging experience through better logging and code
organization.
2025-02-08 20:39:47 +10:00
Zephyron
268d322d7f
service/audio: implement Unknown5000 and add debug commands
- Add Unknown5000 implementation to create duplicate controller interface
- Add new debug-related command handlers:
  * OverrideDefaultTargetForDebug (50001)
  * SetForceOverrideExternalDeviceNameForDebug (50003)
  * ClearForceOverrideExternalDeviceNameForDebug (50004)
- Add proper debug logging for interface creation
- Update header with new function declaration
- Fix missing commas in function registration array

These changes improve the audio controller implementation by
adding support for interface duplication and debug override
functionality. The implementation maintains proper interface
lifetime management using SharedFrom.
2025-02-08 20:35:38 +10:00
Zephyron
92b70b31e0
service/nim: implement CreateServerInterface2 and improve logging
- Add CreateServerInterface2 implementation for NIM_ECA service
- Change log level from WARNING to DEBUG for CreateServerInterface
- Add descriptive log message for server interface creation
- Maintain consistent interface creation pattern between both versions
- Fix missing comma in function registration array

These changes improve the NIM service implementation by adding
support for the newer server interface creation method while
making logging more appropriate for stubbed functions.
2025-02-08 20:28:25 +10:00
Zephyron
4792ba752e
service/mm: add missing vector include and update copyright
- Add missing <vector> include for std::vector usage
- Add Citron copyright notice
- Maintain existing include ordering

This is a minor cleanup change to ensure proper header inclusion
and copyright attribution.
2025-02-08 20:24:09 +10:00
Zephyron
b8fe6b6f7c
service/acc: implement Nintendo Account integration and cleanup
- Add Nintendo Account related implementations:
  * GetNintendoAccountId
  * GetNintendoAccountUserResourceCache
  * IsLinkedWithNintendoAccount
  * StoreSaveDataThumbnailApplication
- Improve version handling:
  * Add proper firmware version comments
  * Implement deprecated and new TrySelectUserWithoutInteraction
  * Update service interface versioning
- Clean up code organization:
  * Remove redundant clang-format markers
  * Fix constructor formatting
  * Improve error handling in InitializeApplicationInfoBase
  * Add proper debug logging
  * Update copyright headers
- Add proper documentation for buffer types and sizes

These changes improve Nintendo Account integration support while
cleaning up the codebase and improving version compatibility
handling. The implementation provides stubs for network-related
functionality to allow applications to proceed while proper
integration is developed.
2025-02-08 20:21:47 +10:00
Zephyron
0acfbc5fa1
service/nifm: implement additional network interface functions
- Add implementations for previously stubbed functions:
  * EnumerateNetworkInterfaces
  * EnumerateNetworkProfiles
  * ConfirmSystemAvailability
  * SetBackgroundRequestEnabled
- Add proper debug logging for new implementations
- Update header with new function declarations
- Add Citron copyright notice
- Improve response builder naming for clarity

These implementations return success status with empty results
to allow applications to proceed while proper network interface
management is developed. Debug logging has been added to track
usage of these functions.
2025-02-08 19:58:19 +10:00
Zephyron
e3128c6e98
service/sm: improve service manager implementation
- Reorder error codes to match numerical order
- Rename RegisterClient to Initialize in service registration
  to match actual function name
- Update function declaration order in header to match implementation
- Improve QueryPointerBufferSize implementation:
  * Add proper documentation comment
  * Use constexpr for maximum transfer memory size
  * Use std::numeric_limits where appropriate
  * Improve debug logging message
  * Use meaningful constant name

These changes improve code organization and clarity while making
the service manager interface more consistent with Nintendo's
official naming conventions.
2025-02-08 19:50:28 +10:00
Zephyron
b89a85e228
service/set: improve settings handling and update serial number
- Update default console serial number prefix from "YUZ" to "CIT"
- Improve GetSettingsItemValueImpl template implementation:
  * Add proper buffer management using std::vector
  * Fix potential buffer overflow issues
  * Use clearer variable naming
  * Add proper size handling with actual_size
  * Use memcpy for safer data copying

These changes improve the safety of settings handling while
updating the emulator's identity to use the Citron prefix
instead of yuzu's.
2025-02-08 19:45:27 +10:00
Zephyron
cc48197448
service/hid: reorganize gesture-related functions
- Move SetGestureOutputRanges function registration to be with other
  gesture-related functions (next to ActivateGesture)
- Move SetGestureOutputRanges implementation to be with other
  gesture-related implementations
- Change log level from WARNING to DEBUG for SetGestureOutputRanges
- Move function declaration to private section with other IPC handlers
- Update function ordering to match service registration order

These changes improve code organization by grouping related
functionality together and maintain consistency between the
interface registration and implementation ordering.
2025-02-08 19:39:53 +10:00
Zephyron
0010882f36
service: fix typo in NPNS GetStateChangeEvent function name
Fix spelling of "GetStateChangeEvent" function name in both INpnsSystem
and INpnsUser interfaces. The function was incorrectly spelled as
"GetStateChangeEVent" with a capital 'V'.
2025-02-08 19:35:59 +10:00
Zephyron
28350f7af8
android: optimize build settings and remove x86_64 support
- Enable resource shrinking for release builds
- Disable JNI debugging in release builds
- Switch to optimized proguard configuration file
- Remove x86_64 ABI support
- Fix syntax error in dependencies block
- Update build optimization flags:
  * Enable shrinkResources
  * Use proguard-android-optimize.txt
  * Disable JNI debugging for release builds

These changes improve the release build optimization and reduce
APK size by removing x86_64 support and enabling additional
resource optimization features. The build configuration is also
cleaned up by fixing a syntax error and using more aggressive
optimization settings.
2025-02-08 19:33:53 +10:00
Zephyron
7ecb890a16
common: improve host memory mapping validation
- Add maximum memory size limit of 512GB (Overkill)
- Implement additional safety checks for memory mapping:
  * Validate non-zero addresses
  * Verify address alignment
  * Add length validation against maximum size
- Remove redundant assertion for host_offset alignment
- Remove potentially problematic mapping verification
- Improve error logging for invalid mapping attempts

These changes enhance memory safety by adding proper bounds
checking and validation before performing memory mappings,
while removing a potentially problematic post-mapping
verification step.
2025-02-08 19:32:06 +10:00
Zephyron
c31768ec15
core: improve nvdrv and buffer queue implementations
Buffer Queue Changes:
- Add assertion for buffer state in free slots
- Improve error handling for buffer dequeuing
- Add buffer count validation checks
- Update log levels for better diagnostics

NVDRV Changes:
- Add host1x reference to nvhost_nvdec_common
- Improve ioctl error reporting with more detailed messages
- Reorder function declarations in nvhost_ctrl_gpu
- Add stub for unimplemented ioctl command 0x13
- Clean up initialization of boolean flags

These changes improve error handling and debugging capabilities
while adding additional safety checks for buffer management.
The nvdrv interface is also made more robust with better error
reporting and proper hardware access patterns.
2025-02-08 19:29:49 +10:00
Zephyron
227db142e2
sockets: reorder errno values numerically
Reorder the Errno enum values to be in ascending numerical order,
moving NOMEM (12) to be between AGAIN (11) and INVAL (22). This
improves readability and makes it easier to verify completeness
of the error code list.
2025-02-08 19:21:47 +10:00
Zephyron
3aa9c0d151
audio: refactor SDL2 sink implementation
- Move SDLSinkStream class definition to header file
- Add additional error checking for SDL audio device availability
- Limit audio channels to stereo
- Add format verification and warning messages
- Improve audio device initialization with better error handling
- Rename device variable to audio_device_id for clarity
- Add running state flag
- Update copyright header to include citron

This refactoring improves error handling and provides better debug
information when audio device initialization fails. The implementation
is now more robust and provides clearer feedback for troubleshooting
audio issues.
2025-02-08 19:19:52 +10:00
Zephyron
7b6495aced
build: update dependencies and relax version requirements
- Update Vulkan validation layers to 1.4.304.1
- Update Qt to 6.8.2
- Remove strict version requirements for various dependencies
- Update Vulkan-Headers, VulkanMemoryAllocator, and vcpkg submodules
- Reorganize discord-rpc compile options

This change makes the build system more flexible by removing unnecessary
version constraints while ensuring compatibility with newer versions of
key dependencies.
2025-02-08 19:13:51 +10:00
Zephyron
d4eca46bba
frontend: Remove telemetry popup and default to disabled
Removes the telemetry opt-in popup dialog and defaults telemetry to disabled.
The ShowTelemetryCallout function is simplified to just:
- Set telemetry to disabled by default
- Apply the setting
- Mark the callout as shown to prevent future popups

This change ensures user privacy by defaulting to no telemetry collection
without requiring user interaction.
2025-02-05 15:13:10 +10:00
Zephyron
df1ae19742
discord: Increase game icon resolution to 256x256
Update the tinfoil.media URL requests to fetch game icons at 256x256 resolution
instead of 128x128, providing higher quality game icons in Discord Rich Presence.
2025-02-04 20:28:16 +10:00