Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #160 +/- ##
===========================================
- Coverage 61.40% 50.16% -11.24%
===========================================
Files 2 30 +28
Lines 57 4764 +4707
Branches 13 2123 +2110
===========================================
+ Hits 35 2390 +2355
- Misses 15 1686 +1671
- Partials 7 688 +681
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
|
3d105cb to
afa99a2
Compare
2edc2b0 to
cf77c81
Compare
2cdaed4 to
e727743
Compare
Introduce client-side UI and state management plus extensive build and platform adjustments for Xbox/nxdk. Key changes: - Add app UI/state implementation (src/app/*), pairing, host records, networking, startup, logging, input navigation, streaming overlay, and many UI components. - Add compatibility shims for OpenSSL and moonlight-common-c, plus new FindNXDK_SDL2_TTF CMake module and font/logo assets. - Add many unit tests covering app, input, logging, network, startup and UI components (tests/unit/*). - Update CMake build: enable export of compile commands, add xbox mingw64 CMake presets, register SDL2_TTF, include libxboxrt, and pass compat header into moonlight-common-c build. - Revise GetOpenSSL: pin OpenSSL to 1.1.1w, add platform-aware configure/build logic for HOST vs XBOX, set configure options and env vars, and link host system libs when appropriate. - Small cmake/source tweaks: exclude shell_screen from host tests, export compile commands for child builds, and link NXDK::Net into ws2_32 target. - Enhance run-xemu scripts to support network mode and TAP interface, to propagate XEMU-related environment paths, and to include network args when launching xemu. - Update .gitmodules to track OpenSSL OpenSSL_1_1_1-stable branch and update third-party/openssl submodule reference. These changes add core UI/state functionality and platform-specific build/tooling to support building and running on Xbox (nxdk) and improve host-side OpenSSL vendoring. Some new files are large and introduce the initial app logic and tests.
Provide NXDK-specific compatibility for OpenSSL and sockets: add src/_nxdk_compat (openssl_compat.h, poll_compat.cpp, stat_compat.cpp), remove legacy openssl compat files, and wire them into CMake (include dirs, build/install commands, and source list changes). Refactor host_pairing to be cross-platform (NXDK vs Winsock): unify socket error handling, non-blocking connect helper, timeouts, TLS connect error reporting, serverinfo path construction with uniqueId, and ensure socket initialization works on NXDK. Minor UI text cleanups and include stat_compat.cpp in the final executable. Also update third-party submodule pins for moonlight-common-c and nxdk.
Introduce the first M0 client shell and supporting infrastructure: structured in-memory logging (logger + log_file), controller/keyboard input mapping, retained menu model, host records and pairing flow scaffolding, saved files and cover art cache, startup memory/video utilities, and UI state management (client_state). Adds grid/modal navigation, add-host keypad, apps view, log viewer, and many unit tests and icon assets. Also includes various refactors and helpers for host/app selection, scrolling, and menu rebuilding to enable further work on pairing, streaming and Xbox runtime integration.
Record and handle data cleanup when hosts are deleted: add pairingResetEndpoints to ClientState and new AppUpdate fields to request host-delete cleanup and carry deleted host metadata (address, port, paired flag, cover art keys). Implement helpers to remember/clear deleted host pairing and to check host_requires_manual_pairing, and clear these records when a host is successfully re-paired. Add startup APIs to delete persisted client identity and cached cover art (delete_client_identity, delete_cover_art) with basic error reporting. Wire a delete_host_data_if_requested flow that removes cached cover art, clears texture cache, and resets the shared client identity if no paired hosts remain, updating status messages accordingly. Improve settings/menu synchronization (sync_selected_settings_category_from_menu, rebuild_settings_detail_menu) and adjust UI rendering for the menu/options/detail layout and visuals. Simplify SVG asset handling and texture creation (use SDL scale hint for quality), and swap footer action icons for Exit in the view model. Update many SVG icon assets to remove text parameters (nanosvg limitation) and tweak visuals, add xbe/assets README, and extend unit tests to cover host deletion/pairing cleanup, client identity deletion, and cover art deletion. Also mark several README features as completed.
Add verbose startup debug logging and encoder diagnostics, and harden video mode selection and UI layout for widescreen/HD scenarios. - main.cpp: introduce debug_print_* helpers, log XVideoGetEncoderSettings, XVideoSetMode result, SDL initialization/window creation, and startup task lifecycle for easier diagnostics. - splash: always apply aspect correction when framebuffer vs display aspect differs; add calculate_display_width() to compute logical UI width based on effective display aspect (header and implementation), and adjust logo scaling logic. - ui/shell_screen: query encoder settings, compute logical screen width via calculate_display_width, apply horizontal SDL renderer scaling to render square-pixel UI, and restore scale after presenting. - startup/video_mode: prefer 720p progressive over 1080i interlaced when both are available; add helper is_1080i and update selection logic. - tests: add unit tests for the 4:3 correction on HD modes, calculate_display_width behavior, and preferring 720p over 1080i. - scripts/README: note widescreen tool in README and update run-xemu.sh to set display.ui aspect_ratio = 'native' in generated config. These changes improve widescreen support, ensure UI layout uses a logical square-pixel width, prefer progressive HD modes for clarity, and make startup video/debug issues easier to diagnose.
Remove the imported ws2_32 target and all NXDK::ws2_32 link usages from CMake (FindNXDK.cmake, xbox-build.cmake, GetOpenSSL.cmake) and link against NXDK::Net instead. Update OpenSSL target linkage to omit ws2_32 on HOST Windows builds. Add lwIP/socket compatibility helpers to src/_nxdk_compat/openssl_compat.h: include lwip/opt.h, sys/time.h and string.h, declare lwip_select, provide defaults for LWIP_SOCKET_OFFSET and FD_SETSIZE (based on MEMP_NUM_NETCONN), and define fd_set plus FD_* macros and a select macro that maps to lwip_select. These changes remove the dependency on WinSock symbols and provide a minimal fd_set/select shim for lwIP on NXDK.
Introduce platform::filesystem utilities and centralize dependency preparation.
- Add src/platform/filesystem_utils.{h,cpp} to provide cross-platform path operations, directory creation, file size checks and prefix checks.
- Replace duplicated path and directory helper code in logging, startup (client_identity_storage, cover_art_cache, host_storage, saved_files) with platform:: APIs and use platform::join_path for consistent path handling.
- Make saved_files and host_pairing more portable: add POSIX directory enumeration and socket handling fallbacks, unify SOCKET handling and non-blocking configuration.
- Improve OpenSSL vendored build: add msys2 support, shell-quoting helpers and platform-specific configure/build commands in cmake/modules/GetOpenSSL.cmake; expose provider/platform info and link ws2_32 for Windows host builds when needed.
- Add cmake/moonlight-dependencies.cmake to prepare common third-party dependencies (moonlight-common-c, OpenSSL, enet) and use it from top-level CMakeLists and xbox-build.cmake.
- Tests: add tests/support/filesystem_test_utils.h and update tests to use it; require prepared Moonlight dependency targets in tests/CMakeLists and link Moonlight::OpenSSL (add ws2_32 on Windows), and add dependency on moonlight-common-c for test target.
These changes reduce duplicated filesystem/platform code, improve portability across Windows/Unix/NXDK, and centralize dependency configuration for builds and tests.
Make Windows/Mingw builds more reliable and surface better logs. CI: install mingw-w64-x86_64-cmake for MinGW CMake support and expand failure debug step to print OpenSSL configure/build logs for host and Xbox builds. build.sh: collect CMake configure args into an array, require a CMake with MinGW Makefiles on Windows, and set the MinGW generator and toolchain file. cmake/modules/GetOpenSSL.cmake: introduce a deterministic external target name, clear Make-related env vars, pass MAKEFLAGS/MFLAGS/GNUMAKEFLAGS/MAKELEVEL and enforce single-job (-j1) builds for Windows/MSYS to avoid parallel build issues; properly map compiler/AR/RANLIB into MSYS2 shell commands; use the new external target name in ExternalProject_Add and add_dependencies; and emit the OpenSSL external target in status messages. cmake/moonlight-dependencies.cmake: conditionally wire moonlight-common-c to the OpenSSL external target when defined and present. These changes improve reproducibility and Windows build stability.
Add Doxygen-style comments across many public headers to document structs, functions, parameters and return values. Updated .github/copilot-instructions.md to require/mention Doxygen documentation. Files touched include openssl_compat.h, client_state.h, host_records.h, pairing_flow.h, log_file.h, logger.h, host_pairing.h, runtime_network.h, client_identity_storage.h, cover_art_cache.h, host_storage.h, saved_files.h, stats_overlay.h, menu_model.h, shell_view.h and a small SVG asset tweak. These comments improve API clarity and help enforce build-time documentation checks.
Refactor add-host keypad handling and improve controller navigation/UI behavior. - Replace ad-hoc keypad button list with fixed character arrays and AddHostKeypadLayout; add helper to get selected keypad character and robust wrapping navigation across rows. - Add GamepadAxisDirection enum and mapping for axis directions to UI commands; support left-stick navigation with hysteresis and held-repeat timing. - Rework SDL event loop to use a short wait timeout, process events, and poll controller navigation when idle; add per-direction hold state and repeat/seeding logic; avoid jitter and require neutral stick when non-navigation commands occur. - Introduce KeypadModalLayoutCache to cache modal text measurements and reduce redraws; optimize modal rendering and drawing conditions for keypad modal. - Update shell view text and modal footer actions to reflect new controls and improve help messaging. - Simplify host_pairing: remove legacy JSON parsing helpers and SHA-1 legacy support, force SHA-256 pairing digest, and adjust digest/key derivation APIs; return an explicit error when applist is not XML. - Minor input and UI tweaks (constants, thresholds, repeat timings) and corresponding unit test updates. These changes improve controller UX (left-stick support, repeat behavior), simplify keypad logic, and remove legacy pairing code paths.
Add an IDE run configuration (.run/docs.run.xml) to open the generated docs HTML. Replace the old loading.png with three new screenshots under docs/images/screenshots and update README to show the new images and clarify that streaming does not work yet and 1080i does not work in Xemu. Also tidy the TODO checklist by marking docs via doxygen done and removing the duplicate entry.
Add test-output/ to .gitignore and delete generated test logs under test-output/logging (long-lines.log, moonlight.log, reset.log). These are ephemeral test artifacts and should not be tracked in the repository.
Stop tracking the binary vegur-regular.ttf and instead copy it from the nxdk samples during the CMake xbox asset sync. Remove the committed font file from the repo. Update CI and docs: drop mingw-w64-x86_64-make from the workflow and remove the failing OpenSSL debug-logs step, and adjust README to use mingw-w64-x86_64-cmake (plus minor formatting).
Introduce a lightweight activeHost snapshot and hostsLoaded flag to allow unloading the hosts page while preserving host-specific screens. Add utilities to remember/restore selected host, unload per-screen state, and route lookups via find_loaded_host_by_endpoint. Implement a thread-safe HostProbeResultQueue and refactor host probing to spawn per-host worker threads that publish results into the queue; the main loop now drains and reap workers, updating host reachability and persisting metadata changes. Extend host-record serialization to include cached host metadata and app-list entries (with percent-encoding/decoding and parsing helpers) so app lists, artwork cache keys, and related flags are persisted. Update persistence and shell logic to merge activeHost into saved hosts when saving, lazily load hosts for the hosts screen, release page resources on screen changes, and adjust related client_state/shell behavior. Tests updated to reflect the new unload/load semantics and probe behavior.
Introduce persistent TOML-backed app settings and expand logging features. - Add third-party tomlplusplus submodule and include it in the Xbox build. - Implement settings storage (src/app/settings_storage.*) to load/save moonlight.toml (logging and UI keys), with parsing, validation, warnings and cleanup hints. - Add AppSettings types and load/save APIs (settings_storage.h). - Add storage_paths helper for default storage locations and platform error utilities. - Enhance logging subsystem: - Add global logger proxy (global_logger.*) and startup debug support. - Add source-location support and richer formatting in logger; include optional file/line in entries. - Add runtime file sink type and ability to set file sink, per-sink minimum levels, debugger-console minimum level, and startup debug flag. - Change default in-memory/file logging levels handling and improve sink dispatching. - Update client_state to use new settings, add detailed UI menu item descriptions, track settingsDirty/settingsChanged, expose xemu console logging level, and restructure create_initial_state to explicit member initialization. - Update run-xemu.sh to add environment flags controlling xemu serial stdio and to include serial device args conditionally. - Update CMake includes for tomlplusplus and adjust logging/log_file storage path resolution to use new storage helpers. - Add startup debug logger files and tests for settings/logging components; add third-party/tomlplusplus submodule. These changes add user-configurable TOML settings, improve observability during startup and runtime, and enable mirrored logging to xemu's serial console.
Remove separate global_logger and startup_debug modules and move their functionality into logger.{h,cpp}. Introduces process-wide logger management and convenience logging APIs (set_global_logger, log/trace/debug/info/warn/error, set_minimum_level, set_file_sink, set_file_minimum_level, set_debugger_console_minimum_level, set_startup_debug_enabled, snapshot, format_startup_console_line, startup console enable/print helpers). Replace uses of logging::logger proxy and StartupConsoleStyle with the new logging::* free functions and LogLevel-based startup console functions across main, splash, startup, ui and tests. Add internal g_globalLogger and startup-console state, and NXDK-aware startup console printing. Update includes to use logger.h and tidy up related tests.
Break up large command and app-list functions into focused helper routines. Extracted modal helpers (close_modal_and_mark_closed, per-modal handlers, handle_modal_activation) and host/app action helpers (request_host_pairing, delete_selected_host, collect_deleted_host_cover_art_keys). Reworked apply_app_list_result into smaller pieces (find_app_list_result_host, merge_host_app_records, apply_unpaired_app_list_failure, apply_cached_app_list_failure, restore_selected_app_after_refresh) and tightened null/update checks. Also modularized UI command handling (overlay, add-host keypad, settings, hosts, apps) to improve readability and maintainability with no intended behavioral changes.
Group related ClientState fields into nested substructures (hosts, apps, shell, settings, persistence, navigation, requests) and update all usages accordingly. Moves host list into hosts.items and renames numerous fields (e.g. activeHost -> hosts.active, activeScreen -> shell.activeScreen, statusMessage -> shell.statusMessage, hostsDirty -> hosts.dirty, logViewer* and savedFiles into settings.*, pairingResetEndpoints into hosts.pairingResetEndpoints). Also adapts AppUpdate fields to new namespaces (navigation/requests/persistence) and updates related logic and tests to match the new layout.
Integrate nanosvg to rasterize SVG assets to requested pixel bounds and make asset texture caching size-aware. Adds helpers: build_asset_texture_cache_key, calculate_fitted_dimensions and load_svg_surface_from_asset; load_texture_from_asset now optionally rasterizes SVGs when max dimensions are provided. The asset cache keys include raster dimensions and failed-key tracking was updated accordingly; load_cached_asset_texture and render_asset_icon were updated to pass requested bounds. Removed the dedicated titleLogoTexture field and its load/destroy calls in favor of rendering the logo via the asset cache. Also updates several SVG icon assets with revised vector art.
c4b888b to
2c7bd74
Compare
|



Description
Phase 1 of implementation
TODO:
Screenshot
Issues Fixed or Closed
Roadmap Issues
Type of Change
Checklist
AI Usage