Skip to Content
The Alchemy Project

Graphics & Sound

Every picture and sound in Golden Sun: The Broken Seal is held in an open format that the build compiles byte-for-byte into GBA hardware formats.

Instead of opaque binary blobs, the repository stores indexed PNGs, .tsv animation and metadata tables, MIDI sequences, and 8-bit PCM WAV samples. Isaac's sprite sheet can be opened in an image editor, a song altered in a MIDI tool, or a waterfall's animation inspected, and make converts everything back into the cartridge's exact packed layouts.

This page describes the GBA hardware rules those assets obey, Camelot's reuse of 5-direction character sheets and shared tilesets across the cartridge, and the way MusicPlayer2000, area music rules, jingle ducking, and the custom IWRAM mixer work together.

GBA graphics fundamentals

The title intro fades in: watch every colour of the sky, mountain, and sun brighten from dark red as hardware palette entries step toward their targets
The title intro fades in: watch every colour of the sky, mountain, and sun brighten from dark red as hardware…

The GBA uses indexed colour. Images store palette indices, while separate hardware palettes map those indices to 15-bit RGB colours (32 levels per channel; tools/ags-graphics rejects non-exact RGB values). Because colours are held in palettes rather than in tile pixels, fades, Psynergy tints, and enemy recolours run without rewriting tile data.

  • Palettes and bit depths: The console holds 256 background colours and 256 sprite colours. 8bpp assets index all 256 entries directly, while 4bpp assets pick one of sixteen 16-colour sub-palettes using a 4-bit palette number (index 0 is always transparent).
  • Tiles and sprites: Pixels pack into 8×8 tiles, and hardware sprites (OAM) range up to 64×64 pixels.

Character sprites and 5-direction animations

Character sheets in sprite/ are vertical PNG strips paired with tab-separated .tsv animation scripts. For example, isaac.png holds 210 pictures of 32×32 pixels. Isaac's walk cycle is animation 2 in sprite/isaac.tsv:

2	picture	55	6
2	picture	30	6
2	picture	35	6
2	picture	40	6
2	picture	45	6
2	picture	50	6
2	loop

Picture indices step in fives because each pose is drawn in 5 directions (S, SE, E, NE, and N) and horizontally mirrored for the 3 west facings, so one animation script works facing any direction. Monsters follow the same principle, with front and back pose pairs for the orbiting battle camera, sharing 54 8bpp strips across 165 enemies through palette swaps.

Tilesets and 128-colour battle backgrounds

The title intro pulled apart into its cloud, mountain, and sun background layers before closing back into the frame players see
The title intro pulled apart into its cloud, mountain, and sun background layers before closing back into the…
  • Tilesets (tileset/): Maps borrow palettes (14×16-colour sets, leaving sub-palettes 14 and 15 free for UI windows) and 512-tile 4bpp sheets independently. This sharing allows Mercury Lighthouse's walls to appear across four different areas under nine palettes.
  • Battle backgrounds (battle_backgrounds/): Raw 256×120 bitmaps capped at 128 colours so that two backdrops can occupy VRAM at the same time during ending credits crossfades.

Static assets link directly into their owning module, while dynamically loaded assets register in the 1,000-row resource directory.

Sound architecture and MusicPlayer2000 (m4a)

Isaac opens a chest in Sol Sanctum: watch the Small Jewel rise as the treasure jingle ducks the background music
Isaac opens a chest in Sol Sanctum: watch the Small Jewel rise as the treasure jingle ducks the background…

All audio routes through one entry point, sySoundPlay in sound/sound.c. Callers pass a numeric ID from include/sounds.h, and its numeric range decides how it plays:

RangeKindBehaviour
0–79Music (MUS_*)Loops continuously; requesting the current track is a no-op so town music carries seamlessly into houses
80–99Jingle (MUS_*)Plays once while ducking BGM to silence, then fades BGM back in
100+Sound effect (SE_*)Plays over music and jingles

Beneath sySoundPlay are reconstructed MusicPlayer2000 (m4a) routines matching the driver linked into the cartridge, exposing 8 music players: 1 for BGM, 1 for jingles, and 6 for sound effects. Each row of SongTable pins a sound to a specific player, which is why each dialogue voice blip cuts off the previous one rather than overlapping it. Sequences (songs/*.mid) play over pitched 8-bit PCM samples (direct_sound_samples/*.pcm8.wav) and the four legacy Game Boy tone channels. Camelot's custom 352-sample/frame IWRAM mixer renders the stream from system/resident_mixer.s, where it shares the system library's r4-scratch ABI.

Rule-based music selection and VBlank jingle ducking

Isaac stays at an inn: watch how long the screen stays black while it waits for the inn fanfare to finish before town music swells back in
Isaac stays at an inn: watch how long the screen stays black while it waits for the inn fanfare to finish…
  • Area and boss music rules: Before a scene overlay loads, gmMainRoutineRun scans field/music_rules.s, matching scene or area and an optional story flag (first match wins). By this rule Vale's five story tracks carry automatically into every house in Vale. Special boss tracks are held in field/battle_music.c.
  • VBlank jingle ducking: A jingle does not stop the background music. It drops BGM volume to 0 and lets the song keep playing unheard. On every VBlank (~60 Hz), volume steps toward its target. When the jingle finishes, BGM swells back in over roughly a second, at the point the song has reached in the meantime. Because audio runs on VBlank frames rather than game ticks, music holds exact tempo even during slowdown.

Code references