Port of Moonlight for the Original Xbox. Unlikely to ever actually work. Do NOT use!
Nothing works, except the splash screen.
-
Clone the repository with submodules, or update them after cloning.
git submodule update --init --recursive
-
Install nxdk prerequisites.
Note
You must use the mingw64 shell on Windows.
pacman -Syu
nxdk_dependencies=(
"bison"
"cmake"
"flex"
"git"
"make"
"mingw-w64-x86_64-clang"
"mingw-w64-x86_64-gcc"
"mingw-w64-x86_64-lld"
"mingw-w64-x86_64-llvm"
)
moonlight_dependencies=(
"mingw-w64-x86_64-doxygen"
"mingw-w64-x86_64-graphviz"
"mingw-w64-ucrt-x86_64-nodejs"
)
dependencies=("${nxdk_dependencies[@]}" "${moonlight_dependencies[@]}")
pacman -S "${dependencies[@]}"nxdk_dependencies=(
"bison"
"build-essential"
"clang"
"cmake"
"flex"
"git"
"lld"
"llvm"
)
moonlight_dependencies=(
"doxygen"
"graphviz"
"nodejs"
)
dependencies=("${nxdk_dependencies[@]}" "${moonlight_dependencies[@]}")
apt install "${dependencies[@]}"nxdk_dependencies=(
"cmake"
"coreutils"
"lld"
"llvm"
)
moonlight_dependencies=(
"doxygen"
"graphviz"
"node"
)
dependencies=("${nxdk_dependencies[@]}" "${moonlight_dependencies[@]}")
brew install "${dependencies[@]}"- Run the following from mingw64 or bash shell:
export NXDK_DIR="$(pwd)/third-party/nxdk"
eval "$(${NXDK_DIR}/bin/activate -s)"
cd "${NXDK_DIR}"
make NXDK_ONLY=y
make tools-
Create build directory
mkdir -p build
-
Configure the project
cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE="${NXDK_DIR}/share/toolchain-nxdk.cmake"
cmake --build buildThis script takes care of everything, except installing the prerequisites.
./build.shThe default build directory is build. You can override it or force a clean build:
./build.sh --build-dir cmake-build-nxdk-release
./build.sh --clean
./build.sh build cleanTo launch the same build from shells outside MSYS2 on Windows, use one of these wrappers:
build-mingw64.bat./build-mingw64.shThe Xbox executable cannot run directly on Windows, macOS, or Linux, so unit tests are built as a separate host-native target. Keep Xbox runtime code thin and move logic you want to test into platform-neutral sources that can be linked into test_moonlight.
From cmd.exe, configure, build, and run the host tests with:
C:\msys64\msys2_shell.cmd -defterm -here -no-start -mingw64 -c "cd /c/Users/%USERNAME%/Dev/git/Moonlight-XboxOG && cmake --preset \"host-tests (mingw64)\" && cmake --build --preset \"host-tests (mingw64)\" && ctest --preset \"host-tests (mingw64)\""If you are already inside a mingw64 shell, the equivalent commands are:
cmake --preset "host-tests (mingw64)"
cmake --build --preset "host-tests (mingw64)"
ctest --preset "host-tests (mingw64)"cmake -S . -B cmake-build-host-tests -DBUILD_TESTS=ON -DBUILD_DOCS=OFF
cmake --build cmake-build-host-tests --target test_moonlight
ctest --test-dir cmake-build-host-tests --output-on-failureCoverage should come from this host-native test build instead of the cross-compiled Xbox build.
The repository now includes CLion-friendly nxdk wrapper scripts in cmake/ plus shared run configurations in .run/.
- Open the project in CLion and let it import the
nxdkpreset fromCMakePresets.json. - If CLion cached an older failed configure, reload the CMake project or remove
cmake-build-nxdk-release/CMakeCache.txtonce. - Use the normal build button with the
nxdkprofile selected. - Build
Moonlight.isofirst, then use the sharedRun Moonlight ISO in xemurun configuration to launch it in xemu.
For the first xemu launch, you can either run the shared Setup portable xemu configuration or run the Windows wrapper manually:
scripts\setup-xemu.cmdThe shared CLion run configurations now call scripts\setup-xemu.cmd and scripts\run-xemu.cmd directly through C:\Windows\System32\cmd.exe. Those wrappers start MSYS2 with the expected mingw64 environment and then launch the corresponding .sh scripts.
The setup script downloads xemu and the emulator support files into .local/xemu, then refreshes launcher manifests used by scripts/run-xemu.sh.
If you only want the emulator without the ROM/HDD support bundle, run:
scripts\setup-xemu.cmd --skip-support-files- Build
- Build in GitHub CI
- Build with CMake instead of Make, see https://github.com/Ryzee119/Xenium-Tools/blob/master/CMakeLists.txt and https://github.com/abaire/nxdk_pgraph_tests/blob/4b7934e6d612a6d17f9ec229a2d72601a5caefc4/CMakeLists.txt
- Get build environment working with CLion directly instead of using external terminal
- debugger, see https://github.com/abaire/xbdm_gdb_bridge
- Add a run config for CLion, see https://github.com/Subtixx/XSampleProject
- Automatically run built xiso in Xemu
- Add unit testing framework
- Separate main build and unit test builds, due to cross compiling, see https://stackoverflow.com/a/64335131/11214013
- Get tests to properly compile
- Enable codecov
- Enable sonarcloud
- Build moonlight-common-c
- Build custom enet
- Menus / Screens
- Loading/splash screen
- Initial loading screen, see https://github.com/XboxDev/nxdk/blob/master/samples/sdl_image/main.c
- Set video mode based on the best available mode
- dynamic splash screen (size based on current resolution)
- simplify (draw background color and overlay logo) to reduce total size
- Main/Home
- Settings
- Add Host
- Game/App Selection
- Host Details
- App Details
- Pause/Hotkey overlay
- Loading/splash screen
- Streaming
- Video - https://www.xbmc4xbox.org.uk/wiki/XBMC_Features_and_Supported_Formats#Xbox_supported_video_formats_and_resolutions
- Audio
- Mono
- Stereo
- 5.1 Surround
- 7.1 Surround
- Input
- Gamepad Input
- Keyboard Input
- Mouse Input
- Mouse Emulation via Gamepad
- Misc.
- Save config and pairing states, probably use nlohmann/json
- Host pairing
- Possibly, GPU overclocking, see https://github.com/GXTX/XboxOverclock
- Docs via doxygen
