libmsx
C library for MSX
Loading...
Searching...
No Matches
VDP commands (Low level APIs)

Write to command registers. More...

+ Collaboration diagram for VDP commands (Low level APIs):

Data Structures

struct  vdp_cmd
 Parameters for VDP commands. More...
 

Enumerations

enum  vdp_cmd_op {
  VDP_CMD_STOP = 0x00 , VDP_CMD_POINT = 0x40 , VDP_CMD_PSET = 0x50 , VDP_CMD_SRCH = 0x60 ,
  VDP_CMD_LINE = 0x70 , VDP_CMD_LMMV = 0x80 , VDP_CMD_LMMM = 0x90 , VDP_CMD_LMCM = 0xa0 ,
  VDP_CMD_LMMC = 0xb0 , VDP_CMD_HMMV = 0xc0 , VDP_CMD_HMMM = 0xd0 , VDP_CMD_YMMM = 0xe0 ,
  VDP_CMD_HMMC = 0xf0
}
 Enumeration of operation codes for VDP commands. More...
 

Functions

void vdp_cmd_set_SX (struct vdp_cmd *c, uint16_t sx)
 MSX2 Set SX value (x-coordinate of the source point) for VDP commands.
 
void vdp_cmd_set_SY (struct vdp_cmd *c, uint16_t sy)
 MSX2 Set SY value (y-coordinate of the source point) for VDP commands.
 
void vdp_cmd_set_DX (struct vdp_cmd *c, uint16_t dx)
 MSX2 Set DX value (x-coordinate of the destination point) for VDP commands.
 
void vdp_cmd_set_DY (struct vdp_cmd *c, uint16_t dy)
 MSX2 Set DY value (y-coordinate of the destination point) for VDP commands.
 
void vdp_cmd_set_NX (struct vdp_cmd *c, uint16_t nx)
 MSX2 Set NX value (width) for VDP commands.
 
void vdp_cmd_set_NY (struct vdp_cmd *c, uint16_t ny)
 MSX2 Set NY value (height) for VDP commands.
 
void vdp_cmd_set_CLR (struct vdp_cmd *c, uint8_t clr)
 MSX2 Set CLR value (color) for VDP commands.
 
void vdp_cmd_set_ARG (struct vdp_cmd *c, uint8_t arg)
 MSX2 Set ARG value (DIX, DIY, etc.) for VDP commands.
 
void vdp_cmd_set_logop (struct vdp_cmd *c, enum vdp_cmd_logop logop)
 MSX2 Set a logical operation code for VDP commands.
 
void vdp_cmd_execute (const struct vdp_cmd *c, enum vdp_cmd_op opcode)
 MSX2 Executes a VDP command.
 

Detailed Description

Write to command registers.


Data Structure Documentation

◆ vdp_cmd

struct vdp_cmd

Parameters for VDP commands.

See also
vdp_cmd_execute()

Definition at line 1155 of file vdp.h.

Data Fields
uint8_t r32 SX (lo)
uint8_t r33 SX (hi)
uint8_t r34 SY (lo)
uint8_t r35 SY (hi)
uint8_t r36 DX (lo)
uint8_t r37 DX (hi)
uint8_t r38 DY (lo)
uint8_t r39 DY (hi)
uint8_t r40 NX (lo)
uint8_t r41 NX (hi)
uint8_t r42 NY (lo)
uint8_t r43 NY (hi)
uint8_t r44 CLR (2bpp * 4 pix, 4bpp * 2 pix, or 8bpp * 1 pix)
uint8_t r45 ARG (0000b | DIY | DIX | 00b)
uint8_t r46 CMR (op | logop)

Enumeration Type Documentation

◆ vdp_cmd_op

enum vdp_cmd_op

Enumeration of operation codes for VDP commands.

See also
vdp_cmd_execute()
Enumerator
VDP_CMD_STOP 

Operation code "STOP" : Stop the running VDP command.

See also
vdp_cmd_stop()
VDP_CMD_POINT 

Operation code "POINT" : Read color code at the given point.

See also
vdp_cmd_execute_POINT()
VDP_CMD_PSET 

Operation code "PSET" : Write color code at the given point.

See also
vdp_cmd_execute_PSET()
VDP_CMD_SRCH 

Operation code "SRCH" : Search color code from the given point towards left/right.

See also
vdp_cmd_execute_SRCH()
VDP_CMD_LINE 

Operation code "LINE" : Draw line w/ logical operation.

See also
vdp_cmd_execute_LINE()
VDP_CMD_LMMV 

Operation code "LMMV" : Fill rectangular area w/ logical operation.

See also
vdp_cmd_execute_LMMV()
VDP_CMD_LMMM 

Operation code "LMMM" : Copy rectangular area from VRAM to VRAM w/ logical operation.

See also
vdp_cmd_execute_LMMM()
VDP_CMD_LMCM 

Operation code "LMCM" : VRAM to CPU logical transfer.

See also
vdp_cmd_execute_LMCM()
VDP_CMD_LMMC 

Operation code "LMMC" : CPU to VRAM logical transfer.

See also
vdp_cmd_execute_LMMC()
VDP_CMD_HMMV 

Operation code "HMMV" : Fill rectangular area.

See also
vdp_cmd_execute_HMMV()
VDP_CMD_HMMM 

Operation code "HMMM" : Copy rectangular area from VRAM to VRAM.

See also
vdp_cmd_execute_HMMM()
VDP_CMD_YMMM 

Operation code "YMMM" : Copy rectangular area from VRAM to VRAM vertically.

See also
vdp_cmd_execute_YMMM()
VDP_CMD_HMMC 

Operation code "HMMC" : CPU to VRAM high speed transfer.

See also
vdp_cmd_execute_HMMC()

Definition at line 1082 of file vdp.h.

Function Documentation

◆ vdp_cmd_set_SX()

void vdp_cmd_set_SX ( struct vdp_cmd c,
uint16_t  sx 
)
inline

MSX2 Set SX value (x-coordinate of the source point) for VDP commands.

Parameters
cpointer to struct vdp_cmd.
sxSX value.
See also
vdp_cmd_execute()

Definition at line 1181 of file vdp.h.

◆ vdp_cmd_set_SY()

void vdp_cmd_set_SY ( struct vdp_cmd c,
uint16_t  sy 
)
inline

MSX2 Set SY value (y-coordinate of the source point) for VDP commands.

Parameters
cpointer to struct vdp_cmd.
sySY value.
See also
vdp_cmd_execute()

Definition at line 1194 of file vdp.h.

◆ vdp_cmd_set_DX()

void vdp_cmd_set_DX ( struct vdp_cmd c,
uint16_t  dx 
)
inline

MSX2 Set DX value (x-coordinate of the destination point) for VDP commands.

Parameters
cpointer to struct vdp_cmd.
dxDX value.
See also
vdp_cmd_execute()

Definition at line 1207 of file vdp.h.

◆ vdp_cmd_set_DY()

void vdp_cmd_set_DY ( struct vdp_cmd c,
uint16_t  dy 
)
inline

MSX2 Set DY value (y-coordinate of the destination point) for VDP commands.

Parameters
cpointer to struct vdp_cmd.
dyDY value.
See also
vdp_cmd_execute()

Definition at line 1220 of file vdp.h.

◆ vdp_cmd_set_NX()

void vdp_cmd_set_NX ( struct vdp_cmd c,
uint16_t  nx 
)
inline

MSX2 Set NX value (width) for VDP commands.

Parameters
cpointer to struct vdp_cmd.
nxNX value.
See also
vdp_cmd_execute()

Definition at line 1233 of file vdp.h.

◆ vdp_cmd_set_NY()

void vdp_cmd_set_NY ( struct vdp_cmd c,
uint16_t  ny 
)
inline

MSX2 Set NY value (height) for VDP commands.

Parameters
cpointer to struct vdp_cmd.
nyNY value.
See also
vdp_cmd_execute()

Definition at line 1246 of file vdp.h.

◆ vdp_cmd_set_CLR()

void vdp_cmd_set_CLR ( struct vdp_cmd c,
uint8_t  clr 
)
inline

MSX2 Set CLR value (color) for VDP commands.

Parameters
cpointer to struct vdp_cmd.
clrCLR value.
See also
vdp_cmd_execute()

Definition at line 1259 of file vdp.h.

◆ vdp_cmd_set_ARG()

void vdp_cmd_set_ARG ( struct vdp_cmd c,
uint8_t  arg 
)
inline

MSX2 Set ARG value (DIX, DIY, etc.) for VDP commands.

Parameters
cpointer to struct vdp_cmd.
argARG value.
See also
vdp_cmd_execute()

Definition at line 1271 of file vdp.h.

◆ vdp_cmd_set_logop()

void vdp_cmd_set_logop ( struct vdp_cmd c,
enum vdp_cmd_logop  logop 
)
inline

MSX2 Set a logical operation code for VDP commands.

Parameters
cpointer to struct vdp_cmd.
logopa logical operation code.
See also
vdp_cmd_execute()

Definition at line 1283 of file vdp.h.

◆ vdp_cmd_execute()

void vdp_cmd_execute ( const struct vdp_cmd c,
enum vdp_cmd_op  opcode 
)

MSX2 Executes a VDP command.

Requests the VDP to execute a VDP command. When a previous VDP command is still running, this function waits for the command to finish before requesting. Therefore you need not to call vdp_cmd_await() before calling vdp_cmd_execute().

Before calling this function, all parameters for the VDP command must be set to the struct vdp_cmd object pointed by the 1st argument c.

To set parameters, you may use the following inline functions:

After calling this function, if you want to wait for the VDP command to finish, call vdp_cmd_await().

Parameters
cpointer to struct vdp_cmd.
opcodean operation code.
See also
vdp_cmd_await()
vdp_cmd_set_SX()
vdp_cmd_set_SY()
vdp_cmd_set_DX()
vdp_cmd_set_DY()
vdp_cmd_set_NX()
vdp_cmd_set_NY()
vdp_cmd_set_CLR()
vdp_cmd_set_ARG()
vdp_cmd_set_logop()