(東方紅魔郷 〜 the Embodiment of Scarlet Devil)
A native homebrew port of ZUN's legendary 2002 bullet hell danmaku masterpiece Touhou 6: Embodiment of Scarlet Devil for the Nintendo Switch (Horizon OS).
Built upon the cross-platform decompilation engine GensokyoClub/th06, this port features custom hardware-accelerated OpenGL ES 3.2 rendering over Nouveau/Mesa, seamless Nintendo Switch Joy-Con and Pro Controller support, native 1280x720 window resolution scaling with pure OLED black letterbox borders, and an intelligent filename alias resolver designed for FAT32 SD cards.
- 🚀 Full 60 FPS Performance: Smooth, rock-solid 60 FPS danmaku gameplay across all Nintendo Switch models (V1 Erista, V2 Mariko, Switch Lite, Switch OLED) running natively on Horizon OS—no Linux, Box64, or Wine required.
- 🦇 Embedded Official Artwork: Features the classic 2002 CD release cover silhouette embedded directly within the
.nroasset header for seamless display in Homebrew Menu, Sphaira, and custom home screen forwarders. - 🖥 OLED-Optimized Widescreen Scaling: Automatically scales the original 640x480 gameplay viewport centered inside the Switch's native 1280x720 display. Double-buffered hardware scissor testing (
GL_SCISSOR_TEST) guarantees that the 16:9 side pillarboxes remain 100% pure black (#000000), preserving contrast and extending battery life on OLED screens. - 🎮 Native Controller Support: Seamless out-of-the-box mapping for Joy-Con (Handheld, Grip, or detached) and Nintendo Switch Pro Controllers via SDL2 GameController API, complete with slow-motion focus mode (
L/R/ZL/ZR) and menu navigation. - 🧠 Defensive Smart Filename Resolver: FAT32/ExFAT filesystems on Switch often reject Japanese Shift-JIS / UTF-8 characters (
東方紅魔郷.cfg), and Windows extraction tools frequently strip non-ASCII prefixes from filenames (紅魔郷CM.DAT→CM.DAT). The engine includes a low-level filesystem interceptor that automatically locates and resolves stripped ASCII filenames (CM.DAT,MD.DAT,.cfg,th06.cfg) transparently. - 🎵 Lossless Audio & BGM Support: Full support for sound effects (
CM.DAT) and lossless WAV background music playback (bgm/folder).
⚠️ Disclaimer: In compliance with ZUN's guidelines and copyright law, this repository contains ONLY the homebrew engine code. Game asset archives (*.DAT) are not distributed. You must legally own a copy of Touhou 6: Embodiment of Scarlet Devil v1.02h.
- Ensure your Nintendo Switch is running custom firmware (Atmosphère CFW).
- Download the latest
touhou6.nrofrom the Releases tab (or build from source). - Create a folder named
sd:/touhou6/on your SD card and copytouhou6.nrointo it. - Copy the data archives from your legitimate Touhou 6 PC folder directly into the same directory:
(Note: Whether your files are named with full Japanese characters
sd:/touhou6/ ├── touhou6.nro # Nintendo Switch homebrew executable ├── CM.DAT # Game data (or 紅魔郷CM.DAT) ├── ED.DAT # Endings data (or 紅魔郷ED.DAT) ├── IN.DAT # Stage intro data (or 紅魔郷IN.DAT) ├── MD.DAT # MIDI/Music data (or 紅魔郷MD.DAT) ├── ST.DAT # Stage data (or 紅魔郷ST.DAT) ├── TL.DAT # Title screen data (or 紅魔郷TL.DAT) └── msgothic.ttc # Japanese font (optional)紅魔郷CM.DATor stripped ASCIICM.DAT, the engine will locate and load them automatically).
Because Horizon OS lacks a system MIDI synthesizer, Touhou 6 plays background music on the Switch via ZUN's official WAV music mode:
- Locate or download the standard Touhou 6 EoSD WAV BGM / Lossless Soundtrack Pack.
- Create a folder named
bgminside your game directory (sd:/touhou6/bgm/). - Place all soundtrack WAV files (
th06_01.wavthroughth06_17.wav) along with their loop point definition files (*.pos) insidebgm/. - Launch the game. The engine will automatically detect
bgm/th06_01.wav, configuremusicModeto WAV, and play full soundtrack audio. (If needed, navigate to Options -> BGM inside the game menu and set it to WAV).
Run touhou6.nro from the Homebrew Menu (hbmenu), Sphaira launcher, or install a home screen forwarder shortcut.
| Nintendo Switch Button | Action |
|---|---|
| Left Stick / D-Pad | Character Movement |
| A (or B) | Shoot / Confirm |
| B (or A) | Bomb / Cancel |
| L / R / ZL / ZR | Focus (Precision Slow-Motion Movement) |
| + (Plus) | Pause / In-Game Menu |
This repository includes a pre-configured GitHub Actions CI pipeline (.github/workflows/build-switch.yml). Simply fork or push this repository to GitHub, and the CI workflow will automatically compile touhou6.nro inside an official devkitA64 container and upload the ready-to-play executable as a downloadable workflow artifact.
- Install devkitPro with
devkitA64andlibnx. - Install required Switch portlibs:
sudo dkp-pacman -Syu sudo dkp-pacman -S switch-sdl2 switch-sdl2_image switch-sdl2_ttf switch-mesa switch-libdrm_nouveau switch-libpng switch-libjpeg-turbo switch-freetype switch-zlib
- Set environment variables and compile:
export DEVKITPRO=/opt/devkitpro export PATH=$DEVKITPRO/tools/bin:$PATH # Pre-generate shader header embeds python3 scripts/gen_embeds.py # Build executable make -j$(nproc)
- ZUN / Team Shanghai Alice — Original creator and developer of the Touhou Project series.
- GensokyoClub — For their monumental work on the byte-accurate C++ portable decompilation of Touhou 6.
- Switchbrew & devkitPro Team — For the open-source
libnxSDK and Nintendo Switch toolchain.