Commit Graph

27547 Commits

Author SHA1 Message Date
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
a184f951e9 Merge branch 'auto-token-generation' into 'main'
feat: auto-generate multiplayer tokens

See merge request citron/emulator!106
2025-10-21 18:34:47 +10:00
Zephyron
caf1f93131 feat: auto-generate multiplayer tokens
Replace manual token verification with automatic UUID generation.
Tokens are now auto-generated on first save and can be reset via button.

- Remove verification logic and base64 encoding
- Add ResetToken() method with UUID generation
- Sync profile username to web service settings
- Simplify UI and improve error messages

Based on Torzu PRs #22 and #28.

Co-authored-by: anon <anon@noreply.localhost>
Co-authored-by: spectranator <spectranator@y2nlvhmmk5jnsvechppxnbyzmmv3vbl7dvzn6ltwcdbpgxixp3clkgqd.onion>
Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-10-21 18:34:18 +10:00
Zephyron
f6c2cfe69d Merge branch 'implement-library-applet-commands' into 'main'
am: Implement missing ILibraryAppletCreator and ILibraryAppletAccessor commands

See merge request citron/emulator!105
2025-10-21 18:01:38 +10:00
Zephyron
543dc05008 am: Implement missing ILibraryAppletCreator and ILibraryAppletAccessor commands
Adds support for newer firmware commands:
- ILibraryAppletCreator::CreateLibraryAppletEx (cmd 3) - Added in firmware 20.0.0+
  Takes an additional thread_id parameter compared to CreateLibraryApplet
- ILibraryAppletAccessor::Unknown90 (cmd 90) - Unknown command from newer firmware
  Stubbed with generic parameter logging

Fixes assertion: Unknown / unimplemented function '3': port='ILibraryAppletCreator'
Fixes assertion: Unknown / unimplemented function '90': port='ILibraryAppletAccessor'

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-10-21 18:01:05 +10:00
Zephyron
37515d753f Merge branch 'filesystem-accuracy' into 'main'
core/filesystem: Implement accurate SaveData system

See merge request citron/emulator!104
2025-10-21 17:50:33 +10:00
Zephyron
98c6ac8961 core/filesystem: Implement accurate SaveData system
- Add transactional ExtraData with journaling (6 service functions)
- Implement atomic commit with crash recovery
- Add HOS-compliant path normalization
- Fix all ResultUnknown returns and add 9 HOS error codes
- Add directory journaling with /0 (committed) and /1 (working)
- Implement cross-tree directory moves

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-10-21 17:49:59 +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
ac21b19165 vulkan: fix flickering objects and texture corruption
- Fix critical memory barrier bug: add missing newLayout assignment in write_barrier
- Improve texture swizzling with dynamic block height calculation:
  * RGB565 format: use block_height_log2 = 3
  * Small textures (≤256x256): use block_height_log2 = 3
  * Add validation to prevent corruption from invalid sizes
- Enhance memory barriers with proper stage synchronization:
  * Add VK_ACCESS_SHADER_READ_BIT to source access mask
  * Use correct pipeline stages for transfer operations
  * Ensure proper layout transitions (UNDEFINED → TRANSFER_DST → SHADER_READ_ONLY)
- Fix descriptor set layout: use VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL
- Add framebuffer dimension validation (max 8192x8192) to prevent crashes
- Add fallback mechanism for invalid texture data (raw memory copy)

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-10-17 18:44:07 +10:00
Zephyron
6d53fec8db discord: optimize RPC game image loading
- Remove blocking network timeout check that was causing 5-second delays
- Simplify logic to always attempt using Tinfoil game images
- Let Discord handle image loading and fallback gracefully
- Clean up URL formatting for better consistency
- Remove unnecessary network validation that caused false negatives

This fixes the issue where Discord RPC would fall back to default
Citron logo due to network timeouts, allowing game-specific artwork
to display properly from Tinfoil's CDN.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-10-17 17:31:20 +10:00
Zephyron
3f71089f6d ci: disable GitLab CI configuration
- Comment out all GitLab CI stages (build, test, package)
- Preserve original configuration for future reference
- Switch to GitHub Actions for CI/CD automation
- Prevents unnecessary automated builds on GitLab VPS

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-10-17 17:29:16 +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
dd49615a48 shader_recompiler: Add missing texture types for SURED instruction
The SURED (Surface Reduction) instruction can operate on cube maps and 3D
texture arrays which were previously missing from the Type enum, causing
shader translation failures.

Changes:
- Add ARRAY_3D and CUBE to Type enum
- Map ARRAY_3D to Color3D and CUBE to ColorCube in GetType()
- Update MakeCoords() to handle array and cube coordinate generation

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-10-17 16:09:03 +10:00
Zephyron
d8d54c5ccf shader_recompiler: Fix alpha-to-coverage fragment output interface
The Vulkan spec requires fragment shaders to declare an output covering
Location 0, Component 3 (alpha) when alpha-to-coverage is enabled. This change:

- Tracks alpha_to_coverage_enabled through RuntimeInfo from pipeline state
- Forces declaration of frag_color[0] with full RGBA when enabled
- Initializes alpha to 1.0 in shader epilogue if not explicitly written

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-10-17 16:07:35 +10:00
Zephyron
7dea15e642 Revert "fix: Prevent race condition on unmapped memory reads"
This reverts commit 13c60ebcde.

This needs a rework as it caused Shader Corruption On Many Titles
2025-10-16 17:40:53 +10:00
Zephyron
ab18e750d8 feat: Add ZIP firmware installation and update Android VVL to 1.4.328.1
Firmware Installation:
- Add OnInstallFirmwareFromZip() to install firmware from ZIP archives
- Implement ExtractZipToDirectory() with libarchive (primary) and PowerShell fallback (Windows)
- Add user dialog to choose between folder or ZIP installation
- Validate NCA files at ZIP root before installation
- Automatic cleanup of temporary extraction directory

Android Vulkan Validation Layers:
- Update from sdk-1.3.261.1 to vulkan-sdk-1.4.328.1
- Fix extraction path for new VVL archive structure
- Add file existence checks and improved error messages

Benefits:
- Users can install firmware directly from ZIP files
- No manual extraction required
- Better debugging on newer Android devices

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-10-16 16:31:49 +10:00
Zephyron
c64bcb3f82 Merge branch 'fix_linux_test_unit' into 'main'
fix: .gitlab-ci.yml

See merge request citron/emulator!103
2025-10-16 16:21:19 +10:00
collecting
c664d913dc fix: Re-add Package-Release 2025-10-16 01:59:30 +00:00
collecting
058df85af0 fix: .gitlab-ci.yml 2025-10-16 01:52:31 +00:00
Zephyron
f3374ea7e6 Merge branch 'unmapped_memory_fix' into 'main'
fix: Prevent race condition on unmapped memory reads

See merge request citron/emulator!99
2025-10-15 15:05:47 +10:00
collecting
13c60ebcde fix: Prevent race condition on unmapped memory reads 2025-10-15 04:24:03 +00:00
Zephyron
61ba432ac0 Merge branch 'resize_windows_fix' into 'main'
fix: Dialogs now correctly remember their window size

See merge request citron/emulator!98
2025-10-15 12:23:03 +10:00
Zephyron
038619c543 remove: first-time telemetry popup
Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-10-14 15:56:20 +10:00
Zephyron
c15b6519d5 chore: replace wiki URLs with Discord support links
Replace all citron-emu.org/help and wiki URLs with discord.gg/citron
across Android resources (15+ languages) and desktop UI.

- Update app disclaimers, error messages, and help links
- Consolidate FAQ/Quickstart/Mods menu items into "Get Support"

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-10-13 13:59:48 +10:00
collecting
b162d63a1b fix: Resizable w/ Window Memory 2025-10-12 21:45:53 +00:00
collecting
9f30085cbb fix: Resizable w/ Window Memory 2025-10-12 21:45:19 +00:00
collecting
e96c9d7a8f fix: Resizeable w/ Window Memory 2025-10-12 21:44:43 +00:00
collecting
8c629a29c3 fix: Non-fullscreen & Resize Memory 2025-10-12 21:43:05 +00:00
Zephyron
31528201b5 ci: Use Qt6 system packages instead of Qt5
Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-10-12 18:31:52 +10:00
Zephyron
2ad9d9d17a ci: Use system Qt6 instead of downloading with aqt
Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-10-12 18:17:41 +10:00
Zephyron
ec7c6787cd ci: Add python-pip to fix Qt download with aqt
Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-10-12 17:59:16 +10:00
Zephyron
a15719b21d hid_core: Add NpadCondition to shared memory to fix no-controller crash
Fix crash when launching games without a connected controller by adding
a global NpadCondition structure at offset 0x3E200 in HID shared memory.
Games read this structure on startup to verify controller state validity,
and crash with a userspace PANIC if the data is uninitialized.

The NpadCondition structure contains:
- is_initialized flag (set to 1)
- hold_type (controller orientation)
- is_valid flag (set to 1)

These fields are properly initialized when shared memory is created,
ensuring games see valid controller state data even before any
controllers are physically connected.

Fixes crash in The Legend of Zelda: Echoes of Wisdom and other titles
that validate controller state on startup.

Based on LotP's implementation of the NpadCondition structure.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-10-12 16:49:03 +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
df14b96c6b feat: Add romfslite mod folder support (Atmosphere 1.9.5)
Support the romfslite folder type introduced in Atmosphere 1.9.5 for
memory-optimized mod loading. The emulator now detects and loads
romfslite folders the same way as romfs folders.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-10-11 20:24:18 +10:00
Zephyron
c8b3f0c98c Fix: Explicit float casts for Android NDK compilation
Add static_cast<f32>() to integer-to-float conversions in audio_core
to satisfy Android NDK's -Werror=implicit-int-float-conversion flag.

Fixes compilation errors in fft.cpp, loudness_calculator.cpp, and
limiter.cpp on Android builds.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-10-11 18:51:08 +10:00
Zephyron
4e0178c678 Merge branch 'sdk20-rev15-audio-changes' into 'main'
feat: REV15 audio renderer + HID fix (v0.8.0)

See merge request citron/emulator!97
0.8.0
2025-10-11 17:11:09 +10:00
Zephyron
fbb4f5c015 Fix: Recover from null pointer execution crashes
Add proper recovery mechanism for null pointer execution (PC < 0x1000)
by returning from invalid function calls using the Link Register instead
of blindly continuing execution.

Fixes infinite crash loop in games like Little Nightmares III.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-10-11 17:02:28 +10:00
Zephyron
56dba09e0c feat: REV15 audio renderer + HID fix (v0.8.0)
Complete SDK15 audio implementation with native float biquads.
Fixes TotK 1.4.2 and BotW 1.8.2 boot loops.

- Add REV15 float biquad filter support
- Implement VoiceInParameterV2 (0x188 bytes)
- Add SplitterDestinationV2b with biquad filters
- Fix HID sampling number (double state value)
- Add AudioSnoopManager and AudioSystemManager
- Implement FinalOutputRecorder system
- Add FFT and loudness calculator (ITU-R BS.1770)
- Add full Limiter effect

Resolves boot loops and controller detection in SDK20 games.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-10-11 14:10:08 +10:00
Zephyron
3c16d8330b chore: Version bump to 0.8.0
Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-10-11 13:51:57 +10:00
Zephyron
ded5906f03 chore: Version bump to 0.7.2
Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-10-11 13:47:57 +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
568ab699f6 feat(renderer): Add ScaleFX pixel art upscaling filter
Implements ScaleFX algorithm for pixel art upscaling with edge
preservation. Supports both OpenGL and Vulkan with FP16/FP32
variants for hardware optimization.

ScaleFX is designed to reduce pixelation while preserving sharp
edges, ideal for low-resolution and pixel art games.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-10-11 13:35:19 +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
bdd2875642 feat: Add Profile-Guided Optimization (PGO) build support
Implements two-stage PGO build system with CMake integration and
automated build scripts for Windows, Linux, and macOS. Supports
MSVC, GCC, and Clang compilers.

PGO enables runtime profiling-based optimizations for improved
emulator performance. Includes helper scripts to streamline the
build workflow and resolve platform-specific issues.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-10-11 13:30:39 +10:00
Zephyron
2a7e6c74bd Fix Android RAM overlay instant crash
Use getMainLooper() instead of myLooper() in Handler initialization
and add view attachment checks to prevent crashes.

Reported-by: Shadai (theonlyshadai) on Discord
Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-10-08 16:59:38 +10:00
Zephyron
4c5f12ec69 fix(qt): Use QImage::mirrored() instead of non-existent flipped()
QImage does not have a flipped() method. Replace with the correct mirrored(false, true) call to perform vertical image flipping for
screenshot capture.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-10-08 16:24:54 +10:00
Zephyron
c98d253040 cmake: Auto-create user directory for portable mode
Suggested-by: dr.stug@citron-emu.org
Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-10-08 16:21:14 +10:00
Zephyron
c1a6f2d47b Merge branch 'refine_lanczos' into 'main'
fix(Renderer): Stabilize Lanczos Filter

See merge request citron/emulator!96
2025-10-08 11:13:06 +10:00
Zephyron
20cf1339a5 Merge branch 'perf_temp_feat' into 'main'
feat(overlay): Add CPU & GPU Temperature Monitoring

See merge request citron/emulator!95
2025-10-08 11:12:45 +10:00
Zephyron
15498b13d4 Merge branch 'web_backend_bug' into 'main'
fix: Use-After-Free Bug

See merge request citron/emulator!94
2025-10-08 11:12:17 +10:00