Commit Graph

2152 Commits

Author SHA1 Message Date
Zephyron
efef746299 feat(renderer): add CRT shader filter with configurable effects
Add CRT (Cathode Ray Tube) shader implementation as scaling filter
options (CRT EasyMode and CRT Royale) in the Window Adapting Filter
dropdown. Provides classic TV effects including scanlines, phosphor
masks, curvature distortion, gamma correction, bloom, brightness, and
alpha transparency.

- Add CRTEasyMode and CRTRoyale to ScalingFilter enum
- Implement vulkan_crt_easymode.frag shader with single-pass effects
- Integrate CRT filter into WindowAdaptPass rendering pipeline
- Add configurable CRT parameters to settings with user-friendly labels
- Add UI translations for desktop and Android platforms
- Support CRT push constants in present pipeline

The CRT filter appears alongside other scaling filters like FSR and
FSR 2.0. CRT parameter settings are only active when a CRT filter
is selected.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2026-01-01 18:18:05 +10:00
Collecting
c377c0c407 feat(fs): Cross-Compatible Emulator Save Pathing w/ Custom Save Paths
Signed-off-by: Collecting <collecting@noreply.localhost>
2025-12-31 03:53:38 +00:00
Collecting
70926d388d feat(fs): Cross-Compatible Emulator Save Pathing w/ Custom Save Paths
Signed-off-by: Collecting <collecting@noreply.localhost>
2025-12-31 03:52:44 +00:00
Collecting
9c6572e0cc feat(fs): Implement Global Custom Save Path
Added a "Global Custom Save Path" configuration option in the Filesystem settings.

Implemented a prioritized save-loading hierarchy: Global Path (if enabled) > Per-Game Custom Path > Default NAND.

Introduced a non-destructive migration tool that allows users to consolidate their existing saves into the new global location.

The migration tool specifically prioritizes per-game custom saves over NAND saves to ensure the most up-to-date data is preserved during consolidation.

The migration process is copy-only; no data is deleted from the source directories, ensuring absolute user data safety.

Maintained compatibility with the existing "Backup Saves to NAND" feature, ensuring saves continue to be mirrored internally if configured.

Signed-off-by: Collecting <collecting@noreply.localhost>
2025-12-29 01:09:20 +00:00
Zephyron
38d4152021 fix(network): improve ZSTD compression/decompression error handling
- Add error checking after decompression to drop corrupted packets
- Add error checking after compression to prevent sending empty packets
- Allow ZSTD_CONTENTSIZE_UNKNOWN and use streaming decompression
- Only reject ZSTD_CONTENTSIZE_ERROR as a fatal error

Fixes network connectivity issues where corrupted/empty packets were
being processed, breaking the network protocol.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-12-26 16:51:33 +10:00
Collecting
cd3c5e1d88 fs(feat): Add Backup Saves for Custom Save Paths
Signed-off-by: Collecting <collecting@noreply.localhost>
2025-12-22 08:32:57 +00:00
Collecting
3b5c2e86ae fix: NTFS Directory Scanning on Linux
Signed-off-by: Collecting <collecting@noreply.localhost>
2025-12-19 18:43:51 +00:00
Collecting
9d68c1b1f6 fix: Directory Scanning w/ Linux (add Copyright)
Signed-off-by: Collecting <collecting@noreply.localhost>
2025-12-19 18:41:20 +00:00
Collecting
8ee84ee519 fs: Fix Directory Scanning w/ NTFS
Signed-off-by: Collecting <collecting@noreply.localhost>
2025-12-19 18:40:19 +00:00
Zephyron
240b8f7aef fix: Add safety checks to ZSTD decompression and improve HTTP client
- Add maximum packet size limit (16 MB) to prevent memory exhaustion
- Add empty input validation for ZSTD decompression
- Improve error handling with detailed logging
- Increase HTTP timeout from 30 to 60 seconds
- Enable HTTP redirect following and keep-alive connections

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-12-03 12:03:06 +10:00
Zephyron
90eeee345c feat(filesystem): add custom save path support per game
- Add custom_save_paths map to Settings::Values
- Implement ReadCustomSavePathValues and SaveCustomSavePathValues in Config
- Update CreateSaveDataFactory to check for custom save paths
- Support per-game title ID save path overrides

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-11-28 16:11:07 +10:00
Zephyron
19faff40cd fix: socket assertion crashes and add Nex service stub
- Replace socket option assertion failures with proper error returns
- Add WSAENOPROTOOPT/ENOPROTOOPT error handling
- Fix LINGER and option value size validation
- Add Network::Errno::OTHER translation
- Implement basic Nex service stub for error code 2306-0520

Fixes crashes in Minecraft and other games when encountering unsupported
socket operations or attempting to use Nintendo's online services.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-11-13 19:30:40 +10:00
Zephyron
be5c2f772c fix: Multiplayer network fixes and airplane mode
- Auto-select network interface for direct connect/host room
- Always recreate ENet client on join for fresh bindings
- Add airplane mode toggle (Desktop & Android)
- Fix JWT verification with empty verify_uid
- Improve content-type handling for JWT endpoints

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-11-10 17:16:45 +10:00
Zephyron
09f8c3a643 feat(ui): add per-game cheat management tab with bulk toggle controls
Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-11-07 19:17:07 +10:00
Zephyron
5117ff3702 feat: implement multiplayer networking improvements for reduced latency
Major networking enhancements to improve multiplayer performance and
reduce desync issues in games like Mario Kart 8 Deluxe:

Network Performance:
- Add socket connection pooling in BSD service to reduce overhead
- Implement unreliable packet delivery for latency-sensitive game data
- Add packet reliability control for both ProxyPacket and LDNPacket
- Use ENET_PACKET_FLAG_UNSEQUENCED for small UDP packets (<1200 bytes)

Monitoring & Debugging:
- Add PacketStatistics struct to track sent/received/dropped packets
- Enhanced logging for proxy packet handling and socket lifecycle
- Periodic stats logging every 100 packets for diagnostics

Configuration:
- Update lobby_api_url and web_api_url to https://api.ynet-fun.xyz
- Add lobby API URL configuration support

Socket Management:
- Implement SocketPoolKey for efficient socket reuse
- Store domain/type/protocol info in FileDescriptor
- Max pool size limit (8 sockets per type) to prevent memory bloat
- Return closed sockets to pool when room is still connected

Protocol Updates:
- Add 'reliable' field to ProxyPacket and LDNPacket structures
- Update room.cpp packet handlers to respect reliability flags
- Maintain backward compatibility with default reliable=true

These changes significantly reduce packet latency for real-time game
traffic while maintaining reliability for control packets.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-11-05 18:52:06 +10:00
Collecting
e1f4815c0c feat: Add Controller Color & Toggle Gyro
Signed-off-by: Collecting <collecting@noreply.localhost>
2025-10-31 05:38:22 +00:00
Zephyron
e9b63b4b34 feat: Add XCI Trimmer and UI improvements
- Implement XCI file trimming with validation and Unicode support
- Add trimming options to File menu and game properties dialog
- Optimize rainbow mode performance globally (150ms timer, cached colors)
- Add horizontal scrolling to game properties dialog
- Fix compilation issues and improve code quality

Thanks to Citron Tester Tetsuya Takahashi (高橋 哲屋) for extensive testing and contributions to the XCI Trimmer implementation.

Co-authored-by: Tetsuya Takahashi <tetsuya@citron-emu.org>
Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-10-21 22:26:10 +10:00
Zephyron
b85fd5fc73 renderer_vulkan: add Extended Dynamic State user setting
Add configurable EDS levels (Disabled/EDS1/EDS2/EDS3) to allow users to
troubleshoot graphics issues by controlling which Vulkan Extended Dynamic
State features are enabled. Defaults to EDS3 for maximum performance.

Implements setting in both desktop and Android frontends with proper
translations and descriptions.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-10-17 18:52:30 +10:00
Zephyron
99073c8e19 renderer_vulkan: Add conditional rendering control setting
Adds user option to disable Vulkan conditional rendering, which can fix
flickering objects in some games caused by rapidly toggled draw calls.

Changes:
- Add use_conditional_rendering setting (default: enabled)
- Guard conditional rendering functions with setting check using [[unlikely]]
- Early exit in Pause/Resume and Compare functions when disabled

Disabling this in Graphics (Advanced) fixes flickering at cost of performance.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-10-17 16:47:57 +10:00
Zephyron
bc81e53c53 refactor: Convert ENUM macros to explicit enum class definitions
- Convert ENUM() macro calls to standard C++ enum class syntax
- Add explicit numeric values to each enum member for clarity
- Manually define EnumMetadata<T>::Canonicalizations() specializations
- Manually define EnumMetadata<T>::Index() specializations
- Special handling for ResolutionSetup which requires signed (s32) values

Benefits:
- Improved type safety and compiler error messages
- Better IDE support for navigation and refactoring
- More explicit and self-documenting code
- Easier to debug enum-related issues
- Eliminates macro expansion complexity

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-10-12 16:42:56 +10:00
Zephyron
9a61cf07a6 feat(renderer): Add ScaleFX to Settings enum
Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-10-11 13:36:00 +10:00
Zephyron
0c5c1bbf7f feat(graphics): add 0.25X quarter resolution downscaling
- Add Res1_4X resolution setup with down_shift=2
- Mark as EXPERIMENTAL in UI labels
- Support on both Qt and Android frontends

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-10-11 13:32:27 +10:00
Zephyron
996237f889 Merge branch 'multiple_compile_fixes' into 'main'
fix: Multiple Compiler Warnings

See merge request citron/emulator!92
2025-10-07 18:36:25 +10:00
collecting
0c2502f3fc fix: disable Warnings 2025-10-07 06:54:08 +00:00
collecting
ea26753051 fix: Add Copyright 2025-10-07 06:31:32 +00:00
collecting
add9a52fcd fix: Stable & Predictable 64-byte 2025-10-07 05:37:38 +00:00
collecting
19a5cde299 feat: Add Lanczos 2025-10-06 02:14:33 +00:00
collecting
0408e26e4c feat: Add Lanczos 2025-10-06 02:03:36 +00:00
Zephyron
44057a1b2b Merge branch 'wayland_flag' into 'main'
create: Flag for UI Layer

See merge request citron/emulator!60
2025-10-01 22:16:53 +10:00
Zephyron
9090a24c2e feat: add Low GPU Accuracy setting for maximum performance
Implements a new "Low" GPU accuracy level that prioritizes performance
over accuracy by aggressively cutting corners in GPU emulation.

Changes:
- Add GpuAccuracy::Low enum and setting infrastructure
- Implement IsGPULevelNormal() helper function
- Skip texture cache checks and query operations
- Use unsafe memory reads for DMA operations
- Disable fence delays and query precision
- Add UI support for desktop (Qt) and Android

Performance optimizations:
- Skips texture cache coherency checks (vk/gl_rasterizer.cpp)
- Non-blocking query synchronization (query_cache.h)
- Unsafe memory operations (dma_pusher.cpp)
- No macro parameter refresh (maxwell_3d.cpp)
- Immediate fence signaling (fence_manager.h)
- Non-precise Vulkan queries (vk_query_cache.cpp)

Ideal for lower-end hardware and users prioritizing FPS over accuracy.
Works on both desktop and Android platforms.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-10-01 21:45:23 +10:00
collecting
fe9683356b fix: wayland_flag 2025-09-29 04:45:47 +00:00
collecting
73b2ac113e create: Flag for UI Layer 2025-09-29 04:06:31 +00:00
Zephyron
274b027668 fix: allow Insane VRAM mode persistence
- Update VRAM setting max value from HighEnd to Insane
- Add TAA translation for UI
- Fixes issue where Insane VRAM reverts to HighEnd

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-09-27 11:48:01 +10:00
collecting
be70def422 #define STBI_NO_SIMD 2025-09-23 05:01:27 +00:00
collecting
c433436e8d #define STBI_NO_SIMD 2025-09-23 04:55:23 +00:00
Zephyron
19cf31b215 feat: add Temporal Anti-Aliasing (TAA) support for OpenGL and Vulkan
- Add TAA option to AntiAliasing enum in settings
- Implement TAA shaders for both OpenGL (GLSL) and Vulkan (SPIR-V)
- Add OpenGL TAA class with framebuffer management and temporal blending
- Add Vulkan TAA class following existing AntiAliasPass architecture
- Integrate TAA into OpenGL and Vulkan rendering pipelines
- Add UI translations and Android string resources for TAA option
- Implement Halton sequence jittering for temporal sampling
- Add motion vector validation and neighborhood clamping to reduce ghosting
- Configure aggressive temporal blending to minimize visual artifacts
- Add proper descriptor set management for Vulkan TAA implementation

The TAA implementation provides high-quality anti-aliasing by combining
information from multiple frames with per-pixel jittering, resulting
in smoother edges and reduced aliasing artifacts while maintaining
good performance and temporal stability.

Fixes: Black screen issues with proper descriptor set bindings
Fixes: Ghosting artifacts with improved temporal blending parameters
Fixes: Jitter visibility with reduced jitter intensity (50% scaling)
Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-09-21 10:34:19 +10:00
Zephyron
6e6b2f438e feat: add High-End and Insane VRAM modes with leak prevention
- Add HighEnd and Insane VRAM usage modes for RTX 4090/4080+ users
- Implement VRAM limits: HighEnd (12GB), Insane (22GB) with scaling
- Optimize buffer allocation with larger chunks for high-end GPUs
- Add VRAM leak detection and aggressive cleanup for Insane mode
- Increase shader compilation buffer sizes for better performance
- Add VRAM monitoring functions to Vulkan rasterizer
- Implement memory usage tracking for staging buffers

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-09-14 16:05:31 +10:00
Zephyron
00d6eb12d9 feat: Add list view toggle and separate applets settings category
- Add list/grid view toggle button to games fragment
- Implement dual-view GameAdapter with separate ViewHolders for grid/list layouts
- Create compact card_game_list.xml layout for list view
- Add "Applets on Android" settings category to separate applet settings from Zep Zone
- Add logging settings with log filter configuration
- Add view toggle icons (ic_view_list, ic_view_grid)
- Update strings.xml with new UI text and settings descriptions

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-08-21 16:47:08 +10:00
Zephyron
e27fc65d11 feat: remove frame generation options from all platforms
Frame generation was marked as WIP and not ready for production use.
This commit removes all frame generation related code and UI elements
to prevent users from enabling an incomplete feature.

Changes:
- Remove frame generation settings from Android UI (Kotlin/XML)
- Remove frame generation settings from Desktop UI (Qt/C++)
- Remove frame generation enums and settings from core (C++)
- Remove frame generation Vulkan renderer implementation
- Remove frame generation shader files
- Update CMake build configuration

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-08-17 16:09:05 +10:00
Zephyron
96dd82ea3b chore(network): Change web API from HTTPS -> HTTP
Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-08-11 18:41:23 +10:00
Zephyron
117c467ff3 feat: Add frame generation and enhance UE4 game compatibility
- Add frame generation settings (enabled/disabled, interpolation/extrapolation modes)
- Add frame skipping settings (enabled/disabled, adaptive/fixed modes)
- Implement frame skipping logic with adaptive and fixed modes
- Enhance UE4 crash handling with recovery mechanisms
- Add support for signed and float 32-bit image formats across shader backends
- Update Vulkan Validation Layers to v1.4.321.0
- Fix duplicate frame skipping options in Qt UI
- Improve memory handling for UE4 games (Hogwarts Legacy compatibility)
- Add enhanced bindless texture handling with fallback approach
- Update Android build configuration and dependencies

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-08-05 19:32:28 +10:00
Zephyron
568999fd59 feat: Improve FSR2 UI with dropdown quality mode and conditional FSR sharpness
- Convert FSR2 quality mode from number input to dropdown with 4 options
- Disable and grey out FSR sharpness slider when FSR2 is selected
- Add proper enum-based settings for FSR2 quality modes
- Update both Vulkan and OpenGL FSR2 implementations
- Connect UI state changes automatically

Provides better UX by using appropriate controls and preventing confusion
between FSR 1.0 and FSR 2.0 sharpening options.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-07-29 15:49:05 +10:00
Zephyron
3b8da3d80a feat: Add FSR 2.0 scaling filter option
- Add FSR2 to ScalingFilter enum alongside existing FSR
- Implement FSR2 classes for both Vulkan and OpenGL renderers
- Add fsr2_quality_mode setting with 4 quality levels (Quality, Balanced, Performance, Ultra Performance)
- Integrate FSR2 into present pipeline for both renderers
- Add UI support for FSR2 option in scaling filter dropdown
- Add FSR2 quality mode setting with dropdown selection
- Update translations and Android strings for new options
- Default to Performance mode for optimal balance

This provides users with FSR 2.0 as a scaling option, offering different
quality/performance characteristics compared to FSR 1.0. The implementation
uses quality-based sharpening values and integrates seamlessly with the
existing rendering pipeline.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-07-29 15:21:36 +10:00
Boss.sfc
fc480dcb69 fix: CachyOS LTO Compilation
Fix LTO linking issues on CachyOS with GCC 15.x

- Add LTO support to all core library targets (input_common, frontend_common,
  network, shader_recompiler, web_service) that were missing LTO configuration
- Create citron_configure_lto() helper function for consistent LTO handling
- Implement CachyOS-specific detection via /etc/os-release and kernel version
- Apply conservative LTO flags (-flto=auto -ffat-lto-objects) only for
  CachyOS + GCC 15+ to resolve linking errors with newer toolchains
- Other distributions continue using aggressive LTO settings for maximum performance
- Disable LTO on executable targets to prevent main function optimization issues

This resolves "undefined symbol" errors when building with -DCITRON_ENABLE_LTO=ON
on CachyOS while maintaining optimal LTO performance on other distributions.

Fixes linking errors including:
- Core::Frontend::EmuWindow symbols
- Core::System methods
- Settings::values
- Common logging functions

Tested on CachyOS with GCC 15.1.1 + LLD 20.1.8

Signed-off-by: Boss.sfc <boss.sfc@citron-emu.org>
2025-07-22 21:37:37 +07:00
Zephyron
c7bc05f1d0 Merge branch 'macOS-compilation-fix' into 'master'
fix: Resolve compilation issues with fmt library and formatters

See merge request citron/rewrite!35
2025-07-16 05:45:22 +00:00
Zephyron
97490b0586 fix: constrain file.h Open templates with C++20 concepts
Add HasValueType concept to prevent compilation errors when using raw
pointers like const char* with Open() templates. The templates now only
participate in overload resolution for types that have a value_type
member (e.g., std::string, std::filesystem::path).

Fixes C2039 and C2651 errors on Windows builds.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-07-16 15:41:41 +10:00
Boss.sfc
0fb39034c1 fix: Resolve compilation issues with fmt library and formatters
Fix multiple compilation errors preventing successful build:

* Add const qualifier to custom fmt formatter functions across codebase
  - Updated formatters in logging, shader recompiler, texture cache, and other modules
  - Ensures compatibility with newer fmt library versions

* Add missing fmt/ranges.h includes for fmt::join usage
  - Fixed fmt::join calls in Vulkan renderer, GDB stub, NFC service, and main window
  - Resolves "no member named 'join' in namespace 'fmt'" errors

* Exclude unsupported platforms from Boost.Process usage in debugger
  - Extended conditional compilation to avoid Boost.Process where unavailable

* Fix type casting issues in AOC service manager
  - Resolved std::min type mismatch with explicit casting
2025-07-16 11:11:33 +07:00
Zephyron
9ef1c76a2c feat: Add automatic update system with background checking
Implement a complete auto-updater system for Citron with the following features:

- Add UpdaterService class for handling update checks, downloads, and installations
- Add UpdaterDialog with progress tracking and user interaction
- Support both .zip and .7z archives with Windows PowerShell fallback
- Automatic background update checking on startup (3-second delay)
- Silent notifications when updates are available
- Manual "Check for Updates" menu option in Help menu
- User setting to enable/disable automatic update checks (enabled by default)
- Graceful error handling with detailed logging
- Restart functionality after successful updates
- Libarchive integration for cross-platform archive support

The system uses HTTP URLs to bypass SSL library compatibility issues and
provides a smooth user experience with minimal interruption during automatic
checks. Manual updates show a full dialog with progress tracking and changelog
information.

Fixes update distribution workflow and keeps users informed of new releases.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-07-11 16:22:28 +10:00
Zephyron
04b0624930 core/hle: Implement TMA (Target Manager Agent) service
Add implementation for the TMA service which provides file I/O
and debugging functionality for development tools.

Changes:
- Add TMA service with IFileManager, IFileAccessor, and IDirectoryAccessor
- Implement stubbed file operations (ReadFile, WriteFile, GetFileSize, etc.)
- Implement stubbed directory operations (ReadDirectory, GetEntryCount, etc.)
- Add TMA logging category for service debugging
- Fix parameter alignment in ReadFile function signature

All functions are provided as-is to allow games and development tools to initialize
without errors.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-07-01 16:25:30 +10:00
Zephyron
abf5f6730b audio_core: Add OpenAL audio backend support
- Add complete OpenAL sink implementation with robust error handling
- Support for device enumeration using ALC extensions
- Implement dummy streams for graceful degradation when OpenAL fails
- Add proper audio threading and buffer management
- Include comprehensive logging and diagnostic information
- Add stream limits and retry mechanisms for stability

Additional changes:
- Add ENABLE_OPENAL CMake option and OpenAL dependency management
- Include openal-soft in vcpkg dependencies
- Add OpenAL to audio engine settings enum

The OpenAL backend provides an alternative audio solution alongside
existing Cubeb and SDL2 backends, with enhanced device compatibility
and improved error recovery mechanisms.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-06-01 15:26:55 +10:00