Apotris is a block stacking game for the Gameboy Advance! It features satisfying graphics, responsive controls and a large amount of customization so that you can tailor the game to your preferences! https://apotris.com
Find a file
2025-11-02 11:26:11 +00:00
.gitea/workflows fixed missing GBA song tools from release pipeline 2025-04-21 13:11:57 +03:00
.github added n3ds build 2025-03-30 13:28:49 +03:00
assets added more shader files 2025-04-03 00:54:31 +03:00
conversionScripts remaking UI 2023-04-20 22:26:07 +03:00
data updated finesse trainer move sprites 2024-04-24 17:23:15 +03:00
dist Remove broken game mode identifier on macOS 2024-05-22 13:10:34 -05:00
images changed readme image 2022-11-15 23:10:50 +02:00
include Merge pull request 'Improve in-game pRNG, fix macOS save path bug' (#188) from aronson/apotris:better-rng into main 2025-11-02 11:26:11 +00:00
lib fixed windows packaging 2024-03-01 23:59:56 +02:00
license Improve PRNG entropy with user input in menus and save hash 2025-04-17 00:38:28 -05:00
license-n3ds Add n3ds build script and libxmp license file 2025-03-29 21:40:10 +08:00
meson Support mingw -posix suffix for g++ and add nodejs to docker 2025-03-29 23:02:46 +02:00
source Merge pull request 'Improve in-game pRNG, fix macOS save path bug' (#188) from aronson/apotris:better-rng into main 2025-11-02 11:26:11 +00:00
sprites updated finesse trainer move sprites 2024-04-24 17:23:15 +03:00
subprojects Merge pull request 'Improve in-game pRNG, fix macOS save path bug' (#188) from aronson/apotris:better-rng into main 2025-11-02 11:26:11 +00:00
tools update mmutil.exe cosmocc binary to latest 2025-11-02 05:20:49 -06:00
.clang-format added clang-format config and autoformatted files 2025-03-03 16:53:34 +02:00
.git-blame-ignore-revs added git-blame-ignore file for autoformatting commit and gitea formatting runner config 2025-03-03 21:11:00 +02:00
.gitattributes .py end-of-line normalization 2024-12-26 15:04:52 -08:00
.gitignore Add macOS files to gitignore 2024-03-22 17:52:55 -05:00
.gitlab-ci.yml updated added only on manual or scheduled rule to gitlab pipeline 2024-04-14 15:58:13 +03:00
.gitmodules Point submodules to organization 2024-04-26 17:37:29 -05:00
CONTRIBUTING.md Add CONTRIBUTING.md 2024-04-29 16:24:25 -05:00
convertAll.sh finished link scene & fixed skin editor saving 2023-08-06 21:14:16 +03:00
Dockerfile reverted dockerfile after it was accidentally changed 2025-04-02 11:25:31 +03:00
Dockerfile-arm64 add arm64 build 2025-03-31 20:45:38 +03:00
Dockerfile-linux created new docker image to create linux builds with lower glibc requirements 2025-04-15 18:52:45 +03:00
gitlab-ci.yml split build artifacts by platform 2024-03-03 14:54:27 +02:00
LICENSE.txt Move LICENSE to AGPL 2024-04-29 16:27:02 -05:00
meson.build n3ds: Use geometry shader for BG tiles 2025-05-17 19:17:55 +08:00
meson.options n3ds: Add Nintendo 3DS port 2025-03-27 22:07:44 +08:00
README.md update README to include optional release build flags 2025-10-26 18:25:55 -05:00

Apotris

https://apotris.com

You can find builds/releases at https://apotris.com/downloads

Apotris is a block stacking game for the Gameboy Advance! It features satisfying graphics, responsive controls and a large amount of customization so that you can tailor the game to your preferences!

Join the discord server for updates, beta releases, or to give me feedback!

Docker build

Want to bypass all the work and use a system shipped by the developers intended to build Apotris? Try the docker image:

First, install Docker for your system. Then get it running and open up a terminal:

# Download and log in to the Apotris builder docker image
docker run -it docker.io/akouzoukos/apotris bash
# OR Optional: build the image yourself
docker build -t apotris-builder . && docker run -it apotris-builder bash
# You are now in the docker image environment, use Ctrl+D or "exit" command to return to main OS

# Clone the latest sources
git clone --recursive https://gitea.com/akouzoukos/apotris.git
# Enter source dir
cd apotris
# From here you can build one of the available targets

# GBA
meson setup --cross-file=meson/gba.ini build-gba && meson compile -C build-gba
# Windows
meson setup --cross-file=meson/mingw.ini build-windows && meson compile -C build-windows
# Linux
meson setup build-linux && meson compile -C build-linux

# NOTE: If you're trying to produce a build exactly like the released builds, you want to add flags as well like below
# Some emulators and platforms will behave differently without these flags (e.g. a debug build)
meson setup -Db_lto=true -Db_lto_mode=thin --buildtype=release ...
# Also note that some builds (specifically the Windows build) may fail with the LTO-related flags, so remove those if the sources no longer compile

# Built executables are now in the Docker environment's apotris/build-*/ folders

OR mount the repo as a volume:

# Clone the repo locally (add --config core.autocrlf=false if you are on Windows)
git clone --recursive https://gitea.com/akouzoukos/apotris.git 
# Enter source dir
cd apotris 
# Build the image
docker build -t apotris-builder . 
# Run the image with the project directory mounted
docker run -it -v ${PWD}/:/root/apotris -w /root/apotris apotris-builder bash

# GBA
meson setup --cross-file=meson/gba.ini build-gba && meson compile -C build-gba
# Windows
meson setup --cross-file=meson/mingw.ini build-windows && meson compile -C build-windows
# Linux
meson setup build-linux && meson compile -C build-linux
# Built executables are now in the local environment's apotris/build-*/ folders

Meson build

Overview of requirements for most systems

As all the libraries and tools are compiled from source, the only things you need to have installed and in your PATH are:

  • meson (at least version 1.3.0 or later)
    • If your system has an out of date meson, install pip and run pip install -U meson to get the latest
  • git
  • A compiler for your system (gcc, clang, etc.)
  • A compiler for the GBA (arm-none-eabi-gcc)
    • On Windows you can download the .exe installer for mingw-w64-i686-arm-none-eabi-gcc
    • On Ubuntu download at least 13.2 of arm-none-eabi-gcc for your system here
      • Extract the archive into your system path with tar xf ./arm-gnu-toolchain-*-arm-none-eabi.tar.xz -C /usr/share/
      • Make sure to symlink everything sudo ln -sf /usr/share/arm-gnu-toolchain-YOUR_VERSION/bin/* /usr/bin/

Note: On macOS one can brew install --cask gcc-arm-embedded && brew install meson ninja opus pkg-config cmake to get all required deps.

Windows (native) requirements

You will need to install:

  • Python 3
    • get the latest stable Windows installer for your platform
    • ensure you "add to PATH" when you run the installer (unless you know what you're doing otherwise)
  • Meson
  • A Windows-native compiler and build tools
    • Strawberry Perl works out of the box, get the system installer to make it easiest

Windows GBA build

For the GBA target, you will need to update the meson/gba.ini file to have the path to your ARM compiler:

[constants]
path = 'C:\Program Files (x86)\Arm GNU Toolchain arm-none-eabi\13.2 Rel1\bin'
# ... rest of original file

You can avoid editing a file by setting this with a powershell command per-session

$env:PATH="$env:PATH;C:\Program Files (x86)\Arm GNU Toolchain arm-none-eabi\13.2 Rel1\bin"

Ensure the version string and directory paths are correct for your installation. They may change with future updates.

Ubuntu 22.04+ and Windows (WSL) dependencies

For all Linux systems

Install the following packages:

sudo apt install build-essential git meson cmake 

also install mingw-w64 if you plan to cross compile for Windows

For Linux native builds

Install the following dependencies of SDL2:

sudo apt-get install build-essential git make \
  pkg-config cmake ninja-build gnome-desktop-testing libasound2-dev libpulse-dev \
  libaudio-dev libjack-dev libsndio-dev libx11-dev libxext-dev \
  libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev \
  libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev \
  libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev fcitx-libs-dev libglew-dev

Note: On some Ubuntu installations the SDL2 libraries are not imported correctly by the build. Removing libsdl2-dev may resolve these issues.

Compiling

Once you have everything, git clone --recursive https://gitea.com/akouzoukos/apotris.git or download this repository, then navigate to the directory in a terminal (or "command-line") window, and run some or all of the following commands depending on your desired target:

# Native build
meson setup build
meson compile -C build

# GBA Build
meson setup --cross-file=meson/gba.ini build-gba
meson compile -C build-gba

# MingW build (Windows using Linux, WSL, or macOS to build)
# Note: the following command is a really bad hack that probably has no consequences but is required
sudo ln -sf $(which x86_64-w64-mingw32-g++-posix) $(which x86_64-w64-mingw32-g++)
meson setup --cross-file=meson/mingw.ini build-mingw
meson compile -C build-mingw

The built Apotris ROMs (.elf, .gba) will be in your build-gba directory.

The built Apotris executable and its required assets/ folder will be in your build directories for other builds.

Less common platforms

Nintendo Switch

The Switch build requires one have the DevkitARM A64 toolchain installed. Installing this is covered by this reference. You will want the switch-dev and switch-portlibs targets installed.

Ensure the compiler is in your PATH and run the cross build:

meson setup --cross-file=meson/switch.ini build-switch
meson compile -C build-switch

The file is output to build-switch/Apotris.nro.

Emscripten

The Emscripten build requires one to have the Emscripten toolchain/SDK installed. See this reference. The latest should work, but at least 3.1.51 is required.

The Emscripten build has a bug. The workaround is relatively simple.

$ meson setup --cross-file=meson/emscripten.ini build-web

$ meson compile -C build-web # this command will throw an error:

AssertionError: attempt to lock the cache while a parent process is holding the lock (sysroot/lib/wasm32-emscripten/libSDL2.a)
em++: error: subprocess 1/34 failed (returned 1)! (cmdline: /opt/homebrew/Cellar/emscripten/3.1.58/libexec/emcc -c /opt/homebrew/Cellar/emscripten/3.1.58/libexec/cache/ports/sdl2_mixer/SDL_mixer-release-2.8.0/src/mixer.c -o /opt/homebrew/Cellar/emscripten/3.1.58/libexec/cache/ports-builds/sdl2_mixer/src/mixer.c.o -g -sSTRICT -Werror -O2 -I/opt/homebrew/Cellar/emscripten/3.1.58/libexec/cache/ports/sdl2_mixer/SDL_mixer-release-2.8.0 -sUSE_SDL=2 -O2 -DMUSIC_WAV -sUSE_VORBIS -DMUSIC_OGG -I/opt/homebrew/Cellar/emscripten/3.1.58/libexec/cache/ports/sdl2_mixer/SDL_mixer-release-2.8.0/include -I/opt/homebrew/Cellar/emscripten/3.1.58/libexec/cache/ports/sdl2_mixer/SDL_mixer-release-2.8.0/src -I/opt/homebrew/Cellar/emscripten/3.1.58/libexec/cache/ports/sdl2_mixer/SDL_mixer-release-2.8.0/src/codecs)
ninja: build stopped: subcommand failed.

Take the command it failed on (in the cmdline: section) and run it manually:

$ /opt/homebrew/Cellar/emscripten/3.1.58/libexec/emcc -c /opt/homebrew/Cellar/emscripten/3.1.58/libexec/cache/ports/sdl2_mixer/SDL_mixer-release-2.8.0/src/mixer.c -o /opt/homebrew/Cellar/emscripten/3.1.58/libexec/cache/ports-builds/sdl2_mixer/src/mixer.c.o -g -sSTRICT -Werror -O2 -I/opt/homebrew/Cellar/emscripten/3.1.58/libexec/cache/ports/sdl2_mixer/SDL_mixer-release-2.8.0 -sUSE_SDL=2 -O2 -DMUSIC_WAV -sUSE_VORBIS -DMUSIC_OGG -I/opt/homebrew/Cellar/emscripten/3.1.58/libexec/cache/ports/sdl2_mixer/SDL_mixer-release-2.8.0/include -I/opt/homebrew/Cellar/emscripten/3.1.58/libexec/cache/ports/sdl2_mixer/SDL_mixer-release-2.8.0/src -I/opt/homebrew/Cellar/emscripten/3.1.58/libexec/cache/ports/sdl2_mixer/SDL_mixer-release-2.8.0/src/codecs

cache:INFO: generating port: sysroot/lib/wasm32-emscripten/libSDL2.a... (this will be cached in "/opt/homebrew/Cellar/emscripten/3.1.58/libexec/cache/sysroot/lib/wasm32-emscripten/libSDL2.a" for subsequent builds)
system_libs:INFO: compiled 117 inputs in 2.99s
cache:INFO:  - ok

Then re-run the compile step again:

$ meson compile -C build-web

ninja: Entering directory `build-web`
[1/1] Linking target Apotris.html # success !

Portmaster

You'll need to load the portmaster development environment, covered here.

Once inside the container, clone the repo and configure as if it were a native build, but with one key config:

meson setup -Dportmaster=true build-pm
meson compile -C build-pm

For some platforms (namely the TrimUI Smart Pro or other devices with specifically a Cortex A-53) you'll need to add the native-file argument to bring in some patches for hardware bugs.

meson setup --native-file=meson/portmaster.ini -Dportmaster=true build-pm
meson compile -C build-pm

Note: on typical Intel/AMD machines this can take a long time.

Nintendo 3DS

Compiling the 3DS build requires you to install the devkitARM toolchain from devkitPro. You can refer to the 3DBrew and devkitPro guides to set it up. Following the guide, you should install all packages in the package group 3ds-dev using pacman (or dkp-pacman).

You will also need to install the library libxmp using pacman (or dkp-pacman):

pacman -S 3ds-libxmp

To perform the cross build:

meson setup --cross-file=meson/n3ds.ini build-n3ds
meson compile -C build-n3ds

The build output file can be found as build-n3ds/Apotris.3dsx.

To run the build, the audio assets must be placed on the SD card under /3ds/Apotris/assets/ beforehand.

Building a CIA file

Normally, there is no reason to use a CIA file. Especially if you are developing and debugging code, the 3dsx file can be easily loaded using 3dslink which also allows you to see stdout and stderr output with its server.

To build the CIA, you will need to install bannertool and makerom manually and have them available on the PATH environment variable while building.

meson compile -C build-n3ds cia

Metadata:

  • Unique ID: 0xA9715
  • Title ID: 000400000A971500
  • Product Code: CTR-H-APTR