Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
revert Changes of the previous commits
|
|
|
|
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>
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
- 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.
|
|
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.
|
|
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
|
|
- Removes STUBBED designation as implementation is now complete
- Changes log level from WARNING to DEBUG
- Properly sets the exit request flag under lock protection
|
|
- 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
|
|
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.
|
|
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
|
|
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.
|
|
This reverts commit d4ad55ed21047747698618e97dfa727d454c3c96.
|
|
- 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.
|
|
Update magic numbers and default identifiers across codebase:
- UUID default value
- Thread magic number
- Amiibo name
- Vulkan cache magic number
- Shader cache magic number
|
|
- Add IoctlNumVsms struct definition
- Implement ioctl 0x13 to return number of SM units (2 for Tegra X1)
|
|
- Remove unused function stubs
- Improve GetCompletionEvent implementation
- Clean up response builder naming
|
|
- Remove Unknown5000 function and related debug commands
- Fix incorrect service name in log message
|
|
- Remove unused function stubs
- Add version information comments
- Add clang-format markers
- Remove duplicate TrySelectUserWithoutInteraction function
- Fix formatting and code style
|
|
- 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.
|
|
- 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.
|
|
- 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.
|
|
- 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.
|
|
- 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.
|
|
- 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.
|
|
- 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.
|
|
- 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.
|
|
- 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.
|
|
Fix spelling of "GetStateChangeEvent" function name in both INpnsSystem
and INpnsUser interfaces. The function was incorrectly spelled as
"GetStateChangeEVent" with a capital 'V'.
|
|
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.
|
|
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.
|
|
Update the Atmosphere release version minor number from 0 to 8 to match
newer firmware versions. Also add copyright notice for citron Emulator
Project.
This change maintains compatibility with newer system versions while
preserving the existing version number format.
|
|
Improve the validation logic in UnmapProcessCodeMemory by:
- Add missing size validation check at the start
- Reorganize validation checks into logical groups
- Simplify error handling using R_UNLESS macros
- Remove redundant page table range check
- Add copyright notice for Citron Emulator Project
- Add ResultInvalidSize constant definition
The changes make the validation code more concise and easier to follow
while maintaining the same validation requirements. Error handling is now
more consistent with other SVC implementations.
|
|
Add more detailed debug logging and validation to the InvalidateNCE function:
- Add entry debug log showing NCE invalidation request details
- Add upfront validation of memory region before proceeding
- Add debug logs for rasterizer and separate heap handling cases
- Add warning logs for invalid address ranges and failed invalidations
- Improve error message formatting and clarity
- Group related operations with descriptive comments
These changes make it easier to debug NCE invalidation issues by providing
more visibility into the validation steps and failure cases.
|
|
Implements several improvements to memory handling and validation:
- host_memory: Add IsValidMapping() and IsDirectMappingEnabled() methods to
validate memory access
- host_memory: Fix virtual base offset calculation to use proper pointer
arithmetic
- host_memory: Add size field to track allocation size
- nvhost_ctrl_gpu: Return InvalidState instead of InvalidValue for TPC mask
buffer size validation
- Update copyright year for citron
The changes improve memory safety by adding explicit validation checks and
fixing pointer arithmetic in the virtual memory implementation.
|
|
This commit makes two main changes:
1. Adds support for GetTpcMasks2 (ioctl 0x13) in nvhost_ctrl_gpu:
- Implements new GetTpcMasks2 method to handle TPC mask queries
- Adds IoctlGetTpcMasks structure to store mask parameters
- Returns conservative single TPC configuration for compatibility
2. Enhances memory mapping validation in HostMemory:
- Adds verification check after memory mapping operations
- Improves error handling for direct mapped address enabling
- Adds logging for mapping and direct address failures
Additional changes:
- Updates copyright headers to include citron Emulator Project
- Improves error handling and validation in several paths
- Adds debug logging for TPC mask operations
This improves GPU virtualization support and memory mapping reliability.
|
|
Adds initial support for rebootless system update related functionality:
- Add system archive title IDs for ApplicationBlackList, RebootlessSystemUpdateVersion,
and ContentActionTable
- Add NS service result codes for system update operations
- Implement stubs for ISystemUpdateControl::SetupToReceiveSystemUpdate and
RequestCheckLatestUpdateIncludesRebootlessUpdate
- Add RebootlessSystemUpdateVersion settings type and implement
GetRebootlessSystemUpdateVersion in SET service
- Fix GetSettingsItemValueImpl template implementation
This provides basic infrastructure for handling system updates, particularly
the rebootless update feature, though actual update functionality remains
stubbed.
|
|
- Replace stubbed InitialProcessIdRange implementation with proper bounds (1-0x50)
- Add handle and info_sub_id validation for InitialProcessIdRange
- Replace process exit ASSERT with graceful error handling and logging
- Add try-catch block around system.Exit() for safer shutdown
- Add atomic header inclusion for binder.h
This improves system call reliability by properly implementing process ID
range checks and adding safer process exit handling with proper error logging.
|
|
Implements support for ENOMEM (errno 12) across the network stack:
- Added NOMEM to Network::Errno enum
- Added NOMEM = 12 to sockets Errno enum
- Added translation case in sockets_translate.cpp
This is the first step towards addressing the 0.0 FPS bug that occurs
when the system runs out of memory during socket operations. Previously,
these operations would trigger an unimplemented assertion, causing the
emulator to halt. Now the error will be properly propagated to the guest
application.
|
|
Implements several IPC commands in IApplicationFunctions related to GPU error
handling and system events:
- EnableApplicationAllThreadDumpOnCrash (cmd 124)
- SetDelayTimeToAbortOnGpuError (cmd 131)
- TryPopFromNotificationStorageChannel (cmd 151)
- SetHdcpAuthenticationActivated (cmd 170)
- GetLaunchRequiredVersion (cmd 180)
- UpgradeLaunchRequiredVersion (cmd 181)
Also adds the LaunchRequiredVersion struct definition to the header file.
These are currently stubbed implementations that log warnings when called.
REFS: switchbrew.org/wiki/Applet_Manager_services#GetGpuErrorDetectedSystemEvent
|
|
Implements proper reference counting for binder objects based on the official
documentation. This adds both weak and strong reference counting support to
the IBinder interface and its implementations (BufferQueueProducer and
BufferQueueConsumer).
The implementation follows the documented behavior where:
- type 0 affects weak references
- type 1 affects strong references
- During initialization: {addval=1, type=0} followed by {addval=1, type=1}
- For onFirstRef: {addval=1, type=1}
- For onLastStrongRef: {addval=-1, type=1}
Reference counters are implemented using std::atomic to ensure thread safety.
REFS: switchbrew.org/wiki/Nvnflinger_services#AdjustRefcount
|
|
Implements missing functions and improves permission handling in the VI
(Visual Interface) IApplicationDisplayService based on official documentation.
Key changes:
- Add session type enum to properly handle vi:u/vi:s/vi:m permissions
- Implement GetIndirectLayerImageCropMap for handling cropped layer images
- Implement GetDisplayVsyncEventForDebug for debug vsync event handling
- Add proper permission checks for GetSystemDisplayService and GetManagerDisplayService
- Improve AppletResourceUserId validation in OpenLayer
- Clean up logging and error handling
The changes follow the official documentation for permission handling:
- vi:u sessions can only use GetRelayService
- vi:s sessions can use everything except GetManagerDisplayService
- vi:m sessions can use all commands
REFS: switchbrew.org/wiki/Display_services#IApplicationDisplayService
|
|
This reverts commit b55be320b75d01bdc1320bc78179542b2ce10fb2.
|
|
Reorganizes the ErrorModule enum in result.h by grouping error codes into
numerical ranges with descriptive comments. This improves readability and
makes it easier to:
- Find specific modules by their number
- See which numbers are used/unused in each range
- Understand the overall distribution of module numbers
Also standardizes naming conventions across modules and fixes some
inconsistent casing (e.g. FS -> Fs, HDCP -> Hdcp).
REFS: switchbrew.org/w/index.php?title=Error_codes
|