# Open-source system archives (vendored)

Four replacement system archives, as Azahar ships them, for the files a real console has in its NAND and
this port cannot read from a player's dump. They are what `archive_ncch.cpp` serves when the game opens
the system archive of the Mii data, the country list, the shared fonts or the bad-word list
(`native/src/services/fs`).

Nothing here comes from a console or from a game: the bytes are the open-source replacements that
Azahar's `externals/open_source_archives` contains.

## Where the bytes come from

- Azahar, `externals/open_source_archives/include/{bad_word_list,country_list,mii,shared_font}.app.romfs.h`
  at the commit pinned in `port/azahar/COMMIT` (`5f3306d13cab40bbd5cf38f2cf3ae8b6e6eedca6`). Those headers are
  C byte arrays; their `Readme.md` says they "were generated by https://github.com/B3n30/citra_system_archives
  at git commit 0baa5f5773432f04e3e671859780ded965c4248c".
- `make_archives.py` turns each array into the same bytes as a plain binary file, `data/<name>.dat`
  (shared font 6.8 MB as a header, 1.1 MB as binary). It is deterministic; `MANIFEST.txt` records the size,
  CRC-32 and SHA-256 of each result and the SHA-256 of the header it came from, and `--check` verifies the
  files against the headers:

      python3 native/third_party/open_source_archives/make_archives.py \
          <azahar>/externals/open_source_archives/include --check

- The build embeds the `.dat` files with `native/src/services/fs/embed_archive.cmake`.

| File | Bytes | What | Built from |
|---|---|---|---|
| `data/bad_word_list.dat` | 1508 | the NG bad-word list (`0004 00DB 0001 0302`), placeholder lists | the 17 placeholder list files of citra_system_archives |
| `data/country_list.dat` | 219040 | the country list (`0004 009B 0001 0402`) | citra_system_archives `country_list` |
| `data/mii.dat` | 73600 | the Mii data (`0004 009B 0001 0202`) | citra_system_archives `mii` (its own artwork) |
| `data/shared_font.dat` | 1110016 | the shared font (`0004 009B 0001 4002`, also used for the CHN, KOR and TWN ids) | Montserrat Regular 4.000 and Unifont 10.0.05, converted to the console's font format |

## Licences

The licence check read the upstream repository (B3n30/citra_system_archives, the
pinned commit is an ancestor of its head and holds the same two fonts) and Azahar's sources:

- **citra_system_archives**, its scripts and committed data (the country list, the Mii artwork "custom", the
  bad-word-list placeholders, `bcfnt`, `create_png` and the RomFS tooling): "Copyright 2018/2019 Weiyi Wang,
  Licensed under GPLv2 or any later version", with a GPLv2 `license.txt`. `common/lz.py` and `lz_compress.py`
  are MIT (Copyright (C) magical). They are build tools of the archives, not part of the bytes.
- **Montserrat-Regular.otf** (4.000), in the shared font: its name table says "Copyright 2011 - 2016 The
  Montserrat Project Authors ... licensed under the SIL Open Font License, Version 1.1" (no Reserved Font
  Name statement). The glyphs stay under the **SIL OFL 1.1**.
- **unifont-10.0.05.ttf**, in the shared font: its name table says "Copyright (C) 1998-2017 Roman Czyborra,
  Paul Hardy, Qianqian Fang, Andrew Miller, et al. Licensed under the GNU General Public License; either
  version 2, or (at your option) a later version, with the GNU Font Embedding Exception." The glyphs stay under
  **GPL-2.0-or-later with the GNU Font Embedding Exception**.
- **Azahar** names no licence for `externals/open_source_archives` (its `Readme.md` has none and the
  generated headers carry only a `Git Hash:` line); the sources of Azahar that use the archives say "GPLv2 or
  any later version" or "GPLv3 or any later version".

So the archives are GPL-2.0-or-later (the generated wrappers and data), OFL-1.1 (the Montserrat glyphs) and
GPL-2.0-or-later with the font exception (the Unifont glyphs): all compatible with this repository's
GPL-3.0-or-later. A release package must ship the OFL text and the copyright notices above with the shared
font (the OFL asks for them whenever the font is redistributed, also inside a program).
