Building for Wii U - TheXTech/TheXTech GitHub Wiki

In November 2023, experimental support for Nintendo Wii U was added to TheXTech.

Dependencies

Building the Nintendo Wii U version of the game requires the homebrew toolchain devkitPro. devkitPro is supported on Linux, macOS and Windows. Wii U builds have primarily been tested on Linux-based operating systems. Please follow your platform's appropriate steps to install the devkitPro, and ensure that the environment variables DEVKITPRO and DEVKITPPC is set as per the official instructions.

Once devkitPro is installed, you'll be using the CMake parameter -DCMAKE_TOOLCHAIN_FILE to tell CMake what parameters, compilers, and arguments it should use to cross-compile for Nintendo Wii U.

For example:

# Simplest Nintendo Wii cross-compilation example
cmake -DCMAKE_TOOLCHAIN_FILE=$DEVKITPRO/cmake/WiiU.cmake

You are required to install the wiiu-sdl2 package using the dkp-pacman utility, for example on Linux and or on macOS:

sudo dkp-pacman -S wiiu-sdl2

Preparing to build

Before to start the build, you should obtain the source code for TheXTech. You can use the stable version as well as the latest in-development to test out any new experimental features and receive any further bugfixes earlier.

Stable version

If you want to build the stable version, you can simply download the source code archive from the official site or from GitHub releases:

And then, unpack the archive and open the terminal at the just-now unpacked directory that contains the source code for TheXTech.

Important note: Please never use the "Source code" links at Github releases: they are broken. Instead, download the thextech-full-src-v*.*.*.tar.gz or thextech-full-src-v*.*.*.tar.bz2 or thextech-full-src-v*.*.*.zip archive.

This project uses submodules and GitHub is unable to create source code packages that includes submodules too.

Development version

If you want to build the latest in-development version, then, instead of downloading the archive, you can clone the repository itself by running this in a terminal (please open the terminal at the directory where you want to put the clonned repository, so, you will know where it is):

git clone https://github.com/TheXTech/TheXTech.git

Then, Make sure all submodules have been pulled, otherwise, it won't build:

cd TheXTech
git submodule init
git submodule update

Building

At the TheXTech's source code directory, run next commands in the terminal:

  1. Make the building directory:

    mkdir build-wiiu
    cd build-wiiu
  2. Run CMake configuration:

    For the optimized, fast build

    # when you want to use the regular GNU Make
    cmake -DCMAKE_BUILD_TYPE=MinSizeRel \
             -DCMAKE_TOOLCHAIN_FILE=$DEVKITPRO/cmake/WiiU.cmake \
             -DCMAKE_INSTALL_PREFIX=$DEVKITPRO/portlibs/wiiu ..
    # OR when you want to use Ninja which does better parallel processes management
    cmake -G Ninja -DCMAKE_BUILD_TYPE=MinSizeRel \
             -DCMAKE_TOOLCHAIN_FILE=$DEVKITPRO/cmake/WiiU.cmake \
             -DCMAKE_INSTALL_PREFIX=$DEVKITPRO/portlibs/wiiu ..

    For a slower, debug build (useful for verbose logging)

    # when you want to use the regular GNU Make
    cmake -DCMAKE_BUILD_TYPE=Debug \
             -DCMAKE_TOOLCHAIN_FILE=$DEVKITPRO/cmake/WiiU.cmake \
             -DCMAKE_INSTALL_PREFIX=$DEVKITPRO/portlibs/wiiu ..
    # OR when you want to use Ninja which does better parallel processes management
    cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug \
             -DCMAKE_TOOLCHAIN_FILE=$DEVKITPRO/cmake/WiiU.cmake \
             -DCMAKE_INSTALL_PREFIX=$DEVKITPRO/portlibs/wiiu ..
  3. Run the build itself:

    # Run regular GNU Make build with 4 parallel tasks
    # (suggested on 4-core CPU, if you have more cores, use a different number than 4)
    make -j 4
    # Or run a Ninja build
    ninja

Running and debugging a build

The built game will not work until you will prepare the game root. The game root by default for Nintendo Wii U is located at sd:/wiiu/thextech/. Please create this directory and place your preferred game assets inside that directory before attempting to launch the Nintendo Wii U version of the game. For debugging purposes you may simply copy a standard TheXTech asset pack to this directory, but see below for advice to significantly speed up the game.

Running game on hardware

Once the game is built and assets directory is ready, you can install the executable itself:

  • Create the directory sd:/apps/wiiu/thextech/
  • Find in the build directory files icon.png, meta.xml, and thextech.rpx. Copy them into new-made sd:/wiiu/apps/thextech-wiiu/ directory.
  • Once you done that, you can open the Homebrew Launcher, and find the TheXTech game in the list.

Creating a WUHB pacckage

To get an ability to run multiple different games, and also, improve the file system performance, you can make a WUHB package using an assets package and the game executable. The wuhbtool from the set of DevkitPro toolset should help you in this process.

wuhbtool <rpx-file> <output> [options]

Global Options:
  -H --help
    Show help.
  --content=<content>
    Path to the /content directory
  --name=<name>
    Long name of the application
  --short-name=<short-name>
    Short name of the application
  --author=<author>
    Author of the application
  --icon=<icon>
    Application icon (128x128)
  --tv-image=<tv-image>
    Splash Screen image shown on the TV (1280x720)
  --drc-image=<drc-image>
    Splash Screen image shown on the DRC (854x480)

All that you need:

  • Download an assets package that you want.
  • Unpack an assets pacakge into any convenient directory, but, keep it clean and don't put any other files into it: only content of archive.
  • Open the terminal, and run the next command to generate the WUHB package:
wuhbtool \
    <path-to-thextech.rpx-file> \
    <path-to-the-game.wuhb-file> \
    --content="<path-to-assets-directory>" \
    --name="<Name-of-the-game>" \
    --short-name="<NoTG>" \
    --icon=<path-to-icon-file> \
    --author="Put-the-name-of-game-creator"

Example:

wuhbtool \
    /path/to/thextech.rpx \
    /path/to/SuperGame.wuhb \
    --content="/path/to/unpacked/SuperGameAssets" \
    --name="Super Game" \
    --short-name="SG" \
    --icon="/path/to/unpacked/SuperGameAssets/graphics/ui/icon/thextech_128.png" \
    --author="The Super Developer"

After running the command, you will get the WUHB file that you can use to put on your SD card and run it (or even install).

When running game as WUHB package, all logs, screenhots, etc. will be saved on your SD card or USB stick at the sd:/wiiu/thextech-user/<title-id>/ directory. Where <title-id> is a hexidecimal identifier of the genreated WUHB file, and it will gets changed when you rename the WUHB file into any other name. At the sd:/wiiu/thextech-user/<title-id>/worlds/ you can put any custom episodes you want without the necessary to repack the WUHB file.

Running game on CEMU emulator

You also can run the game on the CEMU emulator (You need latest development version!): you can simply open the thextech.rpx through the emulator directly. Highly recommended to run the emulator with the --force-interpreter command-line argument because of bugs in the CEMU's recompiler are didn't resolved yet.

Troubleshooting

  • Please ensure you have the latest devkitPro installed
  • Please ensure that the DEVKITPRO and DEVKITPPC environment variables are set OR exported in your .bashrc (or similar)
  • Please ensure that your assets are installed at sd:/wiiu/thextech/
⚠️ **GitHub.com Fallback** ⚠️