diff --git a/services/wolf.sh b/services/wolf.sh index c47f559..f12cde8 100644 --- a/services/wolf.sh +++ b/services/wolf.sh @@ -316,13 +316,11 @@ EOF echo " - Write $WOLF_DIR/docker-compose.yml and $WOLF_DIR/manage.sh" echo " - Open Moonlight UFW ports: TCP ${WOLF_PORTS_TCP[*]} / UDP ${WOLF_PORTS_UDP[*]}" echo " - Start Wolf and inject Steam + EmulationStation app profiles" - echo " - Create bios/ + retroarch/{cores,shaders,overlays}/ on the game drive and pre-download RetroArch cores (~1.5 GB)" + echo " - Create bios/ + retroarch/{cores,shaders,overlays}/ on the game drive, pre-download RetroArch" + echo " cores (~1.5 GB), and fetch Dolphin's Sys folder so GC/Wii boot clean on first run" echo " - Offer to auto-download standalone emulator AppImages into emulators/:" echo " Azahar (3DS), PCSX2 (PS2), Dolphin (GameCube/Wii — unofficial community build," echo " symlinked to Dolphin_Emulator.AppImage so ES-DE's own find-rules can see it)" - echo " - Offer to set up AntiMicroX (universal controller-combo hotkey, experimental —" - echo " downloads it and wires a Sway launch hook; the button mapping itself is" - echo " built later through AntiMicroX's own GUI)" return 0 fi @@ -907,84 +905,6 @@ UDEV log_success "Linked $_EMU_DIR/Dolphin_Emulator.AppImage -> $(basename "$_DOLPHIN_REAL") (the filename ES-DE's own find-rules require)" fi - # ── Optional: AntiMicroX for a universal controller-combo hotkey ───────── - # RetroArch's own hotkeys (Settings -> Input -> Input Hotkey Binds) are - # global across every libretro core, but Dolphin/PCSX2/Azahar each run as - # standalone apps ES-DE launches directly and none of the three support - # gamepad-bound hotkeys natively (confirmed open feature requests: - # PCSX2/pcsx2#1082, azahar-emu/azahar#722; Dolphin's hotkeys are - # hardcoded to keyboard only). AntiMicroX bridges this by watching the - # real controller device (Wolf's virtual gamepad is a genuine uinput - # device — see games-on-whales/wolf's own docs on "inputtino" — so this - # is a real input device AntiMicroX can open, not a proprietary channel) - # and injecting whatever keyboard shortcut each app actually expects. - # - # GoW's own stock Sway config (/cfg/sway/config, baked into the esde and - # retroarch images — same one both apps' `launcher()` call copies) has a - # deliberate extension point at its very first line: - # include /home/retro/.config/sway/custom-cfg - # Since /home/retro/.config is already our own retro-home mount (see the - # esde/retroarch CATALOG mounts above), just writing a file to - # $GAME_STORAGE_DIR/retro-home/sway/custom-cfg on the host lands exactly - # there in the container, for both apps, with zero changes to GoW's own - # image or scripts needed. - # - # This only wires up the plumbing (download AntiMicroX, launch it - # visibly as a floating window every session). The actual button - # mapping — including AntiMicroX's own per-application "Auto Profile" - # switching (Options -> Settings -> Auto Profile in its GUI) needed to - # send a different key to each emulator from the same physical combo — - # has to be built once through AntiMicroX's own GUI while it's running; - # hand-authoring its .gamecontroller.amgp profile XML blind isn't - # something to guess at. Whatever gets saved there persists automatically - # (same retro-home mount), so it's a one-time setup. - local _AMX_DIR="$GAME_STORAGE_DIR/retro-home/antimicrox" - local _SWAY_CFG_DIR="$GAME_STORAGE_DIR/retro-home/sway" - mkdir -p "$_AMX_DIR" "$_SWAY_CFG_DIR" - - echo "" - log_info "AntiMicroX lets you map one controller combo (e.g. Select+Start) to a" - log_info "different real keyboard shortcut per emulator — RetroArch's own hotkeys" - log_info "already cover every RetroArch-driven system; this is for Dolphin/PCSX2/" - log_info "Azahar, none of which support gamepad hotkeys natively. EXPERIMENTAL:" - log_info "the actual button mapping has to be built once through its own GUI." - local _GET_AMX="" - prompt_yn "Set up AntiMicroX for a universal controller hotkey? (y/n):" "n" _GET_AMX - if [[ "$_GET_AMX" =~ ^[Yy]$ ]]; then - # Real release asset is "AntiMicroX-x86_64.AppImage" (capitalized) — - # confirmed against the actual GitHub release, not assumed. A plain - # lowercase glob (like Azahar's/PCSX2's, which really are lowercase) - # would silently never match this one, on both the helper's own - # already-downloaded check and the lookup below. - _wolf_download_emulator_appimage \ - "AntiMicroX" "AntiMicroX/antimicrox" "[Aa]nti[Mm]icro[Xx]*.AppImage" "$_AMX_DIR" - local _AMX_APP - _AMX_APP=$(ls "$_AMX_DIR"/[Aa]nti[Mm]icro[Xx]*.AppImage 2>/dev/null | head -1) - if [[ -n "$_AMX_APP" ]]; then - backup_if_exists "$_SWAY_CFG_DIR/custom-cfg" - cat > "$_SWAY_CFG_DIR/custom-cfg" << CFGEOF -# Written by services/wolf.sh — AntiMicroX: universal controller-combo hotkey. -# Launched as a normal floating window (not hidden) so its own GUI is -# reachable through the Moonlight stream for one-time profile setup — -# see ~/docker/wolf/README.md for how to build the actual button mapping. -# -# AntiMicroX is a Qt5/X11 app running under XWayland here, same as ES-DE and -# Steam in this same stock config (see their own [class="..."] rules above) — -# app_id only matches native Wayland clients and would never match this one. -# Matched on both class and title as a fallback in case the exact WM_CLASS -# AntiMicroX registers turns out to differ from what's assumed here. -for_window [class="(?i)antimicrox"] floating enable, resize set 480 360, move position 20 20 -for_window [title="(?i)antimicrox"] floating enable, resize set 480 360, move position 20 20 -exec /home/retro/.config/antimicrox/$(basename "$_AMX_APP") --appimage-extract-and-run & -CFGEOF - chown -R 1000:1000 "$_AMX_DIR" "$_SWAY_CFG_DIR" 2>/dev/null || true - log_success "AntiMicroX will launch (as a small floating window) alongside ES-DE/RetroArch." - log_info "First session: open its window, map your combo, save — it persists from then on." - else - log_warning "AntiMicroX download didn't produce a usable AppImage — skipping the Sway launch hook." - fi - fi - # ── App selection ───────────────────────────────────────────────────────── echo "" echo "═══════════════════════════════════════════════════════" @@ -1771,6 +1691,32 @@ fuse scummvm" echo "RetroArch cores: $ok downloaded, $skip already present, $fail failed" echo " → $CORES_DIR" [ "$fail" -gt 0 ] && echo " Retry failed cores: ./manage.sh cores $SCOPE force" + + # The Dolphin core needs its own 'Sys' folder (compatibility DB + IPL + # data) to boot Wii titles at all — it's not part of the core .so/.info + # pair above, and the only documented way to get it is a manual trip + # through RetroArch's own Online Updater -> Core System Files + # Downloader (Dolphin.zip). It's just a static folder from Dolphin's + # own repo (Data/Sys), so fetch it here too instead of requiring that + # GUI step. Sparse+shallow checkout — the full repo is large, this + # folder isn't. + SYS_DIR="$GAME_DIR/retroarch/system/dolphin-emu/Sys" + if [ -f "$CORES_DIR/dolphin_libretro.so" ] && [ ! -d "$SYS_DIR" ]; then + echo "Fetching Dolphin's Sys folder (needed for GameCube/Wii to boot)..." + SYS_TMP=$(mktemp -d) + if git clone --depth 1 --filter=blob:none --sparse -q \ + https://github.com/dolphin-emu/dolphin "$SYS_TMP" 2>/dev/null \ + && (cd "$SYS_TMP" && git sparse-checkout set Data/Sys -q 2>/dev/null) \ + && [ -d "$SYS_TMP/Data/Sys" ]; then + mkdir -p "$(dirname "$SYS_DIR")" + cp -r "$SYS_TMP/Data/Sys" "$SYS_DIR" + echo "Dolphin Sys folder installed → $SYS_DIR" + else + echo "Could not fetch Dolphin's Sys folder automatically." + echo " Get it via RetroArch's own Online Updater -> Core System Files Downloader -> Dolphin.zip" + fi + rm -rf "$SYS_TMP" + fi ;; reorder) # Interactively reorder the Moonlight tiles by reordering the @@ -3282,10 +3228,50 @@ ES-DE is usable the moment you launch it; only ROMs and BIOS are yours to add. - **Exit a game** back to ES-DE: Start+Select opens the RetroArch menu → Quit, or use the Wolf hotkey START+UP+RB (Ctrl+Alt+Shift+W on a keyboard). -## Standalone emulators (3DS / PS2 / GameCube+Wii) -RetroArch's own libretro cores handle these systems poorly or not at all -(Dolphin's libretro core in particular is unstable for Wii), so ES-DE hands -them off to standalone AppImages instead: +## GameCube / Wii / PS2 — prefer RetroArch's own cores over standalone +RetroArch's libretro cores (Dolphin for GameCube/Wii, PCSX2 for PS2) are +downloaded automatically along with the rest of the RetroArch core set +(\`./manage.sh cores\`) and use RetroArch's own universal hotkey binds +(Settings -> Input -> Input Hotkey Binds) — one combo for exit/save-state/ +volume/etc. that works the same across every RetroArch-driven system, no +extra tooling needed. **Point ES-DE's GameCube and Wii systems at this +instead of "Dolphin (Standalone)"**: Main Menu -> Other Settings -> +Alternative Emulators -> GameCube / Wii (two separate entries) -> pick the +RetroArch/core-based option. Same config either way — ES-DE's embedded +RetroArch and the standalone RetroArch app (if you added it) share the +same \`retroarch/\` cores/saves/system directories. + +The Dolphin core's \`Sys\` folder (compatibility DB + IPL data it needs to +boot Wii titles at all) is fetched automatically now, right after the core +itself downloads — no more manual trip through RetroArch's own Online +Updater -> Core System Files Downloader. + +**If a Wii game shows "This file cannot be used because the data is +corrupted. Delete the file and create a new one?" with the OK button +greyed out** — confirmed live: this isn't a Sys-folder or permissions +problem, and isn't something a fresh install can prevent outright (it's +Dolphin's own generated per-game save data getting stuck mid-write, not a +setup defect) — it's that specific game's own save file wedged in a bad +state. For Mario Kart Wii specifically, delete just its \`rksys.dat\` +(license/ghost/friend-roster data, not your NAND or game files) and let +Dolphin regenerate it fresh: +\`\`\`bash +GAME_DIR=\$(grep '^GAME_STORAGE_DIR=' $WOLF_DIR/.env | cut -d= -f2-) +rm "\$GAME_DIR/retroarch/saves/dolphin-emu/User/Wii/title/00010004/524d4345/data/rksys.dat" +\`\`\` +Other Wii titles hit the same class of issue under their own title ID — +\`find "\$GAME_DIR/retroarch/saves/dolphin-emu/User/Wii/title" -maxdepth 2\` +lists them; delete the specific stuck file inside that title's \`data/\` +folder, not the whole \`Wii/\` tree. + +3DS has no viable RetroArch/libretro path at all (Azahar/Citra never +shipped a libretro core), so the standalone AppImage below stays the only +option there. PS2's libretro core is much newer/less mature than Dolphin's +— worth trying the same way, but expect rougher edges. + +## Standalone emulators (3DS required; PS2 / GameCube+Wii as a fallback) +ES-DE also hands these off to standalone AppImages, for 3DS (the only +option) or as an alternative to the RetroArch cores above: - **Azahar** (3DS, open-source Citra fork) — official releases - **PCSX2** (PS2) — official releases @@ -3309,38 +3295,6 @@ auto-detected. Missing ones get offered again on a fresh install (\`sudo ./setup.sh wolf\`); to grab just one by hand, download its AppImage into \`emulators/\`, \`chmod +x\` it. -## AntiMicroX — universal controller-combo hotkey (experimental) -RetroArch's own hotkeys (Settings -> Input -> Input Hotkey Binds) already -cover every RetroArch-driven system, but Dolphin/PCSX2/Azahar don't support -gamepad-bound hotkeys natively — AntiMicroX watches the controller directly -and injects whatever keyboard shortcut each app actually expects, so one -physical combo (e.g. hold Select, press Start) can mean "exit" — or save -state, or anything else — everywhere. - -If you said yes to the AntiMicroX prompt during install, it launches -automatically as a small floating window every time ES-DE or RetroArch -starts. **Building the actual mapping is a one-time step, done through its -own GUI, not something this installer can pre-configure:** - -1. Start ES-DE (or RetroArch) from Moonlight as normal — AntiMicroX's small - window appears floating in the corner alongside it. -2. In AntiMicroX: set up your controller under its device list, then create - a profile — click a button in its UI, press the real combo on your - gamepad, assign it the keyboard key the target emulator expects for that - action (see each emulator's own Settings -> Input/Hotkeys for its actual - bindings — Dolphin/PCSX2 defaults are commonly F1-F4-range keys). -3. For a **different translation per emulator** from the same physical - combo, use AntiMicroX's own **Options -> Settings -> Auto Profile** — - add a rule per application (matched by window class/title) so e.g. - Select+Start sends Esc when Dolphin has focus but F4 when RetroArch does. -4. Save. It's written under \`~/.config/antimicrox/\` inside the container, - which is the same \`retro-home/\` mount everything else here persists - through — it'll auto-load on every future session with no further setup. - -To change the mapping later, just reopen AntiMicroX the same way. To remove -it entirely, delete \`retro-home/sway/custom-cfg\` and \`retro-home/antimicrox/\` -on the host and re-run \`sudo ./setup.sh wolf\`. - ## Troubleshooting: app exits immediately ("Permission denied") If a launcher (Steam, etc.) closes the moment it opens, its Wolf-managed home dir has root-owned files the in-container user (uid 1000) can't write. Fix: @@ -3370,7 +3324,7 @@ MD bash "$WOLF_DIR/manage.sh" cores all \ || log_warning "Some cores failed — retry later with: cd $WOLF_DIR && ./manage.sh cores" chown -R "$ACTUAL_USER:$ACTUAL_USER" "$GAME_STORAGE_DIR/retroarch" 2>/dev/null || true - log_success "RetroArch cores ready — retro games launch on first run" + log_success "RetroArch cores ready — retro games (including GameCube/Wii via the Dolphin core) launch on first run" else log_info "Skipped — fetch later with: cd $WOLF_DIR && ./manage.sh cores" fi