Alchemy
Loading...
Searching...
No Matches

Getting started

This page takes you from nothing to a changed game: build The Broken Seal, check it against the original, then make two small changes of your own.

The Broken Seal builds on Linux, macOS and Windows with nothing but this repository. The Lost Age is optional and also needs your own cartridge dumps.

1. Install the tools

Linux** (Debian or Ubuntu):

sudo apt install build-essential git curl patch xz-utils binutils-arm-none-eabi pkg-config libpng-dev libutf8proc-dev

On other distributions, install the same packages under their local names.

macOS** (with Homebrew):

xcode-select --install
brew install arm-none-eabi-binutils xz pkg-config libpng utf8proc

Windows:** open PowerShell, run wsl --install, restart, then open Ubuntu from the Start menu and follow the Linux steps inside it.

2. Build

git clone https://github.com/PascalPixel/alchemy
cd alchemy
git submodule update --init --recursive alchemy-gcc
make bootstrap
make tbs-en

make bootstrap builds the compilers once. It downloads their sources and prints plenty of old-compiler warnings, which is normal. make tbs-en builds the English Broken Seal as out/tbs-en/tbs-en.gba, ready for an emulator. The other languages are tbs-ja, tbs-de, tbs-es, tbs-fr and tbs-it.

To check a build against the original, run make compare-tbs-en. It ends with OK when every byte matches.

3. Change something

  • games/tbs/text/en.po holds every line of English dialogue.
  • games/tbs/src holds the code, with the pictures beside it as PNG files.
  • games/tbs/sound holds the music and sound effects.

Edit, run make tbs-en again, and play your version. A changed game no longer matches the original, so compare will report a difference. Please don't share built ROMs, original or modified.

CI checks formatting with clang-format 21, available from LLVM's packages. To use the same check locally, run make format-check CLANG_FORMAT=clang-format-21, or set CLANG_FORMAT to the path of your clang-format 21 executable.

Reconstruction tools (optional)

The pinned alchemy-gcc submodule supplies the compilers. Matching and progress tools live in the optional alchemy-devtools submodule and require Rust:

git submodule update --init alchemy-devtools
make devtools
alchemy-devtools/target/release/alchemy-devtools --help

The documentation generator and theme live separately in alchemy-docs; building the games needs neither Doxygen nor Node.

For an existing checkout after the rename, run git submodule sync --recursive and initialize the new paths above. A fresh clone is also supported. The old command psynergy is now alchemy-devtools, and make psynergy is now make devtools.

The Lost Age (optional)

Dump your own cartridge and put the file in roms/ as tla-en.gba (or tla-ja.gba, tla-de.gba and so on), then run make tla-en. Don't download ROMs; the build checks each one against rom.sha1.

If something fails

  • png.h, utf8proc.h or arm-none-eabi-as not found: one of the packages in step 1 is missing.
  • alchemy-gcc is empty: rerun git submodule update --init --recursive alchemy-gcc, then make bootstrap.
  • Odd path errors: clone into a folder whose path has no spaces.

make help lists every other command.

Your first change: a stronger Quake

Every ability's numbers are one row of games/tbs/src/game/actions.tsv, named in its last column. Quake's row reads:

1 0x85 0 0 1 0 0 0 2 4 12 0 0 0 0 Quake

Its pp_cost is 4 and its power is 12. Change 12 to 40, run make tbs-en, and Quake hits more than three times as hard. How that number becomes damage is in How an ability resolves.

Your second change: a line of dialogue

Every English line is in games/tbs/text/en.po, named by the message the code uses. In Vale, after the party has left, a villager by the fence says this one; find it by its name:

msgctxt "MsgValeIllClimbTheFenceSomeday"
msgid "04548"
msgstr ""
"Once I'm as old as you,\n"
"{actor_name:1}, I'm going to\n"
"climb that fence...{page_break}"

Change the text inside msgstr, keep the \n line breaks the window needs and the codes in braces, and rebuild. How to change a line of dialogue explains the other languages and the control codes.

After a change

A changed game no longer matches the cartridge, so make compare-tbs-en reports a difference: that is the point of comparing. To find the code behind anything you see, start from ☀️ The Broken Seal, which lists the questions people bring and where each is answered.