unsigned char vdpaddr (unsigned char table, unsigned int addr);

Set a VDP table address. This is a convenience routine for configuring VDP registers 2 - 6. It shifts the address to the correct alignment in the register, and ensures that the LSB are all zero. Note that these checks do not prevent a table from wrapping across the end of VRAM.

Note: To make use of the undocumented enhancements of graphics mode 2 use vdpreg() to set registers 3 & 4.

table =0 - Name table
1 - Colour table
2 - Pattern table
3 - Sprite attributes table
4 - Sprite pattern table
5 - Graphics 2 colour table (addr = 0x0000 or 0x2000)
6 - Graphics 2 pattern table (addr = 0x0000 or 0x2000)
addr =Address for table
Return:0 - Success
1 - Invalid table number
2 - Address > 16K
3 - Invalid LSB

Include file: mtxvdp.h