VDP Table Base Address Registers
This page was last modified 21:52, 17 May 2022 by Aoineko. Based on work by Gdx and Mars2000you.

Contents

Control Register 2

This register determines the base address of the Name Table which constitutes the foreground.

It can be only written. Use the MSX-BASIC instruction VDP(2) to access it. The instruction reads the system variable REG2SAV (0F3E1h) to return the requested value.

Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
R#2: 0 N16 N15 N14 N13 N12 N11 N10 (MSX1/2/2+/Turbo R)

In MSX1 screen and SCREEN 4 modes, N10-N13 bits correspond to the four most significant bits of the address that defines the start of the character table in VRAM. Other bits must be always reseted. The real address is obtained by multiplying the value of these 4 bits by 400h. For example, if the bits are 1001 (09h), the characters table is at 2400h (9 x 400h). Thus the address can vary between 0 and 3C00h.

With 128KB of RAM, 32 different pages can be defined in SCREEN 0 mode (40 columns) and 1, 16 different pages in SCREEN0 mode (80 columns) and 4 in SCREEN 2, 3 and 4 mode.

In other SCREEN modes N10-N14 bits must always be set, and N15-N16 bits determine the page number.

In KANJI screens modes, it will vary according using of Bitmap screen 5 or 7.

Name Table address is returned by the BASIC instruction BASE. Here are the default values:

SCREEN Decimal Hexadecimal
0 0 0000
1-2 6144 1800
3 2048 0800
4 6144 1800
5-8 0 0000
10-12 0 0000


Control Registers 3 and 10

These registers define the base address of the Color Table.

They can be only written. Use the MSX-BASIC instruction VDP(3) and VDP(11) to access it. The instruction reads the system variable REG3SAV (0F3E2h) or REG10SAV (0FFE9h) to return the requested value.

Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
R#3: C13 C12 C11 C10 C9 C8 C7 C6 (MSX1/2/2+/Turbo R)
R#10: 0 0 0 0 0 C16 C15 C14 (MSX2/2+/Turbo R)

In the SCREEN modes 0, 1 and 3, C6-C13 bits define the address of the colors table. The real address in VRAM is obtained by multiplying the register content by 40h. For example if we read 0B6h in register 3, the start address of the color table is 0B6h * 40h = 2D80h. Thus the address can vary between 0 and 3FC0h.

In SCREEN 2 and 4, the operation is different. Only C13 can be changed, the other bits must be always set. Thus, color table can only be found at the address 0000h or 2000h. Register 3 should therefore only contain 7Fh or FFh.

In other SCREEN modes, C6-C16 bits code the address of the color table as on MSX1 (see above). The address can vary between 0 and 1FFC0h

Color Table address is returned by the BASIC instruction BASE. Here are the default values:

SCREEN Decimal Hexadecimal
1-2 8192 2000
4 8192 2000


Control Register 4

This register defines the base address of the Pattern Table.

It can be only written. Use the MSX-BASIC instruction VDP(4) to access it. The instruction reads the system variable REG4SAV (0F3E3h) to return the requested value.

Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
R#4: 0 0 F16 F15 F14 F13 F12 F11 (MSX1/2/2+/Turbo R)

In the SCREEN modes 0, 1 and 3, F11-F13 bits code the 3 most significant bits of the address of the VRAM pattern table. The real address is therefore obtained by multiplying the value of these 3 bits by 800h. For example, if the bits are 100 (04h), the pattern table is located at 2000h (4 x 800h). F14-F16 are ignored. So the address can vary between 0 and 3800h.

In the SCREEN modes 2 and 4, only the F13 bit defines the pattern table address. Thus, it can only start at the address 0000h or 2000h. Consequently, this bit must always be set opposite to bit 7 of register 3 so as not to interfere with the color table. In addition, the VDP performs the logical "AND" operation of the value of F12 and F11 bits on the 2 most significant bits of the graphic character numbers (table of character positions).

In the other SCREEN modes, F11-F16 bits code the 6 most significant bits of the address at the start of the pattern table. The operation is the same as on MSX1 (see above). The address varies between 0 and 1F800h.

Pattern Table address is returned by the BASIC instruction BASE. Here are the default values:

SCREEN Decimal Hexadecimal
0 (width 40) 2048 0800
0 (width 80) 4096 1000
1-4 0 0000


Control Registers 5 and 11

These registers define the address of the Sprite Attribute Table. On the MSX1 VDP, bit 7 of register 5 has always the value 0.

They can be only written. Use the MSX-BASIC instruction VDP(5) and VDP(12) to access it. The instruction reads the system variable REG5SAV (0F3E4h) or REG11SAV (0FFEAh) to return the requested value.

Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
R#5: S14 S13 S12 S11 S10 S9 S8 S7 (MSX1/2/2+/Turbo R)
R#11: 0 0 0 0 0 0 S16 S15 (MSX2/2+/Turbo R)

In SCREEN 1 to 3, S7-S13 bits code the 7 most significant bits of address of the sprites attribute table. The real address is therefore obtained by multiplying the content of register 5 by 80h. For example if we write 0110111 (037h) in register 5, the address of sprites attribute table is 1B80h (037h x 80h). S14 bit is ignored. The address can therefore only be between 0 and 3F80h.

In SCREEN 4 to 6, the S7-S8 bits are always considered 0 and S9 must be always set. The address is also obtained by the formula (value of S7-S16) x 80h.

In SCREEN 7, 8, 10 to 12, S7-S14 are used with S15-S16 of the VDP register 11. These 10 bits code the address of the start of the attribute table of Sprites as on MSX1 (see above). The address can vary between 0 and 1FF80h. Please note, S7 and S8 are ignored and S9 must always be 1.

Sprite Attribute Table address is returned by the BASIC instruction BASE. Here are the default values:

SCREEN Decimal Hexadecimal
1-3 6912 1B00
4 7680 1E00
5-6 30208 7600
7-8 64000 FA00
10-12 64000 FA00


Control Register 6

This register defines the address of the Sprite Pattern Table.

It can be only written. Use the MSX-BASIC instruction VDP(6) to access it. The instruction reads the system variable REG6SAV (0F3E5h) to return the requested value.

Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
R#6: 0 0 P16 P15 P14 P13 P12 P11 (MSX1/2/2+/Turbo R)

In MSX1 screen modes, P11-P13 encode the 3 most significant bits of the address of the Sprite Pattern in VRAM. Other bits must be reseted. The real address is obtained by multiplying the value of these 3 bits by 800h. Therefore, to put the Sprite Pattern at the address 2000h, divide 2000h by 800h and write the result in this register. The address can only vary between 0 and 3800h.

In other screen modes, P11-P16 code the 6 most significant bits of the Sprite Pattern address. The real address is obtained by multiplying the value of this register by 800h. The address varies between 0 and 1F800h.

Sprite Pattern Table address is returned by the BASIC instruction BASE. Here are the default values:

SCREEN Decimal Hexadecimal
1-4 14336 3800
5-6 30720 7800
7-8 61440 F000
10-12 61440 F000