# Methodology How the notes are made, so a claim can be checked without trusting the person who wrote it. ## Evidence tags Every constant, register, memory effect and behaviour carries one of these tags in the mapper page or the audit log: These are this project's own definitions. **NESdev Wiki is the documentation oracle**; its content is public domain. Permissive source files come next, then black-box emulator behaviour. GPL/LGPL source is never read. | Tag | Meaning | | --- | --- | | `MEASURED` | our own capture or measurement from a real console: probe, scope, logic analyser | | `DIE` | derived from die-level analysis or a die model | | `TEST ROM` | a test ROM whose verdict was captured on real hardware; name the test | | `DOC` | a named document or page, with its revision and licence; public-domain or permissive preferred | | `OBSERVED` | another emulator's public behaviour, seen as a black box; name the binary and version | | `FITTED` | chosen because it makes named cases pass; list the cases and the alternatives tried | | `HYPOTHESIS` | a guess; state what would falsify it | A lower tier detects; the highest tier that checks a claim decides it. A fitted value is honest. An untagged claim is not. If the only evidence is "the game boots further," the claim is `FITTED`, not `DOC`. ## Per-mapper coverage A mapper is not one tier. The **claim** is the unit: a page may be `DOC` for one register, BSD for another, `FITTED` for a third and `HYPOTHESIS` for a fourth. Each page carries: - a **source coverage** table: source, licence, what it covers, whether it was used; - a **claim ledger**: claim, value, source and licence, evidence tag, confidence, falsifier or test; - a **coverage summary**: `DOC`, `DOC+BSD`, `OBS`, `FIT`, `MEAS`, with the gaps named. Order of use: 1. NESdev Wiki (public domain). If it answers the claim, stop. 2. A permissive source file (MIT/BSD), read for facts and cited; keep the notice if code is copied. 3. A black-box emulator (GPL/LGPL binary) for behaviour only. `GPL-box` means the tool lives outside this repository; only our observation is written down. 4. Our own ROM trace, labelled `FITTED` or `HYPOTHESIS`. 5. Hardware or a test-ROM verdict, the strongest tier. A lower tier can raise a question; it cannot silently overrule a higher one. Record the conflict. MAME is a sibling reference for obscure pirate boards, not an oracle. ## First: look for the original Before tracing a pirate or unlicensed mapper, check whether the game is a patched copy of something else. Many pirate carts are a licensed game with only its mapper writes rewritten for a cheaper board. 1. Search `NO_INTRO_DIR` for the same title: the licensed release, other pirates, translations, and revisions. Note each one's mapper. 2. Compare PRG and CHR bank by bank against each candidate. If most banks are identical, the differences are the conversion. 3. Read every changed spot next to the original. Each patched store lines up an original register, whose job the licensed mapper's documentation gives, with its pirate replacement. Stores changed to `BIT` are writes the new board does not want. Routines added in the original's `$FF` padding are glue the new board needs. 4. Only then trace or sweep, starting from that map. Mapper 559 is the worked example: *Sangokushi II* (Subor) is Namco's mapper-19 release with 968 bytes changed, and the patches give the register map. Fifteen entries of bank sweeps before that check found pieces of it (audit.md, entries 1-15). The comparison is our own static analysis: label the resulting map `FITTED` once a game runs on it, and `HYPOTHESIS` until then. ## Licence boundary Read [provenance.md](provenance.md) before opening a third-party source. GPL/LGPL is black-box-only: run the binary, never read the source. Permissive and public-domain sources may be cited; keep their notices. An accidental source view is an incident, not a footnote. ## Audit logs An audit log is a chain of custody for claims, not a diary. Each entry records: - date and time (UTC), project version or commit; - environment: emulator commit, Python/PyPy/Rust versions, OS, ROM hash; - the question or hypothesis; - the exact command; - the raw result, including failures and crashes; - interpretation, evidence tag, confidence; - the next experiment, or what would falsify the claim. Rules: - Append; never rewrite an old entry to make the story cleaner. A correction is a new entry that says what was wrong. - Record negative results. "Mapper 330 mapping crashed to `$4010`" is as useful as a working mapping. - Keep raw artifacts small and check them in: text traces, screenshots, hashes. Large traces go in a release or a `.gitignore` directory with a manifest, not silently. - Link every mapper-page claim to an audit entry or an external source. - No post-hoc certainty. If a conclusion was a guess at the time, keep the tag. ## Gates that can fail A gate is a command whose passing is the proof. "The game boots" is a weak gate; a screen can be right for the wrong reason. - Prefer a synthetic test ROM or a scripted register test that exercises each documented register and asserts its effect. - For a real ROM, record a trace hash or screenshot hash and compare it against a named reference; say which reference and which tier. - Break the mapper deliberately and show the gate catches it. A gate that cannot fail proves nothing. - Validate a fitted map on a held-out ROM or dump, not only the ROM used to fit it. - If no test can fail yet, say that; do not call the boot a verification. ## Brute force Brute force is a legitimate way to generate hypotheses. It becomes knowledge only when it is documented and tested. - State the search space, the observable, the fitness function and the cost. - Save the search script and the search log; reject candidates are part of the result. - Label the winner `FITTED` until an independent test or source confirms it. - Check for overfitting: try another dump, another game, or a synthetic case that exercises different registers. ## ROMs and provenance - Never commit ROMs, firmware, or a mirror's private data. Record the No-Intro name, SHA1, header and how to obtain the file through `NO_INTRO_DIR`. - Use environment variables for ROM sets and emulator sources; no machine paths in the repository. - Run `provenance_check` (the family tool) before publishing anything derived from another emulator's source. - Permissive sources may be read and cited; keep the notice with anything copied. GPL sources: run and measure, do not copy code into this MIT project. - Cite external sources in [sources.md](sources.md) with revision and access date. ## AI disclosure This project is AI-assisted. The model is used for exploration, disassembly, code and prose; it is not evidence. The audit log, hashes, commands, traces and independent reproduction are the evidence. Disclose this in the README and in contributions; do not hide it, and do not lead with it instead of the artifact. ## Documents - `STATUS.md` says what is current, what is next, and what is blocked. - A mapper page says what is claimed, with tags and links. - An audit log says how the claim was reached, including the dead ends. - When a claim changes, update the page and the status in the same commit; a stale page is a bug.