Commit Graph

2160 Commits

Author SHA1 Message Date
Zephyron
1543418260 refactor(settings): simplify GC aggressiveness to Off/Light only
Remove Moderate, Heavy, and Extreme GC aggressiveness levels, keeping only Off and Light options for simpler configuration.

- Light mode now uses 75%/90% VRAM thresholds

- Simplified switch statements in texture/buffer cache

- Updated UI dropdowns for desktop and Android

- Light is now the default and recommended setting
2026-01-30 17:55:43 +10:00
Zephyron
5600aefcd5 chore(core): update build config for QLaunch services
- Add application_observer and system_process_common_functions to CMakeLists

- Add enable_home_menu setting option
2026-01-28 16:43:07 +10:00
Collecting
af5eb92450 fix(graphics/adv): Ensure STPE is auto-disabled
Games appear to have horrendous VRAM leaking with this setting enabled. By default, this setting was turned on, leaving users without any information of the setting or what the setting does and seems to have adverse effects in certain titles. Disabling it so that users don't have it automatically chosen.

Signed-off-by: Collecting <collecting@noreply.localhost>
2026-01-26 00:26:05 +01:00
Collecting
6253352e1e fix(compiler): generate the vtable within settings.cpp
Signed-off-by: Collecting <collecting@noreply.localhost>
2026-01-25 13:42:55 +01:00
Zephyron
8eaa38540c refactor(settings): simplify VRAM usage mode to Conservative/Aggressive
The removed modes added complexity without significant benefit now that
the new VRAM management system (gc_aggressiveness, vram_limit_mb)
provides finer-grained control over memory pressure.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2026-01-25 15:29:25 +10:00
Zephyron
3e2137a470 feat(video_core): implement comprehensive VRAM management system
Add automatic VRAM leak prevention with configurable garbage collection
to prevent device loss crashes during extended play sessions.

New Settings:
- vram_limit_mb: Configurable VRAM limit (0 = auto-detect 80%)
- gc_aggressiveness: Off/Light/Moderate/Heavy/Extreme levels
- texture_eviction_frames: Frames before texture eviction (default 2)
- buffer_eviction_frames: Frames before buffer eviction (default 5)
- sparse_texture_priority_eviction: Prioritize large sparse textures
- log_vram_usage: Enable VRAM statistics logging

Core Changes:
- Enhanced texture cache with LRU eviction and sparse texture priority
- Enhanced buffer cache with configurable eviction thresholds
- Added VRAM pressure monitoring using VK_EXT_memory_budget
- Emergency GC triggers at 90%/95% VRAM usage thresholds

Platform Support:
- Desktop: Settings in Graphics > Advanced tab
- Android: Settings in Zep Zone category

Fixes VRAM climbing steadily during gameplay until device loss.
Target: Stable VRAM usage below configured limit for 2+ hours.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2026-01-25 15:21:02 +10:00
Collecting
a5a6ed7f37 fix(core): Properly release memory when stopping emulation
Signed-off-by: Collecting <collecting@noreply.localhost>
2026-01-09 04:44:13 +00:00
Collecting
5a28f13c06 fix(core): Properly release memory when stopping emulation
Signed-off-by: Collecting <collecting@noreply.localhost>
2026-01-09 04:43:25 +00:00
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