there are 30 "line registers". they are set via "line ram", which allows choosing different values for each scanline (if you've heard of SNES's HDMA, it's sorta like that)
"Lineram" is a list of per-scanline graphics settings.
Almost everything is controlled by lineram, with the exception of: tile data and global scroll for tilemaps/pivot; extend mode; various video signal settings; the sprite data; and textures of course.
In principle, it's very simple: there are 30 16-bit Line Registers, and each one is read from an array of 256 values (one for each scanline).
The complexity comes from features which let you apply the same settings to many scanlines, without having to write the same data many times (though most games do that anyway).
Lineram has 8 "sections" (traditionally referred to as 4000,5000,...,A000,B000 because that's where every game maps them).
Each section can be mapped to one of 16 possible locations within the $62.... block of graphics ram (though, the first two would interfere with other things).
Each section contains four "subsections" (traditionally named 000,200,400,600).
Each subsection can occur in one of two positions within its section: either at its base address, or that address plus $800
Each subsection contains a list of 256 words, which control some settings on each scanline.
The mapping of sections and subsections, and latching (reusing the same parameters across multiple scanlines) is controlled by the "latches".
at $620000, there is a latch per scanline per section (todo: better language to describe arrays-of-arrays)
Lineram Section Latches
Address ($620000+)
⋯,0,1,0,0,0,0,0,section:3,scanline:8,-
section
section number (0-7)
scanline
scanline number (0-255)
Data
.:2,map:4,.:2,a3,a2,a1,a0,l3,l2,l1,l0
map
section data location: maps this section to address $620000 + $1000*m
an
subsection n: bank (note: only matters if latch is 1)
1
add $800 to the address of this subsection
ln
subsection n: latch
1
read parameter from lineram
0
reuse previous value
(note: the latched value presists across frames. e.g. if 0 on the first scanline)
Line Register Values
Address ($620000+)
⋯,0,1,0,map:4,a,sub:2,scanline:8,-
map
section mapping (from the section's latches) usually at (section + $4)
a
subsection bank (from the section's latches) usually 0
sub
subsection number
scanline
scanline number
most of the data about the line registers themselves is repeated on the relevant pages. we should probably either get rid of the definitions on this page (replace with links to the other pages) or generate them automatically from data in one place
note: section 0 is missing its first 2 subsections (0.0 "4000" and 0.1 "4200"), so per-line y scroll adjust and alternate tilemap are only available on tilemaps 2 and 3.