diff --git a/Building-on-FreeBSD.md b/Building-on-FreeBSD.md index 363dabc..5b26dc8 100644 --- a/Building-on-FreeBSD.md +++ b/Building-on-FreeBSD.md @@ -6,7 +6,7 @@ This wiki page shows how to build re3 on FreeBSD on a amd64/x86_64 system. Teste Disclaimer: you need to get premake5, there are also other premake versions available, only premake5 is supported. You will also need GNU make and not the built-in BSD make. (Library libsndfile is optional.) -* Run `$ git clone --recursive https://github.com/GTAmodding/re3.git` to clone the project to your PC +* Run `$ git clone --recursive https://github.com/Dima353/re3.git` to clone the project to your PC * Enter the newly created `re3` directory and run `$ premake5 --with-librw gmake2`, remember to use premake5 you either have built in `/usr/ports` or installed it via `pkg` diff --git a/Building-on-Linux.md b/Building-on-Linux.md index 6d1c833..af9fd17 100644 --- a/Building-on-Linux.md +++ b/Building-on-Linux.md @@ -11,7 +11,7 @@ and compilers set up, i.e. for Ubuntu you should install `build-essential`. ## Steps -* Run `$ git clone --recursive https://github.com/GTAmodding/re3.git` to clone the project to your PC +* Run `$ git clone --recursive https://github.com/Dima353/re3.git` to clone the project to your PC * Enter the newly created `re3` directory; * If you're on x86/x86_64, run `$ ./premake5Linux --with-librw gmake2`. diff --git a/Building-on-MacOS.md b/Building-on-MacOS.md index 17784c5..a56a8e2 100644 --- a/Building-on-MacOS.md +++ b/Building-on-MacOS.md @@ -13,7 +13,7 @@ to be installed via Homebrew or MacPorts. * Switch to another directory which you will use for building premake5, and build your own premake5 from source (Not explained in this tutorial). -* Switch to a directory you want to use for building re3, and run `$ git clone --recursive https://github.com/GTAmodding/re3.git` to clone the project to your PC. +* Switch to a directory you want to use for building re3, and run `$ git clone --recursive https://github.com/Dima353/re3.git` to clone the project to your PC. * Enter the newly created `re3` directory. diff --git a/Building-on-Nintendo-Switch.md b/Building-on-Nintendo-Switch.md new file mode 100644 index 0000000..5c62b72 --- /dev/null +++ b/Building-on-Nintendo-Switch.md @@ -0,0 +1,93 @@ +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](https://devkitpro.org/wiki/Getting_Started) 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 from `gamefiles/10thae/`. +- `-DRE3_RT=OFF` - **vanilla**, stock resources and behaviour. Packages the resources from `gamefiles/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=ON + ``` + + Instead 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 .. + ``` + +* Compile: + + ``` + $ make -j$(nproc) + ``` + +* Package the build. `cpack` collects the `.nro` together with the resource set that matches the variant you configured: + + ``` + $ cpack -G TXZ + ``` + + This produces `re3-oal-switch-10thae.tar.xz` (or `-vanilla`) in the build directory. Use `cpack` without arguments to get a `.zip` instead. + +* Extract the archive onto your SD card and run the `.nro`. The archive already contains the correct `TEXT/`, `data/`, `models/` and `neo/` for the variant, so you do not need to copy any resources by hand — you only need the original game assets that `re3` cannot 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-10thae` +- `switch-gl3-vanilla` + +(`reVC` uses the `miami` branch and names its artifacts `switch-gl3-miami-10thae` / `switch-gl3-miami-vanilla`.) + +## Notes + +* `RE3_INSTALL=True` is required — without it the install rules that select the resource set are not generated, and `cpack` would package the executable only. +* If you build the `.nro` by hand instead of using `cpack`, remember to copy the resources from the matching `gamefiles/10thae/` or `gamefiles/vanilla/` directory yourself. +* Debug menu can be opened on a controller with `X`+`R` (see [[Home]]). diff --git a/Home.md b/Home.md index 16b8d87..d6d3b64 100644 --- a/Home.md +++ b/Home.md @@ -6,16 +6,30 @@ Alongside the original game code, `re3` implements features and improvements tha ### Map View -All [releases (.zip)](https://github.com/GTAmodding/re3#installation) includes a custom file called `models/menu.txd`. To enable this feature you must replace it in the game directory. Once done that, a "Map" option will be enabled in the Main Menu (the one when you pause the game). As shown in the figure below, the player can navigate the map and place custom way-points (a gray blip) with mouse right button. +All [releases (.zip)](https://github.com/Dima353/re3#installation) includes a custom file called `models/menu.txd`. To enable this feature you must replace it in the game directory. Once done that, a "Map" option will be enabled in the Main Menu (the one when you pause the game). As shown in the figure below, the player can navigate the map and place custom way-points (a gray blip) with mouse right button.

Map View
Image 1: VC's map view in action (backported to III)

### Debug Menu -Debug menu provides a series of in-game settings that can be toggled by the user using the mouse. It can be activated by pressing `Control+M`. The following image (1) shows what it looks like. The code that implements this module can be found in `src/extras/debugmenu`{[.cpp](https://github.com/GTAmodding/re3/blob/master/src/extras/debugmenu.cpp) [.h](https://github.com/GTAmodding/re3/blob/master/src/extras/debugmenu.h)}. +Debug menu provides a series of in-game settings that can be toggled by the user using the mouse. It can be activated by pressing `Control+M`, or by pressing `X`+`R` on a Nintendo Switch controller. The following image (1) shows what it looks like. The code that implements this module can be found in `src/extras/debugmenu`{[.cpp](https://github.com/Dima353/re3/blob/master/src/extras/debugmenu.cpp) [.h](https://github.com/Dima353/re3/blob/master/src/extras/debugmenu.h)}.

Debug Menu
Image 1: Debug Menu in action

+## This Repository + +This fork targets the **Nintendo Switch**. Both games live here, in separate branches: + +* `master` - `re3` (GTA III) +* `miami` - `reVC` (GTA Vice City) + +See [[Building on Nintendo Switch]] for the toolchain, build flags and packaging. + +Each game is built in two variants, selected by the `RE3_RT`/`REVC_RT` CMake option: + +* **10thAE** - the Revisited Trilogy edition (reworked HUD, menus, controller artwork and fonts) +* **vanilla** - stock resources and behaviour + ## Derived Work ### Platform Ports