# The Game Boy Advance: hardware documents Phase 0 of the restarted gba-python (2026-11-19), written from permitted sources only ([restart.md](restart.md), [provenance.md](provenance.md)). Every behaviour carries its source and an evidence tag (the family's [methodology](https://github.com/alewman/emulator-lineage/blob/main/docs/methodology.md)): | Tag | Here it means | | --- | --- | | `DOC` | GBATEK (Martin Korth, the 2025-04-16 revision pinned as `reference/docs/gbatek.txt`; cited by section title), CowBite 3.5 (Tom Happ), gbadoc (gbadev-org, CC0, pinned `35a281a`), ARM's ARM7TDMI TRM (DDI 0029G) | | `TEST ROM` | a hardware test whose expected value is in its permissive source or readme: `hw-test` (BSD-3, `fbc9914`), alyosha-tas `gba-tests` (MIT, `66f5f1d`), jsmolka `gba-tests` (MIT, `a7113b6`), endrift's mGBA `suite` (MIT, `e694203`), destoer `gba_tests` (MIT, `d714cda`). How strongly each is calibrated is in [validation.md](validation.md) | | `OBSERVED` | a closed box run through `scripts/`: NanoBoyAdvance 1.8.3 (`8c3b159`, "NBA") or mGBA (`fd9dc5c`), always with the BIOS named | | `HYPOTHESIS` | a reasoned guess; the experiment that would settle it is named | No GBA hardware is available to this project, so nothing is `MEASURED`; there is no die-level model either. Hardware-calibrated test ROMs are the strongest evidence we have. ## Documents | Document | What | | --- | --- | | [memory-map.md](memory-map.md) | regions, mirrors, access widths, I/O map, open bus, the BIOS's read protection, reset values | | [timing.md](timing.md) | the clock, N/S/I cycles, WAITCNT, the Game Pak prefetch buffer, DMA, IRQ, HALT/STOP, timers, serial | | [video.md](video.md) | the picture processor: timing, modes 0-5, OBJs, windows, blending, mosaic, latches, VRAM contention | | [sound.md](sound.md) | what the board adds around gb-apu-python's AGB row: the register map, FIFOs A/B, the mixer, SOUNDBIAS | | [cartridge.md](cartridge.md) | the Game Pak bus, header, SRAM/FRAM, Flash, EEPROM, GPIO and the S-3511 RTC, the save census | | [undocumented-behavior.md](undocumented-behavior.md) | what the documents leave open or contradict, each with what would settle it | | [validation.md](validation.md) | every judge, how its verdict is read, its calibration, and the detectors' own measured scores | | [plan.md](plan.md) | the Specification agent's plan: module layout and the order of work by rung | | [provenance.md](provenance.md) | every source used, its terms, how it was used, and what was left unread | | [handoff-brief.md](handoff-brief.md), [restart.md](restart.md) | the owner's brief and the restart's rules | ## The machine in one page The AGB-001 is one clock domain at 16,777,216 Hz (2^24; GBATEK "LCD Dimensions and Timings", "System Clock"; `DOC`). On it: - **CPU**: an ARM7TDMI (ARMv4T, ARM and Thumb states) with a three-stage pipeline, FIQ unused (GBATEK "BIOS Interrupt handling", "Fast Interrupt (FIQ)": the FIQ pin is tied inactive; `DOC`). It is [arm7tdmi-python](../../arm7tdmi-python), which makes one bus callback per CPU cycle with the address, width and the SEQ/CODE/LOCK bits, internal cycles included; the board turns those into clocks ([timing.md](timing.md)). - **Memory** (GBATEK "GBA Memory Map"; `DOC`): 16 KB BIOS ROM (read-protected), 256 KB on-board work RAM on a 16-bit bus, 32 KB on-chip work RAM on a 32-bit bus, 1 KB I/O, 1 KB palette RAM, 96 KB VRAM, 1 KB OAM, and the Game Pak: up to 32 MB of ROM on a 16-bit multiplexed bus seen through three wait-state windows, and an 8-bit backup bus (SRAM or Flash) at `0E000000`. - **System control**: WAITCNT (Game Pak wait states and the prefetch buffer), the undocumented internal memory control at `04000800` (EWRAM wait states), POSTFLG and HALTCNT. - **Four DMA channels** (priority 0 > 1 > 2 > 3; start immediately, at V-blank, at H-blank, or a special trigger: sound FIFO for 1 and 2, video capture for 3). - **Four 16-bit timers** with prescalers 1/64/256/1024 and count-up chaining; timers 0 and 1 pace the sound FIFOs. - **Interrupt controller**: IE, IF, IME; 14 sources (V-blank, H-blank, V-count, four timers, serial, four DMAs, keypad, Game Pak). The BIOS owns the vectors. - **Picture processor**: 240x160, 308x228 dots of 4 cycles; four backgrounds (text, affine, bitmap), 128 OBJs, two windows plus the OBJ window, alpha blending and brightness, mosaic. - **Sound**: the four Game Boy channels (gb-apu-python's AGB row), two 8-bit DMA FIFOs, a mixer and a PWM output stage set by SOUNDBIAS. - **Keypad** (10 keys, an IRQ with OR/AND conditions) and the **serial port** (normal, multi-player, UART, JOY bus, general purpose). - **Cartridge devices**: SRAM/FRAM, Flash 64/128 KB, EEPROM 512 B/8 KB, the GPIO port in the ROM chip and the Seiko S-3511 real-time clock behind it. Out of scope for the board as briefed: the CGB/DMG compatibility mode (a separate machine inside the same chip, GBATEK "GBA Backwards Compatibility CGB Mode"), the Wireless Adapter, e-Reader, solar/tilt/gyro sensors and rumble (listed in [cartridge.md](cartridge.md) for later). ## What the BIOS does that the board must not The board runs the player's own BIOS or Cult-of-GBA's free one (owner's decision). It does not reimplement BIOS functions (no HLE): `SWI` calls are ordinary ARM code in the BIOS image. Some observable values depend on which image runs: the protected-read value ([memory-map.md](memory-map.md) "BIOS read protection") and the cycle counts of BIOS routines (hw-test `haltcnt` calls CpuSet; alyosha-tas `timing/cpy_data_bios`). Judges whose expectations were taken with Nintendo's BIOS can only be passed with it; [validation.md](validation.md) says which.