Conversation
…view
The format pages describe bytes with a table, which is right when you are
implementing a reader and wrong when the question is "what is this file mostly
made of?" — a table gives a 4-byte field and a 4-megabyte payload the same row.
So the same region list now renders two ways behind a Table/Block switch: the
offset table as before, or blocks drawn to scale from byte 0 at the top left,
one row worth 64 B or 64 KB or 1 MB as the file's own scale asks, hover for what
a stretch of bytes is for.
<ByteMap> is the one component this doc set needs that markdown cannot express,
so docs/.vitepress/theme/ exists now. Struct layouts are hand-authored beside it
(the 1024-byte file header, a container record, a flat record); whole-file maps
are generated by tools/blockmap.ts, which opens a real file with the real reader
and walks it — SET (both engines), STG/FLT, MOV (both), TRK/SFX/11K, SND, SHP,
PUP, CST, BOOTFILE and both save formats. What the walk misses is sniffed: an
audio chunk, a script and a picture each announce themselves. The maps are
committed because the game data is not in this repository, and what they carry
is offsets and roles, never content.
The walk also records WHICH CONTAINER NAMED WHICH, so a map carries the file's
pointer graph and hovering a table rings every container it addresses. The
pointer itself is four bytes inside somebody else's payload — invisible at file
scale — so the map draws the relation between the two containers instead.
Three things fell out of building it:
- the containers a SET walk cannot name are not random. They are equal-sized
pairs plus one singleton: one pair per scene AND per road, on every set
checked, from wireless (1 scene) to hallf2c (14 scenes, 13 roads).
- a BOOTFILE has no pointer graph at all. Its handlers are reached by name
through the resolution chain, so nothing in the file points at anything
else in it — which is what "standard library" means in bytes.
- v1Index's `banks` is a count, not a container index, and the first draft of
the save annotator read it as one.
Also corrects a stale claim the maps made me re-read: set.md and
set-v1-to-v4.ts still said Dust's field of view was "unmeasured" and that the
viewer takes max(w, h)/2 for every set. It was recovered from DF.EXE (310, at
0x4331e5 / 0x433418, read by the projection at 0x433c60) and v1 sets have
carried it since; max(w, h)/2 is the v4 default only.
Colours are the data-viz palette's first three categorical slots, which are the
ones that clear the all-pairs CVD and normal-vision gates in both light and
dark — a byte map is all-pairs by construction, because reading one means
matching a block against every legend swatch. Audio inside "pictures & sound"
gets a hatch rather than a fourth hue.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every format page describes bytes with a table. That is the right shape when you are implementing a reader and the wrong one when the question is what is this file mostly made of? — a table gives a 4-byte field and a 4-megabyte payload the same row.
So the same region list now renders two ways behind a Table / Block switch: the offset table as before, or blocks drawn to scale from byte 0 at the top left, one row worth 64 B or 64 KB or 1 MB as the file's own scale asks. Hover a block for what that stretch of bytes is for.
What is here
docs/.vitepress/theme/— a custom theme, for the one component markdown cannot express.withMermaidis unaffected: it patches VitePress's client entry, not the theme.bytemap/layouts.ts): the 1024-byte file header, a container record, an STG flat record.tools/blockmap.ts: it opens a real file with the real reader and walks it — SET (both engines), STG/FLT, MOV (both), TRK/SFX/11K, SND, SHP, PUP, CST, BOOTFILE, both save formats. What the walk misses is sniffed; an audio chunk, a script and a picture each announce themselves. Coverage runs 100% on most (extra.cst332/333,cuff.shp62/62, both saves complete) and is honest where it is not.Pointers between containers
The walk records which container named which, so a map carries the file's pointer graph: hovering a table rings every container it addresses. The pointer itself is four bytes inside somebody else's payload — invisible at file scale — so the map draws the relation between the two containers instead, which is the same fact at a size you can hover.
Three things that fell out of building it
wireless(1 scene) throughhallf2c(14 scenes, 13 roads). Documented on the formats index as the open question it is.v1Index'sbanksis a count, not a container index, and the first draft of the save annotator read it as one.Also
Corrects a stale claim the maps made me re-read:
set.mdandset-v1-to-v4.tsstill said Dust's field of view was "unmeasured" and that the viewer takesmax(w, h) / 2for every set. It was recovered from DF.EXE — 310, written at0x4331e5/0x433418, read by the projection at0x433c60— and v1 sets have carried it since;max(w, h) / 2is the v4 default only.Colours are the first three categorical slots of the data-viz palette, the ones that clear the all-pairs CVD and normal-vision gates in both light and dark (a byte map is all-pairs by construction: reading one means matching a block against every legend swatch). Audio inside "pictures & sound" gets a hatch rather than a fourth hue.
Checks
tsc --noEmitclean ·npm test534/534 ·npm run docs:buildclean · looked at every map in light, dark, table view and at 390 px.🤖 Generated with Claude Code