# nanoboyadvance: NanoBoyAdvance fetched and built behind the family's two drivers NanoBoyAdvance (fleroviux) run as a closed-box referee through two drivers of ours, each built against NBA at its own pin (nanoboyadvance-drivers 0.1.0, `CHANGELOG.md`): - **`arm7tdmi-sst`**: `nba_sst`, NBA's ARM7TDMI alone on stand-in Bus, save-state and scheduler headers (`nba_sst/shim/`), which runs SingleStepTests ARM7TDMI cases one at a time and reports state and bus agreement with every internal cycle (`nba_sst/nba_sst.cc`). For arm7tdmi-python. Pin `e8482c1` (Codeberg master, 2026-07-26). - **`gba`**: `nba_driver`, a headless driver for NBA's whole GBA core that runs a ROM for a number of frames with a BIOS and writes the picture, registers and save memory, with the same command line and output as gba-python's MIT mGBA driver (`nba_driver/`). For gba-python and arm7tdmi-python's `thumb_undefined` test. Pin `8c3b159` (v1.8.3, 2026-10-19; not HEAD: gba-python found the 2.0 rewrite at `9894c66` crashing in over half its runs). Gathered here on 2026-11-25 (decisions page T3). The two drivers had been parked in `../arm7tdmi-python/nba/` and `../gba-python/nba_driver/` since 2026-11-22 (those paths are now links here), while NBA's source and both builds stayed in the two MIT repositories. The programs run as separate executables with their own command lines; they do not write the shared contract's manifest yet (`build.py` has the contract's `--version` and exit codes). ## Paths | Path under `$EMU_TOOLS_GPL` | What | | --- | --- | | `tools/nanoboyadvance/build.py` | fetches NBA at the machine's pin (Codeberg's archive of the commit) into `upstream/` and builds: `python3 -I build.py --machine arm7tdmi-sst` or `--machine gba`; `JOBS` sets Ninja's jobs (2 by default) | | `tools/nanoboyadvance/build/arm7tdmi-sst/nba_sst` | the SingleStepTests referee (git-ignored): `nba_sst FILE.json.bin [--dump N] [--seq N]`, agreement as JSON on standard output, details on standard error | | `tools/nanoboyadvance/build/gba/nba_driver` | the GBA driver (git-ignored): `nba_driver ROM --bios BIOS --frames N [--reg NAME] [--png FILE] [--sram FILE] ...` | | `tools/nanoboyadvance/build//build-info.json` | the pin and options of that build | | `tools/nanoboyadvance/tests/smoke.py` | the smoke test | Who runs them: arm7tdmi-python (`scripts/referee_sst.py`, `scripts/referee_icycles.py`; its `scripts/build_referees.py` runs this `build.py`; `tests/hw/thumb_undefined/run_referees.py` runs `nba_driver`) and gba-python (`scripts/referee_run.py --emu nba`; `scripts/build_referees.py --nba` runs this `build.py`), each through `EMU_TOOLS_GPL` (emu-tools `docs/contract.md`, section 5). ## The builds Each keeps its consumer's options, so it is the program the consumer built before: - `arm7tdmi-sst` (from arm7tdmi-python's `build_referees.py`): one `g++ -std=c++20 -O2` compile of `nba_sst.cc` with `-I nba_sst/shim -I /src/nba/src -I /src/nba/include`. - `gba` (from gba-python's `build_referees.py --nba`): `cmake -G Ninja nba_driver -DNBA_ROOT= -DCMAKE_BUILD_TYPE=Release`, then `ninja nba_driver` (NBA's core library and its vendored third-party code; needs libpng's development files). A build already present is kept; nothing is deleted. A half-fetched tree stops `build.py` until it is moved aside. ## What it measures Per-instruction state and per-cycle bus agreement of NBA's ARM7TDMI with the SingleStepTests corpus (`nba_sst`); NBA's GBA pictures, registers and save memory for test ROMs (`nba_driver`). **Every output is OBSERVED** (NanoBoyAdvance at the pin): an emulator observed as a closed box, never a hardware fact; any document or hardware measurement overrules it. ## Upstream, licence and pin - **NanoBoyAdvance** by fleroviux, , **GPL-3.0-or-later**; pinned at `e8482c1efc6cde3f553e8170a51abea71cee426e` (`arm7tdmi-sst`) and `8c3b159c649b027ea8fc87df3290bad4cdcdcf4b` (`gba`). Checked against `emulator-lineage/docs/sources.md` (closed box only). - **The drivers and `build.py`:** ours (alewman), GPL-3.0-or-later. `build.py`'s steps were first published under MIT in arm7tdmi-python and gba-python; that permission is kept for those parts (`../../notices/MIT-emulator-family.txt`). - NBA is not committed here. If a built program is ever shared, NBA's source at the pin, the driver and this folder go with it.