- In commit b3facaa6bb, the copyright header was
updated to include "Citron Homebrew Project" across multiple files, regardless
of whether any contributions were made.
- This commit removes the incorrect attribution and reverts the copyright header
to its previous state.
- Copyright attribution should only be added when meaningful contributions have
been made to the file.
- This commit ensures proper compliance with copyright standards and maintains
correct attribution to the respective contributors.
- Special thanks to Tachi for pointing out the need for these corrections and
ensuring that proper attribution practices are followed.
Expand ISA level enforcement to ensure all components, including vcpkg
dependencies, are built with x86-64-v2 instruction set. This addresses
remaining compatibility issues where dependencies were potentially being
built with higher ISA levels.
Changes:
- Add dedicated x86-64-v2 toolchain file for vcpkg
- Set ISA flags for both main project and dependencies
- Ensure proper quoting of compiler flags
- Configure vcpkg to use consistent toolchain settings
The fix requires cleaning both build and vcpkg directories before
rebuilding:
rm -rf build/
rm -rf vcpkg_installed/
Credits to Alex&Indie for the original ISA compatibility fix.
Fixes remaining instances of Linux Compilation
Enforce x86-64-v2 instruction set level to prevent compatibility issues
on systems that default to higher ISA levels (v3/v4). This fixes crashes
reported on certain Linux distributions like CachyOS that force higher
instruction set levels by default.
The fix:
- Sets -march=x86-64-v2 for both C and CXX flags
- Adds compile options to ensure system defaults don't override
- Explicitly disables v3 and v4 instruction sets
- Only applies to x86_64 architectures
Credits to Alex&Indie for identifying the ISA level compatibility
issue.
Fixes: Linux Compilation.
- Update Kotlin and various AndroidX dependencies to stable versions
- Add temperature monitoring with color-coded display in emulation
- Add FPS color indication (red to green based on performance)
- Add legal disclaimer page to initial setup
- Remove x86_64 ABI filter to focus on arm64-v8a
- Adjust thermal and FPS update intervals for consistency
- Clean up redundant dependency declarations
The temperature display now shows both Celsius and Fahrenheit with
color coding based on safe operating ranges [WIP]. FPS counter provides
visual feedback through colors, making performance issues more
immediately apparent to users.
- Update Gradle from 8.1 to 8.10.2
- Update Android Gradle Plugin from 8.1.2 to 8.8.0
- Update Kotlin from 1.9.20 to 2.1.20-Beta1
- Update various AndroidX dependencies to latest versions
- Update NDK from 26.1 to 27.2 (with RC1/RC2 options commented)
- Update Java target from 17 to 21
- Update Android target SDK from 34 to 35
- Enable additional optimizations in release builds:
- Enable shrinkResources
- Use proguard-android-optimize.txt
- Disable JNI debugging
- Replace vector drawables with PNG for ic_citron
- Comment out unused ComputeInline constant in dma_pusher.cpp
- Update Gradle wrapper and configuration files
This updates the Android build system and dependencies to their latest
versions while enabling additional optimizations for release builds.
The ic_citron icon was converted from vector to PNG format for better
compatibility.
Added new CMake option CITRON_USE_LLVM_DEMANGLE (default: ON) to control whether
the project uses LLVM's Demangle component. This allows building without LLVM
dependencies when demangling support is not needed.
Co-authored-by: reg_server
Previously, the code would unconditionally add a constant buffer descriptor
at index 0 whenever storage buffers were present, which could cause conflicts
and crashes. This change:
- Adds validation to check if constant buffer 0 already exists
- Only adds the descriptor if it's not already present
- Prevents potential descriptor conflicts in shaders
This should resolve crashes in Vulkan games related to invalid descriptor
layouts and resource binding conflicts.
Add conditional compilation directives to handle packed struct definitions
differently between MSVC and other compilers. MSVC uses #pragma pack
while GCC/Clang use __attribute__((packed)). This change affects:
- ZBCColorEntry
- ZBCDepthEntry
- IoctlZbcSetTable
The functionality remains the same, but ensures proper struct packing
across different compiler environments.
Add support for bindless texture constant buffers in the compute pipeline
creation process. When storage buffer descriptors are present, create a
constant buffer descriptor to handle bindless textures. This fixes the
"Failed to track bindless texture constant buffer" error.
Changes:
- Add constant buffer descriptor with index 0 and count 1 when storage
buffers are present
- Place descriptor creation before SPIR-V code generation to ensure proper
shader compilation
This resolves issues with bindless texture access in compute shaders.
Adds support for InfoType::SystemResourceSize (0x1C) which is required for
proper initialization of the Virtual Address Memory Manager (VAMM). This
implementation:
1. Adds SystemResourceSize to the InfoType enum in svc_types.h
2. Implements the GetInfo handler for SystemResourceSize in svc_info.cpp
3. Returns 512MB (0x20000000 bytes) as the system resource size
4. Adds debug logging for the SVC call
The 512MB value is chosen based on typical system resource allocations
needed for VAMM initialization on the Nintendo Switch.
This fixes crashes in games that rely on VAMM functionality, particularly
during nn::os::detail::VammManager::InitializeIfEnabled().
This commit makes several improvements to device memory management and buffer
queue handling:
DeviceMemoryManager:
- Add null pointer and size checks for ReadBlock
- Fill unmapped memory with a known pattern (0xCC) instead of zeros
- Add better error logging for invalid memory accesses
- Add null pointer check for source pointer in memcpy
BufferQueueProducer:
- Improve error handling in WaitForFreeSlotThenRelock
- Add proper abandoned state checking during wait conditions
- Clean up and simplify buffer scanning logic
- Improve logging messages with more descriptive information
- Remove redundant buffer count validation
- Fix potential infinite loop condition during wait
These changes improve stability and error handling while making the code more
maintainable and debuggable. The use of a known pattern for unmapped memory
helps identify uninitialized memory access issues.
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.
Refactors the game list scanning code to use std::filesystem instead of custom
directory iteration functions. Main changes include:
- Replace Common::FS directory iteration with std::filesystem iterators
- Split game file processing logic into separate ProcessGameFile method
- Improve error handling with try-catch for filesystem operations
- Simplify control NCA metadata extraction
- Use more modern C++ features and cleaner code organization
This change should improve maintainability and reliability of the game
scanning system while potentially offering better performance through
native filesystem APIs.
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.
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
- Remove telemetry functionality and related UI elements
- Add automatic token generation using UUID
- Remove manual token verification process
- Sync Citron username with profile username automatically
- Simplify web configuration UI and improve error messages
- Update host room error message for clarity
This change streamlines the web service configuration by removing
unnecessary complexity and automating token management. Users no longer
need to manually verify tokens, and the Citron username is automatically
kept in sync with their profile username.
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.
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
- 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
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.
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.
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.
- 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.
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
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().
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.
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.
Updates version constants to match Nintendo Switch firmware 19.0.1:
- HOS version numbers (19.0.1)
- Version hash
- Display version string
- Display title string
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.
- The personalization array in GenerateTelemetryId() was too small (18 bytes)
for the string "citron Telemetry ID" which requires 20 bytes including the
null terminator
- Increased the array size to 20 to properly accommodate the full string