Commit Graph

23959 Commits

Author SHA1 Message Date
collecting
09ef525ef2 Fix null pointer dereference in patch_manager.cpp line 362 2025-09-22 08:54:03 +00:00
Zephyron
a76c3e8808 fix: resolve UpdaterService redefinition error with conditional compilation
Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-09-21 11:33:26 +10:00
Zephyron
b585120025 fix: add UpdateResult enum to updater dialog forward declarations
Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-09-21 11:11:30 +10: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
42bc6b7b6c fix(android): Fix aspect ratio crash for non-16:9 settings
- Add missing Force 32:9 option and fix Stretch mapping
- Add safety checks to prevent division by zero in FixedRatioSurfaceView
- Update handlers to support all 6 AspectRatio enum values

Fixes crashes when selecting any aspect ratio other than Force 16:9.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-09-17 20:46:59 +10:00
Zephyron
da3f017c32 fix: resolve Qt MOC generation for conditionally compiled UpdaterDialog
Move UpdaterDialog class declaration outside #ifdef _WIN32 to ensure
Qt's MOC can see the Q_OBJECT macro. Add stub implementations for
non-Windows platforms to satisfy linker.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-09-17 20:27:22 +10:00
Boss.sfc
056e6bf951 chore(core/debugger): modernize Boost.Process include path to v1
Signed-off-by: Boss.sfc <boss.sfc@citron-emu.org>
2025-09-15 21:59:01 +07:00
Boss.sfc
a3c4f0614a fix: Linux compiling
Made it so that the updater stuff is windows only.

Signed-off-by: Boss.sfc <boss.sfc@citron-emu.org>
2025-09-14 18:46:18 +07:00
Zephyron
94119302ec feat: Add OpenGL ZBC clear support and refactor ZBC management
Moved ZBCManager to `video_core/zbc_manager.cpp/h` for modularity. Added
`gl_zbc_clear.cpp/h` for efficient OpenGL color, depth, and stencil clears.
Updated `RasterizerOpenGL::Clear` to use ZBC with fallback. Added stencil
type validation. Fixed color mask and logging. Updated `CMakeLists.txt`.
Enhances performance and code organization.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-09-14 20:28:39 +10:00
Zephyron
12c3e4b92c Revert "fix: resolve X11 macro conflicts with enum values and Qt constants"
This reverts commit c32ac3b3c1.
2025-09-14 20:15:29 +10:00
Zephyron
c32ac3b3c1 fix: resolve X11 macro conflicts with enum values and Qt constants
Rename Success enums and fix Qt event types to avoid X11 macro conflicts.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-09-14 20:09:09 +10:00
Zephyron
2d890316ad shader_recompiler: Implement ISBERD instruction for internal stage buffer reads
This commit properly implements the ISBERD (Internal Stage Buffer Entry Read)
instruction that was previously stubbed. The implementation supports all
modes and shift types:

- Patch mode: Reads tessellation patch attributes using ir.GetPatch()
- Prim mode: Reads primitive attributes for geometry shaders
- Attr mode: Reads generic vertex attributes
- Default mode: Maintains backward compatibility

The implementation also supports:
- U16 and B32 shift modes for different data formats
- SKEW and O flags for advanced buffer addressing
- Proper data type conversions and bit casting

This fixes rendering issues in UE4 titles that rely on internal stage
buffer operations in tessellation and geometry shaders. The previous
stubbed implementation caused compatibility problems with modern
rendering pipelines.

Credit: Hayate Yoshida (吉田 疾風) <hayate@citron-emu.org> for discovering
the root cause and providing insight on the proper implementation approach.

Fixes: Internal stage buffer read operations in tessellation shaders
Resolves: UE4 title rendering issues related to ISBERD instruction
Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-09-14 19:01:19 +10:00
Zephyron
ce06115c2c Revert "shader_recompiler: Implement ISBERD instruction"
This reverts commit d2c6f3ab9c.
2025-09-14 18:19:36 +10:00
Zephyron
3c70fd52bd fix: update Android build config and dependencies
Update NDK/CMake versions, switch default build variant, re-enable x86_64
support, add ConstraintLayout dependency, and enable LTCG optimization.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-09-14 16:09:04 +10:00
Zephyron
0b0b61572b Merge branch 'insane-vram-mode' into 'main'
feat: add High-End and Insane VRAM modes with leak prevention

See merge request citron/emulator!3
2025-09-14 16:06:09 +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
8356d9fea0 fix: clean up VRAM overlay layout and remove visual clutter
- Remove cut-off percentage labels from graph area
- Isolate graph with proper background and border
- Reduce padding and spacing to match performance overlay
- Compress leak warnings to single line
- Adjust widget size to 250x180 for consistent proportions

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-09-14 16:00:13 +10:00
Zephyron
192cb91286 feat: add VRAM monitoring overlay with modern UI
- Clean dark-themed overlay with real-time VRAM usage display
- Memory breakdown (Buffers, Textures, Staging) with color coding
- Interactive graph with 2-minute history and leak detection
- VRAM mode indicator with special highlighting for Insane mode
- Draggable interface with persistent positioning
- Menu integration with keyboard shortcut support
- Safe Vulkan renderer integration with exception handling

Files: CMakeLists.txt, main.cpp, main.h, main.ui, uisettings.h, vram_overlay.cpp, vram_overlay.h
Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-09-14 15:49:27 +10:00
Zephyron
56d8bd7dd3 feat: Add mouse wheel support for game input passthrough
- Implement mouse wheel event handling in SDL2 backend (emu_window_sdl2)
- Add wheel event routing from GRenderWindow to input subsystem
- Add debugging logs to trace mouse wheel events through input chain
- Support mouse wheel input for mods like Ultracam when games are running (WIP)

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-09-14 15:18:38 +10:00
Zephyron
69c3bc705c feat: implement missing kernel event handle and service function
- Implement CreateInterruptEvent SVC function to resolve panic
  - Add proper resource management with KScopedResourceReservation
  - Use regular KEvent as placeholder for interrupt events
  - Add proper cleanup with SCOPE_EXIT
  - Include debug logging for troubleshooting

- Implement GetLaunchRequiredVersionUpgrade in IApplicationFunctions service
  - Fix "Unknown / unimplemented function" error for command 210
  - Return event handle instead of boolean to match Nintendo Switch API
  - Use state_changed_event as placeholder until dedicated event is implemented
  - Add function declaration to header file

Tested with Hollow Knight: Silksong - successfully boots.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-09-06 14:20:45 +10:00
Zephyron
50afaefffb feat: Enhanced Nintendo SDK crash detection and recovery system
* Enhanced ARM interface backtrace logging with Nintendo SDK crash detection
  - Detects nnSdk module crashes and initialization-time failures
  - Provides detailed recovery suggestions and logging
  - Identifies recoverable vs non-recoverable crashes

* Improved physical core crash handling
  - Enhanced prefetch abort and data abort recovery
  - Continues execution for Nintendo SDK crashes instead of suspending
  - Better logging for crash analysis and debugging

* Expanded SVC exception handling
  - Added Nintendo SDK-specific crash recovery logic
  - Enhanced general crash recovery for low-address and assertion failures
  - Improved UE4 crash handling integration

* Updated Horizon OS version to 20.4.0
  - Updated HOS_VERSION_MINOR from 1 to 4
  - Updated HOS_VERSION_MICRO from 5 to 0
  - Updated version hash and display strings accordingly

* Fixed Vulkan turbo mode performance metrics
  - Added proper type casting for execution time comparisons
  - Prevents potential integer overflow issues

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-09-05 14:57:58 +10:00
Zephyron
ae46d4629f Merge branch 'vulkan-turbo-mode-optimization' into 'master'
vulkan: Add adaptive timeout and auto-disable to turbo mode

See merge request citron/rewrite!56
2025-08-26 08:33:43 +00:00
Zephyron
c851521a6b vulkan: Add adaptive timeout and auto-disable to turbo mode
- Implement adaptive timeout system that adjusts based on GPU performance
- Add auto-disable after 10 cycles of persistent timeouts
- Reduce workload (32x32 dispatch, 1MB buffer) for better compatibility
- Add performance monitoring and runtime control
- Fixes persistent timeout warnings by gracefully degrading when GPU is busy

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-08-26 18:30:58 +10:00
Zephyron
4cdc602f1e vulkan: Optimize descriptor update queue performance
- Increase frame count (8→12) and payload size (0x20000→0x40000)
- Add batch operations and memory management helpers
- Improve overflow handling with statistics tracking
- Create specialized classes for different workload types
- Implement smart pre-allocation and memory optimization
- Add comprehensive performance monitoring

Improves performance for Switch titles with complex shaders under Vulkan.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-08-26 16:15:10 +10:00
Zephyron
f819b5d58d nvdrv: Implement ZBC table management with GPU memory integration
- Replace stubbed ZBCSetTable with comprehensive implementation
- Add parameter validation for format and type fields
- Implement detailed logging of ZBC color values for debugging
- Add proper documentation explaining ZBC (Zero Bandwidth Clear) functionality
- Handle color_ds and color_l2 arrays for GPU memory clearing operations
- Validate format parameter range (0-0xFF) and type parameter (0-1)
- Provide clear error handling for invalid parameters
- Add ZBCManager singleton class for global ZBC table management
- Implement ZBCQueryTable with full table lookup functionality
- Add thread-safe ZBC table storage with proper mutex protection
- Create ZBC namespace helper functions for GPU clearing operations
- Fix IoctlGpuCharacteristics struct size (0xA0) by correcting field types
- Add comprehensive logging and error handling for ZBC operations
- Enable ZBC table integration with GPU memory management system
- Store ZBC entries in both local device table and global manager
- Implement reference counting for proper ZBC entry lifecycle management

ZBC (Zero Bandwidth Clear) allows the GPU to perform efficient memory
clearing operations without requiring CPU bandwidth by storing clear
values in a dedicated table that can be referenced during rendering.
This implementation provides the foundation for zero-bandwidth clear
operations, allowing the GPU to efficiently clear color and depth
buffers using pre-defined values stored in the ZBC table.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-08-25 18:00:23 +10:00
Zephyron
9f13c0a827 nvdrv: Implement ZBCSetTable with proper parameter validation and logging
- Replace stubbed ZBCSetTable with comprehensive implementation
- Add parameter validation for format and type fields
- Implement detailed logging of ZBC color values for debugging
- Add proper documentation explaining ZBC (Zero Bandwidth Clear) functionality
- Handle color_ds and color_l2 arrays for GPU memory clearing operations
- Validate format parameter range (0-0xFF) and type parameter (0-1)
- Provide clear error handling for invalid parameters

ZBC (Zero Bandwidth Clear) allows the GPU to perform efficient memory
clearing operations without requiring CPU bandwidth by storing clear
values in a dedicated table that can be referenced during rendering.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-08-25 17:21:06 +10:00
Zephyron
3af5af3078 service: Implement QueryPointerBufferSize with proper IPC buffer calculation
- Replace stubbed QueryPointerBufferSize with comprehensive implementation
- Calculate pointer buffer size based on IPC message buffer requirements
- Account for all buffer descriptor types (X, A, B, W, C) and message headers
- Include proper alignment and overhead calculations
- Cap buffer size to reasonable maximum (64KB) to prevent excessive memory usage
- Use dynamic calculation instead of hardcoded 0x8000 value
- Add detailed comments explaining the buffer size calculation logic

This implementation properly handles the IPC marshalling requirements for
pointer buffers used in service communication, eliminating the frequent
stub warnings in the logs.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-08-25 16:55:33 +10:00
Zephyron
d2c6f3ab9c shader_recompiler: Implement ISBERD instruction
- Replace stubbed ISBERD implementation with proper internal stage buffer read
- Add support for different modes (Default, Patch, Prim, Attr)
- Implement shift operations (U16, B32) for buffer data processing
- Convert float results from GetAttributeIndexed to unsigned integers
- Handle buffer index from source register for stage buffer access
- Maintain proper error handling for unimplemented features (SKEW, O)

This completes the internal stage buffer entry read functionality for Maxwell shader translation.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-08-25 16:26:05 +10:00
Zephyron
432d6da7c1 fix(network): prevent datagram socket SendTo errors in HDR multiplayer
Changes:
- Add validation in BSD::SendToImpl to check for empty address buffers on
  datagram sockets and return EINVAL instead of passing nullptr to sendto()
- Add null pointer check in ProxySocket::SendTo to prevent dereferencing
  nullptr address parameters
- Improve error logging to help identify socket configuration issues

Fixes: Socket operation errors in HDR multiplayer sessions
Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-08-24 16:39:39 +10:00
Boss.sfc
01757c21ea fix: Linux compilation
There were linking errors

Signed-off-by: Boss.sfc <boss.sfc@citron-emu.org>
2025-08-23 18:53:24 +07: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
2d43a2d47b feat: add movable shader building overlay with touch handling
- Add touch event handling to ShaderBuildingOverlayView for dragging
- Implement boundary constraints to keep overlay within screen bounds
- Add visual feedback with border color changes during dragging
- Add resetPosition() method to restore overlay to default position
- Move ShaderBuildingOverlayView to separate FrameLayout for absolute positioning
- Set container to non-clickable to prevent interference with input controls
- Maintain clickable/focusable state only on the overlay view itself

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-08-17 17:03:52 +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
06f13f3cb1 android: Add shader building overlay with performance graph
- Add new settings for shader building overlay and performance graph
- Create ShaderBuildingOverlayView with animated shader building indicator
- Implement JNI bridge to get shader building count from core
- Add performance metrics display (FPS, frametime, emulation speed)
- Include real-time frametime graph with min/avg/max statistics
- Add menu options to toggle overlay and graph independently
- Integrate with existing overlay system in EmulationFragment
- Optimize Vulkan pipeline cache loading with pre-reservation
- Improve async shader building to reduce main thread blocking

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-08-17 15:48:06 +10:00
Zephyron
85324599a6 sockets/network: relax SockAddrIn len check and fix port byte-order to avoid SSBU crashes
- Accept SockAddrIn len in [6, sizeof] and warn instead of asserting to handle libnx/SSBU quirks
- Ensure TranslateFromSockAddrIn sets sin_port via htons(uint16_t) for consistent network byte-order
- Prevents assertion crashes and reduces “Broken pipe” error spam observed in Frozen's SSBU logs

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-08-11 20:59:44 +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
Boss.sfc
f9758f1770 feat: Updated MoltenVK
Signed-off-by: Boss.sfc <boss.sfc@citron-emu.org>
2025-08-08 16:02:09 +07: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
011a546229 android: Add applet mode settings to UI
Add comprehensive applet mode configuration options to the Android settings
interface. This includes settings for all major applets:

- Cabinet applet mode
- Controller applet mode
- Data Erase applet mode
- Error applet mode
- Network Connect applet mode
- Player Select applet mode
- Software Keyboard applet mode
- Mii Edit applet mode
- Web applet mode
- Shop applet mode
- Photo Viewer applet mode
- Offline Web applet mode
- Login Share applet mode
- WiFi Web Auth applet mode
- My Page applet mode

Each setting allows users to choose between HLE (High-Level Emulation)
and LLE (Low-Level Emulation) modes for individual applets, providing
granular control over applet emulation behavior.

Changes:
- Add applet mode settings to IntSetting enum
- Add corresponding string resources for all applet settings
- Add applet mode choice arrays (HLE/LLE options)
- Add applet settings section to SettingsItem mapping
- Add applet settings header and all applet mode settings to
  SettingsFragmentPresenter

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-08-05 17:29:45 +10:00
Zephyron
45daff11c9 feat(audio): Fix OpenAL auto detection
This commit addresses serveral bugs within the audio service where OpenAL would fail to register the output device to the mapped engine.

- Increase null safety checks for all audio backends (cubeb, sdl2, openal)
- Added failsafe for Device selection

These ensure the audio_renderer can validate calls from the OpenAL engine, Credits to Hayate Yoshida for helping Identify the issue.

Credit: Hayate Yoshida <hayate_yoshida@citron-emu.org>
Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-08-02 20:36:40 +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
Zephyron
d38b58ca77 Merge branch 'performance-overlay-enhancements' into 'master'
feat: enhance performance overlay with frame graph and draggable UI

See merge request citron/rewrite!42
2025-07-27 10:52:07 +00:00
Zephyron
93a48ad682 feat: enhance performance overlay with frame graph and draggable UI
- Add real-time frame time graph with min/avg/max statistics
- Implement draggable overlay functionality with cursor feedback
- Modernize UI with Material Design colors and improved typography
- Fix crash issues by throttling performance data updates
- Ensure FPS and frame time consistency
- Add proper error handling and validation
- Increase overlay size to accommodate new graph feature

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-07-27 20:50:57 +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
eb4512e9de Merge branch 'CachyOS-compiling-fix' into 'master'
fix: Compiling for CachyOS

See merge request citron/rewrite!39
2025-07-22 06:34:51 +00:00
Zephyron
f5bea18fd9 frontend: Improve High DPI support and scaling
This patch enhances High DPI support across the Qt frontend with the following improvements:

**Windows DPI Awareness:**
- Add shellscalingapi.h include for Windows DPI functions
- Implement Per Monitor DPI Awareness (Windows 8.1+) and Per Monitor v2 DPI Awareness (Windows 10+)
- Use SetProcessDPIAware() and SetProcessDpiAwareness() for better multi-monitor scaling
- Dynamically load shcore.dll to access modern DPI awareness APIs

**Configuration Dialog Enhancements:**
- Add comprehensive High DPI responsive CSS media queries for different DPI levels (192dpi, 240dpi)
- Scale UI elements (buttons, comboboxes, line edits, checkboxes, radio buttons) based on screen DPI
- Improve scroll area styling with proper scrollbar theming for high DPI displays
- Set proper window attributes for scaling (WA_TranslucentBackground, WA_NoSystemBackground)
- Calculate logical window size based on device pixel ratio for accurate scaling

**UI Improvements:**
- Enhanced scroll area styling with custom scrollbar appearance
- Better visual feedback with hover effects on scrollbar handles
- Improved spacing and sizing for high DPI displays
- Set proper window modality and title for configuration dialog

These changes provide better visual quality and usability on high DPI displays, particularly on Windows systems with multiple monitors or high-resolution screens. The scaling is now more accurate and consistent across different display configurations.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-07-22 16:30:47 +10:00
Boss.sfc
e02ba8b5bf fix: Compiling for CachyOS
- Made CreateScrollArea function static to limit its linkage to the current translation unit.

Signed-off-by: Boss.sfc <boss.sfc@citron-emu.org>
2025-07-22 13:29:16 +07:00
Zephyron
0d05f64e79 fix: Prevent controller crashes and memory leaks in game list grid view
- Fix memory leak in PopulateGridView() and FilterGridView() by properly
  deleting old QStandardItemModel instances before creating new ones
- Add safety checks in controller navigation to prevent crashes when
  accessing uninitialized controller data
- Improve controller input handling to only send events to visible and
  properly initialized views
- Add null pointer checks in SetViewMode() to prevent crashes when
  setting current index on empty models
- Add proper cleanup in GameList destructor to prevent memory leaks
  on application shutdown

The main issue was that switching between list and grid views created
new models without properly cleaning up old ones, leading to memory
leaks. Additionally, controller navigation would send keyboard events
to both views simultaneously, causing crashes when one view was not
properly initialized or visible.

Fixes crashes when using controller navigation in grid view mode.

Thanks to Beta Testers acarajé & Hayate Yoshida (吉田 疾風) for finding the bug.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-07-21 21:23:51 +10: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