Commit graph

9 commits

Author SHA1 Message Date
claude
c8de2e42e9 docs(gb): the module header names the corner the cartridge settled 2026-09-22 04:16:48 +00:00
claude
abd3e563a8 gb: refuse a map header that does not fit wOverworldMap
The buffer is ds 1300 and every real map plus its three-block border fits in it.
A header that says otherwise is one read mid-load, and decoding it would read
past the buffer into somebody else s WRAM, so it is a refusal rather than a
clamp.
2026-09-22 04:15:29 +00:00
claude
bcae388d99 gb: re-check a cached grid against the screen when it is served
A warp writes wCurMap before the map header and the block data: on Oak s lab
doormat wCurMap already reads PALLET_TOWN while the header still reads the lab s
ten-by-twelve. The decode agrees with the screen on such a frame -- both are the
old map -- so only the id is wrong, and a grid filed under it would stay wrong
for as long as it was cached. One byte answers it: does the cached grid still
agree with the screen about the tile the fly is standing on.
2026-09-22 04:10:28 +00:00
claude
1b06e6a6cb gb: the collision tile is the lower left of a map tile s quadrant
Measured on the cartridge, not derived: a map tile is 2x2 screen tiles and
CheckTilePassable matches one id, and the screen agrees with the lower-left tile
of the quadrant. Viridian Forest s (4, 32) reads 3, the second row of its
block, where the first row holds bash4. On open ground most quadrants hold one id
four times over, so the upper-left guess reads correctly on a town and falls
apart in a forest -- which is why the decode is cross-checked against the screen
before it is trusted.
2026-09-22 04:10:28 +00:00
claude
f7fa39afa7 macros: plan every walk over the map grid
route and frontier ask for the grid once per plan and fall back to the window
when there is none. With it: one plan crosses a whole map, GO WARP / GO OUT /
GO ROUTE route to their warp or connection tile rather than to the nearest tile
of an edge that reads Unknown, a tile-pair wall is planned around instead of
being learned by walking into it, and the frontier is the nearest unstood
walkable tile anywhere on the map instead of the nearest one on screen.
2026-09-22 03:32:35 +00:00
claude
68228ef2a1 gb: decode the whole current map into a walkability grid
The walkable predicate answered for the ten-by-nine screen window and Unknown
everywhere else. MapGrid is the same rule over every tile of the loaded map:
block ids out of wOverworldMap, a blocks-to-tiles read of the tileset header s
blockset through the new bank-aware ROM read, the tileset s collision list as
before, and the TilePairCollisionsLand values as directed walls both ways.

The reader checks itself before it answers: the decode is compared against the
window predicate over the player s own neighbourhood, and a frame where the
window can answer for none of it -- a battle, a text box, a frame mid-warp -- is
refused, because wOverworldMap shares its bytes with the picture buffer. Every
refusal is named (GridRefusal) and leaves the window predicate in charge.

Cached per map id and size, so a map is decoded once on arrival rather than once
per question, and owned beside the session ledgers: never checkpointed.
2026-09-22 03:32:35 +00:00
claude
d75b7320ea seam: a bank-aware ROM read beside the bus read
MemoryReader::read8 reads the CPU bus, where banks 1 and up are whichever bank
the cartridge last switched to, so a table in another bank could only be read by
writing the mapper register -- and the joypad is the only write this workspace
makes into a running game. read_rom takes a bank and a CPU address and reads the
cartridge image the process already holds instead. Defaulted to None, so every
reader without a cartridge behind it narrows rather than guesses.
2026-09-22 03:32:19 +00:00
claude
320b05ecee symbols: the four WRAM names the whole-map grid reads
resolve_wram.py is a second reading of the disassembly beside gen_symbols.py:
it walks ram/wram.asm with a cursor that is only ever live while anchored on an
address symbols.rs already pins, re-derives 40 of the 63 it carries with no
disagreement, and emits an address only when a pinned one after it agrees too.
wOverworldMap, wCurMapTileset, wTilesetBank and wTilesetBlocksPtr come out of
that pass; no address is hand-written and nothing else in the table moves.
2026-09-22 03:17:20 +00:00
acamilo
660c3cf00d flybrain v0.4.0: public tree (history retained privately)
Some checks failed
ci / node 22 (test + typecheck) (push) Has been cancelled
ci / rust stable (cargo test --workspace --release) (push) Has been cancelled
ci / infra/tests/lint.sh (push) Has been cancelled
ci / playwright apps/stage (allowed to fail) (push) Has been cancelled
2026-09-21 15:09:46 +00:00