Skip to content

XITRIX/Moonlight-Switch

Repository files navigation

Moonlight-Switch

Moonlight-Switch is a port of Moonlight Game Streaming Project for Nintendo Switch.

Screenshots

Preview

Installing

Switch

  1. Download latest Moonlight-Switch release.
  2. Put Moonlight.nro to sdcard:/switch/Moonlight-Switch;
  3. Launch hbmenu over Title Redirection (for FULL RAM access);
  4. Launch moonlight.

Or download it from HB App Store

Tip

To be able to use high bitrate setting especially with 1080p - resolution, you need to overclock CPU/GPU of your console.

To learn more about that you can take a look at Sys-Clk homebrew or entire Atmosphere build - 4IFIR which includes everything you need to overclock your console

Warning

I DO NOT RESPOSIBLE FOR ANY DAMAGE TO YOUR CONSOLE IF SOMETHING WILL GO WRONG!

I am using 4IFIR by myself and not find any issue, but everything is possible. So think by you own head and be responsible for what you do with your devices!

iOS, tvOS and macOS

Accept invite for TestFlight and download app from there

Discord

Feel free to join Moonlight discord server, you will find me there in "switch-help" channel

Controls

Mouse

With touch screen you can move your coursor, tap to left click, scroll 2 fingers to scroll.

While touching screen ZR and ZL buttons will work like left and right mouse buttons.

Also while touching screen L and R sticks will work like scrolling wheel.

USB mouse working as well.

Keyboard

You can use onscreen keyboard, tap 3 fingers on screen to show it.

USB keyboard working as well.

Gamepad

By default, Switch gamepad configured as X360 gamepad (A/B and X/Y swapped). Key mapping available in application settings.

Up to 5 gamepads (includes handheld mode) supported. Half of joycons are also supported.

SixAxis

You should configure your Sunshine server to recognise controller as DS4 one to be able to use Gyro and Accelerometer. Only works for player 1 controller.

Ingame overlay

To open overlay, press - and + key simultaneously by default or Hold ESC on keyboard.

Key combination and holding time are configurable in settings.

NSP forwarder

App supports NSP forwarders to start stream immediately with predefined configuration. Add app you want to launch in Favorites list first.

You'll need to add thees arguments to the forwarder:

  • --host - Mac address of your PC (you could find it in /switch/Moonlight-Switch/settings.json)
  • --appid - ID of the app to launch
  • --appname - The name of the app without any spacings

example: --host=a2:34:de:ad:12:3b --appid=1233211234 --appname=Steam

Localization

  • English (100%)
  • Russian (100%)
  • German (86%)
  • Spanish (72%)
  • Japanese (70%)
  • Chinese (simplified) (86%)
  • Czech (70%) - unsupported yet, as HOS has no such system language

Contribution

If you'd like to improve existing language, or add a new one, follow the instruction:

  1. Ask a permission to modify language here
  2. Notify me by creating an issue with title "[Localization] - {Name of language}", in description write your nickname on POEditor
  3. After translation is done, notify me in issue created earlier

You have 2 options to add that translation:

  1. If you'd like your profile in "contributors" section, you could add that localization by creating a PR
  2. If you don't care, I could do that by myself

If you'd like to test your translation, you could follow build instructions, or ask me to create a build with your localization, I'll attach that build in issue.

Warning

Currently there is no way to select language inside of app, it takes from system settings, so it is impossible to add locatization, that HOS doesn't support (that happend with Czech language).

Build Moonlight-Switch

cd 'folder/to/store/the/sources'

# Clone this repo with submodules
git clone https://github.com/XITRIX/Moonlight-Switch.git --recursive
cd Moonlight-Switch

Switch

To build for Switch, a standard development environment must first be set up. In order to do so, refer to the Getting Started guide.

cmake -B build/switch -DPLATFORM_SWITCH=ON
make -C build/switch Moonlight.nro -j$(nproc)

PC (Windows/Linux/MacOS)

To build for PC, the following components are required:

  • cmake/make build system
  • A C++ compiler supporting the C++17 standard

Please refer to the usual sources of information for your particular operating system. Usually the commands needed to build this project will look like this:

cmake -B build/pc -DPLATFORM_DESKTOP=ON -DCMAKE_BUILD_TYPE=Release
make -C build/pc -j$(nproc)

Also, please note that the resources folder must be available in the working directory, otherwise the program will fail to find the shaders.

iOS / tvOS:

# build libromfs generator
./build_libromfs_generator.sh

# prepare vcpkg
./extern/vcpkg/bootstrap-vcpkg.sh

1. Build for arm64 iphoneOS

# 1. Generate a Xcode project
cmake -B build/ios -G Xcode -DPLATFORM_IOS=ON

# 2. open project in Xcode
open build/ios/*.xcodeproj

# 3. Set up Team and Bundle Identifiers in Xcode, then connect devices to run.

2. Build for arm64 tvOS

# 1. Generate a Xcode project
cmake -B build/tvos -G Xcode -DPLATFORM_TVOS=ON

# 2. open project in Xcode
open build/tvos/*.xcodeproj

# 3. Set up Team and Bundle Identifiers in Xcode, then connect devices to run.

Credits

Thanks a lot to Rock88 and his Moonlight-NX, lots of streaming code has been lend from it 👍.

Xfangfang for maintaining Borealis library. iOS port would not be possible without it.

Also thanks to Averne for NVDEC implementation into FFmpeg and useful guidance of how to enable it