Replace the joinedtogether build with a template build

This commit is contained in:
Gwilym Kuiper 2022-10-13 20:20:44 +01:00
parent 0cf3dee603
commit 67c293238d
3 changed files with 14 additions and 16 deletions

View file

@ -7,7 +7,7 @@
- [Linux setup](./setup/linux.md) - [Linux setup](./setup/linux.md)
- [Windows setup]() - [Windows setup]()
- [Mac OS setup]() - [Mac OS setup]()
- [Building the game](./setup/building.md) - [Building the template](./setup/building.md)
- [Learn agb part I - pong](./pong/01_introduction.md) - [Learn agb part I - pong](./pong/01_introduction.md)
- [The Gba struct](./pong/02_the_gba_struct.md) - [The Gba struct](./pong/02_the_gba_struct.md)
- [Sprites](./pong/03_sprites.md) - [Sprites](./pong/03_sprites.md)

View file

@ -27,3 +27,4 @@ It is super rewarding being able to play a game you made yourself on a piece of
* [agb's documentation](https://docs.rs/agb) which is useful if you need a quick reference * [agb's documentation](https://docs.rs/agb) which is useful if you need a quick reference
* [Awesome Game Boy Advance development](https://github.com/gbdev/awesome-gbadev) contains links to popular libraries, emulators and the super friendly gbadev discord * [Awesome Game Boy Advance development](https://github.com/gbdev/awesome-gbadev) contains links to popular libraries, emulators and the super friendly gbadev discord
* [Example game](https://lostimmortal.itch.io/the-hat-chooses-the-wizard) written using agb as part of the 2021 GMTK game jam. * [Example game](https://lostimmortal.itch.io/the-hat-chooses-the-wizard) written using agb as part of the 2021 GMTK game jam.
* [More example games](https://github.com/agbrs/agb/releases/latest) built using agb. See them in `examples.zip` attached to the latest release.

View file

@ -1,34 +1,31 @@
# Building the game # Building the template
By the end of this section, you should be able to build and run an example game made using agb! By the end of this section, you should be able to build and run the **agb** template.
**This section is optional.**
If you just want to get straight into building your own games, you don't need to do this.
However, we recommended doing this section to prove that your setup works.
# 1. Get the source code # 1. Get the source code
The source code can be fetched using `git clone https://github.com/agbrs/joinedtogether.git`. The source code can be fetched using `git clone https://github.com/agbrs/template.git`.
# 2. Build the game # 2. Build the template
Build a copy of the game using `cargo build --release`. Build a copy of the template using `cargo build --release`.
This could take quite a while, but eventually you'll end up with a copy of the game in `target/thumbv4t-none-eabi/release/joinedtogether` or `target/thumbv4t-none-eabi/release/joinedtogether.elf` depending on platform. This could take quite a while, but eventually you'll end up with a copy of the template in `target/thumbv4t-none-eabi/release/template` or `target/thumbv4t-none-eabi/release/template.elf` depending on platform.
This can be run directly by some emulators, but we need to run an extra step in order to convert the elf file into a '.gba' file. This can be run directly by some emulators, but we need to run an extra step in order to convert the elf file into a '.gba' file.
```sh ```sh
arm-none-eabi-objcopy -O binary target/thumbv4t-none-eabi/release/joinedtogether joinedtogether.gba arm-none-eabi-objcopy -O binary target/thumbv4t-none-eabi/release/template template.gba
gbafix joinedtogether.gba gbafix template.gba
``` ```
or or
```sh ```sh
arm-none-eabi-objcopy -O binary target/thumbv4t-none-eabi/release/joinedtogether.elf joinedtogether.gba arm-none-eabi-objcopy -O binary target/thumbv4t-none-eabi/release/template.elf template.gba
gbafix joinedtogether.gba gbafix template.gba
``` ```
And then load the resulting file in your emulator of choice. And then load the resulting file in your emulator of choice.
That's all there is to it! That's all there is to it!
If you have `mgba-qt` in your path, then you can launch the game directly using `cargo run --release` If you have `mgba-qt` in your path, then you can launch the template directly using `cargo run --release`.