176#define RGB(r, g, b) \
177 ((palette_t)((((g) & 7) << 8) | (((r) & 7) << 4) | ((b) & 7)))
710 uint16_t sx, uint16_t sy,
725 uint16_t x2, uint16_t y2,
784 uint16_t w, uint16_t h,
843 uint16_t w, uint16_t h,
902 uint16_t w, uint16_t h,
1033 uint16_t x2, uint16_t y2);
1182 c->
r32 = (sx & 0xff);
1183 c->
r33 = (sx >> 8) & 0x01;
1195 c->
r34 = (sy & 0xff);
1196 c->
r35 = (sy >> 8) & 0x03;
1208 c->
r36 = (dx & 0xff);
1209 c->
r37 = (dx >> 8) & 0x01;
1221 c->
r38 = (dy & 0xff);
1222 c->
r39 = (dy >> 8) & 0x03;
1234 c->
r40 = (nx & 0xff);
1235 c->
r41 = (nx >> 8) & 0x01;
1247 c->
r42 = (ny & 0xff);
1248 c->
r43 = (ny >> 8) & 0x03;
C language I/F for MSX BIOS routines.
#define color(fg, bg, border)
MSX Set foreground, background, and border color.
void vdp_set_color(uint8_t c)
MSX Set VDP color register.
void vdp_cmd_execute_LMMC(uint16_t x, uint16_t y, uint16_t w, uint16_t h, enum vdp_cmd_dir dir, enum vdp_cmd_logop logop)
MSX2 Executes VDP command "LMMC" (CPU to VRAM logical transfer).
void vdp_cmd_execute_HMMV(uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint8_t color)
MSX2 Executes VDP command "HMMV" (fills rectangular area).
void vdp_cmd_execute_LINE(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint8_t color, enum vdp_cmd_logop logop)
MSX2 Executes VDP command "LINE" (Draw line w/ logical operation).
void vdp_cmd_execute_HMMM(uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint16_t x2, uint16_t y2)
MSX2 Executes VDP command "HMMM" (copy rectangular area).
void vdp_cmd_execute_LMMV(uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint8_t color, enum vdp_cmd_logop logop)
MSX2 Executes VDP command "LMMV" (fills rectangular area w/ logical operation).
void vdp_cmd_execute_YMMM(uint16_t x, uint16_t y, uint16_t h, uint16_t y2, uint8_t dir)
MSX2 Executes VDP command "YMMM" (copy rectangular area from VRAM to VRAM vertically).
uint8_t vdp_cmd_execute_POINT(uint16_t sx, uint16_t sy)
MSX2 Executes VDP command "POINT" (Read color code at the given point).
bool vdp_cmd_read(uint8_t *ret)
MSX2 Reads a value from VDP.
vdp_cmd_dir
Enumeration of directions of rectangular operation for VDP commands.
bool vdp_cmd_is_running(void)
MSX2 Tests if a VDP command is running.
void vdp_cmd_execute_PSET(uint16_t dx, uint16_t dy, uint8_t color, enum vdp_cmd_logop logop)
MSX2 Executes VDP command "PSET" (Write color code at the given point).
bool vdp_cmd_execute_SRCH(uint16_t *ret, uint16_t sx, uint16_t sy, uint8_t color, uint8_t arg)
MSX2 Executes VDP command "SRCH" (Search color code from the given point towards left/right).
void vdp_cmd_execute_HMMC(uint16_t x, uint16_t y, uint16_t w, uint16_t h, enum vdp_cmd_dir dir)
MSX2 Executes VDP command "HMMC" (CPU to VRAM high speed transfer).
void vdp_cmd_await(void)
MSX2 Wait for the VDP command to finish.
bool vdp_cmd_write(const uint8_t val)
MSX2 Writes a value to VDP.
void vdp_cmd_execute_LMCM(uint16_t x, uint16_t y, uint16_t w, uint16_t h, enum vdp_cmd_dir dir)
MSX2 Executes VDP command "LMCM" (VRAM to CPU logical transfer).
vdp_cmd_logop
Enumeration of logical operation codes for VDP commands.
void vdp_cmd_stop(void)
MSX2 Executes VDP command "STOP" (stop the running VDP command).
void vdp_cmd_execute_LMMM(uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint16_t x2, uint16_t y2, enum vdp_cmd_logop logop)
MSX2 Executes VDP command "LMMM" (copy rectangular area w/ logical operation).
void vdp_cmd_set_unrestricted(bool enable)
MSX2+ Unristricts/Restricts availability of the VDP command for some screen modes.
@ VDP_CMD_LRTB
Left to Right, Top to Bottom.
@ VDP_CMD_RLBT
Right to Left, Bottom to Top.
@ VDP_CMD_LRBT
Left to Right, Bottom to Top.
@ VDP_CMD_RLTB
Right to Left, Top to Bottom.
@ VDP_CMD_OR
Logical operation code "OR" : destination ← destination | source.
@ VDP_CMD_TNOT
Logical operation code "TNOT" : destination ← ~source , if source ≠ 0.
@ VDP_CMD_EOR
Logical operation code "EOR" : destination ← destination ^ source.
@ VDP_CMD_AND
Logical operation code "AND" : destination ← destination & source.
@ VDP_CMD_XOR
(synonim for VDP_CMD_EOR)
@ VDP_CMD_TEOR
Logical operation code "TEOR" : destination ← destination ^ source , if source ≠ 0.
@ VDP_CMD_TXOR
(synonim for VDP_CMD_TEOR)
@ VDP_CMD_IMP
Logical operation code "IMP" : destination ← source.
@ VDP_CMD_TAND
Logical operation code "TAND" : destination ← destination & source , if source ≠ 0.
@ VDP_CMD_NOT
Logical operation code "NOT" : destination ← ~source.
@ VDP_CMD_TOR
Logical operation code "TOR" : destination ← destination | source , if source ≠ 0.
@ VDP_CMD_TIMP
Logical operation code "TIMP" : destination ← source , if source ≠ 0.
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)
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_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_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_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_ARG(struct vdp_cmd *c, uint8_t arg)
MSX2 Set ARG value (DIX, DIY, etc.) for VDP commands.
void vdp_cmd_execute(const struct vdp_cmd *c, enum vdp_cmd_op opcode)
MSX2 Executes a VDP command.
vdp_cmd_op
Enumeration of operation codes 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_logop(struct vdp_cmd *c, enum vdp_cmd_logop logop)
MSX2 Set a logical operation code 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_NX(struct vdp_cmd *c, uint16_t nx)
MSX2 Set NX value (width) for VDP commands.
@ VDP_CMD_LMCM
Operation code "LMCM" : VRAM to CPU logical transfer.
@ VDP_CMD_SRCH
Operation code "SRCH" : Search color code from the given point towards left/right.
@ VDP_CMD_LMMM
Operation code "LMMM" : Copy rectangular area from VRAM to VRAM w/ logical operation.
@ VDP_CMD_STOP
Operation code "STOP" : Stop the running VDP command.
@ VDP_CMD_HMMV
Operation code "HMMV" : Fill rectangular area.
@ VDP_CMD_YMMM
Operation code "YMMM" : Copy rectangular area from VRAM to VRAM vertically.
@ VDP_CMD_LINE
Operation code "LINE" : Draw line w/ logical operation.
@ VDP_CMD_LMMC
Operation code "LMMC" : CPU to VRAM logical transfer.
@ VDP_CMD_PSET
Operation code "PSET" : Write color code at the given point.
@ VDP_CMD_LMMV
Operation code "LMMV" : Fill rectangular area w/ logical operation.
@ VDP_CMD_POINT
Operation code "POINT" : Read color code at the given point.
@ VDP_CMD_HMMM
Operation code "HMMM" : Copy rectangular area from VRAM to VRAM.
@ VDP_CMD_HMMC
Operation code "HMMC" : CPU to VRAM high speed transfer.
Parameters for VDP commands.
void vdp_write_control(uint8_t reg, void *src, uint8_t len)
MSX2 Write to a series of VDP control registers.
void vdp_set_control(uint8_t reg, uint8_t x)
MSX Write to a VDP control register.
void vdp_set_hscroll(uint16_t x)
MSX2+ Set VDP horizontal display offset register.
void vdp_set_hscroll_mask(bool enable)
MSX2+ Enables/Disables the screen mask for the leftmost 8 pixels.
void vdp_set_vscroll(uint8_t y)
MSX2 Set VDP vertical display offset register.
void vdp_set_yjk_mode(enum vdp_yjk_mode yjk)
MSX2+ Set V9958 VDP's color space to RGB, YJK, or YJK/RGB.
void vdp_set_adjust(int8_t x, int8_t y)
MSX2 Set VDP display adjust register.
vdp_yjk_mode
MSX2+ Enumeration of V9958 VDP's color space.
void vdp_set_hscroll_dual_page(bool enable)
MSX2+ Enable/disable horizontal scrolling for two pages.
@ VDP_RGB
Default color space of the V9958 (same as the V9938).
@ VDP_YJK_RGB
YJK / RGB mixed mode.
vdp_screen_lines
Enumeration of VDP screen lines.
void vdp_set_visible(bool visible)
MSX Show / hide screen.
void vdp_set_screen_mode(enum vdp_screen_mode mode)
MSX Set VDP screen mode.
vdp_screen_mode
Enumeration of VDP screen modes.
void vdp_set_sprite_visible(bool visible)
MSX2 Show / hide sprites.
uint8_t vdp_get_sprite_mode(void)
MSX Get current sprite mode.
void vdp_set_sprite_size(enum vdp_sprite_size size)
MSX Set sprite size.
vdp_sprite_size
Enumeration of VDP sprite size.
void vdp_set_screen_lines(enum vdp_screen_lines lines)
MSX2 Set number of visible lines.
@ VDP_SCREEN_LINES_192
192 lines
@ VDP_SCREEN_LINES_212
212 lines
@ VDP_SCREEN_MODE_GRAPHIC_2
MSX GRAPHIC 2 (SCREEN 2)
@ VDP_SCREEN_MODE_MULTI_COLOR
MSX MULTI COLOR (SCREEN 3)
@ VDP_SCREEN_MODE_GRAPHIC_3
MSX2 GRAPHIC 3 (SCREEN 4)
@ VDP_SCREEN_MODE_GRAPHIC_7
MSX2 GRAPHIC 7 (SCREEN 8)
@ VDP_SCREEN_MODE_GRAPHIC_5
MSX2 GRAPHIC 5 (SCREEN 6)
@ VDP_SCREEN_MODE_GRAPHIC_1
MSX GRAPHIC 1 (SCREEN 1)
@ VDP_SCREEN_MODE_GRAPHIC_6
MSX2 GRAPHIC 6 (SCREEN 7)
@ VDP_SCREEN_MODE_GRAPHIC_4
MSX2 GRAPHIC 4 (SCREEN 5)
@ VDP_SCREEN_MODE_TEXT_1
MSX TEXT 1 (SCREEN 0, WIDTH 40)
@ VDP_SCREEN_MODE_TEXT_2
MSX2 TEXT 2 (SCREEN 0, WIDTH 80)
@ VDP_SPRITE_SIZE_16x16
16x16 pixels
@ VDP_SPRITE_SIZE_16x16_MAGNIFIED
16x16 pixels, 2x magnification
@ VDP_SPRITE_SIZE_8x8_MAGNIFIED
8x8 pixels, 2x magnification
@ VDP_SPRITE_SIZE_8x8
8x8 pixels
uint16_t palette_t
Type for RGB color palette value.
void vdp_set_palette(uint8_t idx, const palette_t palette)
MSX2 Write to a VDP palette register.
void vdp_write_palette(const palette_t palettes[16])
MSX2 Write to a series of VDP palette registers.
uint8_t vdp_get_status(uint8_t reg)
MSX Read from a VDP status register.
void vdp_set_image_table(vmemptr_t table)
MSX Set VRAM address of the pattern name table.
void vdp_set_sprite_pattern_table(vmemptr_t table)
MSX Set VRAM address of the sprite pattern generator table.
void vdp_set_sprite_attribute_table(vmemptr_t table)
MSX Set VRAM address of the sprite attribute table.
void vdp_set_color_table(vmemptr_t table)
MSX Set VRAM address of the color table.
void vdp_set_pattern_table(vmemptr_t table)
MSX Set VRAM address of the pattern generator table.
uint32_t vmemptr_t
Type for VRAM address.
Unsafe primitive functions for VDP (Video Display Proccessor) access.
Data types and functions for VRAM access.
Definitions of MSX SYSTEM Workarea.