# Provenance ## Licence provenance (audit 2026-11-13) Audit of where each piece of the board came from, against the family charter ("Licences and provenance": an MIT project takes nothing copied or transcribed from GPL or LGPL code, and a GPL emulator's source is not opened while writing the code it informs). Judged at `HEAD` from the code's own comments, `docs/`, `scripts/pinned_repos.json`, `scripts/pinned_files.json` and git history. NanoBoyAdvance, Hades, GBA_MiSTer and FuzzARM (GPL) and mGBA (MPL-2.0) were not opened. `provenance_check.py` (pcengine-python) was run against the permissive pinned trees only: `reference/src/SkyEmu` (MIT): no hits; `reference/src/ares` (ISC): no hits; `reference/src/mame` (the sparse GBA files, all BSD-3-Clause): two prose hits (game titles in `tests/smoke_*.txt`), noise. The CPU is arm7tdmi-python and the Game Boy sound channels gb-apu-python (both pinned in `pyproject.toml`); they are audited in their own repositories. ### The finding: the board was written with NanoBoyAdvance's source open NanoBoyAdvance is GPL-3.0. Module after module names the NanoBoyAdvance source file or function whose machinery it follows, for example: - `dma.py:3`: "the machinery is NanoBoyAdvance's ``hw/dma/dma.cpp``" - `irq.py:3`: "the timing is NanoBoyAdvance's ``hw/irq/irq.cpp``" - `timer.py:3`: "the cycle rules are NanoBoyAdvance's ``hw/timer/timer.cpp``" - `scheduler.py:9`: "Ordering follows NanoBoyAdvance's queue (``include/nba/scheduler.hpp``)" - `board.py:119`: "The prefetch buffer (NanoBoyAdvance bus/timing.cpp ...)"; `board.py:210` `Bus::Step`, `:268` `Bus::Prefetch`, `:413` `Bus::Idle`, `:584/596` `WritePRAM`/`WriteVRAM`, `:644` `Bus::ReadVRAM`, `:693` `ReadOpenBus`, `:745` `Core::Run` - `ppu/dot.py:3`: "These run cycle by cycle, as NanoBoyAdvance 1.8.3's ``background.inl`` and ``merge.cpp`` do" - `ppu/compose.py:9`: "The arithmetic follows NanoBoyAdvance's ``merge.cpp``" - `ppu/objects.py:9`: "The step loop below follows NanoBoyAdvance's engine (``sprite.cpp``)"; `:133` quotes a source comment ("VRAM fetch appears to stop at cycle 960") - `ppu/background.py:121` `RenderMode2BG`; `ppu/__init__.py:164` `Bus::Write`, `:417` `DrawWindow` - `apu.py:12-15`: FIFOs "as NanoBoyAdvance models them (``hw/apu/channel/fifo.hpp``, ``apu.cpp``)", the mixer `APU::StepMixer`, `:281` `GetSample` - `cartridge/__init__.py:7,73` `rom.hpp`; `cartridge/backup.py:41,106` `hw/rom/backup/flash.cpp`, `eeprom.cpp`; `cartridge/gpio.py:9` `hw/rom/gpio/rtc.cpp` - `keypad.py:5` `hw/keypad/keypad.cpp`; `io.py:110` `bus/io.cpp`; `serial.py:3` `bus/io.cpp` Naming functions, file paths and a quoted comment means the source was read while this code was written; the module docstrings say they follow its structure. Under the charter that is a breach whatever the hardware tests say afterwards. Two ways out, Aubrey's choice: rewrite those modules clean (from GBATEK, the hardware-calibrated test suites and closed-box runs of NanoBoyAdvance, without its source open), or relicense gba-python GPL-3.0-or-later and honour NanoBoyAdvance in full. | Module | Behaviour source | Source licence | Verdict | | --- | --- | --- | --- | | `scheduler.py` | NBA `scheduler.hpp` | GPL-3.0 | rewrite | | `board.py` (bus step, prefetch buffer, PRAM/VRAM waits, open bus, halt) | NBA `bus/*`, `Core::Run`; GBATEK for the map and wait states | GPL-3.0 | rewrite | | `dma.py` | NBA `hw/dma/dma.cpp`; GBATEK; alyosha-tas tests; GBAHawk `DMA_IRQ_Delay` | GPL-3.0 (BizHawk MIT) | rewrite | | `irq.py` | NBA `hw/irq/irq.cpp`; GBATEK | GPL-3.0 | rewrite | | `timer.py` | NBA `hw/timer/timer.cpp`; GBATEK; hw-test | GPL-3.0 | rewrite | | `ppu/__init__.py`, `ppu/dot.py`, `ppu/compose.py`, `ppu/objects.py`, `ppu/background.py` | NBA 1.8.3 `background.inl`, `merge.cpp`, `sprite.cpp`, `DrawWindow`, `RenderMode2BG`; GBATEK | GPL-3.0 | rewrite | | `apu.py` | NBA `fifo.hpp`, `apu.cpp`, `StepMixer`, `GetSample`, `registers.cpp`; GBATEK | GPL-3.0 | rewrite | | `cartridge/__init__.py` | NBA `rom.hpp` (address latch, EEPROM decode); GBATEK save IDs | GPL-3.0 | rewrite | | `cartridge/backup.py` | NBA `flash.cpp`, `eeprom.cpp` state machines; GBATEK; mGBA's flash IDs as data | GPL-3.0 | rewrite | | `cartridge/gpio.py` | GBATEK RTC; NBA `rtc.cpp` for the bit-order rule | GPL-3.0 (one rule) | rewrite (small) | | `keypad.py`, `io.py`, `serial.py` | GBATEK; NBA `keypad.cpp`, `bus/io.cpp` | GPL-3.0 | rewrite (small) | | `bios.py` | own loader; Cult-of-GBA BIOS (MIT) fetched, never committed; Nintendo's never fetched | MIT | clean | | `console.py`, `trace.py`, `state.py`, `__main__.py`, `frontend.py` | own work; GBATEK register names | MIT / facts | clean | | `testrom.py` | verdict parsers for the suites (mGBA suite and jsmolka MIT, hw-test BSD-3, Hades-Tests) | permissive | clean | | `scripts/nba_driver/driver.cc`, `trace.cc` | drivers linked against NBA's core; `trace.cc` "replays NBA's Core::Run loop (core.cpp)" | GPL-3.0 | cite: a GPL tool (charter rule 6); mark both files `GPL-3.0-or-later` | | `scripts/mgba_driver.c` | own file linked against libmgba | MPL-2.0 is file-level; our file stays MIT | clean | | `scripts/libgba_shim/` | stand-ins so mGBA's `keyirq` builds; libgba register names | facts | clean | | other `scripts/*.py` (fetch, referees, sweeps, diffs) | own tools | MIT | clean | | `tests/hw/dma_stop/` (source, `.gba`, referee PNGs) | own test program; screenshots of it under mGBA and NBA | MIT | clean, except the logo below | | Nintendo logo bytes in `scripts/build_test_roms.py`, `tests/hw/dma_stop/build.py`, `tests/hw/dma_stop/dma_stop.gba` | the 156-byte header logo the BIOS checks | Nintendo copyright/trademark | unclear (policy) | **Unclear (policy):** the Nintendo header logo is embedded so test ROMs boot on the BIOS. Every homebrew toolchain does the same (gbafix), and interoperability use of lockout data is widely treated as permitted, but it is Nintendo's artwork (charter rule 9). Options: fill it at build time from the player's BIOS-checked dump or a game ROM, or accept it explicitly. Verdicts (by table row): clean 7, cite 1, rewrite 11 (17 source modules), unclear 1. ### Facts the docs carry `docs/timing.md`, `docs/undocumented-behavior.md` and `docs/validation.md` mark NanoBoyAdvance results as "emulator-derived" (detector tier). A behaviour measured by running NBA is a closed-box fact and may stay; what must go is code structured after its source. A clean rewrite can keep these documents as its specification, if each row's evidence is a hardware test or a closed-box run rather than a reading of NBA's code. `docs/validation.md` also says GBAHawk's source was read for an idea (rule 2 of the IRQ synchronizer); GBAHawk is part of BizHawk (MIT): cite it, after confirming the GBAHawk files' headers. ### History 36 commits, private. One removed module, `src/gba_python/ppu.py`, the PPU before the split into `ppu/`; it shares the PPU's verdict. No GPL source, BIOS or commercial ROM was ever committed (every path in the history checked; `reference/`, `*.bin`, `*bios*.gba` are ignored). ### Sources | Source | Licence or terms | Family use | | --- | --- | --- | | NanoBoyAdvance (1.8.3) | GPL-3.0 | closed box only (the board's best detector; its source is off limits) | | mGBA | MPL-2.0 (file-level copyleft) | closed box only for code; its suite (MIT) runs freely | | Hades | GPL-2.0 | closed box only | | GBA_MiSTer (VHDL) | GPL-2.0 | closed box only | | FuzzARM ROM generator | GPL-3.0 | run its prebuilt ROMs | | SkyEmu | MIT | code OK (with notice) | | ares | ISC | code OK (with notice) | | MAME GBA files (`gba.cpp`, `gba_lcd.cpp`, `bus/gba/*`, `sound/gb.cpp`) | BSD-3-Clause | code OK (with notice) | | BizHawk / GBAHawk | MIT (confirm file headers) | code OK (with notice) | | GBATEK (Martin Korth) | free to read | facts only | | gbadoc (gbadev-org) | CC0-1.0 | code OK | | Tonc | text CC BY-NC-SA | facts only | | CowBite spec (Tom Happ) | free to read | facts only | | mGBA suite (endrift) | MIT | code OK; test ROM | | jsmolka gba-tests, alyosha-tas gba-tests, destoer gba_tests, GBA-Test-Collection | MIT | code OK; test ROMs | | NBA hw-test | BSD-3-Clause | code OK; hardware results are facts | | Hades-Tests, DUST, ARMWrestler (fixed), mGBA gbatests, PeterLemon GBA | no licence stated | run as test ROMs; facts only | | AGBEEG | see its repository | run as a test ROM | | Cult-of-GBA BIOS | MIT | may be loaded (fetched, not committed) | | Normmatt gba_bios | no licence stated | do not ship; reference only | | Nintendo GBA BIOS | Nintendo copyright | never shipped; player supplies | | Arm GNU toolchain | GPL-3.0 with runtime exception | tool | ### GBAHawk, read 2026-11-12/13 (added by the session that read it) What was read: `libHawk/GBAHawk/GBA_System.cpp`, `GBA_System.h` and `MemoryMap.cpp` of alyosha-tas/GBAHawk (`724ccac`, a BizHawk fork), checked out in a scratch folder outside the repository, for ideas while fitting alyosha-tas's own hardware tests: how its CPU latches the IRQ input at the first cycle of each access, its two-cycle HALT-leave countdown, its DMA pause handling, and its per-memory bus latches (IWRAM, OAM). Nothing was copied or transcribed; the board's code for the rules below was written from the traces and the tests. Two rules now in the board took their idea from it: IRQ rule 2 (the CPU looks at its IRQ input when it begins a bus cycle; quirk 23) and the IWRAM/OAM bus latches of quirk 24 (open bus after a data cycle). The earlier `fifo_dma` work (2026-11-11) read its FIFO and `DMA_IRQ_Delay` code the same way (the `dma.py` row above). Licence, as found: the C++ files carry no header. The repository's `LICENSE` says the BizHawk team's own work and customisations are MIT, but that the embedded C/C++ cores are a mix and that anyone interested in a portion's licence "should contact us or else assume it is a minefield". GBAHawk's core is the BizHawk team's (alyosha-tas's) own work, so MIT is likely, but it is not stated on the files: "cite" stands only if the author confirms it. Until then, treat the two rules above like any idea taken from source of unclear licence.