Skip to content

Latest commit

 

History

History
152 lines (112 loc) · 5.23 KB

File metadata and controls

152 lines (112 loc) · 5.23 KB

Falcon 3.0 with ControllerBuddy on Linux

📖 Description

This guide describes the setup of Falcon 3.0 (Steam) for use with ControllerBuddy on Linux via the DOSBox Staging emulator.

What you get with this setup:

  • An installation of Falcon 3.0 that is nicely integrated into your Steam library.
  • ControllerBuddy will start automatically when you start the game, load the correct profile, and exit when you quit the game.

🧩 Prerequisites

🪜 Steps

Important

Before starting with the steps, make sure to read the Important Notes section in the README of this repository.

  1. Download Falcon Gold in Steam.

  2. Create a folder which will hold a custom DOSBox config file and launch script for Falcon 3.0:

    mkdir "$HOME/Falcon_Gold"
  3. Configure Falcon Gold to work with the Falcon_3.0.json profile from ControllerBuddy-Profiles:

    controller_buddy_profiles_dir=$(realpath -s "$(flatpak info -l de.bwravencl.ControllerBuddy)/../active/files/share/ControllerBuddy-Profiles") &&
    cp "$controller_buddy_profiles_dir/configs/Falcon_3.0/JOYSTICK.DEF" "$HOME/.local/share/Steam/steamapps/common/Falcon Gold/game/"
  4. Create the DOSBox config file:

    cat << 'EOF' > "$HOME/Falcon_Gold/dosbox_falcon_gold.conf"
    [sdl]
    fullscreen = true
    host_rate = sdi
    presentation_mode = cfr
    
    [dosbox]
    memsize = 8
    vmem_delay = 650
    
    [render]
    glshader = nearest
    
    [cpu]
    cpu_cycles = 20000
    cpu_cycles_protected = auto
    cycleup = 1000
    cycledown = 1000
    
    [voodoo]
    voodoo = false
    
    [joystick]
    joysticktype = 4axis
    timed = false
    deadzone = 0
    
    [dos]
    keyboardlayout = us
    
    [ipx]
    ipx = true
    
    [autoexec]
    @echo off
    mount c "~/.local/share/Steam/steamapps/common/Falcon Gold/game"
    imgmount d "~/.local/share/Steam/steamapps/common/Falcon Gold/game/game.gld" -t iso -fs iso
    c:
    cls
    FALCONCD.EXE
    exit
    
    EOF
  5. Create the launch script:

    cat << 'EOF' > "$HOME/Falcon_Gold/Falcon_Gold.sh" && chmod +x "$HOME/Falcon_Gold/Falcon_Gold.sh"
    #!/bin/bash
    
    cb_profile=Falcon_3.0.json
    dosbox_conf=dosbox_falcon_gold.conf
    mouse_sensitivity=1.0
    
    cd "$(cd -- "$(dirname -- "$0")" &> /dev/null && pwd)" || exit
    
    flatpak run de.bwravencl.ControllerBuddy -autostart local -profile "/app/share/ControllerBuddy-Profiles/$cb_profile" -tray &
    
    timeout=15
    cb_device_name="ControllerBuddy Joystick"
    
    i=0
    while cb_joystick_device=$(awk -v RS='' "/Name=\"$cb_device_name\"/{match(\$0, /js[0-9]+/); print substr(\$0, RSTART, RLENGTH); exit}" /proc/bus/input/devices) && [ -z "$cb_joystick_device" ] && [ "$i" -lt "$timeout" ]
    do
        if ! pgrep -f 'flatpak-spawn --host /bin/bash -c FLATPAK_ID=de.bwravencl.ControllerBuddy' > /dev/null
        then
            (( i++ ))
        fi
        sleep 1
    done
    
    if [ -z "$cb_joystick_device" ]
    then
        zenity --error --text="Launch aborted because $cb_device_name wasn't ready within $timeout seconds.\n\nCheck if your controller is connected." --width 500
    else
        SDL_JOYSTICK_DEVICE="/dev/input/$cb_joystick_device" \
        SDL_MOUSE_RELATIVE_SPEED_SCALE="$mouse_sensitivity" \
        flatpak run io.github.dosbox-staging -conf "$dosbox_conf"
    fi
    
    killall -q ControllerBuddy
    
    EOF
  6. Add the launch script ($HOME/Falcon_Gold/Falcon_Gold.sh) as a Non-Steam game to your Steam library.

  7. Rename the Falcon_Gold.sh Steam shortcut to Falcon Gold (ControllerBuddy).

  8. Override the Steam CONTROLLER settings of the Falcon Gold (ControllerBuddy) shortcut settings to Disable Steam Input.

🎮 Steam Deck Specifics

Configure Touchpads

Important

Since the Steam Deck's controller hardware is exposed to games via Steam Input, even if you do not care for the touchpad controls, you must at least apply the default Steam Input layout called Gamepad With Camera Controls to the Falcon Gold (ControllerBuddy) shortcut to ensure the controller can be detected by ControllerBuddy.

There is a special ControllerBuddy Steam Input controller layout available which configures the Steam Deck's touchpads to act as a mouse replacement.

Control Function
Right Touchpad Move mouse cursor
Right Touchpad Click Left mouse button
Left Touchpad Click Right mouse button
Left Touchpad Y-Axis Scroll up/down

To use this layout:

  1. Add the ControllerBuddy Steam Input layout to your Steam controller layouts:

    xdg-open steam://controllerconfig/3259858387/3672925155
  2. Apply the layout to the Falcon Gold (ControllerBuddy) shortcut in your Steam library.