mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-24 00:31:34 +11:00
Add build script to generate the .gba files
This commit is contained in:
parent
02940b447a
commit
ec9a345563
26
.github/scripts/build-example-gba-files.sh
vendored
Executable file
26
.github/scripts/build-example-gba-files.sh
vendored
Executable file
|
@ -0,0 +1,26 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e # Fail if any command fails
|
||||||
|
set -x # print every command before it runs
|
||||||
|
|
||||||
|
# Requires gbafix and arm-none-eabi-objcopy to already be installed
|
||||||
|
|
||||||
|
function build_rom() {
|
||||||
|
local GAME_NAME="$1"
|
||||||
|
local INTERNAL_NAME="$2"
|
||||||
|
|
||||||
|
local GBA_FILE="target/$GAME_NAME.gba"
|
||||||
|
|
||||||
|
pushd "examples/$GAME_NAME"
|
||||||
|
cargo build --release
|
||||||
|
|
||||||
|
arm-none-eabi-objcopy -O binary "target/thumbv4t-none-eabi/release/$GAME_NAME" "$GBA_FILE"
|
||||||
|
gbafix -p "-t${INTERNAL_NAME:0:12}" "-c${INTERNAL_NAME:0:4}" -mGC "$GBA_FILE"
|
||||||
|
|
||||||
|
cp -v "$GBA_FILE" "../$GAME_NAME.gba"
|
||||||
|
|
||||||
|
popd
|
||||||
|
}
|
||||||
|
|
||||||
|
build_rom "the-purple-night" "PURPLENIGHT"
|
||||||
|
build_rom "the-hat-chooses-the-wizard" "HATWIZARD"
|
1
examples/.gitignore
vendored
Normal file
1
examples/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
*.gba
|
Loading…
Reference in a new issue