[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-111551":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":8,"htmlUrl":8,"language":9,"languages":8,"totalLinesOfCode":8,"stars":10,"forks":11,"watchers":12,"openIssues":13,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":14,"stars7d":15,"stars30d":16,"stars90d":14,"forks30d":14,"starsTrendScore":12,"compositeScore":17,"rankGlobal":8,"rankLanguage":8,"license":8,"archived":18,"fork":18,"defaultBranch":19,"hasWiki":20,"hasPages":18,"topics":21,"createdAt":8,"pushedAt":22,"updatedAt":23,"readmeContent":24,"aiSummary":25,"trendingCount":14,"starSnapshotCount":14,"syncStatus":26,"lastSyncTime":27,"discoverSource":28},111551,"Moonlight-CivSwitch","XITRIX\u002FMoonlight-CivSwitch","XITRIX",null,"JavaScript",112,3,1,5,0,4,22,40.01,false,"master",true,[],"2026-11-15 00:15:35","2026-11-21 13:42:39","# Moonlight for CivSwitch\n\nStream your PC games to Nintendo Switch 2 through Civilization VII.\nA [Moonlight](https:\u002F\u002Fmoonlight-stream.org\u002F) client running inside\n[Gezine’s CivSwitch](https:\u002F\u002Fgithub.com\u002FGezine\u002FCivSwitch), with\nSunshine pairing, a game library, controller input, video and stereo audio.\n\n**Tested on Switch 2.** Requires the Switch 1 edition of Civilization VII on a\nphysical cartridge, version **1.0.0**, with CivSwitch already set up. Compatibility\nwith other Switch models has not been established.\n\n## Native rendering\n\nMoonlight draws its interface with NanoVG and Vulkan at 1920×1080 and presents\nH.264\u002FAV1 video directly through the same native display. Boost is not required\nfor 1080p output. The Launcher, Moonlight and streaming share one retained\ndisplay; app transitions release view leases while keeping its device and\nswapchain alive. There is no output-renderer setting.\n\nUse the matching CivHomebrew native Launcher (`0.4.3-nanovg.12`, core `0.4.3-sdk.8`, SDK\n1.3.5) and restart Civ VII after the upgrade. Earlier builds completed four installed Launcher → Moonlight → stream → Launcher roundtrips on\nSwitch 2, using H.264 and AV1 on one retained native device\u002Fswapchain. The user\nconfirmed picture, sound, overlay spacing and centered button labels. These were\nshort 1080p60\u002F20 Mbps requested Desktop streams, rather than a sustained 60 FPS\nperformance qualification. The earlier direct AV1 workload measured 57.2 FPS\nwith Boost off; Boost state was not re-confirmed for this newer test.\nStream sources up to 4K are scaled to the shared 1080p output; 4K is capped at\n60 FPS. See [rendering and app switching](docs\u002Fnative-rendering.md) and\n[earlier native video evidence](docs\u002Fnative-video-evidence.md).\n\n## Shared renderer development\n\nLauncher, Hello CivHomebrew, Moonlight and Doom pin **CivHomebrew-SDK 1.3.5**. Renderer fixes belong\nin [CivHomebrew-SDK](https:\u002F\u002Fgithub.com\u002FXITRIX\u002FCivHomebrew-SDK). Each app builds\noffline from the same verified release. See [native rendering](docs\u002Fnative-rendering.md) for integration and\nvalidation, including the restart required when upgrading the resident renderer.\n\n## Screenshots\n\n| Pairing | Game library |\n| :---: | :---: |\n| [![Pair a PC with Moonlight](docs\u002Fimages\u002Fpairing.jpg)](docs\u002Fimages\u002Fpairing.jpg) | [![Browse the Moonlight game library](docs\u002Fimages\u002Fgames.jpg)](docs\u002Fimages\u002Fgames.jpg) |\n| **Stream settings** | **Streaming controls** |\n| [![Moonlight resolution, frame rate and bitrate settings](docs\u002Fimages\u002Fsettings.jpg)](docs\u002Fimages\u002Fsettings.jpg) | [![Moonlight disconnect and terminate controls during a stream](docs\u002Fimages\u002Fstreaming.jpg)](docs\u002Fimages\u002Fstreaming.jpg) |\n| **Virtual keyboard** | **Touchscreen mode** |\n| [![Moonlight virtual keyboard during a stream](docs\u002Fimages\u002Fvirtual-keyboard.jpg)](docs\u002Fimages\u002Fvirtual-keyboard.jpg) | [![Moonlight touchscreen mode menu](docs\u002Fimages\u002Ftouchscreen-mode.jpg)](docs\u002Fimages\u002Ftouchscreen-mode.jpg) |\n\n*Captured on Switch 2. Click a screenshot to enlarge.*\n\n## Supported features\n\n- H.264 hardware decoding\n- Touchscreen: trackpad and direct touch modes (without Boost mode)\n- Virtual keyboard\n- Mouse control from gamepad\n- Gamepad rumble\n\n## Installation\n\nHave [Sunshine](https:\u002F\u002Fgithub.com\u002FLizardByte\u002FSunshine) running on your PC and\nconnect the PC and Switch to the same local network. Choose either method below.\n\n### 1. CivHomebrew — recommended\n\n1. Set up [CivHomebrew](https:\u002F\u002Fgithub.com\u002FXITRIX\u002FCivHomebrew) with its matching native Launcher on your Switch.\n2. Get a `moonlight.civapp` package, or build one using the instructions below.\n3. In CivHomebrew, open **Y Options → FTP** and enable the FTP server.\n4. Connect an FTP client to the Switch (default port **5000**) and upload\n   `moonlight.civapp` into **Install civapp**.\n5. Select **Moonlight** in the launcher and press **A**.\n\nThe app stays installed in the game’s save data, ready to launch from CivHomebrew.\n\nIn a CivHomebrew version supporting app updates, select Moonlight and open\n**X Menu → Check app updates**. The package declares this repository's latest\nGitHub release and the `moonlight.civapp` asset. A newer release offers confirmation\nbefore installation; its tag and packaged `release` must use matching SemVer\nversions. Pairing and settings are kept outside the installation folder.\n\n### 2. Upload to Gezine’s launcher\n\nBuild the project below, then leave Gezine’s original CivSwitch loader waiting\nfor a payload. From the Moonlight repository, run:\n\n```sh\npython3 tools\u002Fsend_ui.py SWITCH_IP\n```\n\nReplace `SWITCH_IP` with your console’s local IP address. The sender uploads the\nstreaming runtime and app automatically. Keep the terminal open while using it;\nclose Moonlight before uploading another payload. The raw loader has no Launcher\nview to return to; use CivHomebrew for app switching.\n\n## First launch\n\nChoose **Pair new host**, enter your PC’s IP address, and approve the displayed\nPIN in Sunshine. Select the paired PC, then choose a game or Desktop to stream.\n\n- **D-pad \u002F A:** navigate and select. **B:** go back; from Hosts, return to Launcher.\n- **− and + together:** open the left-side menu, titled with the connected host's name. **More** contains **Mouse by Gamepad**, **Show keyboard** and **Touchscreen mode**. **Logout** opens **Disconnect** \u002F **Terminate**: Disconnect keeps the PC app running; Terminate also closes it. **B** goes back through the menu and returns to streaming.\n- A running PC app appears first in the library; other cards are dimmed and disabled until it stops. Use **Terminate app** at the top right to close it.\n- **Settings:** adjust resolution, frame rate, bitrate, codec and frame pacing.\n  Defaults are **720p, 60 FPS, 20 Mbps**.\n\nPairing and settings are saved between sessions.\n\nGamepad rumble from the PC is sent to the active Switch controller. It follows\nthe console's vibration setting and stops on disconnect, focus loss, or when\nopening the stream options. Joy-Con and Pro Controller vibration use both HD\nrumble frequency bands; trigger rumble is not supported.\n\n**Settings → Gamepad rumble** turns controller vibration on or off.\n\n**Settings → Touchscreen** selects either:\n\n- **Trackpad** (default): slide one finger to move the mouse. Tap with one finger\n  for left click or two fingers for right click. Swipe with two fingers to scroll\n  vertically or horizontally; the page follows your fingers. Quickly tap again\n  and keep your finger down on the second tap to hold the left button and drag;\n  lifting releases it.\n- **Touchpad (direct touch)**: each finger is sent as a separate touch contact at\n  its position in the streamed picture. Requires a Sunshine host with direct\n  touch support; an unsupported host shows a notice. Host OS and app support\n  determine how those contacts behave.\n\nPlace three fingers on the stream to open the full English virtual keyboard in\neither touchscreen mode. Lift the opening fingers, then hold any combination of\nkeys, including modifiers. Touch outside the keyboard to close it. A keyboard\nopened by touch leaves the gamepad controlling the stream. **−\u002F+ → More → Show\nkeyboard** opens the controller mode: D-pad moves, A holds a key or toggles a\nmodifier for combinations, **Y** sends Backspace, **X** sends Space, **L\u002FR** send\nleft\u002Fright arrow keys, and **B** closes. Hold a shortcut to repeat it. Switch-style\nbutton hints appear at the bottom in controller mode. Release the opening A\nbefore typing.\n\nTouch input pauses while the stream options are open or the app loses focus.\n**More → Touchscreen mode** changes the active stream immediately and saves the\nchoice for future streams; touchscreen changes in Settings apply to the next\nstream. Rumble updates are combined and limited to\n30 per second after video\u002Faudio processing; zero strength bypasses the rate\nlimit. The performance overlay reports rumble call timing.\n\n**−\u002F+ → More → Mouse by Gamepad** enables the Moonlight-Switch mouse controls:\nleft stick moves, **L\u002FR** slows\u002Fspeeds up, **ZR\u002FZL** holds left\u002Fright click for\nclicks and dragging, and the right stick scrolls. **−** hides\u002Fshows hints,\n**X** opens the keyboard, **Y** opens speed\u002Fbutton-swap\u002Fscroll-direction options,\nand **B** goes back. B from the keyboard returns to mouse mode. B from mouse\noptions saves them. Menu entry, focus loss and disconnect release held input.\n\n## Build from source\n\nInstall **Git, Python 3.10+, Node.js 22+ with npm, CMake, and a C\u002FC++ build toolchain**\n(Xcode Command Line Tools on macOS, or build-essential on Linux). Then run:\n\n```sh\ngit clone https:\u002F\u002Fgithub.com\u002FXITRIX\u002FMoonlight-CivSwitch.git\ncd Moonlight-CivSwitch\nnpm run bootstrap\nnpm run build\n```\n\nBootstrap downloads the pinned dependencies and installs Emscripten **3.1.74**\nlocally; no global SDK setup or `npm install` is needed. The build produces\n`dist\u002Fruntime\u002Fmoonlight-stream.js`. You can now upload with `tools\u002Fsend_ui.py`.\nRun `npm run build` again after changing native runtime sources.\n\n### Optional: create a .civapp package\n\nAfter building, package from the Moonlight root with the included tool:\n\n```sh\nnpm run package\n```\n\nThis creates and validates `dist\u002Fmoonlight.civapp`, ready to install using method 1\nabove. No separate CivHomebrew checkout is needed. `payload.json` defines the\nbundled files and their order; rebuild the package after changing the app.\nThe single-file Python packager can also be copied into other repositories;\nsee [reuse and CI examples](tools\u002FREADME.md).\n\nThe manual **Release Moonlight** GitHub Actions workflow reads the version from\n`payload.json`, builds\u002Ftests the app and publishes an update-ready `moonlight.civapp` release.\nSee [release workflow](docs\u002Freleases.md).\n\n### Development checks\n\n```sh\nnpm test\nnpm run test:runtime\nnpm run test:ui\nnpm run test:package\n```\n\nRuntime checks require a completed build; package checks also require\n`npm run package`. UI and package checks require Chrome; set\n`CHROME_BIN` if needed. See the [build details](tools\u002Fwasm2js\u002FREADME.md),\n[streaming notes](docs\u002Fstreaming.md) and [development routine](AGENTS.md) for more.\n\n## Credits\n\n- **[Gezine](https:\u002F\u002Fgithub.com\u002FGezine\u002FCivSwitch)** — CivSwitch and the loader\n  that makes this possible.\n- **[Moonlight](https:\u002F\u002Fgithub.com\u002Fmoonlight-stream\u002Fmoonlight-common-c)** and\n  **[Sunshine](https:\u002F\u002Fgithub.com\u002FLizardByte\u002FSunshine)** — streaming protocol,\n  client core and host software.\n- **[XITRIX \u002F Moonlight-Switch](https:\u002F\u002Fgithub.com\u002FXITRIX\u002FMoonlight-Switch)** —\n  my original Switch client and the app icon used here.\n- **[Emscripten](https:\u002F\u002Femscripten.org\u002F)**, **[Mbed TLS](https:\u002F\u002Fgithub.com\u002FMbed-TLS\u002Fmbedtls)**,\n  **[Forge](https:\u002F\u002Fgithub.com\u002Fdigitalbazaar\u002Fforge)**, **ENet** and **nanors** —\n  compiler, cryptography and networking foundations.\n\nThird-party licenses and attribution are included in the\n[bundled notices](app\u002Fcivapp-notices.js).\n","Moonlight-CivSwitch 是一个将 Moonlight（NVIDIA GameStream 客户端）移植到任天堂 Switch 2 平台的开源项目，依托 CivSwitch 运行环境实现 PC 游戏串流。核心功能包括原生 Vulkan\u002FNanoVG 渲染、H.264\u002FAV1 视频直通、立体音频输出、游戏库管理、手柄输入映射及虚拟键盘支持；所有组件共享同一 1080p 原生显示设备与交换链，无需 Boost 即可稳定输出。该项目专为已安装实体版《文明VII》（v1.0.0）并完成 CivSwitch 环境配置的 Switch 2 用户设计，适用于在掌机模式下低延迟串流 Windows PC 游戏的场景。",2,"2026-11-24 04:41:08","CREATED_QUERY"]