Major networking enhancements to improve multiplayer performance and
reduce desync issues in games like Mario Kart 8 Deluxe:
Network Performance:
- Add socket connection pooling in BSD service to reduce overhead
- Implement unreliable packet delivery for latency-sensitive game data
- Add packet reliability control for both ProxyPacket and LDNPacket
- Use ENET_PACKET_FLAG_UNSEQUENCED for small UDP packets (<1200 bytes)
Monitoring & Debugging:
- Add PacketStatistics struct to track sent/received/dropped packets
- Enhanced logging for proxy packet handling and socket lifecycle
- Periodic stats logging every 100 packets for diagnostics
Configuration:
- Update lobby_api_url and web_api_url to https://api.ynet-fun.xyz
- Add lobby API URL configuration support
Socket Management:
- Implement SocketPoolKey for efficient socket reuse
- Store domain/type/protocol info in FileDescriptor
- Max pool size limit (8 sockets per type) to prevent memory bloat
- Return closed sockets to pool when room is still connected
Protocol Updates:
- Add 'reliable' field to ProxyPacket and LDNPacket structures
- Update room.cpp packet handlers to respect reliability flags
- Maintain backward compatibility with default reliable=true
These changes significantly reduce packet latency for real-time game
traffic while maintaining reliability for control packets.
Signed-off-by: Zephyron <zephyron@citron-emu.org>
Windows auto updater failed due to:
1. File locking - can't overwrite running .exe files
2. Missing Qt 6 TLS plugins - can't connect via HTTPS
Solution:
- Implement helper batch script that applies updates after app exits
- Automate TLS plugin copying in CMake (qschannelbackend.dll, qopensslbackend.dll)
- Add enhanced SSL debugging and error messages
Windows updates now work. Linux continues to work as before.
Signed-off-by: Zephyron <zephyron@citron-emu.org>
Add support for the Skyline 32-bit modding framework by implementing
a code address offset and improving memory state verification.
Changes:
- Add CodeStartOffset constant (0x500000) applied to 32-bit code
address space types (Is32Bit and Is32BitNoMap) in KProcess::LoadFromMetadata
- Add debug logging for 32-bit syscall argument tracking in
SetProcessMemoryPermission, MapProcessCodeMemory, and
UnmapProcessCodeMemory wrapper functions
- Replace CheckMemoryStateContiguous with CheckMemoryState in
KPageTableBase::UnmapCodeMemory for more flexible memory state
verification
This implementation enables compatibility with:
- Skyline 32-bit modding framework
- CTGP-DX (Mario Kart 8 Deluxe mod)
- Other homebrew using 32-bit Skyline
Based on similar fixes in Ryujinx (commit 5e9678c8fe) and Eden emulator.
Co-authored-by: JPikachu <jpikachu.eden@gmail.com>
Co-authored-by: JPikachu <jpikachu@eden-emu.dev>
Signed-off-by: Zephyron <zephyron@citron-emu.org>
Changes:
- Add missing encryption type cases to all switch statements
- Only call CreatePatchMetaStorage() when both tables are present
- Update assertions to allow partial table combinations
Fixes loading for Hades II, Pokémon Legends: Z-A, and other games
with newer NCA structures.
Reported-by: Dr.Stug@citron-emu.org
Signed-off-by: Zephyron <zephyron@citron-emu.org>
Initialize PollFD.revents field to prevent assertion failures when
copying from read buffer. The assertion was failing because revents
contained uninitialized data from the buffer.
Thanks to Dr.Stug for providing the logs that identified this issue.
Fixes assertion failure at core\hle\service\sockets\bsd.cpp:564
Signed-off-by: Zephyron <zephyron@citron-emu.org>
- Increased heap region from 8 GiB to 12 GiB
- Fixed memory manager page reference count allocation
- Made resource region sizing dynamic for >8GB DRAM
- Increased physical address space bits to support 16GB
Signed-off-by: Zephyron <zephyron@citron-emu.org>
- Add stubbed DeleteCacheStorage function to FSP_SRV service
- Return success instead of causing assertion failure
- Prevents userspace PANIC when games attempt to delete cache storage
Signed-off-by: Zephyron <zephyron@citron-emu.org>
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>
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>
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>
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>
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>
- 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>
- 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>
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>
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>