Skip to content

Instantly share code, notes, and snippets.

@michaelbutler
Last active October 1, 2022 01:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaelbutler/42a84f231e4e39c0e73372ba6eab8633 to your computer and use it in GitHub Desktop.
Save michaelbutler/42a84f231e4e39c0e73372ba6eab8633 to your computer and use it in GitHub Desktop.
Running Zelda Breath of the Wild in CEMU on Linux with Full Steam Controller Support Including Gyro Controls

Running Zelda: Breath of the Wild in CEMU on Linux with Full Steam Controller Support Including Gyro Controls

This guide instructs you how to:

  1. Install latest version of Wine
  2. Install gamescope
  3. Create a new wine prefix
  4. Install and setup DXVK in that wine prefix
  5. Install the Windows version of CEMU in that prefix (*)
  6. Configure CEMU first outside of Steam
  7. Run CEMU in Steam as a Non-Steam Game so the Overlay works

(*) As of Sept. 2022, the performance is still much better on the windows EXE version versus the native Linux build which is why I use it here.

Install Latest Version of Wine

Use your distro's package manager to install the official wine package.

Debian based

sudo apt install wine

Fedora or RPM based

sudo yum install wine

Arch based

sudo pacman -S wine

After it is installed you can make sure it's working with:

wine64 --version

Install gamescope

This step might be optional, but lately I've been running my games with gamescope, which was primarily made for the Steam Deck, however it works fine on Desktops too and provides some nice features. Also it seems the Steam Controller works better for me when I run a game with gamescope.

Follow instructions here to install gamescope. You might have to compile it. If you're on an Arch based distro and have AUR, you can find gamescope there.

Create a new wine prefix

Open a new terminal window (Usually Ctrl Alt T) and get some things set up:

WINEPREFIX=”$HOME/cemu_wine” winecfg

You can change $HOME/cemu_wine to be and folder path you want; this is basically where we will put the CEMU application and Wii U games. Running this command will set up a typical Wine environment. Say "Yes" to install any packages it prompts you with, then when you get to the configuration GUI, change it to Windows 7 and hit OK to close the window.

💡 TIP: If you have an extra games hard drive, open the folder in your file explorer, then press Ctrl L and then Ctrl C to quickly copy the full file path, then use Ctrl Shift V to paste it into the terminal.

Install and setup DXVK in that wine prefix

Some of this step might be optional, since I don't think we'll be strictly using DXVK, as CEMU is not using Direct3D API -- it's using Vulkan even on the Windows version (or at least we can tell it to).

For this step, follow the first part of this guide which is basically installing some packages. Your system might already have this.

Download the latest DXVK release on the releases page, it should say something like "dxvk-1.10.3.tar.gz". Extract it to your cemu_wine folder. You can double click the file and just drag and drop the folder if you want, or you can use the terminal with tar -xvf dxvk-1.10.3.tar.gz and then copy the folder.

Now run this command to setup DXVK in your wine prefix:

cd $HOME/cemu_wine
WINEPREFIX="$HOME/cemu_wine" WINEARCH=win64 ./dxvk-1.10.3/setup_dxvk.sh install   

Install the Windows version of CEMU in that wine prefix

Go to the CEMU downloads page and download your preferred version of CEMU for Windows. I used 1.26.2f since it is more stable.

Extract the downloaded zip to this folder:

$HOME/cemu_wine/drive_c/Program Files/CEMU

I renamed the folder from cemu_1.26.2 to CEMU in that example. So now I have $HOME/cemu_wine/drive_c/Program Files/CEMU/Cemu.exe as the path to the program.

Now create a folder inside $HOME/cemu_wine/drive_c/Program Files/CEMU called Roms. This is where you'll put your games. Inside that Roms folder you should put the The Legend of Zelda Breath of the Wild [ALZP01] folder (and inside that folder there should be meta, content, and code. This guide doesn't cover how to get those (you'll have to dump the game discs from your Wii U hardware).

Configure CEMU first outside of Steam

Run this command:

WINEPREFIX="$HOME/cemu_wine" WINEARCH=win64 wine64 "$HOME/cemu_wine/drive_c/Program Files/CEMU/Cemu.exe"

You should get the Cemu wizard, don't do anything on this screen and just hit next & continue & close. We'll be setting up the options elsewhere.

  • Open Options -> General Settings.
  • Under Game Paths click Add
  • Navigate to My Computer -> C: -> Program Files -> CEMU -> Roms
  • Click Open
  • Configure Graphics tab how you wish: Graphics API = Vulkan, Vsync = Off, Async shader compile checked.
  • Adjust volume on Audio tab, but this should mostly be left as defaults so you can set the sound device in Linux.
  • Close options

Now right click in the empty space and choose "Refresh game list" and your games should show up. If not, exit the program and launch it again using the command used earlier.

Once Zelda BOTW is showing up:

  • Go to Options -> Graphic packs
  • Click Download community graphic packs
  • Configure Zelda graphic packs as you wish, I recommend:
    • Enhancements
    • Graphics
    • Mods -> FPS++
    • Mods -> Extended Memory
    • Mods -> Camera Sensitivity set to 1.75x for best Steam Controller usage.
  • Close graphic packs window
  • Open Options -> Input settings
  • Type Profile name: SteamController
  • Choose Wii U Gamepad for Emulated controller
  • Click + and then select API: SDLController
  • For Controller select Xbox 360 Controller (Hopefully this shows up, it's kind of a virtual controller put there I think from Wine)
  • Don't configure any buttons! The defaults should all be good and you can change them later with the Steam overlay. Configuring buttons here didn't work for me anyway.
  • Click Save to save your input profile and close the input settings.
  • Finally, right click Zelda and choose Edit game profile
  • For Mode choose Multi-core recompiler and set Thread quantum to 60000 cycles. You might be able to play around with this number, I'm not too sure.
  • Under graphic tab set API to Vulkan. Leave everything else as is and don't change the Controller tab.
  • Close this dialog window
  • Under Options choose Fullscreen so it becomes checked.
  • Double click Zelda to launch and test it. NOTE: The Steam Controller likely won't work at this point. but don't worry. You want to confirm that the game runs at least.

Once you're done testing that the game works, press Alt F4 to quit out of Cemu and we're ready to add it to Steam.

Run CEMU in Steam as a Non-Steam Game so the Overlay works

  • In Steam library go to Games menu -> Add a Non-Steam Game to Library.

Honestly it will be quicker here to just literally add any program such as Firefox or Calculator and then customize it later, so just check any program and hit Add Selected Programs.

  • Right click on the program you added and choose Properties.
  • Set the Name to CEMU Windows or whatever you want. Note: don't change it again later as the name seems to be tied to the controller profiles, unless you are okay with reconfiguring it again.
  • Change the TARGET to be just wine64
  • Change Start In to be /home/YOURUSERNAME/cemu_wine or whatever your wine prefix is (along with any other step referencing this)
  • Set Launch Options to this string:
WINEPREFIX="/home/YOURUSERNAME/cemu_wine" WINEARCH=win64 gamescope -w 1920 -h 1080 -W 3440 -H 1440 -f %command% "/home/YOURUSERNAME/cemu_wine/drive_c/Program Files/CEMU/Cemu.exe"

Tweak the gamescope widths and heights as needed for your set up. The first width and height is what to run the game at, and the second width and height should be your actual monitor's full dimensions. For example this means you can make the game think you only have a 1920 x 1080 monitor even if you have a super Ultra Wide monitor, so it doesn't have to worry about aspect ratio stuff. You can also try some cool FSR upscaling logic later if you have an AMD card.

If you don't have an AMD card or don't want to use gamescope, you can just set the Launch options to this pared down version:

WINEPREFIX="/home/YOURUSERNAME/cemu_wine" WINEARCH=win64 %command% "/home/YOURUSERNAME/cemu_wine/drive_c/Program Files/CEMU/Cemu.exe"

Don't change anything on the Compatibility Tab. Close the properties to save them.

💡 TIP: You can customize the logo and artwork of this entry in your Steam library by right clicking on it -> customize artwork/logo in different views and selecting any PNG file.

Click Play on Cemu Windows in Steam to launch it.

When it launches double click Zelda (or click and press Enter) to start the game.

In a few moments the Steam Overlay should be visible, and if your Steam Controller is turned on, you should be able to control the game using it. You'll be able to customize the right trackpad as a Mouse Joystick, and also set up the Gyro to map to the Mouse Joystick as well, which gives you good aiming capabilities when the game only sees a regular Xbox 360 controller.

Steam Button Configuration Tips

💡 TIP: I like to set the Xbox's "A" button (South) to be Nintendo's "A" button (East) to match most other PC games. Confusingly, this means in the Steam controller configuration, you should set A to actually be B, and B to A. However, I keep X and Y as-is... which means IN GAME "A" and "B" will be labeled correctly -- Xbox A is actually Confirm, Xbox B is actually Run/Cancel, but Xbox X button is Attack, even though the game will say Y, and Xbox Y is Jump/Glide, even though the game will say to press X.💡

My left touch pad maps to the left analog stick so I use it for movement. I can simply press down on it to sprint, by mapping it to Xbox button A (which remember, is actually Nintendo Button B 😄). This allows easy sprinting while still operating the camera.

Right pad is mapped to the right joystick for camera controls. Using the camera sensitivity mod at 1.75x really helped here so I can move the camera faster but also fine control if I need it. Gyro is also mapped as Mouse Joystick, activated on right pad touch. I find this to be extremely close to real gyro controls without needing any special Cemu configuration.

I have Left Grip to be LS Click, meaning Crouch toggle. Right grip is set to Xbox Y (Jump).

Left Analog stick is mapped to the D-Pad for changing weapons.

Right pad click is Right stick click.

@michaelbutler
Copy link
Author

michaelbutler commented Sep 27, 2022

Caveat

Unfortunately I forgot about some of the required gyro parts of the game (ball + labyrinth) which means the Steam Controller can't do everything -- because in this configuration i was just using it to emulate an Xbox 360 controller, with gyro mapping to the right analog stick... well maybe it can but I haven't figured out how yet. As a quick solution, I hooked up a Dual Shock 4 via micro USB and can switch to it for the motion part. To do this you just have to hit the + icon in Input Settings, SDLController and choose DualShock 4. then click settings and enable motion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment