Commit Graph

10512 Commits

Author SHA1 Message Date
Zephyron
cdcda1fa5b feat(core): Update HOS and NintendoSDK version constants
- Bumps HOS version from 20.1.1 to 20.1.5
- Updates the corresponding `VERSION_HASH`, `DISPLAY_VERSION`, and
  `DISPLAY_TITLE` strings.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-06-28 19:55:42 +10:00
Zephyron
39ed0afa1f Revert "Implement IApplicationFunctions function 210 (RequestToAcquireUserUsedMemory)"
This reverts commit 1471d150d0.
2025-06-23 19:14:23 +10:00
Zephyron
1471d150d0 Implement IApplicationFunctions function 210 (RequestToAcquireUserUsedMemory) 2025-06-20 15:52:14 +10:00
Zephyron
66a3980a43 hid: Implement ActivateDebugMouse function
Adds implementation for the missing ActivateDebugMouse HID service function
that was causing crashes when games attempted to call it.

- Add ActivateDebugMouse declaration to IHidServer header
- Implement ActivateDebugMouse function following the same pattern as ActivateMouse
- Update function table to call the actual implementation instead of nullptr
- Add missing include for debug_mouse.h

Fixes crashes in games (GEX Trilogy) that use debug mouse functionality.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-06-18 19:41:43 +10:00
Zephyron
1abbc3d475 fix: prevent crash when detecting newer updates in NCA integrity verification
- Change storage assignment from SetDataStorage() method to direct array indexing to prevent crashes when newer game updates are detected.
- The previous method was incorrectly handling storage info assignment for integrity verification layers.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-06-11 18:47:25 +10:00
Zephyron
4bd4e662d2 feat(service/aoc): Implement IContentsServiceManager
- Add IContentsServiceManager class with RequestContentsAuthorizationToken function
- Add IAsyncData class for handling asynchronous authorization token operations
- Implement CreateContentsServiceManager in IAddOnContentManager (was previously stubbed)
- Add support for GetSize, Read, Cancel, and GetSystemEvent operations in IAsyncData
- Update CMakeLists.txt to include new source files

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-06-03 22:19:44 +10:00
Zephyron
1febbc4911 feat(core): Update HOS and NintendoSDK version constants
- Bumps HOS version from 20.0.1 to 20.1.1.
- Updates the corresponding `VERSION_HASH`, `DISPLAY_VERSION`, and
  `DISPLAY_TITLE` strings.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-06-03 21:48:46 +10:00
Zephyron
e85f691767 nsd: Suppress unused variable warnings
Mark ResultNotImplemented and ResultNsdNotInitialized with
[[maybe_unused]] to avoid compiler warnings.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-05-25 19:33:54 +10:00
Zephyron
fdf1bfc06a feat: Add 10GB, 12GB, 14GB, and 16GB DRAM configuration options
- Extended MemoryLayout enum with new memory size options
- Added corresponding SMC memory size and arrangement constants
- Updated system control functions to handle new memory configurations
- Added appropriate application pool sizes for higher memory modes
- Updated UI translations to display new DRAM options as "Unsafe"
- Increased maximum memory layout setting from 8GB to 16GB

This allows users to configure higher memory amounts for games and
texture mods that require more than the standard 4-8GB configurations.
All new options are marked as "Unsafe" in the UI to indicate they
are experimental features beyond Nintendo's official specifications.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-05-24 17:10:19 +10:00
Zephyron
238e8282b2 hle/service/audio: Implement missing audio services and functions
- Add complete IAudioController implementation with 32 missing functions:
  * Volume control (GetTargetVolume, SetTargetVolume, etc.)
  * Mute control (IsTargetMute, SetTargetMute, etc.)
  * Target management (SetDefaultTarget, GetDefaultTarget, etc.)
  * Play report functions (10000+ series command IDs)
  * Hearing protection safeguard functions
  * Debug and system functions

- Add new audio services:
  * codecctl - Codec controller service with 13 functions
  * auddebug - Audio debug service placeholder
  * Device suspend/resume services (audout:d, audin:d, audrec:d, audren:d)
  * System audio services (aud:a, aud:d)
  * Applet audio services (audout:a, audin:a, audren:a)

- Update IAudioDevice with missing functions:
  * GetAudioSystemMasterVolumeSetting
  * GetActiveAudioOutputDeviceName
  * Fix function ID mappings to match official documentation

- Register all services in main audio LoopProcess function
- Update CMakeLists.txt with new source files

All implementations follow the official Switch audio services documentation
from switchbrew.org and provide appropriate stub implementations with
sensible default values for enhanced game compatibility.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-05-24 16:39:15 +10:00
Zephyron
129e76a13c hle/service/acc: Implement acc:e, acc:e:u1, acc:e:u2, and dauth:0 services
- Add acc:e service with full account management functionality
- Add acc:e:u1 service (minimal implementation)
- Add acc:e:u2 service with extended functionality including PIN code support
- Add dauth:0 device authentication service
- Update acc_su function mappings to match newer firmware versions
- Move TrySelectUserWithoutInteraction from ID 51 to 52 with deprecated fallback

These services provide additional account management interfaces used by
newer Switch firmware versions and some games that require extended
account functionality.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-05-24 15:42:58 +10:00
Zephyron
a35d0de5a6 feat(service/pm): Align PM services with Switchbrew documentation
- **pm:bm (IBootModeInterface):**
    - Added stubs for Cmd 2 (`[19.0.0+]`) and Cmd 3 (`[19.0.0+]`) as "UnknownCmd2" and "UnknownCmd3" respectively.
- **pm:dmnt (IDebugMonitorInterface):**
    - Corrected typo in Cmd 5 name from "HookToCreateApplicationProgress" to "HookToCreateApplicationProcess".
    - Added stub for Cmd 7 (`GetProgramId`, `[14.0.0+]`).
- **pm:info (IInformationInterface):**
    - Added stub for Cmd 1 (`GetAppletCurrentResourceLimitValues`, `[14.0.0+]`).
    - Added stub for Cmd 2 (`GetAppletPeakResourceLimitValues`, `[14.0.0+]`).
- **pm:shell (IShellInterface):**
    - Added stub for Cmd 10 (`BoostSystemThreadResourceLimit`, `[14.0.0+]`).
    - Added stub for Cmd 12 (`GetProcessId`, `[19.0.0+]`).

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-05-20 17:58:38 +10:00
Zephyron
9ac1277fd7 feat(service/npns): Add NPNS stubs and interfaces from documentation
- Addition of all documented commands for `INpnsSystem` and `INpnsUser` as `nullptr` stubs. This includes newly added commands and ensures all known commands have a placeholder.
- Introduction of empty class definitions for `INotificationReceiver`, `ICreateTokenAsyncContext`, `ISubscriptionUpdateNotifier`, and `IFuture` interfaces as specified in the documentation.
- Reversion of the previous change that made `nullptr` stubs call an `UnimplementedMethod` that returned success. Stubs are now back to being `nullptr`.
- Update of the copyright year in `npns.cpp`.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-05-20 16:01:15 +10:00
Zephyron
c5604ced4f feat: Implement 32:9 aspect ratio
This commit introduces support for a 32:9 aspect ratio throughout Citron.

Key changes include:

-   **Enum Updates**: Added `R32_9` to `Settings::AspectRatio` and `Layout::AspectRatio` enums, ensuring consistent integer mapping for casting between them.
-   **Core Logic**:
    -   Modified `UISettings::CalculateWidth` to correctly compute width for the 32:9 ratio.
    -   Updated `Layout::EmulationAspectRatio` to handle the new `R32_9` case and return the appropriate float value (9.0f / 32.0f).
-   **Android Integration**:
    -   Updated `EmulationFragment.kt` and `EmulationActivity.kt` (for Picture-in-Picture) to recognize and apply the 32:9 aspect ratio (mapping setting value `4` to `Rational(32, 9)`).
-   **UI Configuration**:
    -   Added "Force 32:9" to the aspect ratio selection in the graphics settings UI via `shared_translation.cpp`. This string is translatable.

This enhancement allows users to utilize ultra-widescreen 32:9 displays for a more immersive experience.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-05-18 15:10:47 +10:00
Zephyron
7a564e727a feat(service/nsd): Implement missing nsd:u and nsd:a services
Adds implementations for missing nsd:u and nsd:a services
as documented in SwitchBrew. This includes:

- Defining necessary data structures (Url, SettingName, DeviceId, Fqdn,
  NasServiceSetting, NasServiceName, SaveData, TestParameter, DeleteMode,
  ImportMode) in nsd.cpp.
- Adding declarations for new service methods to nsd.h.
- Implementing basic stub logic for each new service method in nsd.cpp,
  including logging, returning default success/error codes, and handling
  output buffers where applicable.
- Implementing checks for nsd:a specific functions using a new
  IsNsdA() helper.
- Updating the copyright year in nsd.h.

This provides a complete interface for the nsd service, allowing
further development and reducing unknown service calls.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-05-17 17:25:43 +10:00
Zephyron
dc51851b67 feat(HLE): Implement sfdnsres service functions and align with docs
Adds implementations for missing `sfdnsres` (nn::socket::resolver::IResolver) service functions and corrects command ID mappings to align with Switchbrew documentation.

Key changes:
- Implemented stubs for the following `sfdnsres` functions:
    - `SetDnsAddresses` (Cmd 0)
    - `GetDnsAddressList` (Cmd 1)
    - `GetHostByAddrRequest` (Cmd 4, deprecated)
    - `GetHostStringError` (Cmd 5)
    - `CancelRequest` (Cmd 7)
    - `GetOptions` (Cmd 9)
    - `GetAddrInfoRequestRaw` (Cmd 11)
- Updated the command registration table in the `SFDNSRES` constructor to use correct Switchbrew command IDs and map them to the appropriate existing or new (stubbed) implementations.
- Retained and stubbed `GetNameInfoRequest` and `GetNameInfoRequestWithOptions` with placeholder IDs, as they were present in the previous command table.
- Corrected usage of `GetAddrInfoError` constants in stubs to use valid members (e.g., `GetAddrInfoError::AGAIN` instead of a non-standard `INTERNAL`).

This significantly expands the implemented interface for the `sfdnsres` service, bringing it closer to the documented functionality and resolving related compilation errors.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-05-16 18:21:01 +10:00
Zephyron
76210eb990 feat(HLE): Implement bsdcfg service functions and fix logging
Adds implementations for all `bsdcfg` (aliased as `ifcfg`) service functions as listed in the existing codebase and supplemented by Switchbrew documentation.

The following functions have been added to the `BSDCFG` service:
- `SetIfUp` (Cmd 0)
- `SetIfUpWithEvent` (Cmd 1)
- `CancelIf` (Cmd 2)
- `SetIfDown` (Cmd 3)
- `GetIfState` (Cmd 4)
- `DhcpRenew` (Cmd 5)
- `AddStaticArpEntry` (Cmd 6)
- `RemoveArpEntry` (Cmd 7)
- `LookupArpEntry` (Cmd 8)
- `LookupArpEntry2` (Cmd 9)
- `ClearArpEntries` (Cmd 10)
- `ClearArpEntries2` (Cmd 11)
- `PrintArpEntries` (Cmd 12)
- `Unknown13` (Cmd 13)
- `Unknown14` (Cmd 14)
- `Unknown15` (Cmd 15)

These functions are initially stubbed to log a warning and return `EOPNOTSUPP`.
Command handlers have been updated in the `BSDCFG` constructor.

Additionally, this commit corrects the logging category in these new `BSDCFG` stubs from an undefined `Service_BSDCFG` to the existing `Service` category, resolving compilation errors.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-05-16 17:31:26 +10:00
Zephyron
07139a2c0d feat(HLE): Implement missing BSD socket service functions
Adds implementations for several previously unimplemented BSD socket service functions, as documented in Switchbrew. REF: https://switchbrew.org/wiki/Sockets_services#bsd:u.2C_bsd:s.2C_bsd:a

The following functions have been added to the `bsd:u`, `bsd:s`, and `bsd:a` services:

* `SocketExempt` (Cmd 3)
* `Open` (Cmd 4)
* `Sysctl` (Cmd 7)
* `Ioctl` (Cmd 19)
* `ShutdownAllSockets` (Cmd 23)
* `GetResourceStatistics` (Cmd 28)
* `RecvMMsg` (Cmd 29)
* `SendMMsg` (Cmd 30)
* `RegisterResourceStatisticsName` (Cmd 32)
* `RegisterClientShared` (Cmd 33) (replaces the placeholder `Initialize2`)
* `GetSocketStatistics` (Cmd 34)
* `NifIoctl` (Cmd 35)
* `SetThreadCoreMask` (Cmd 200)
* `GetThreadCoreMask` (Cmd 201)

These functions are initially set to log a warning and return an appropriate error code (typically `EOPNOTSUPP` or `ENOTTY`), or success in the case of registration-type functions.

The command handlers have been registered in the BSD service constructor.

This resolves various compilation errors encountered during the implementation process related to IPC response generation and enum usage.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-05-16 16:54:39 +10:00
Zephyron
646326e608 build: update Android build system and platform compatibility
1. Gradle ecosystem upgrades:
   - Update Gradle from 8.1 to 8.12
   - Update Android Gradle plugin from 8.1.2 to 8.10.0
   - Upgrade Java compatibility from 17 to 21

2. Build configuration changes:
   - Make release build the default instead of relWithDebInfo
   - Enable premium features

3. Platform compatibility fixes:
   - Properly exclude boost-process on Android
   - Add workarounds for missing features on Android
   - Fix socket operations in SSL backend
   - Update Boost.Asio naming (io_service → io_context)

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-05-15 17:24:33 +10:00
Zephyron
42573456db hid: Add SetGestureOutputRanges function
Add an implementation for function 92 (SetGestureOutputRanges) in the HID service.
This fixes a crash in Donkey Kong Country Returns HD which occurs when the game
attempts to access this unimplemented function. The function is now properly
registered and returns success while logging the call.

The specific error that was occurring:
"Unknown / unimplemented function '92': port='hid'"

According to the official Switch documentation, this function was introduced in
firmware 18.0.0+ and is used for setting gesture output ranges for touch/gesture
controls.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-05-12 16:10:57 +10:00
Zephyron
9c4eea3939 Merge branch 'ssl-add-new-functions-services' into 'master'
service/ssl: Add ssl:s service and fix SSL-related crashes in Xenoblade X

See merge request citron/rewrite!5
2025-05-11 10:23:02 +00:00
Zephyron
6a0c0a4835 service/ssl: Add ssl:s service and fix SSL-related crashes in Xenoblade X
Implements the ssl:s service alongside various SSL-related functionality that
was causing Xenoblade Chronicles X: Definitive Edition to crash. The changes
include:

- Add the ssl:s service with proper command handlers
- Add InfoType::TLSCapability (0x1C) to the system call handler
- Implement a stub SSL backend for basic network operations
- Add FlushSessionCache functionality to both ssl and ssl:s services

These changes resolve the "TLS initialization failed" crash and the "Unknown
function '5': port='ssl:s'" error that were preventing the game from starting.
The implementation is mostly stubbed, allowing network requests to pass through
unencrypted but enabling games to proceed without crashing.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-05-11 20:22:13 +10:00
Zephyron
95f0749a8a service/nim: Implement missing services and functions
Add implementation for the missing nim:ecas service documented in SwitchBrew.
Provide stub implementations of critical NIM service functions that games might call:
- System update related functions (CreateSystemUpdateTask, GetSystemUpdateTaskInfo)
- Network installation functions (RequestNetworkInstallTaskRun, GetNetworkInstallTaskInfo)
- Local communication for system updates and applications
- Delta update related functions (CreateApplyDeltaTask, GetApplyDeltaTaskInfo)
- RequestDownloadTicketForPrepurchasedContents for DLC content access

Fix compilation error in GetDownloadedSystemDataPath by using ctx.WriteBuffer
instead of unsupported rb.PushString.

These changes prevent games from crashing due to missing NIM service functions and
allow proper handling of system updates, network installations, and DLC content.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-05-11 19:02:42 +10:00
Zephyron
62f40d8b82 feat(service/nifm): implement missing network interface services
Specifically:
- Add 11 missing methods to IGeneralService including network profile, scan, and WoWL functionality
- Implement 14 missing methods for IRequest class
- Complete implementation of IScanRequest class with all 5 required methods
- Update copyright notices to include citron Emulator Project

These additions should prevent games from crashing when accessing previously unimplemented network interface functions.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-05-11 18:29:55 +10:00
Zephyron
54f2b4442e friend: Implement stubs for all service functions
- Add implementations for all previously unimplemented IFriendService functions
- Create IDaemonSuspendSessionService class and implement CreateDaemonSuspendSessionService
- Restructure code to separate method declarations from implementations
- Add helper structs/payloads for various friend-related data structures
- Update function documentation and logging messages

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-05-07 19:06:43 +10:00
Zephyron
2fae273e9a nvdrv: Add dummy support for ioctl 0x13 in nvhost_ctrl_gpu
- This adds implementations for ioctl command 0x13 in both Ioctl1 and Ioctl3 functions, allowing newer titles like Super Mario Party Jamboree to boot by properly handling this command with a NotImplemented response rather than failing.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-05-07 18:39:17 +10:00
Zephyron
a8f0af4a2b feat(core): Update HOS and NintendoSDK version constants
- Bumps HOS version from 12.1.0 to 20.0.1.
- Updates the corresponding `VERSION_HASH`, `DISPLAY_VERSION`, and
  `DISPLAY_TITLE` strings.
- Updates the copyright year and project name.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-05-06 16:22:24 +10:00
Zephyron
6a3374309f fix(core): Correct telemetry personalization string size and update copyright
- Updates the copyright year and project name in `telemetry_session.cpp`.
- Adjusts the size of the `personalization` array for telemetry ID generation to correctly accommodate the "citron Telemetry ID" string, preventing potential truncation.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-05-06 16:15:37 +10:00
Zephyron
b2d9cf4a01 chore: update project branding to CITRON
Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-05-06 16:11:33 +10:00
Zephyron
5e16e20427 chore: update project branding to Citron
Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-05-06 16:08:59 +10:00
Zephyron
bfb82e577c chore: update project branding to citron
Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-05-06 16:06:48 +10:00
yuzubot
537296095a "Merge Tagged PR 13018" 2024-03-04 13:02:54 +00:00
liamwhite
dc94882c90 Merge pull request #13135 from german77/hid-interface
service: hid: Migrate HidServer to new IPC
2024-02-27 12:26:26 -05:00
Liam
c7174d5f61 general: fix asan errors 2024-02-26 19:28:49 -05: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
d66ca8b731 video_core: make gpu context aware of rendering program 2024-02-26 11:16:14 -05:00
Liam
4050242cf3 ldn: return no connection from GetStateForMonitor 2024-02-24 22:56:08 -05:00
Liam
fd718f350c ssl: add cert store 2024-02-24 22:56:05 -05:00
Liam
0d6fd12231 glue: load initial year setting as s32 2024-02-24 22:49:38 -05:00
Liam
f297e98a9e acc: add account manager for acc:u1 2024-02-24 22:25:34 -05:00
Liam
637c54e205 fs: add stubs for online web applet 2024-02-24 22:25:34 -05:00
Liam
f045fa576b erpt: stub report creation 2024-02-24 22:25:34 -05:00
Liam
692ba0fa7d set: add GetPlatformRegion 2024-02-24 22:25:34 -05:00
german77
9fccccedee service: set: Fix GetSettingsItemValue 2024-02-24 14:44:21 -06:00
liamwhite
05f94dc5fc Merge pull request #13153 from german77/defaultset
service: set: Enable nfc and others by default and bump version
2024-02-24 12:48:31 -05:00
liamwhite
dcf7698924 Merge pull request #13081 from FearlessTobi/aoc-ipc
aoc: Migrate to use cmif serialization
2024-02-24 12:48:26 -05:00
german77
4741e50047 service: set: Enable nfc and others by default and bump version 2024-02-24 11:19:51 -06:00
Liam
7836c0867d set: fix region code for system settings 2024-02-24 00:48:44 -05:00
Narr the Reg
0a0c257206 service: audio: Add missing logging properties of SetHeadphoneOutputLevelMode 2024-02-23 18:58:51 -06:00