VDP Access Registers
This page was last modified 02:14, 6 December 2016 by Mars2000you.

WIP

Contents

Control Register 14

This control register is available on the MSX2/2+ VDP and can be read/written with the MSX-BASIC instruction VDP(), using the value 15. Ths register is used to indirectly access the VRAM, especially the addresses higher than 3FFF in hexadecimal.

Value of bits 7 to 3 is always 0. You need to write in bits 2 to 0 the three senior bits of the VRAM address that interests you. These bits are known as the A16, the A15 and A14 bits. The MSX2/2+ VDP can indeed logically address 128kB (00000-1FFFF) through 16 address bits.

In all modes, except the four MSX1 screens, if there's a carry flag from A13 the value in this register is automatically incremented.

The complete procedure to access the VRAM is as following:

1 - Eventually switch back to normal 128kB VRAM if your application uses the 64kB expansion VRAM to read/write data (see Control Register 45)
2 - Set the address counter A16 to A14 by writing these bits in register 14 (this step is not required if the VRAM size is 16kB)
3 - Set the low-order 8 bits A7 to A0 by writing data to VDP port #1 (99 in hexadecimal)
4 - Set the remaining 6 bits A13 to A8 of the address counter to VDP port #1 (99 in hexadecimal) and specify in bit 6 of this port which memory operation will follow (0=data read, 1=data write)
5 - Read or write data from/to VRAM by using the VDP port #0 (98 in hexadecimal) - note that after every data read or write operation from this port address counter is being incremented

Control Register 15

This control register is available on the MSX2/2+ VDP and can be read/written with the MSX-BASIC instruction VDP(), using the value 16. Ths register is used to indirectly access a specific VDP Status Register (0 to 9) and read it.

Value of bits 7 to 4 is always 0. You need to write in bits 3 to 0 the number of the status register to be read.

The complete procedure to access a VDP Status Register is explained on the page about the VDP Status Registers.

Control Register 16

This control register is available on the MSX2/2+ VDP and can be read/written with the MSX-BASIC instruction VDP(), using the value 17. Ths register is used to indirectly access a specific VDP Color Palette Register (0 to 15) and write it.

Value of bits 7 to 4 is always 0. You need to write in bits 3 to 0 the number of the color palette register to be modified.

The complete procedure to access a VDP Color Palette Register is explained on the page about the VDP Color Palette Registers.

Control Register 17

This control register is available on the MSX2/2+ VDP and can be read/written with the MSX-BASIC instruction VDP(), using the value 18. Ths register is used to indirectly access another specific VDP Control Register and write it.

Bit Code Meaning Values
7 AII Auto-increment flag * Value 1 to disable auto-increment of the data in this register
* Value 0 to enable auto-increment of the data in this register
6 Always value 0
5 to 0 RS5 to RS0 Number of the control register * This number must be different from 17
* List of other control registers: 0 to 23 and 32 to 46 on MSX2 and higher, 25 to 27 on MSX2+ and higher,


The complete procedure to access only one VDP Control Register is as following:

1 - Set a number in Control Register 17 corresponding to the binary value resulting from value 1 in bit 7, value 0 in bit 0 and the number of the control register in the other bits
2 - Write the data on the control register via VDP port #3 (9B in hexadecimal)

If you want to automatically write data on successive control registers, the procedure is slightly different:

1 - Set a number in Control Register 17 corresponding to the binary value resulting from value 0 in bit 7, value 0 in bit 0 and the number of the first control register in the other bits
2 - Write the data via VDP port #3 (9B in hexadecimal) on the first control register specified in step 1
3 - As the auto-increment is enabled, your next write of data via VDP port #3 will be made on the next control register