You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DS Netplay core: port GPL DetMP and deterministic mirrored melonDS to native Linux #163
Parent: #162. Implement the emulator-side mechanism, not social/network UI.
Technical target
Port the useful ideas/source from GPL-licensed WatermelonDS Emufii Edition into a reproducible, TrainerOS-owned Linux melonDS build. Prefer a maintainable small patch set on a selected pinned upstream melonDS revision. Do not package the Android WatermelonDS APK, Kotlin UI, Android logging/properties/JNI or a parallel all-in-one launcher.
Check all related upstream core edits and patch ancestry: src/net/DetMP.*, MPInterface.*, NDS scheduling/frame hooks, Wi-Fi calls, deterministic serialization/savestate/JIT normalization, mirror lifecycle and renderer. One NetplayAndroid.cpp copy is insufficient.
Compare with current upstream melonDS and any upstreamed implementation before patching; prefer maintained upstream solution where demonstrably equivalent, without erasing provenance.
Implementation
Add a build target/profile and versioned patch in TrainerOS's managed emulator pipeline similar to the existing Dolphin netplay bridge; document reproducible source/toolchain/dependencies, hashes and ABI/platform support.
Use a narrow platform-neutral/netplay core API; replace Android __android_log_print, system properties, JNI/Kotlin, per-APK preferences and ad hoc user host/join dialog with Linux/core settings driven by trusted local TrainerOS integration.
Each physical client runs one local rendered DS plus one non-presented mirror for each other player. Local wireless interactions happen between co-located instances in emulated deterministic time; the network carries controlled inputs/synchronization, not raw timed DS Wi-Fi over a generic VPN.
Adapt host-selected network lag to measured RTT/jitter rather than freeze a magic 4-frame default; track user-visible latency and failure modes.
Reuse diagnostic hash/checkpoint/desync comparison where appropriate, but never log raw memory, saves, BIOS, player identifiers or credentials.
Mirror-only rendering optimizations must be separately proven safe with GPU display captures (upstream Mario Kart issue is relevant), not blindly applied to Linux GPU paths.
Ensure ordinary single-player melonDS, local LAN mode and WFC game networking are unchanged when DS netplay is disabled.
Licensing
TrainerOS code is GPL-3.0-or-later (#115). Upstream melonDS/WatermelonDS changes are GPL-compatible. Preserve original copyright headers, exact source commit IDs, changed-file notices and corresponding GPL source/patch distribution. ENet MIT and zstd BSD-3-Clause notices/dependency versions must be retained. Keep Android-only code out of the native build.
Acceptance
Reproducible Linux ARM64 build and x86-64 build where feasible; selected existing single-player DS games still launch/exit/save normally.
Two co-located emulated DS exchange representative wireless frames deterministically under repeatable tests without any real network.
Recorded per-frame inputs reproduce a deterministic session under matched build/settings; controlled desync is detected.
Android-specific glue and unbounded raw network/savestate parsing are not carried over without adaptation.
Parent: #162. Implement the emulator-side mechanism, not social/network UI.
Technical target
Port the useful ideas/source from GPL-licensed WatermelonDS Emufii Edition into a reproducible, TrainerOS-owned Linux melonDS build. Prefer a maintainable small patch set on a selected pinned upstream melonDS revision. Do not package the Android WatermelonDS APK, Kotlin UI, Android logging/properties/JNI or a parallel all-in-one launcher.
Start from exact inspected source
9b603e53d4d098a0fcee3401ffa5e9c9992f01a3— input frames, ENet handshake, per-peer mirrors, adaptive lag, hashes/checks.85fdb7596011a3d0e679a6f1f88c312e77ff4cc5— emulated clock/time ordering and deterministic packet/command/reply exchange.src/net/DetMP.*,MPInterface.*, NDS scheduling/frame hooks, Wi-Fi calls, deterministic serialization/savestate/JIT normalization, mirror lifecycle and renderer. OneNetplayAndroid.cppcopy is insufficient.Implementation
__android_log_print, system properties, JNI/Kotlin, per-APK preferences and ad hoc user host/join dialog with Linux/core settings driven by trusted local TrainerOS integration.Licensing
TrainerOS code is GPL-3.0-or-later (#115). Upstream melonDS/WatermelonDS changes are GPL-compatible. Preserve original copyright headers, exact source commit IDs, changed-file notices and corresponding GPL source/patch distribution. ENet MIT and zstd BSD-3-Clause notices/dependency versions must be retained. Keep Android-only code out of the native build.
Acceptance