Skip to main content

Module vi

Module vi 

Source
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_CURRENT acknowledges (clears) the VI interrupt.
  • Vi::tick advances VI_V_CURRENT off master_ticks (the fractional VI domain — docs/scheduler.md) and reports a VI_V_INTR crossing, which the scheduler turns into MI_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_0000 block).

Constants§

VI_BURST
VI_BURST (0x14): color-burst timing.
VI_CTRL
VI_CTRL (0x0440_0000): pixel type, AA/serrate/dither config. TYPE == 0 turns 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_TOTAL register 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/progressive VI_V_INTR behavior.
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.