Expand description
Video Interface (VI) register file.
The VI reads the framebuffer at VI_ORIGIN and scans it out to the DAC,
raising the VI interrupt at the programmed scanline. This module owns the
memory-mapped register block at 0x0440_0000 — sixteen 32-bit registers
the CPU programs — plus the scan-position timing:
- The register latches, with one side effect: writing
VI_V_CURRENTacknowledges (clears) the VI interrupt. Vi::tickadvancesVI_V_CURRENToffmaster_ticks(the fractional VI domain —docs/scheduler.md) and reports aVI_V_INTRcrossing, which the scheduler turns intoMI_INTR.vi.
Not here (elsewhere or deferred): the framebuffer→RGBA scan-out conversion
is Bus::scanout (the live 1:1 path) and Bus::scanout_scaled (the accurate
VI_X_SCALE/VI_Y_SCALE-resampling path being built up slice by slice against
the Angrylion .vivec oracle — ledger R-5); the field cadence is anchored to
nominal 60 Hz NTSC (ledger R-6, PAL later); and the per-register write masks are
not yet applied (ledger R-4). Reference: n64brew_wiki/markdown/Video Interface.md.
Structs§
- Vi
- The Video Interface register file (the
0x0440_0000block).
Constants§
- VI_
BURST VI_BURST(0x14): color-burst timing.- VI_CTRL
VI_CTRL(0x0440_0000): pixel type, AA/serrate/dither config.TYPE == 0turns the VI off (no interrupt is ever generated).- VI_
FIELD_ HZ - Nominal NTSC field rate anchoring the VI scan cadence.
- VI_
FIELD_ HZ_ PAL - Nominal PAL field rate (R-6): PAL’s standard 50 Hz field cadence.
- VI_
H_ TOTAL VI_H_TOTAL(0x1C): total pixels (quarter-precision) per line.- VI_
H_ TOTAL_ LEAP VI_H_TOTAL_LEAP(0x20): line-length modulation for exact frame timing.- VI_
H_ VIDEO VI_H_VIDEO(0x24): active video horizontal start/end.- VI_
ORIGIN VI_ORIGIN(0x04): RDRAM base of the framebuffer being scanned out.- VI_
PAL_ V_ TOTAL_ THRESHOLD - The encoded
VI_V_TOTALregister value above which a field is treated as PAL rather than NTSC. - VI_
REG_ COUNT - Number of 32-bit registers in the VI block.
- VI_
STAGED_ DATA VI_STAGED_DATA(0x3C): RDRAM diagnostic staged data.- VI_
TEST_ ADDR VI_TEST_ADDR(0x38): RDRAM diagnostic access address.- VI_
V_ BURST VI_V_BURST(0x2C): vertical color-burst start/end.- VI_
V_ CURRENT VI_V_CURRENT(0x10): the half-line currently being scanned.- VI_
V_ INTR VI_V_INTR(0x0C): the half-line at which the VI interrupt is raised.- VI_
V_ TOTAL VI_V_TOTAL(0x18): total half-lines per frame; bit 0 selects interlaced/progressiveVI_V_INTRbehavior.- VI_
V_ VIDEO VI_V_VIDEO(0x28): active video vertical start/end.- VI_
WIDTH VI_WIDTH(0x08): framebuffer width in pixels.- VI_
X_ SCALE VI_X_SCALE(0x30): horizontal scale factor (framebuffer → screen).- VI_
Y_ SCALE VI_Y_SCALE(0x34): vertical scale factor.