Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
c176ea4
Add client UI/state, tests and Xbox build support
ReenigneArcher Apr 4, 2026
7c67823
Add NXDK OpenSSL/socket compatibility & pairing fixes
ReenigneArcher Apr 5, 2026
a59d8ac
Add initial client shell, host & logging features
ReenigneArcher Apr 6, 2026
64d95e0
style: clang format
ReenigneArcher Apr 6, 2026
965a3bc
Track deleted hosts, cleanup pairing and cover art
ReenigneArcher Apr 6, 2026
eb228ce
Improve video/aspect handling and add startup logs
ReenigneArcher Apr 6, 2026
8d963ee
Add lwIP select compatibility; drop ws2_32
ReenigneArcher Apr 6, 2026
a3b46bd
Add platform filesystem utils and CMake deps
ReenigneArcher Apr 7, 2026
4300c1e
Improve OpenSSL build and MinGW support
ReenigneArcher Apr 7, 2026
05c5ad9
Add Doxygen documentation to headers
ReenigneArcher Apr 7, 2026
97455a4
style: sonar fixes
ReenigneArcher Apr 7, 2026
9c21433
Enhance controller navigation and keypad UI
ReenigneArcher Apr 8, 2026
2ddedec
Add docs runconfig and update README/screenshots
ReenigneArcher Apr 8, 2026
65d4df7
Ignore test-output and remove test logs
ReenigneArcher Apr 8, 2026
6c864af
Copy vegur font; remove file; update CI/deps
ReenigneArcher Apr 9, 2026
f6c2fa7
Add host snapshot, probe queue, and caching
ReenigneArcher Apr 9, 2026
de886e2
Add TOML settings & enhance logging
ReenigneArcher Apr 12, 2026
e31a886
Consolidate global logger and startup debug
ReenigneArcher Apr 12, 2026
2671e26
Refactor modal and app-list handling into helpers
ReenigneArcher Apr 12, 2026
9b31425
style: sonar fixes
ReenigneArcher Apr 12, 2026
1e6c288
style: sonar fixes
ReenigneArcher Apr 12, 2026
4b77de8
Refactor ClientState into nested structs
ReenigneArcher Apr 12, 2026
a290364
style: sonar fixes
ReenigneArcher Apr 12, 2026
dc89a1f
SVG rasterization and size-aware asset cache
ReenigneArcher Apr 14, 2026
f7a7b41
Add file-level documentation comments
ReenigneArcher Apr 15, 2026
c81df48
Improve doxygen documentation
ReenigneArcher Apr 15, 2026
aebf7e4
docs: update screenshots
ReenigneArcher Apr 17, 2026
538b4bc
Show PIN immediately; update pairing flow and tests
ReenigneArcher Apr 18, 2026
f21eccf
Add scripted HTTP test handler for host pairing
ReenigneArcher Apr 18, 2026
68e2531
Remove obsolete planning and research docs
ReenigneArcher Apr 18, 2026
753e931
Add extensive unit tests and utilities
ReenigneArcher Apr 18, 2026
037d466
Refactor host pairing tests to use std::byte
ReenigneArcher Apr 18, 2026
204d41d
Refactor byte helpers and pairing test handler
ReenigneArcher Apr 18, 2026
7b0af9d
Refactor OpenSSL CMake helpers, rename macro
ReenigneArcher Apr 18, 2026
e25ea15
Refactor MSYS2 detection into helper functions
ReenigneArcher Apr 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,27 @@ You need to prefix commands with `C:\msys64\msys2_shell.cmd -defterm -here -no-s

Prefix build directories with `cmake-build-`.

The xbox build uses Unix Makefiles.

The host native tests will use MinGW Makefiles on Windows, but Unix Makefiles on other platforms.

The project uses gtest as a test framework.

Always add or update doxygen documentation.

The project requires that everything be documented in doxygen or the build will fail.

Primary doxygen comments should be done like so:

```cpp
/**
* @brief Describe the function, structure, etc.
*
* @param my_param Describe the parameter.
* @return Describe the return.
*/
```

Inline doxygen comments should use `///< ...` instead of `/**< ... */`.

Always follow the style guidelines defined in .clang-format for c/c++ code.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,15 @@ jobs:
update: true
install: >-
bison
cmake
flex
git
make
mingw-w64-x86_64-cmake
mingw-w64-x86_64-clang
mingw-w64-x86_64-gcc
mingw-w64-x86_64-lld
mingw-w64-x86_64-llvm
mingw-w64-x86_64-make

- name: Setup python
id: setup-python
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,8 @@ cmake-*/
.local/
docs/doxyconfig*

# test output
test-output/

# Temporary files
*.cmd~
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@
[submodule "third-party/openssl"]
path = third-party/openssl
url = https://github.com/openssl/openssl.git
branch = OpenSSL_1_1_1-stable
[submodule "third-party/tomlplusplus"]
path = third-party/tomlplusplus
url = https://github.com/marzer/tomlplusplus.git
branch = master
7 changes: 7 additions & 0 deletions .run/docs.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="docs" type="CMakeRunConfiguration" factoryName="Application" PROGRAM_PARAMS="&quot;file:\\$CMakeCurrentBuildDir$\build\html\index.html&quot;" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="Moonlight" TARGET_NAME="docs" CONFIG_NAME="nxdk-release (mingw64)" RUN_PATH="$PROJECT_DIR$/../../../../../Windows/explorer.exe">
<method v="2">
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
</method>
</configuration>
</component>
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ cmake_minimum_required(VERSION 3.18)

# Allow third-party subdirectories that use cmake_minimum_required < 3.5 (removed in CMake 4.x)
set(CMAKE_POLICY_VERSION_MINIMUM 3.5 CACHE STRING "")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE BOOL "Export compile commands for IDE tooling" FORCE)

set(MOONLIGHT_BUILD_KIND "HOST" CACHE STRING "Internal Moonlight build mode")
set_property(CACHE MOONLIGHT_BUILD_KIND PROPERTY STRINGS HOST XBOX)
Expand Down Expand Up @@ -51,12 +52,14 @@ option(BUILD_XBOX "Build the Xbox target through an internal child configure" ON
option(MOONLIGHT_FORCE_NXDK_DISTCLEAN "Force a fresh nxdk distclean during configure" OFF)

include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/sources.cmake")
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/moonlight-dependencies.cmake")

if(BUILD_DOCS)
add_subdirectory(third-party/doxyconfig docs)
endif()

if(BUILD_TESTS)
moonlight_prepare_common_dependencies()
enable_testing()
add_subdirectory(tests)
endif()
Expand Down
42 changes: 42 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,40 @@
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "xbox-release (mingw64)",
"displayName": "Xbox Release (mingw64)",
"description": "Direct nxdk Xbox configure for IDE/code-model support on Xbox-only sources",
"generator": "Unix Makefiles",
"toolchainFile": "${sourceDir}/third-party/nxdk/share/toolchain-nxdk.cmake",
"binaryDir": "${sourceDir}/cmake-build-xbox-release",
"environment": {
"CHERE_INVOKING": "1",
"MSYSTEM": "MINGW64",
"NXDK_DIR": "${sourceDir}/third-party/nxdk"
},
"cacheVariables": {
"BUILD_DOCS": "OFF",
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_DEPENDS_USE_COMPILER": "FALSE",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
"CMAKE_MAKE_PROGRAM": "C:/msys64/usr/bin/make.exe",
"CMAKE_TRY_COMPILE_TARGET_TYPE": "STATIC_LIBRARY",
"MOONLIGHT_BUILD_KIND": "XBOX",
"MOONLIGHT_SKIP_NXDK_PREP": "ON",
"NXDK_DIR": "${sourceDir}/third-party/nxdk"
}
},
{
"name": "xbox-debug (mingw64)",
"displayName": "Xbox Debug (mingw64)",
"description": "Direct nxdk Xbox configure for IDE/code-model support on Xbox-only sources",
"inherits": "xbox-release (mingw64)",
"binaryDir": "${sourceDir}/cmake-build-xbox-debug",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
}
],
"buildPresets": [
Expand All @@ -44,6 +78,14 @@
{
"name": "nxdk-debug (mingw64)",
"configurePreset": "nxdk-debug (mingw64)"
},
{
"name": "xbox-release (mingw64)",
"configurePreset": "xbox-release (mingw64)"
},
{
"name": "xbox-debug (mingw64)",
"configurePreset": "xbox-debug (mingw64)"
}
]
}
32 changes: 20 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@

Port of Moonlight for the Original Xbox. Unlikely to ever actually work. Do NOT use!

Nothing works, except the splash screen.
> [!WARNING]
> Streaming does not work yet.

![Splash Screen](./docs/images/loading.png)
![Splash Screen](./docs/images/screenshots/01-splash.png)
![Hosts Screen](./docs/images/screenshots/02-hosts.png)
![Apps Screen](./docs/images/screenshots/03-apps.png)


## Build
Expand All @@ -33,14 +36,15 @@ Nothing works, except the splash screen.
pacman -Syu
nxdk_dependencies=(
"bison"
"cmake"
"flex"
"git"
"make"
"mingw-w64-x86_64-cmake"
"mingw-w64-x86_64-clang"
"mingw-w64-x86_64-gcc"
"mingw-w64-x86_64-lld"
"mingw-w64-x86_64-llvm"
"mingw-w64-x86_64-make"
)
moonlight_dependencies=(
"mingw-w64-x86_64-doxygen"
Expand Down Expand Up @@ -188,6 +192,10 @@ If you only want the emulator without the ROM/HDD support bundle, run:
scripts\setup-xemu.cmd --skip-support-files
```

> [!NOTE]
> You can set Xemu to use widescreen mode by using https://github.com/Ernegien/XboxEepromEditor
> but 1080i does not work in Xemu.

## Todo

- Build
Expand All @@ -204,18 +212,19 @@ scripts\setup-xemu.cmd --skip-support-files
- [x] Enable sonarcloud
- [x] Build moonlight-common-c
- [x] Build custom enet
- [x] Docs via doxygen
- Menus / Screens
- [x] Loading/splash screen
- [x] Initial loading screen, see https://github.com/XboxDev/nxdk/blob/master/samples/sdl_image/main.c
- [x] Set video mode based on the best available mode
- [x] dynamic splash screen (size based on current resolution)
- [x] simplify (draw background color and overlay logo) to reduce total size
- [ ] Main/Home
- [ ] Settings
- [ ] Add Host
- [ ] Game/App Selection
- [ ] Host Details
- [ ] App Details
- [x] Main/Home
- [x] Settings
- [x] Add Host
- [x] Game/App Selection
- [x] Host Details
- [x] App Details
- [ ] Pause/Hotkey overlay
- Streaming
- [ ] Video - https://www.xbmc4xbox.org.uk/wiki/XBMC_Features_and_Supported_Formats#Xbox_supported_video_formats_and_resolutions
Expand All @@ -230,10 +239,9 @@ scripts\setup-xemu.cmd --skip-support-files
- [ ] Mouse Input
- [ ] Mouse Emulation via Gamepad
- Misc.
- [ ] Save config and pairing states, probably use nlohmann/json
- [ ] Host pairing
- [x] Save config and pairing states
- [x] Host pairing
- [ ] Possibly, GPU overclocking, see https://github.com/GXTX/XboxOverclock
- [x] Docs via doxygen

<details style="display: none;">
<summary></summary>
Expand Down
33 changes: 26 additions & 7 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,32 @@ if [[ "${CLEAN_BUILD}" -eq 1 ]]; then
rm -rf "${BUILD_DIR_PATH}"
fi

cmake \
-S . \
-B "${BUILD_DIR_PATH}" \
-DBUILD_DOCS=OFF \
-DBUILD_TESTS=ON \
-DBUILD_XBOX=ON \
-DCMAKE_DEPENDS_USE_COMPILER=FALSE \
cmake_configure_args=(
-S .
-B "${BUILD_DIR_PATH}"
-DBUILD_DOCS=OFF
-DBUILD_TESTS=ON
-DBUILD_XBOX=ON
-DCMAKE_DEPENDS_USE_COMPILER=FALSE
-DCMAKE_BUILD_TYPE=Release
)

case "$(uname -s)" in
MINGW*|MSYS*|CYGWIN*)
if ! cmake --help 2>/dev/null | grep -q "MinGW Makefiles"; then
echo "Windows builds require a CMake that supports MinGW Makefiles. Install the MSYS2 package 'mingw-w64-x86_64-cmake'."
exit 1
fi

cmake_configure_args+=(
-G "MinGW Makefiles"
-DCMAKE_TOOLCHAIN_FILE="${PROJECT_ROOT}/cmake/host-mingw64-clang.cmake"
)
;;
*)
;;
esac

cmake "${cmake_configure_args[@]}"

cmake --build "${BUILD_DIR_PATH}"
21 changes: 0 additions & 21 deletions cmake/modules/FindNXDK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,6 @@ if(NOT TARGET NXDK::NXDK)
IMPORTED_LOCATION "${NXDK_DIR}/lib/winmm.lib"
)

add_library(ws2_32 STATIC IMPORTED)
set_target_properties(
ws2_32
PROPERTIES
IMPORTED_LOCATION "${NXDK_DIR}/lib/ws2_32.lib"
)

add_library(xboxrt STATIC IMPORTED)
set_target_properties(
xboxrt
Expand Down Expand Up @@ -130,17 +123,3 @@ if (NOT TARGET NXDK::Net)
"${NXDK_DIR}/lib/net/nvnetdrv"
)
endif ()

if (NOT TARGET NXDK::ws2_32)
add_library(NXDK::ws2_32 INTERFACE IMPORTED)
target_link_libraries(
NXDK::ws2_32
INTERFACE
ws2_32
)
target_include_directories(
NXDK::ws2_32
SYSTEM INTERFACE
"${NXDK_DIR}/lib/winapi/ws2_32"
)
endif ()
29 changes: 29 additions & 0 deletions cmake/modules/FindNXDK_SDL2_TTF.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
if(NOT TARGET NXDK::SDL2_TTF)
add_library(nxdk_sdl2_ttf STATIC IMPORTED)
set_target_properties(
nxdk_sdl2_ttf
PROPERTIES
IMPORTED_LOCATION "${NXDK_DIR}/lib/libSDL_ttf.lib"
)

add_library(nxdk_freetype STATIC IMPORTED)
set_target_properties(
nxdk_freetype
PROPERTIES
IMPORTED_LOCATION "${NXDK_DIR}/lib/libfreetype.lib"
)

add_library(NXDK::SDL2_TTF INTERFACE IMPORTED)
target_link_libraries(
NXDK::SDL2_TTF
INTERFACE
nxdk_sdl2_ttf
nxdk_freetype
)
target_include_directories(
NXDK::SDL2_TTF
SYSTEM INTERFACE
"${NXDK_DIR}/lib/sdl/SDL_ttf"
"${NXDK_DIR}/lib/sdl/SDL_ttf/external/freetype-2.4.12/include"
)
endif()
Loading
Loading