Register Reference
The five address pins select a register by offset. Offset 0x00 means
A4-A0 = 00000; offset 0x1F means A4-A0 = 11111. No absolute host
address is implied anywhere in this chapter.
Quick map
Offset |
Name |
Access |
Purpose |
|---|---|---|---|
|
|
R/W |
Selected VRAM pointer, bits 7:0 |
|
|
R/W |
Selected VRAM pointer, bits 15:8 |
|
|
R/W |
Pointer increment, direction, and address bit 16 |
|
|
R/W |
VRAM data port 0 |
|
|
R/W |
VRAM data port 1 |
|
|
R/W |
Reconfigure, display bank, and pointer selection |
|
|
R/W |
Interrupt enables and line/scanline bit 8 |
|
|
R/W1C |
Interrupt status and collision groups |
|
|
W/R |
Interrupt line on write; current scanline on read |
|
Display-controller bank |
R/W |
Meaning selected by |
|
Layer 0 |
R/W |
Mode, memory bases, and scrolling |
|
Layer 1 |
R/W |
Mode, memory bases, and scrolling |
|
PCM audio |
Mixed |
FIFO control, sample rate, and data |
|
SPI |
R/W |
Transfer data and controller state |
VRAM pointers and data ports
VERA has two independent 17-bit VRAM pointers. CTRL.ADDRSEL selects which
pointer is visible in ADDRx_L, ADDRx_M, and ADDRx_H. DATA0
always uses pointer 0 and DATA1 always uses pointer 1, regardless of
ADDRSEL.
ADDRx_H has this format:
Bits |
Field |
Meaning |
|---|---|---|
7:4 |
|
Increment code applied after each data-port access |
3 |
|
|
2:1 |
Reserved |
Write zero; reads return zero |
0 |
|
Most-significant bit of the selected VRAM address |
Code |
Bytes |
Code |
Bytes |
|---|---|---|---|
|
0 |
|
128 |
|
1 |
|
256 |
|
2 |
|
512 |
|
4 |
|
40 |
|
8 |
|
80 |
|
16 |
|
160 |
|
32 |
|
320 |
|
64 |
|
640 |
The 40, 80, 160, 320, and 640-byte steps are convenient for column-wise access to common row widths. See Working with VRAM for transfer examples and read prefetch behavior.
Control register
Bits |
Field |
Meaning |
|---|---|---|
7 |
|
Write |
6:1 |
|
Select the meaning of display registers |
0 |
|
Select pointer 0 or pointer 1 for |
Preserve ADDRSEL when changing DCSEL if another routine may be using a
VRAM pointer. Reconfiguration resets the control state and reloads the default
palette.
Interrupt enable
Bit |
Field |
Meaning |
|---|---|---|
7 |
|
High bit of the programmed raster interrupt line |
6 |
|
Read-only high bit of the current scanline |
5:4 |
Reserved |
Write zero; reads return zero |
3 |
|
Enable audio FIFO-low interrupt |
2 |
|
Enable sprite-collision interrupt |
1 |
|
Enable programmed-line interrupt |
0 |
|
Enable vertical-sync interrupt |
Write the low eight bits of the requested line to offset 0x08 and bit 8 to
IEN[7] before enabling LINE. Reading offset 0x08 returns the low
eight bits of the current scanline; IEN[6] supplies its bit 8.
Interrupt status
Bits |
Field |
Meaning |
|---|---|---|
7:4 |
|
Read-only OR of colliding sprite-group masks |
3 |
|
Live indication that the PCM FIFO is less than one-quarter full |
2 |
|
Latched sprite-collision event |
1 |
|
Latched programmed-line event |
0 |
|
Latched vertical-sync event |
Write a one to bits 2, 1, or 0 to clear that latched event. Writing zero leaves
it unchanged. AFLOW clears only after sufficient PCM data has been added.
Display-controller banks
Offsets 0x09-0x0C are banked. Select a bank by writing DCSEL in
CTRL.
Bank 0: output and scaling
Offset |
Name |
Fields |
|---|---|---|
|
|
|
|
|
Horizontal fractional scale; 128 is 1:1 and 64 is 2x |
|
|
Vertical fractional scale; 128 is 1:1 and 64 is 2x |
|
|
Palette index used outside the active area |
Output modes are 0 disabled, 1 VGA, 2 composite/S-video, and 3
15 kHz RGB with composite sync. CHROMA_DISABLE suppresses chroma on the
analog encoded outputs. Bit 3 is reserved in the maintained firmware and must
be written as zero.
Bank 1: active area
Offset |
Name |
Meaning |
|---|---|---|
|
|
Active-area start X, bits 9:2; multiply the byte by 4 |
|
|
Active-area stop X, bits 9:2; multiply the byte by 4 |
|
|
Active-area start Y, bits 8:1; multiply the byte by 2 |
|
|
Active-area stop Y, bits 8:1; multiply the byte by 2 |
Coordinates use the native 640 x 480 display space. A full active area is
HSTART=0, HSTOP=160, VSTART=0, and VSTOP=240 as register
values, representing coordinates 0, 640, 0, and 480 respectively.
Banks 60-63: ecosystem identifier
Select DCSEL 60, 61, 62, and 63 in order and read offsets 0x09 through
0x0C from each bank. Concatenate the resulting 16 bytes and stop at the
first NUL byte. The result is an ASCII identifier derived from the repository
VERSION file, for example VERA v0.1.0.
Writes to offsets 0x09-0x0C are ignored in these banks. Other unimplemented
banks read as zero and ignore writes.
Layer registers
Layer 0 occupies offsets 0x0D-0x13; layer 1 has the identical layout at
0x14-0x1A.
L0 / L1 |
Name |
Meaning |
|---|---|---|
|
|
|
|
|
Map address bits 16:9; base is aligned to 512 bytes |
|
|
|
|
|
Horizontal scroll bits 7:0 |
|
|
Horizontal scroll bits 11:8 in the low nibble |
|
|
Vertical scroll bits 7:0 |
|
|
Vertical scroll bits 11:8 in the low nibble |
Color-depth codes 0-3 select 1, 2, 4, or 8 bits per pixel. Map width and
height codes 0-3 select 32, 64, 128, or 256 tiles. Tile width and height
bits select 8 pixels when clear and 16 pixels when set. See Graphics Programming
for the mode-dependent meaning of the attribute and scroll fields.
PCM audio registers
Offset |
Name |
Fields |
|---|---|---|
|
|
Read: |
|
|
Playback rate, |
|
|
Write-only byte stream into the 4 KiB FIFO; reads return zero |
Writes made while the full flag is set are ignored. Audio and Storage describes sample formats, rates, and a reliable startup sequence.
SPI registers
Offset |
Name |
Fields |
|---|---|---|
|
|
Write starts an 8-bit transfer; read returns the last received byte |
|
|
|
Writing SELECT=1 asserts the card’s active-low chip select. Writing
SELECT=0 releases it. The fast clock is 12.5 MHz; the slow initialization
clock is approximately 390 kHz. With auto-transmit enabled, reading
SPI_DATA returns the previous receive byte and immediately begins another
transfer sending 0xFF.