# Loader: Mines 2 (Demo) gets bank-0 block 2048 from an LNX header that contradicts its size **Status: closed 2026-11-19** (fixed in lynx-python, carried to lynx-rust). See "Resolution" at the end. Found by the 2026-11-19 library sweep (lynx-rust `docs/sweep-2026-11-19.md`). Board (loader) behaviour, not a transcription fault: lynx-rust and this repository at `bc5f35e` produce the same trace (lockstep, 2,700 slices). ## What happens `Mines 2 (World) (Demo) (Unl)` is in two licensed sets: `(LNX)` (with a header) and `(LYX)` (headerless). Both payloads are 262,144 bytes, SHA-1 `5b3e7fb9b4e711b94a4debeb0534db87e8077aa2`. $ lynx-cart info ".../Atari - Atari Lynx (LYX)/Mines 2 (World) (Demo) (Unl).zip" bank0_block 2048 (table:lnx-header) warning bank0_block: table:lnx-header says 2048 but the payload is 262144 bytes (the size rule says 1024): fewer or more than 256 pages The loader takes 2048 (the LNX header's value, recorded in the cart table for this payload) over the size rule's 1024, for the headerless LYX file too. With 2048 the boot ROM's loader runs but the picture stays black for all 2,700 slices (45 s) on both boards; the CPU keeps running (38 distinct slice-end PCs over the last 300 slices) and display frames advance. With an override of 1024 (`lynx-cart override CART --block 1024`, in a scratch `XDG_DATA_HOME`, a diagnostic only) the game runs: a playfield with mines, a timer at 01:41 and "written 11.95 42Bastian Schick" by slice 1,200 (looked at, own judgement). OBSERVED (MAME 0.285, closed box, `lynx -bios a`, 20 s, no input): the `.lnx` (header 2048) stays black; the `.lyx` (no header, so MAME has only the size) shows the same playfield. So the LNX header itself looks wrong for this dump, and our loader carries the wrong value over to the headerless file, where MAME does not. ## Repro lynx-rust/scripts/lockstep.py --cases scripts/sweep-cases.tsv --only 'Mines 2' target/release/lynx-sweep ".../(LYX)/Mines 2 (World) (Demo) (Unl).zip" --slices 1200 docs/cartridge.md ("Dumps that break the size rule") already names this payload and Zaku (Beta) as the two whose LNX headers say 2048 against the size rule's 1024, and says "the correct value is whichever lets the loader find its directory; the build session settles it by booting both ways". Booted both ways: 1024 for Mines 2. (Zaku (Beta) already gets 1024 from MAME's software list, which outranks its header, and reaches its stage select.) ## For the decision (not fixed here) The loader already records `bank0_alternatives` ("to try if the table's fails") and warns about the contradiction. Options: let the size rule win when a header's block size gives other than 256 pages; or keep the header and try the alternative when the boot ROM's loader does not hand over; or a table entry for this payload. Evidence for the size rule: DOC (cart sizes are 256 pages of the block size, docs/cartridge.md) plus the OBSERVED run above. ## Resolution (2026-11-19) The first option, as docs/cartridge.md prescribes: in `cart/loader.py` a block size that comes from a header (read from the file, `header`, or recorded in the table from our own LNX headers, `table:lnx-header`) and gives other than 256 pages of a full-size payload (64/128/256/512 KiB) now ranks below the size rule; it is kept in `bank0_alternatives` with a warning naming both values. A curated table entry (`table:softlist`) and the user's override keep their places. Evidence: DOC (256 pages of the block size) plus OBSERVED (MAME 0.285, above) plus booting both ways on this board. Across every local image (No-Intro sets, the retrobat and headered folders) only Mines 2 changes (Alpine Games, softlist 1024 on a 512 KiB payload, is untouched). Side effect: Mines 2's LNX -> LYX -> LNX round trip (M0) now writes 1024 in the rebuilt header, so it is no longer byte-identical (19 of 20 expected when M0 is next run). Test: `tests/test_cart.py::test_header_block_that_breaks_the_size_rule_loses_to_it` (it replaces `test_header_fewer_pages_than_the_rule_is_reported`, which asserted the old behaviour). Smoke: Mines 2 from `(LNX)` and from `(LYX)` both show the playfield (mines, the 01:41 timer, "written 11.95 42Bastian Schick") at 600, 1,200 and 2,700 frames.