Functions
VDP_CommandHMMC_Arg
inline void VDP_CommandHMMC_Arg(
const u8* addr,
u16 dx,
u16 dy,
u16 nx,
u16 ny,
u8 arg
)

High speed move CPU to VRAM. [MSX2/2+/TR]

VDP_CommandHMMC
inline void VDP_CommandHMMC(
const u8* addr,
u16 dx,
u16 dy,
u16 nx,
u16 ny
)

High speed move CPU to VRAM. [MSX2/2+/TR]

Parameters
addr
const u8*

Address of the source data

dx
u16

X coordinate of the destination area (must be multiple of 2 in GM4 and GM6 mode, and multiple of 4 in GM5)

dy
u16

Y coordinate of the destination area

nx
u16

Width of the destinatio area (same limitation as DX)

ny
u16

Height of the destination area

VDP_CommandYMMM
inline void VDP_CommandYMMM(
u16 sy,
u16 dx,
u16 dy,
u16 ny,
u8 dir
)

High speed move VRAM to VRAM, Y coordinate only. [MSX2/2+/TR] This function copies data from the coordinates (dx, sy)-(255, sy+ny) to (dx, dy)-(255,dy+ny).

Parameters
sy
u16

Y coordinate of the source area

dx
u16

X coordinate of the destination area (must be multiple of 2 in GM4 and GM6 mode, and multiple of 4 in GM5)

dy
u16

Y coordinate of the destination area

ny
u16

Height of the area to move

dir
u8

Direction of the move from the destination: 0 when sy < dy 1 when sy > dy

VDP_CommandHMMM_Arg
inline void VDP_CommandHMMM_Arg(
u16 sx,
u16 sy,
u16 dx,
u16 dy,
u16 nx,
u16 ny,
u8 arg
)

High speed move VRAM to VRAM. [MSX2/2+/TR]

This function copies rectangular sections from VRAM to VRAM.

By default, the copy is done from (sx,sy)-(sx+nx,sy+ny) to (dx,dy)-(dx+nx,dy+ny), that is, left to right and top to bottom. However, this order can be changed by specifying values in the argument register parameter (see below).  Also, this function by default copies data from and to the standard MSX2/2+/TR VRAM addresses, that is, below 128kb. To deal with addresses above that (in the rare case of a MSX with 192kb VRAM), there is an argument register value for that too.

Parameters
sx
u16

X coordinate of the source area (must be multiple of 2 in GM4 and GM6 mode, and multiple of 4 in GM5)

sy
u16

Y coordinate of the source area

dx
u16

X coordinate of the destination area (same limitation as SX)

dy
u16

Y coordinate of the destination area

nx
u16

Width of the area (same limitation as SX)

ny
u16

Height of the area

arg
u8

Argument register: VDP_ARG_DIY_DOWN (0) copies from line sy to line sy + ny

VDP_ARG_DIY_UP (4) copies from line sy

ny to line sy VDP_ARG_DIX_RIGHT (0) copies from column sx to sx + nx

VDP_ARG_DIX_LEFT (8) copies from column sx

nx to sx 16  copies from extended VRAM (between 128kb and 192kb) 32  copies to extended VRAM (between 128kb and 192kb)

VDP_CommandHMMM
inline void VDP_CommandHMMM(
u16 sx,
u16 sy,
u16 dx,
u16 dy,
u16 nx,
u16 ny
)

High speed move VRAM to VRAM. [MSX2/2+/TR]

This function copies data from the coordinates (sx, sy)-(sx+nx, sy+ny) to (dx, dy)-(dx+nx,dy+ny).

Parameters
sx
u16

X coordinate of the source area (must be multiple of 2 in GM4 and GM6 mode, and multiple of 4 in GM5)

sy
u16

Y coordinate of the source area

dx
u16

X coordinate of the destination area (same limitation as SX)

dy
u16

Y coordinate of the destination area

nx
u16

Width of the area (same limitation as SX)

ny
u16

Height of the area

VDP_CommandHMMV_Arg
inline void VDP_CommandHMMV_Arg(
u16 dx,
u16 dy,
u16 nx,
u16 ny,
u8 col,
u8 arg
)

High speed move VDP to VRAM. [MSX2/2+/TR]

This function fills a retangular area with the byte col (bear in mind the bit depth of the mode you're using).

By default, the filling is done from (sx,sy)-(sx+nx,sy+ny) to (dx,dy)-(dx+nx,dy+ny), that is, left to right and top to bottom. However, this order can be changed by specifying values in the argument register parameter (see below).  Also, this function by default filling data inside standard MSX2/2+/TR VRAM addresses, that is, below 128kb. To deal with addresses above that (in the rare case of a MSX with 192kb VRAM), there is an argument register value for that too;

Parameters
sx

X coordinate of the source area (must be multiple of 2 in GM4 and GM6 mode, and multiple of 4 in GM5)

sy

Y coordinate of the source area

dx
u16

X coordinate of the destination area (same limitation as SX)

dy
u16

Y coordinate of the destination area

nx
u16

Width of the area (same limitation as SX)

ny
u16

Height of the area

col
u8

Byte to fill the area

arg
u8

Argument register: VDP_ARG_DIY_DOWN (0) fills from line sy to line sy + ny

VDP_ARG_DIY_UP (4) fills from line sy

ny to line sy VDP_ARG_DIX_RIGHT (0) fills from column sx to sx + nx

VDP_ARG_DIX_LEFT (8) fills from column sx

nx to sx 16  fills extended VRAM (between 128kb and 192kb)

VDP_CommandHMMV
inline void VDP_CommandHMMV(
u16 dx,
u16 dy,
u16 nx,
u16 ny,
u8 col
)

High speed move VDP to VRAM. [MSX2/2+/TR]

This function fills a retangular area (dx,dy)-(dx+nx,dy+ny) with the byte col (bear in mind the bit depth of the mode you're using), from left to right, top to bottom.

Parameters
dx
u16

X coordinate of the destination area (must be multiple of 2 in GM4 and GM6 mode, and multiple of 4 in GM5)

dy
u16

Y coordinate of the destination area

nx
u16

Width of the area (same limitation as DX)

ny
u16

Height of the area

col
u8

Color data

VDP_CommandLMMC_Arg
inline void VDP_CommandLMMC_Arg(
const u8* addr,
u16 dx,
u16 dy,
u16 nx,
u16 ny,
u8 op,
u8 arg
)

Logical move CPU to VRAM. [MSX2/2+/TR]

VDP_CommandLMMC
inline void VDP_CommandLMMC(
const u8* addr,
u16 dx,
u16 dy,
u16 nx,
u16 ny,
u8 op
)

Logical move CPU to VRAM. [MSX2/2+/TR]

Parameters
addr
const u8*

Address of the source data

dx
u16

X coordinate of the destination area

dy
u16

Y coordinate of the destination area

nx
u16

Width of the area

ny
u16

Height of the area

op
u8

Color blend operation

VDP_CommandLMCM
inline void VDP_CommandLMCM()

Logical move VRAM to CPU (not implemented). [MSX2/2+/TR]

VDP_CommandLMMM_Arg
inline void VDP_CommandLMMM_Arg(
u16 sx,
u16 sy,
u16 dx,
u16 dy,
u16 nx,
u16 ny,
u8 op,
u8 arg
)

Logical move VRAM to VRAM. [MSX2/2+/TR]

VDP_CommandLMMM
inline void VDP_CommandLMMM(
u16 sx,
u16 sy,
u16 dx,
u16 dy,
u16 nx,
u16 ny,
u8 op
)

Logical move VRAM to VRAM. [MSX2/2+/TR]

This function copies rectangular sections from VRAM to VRAM, applying a logical operator between the value on source and the value on destination.

Specifying AND operation means that the final pixel will be the source pixel AND the destination pixel.  Same goes for OR and XOR.

NOT disregards the pixel at destination, and copies a negated pixel from the source.

All logic operators preceded by a "T" (TAND, TOR, TXOR, TNOT) behaves as the regular versions, but they keep the destination pixel untouched if the source pixel is transparent (usually 0)

The TIMP operation copies data from source to value, except transparent ones

useful for

superimposing two images. IMP copies everything, including the transparent pixels

so consider using the faster command VDP_CommandHMMM instead)

Parameters
sx
u16

X coordinate of the source area

sy
u16

Y coordinate of the source area

dx
u16

X coordinate of the destination area

dy
u16

Y coordinate of the destination area

nx
u16

Width of the area

ny
u16

Height of the area

op
u8

Color blend operation VDP_OP_IMP (0x00) copies everything (consider using the faster function HMMM) VDP_OP_AND (0x01) applies an AND operation between source and destination VDP_OP_OR (0x02) applies an OR operation between source and destination VDP_OP_XOR (0x03) applies a XOR operation between source and destination VDP_OP_NOT (0x04) applies a NOT operation in the source pixel VDP_OP_TIMP (0x08) copies only non-transparent pixels (superimpose) VDP_OP_TAND (0x09) same as AND, but dont change pixels transparent at the source VDP_OP_TOR (0x0A) same as OR, but dont change pixels transparent at the source VDP_OP_TXOR (0x0B) same as XOR, but dont change pixels transparent at the source VDP_OP_TNOT (0x0C) same as NOT, but dont change pixels transparent at the source

VDP_CommandLMMV_Arg
inline void VDP_CommandLMMV_Arg(
u16 dx,
u16 dy,
u16 nx,
u16 ny,
u8 col,
u8 op,
u8 arg
)

Logical move VDP to VRAM. [MSX2/2+/TR]

VDP_CommandLMMV
inline void VDP_CommandLMMV(
u16 dx,
u16 dy,
u16 nx,
u16 ny,
u8 col,
u8 op
)

Logical move VDP to VRAM. [MSX2/2+/TR]

Parameters
dx
u16

X coordinate of the destination area

dy
u16

Y coordinate of the destination area

nx
u16

Width of the area

ny
u16

Height of the area

col
u8

Color data

op
u8

Color blend operation

VDP_CommandLINE
inline void VDP_CommandLINE(
u16 dx,
u16 dy,
u16 nx,
u16 ny,
u8 col,
u8 arg,
u8 op
)

Draw straight line in VRAM. [MSX2/2+/TR]

Parameters
dx
u16

X coordinate of the destination area

dy
u16

Y coordinate of the destination area

nx
u16

Width of the area

ny
u16

Height of the area

col
u8

Color data

arg
u8

Command argument

op
u8

Color blend operation

VDP_CommandSRCH
inline void VDP_CommandSRCH(
u16 sx,
u16 sy,
u8 col,
u8 arg
)

Search for the specific color in VRAM to the right or left of the starting point (not fonctional). [MSX2/2+/TR]

Parameters
sx
u16

X coordinate of the source area

sy
u16

Y coordinate of the source area

col
u8

Color data

arg
u8

Command argument

VDP_CommandPSET
inline void VDP_CommandPSET(
u16 dx,
u16 dy,
u8 col,
u8 op
)

Draw a dot in VRAM. [MSX2/2+/TR]

Parameters
dx
u16

X coordinate of the destination area

dy
u16

Y coordinate of the destination area

col
u8

Color data

op
u8

Color blend operation

VDP_CommandPOINT
inline u8 VDP_CommandPOINT(
u16 sx,
u16 sy
)

Read the color of the specified dot located in VRAM. [MSX2/2+/TR]

Parameters
sx
u16

X coordinate of the source area

sy
u16

Y coordinate of the source area

VDP_CommandSTOP
inline void VDP_CommandSTOP()

Abort the current command. [MSX2/2+/TR]

VDP_CommandCustomR32

Set a command from a given buffer starting mapped from VDP register R32 (15 bytes buffer)

VDP_CommandCustomR36

Set a command from a given buffer starting mapped from VDP register R36 (11 bytes buffer)