Commit graph

27229 commits

Author SHA1 Message Date
Zephyron
b24dd921aa revert 31694994f2
revert arm_nce: Hash TLB to MLP L2 Update
2025-03-06 06:44:06 +00:00
Zephyron
9a65205dba revert ee3d858935
revert Follow Up Of the previous commit with the update of TLB update
2025-03-06 06:43:37 +00:00
Zephyron
af4f08be33 revert 6565055865
revert Fix: Core_Memory logging and ARM_NCE Mutex logging
2025-03-06 06:42:48 +00:00
Zephyron
0d0963d32f revert 90a8165f77
revert Added: Core_Memory to filter logging class
2025-03-06 06:42:30 +00:00
Zephyron
4491127f52 revert 031c635095
revert arm: corrected declarations
2025-03-06 06:41:01 +00:00
Zephyron
c304afe2b3 revert 78b0080b96
revert TLB: Parallel Page Table Walk Logic Implementation
2025-03-06 06:40:24 +00:00
Zephyron
b8240b4214 revert 644ed69285
revert arm:
2025-03-06 06:40:17 +00:00
Zephyron
91487f6d96 revert 3554f55fc9
revert TLB Update
2025-03-06 06:39:49 +00:00
CamilleLaVey
031c635095 arm: corrected declarations 2025-03-05 11:12:44 -04:00
CamilleLaVey
90a8165f77 Added: Core_Memory to filter logging class 2025-03-05 01:31:22 -04:00
CamilleLaVey
6565055865 Fix: Core_Memory logging and ARM_NCE Mutex logging 2025-03-05 00:25:31 -04:00
CamilleLaVey
ee3d858935 Follow Up Of the previous commit with the update of TLB update 2025-03-04 22:50:01 -04:00
CamilleLaVey
31694994f2 arm_nce: Hash TLB to MLP L2 Update 2025-03-04 22:28:03 -04:00
CamilleLaVey
4197fa84a0 revert e4342324fe
revert Changes of the previous commits
2025-03-04 02:33:14 +00:00
CamilleLaVey
e4342324fe Changes of the previous commits 2025-03-03 21:49:07 -04:00
CamilleLaVey
78b0080b96 TLB: Parallel Page Table Walk Logic Implementation 2025-03-03 21:44:56 -04:00
CamilleLaVey
644ed69285 arm: 2025-03-03 21:23:13 -04:00
CamilleLaVey
3554f55fc9 TLB Update 2025-03-03 20:55:08 -04:00
Zephyron
dc9532b4d1 Revert "CMake: Enable C++ latest and coroutines for MSVC builds"
This reverts commit 1308e2b935.
2025-03-03 17:13:29 +10:00
Zephyron
1308e2b935 CMake: Enable C++ latest and coroutines for MSVC builds
Add /std:c++latest and /await compiler flags for MSVC builds to enable
the latest C++ features and coroutine support.
2025-03-03 16:35:57 +10:00
Zephyron
5caecd8151 Android: Remove redundant firmware check
Remove duplicate firmware presence check in EmulationActivity. The
isFirmwareAvailable() check already handles this functionality, making
checkFirmwarePresence() redundant.
2025-03-03 16:35:18 +10:00
Zephyron
dc9fbcc893 Android: Downgrade build dependencies and SDK versions
- Revert Android Gradle plugin from 8.8.1 to 8.1.2
- Downgrade Kotlin version from 2.1.20-RC to 1.9.20
- Lower Java/JVM target from 21 to 17
- Reduce CMake version from 3.31.5 to 3.22.1
- Update various Android dependencies to stable versions:
  - Navigation Safe Args plugin to 2.6.0
  - ktlint to 0.47.1
  - Play Publisher plugin to 3.8.6
- Remove custom APK naming scheme
- Fix CMake boolean arguments (OFF -> 0)
- Remove citron copyright header
2025-03-03 16:34:35 +10:00
Zephyron
b1d5d4e5be Update external dependencies
- Update Vulkan-Utility-Libraries submodule to 5f41f2a
- Update vcpkg submodule to efb1e74
2025-03-03 16:33:01 +10:00
CamilleLaVey
f0d8daf755 revert cbb9a35166
revert Re-Enabled Vulkan Functions disabled on Adreno to improve compatibility and performance and check further issues within the current changes.
2025-03-03 04:00:13 +00:00
CamilleLaVey
cbb9a35166 Re-Enabled Vulkan Functions disabled on Adreno to improve compatibility and performance and check further issues within the current changes. 2025-03-02 23:17:43 -04:00
Zephyron
cfe437aacf arm: Improve TLB implementation and fault handling in NCE
This commit enhances the Translation Lookaside Buffer (TLB) implementation
in the ARM Native Code Execution (NCE) component to increase stability,
particularly on Android devices. The changes prioritize robustness and
error recovery over performance optimizations.

Key improvements:
- Replace set-associative TLB with a simpler linear search implementation
- Implement a basic LRU replacement policy for TLB entries
- Add validation checks for memory addresses before TLB insertion
- Ensure proper page alignment for guest and host addresses
- Enhance alignment fault handling with instruction skipping as fallback
- Add comprehensive debug logging for memory access errors
- Improve error recovery in guest memory access scenarios

These changes should significantly reduce crashes during emulation on
Android devices by gracefully handling memory access edge cases that
previously resulted in hard crashes.

Co-Authored-By: Camille LaVey <camillelavey@citron-emu.org>
Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-02-28 17:11:07 +10:00
Zephyron
9b293c3a98 shader_recompiler: Implement vertex count lookup for Geometry stage
Add proper handling of input topologies in the Geometry stage for all three
shader backends (GLASM, GLSL, SPIRV). This implementation uses a lookup table
approach to determine vertex counts based on input topology type (Points,
Lines, LinesAdjacency, Triangles, TrianglesAdjacency) and shifts the vertex
count by 16 bits as required by the invocation info format.

Additional changes:
- Fixed TessellationControl and TessellationEval stages to properly break
  after emitting code
- Added proper header include for runtime_info.h in GLASM backend
- Improved code documentation with clear commenting patterns

This change ensures accurate geometry shader behavior across all backends,
improving compatibility with games that rely on proper vertex count reporting.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-02-28 17:08:27 +10:00
Zephyron
84e5fbc089 feat: Make firmware mandatory for title launching
This commit implements a requirement for firmware to be installed before titles
can be launched, similar to how keys are required.

Changes include:
- Add IsFirmwareAvailable method to KeyManager to check for essential keys
- Add CheckFirmwarePresence method to verify actual firmware files (NCAs)
- Add firmware checks in game loading process for both desktop and Android
- Add error messages when firmware is missing
- Add strings for firmware-related error messages

The implementation checks for both essential keys and the presence of system
applets like Mii Edit and Home Menu to ensure proper firmware is installed.
Games will not launch if firmware is missing, and users will be shown an
appropriate error message.
2025-02-28 16:15:10 +10:00
Zephyron
a442078ee4 feat: Remove autogenerated key functionality
This commit removes the functionality that automatically generates and writes
keys to *_autogenerated files. The key derivation logic is preserved, but
derived keys are now only stored in memory and not written to disk.

Changes include:
- Remove loading from *_autogenerated key files
- Make WriteKeyToFile a no-op function
- Remove all file writing operations in SetKey methods
- Remove file writing for keyblobs and other derived keys
- Update copyright notices

This change improves security by not storing derived keys on disk and
simplifies the key management system.
2025-02-28 15:27:12 +10:00
Zephyron
cc610ad9b6 renderer: Disable async presentation due to crashes
- Disable async presentation by default on both Android and desktop platforms due to stability issues.
2025-02-27 13:19:08 +10:00
Zephyron
5a65f9a094 Update external dependencies
- Vulkan-Utility-Libraries: 6be00ca → 2d8f273
- FFmpeg: d161604 → 99e2af4
- vcpkg: 9a7a33f → 23b33f5
2025-02-27 13:08:19 +10:00
Zephyron
5ca1f0e365 core/arm/nce: Implement TLB caching system
Adds a software TLB cache to improve memory access performance in the NCE
(Native Code Execution) system. Key changes include:

- Implement set-associative TLB with 64 sets and 8 ways
- Add TLB lookup before memory access in HandleGuestAccessFault
- Implement LRU replacement policy with access frequency consideration
- Add thread context caching to reduce overhead
- Add proper synchronization with mutex locks
- Add helper functions for TLB management (lookup, insert, invalidate)

This change should improve performance by reducing redundant memory
translations and providing faster access to frequently used pages.
2025-02-25 18:37:14 +10:00
Zephyron
a36baad0f0 externals: Update submodule versions
- vcpkg: 37d46ed → 9a7a33f
- Vulkan-Headers: 234c4b7 → 952f776
- Vulkan-Utility-Libraries: fe7a09b → 6be00ca
- ffmpeg: 9c1294e → d161604
2025-02-25 18:34:32 +10:00
Zephyron
ed115d3f72 Revert "settings: Enable auto-stub by default"
This reverts commit 7903415fa4.
2025-02-24 19:05:05 +10:00
Zephyron
d9619b7eed vulkan: Improve memory allocation robustness
Enhances the Vulkan memory allocator with better OOM handling and memory
alignment:

* Add memory recovery by cleaning up empty allocations before failing
* Implement proper fallback to non-device-local memory
* Simplify memory alignment handling for different vendors
* Add better error logging for allocation failures
* Add IsEmpty() helper to track unused allocations
* Fix alignment requirements for Adreno (4KB) vs other vendors

These changes improve the robustness of memory allocation, particularly
in low-memory situations, and streamline vendor-specific alignment
requirements.
2025-02-22 19:08:42 +10:00
Zephyron
dbe5bf1d18 android: Update build dependencies and configurations
Updates various build dependencies and configurations for the Android build:

* Upgrade Android Gradle Plugin to 8.8.1
* Update Kotlin to 2.1.20-RC
* Upgrade NDK to 28.0.13004108
* Update target/compile SDK to Android 35
* Upgrade Java/Kotlin target to JVM 21
* Enable additional release optimizations (shrinkResources, proguard-android-optimize)
* Update CMake to 3.31.5
* Update various AndroidX and support library dependencies
* Change CMake boolean flags from 0/1 to OFF/ON
* Update ktlint to 0.51.1 and related plugins

This commit modernizes the Android build system and enables additional
optimizations for release builds.
2025-02-22 19:07:53 +10:00
Zephyron
7903415fa4 settings: Enable auto-stub by default
Changes the default value of use_auto_stub from false to true in the settings.
This setting controls whether unimplemented functions should be automatically
stubbed during execution.
2025-02-22 19:07:16 +10:00
Zephyron
3bb4d97e9e cmake: Optimize Android VVL download logic
Improve the Vulkan Validation Layer (VVL) download logic for Android by checking
for the final library file instead of just the zip archive. This prevents
unnecessary re-downloads and extractions when the library is already in place.

The check now looks for libVkLayer_khronos_validation.so in the final
destination path before attempting to download and extract the archive.
2025-02-22 19:06:05 +10:00
Zephyron
a41f7b7a56 feat: Add AnTuTu to license verification for Android app 2025-02-22 10:05:27 +10:00
Zephyron
18f8a0f997 Add license verification for Android app
Implements a LicenseVerifier class to ensure app integrity and license compliance:
- Verifies the app's package name matches the official release
- Validates app signature against official release signature
- Allows debug and EA (Early Access) builds
- Shows violation dialog and exits if verification fails
- Enforces GPLv3 license compliance for modified versions

This helps prevent unauthorized modified versions from being distributed
without source code, as required by the GPLv3 license.
2025-02-21 18:46:48 +10:00
Zephyron
4d50d2ba16 Revert "audio: refactor SDL2 sink implementation"
This reverts commit 3aa9c0d151.
2025-02-20 16:54:43 +10:00
Zephyron
0576d40bf0 Remove redundant TranslateIPv4 function
Remove the TranslateIPv4 function that converts in_addr to IPv4Address, as it
appears to be unused or redundant. The functionality might be handled elsewhere
in the codebase or no longer needed.
2025-02-19 19:53:35 +10:00
Zephyron
6917530ba5 Updated submodule discord-rpc to commit 20cc99aeffa08a4834f156b6ab49ed68618cf94a 2025-02-19 15:19:47 +10:00
Zephyron
43495b6045 network: Improve network interface handling and address resolution
- Return loopback address (127.0.0.1) when no network interface is selected
- Improve IPv4 address string conversion and handling
- Add explicit handling for "None" network interface selection
- Change IsAnyInternetRequestAccepted logging from ERROR to DEBUG
- Simplify internet request acceptance check to assume availability

This change makes the network interface handling more robust by providing
fallback behaviors and improving address resolution. It also reduces
unnecessary error logging for expected scenarios.
2025-02-17 21:59:15 +10:00
Zephyron
c5e480e55d feat: Add Home Menu launch support and system improvements
This commit adds support for launching the system Home Menu and implements
several system-level improvements:

- Add Home Menu launch functionality through new UI action
- Implement shutdown/reboot sequence handlers in GlobalStateController
- Add support for reserved region extra size in page tables
- Enhance audio controller with output management
- Expand parental control service capabilities
- Add profile service improvements for user management

Technical changes:
- Add OnHomeMenu() handler to launch QLaunch system applet
- Implement m_alias_region_extra_size tracking in page tables
- Add new CreateProcessFlag for reserved region extra size
- Expand audio controller interface with output management
- Add self-controller methods to various services
- Implement play timer and profile service improvements

The changes primarily focus on system menu integration and core service
improvements to better support system functionality.
2025-02-17 17:33:10 +10:00
Zephyron
1c9e17496b texture_cache: Add equality operators for ImageInfo and ImageViewInfo
- Add operator== to ImageInfo and ImageViewInfo classes to enable direct equality comparisons. The implementations use std::tie to perform member-wise comparisons of all relevant fields in a safe and efficient manner.

This allows for easier comparison of texture cache entries and view
information, which can be useful for cache management and debugging.
2025-02-16 18:30:50 +10:00
Zephyron
7730d14b4a build: upgrade fmt and SDL2
Update fmt library to version 11.0.2 and make necessary adjustments:
- Replace fmt/format.h includes with fmt/ranges.h
- Add const qualifiers to formatter::format functions
- Update CMake to require fmt version 11

Additional dependency updates:
- Update SDL2 bundled version from 2.28.2 to 2.32.0
- Update catch2 to version 3.8.0
- Update vcpkg baseline to c82f74667287d3dc386bce81e44964370c91a289
2025-02-16 13:38:05 +10:00
Zephyron
677b8f476a service/am: Implement SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled
- Removes STUBBED designation as implementation is now complete
- Changes log level from WARNING to DEBUG
- Properly sets the exit request flag under lock protection
2025-02-16 12:02:52 +10:00
Zephyron
5cbde61d3c service/am: Implement CreateManagedDisplaySeparableLayer
- Removes STUBBED designation as implementation is now complete
- Changes log level from WARNING to DEBUG
- Adds proper locking when accessing the display layer manager
- Fixes parameter alignment in function declaration
2025-02-16 12:01:27 +10:00
Zephyron
33a1996ca4 service/nvnflinger: Unstub GetNativeHandle
Removes the STUBBED designation from GetNativeHandle in IHOSBinderDriver
as the implementation is now complete. Changes the log level from WARNING
to DEBUG to reflect this status.

The function properly handles binder ID validation and returns the
appropriate handle as documented in switchbrew.
2025-02-16 11:59:08 +10:00