summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2025-03-02Re-Enabled Vulkan Functions disabled on Adreno to improve compatibility and ↵CamilleLaVey
performance and check further issues within the current changes.
2025-02-28arm: Improve TLB implementation and fault handling in NCEZephyron
This commit enhances the Translation Lookaside Buffer (TLB) implementation in the ARM Native Code Execution (NCE) component to increase stability, particularly on Android devices. The changes prioritize robustness and error recovery over performance optimizations. Key improvements: - Replace set-associative TLB with a simpler linear search implementation - Implement a basic LRU replacement policy for TLB entries - Add validation checks for memory addresses before TLB insertion - Ensure proper page alignment for guest and host addresses - Enhance alignment fault handling with instruction skipping as fallback - Add comprehensive debug logging for memory access errors - Improve error recovery in guest memory access scenarios These changes should significantly reduce crashes during emulation on Android devices by gracefully handling memory access edge cases that previously resulted in hard crashes. Co-Authored-By: Camille LaVey <camillelavey@citron-emu.org> Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-02-28shader_recompiler: Implement vertex count lookup for Geometry stageZephyron
Add proper handling of input topologies in the Geometry stage for all three shader backends (GLASM, GLSL, SPIRV). This implementation uses a lookup table approach to determine vertex counts based on input topology type (Points, Lines, LinesAdjacency, Triangles, TrianglesAdjacency) and shifts the vertex count by 16 bits as required by the invocation info format. Additional changes: - Fixed TessellationControl and TessellationEval stages to properly break after emitting code - Added proper header include for runtime_info.h in GLASM backend - Improved code documentation with clear commenting patterns This change ensures accurate geometry shader behavior across all backends, improving compatibility with games that rely on proper vertex count reporting. Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-02-28feat: Make firmware mandatory for title launchingZephyron
This commit implements a requirement for firmware to be installed before titles can be launched, similar to how keys are required. Changes include: - Add IsFirmwareAvailable method to KeyManager to check for essential keys - Add CheckFirmwarePresence method to verify actual firmware files (NCAs) - Add firmware checks in game loading process for both desktop and Android - Add error messages when firmware is missing - Add strings for firmware-related error messages The implementation checks for both essential keys and the presence of system applets like Mii Edit and Home Menu to ensure proper firmware is installed. Games will not launch if firmware is missing, and users will be shown an appropriate error message.
2025-02-28feat: Remove autogenerated key functionalityZephyron
This commit removes the functionality that automatically generates and writes keys to *_autogenerated files. The key derivation logic is preserved, but derived keys are now only stored in memory and not written to disk. Changes include: - Remove loading from *_autogenerated key files - Make WriteKeyToFile a no-op function - Remove all file writing operations in SetKey methods - Remove file writing for keyblobs and other derived keys - Update copyright notices This change improves security by not storing derived keys on disk and simplifies the key management system.
2025-02-27renderer: Disable async presentation due to crashesZephyron
- Disable async presentation by default on both Android and desktop platforms due to stability issues.
2025-02-25core/arm/nce: Implement TLB caching systemZephyron
Adds a software TLB cache to improve memory access performance in the NCE (Native Code Execution) system. Key changes include: - Implement set-associative TLB with 64 sets and 8 ways - Add TLB lookup before memory access in HandleGuestAccessFault - Implement LRU replacement policy with access frequency consideration - Add thread context caching to reduce overhead - Add proper synchronization with mutex locks - Add helper functions for TLB management (lookup, insert, invalidate) This change should improve performance by reducing redundant memory translations and providing faster access to frequently used pages.
2025-02-24Revert "settings: Enable auto-stub by default"Zephyron
This reverts commit 7903415fa4369fbf0e8f415fbe9eb0017e0f7b3e.
2025-02-22vulkan: Improve memory allocation robustnessZephyron
Enhances the Vulkan memory allocator with better OOM handling and memory alignment: * Add memory recovery by cleaning up empty allocations before failing * Implement proper fallback to non-device-local memory * Simplify memory alignment handling for different vendors * Add better error logging for allocation failures * Add IsEmpty() helper to track unused allocations * Fix alignment requirements for Adreno (4KB) vs other vendors These changes improve the robustness of memory allocation, particularly in low-memory situations, and streamline vendor-specific alignment requirements.
2025-02-22android: Update build dependencies and configurationsZephyron
Updates various build dependencies and configurations for the Android build: * Upgrade Android Gradle Plugin to 8.8.1 * Update Kotlin to 2.1.20-RC * Upgrade NDK to 28.0.13004108 * Update target/compile SDK to Android 35 * Upgrade Java/Kotlin target to JVM 21 * Enable additional release optimizations (shrinkResources, proguard-android-optimize) * Update CMake to 3.31.5 * Update various AndroidX and support library dependencies * Change CMake boolean flags from 0/1 to OFF/ON * Update ktlint to 0.51.1 and related plugins This commit modernizes the Android build system and enables additional optimizations for release builds.
2025-02-22settings: Enable auto-stub by defaultZephyron
Changes the default value of use_auto_stub from false to true in the settings. This setting controls whether unimplemented functions should be automatically stubbed during execution.
2025-02-22feat: Add AnTuTu to license verification for Android appZephyron
2025-02-21Add license verification for Android appZephyron
Implements a LicenseVerifier class to ensure app integrity and license compliance: - Verifies the app's package name matches the official release - Validates app signature against official release signature - Allows debug and EA (Early Access) builds - Shows violation dialog and exits if verification fails - Enforces GPLv3 license compliance for modified versions This helps prevent unauthorized modified versions from being distributed without source code, as required by the GPLv3 license.
2025-02-20Revert "audio: refactor SDL2 sink implementation"Zephyron
This reverts commit 3aa9c0d1518ceec8e3f9ad93efa84bf90e1f1b21.
2025-02-19Remove redundant TranslateIPv4 functionZephyron
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-17network: Improve network interface handling and address resolutionZephyron
- 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-17feat: Add Home Menu launch support and system improvementsZephyron
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-16texture_cache: Add equality operators for ImageInfo and ImageViewInfoZephyron
- 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-16build: upgrade fmt and SDL2Zephyron
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-16service/am: Implement SetRequestExitToLibraryAppletAtExecuteNextProgramEnabledZephyron
- 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-16service/am: Implement CreateManagedDisplaySeparableLayerZephyron
- 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-16service/nvnflinger: Unstub GetNativeHandleZephyron
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-16service/vi: Improve OpenDisplay validationZephyron
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-16service/aoc: Implement CheckAddOnContentMountStatusZephyron
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-09android: Disable RAM Overlay By DefaultZephyron
- TODO
2025-02-09android: Update build toolchain to NDK 28 and Java 21Zephyron
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-09vulkan: Rename resolve_image to resolve_image_holderZephyron
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-09Revert "Replace yuzu identifiers with citron"Zephyron
This reverts commit d4ad55ed21047747698618e97dfa727d454c3c96.
2025-02-09network: Fix 0.0 FPS bug on Android (Part 2)Zephyron
- 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-09common: Enhance memory mapping safety and debuggingZephyron
- 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-09Replace yuzu identifiers with citronZephyron
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-09service/nvdrv: Implement NVGPU_GPU_IOCTL_NUM_VSMSZephyron
- Add IoctlNumVsms struct definition - Implement ioctl 0x13 to return number of SM units (2 for Tegra X1)
2025-02-09service/friend: Clean up friend service implementationZephyron
- Remove unused function stubs - Improve GetCompletionEvent implementation - Clean up response builder naming
2025-02-09service/audio: Clean up audio controller implementationZephyron
- Remove Unknown5000 function and related debug commands - Fix incorrect service name in log message
2025-02-09service/acc: Clean up account service implementationZephyron
- Remove unused function stubs - Add version information comments - Add clang-format markers - Remove duplicate TrySelectUserWithoutInteraction function - Fix formatting and code style
2025-02-08service/friend: implement additional friend service functionsZephyron
- 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-08service/audio: implement Unknown5000 and add debug commandsZephyron
- 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-08service/nim: implement CreateServerInterface2 and improve loggingZephyron
- 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-08service/mm: add missing vector include and update copyrightZephyron
- 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-08service/acc: implement Nintendo Account integration and cleanupZephyron
- 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-08service/nifm: implement additional network interface functionsZephyron
- 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-08service/sm: improve service manager implementationZephyron
- 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-08service/set: improve settings handling and update serial numberZephyron
- 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-08service/hid: reorganize gesture-related functionsZephyron
- 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-08service: fix typo in NPNS GetStateChangeEvent function nameZephyron
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-08android: optimize build settings and remove x86_64 supportZephyron
- 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-08common: improve host memory mapping validationZephyron
- 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-08core: improve nvdrv and buffer queue implementationsZephyron
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-08sockets: reorder errno values numericallyZephyron
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-08audio: refactor SDL2 sink implementationZephyron
- 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.