Replace references to gbafix with agb-gbafix

This commit is contained in:
Gwilym Inzani 2023-04-11 20:09:05 +01:00
parent 8af41a9b3c
commit 0d9cc6c1f7
6 changed files with 15 additions and 24 deletions

View file

@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Added
- Added custom `gbafix` implementation which can take the elf file produced by `cargo build` directly, removing the need for the objcopy step.
### Changed
- Made Vector2D::new a const function.
- The template now uses rust 2021 edition by default.

View file

@ -66,8 +66,6 @@ to just write games for the Game Boy Advance using this library:
* Install with `cargo install just`
* [mdbook](https://rust-lang.github.io/mdBook/index.html)
* Install with `cargo install mdbook`
* [gbafix](https://crates.io/crates/gbafix)
* Install with `cargo install gbafix`
With all of this installed, you should be able to run a full build of agb using by running
```sh

View file

@ -30,30 +30,21 @@ Depending on your platform, the file will have either a `.elf` extension or no e
## 3. Convert the binary to a GBA file
In order to run the game on an emulator, we need to convert the binary file to a GBA file.
To do this, we'll use two tools: `arm-none-eabi-objcopy` and `gbafix`.
To do this, we'll use the tool `agb-gbafix`.
Run the following command to convert the binary file to a GBA file:
Run the following command to convert the binary file to a GBA ROM:
```sh
arm-none-eabi-objcopy -O binary target/thumbv4t-none-eabi/release/template template.gba
agb-gbafix target/thumbv4t-none-eabi/release/template -o template.gba
```
or
```sh
arm-none-eabi-objcopy -O binary target/thumbv4t-none-eabi/release/template.elf template.gba
agb-gbafix target/thumbv4t-none-eabi/release/template.elf -o template.gba
```
Depending on whether your file has the .elf extension.
This command will create a template.gba file in the template directory.
Next, run the following command to fix the GBA header:
```sh
gbafix template.gba
```
This command will add the correct GBA header to the template.gba file.
This command will add the correct GBA header to the template.gba file and it will be playable on real hardware or an emulator.
## 4. Run the game

View file

@ -25,8 +25,8 @@ The source code for the game is hosted on github, so you will need to install gi
# 4. gbafix
In order to be able to play games made with agb on real hardware or on some emulators, you will need to install 'gbafix'.
The rust implementation can be installed very easily using `cargo install gbafix`.
In order to be able to play games made with agb on real hardware or on some emulators, you will need to install 'agb-gbafix'.
Agb's implementation can be installed very easily using `cargo install agb-gbafix`.
Make sure that the Cargo bin directory is in your `PATH` as we'll need to use it later.

View file

@ -43,8 +43,8 @@ After installing to your `/Applications` folder you can add the binary to your p
# 5. Real hardware - gbafix
In order to be able to play games made with agb on real hardware or on some emulators, you will need to install 'gbafix'.
The rust implementation can be installed very easily using `cargo install gbafix`.
In order to be able to play games made with agb on real hardware or on some emulators, you will need to install 'agb-gbafix'.
Agb's implementation can be installed very easily using `cargo install agb-gbafix`.
Make sure that the Cargo bin directory is in your `PATH` as we'll need to use it later.

View file

@ -22,8 +22,8 @@ You will also want to install an emulator. The best support in agb is with [mgba
`println!` support via `agb::println!` but any emulator should work. You'll get the best experience if
`mgba-qt` is in your `PATH`.
If you want to run your game on real hardware, you will also need to install `gbafix` which you can do after installing
rust with the following: `cargo install gbafix`. This is not required if you are only running your game in an emulator.
If you want to run your game on real hardware, you will also need to install `agb-gbafix` which you can do after installing
rust with the following: `cargo install agb-gbafix`. This is not required if you are only running your game in an emulator.
### Running in an emulator
@ -68,6 +68,5 @@ running on the real thing.
First build the binary in release mode using the instructions above, then do the following:
```sh
arm-none-eabi-objcopy -O binary target/thumbv4t-none-eabi/release/<your game> <your game>.gba
gbafix <your game>.gba
agb-gbafix target/thumbv4t-none-eabi/release/<your game> -o <your game>.gba
```