Create GBA adventure with walkable map and NPC dialogue

This commit is contained in:
Rory Rogers committed 2026-10-26 00:37:22 +00:00
commit b4017d5c1a
10 files changed
+623

No files matched your search

+74
View File
@@ -0,0 +1,74 @@
# My GBA Game
An original Game Boy Advance adventure, built one small step at a time.
## Play your game
Double-click **Build and Play.command** in this folder. It builds your ROM, runs the checks, and opens mGBA.
Or open Terminal and run:
```sh
cd ~/gba-game
make play
```
The game file is **game.gba**. You can also open it directly in mGBA without rebuilding.
### Controls (mGBA defaults)
- **Arrow keys:** walk.
- **X (GBA A button):** talk to Mila, the person in green below the house. Walk close first, then press X again to turn the page and once more to close the conversation. Walking pauses while talking. You can also greet the golden creature when nearby.
- **Return (GBA Start button):** return to your starting position.
If those keys do not match your emulator settings, check mGBA's keyboard input settings.
### Your first change
Open `source/main.c` in a text editor. Find:
```c
static const u16 shirt = RGB(5, 14, 29);
```
Those numbers mean red, green, and blue, each from 0 to 31. Try `RGB(29, 6, 6)` for a red shirt. Save, then double-click **Build and Play.command** again.
## Project files
- `source/main.c`: map, character, creature, and game rules.
- `source/start.s`: code that starts the GBA hardware.
- `gba.ld`: tells the compiler where cartridge code and working memory go.
- `tools/rom_header.py`: adds the cartridge header the GBA expects.
- `Makefile`: builds the game with the installed ARM compiler.
- `tests/`: cartridge header and NPC interaction rule tests.
### Change what Mila says
Find `dialogue` near the top of `source/main.c`. Each pair of strings is one page of her conversation. Use CAPITAL letters and spaces, with no more than 52 characters on each line. Save and rebuild to try your new conversation.
## Mac setup
We are using Homebrew's standalone ARM compiler, not devkitPro.
The project includes its own minimal startup code and linker script; it does not require devkitPro or an additional GBA library.
1. From the account that owns Homebrew, install the compiler and binary tools:
```sh
/opt/homebrew/bin/brew install arm-none-eabi-gcc arm-none-eabi-binutils
```
2. Install [mGBA](https://mgba.io/downloads.html), an emulator for testing our game, either from its website or with:
```sh
/opt/homebrew/bin/brew install --cask mgba
```
Do not run Homebrew with sudo. Homebrew installations and updates should be handled by its owning account. Rory can use the installed compiler to build this project without administrator access.
Never share your Mac password in chat. Enter it only in the Mac's installer or Terminal prompt.
We are making an original game. No existing Pokémon ROM or separate BIOS download is needed for this first project in mGBA.
## Project status
The development tools are installed. The ROM contains a walkable map, a character, an original creature to greet, and one NPC named Mila with a two-page conversation. Battles, catching creatures, sound, and saving are not implemented yet.