libmsx
C library for MSX
|
Write to command registers. More...
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. | |
Write to command registers.
struct vdp_cmd |
enum vdp_cmd_op |
Enumeration of operation codes for VDP commands.
Enumerator | |
---|---|
VDP_CMD_STOP | Operation code "STOP" : Stop the running VDP command.
|
VDP_CMD_POINT | Operation code "POINT" : Read color code at the given point.
|
VDP_CMD_PSET | Operation code "PSET" : Write color code at the given point.
|
VDP_CMD_SRCH | Operation code "SRCH" : Search color code from the given point towards left/right.
|
VDP_CMD_LINE | Operation code "LINE" : Draw line w/ logical operation.
|
VDP_CMD_LMMV | Operation code "LMMV" : Fill rectangular area w/ logical operation.
|
VDP_CMD_LMMM | Operation code "LMMM" : Copy rectangular area from VRAM to VRAM w/ logical operation.
|
VDP_CMD_LMCM | Operation code "LMCM" : VRAM to CPU logical transfer.
|
VDP_CMD_LMMC | Operation code "LMMC" : CPU to VRAM logical transfer.
|
VDP_CMD_HMMV | Operation code "HMMV" : Fill rectangular area.
|
VDP_CMD_HMMM | Operation code "HMMM" : Copy rectangular area from VRAM to VRAM.
|
VDP_CMD_YMMM | Operation code "YMMM" : Copy rectangular area from VRAM to VRAM vertically.
|
VDP_CMD_HMMC | Operation code "HMMC" : CPU to VRAM high speed transfer.
|
|
inline |
MSX2
Set SX value (x-coordinate of the source point) for VDP commands.
c | pointer to struct vdp_cmd . |
sx | SX value. |
|
inline |
MSX2
Set SY value (y-coordinate of the source point) for VDP commands.
c | pointer to struct vdp_cmd . |
sy | SY value. |
|
inline |
MSX2
Set DX value (x-coordinate of the destination point) for VDP commands.
c | pointer to struct vdp_cmd . |
dx | DX value. |
|
inline |
MSX2
Set DY value (y-coordinate of the destination point) for VDP commands.
c | pointer to struct vdp_cmd . |
dy | DY value. |
|
inline |
MSX2
Set NX value (width) for VDP commands.
c | pointer to struct vdp_cmd . |
nx | NX value. |
|
inline |
MSX2
Set NY value (height) for VDP commands.
c | pointer to struct vdp_cmd . |
ny | NY value. |
|
inline |
MSX2
Set CLR value (color) for VDP commands.
c | pointer to struct vdp_cmd . |
clr | CLR value. |
|
inline |
MSX2
Set ARG value (DIX, DIY, etc.) for VDP commands.
c | pointer to struct vdp_cmd . |
arg | ARG value. |
|
inline |
MSX2
Set a logical operation code for VDP commands.
c | pointer to struct vdp_cmd . |
logop | a logical operation code. |
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().
c | pointer to struct vdp_cmd . |
opcode | an operation code. |