Commit Graph

10565 Commits

Author SHA1 Message Date
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
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
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
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
8b830b310b fix(dynarmic): Remove MSVC-specific fastmem_pointer assignments
Unify fastmem_pointer handling by using reinterpret_cast<uintptr_t>()
and std::nullopt consistently across all platforms, fixing MSVC
compilation errors with std::optional<uintptr_t> assignment.

Fixes: C2679 binary '=' operator errors on MSVC
Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-10-07 15:45:56 +10:00
collecting
791718ea7f fix: string for Citron compilation error 2025-10-07 05:10:41 +00:00
collecting
32ea5f0fd0 fix: MSVC Compiler Error 2025-10-07 02:36:00 +00:00
collecting
20e594ca46 fix: MSVC Compiler Error 2025-10-07 02:35:03 +00:00
collecting
6491a53e72 fix: Clang Compiler 2025-10-05 02:25:57 +00:00
collecting
5a87a11917 fix: Clang Compiler 2025-10-05 02:25:14 +00:00
Zephyron
fa595ebe5a Merge branch 'boost_process_fixes' into 'main'
fix: boost_process Linux issue

See merge request citron/emulator!67
2025-10-02 17:15:52 +10:00
collecting
50da0bcca6 fix: boost_process Linux issue 2025-10-01 16:53:13 +00:00
collecting
964df7ef38 fix: boost_process Linux issue 2025-10-01 16:51:05 +00:00
Zephyron
26f93ad8ad hle: service: Complete SSL/TLS service implementation
ISslConnection (36/36 commands now implemented):
- Added Peek, Poll for connection state monitoring
- Implemented GetVerifyCertError and GetVerifyCertErrors for certificate validation
- Added GetNeededServerCertBufferSize for buffer management
- Implemented session cache functions: GetSessionCacheMode, FlushSessionCache
- Added renegotiation support: SetRenegotiationMode, GetRenegotiationMode
- Implemented GetOption and GetCipherInfo for connection information
- Added ALPN support: SetNextAlpnProto, GetNextAlpnProto
- Implemented DTLS functions: SetDtlsSocketDescriptor, GetDtlsHandshakeTimeout
- Added SetPrivateOption for extended options
- Implemented SRTP functions: SetSrtpCiphers, GetSrtpCipher
- Added ExportKeyingMaterial for external key usage
- Implemented timeout functions: SetIoTimeout, GetIoTimeout

ISslService:
- Added GetContextCount, SetDebugOption, GetDebugOption, ClearTls12FallbackFlag

ISslContext:
- Implemented GetOption, RemoveServerPki, RemoveClientPki, RegisterInternalPki,
  AddPolicyOid, ImportCrl, RemoveCrl, ImportClientCertKeyPki, GeneratePrivateKeyAndCert

ISslContextForSystem:
- Fully implemented all 15 commands (CreateConnectionEx and all base functions)

ISslConnection getter functions:
- Added GetSocketDescriptor, GetHostName, GetVerifyOption, GetIoMode

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-10-01 23:00:47 +10:00
Zephyron
40464551ed hle: service: Properly implement SSL services
Implements comprehensive SSL/TLS services based on Switch Brew documentation.

Changes:
- ISslService: Added GetContextCount, SetDebugOption, GetDebugOption,
  and ClearTls12FallbackFlag
- ISslContext: Implemented GetOption, RemoveServerPki, RemoveClientPki,
  RegisterInternalPki, AddPolicyOid, ImportCrl, RemoveCrl,
  ImportClientCertKeyPki, and GeneratePrivateKeyAndCert
- ISslContextForSystem: Fully implemented all 15 commands (was all stubs)
- ISslConnection: Added GetSocketDescriptor, GetHostName, GetVerifyOption,
  and GetIoMode

All SSL-related services now have complete command coverage with proper
stub implementations for emulator compatibility.

Reference: https://switchbrew.org/wiki/SSL_services
Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-10-01 22:46:31 +10:00
Zephyron
33a7836d4f hle: service: Properly implement NIM services
Implements comprehensive NIM (Network Install Manager) services based on
the official Switch Brew documentation.

Changes:
- Added async interface classes: IAsyncValue, IAsyncResult,
  IAsyncProgressResult, and IAsyncData for handling asynchronous operations
- Updated main nim service with all proper command names (commands 0-154)
  - Replaced "Unknown" placeholders (84-134) with correct function names
  - Added newer firmware commands (135-154) including download tasks,
    application icon requests, and delivery info operations
  - Fixed command 36: ListApplyDeltaTaskContentMeta (was duplicate name)
- Extended nim:shp service with Nintendo Account linking commands (600-601)
- Added nim:ecas command 5: GetCommonEcasSystemEventForReceivingBackgroundDownloadTask
- All services (nim, nim:eca, nim:shp, nim:ecas, ntc) verified and properly registered

This implementation accounts for all NIM-related functions across firmware
versions, providing proper stub handlers for emulator compatibility.

Reference: https://switchbrew.org/wiki/NIM_services
Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-10-01 22:28:17 +10:00
Zephyron
9090a24c2e feat: add Low GPU Accuracy setting for maximum performance
Implements a new "Low" GPU accuracy level that prioritizes performance
over accuracy by aggressively cutting corners in GPU emulation.

Changes:
- Add GpuAccuracy::Low enum and setting infrastructure
- Implement IsGPULevelNormal() helper function
- Skip texture cache checks and query operations
- Use unsafe memory reads for DMA operations
- Disable fence delays and query precision
- Add UI support for desktop (Qt) and Android

Performance optimizations:
- Skips texture cache coherency checks (vk/gl_rasterizer.cpp)
- Non-blocking query synchronization (query_cache.h)
- Unsafe memory operations (dma_pusher.cpp)
- No macro parameter refresh (maxwell_3d.cpp)
- Immediate fence signaling (fence_manager.h)
- Non-precise Vulkan queries (vk_query_cache.cpp)

Ideal for lower-end hardware and users prioritizing FPS over accuracy.
Works on both desktop and Android platforms.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-10-01 21:45:23 +10:00
Zephyron
746f748973 nim: Add CreateServerInterface2
- As Seen Via Logs "[  46.275081] Debug <Critical> core\hle\service\service.cpp:operator ():78: Assertion Failed!
Unknown / unimplemented function '5': port='nim:eca' cmd_buf={[0]=0x6, [1]=0x8000000C, [2]=0x3, [3]=0x0, [4]=0x4F434653, [5]=0x2001C4, [6]=0x0, [7]=0x0, [8]=0x49434653}"
- Thankyou Dr.Stug <dr.stug@citron-emu.org>

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-10-01 21:00:31 +10:00
Zephyron
d627962408 cmake: exclude Boost::process on Android
Boost::process is not available on Android, causing build failures.
Conditionally link it only on non-Android platforms.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-09-27 21:39:28 +10:00
Zephyron
0ca82d134c feat(acc): implement missing acc:u0 functions per SwitchBrew spec
- Add function 52 (TrySelectUserWithoutInteraction)
- Implement stubbed functions with proper async context classes
- Fix constructor arguments and type conversion warnings

Resolves assertion failure for unimplemented function 52.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-09-27 21:21:17 +10:00
Zephyron
23352d4a3f fix(dynarmic): resolve fastmem_pointer type compatibility issues
- Convert fastmem_pointer assignments from raw pointers to uintptr_t
- Replace nullptr comparisons with std::optional::has_value()
- Use std::nullopt instead of nullptr for optional types
- Update Dynarmic submodule to commit 9d4582339

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-09-27 20:22:04 +10:00
Zephyron
f75cf14c1f fix(hid): Add SixAxis sensor validation and error handling
- Add parameter validation for joy_xpad_id, device_index, and npad_id
- Implement proper SixAxis resource manager integration with null checks
- Add safe fallback values to prevent crashes in motion sensor games
- Enhance error handling and logging for SixAxis sensor operations
- Address crashes in games like TOTK 1.4.2 that use motion sensors

Resolves SixAxis sensor crashes by following SwitchBrew HID service
specifications and adding proper parameter validation.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-09-27 10:17:44 +10:00
collecting
c6a2a2a728 fix: create a Service::Set::SerialNumber object 2025-09-26 13:56:09 +00:00
collecting
f99fc514df Crash-on-Exit from ServiceManager Null Pointer 2025-09-26 04:24:23 +00:00
collecting
f18c6f09e1 Crash-on-Exit from ServiceManager Null Pointer 2025-09-26 03:33:32 +00:00
Zephyron
af223e445f feat: Enhance audio renderer with new features and simplify Android UI indicators
Audio Core:
- Add support for splitter previous volume reset (REV 13+)
- Implement new audio processing time limits (REV 14-15)
- Add voice channel resource limits and effect processing v3
- Support float biquad filters for improved audio quality
- Enhance error handling to prevent audio system crashes

Android UI:
- Simplify FPS, RAM, and thermal indicator views
- Remove complex backgrounds and icons for cleaner display
- Reduce view sizes and improve text-based rendering
- Maintain color-coded status indicators for performance metrics

Core System:
- Improve file system save data space handling
- Enhance kernel synchronization error handling
- Add new error modules and result codes
- Fix potential infinite loops in handle operations

These changes improve audio processing capabilities while providing a cleaner,
more performant Android UI experience.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-09-23 21:26:59 +10:00
collecting
bb874dc09f Add Boost::process @ 1224 2025-09-23 01:06:41 +00:00
collecting
09ef525ef2 Fix null pointer dereference in patch_manager.cpp line 362 2025-09-22 08:54:03 +00: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
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
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
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
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
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
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
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
Boss.sfc
0fb39034c1 fix: Resolve compilation issues with fmt library and formatters
Fix multiple compilation errors preventing successful build:

* Add const qualifier to custom fmt formatter functions across codebase
  - Updated formatters in logging, shader recompiler, texture cache, and other modules
  - Ensures compatibility with newer fmt library versions

* Add missing fmt/ranges.h includes for fmt::join usage
  - Fixed fmt::join calls in Vulkan renderer, GDB stub, NFC service, and main window
  - Resolves "no member named 'join' in namespace 'fmt'" errors

* Exclude unsupported platforms from Boost.Process usage in debugger
  - Extended conditional compilation to avoid Boost.Process where unavailable

* Fix type casting issues in AOC service manager
  - Resolved std::min type mismatch with explicit casting
2025-07-16 11:11:33 +07:00
Zephyron
eb4da7a78c audio: Implement missing audio services and functions
New Services Added:
- auddev (IAudioSnoopManager) - Audio development/debugging service [6.0.0+]
  * EnableDspUsageMeasurement/GetDspStatistics with firmware version switching
  * DisableDspUsageMeasurement/GetAppletStateSummaries with firmware version switching
  * SetDspStatisticsParameter/GetDspStatisticsParameter [20.0.0+]
  * GetDspUsage [6.0.0-16.1.0]

- aud:a (IAudioSystemManagerForApplet) - System audio manager for applets [11.0.0+]
  * Applet resource user ID registration/management
  * Audio suspend/resume functionality
  * Per-applet volume controls (output/input/record)
  * GetAppletStateSummaries [18.0.0-19.0.1]

- aud:d (IAudioSystemManagerForDebugger) - System audio manager for debugging [11.0.0+]
  * RequestSuspendAudioForDebug/RequestResumeAudioForDebug

Enhanced Existing Services:
- audctl (IAudioController) - Added missing [19.0.0+] functions:
  * OverrideDefaultTargetForDebug [19.0.0-19.0.1]
  * SetForceOverrideExternalDeviceNameForDebug [19.0.0+]
  * ClearForceOverrideExternalDeviceNameForDebug [19.0.0+]
  * Fixed GetSystemInformationForDebug buffer handling

- IAudioDevice - Added missing [17.0.0+] and [18.0.0+] functions:
  * AcquireAudioInputDeviceNotification/ReleaseAudioInputDeviceNotification [17.0.0+]
  * AcquireAudioOutputDeviceNotification/ReleaseAudioOutputDeviceNotification [17.0.0+]
  * SetAudioDeviceOutputVolumeAutoTuneEnabled/IsAudioDeviceOutputVolumeAutoTuneEnabled [18.0.0+]

Technical Changes:
- Updated service registration in audio.cpp to replace placeholder services
- Added proper CMIF buffer handling with std::array<u8, SIZE> for InLargeData/OutLargeData
- Added firmware version annotations matching switchbrew documentation
- Implemented proper state management for all new services
- Added comprehensive error handling and logging

This implementation provides complete audio service coverage including the specifically requested GetDspStatisticsParameter function and numerous other missing functions that games expect to be available.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-07-10 18:00:59 +10:00
Zephyron
99cff6cb9c core/hle/service/bcat: Fix compilation errors and implement missing services
- Fix CMIF serialization alignment error in RequestSyncDeliveryCacheWithApplicationIdAndDirectoryName by reordering parameters (DirectoryName before u64)
- Implement missing INotifierService and IDeliveryTaskSuspensionService classes with proper kernel event handling
- Add missing source files to CMakeLists.txt to resolve linker errors
- Update IServiceCreator to properly implement CreateDeliveryCacheProgressService methods instead of leaving them stubbed
- Add ProgressServiceBackend support to IServiceCreator with proper friend class access
- Fix kernel event creation by using KernelHelpers::ServiceContext instead of direct system calls
- Add proper includes for kernel_helpers.h and event management

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-07-05 23:12:39 +10:00
Zephyron
f1ba9df80a Merge branch 'glue-add-new-functions-services' into 'master'
hle/service: Implement missing Glue services for 20.0.0+ support

See merge request citron/rewrite!30
2025-07-01 10:09:20 +00:00
Zephyron
98d0c627e6 hle/service: Implement missing Glue services for 20.0.0+ support
- **ARP Service (arp:r/arp:w)**: Added 20.0.0+ function support
  * arp:r: GetApplicationInstanceUnregistrationNotifier, ListApplicationInstanceId,
    GetMicroApplicationInstanceId, GetApplicationCertificate, GetPreomiaApplicationLaunchProperty,
    GetPreomiaApplicationControlProperty
  * arp:w: AcquireApplicationProcessPropertyUpdater, AcquireApplicationCertificateUpdater,
    RegisterApplicationControlProperty
  * Added interface classes: IUnregistrationNotifier, IApplicationProcessPropertyUpdater,
    IApplicationCertificateUpdater

- **Platform Service Manager (pl:u)**: Added Switch 2 [S2] functions
  * Commands 2010, 2020, 2100 (Unknown2010, Unknown2020, OpenFont)

- **ECTX Service**: Added missing ectx:r service implementation
  * Registered ectx:r service alongside existing ectx:aw

- All functions properly stubbed
- Fixed PushIpcInterface usage with shared_ptr
- Command mappings follow switchbrew.org documentation
- Ensures compatibility with 20.0.0+ system versions

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-07-01 20:06:45 +10:00
Zephyron
2776962067 core/hle: Implement all missing AM (Applet Manager) service functions
Add complete implementation of missing functions and services from the Applet Manager services documentation, including 20.0.0+ functions.

Changes:
- IApplicationFunctions: Add functions 210-999 including 20.0.0+ function 460
  * GetLaunchRequiredVersionUpgrade, RequestToLaunchApplication
  * DeclareApplicationAlive, GetApplicationControlProperty
  * CreateApplicationResourceUsageSystemReportForDebug, etc.

- IHomeMenuFunctions: Add functions 300-910
  * RebootSystem, LaunchApplication, GetAppletLaunchedHistory
  * TakeScreenShotOfOwnLayerEx, CreateFloatingLibraryApplet, etc.

- IGlobalStateController: Add functions 50-400
  * VR mode functions, wireless priority mode, system button history
  * Operation mode changes, sleep/wake functionality, etc.

- ISelfController: Add functions 140-950
  * Recording functions, CPU boost, performance configuration
  * Migration services, album accessors, etc.

- ICommonStateGetter: Add functions 600-1063
  * Save data functions, cache storage, GPU error detection
  * Capture image functions, HDCP authentication, etc.

- Create new service classes:
  * IOverlayAppletProxy with IOverlayAppletFunctions
  * ISystemApplicationProxy for system applications

- Fix IAllSystemAppletProxiesService stub implementations:
  * OpenOverlayAppletProxy, OpenSystemApplicationProxy
  * CreateSelfLibraryAppletCreatorForDevelop, GetDebugFunctions

All functions are appropriately implemented. Functions without descriptions return stub implementations. Includes all 20.0.0+ functions from switchbrew documentation.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-07-01 17:54:07 +10:00
Zephyron
e2e35d1af6 Merge branch 'tma-add-new-functions-services' into 'master'
core/hle: Implement TMA (Target Manager Agent) service

See merge request citron/rewrite!28
2025-07-01 06:27:59 +00:00
Zephyron
04b0624930 core/hle: Implement TMA (Target Manager Agent) service
Add implementation for the TMA service which provides file I/O
and debugging functionality for development tools.

Changes:
- Add TMA service with IFileManager, IFileAccessor, and IDirectoryAccessor
- Implement stubbed file operations (ReadFile, WriteFile, GetFileSize, etc.)
- Implement stubbed directory operations (ReadDirectory, GetEntryCount, etc.)
- Add TMA logging category for service debugging
- Fix parameter alignment in ReadFile function signature

All functions are provided as-is to allow games and development tools to initialize
without errors.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-07-01 16:25:30 +10:00
Zephyron
90f265837d fs: Implement missing filesystem functions and interfaces
- Add IDeviceOperator interface with 49 functions for SD card, MMC, and game card operations
- Add IEventNotifier interface for filesystem event notifications
- Add ISaveDataTransferManager and related transfer interfaces (exporter/importer)
- Add IWiper interface for BIS partition wiping
- Enhance FSP_SRV with OpenDeviceOperator, OpenSdCardDetectionEventNotifier, OpenSaveDataTransferManager, and other missing functions
- Enhance FSP_LDR with OpenCodeFileSystem, IsArchivedProgram, and SetCurrentProcess implementations
- Enhance FSP_PR with RegisterProgram, UnregisterProgram, and verification functions
- Fix ServiceContext usage for proper event creation and management
- Fix function parameter alignment issues for CMIF serialization
- Update build system to include new source files
- Update copyright headers to 2025 citron

All functions are implemented with appropriate logging and parameter validation based on Nintendo Switch filesystem services documentation.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-06-30 19:24:23 +10:00