Table of Contents
This wiki page shows how to build re3/reVC for the Nintendo Switch. The Switch target is built with CMake and the devkitA64 toolchain (the premake build files are for desktop platforms only). Building has been tested on Linux and on WSL.
You need:
- devkitPro with the devkitA64 toolchain (
switch-dev) - the Switch portlibs providing SDL2, GLFW, Mesa (OpenGL), OpenAL and mpg123 — install them with
dkp-pacman cmake(3.14 or newer)
librw is vendored in the repository, so it is built for you.
Branches
Both games live in this repository:
master-re3(GTA III)miami-reVC(GTA Vice City)
The steps below use re3. For reVC just check out the miami branch and replace the RE3_ option prefix with REVC_.
Build variants
Every build is made in one of two variants, chosen with the RE3_RT (REVC_RT for Vice City) CMake option:
-DRE3_RT=ON(default) - 10thAE, the Revisited Trilogy edition. Reworked HUD, menus, controller artwork and fonts. Packages the resources fromgamefiles/10thae/.-DRE3_RT=OFF- vanilla, stock resources and behaviour. Packages the resources fromgamefiles/vanilla/.
The option controls both the code (it defines RT for the compiler) and which resource set ends up in the package, so a build is always consistent with its resources.
Steps
-
Clone the project with its submodules:
$ git clone --recursive https://github.com/Dima353/re3.git $ cd re3 -
Configure the build. Use a separate build directory per variant, because the variant is cached by CMake:
$ mkdir build && cd build $ cmake .. -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/Switch.cmake \ -DRE3_AUDIO=OAL \ -DLIBRW_PLATFORM=GL3 \ -DLIBRW_GL3_GFXLIB=GLFW \ -DRE3_WITH_OPUS=False \ -DRE3_VENDORED_LIBRW=True \ -DRE3_INSTALL=True \ -DRE3_RT=ONInstead of passing the toolchain file you may use devkitPro's wrapper, which also presets the portlibs search paths — both are equivalent:
$ /opt/devkitpro/portlibs/switch/bin/aarch64-none-elf-cmake .. <same -D options> -
Compile:
$ make -j$(nproc) -
Package the build.
cpackcollects the.nrotogether with the resource set that matches the variant you configured:$ cpack -G TXZThis produces
re3-oal-switch-10thae.tar.xz(or-vanilla) in the build directory. Usecpackwithout arguments to get a.zipinstead. -
Extract the archive onto your SD card and run the
.nro. The archive already contains the correctTEXT/,data/,models/andneo/for the variant, so you do not need to copy any resources by hand — you only need the original game assets thatre3cannot ship.
To build the other variant, repeat the steps in a fresh directory with -DRE3_RT=OFF:
$ mkdir build-vanilla && cd build-vanilla
$ cmake .. -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/Switch.cmake ... -DRE3_RT=OFF
Continuous integration
.github/workflows/build-switch.yml builds both variants on every push and pull request, and uploads them as separate artifacts:
switch-gl3-10thaeswitch-gl3-vanilla
(reVC uses the miami branch and names its artifacts switch-gl3-miami-10thae / switch-gl3-miami-vanilla.)
Notes
RE3_INSTALL=Trueis required — without it the install rules that select the resource set are not generated, andcpackwould package the executable only.- If you build the
.nroby hand instead of usingcpack, remember to copy the resources from the matchinggamefiles/10thae/orgamefiles/vanilla/directory yourself. - Debug menu can be opened on a controller with
X+R(see Home).