Commit graph

2109 commits

Author SHA1 Message Date
Zephyron
a1cbcee7ab
vulkan: Fix parameter naming consistency for Android compilation
Renames 'size' parameter to 'length' in IsValidMapping() methods to avoid
conflicts with Android NDK macros that define 'size'. This fixes compilation
issues on Android platforms where the 'size' macro is defined.
2025-02-02 12:06:07 +10:00
Zephyron
f4b9e54b22
common/nvdrv: improve memory validation and error handling
Implements several improvements to memory handling and validation:

- host_memory: Add IsValidMapping() and IsDirectMappingEnabled() methods to
  validate memory access
- host_memory: Fix virtual base offset calculation to use proper pointer
  arithmetic
- host_memory: Add size field to track allocation size
- nvhost_ctrl_gpu: Return InvalidState instead of InvalidValue for TPC mask
  buffer size validation
- Update copyright year for citron

The changes improve memory safety by adding explicit validation checks and
fixing pointer arithmetic in the virtual memory implementation.
2025-02-01 21:50:33 +10:00
Zephyron
70a9f20ae1
common: add missing <memory> include in common_types.h
Adds missing <memory> header include in common_types.h. This header is
needed for std::unique_ptr and other smart pointer types that may be used
by code including this header.
2025-02-01 21:47:55 +10:00
Zephyron
ecc32958ec
nvdrv: Add GetTpcMasks2 support and improve memory mapping validation
This commit makes two main changes:

1. Adds support for GetTpcMasks2 (ioctl 0x13) in nvhost_ctrl_gpu:
- Implements new GetTpcMasks2 method to handle TPC mask queries
- Adds IoctlGetTpcMasks structure to store mask parameters
- Returns conservative single TPC configuration for compatibility

2. Enhances memory mapping validation in HostMemory:
- Adds verification check after memory mapping operations
- Improves error handling for direct mapped address enabling
- Adds logging for mapping and direct address failures

Additional changes:
- Updates copyright headers to include citron Emulator Project
- Improves error handling and validation in several paths
- Adds debug logging for TPC mask operations

This improves GPU virtualization support and memory mapping reliability.
2025-02-01 19:48:11 +10:00
Zephyron
4e8d00f034
string_util: Replace deprecated wstring_convert with direct UTF conversions
Removes usage of std::wstring_convert and std::codecvt_utf8_utf16 which are
deprecated since C++17. Implements direct UTF conversions for:

- UTF16ToUTF8: Manual conversion with proper surrogate pair handling
- UTF8ToUTF16: Direct conversion supporting full Unicode range
- UTF8ToUTF32: New implementation with proper code point extraction

The new implementations are more robust and handle edge cases better while
avoiding deprecated functionality. Windows-specific code paths remain unchanged
using the existing UTF16W conversions.

This change improves maintainability and removes compiler warnings about
deprecated features while maintaining full Unicode support.
2025-02-01 12:27:03 +10:00
Zephyron
f638922129
common: Improve error handling in host memory management
Add proper error handling and recovery mechanisms for memory mapping
operations instead of using assertions.
2025-02-01 11:45:40 +10:00
Zephyron
9a3d4f0489
ui: Update repository URLs to git.citron-emu.org
Updates all GitHub repository URLs to point to the new self-hosted Git instance
at git.citron-emu.org. This includes:

- Links in the About dialog UI and translations
- Android app string resources
- Documentation/wiki links
- Source code comments

The website URL (citron-emu.org) and support links remain unchanged.
2025-01-28 17:33:57 +10:00
Zephyron
9ae0eeeb87 Revert incorrect copyright attribution for non-contributed files
- In commit b3facaa6bb, the copyright header was
  updated to include "Citron Homebrew Project" across multiple files, regardless
  of whether any contributions were made.

- This commit removes the incorrect attribution and reverts the copyright header
  to its previous state.

- Copyright attribution should only be added when meaningful contributions have
  been made to the file.

- This commit ensures proper compliance with copyright standards and maintains
  correct attribution to the respective contributors.

- Special thanks to Tachi for pointing out the need for these corrections and
  ensuring that proper attribution practices are followed.
2025-01-14 15:33:24 +10:00
Zephyron
08f1ed4011
common: Use consistent cache line size in RingBuffer
Replace hardcoded 128-byte alignment with a defined CACHE_LINE_SIZE constant
of 64 bytes for the atomic indices in RingBuffer. This value is more
appropriate for most modern CPU architectures and simplifies the
implementation by using a consistent value regardless of compiler support
for hardware_interference_size.

Changes:
- Add CACHE_LINE_SIZE constant set to 64 bytes
- Use CACHE_LINE_SIZE for atomic index alignment in both code paths
- Remove outdated TODO comment about hardware_destructive_interference_size
2025-01-06 12:41:42 +10:00
Zephyron
e11c6c03ec
core: Add support for 10GB and 12GB memory configurations
- Add Memory_10Gb and Memory_12Gb to MemoryLayout enum
- Update memory layout settings to support up to 12GB
- Add SMC enums for 10GB and 12GB memory sizes and arrangements
- Increase MainMemorySizeMax from 8GB to 12GB
- Add memory pool size calculations for 10GB and 12GB configurations
- Update UI translations for new memory options
2025-01-04 17:33:22 +10:00
Zephyron
7dc72a0e95
impl(Multiplayer): Switched API To Enable Multiplayer 2025-01-02 16:40:28 +10:00
Zephyron
468ace6b0b
core: Update copyright headers
- Update copyright headers to include Citron Homebrew Project
- Add 2025 to copyright years
2024-12-31 17:36:08 +10:00
Zephyron
b3facaa6bb
chore: update project references and add Citron copyright
- Replaced all references to the old project name with Citron.
- Added Citron copyright information alongside existing notices in all files.
2024-12-31 17:07:49 +10:00
liamwhite
79edad2533
Merge pull request #13159 from liamwhite/web-error
core: enable error applet, add stubs for web applet
2024-02-26 12:44:55 -05:00
Liam
25c3bbba0e settings: remove global override for smash on amdvlk 2024-02-26 11:16:18 -05:00
Liam
dc50b95a47 settings: enable error applet 2024-02-24 22:56:08 -05:00
wheremyfoodat
ed315fb8a5
common/ring_buffer: Include <limits> header 2024-02-24 02:34:09 +02:00
liamwhite
215e887be0
Merge pull request #13100 from liamwhite/audio-ipc
audio: move to new ipc
2024-02-23 11:34:21 -05:00
Narr the Reg
984396a21a
Merge pull request #13001 from liamwhite/scaled-availability
vulkan_device: don't use fixed cap for memory limits
2024-02-22 11:31:17 -06:00
Liam
c575a85233 audio: rewrite IAudioDevice 2024-02-20 22:15:38 -05:00
FearlessTobi
310c1f50be scope_exit: Make constexpr
Allows the use of the macro in constexpr-contexts.
Also avoids some potential problems when nesting braces inside it.
2024-02-19 16:00:46 +01:00
Liam
56810541f0 vulkan_device: don't use fixed cap for memory limits 2024-02-18 18:59:13 -05:00
t895
50ecad547e android: Input mapping 2024-02-17 12:32:33 -05:00
Narr the Reg
2ff45cd0da
Merge pull request #12756 from liamwhite/applet-multiprocess-hwc
general: applet multiprocess
2024-02-11 20:58:28 -06:00
liamwhite
7ec7ff0f30
Merge pull request #12920 from t895/jni-common
android: Move JNI setup and helpers to common
2024-02-09 11:49:25 -05:00
Liam
fa12384350 general: add default configurations for applet mode 2024-02-09 09:20:53 -05:00
t895
c8e8c614a0 common: fs: Expand android macros 2024-02-08 14:13:46 -05:00
t895
e7c4c8b993 android: Move JNI setup and helpers to common 2024-02-08 13:45:26 -05:00
liamwhite
263dfa95e4
Merge pull request #12914 from FernandoS27/vc-refactor
VideoCore Refactor Part 1.
2024-02-08 10:59:59 -05:00
Fernando Sahmkow
fa47ac1c9f Common: Rename SplitRangeSet to OverlapRangeSet 2024-02-05 23:01:17 +01:00
Liam
0e950baf41 typed_address: test values are unsigned 2024-02-05 12:47:10 -05:00
Fernando Sahmkow
0d5a3abeae Buffer Cache: Refactor to use Range sets instead 2024-02-05 11:06:52 +01:00
Fernando Sahmkow
01ba6cf610 Common: Introduce Range Sets 2024-02-04 20:01:50 +01:00
Fernando Sahmkow
4841dc0b74 VideoCore: Move Slot Vector to Common 2024-02-04 20:01:47 +01:00
Narr the Reg
fb3ef957bb service: fs: Skip non user id folders 2024-02-02 13:25:38 -06:00
liamwhite
22492b68b7
Merge pull request #12869 from FernandoS27/smmu-fixes
SMMU: A set of different fixes.
2024-01-31 11:22:29 -05:00
Liam
8f848f43e9 smmu: use new range mutex construction for protecting counters 2024-01-31 16:38:51 +01:00
t895
e8be665f11 settings: Allow audio sink, input, and output to be set per game 2024-01-31 09:31:19 -05:00
liamwhite
90cb852908
Merge pull request #12814 from Kelebek1/time_new_ipc
Move time services to new IPC and add debug printing
2024-01-29 09:08:46 -05:00
Merry
5a20d07c21 atomic_ops: Fix MSVC 2024-01-27 21:42:16 +00:00
Merry
9f91d310c6 atomic_ops: Remove volatile qualifier 2024-01-27 21:36:39 +00:00
Merry
6527c0d2fc atomic_ops: Reduce code duplication with templates
Also fixes builds on unusual toolchains where:
- u32 is unsigned int
- u64 is unsigned long long
- uintptr_t is unsigned long
2024-01-27 21:12:12 +00:00
Kelebek1
da410506a4 Move time services to new IPC.
Add some fixes/improvements to usage with the new IPC
2024-01-27 03:30:09 +00:00
FearlessTobi
975deb7528 Address review comments and fix compilation problems 2024-01-25 16:43:53 -05:00
FearlessTobi
2c049ae06d fs: Add path class 2024-01-25 16:42:06 -05:00
liamwhite
d45561ace0
Merge pull request #12499 from Kelebek1/time
Rework time services
2024-01-25 14:19:01 -05:00
Kelebek1
e4915fb7d2 Rework time service to fix time passing offline. 2024-01-24 04:26:55 +00:00
liamwhite
8bd10473d6
Merge pull request #12579 from FernandoS27/smmu
Core: Implement Device Mapping & GPU SMMU
2024-01-22 10:55:39 -05:00
Merry
5c398ede6f fs/file: Explicitly convert std::u8string to std::filesystem::path 2024-01-20 17:46:30 +00:00
Fernando Sahmkow
2f0418c101 Core: Initial implementation of device memory mapping 2024-01-18 21:12:30 -05:00