libmsx
C library for MSX
Loading...
Searching...
No Matches

Screen / Sprite mode setting. More...

+ Collaboration diagram for Mode registers:

Enumerations

enum  vdp_screen_mode {
  VDP_SCREEN_MODE_GRAPHIC_1 = 0 , VDP_SCREEN_MODE_TEXT_1 = 1 , VDP_SCREEN_MODE_MULTI_COLOR = 2 , VDP_SCREEN_MODE_GRAPHIC_2 = 3 ,
  VDP_SCREEN_MODE_GRAPHIC_3 = 4 , VDP_SCREEN_MODE_TEXT_2 = 5 , VDP_SCREEN_MODE_GRAPHIC_4 = 6 , VDP_SCREEN_MODE_GRAPHIC_5 = 7 ,
  VDP_SCREEN_MODE_GRAPHIC_6 = 8 , VDP_SCREEN_MODE_GRAPHIC_7 = 9
}
 Enumeration of VDP screen modes. More...
 
enum  vdp_screen_lines { VDP_SCREEN_LINES_192 = 0x00 , VDP_SCREEN_LINES_212 = 0x80 }
 Enumeration of VDP screen lines. More...
 
enum  vdp_sprite_size { VDP_SPRITE_SIZE_8x8 = 0 , VDP_SPRITE_SIZE_8x8_MAGNIFIED = 1 , VDP_SPRITE_SIZE_16x16 = 2 , VDP_SPRITE_SIZE_16x16_MAGNIFIED = 3 }
 Enumeration of VDP sprite size. More...
 

Functions

void vdp_set_screen_mode (enum vdp_screen_mode mode)
 MSX Set VDP screen mode.
 
void vdp_set_screen_lines (enum vdp_screen_lines lines)
 MSX2 Set number of visible lines.
 
void vdp_set_visible (bool visible)
 MSX Show / hide screen.
 
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.
 
void vdp_set_sprite_visible (bool visible)
 MSX2 Show / hide sprites.
 

Detailed Description

Screen / Sprite mode setting.

Enumeration Type Documentation

◆ vdp_screen_mode

Enumeration of VDP screen modes.

See also
vdp_set_screen_mode()
Enumerator
VDP_SCREEN_MODE_GRAPHIC_1 

MSX GRAPHIC 1 (SCREEN 1)

VDP_SCREEN_MODE_TEXT_1 

MSX TEXT 1 (SCREEN 0, WIDTH 40)

VDP_SCREEN_MODE_MULTI_COLOR 

MSX MULTI COLOR (SCREEN 3)

VDP_SCREEN_MODE_GRAPHIC_2 

MSX GRAPHIC 2 (SCREEN 2)

VDP_SCREEN_MODE_GRAPHIC_3 

MSX2 GRAPHIC 3 (SCREEN 4)

VDP_SCREEN_MODE_TEXT_2 

MSX2 TEXT 2 (SCREEN 0, WIDTH 80)

VDP_SCREEN_MODE_GRAPHIC_4 

MSX2 GRAPHIC 4 (SCREEN 5)

VDP_SCREEN_MODE_GRAPHIC_5 

MSX2 GRAPHIC 5 (SCREEN 6)

VDP_SCREEN_MODE_GRAPHIC_6 

MSX2 GRAPHIC 6 (SCREEN 7)

VDP_SCREEN_MODE_GRAPHIC_7 

MSX2 GRAPHIC 7 (SCREEN 8)

Definition at line 212 of file vdp.h.

◆ vdp_screen_lines

Enumeration of VDP screen lines.

See also
vdp_set_screen_lines()
Enumerator
VDP_SCREEN_LINES_192 

192 lines

VDP_SCREEN_LINES_212 

212 lines

Definition at line 239 of file vdp.h.

◆ vdp_sprite_size

Enumeration of VDP sprite size.

See also
vdp_set_sprite_size()
Enumerator
VDP_SPRITE_SIZE_8x8 

8x8 pixels

VDP_SPRITE_SIZE_8x8_MAGNIFIED 

8x8 pixels, 2x magnification

VDP_SPRITE_SIZE_16x16 

16x16 pixels

VDP_SPRITE_SIZE_16x16_MAGNIFIED 

16x16 pixels, 2x magnification

Definition at line 250 of file vdp.h.

Function Documentation

◆ vdp_set_screen_mode()

void vdp_set_screen_mode ( enum vdp_screen_mode  mode)

MSX Set VDP screen mode.

enum vdp_screen_mode VDP Screen mode BASIC Screen mode Sprite mode compatibility
VDP_SCREEN_MODE_TEXT_1 TEXT 1 SCREEN 0, WIDTH 40 (no sprite) MSX
VDP_SCREEN_MODE_GRAPHIC_1 GRAPHIC 1 SCREEN 1 mode 1 MSX
VDP_SCREEN_MODE_GRAPHIC_2 GRAPHIC 2 SCREEN 2 mode 1 MSX
VDP_SCREEN_MODE_MULTI_COLOR MULTI COLOR SCREEN 3 mode 1 MSX
VDP_SCREEN_MODE_TEXT_2 TEXT 2 SCREEN 0, WIDTH 80 (no sprite) MSX2
VDP_SCREEN_MODE_GRAPHIC_3 GRAPHIC 3 SCREEN 4 mode 2 MSX2
VDP_SCREEN_MODE_GRAPHIC_4 GRAPHIC 4 SCREEN 5 mode 2 MSX2
VDP_SCREEN_MODE_GRAPHIC_5 GRAPHIC 5 SCREEN 6 mode 2 MSX2
VDP_SCREEN_MODE_GRAPHIC_6 GRAPHIC 6 SCREEN 7 mode 2 MSX2
VDP_SCREEN_MODE_GRAPHIC_7 GRAPHIC 7 SCREEN 8 mode 2 MSX2
VDP_SCREEN_MODE_GRAPHIC_7 GRAPHIC 7 YJK/RGB SCREEN 10 or 11 mode 2 MSX2+
VDP_SCREEN_MODE_GRAPHIC_7 GRAPHIC 7 YJK SCREEN 12 mode 2 MSX2+
Parameters
modeVDP screen mode.
Note
This function just set/reset the M1..M5 bits of the VDP mode registers, any other settings are not changed by this function.
Therefore you should do the following after this function if needed:
See also
vdp_set_image_table()
vdp_set_pattern_table()
vdp_set_color_table()
vdp_set_screen_lines()
vdp_set_yjk_mode()
vdp_set_sprite_pattern_table()
vdp_set_sprite_attribute_table()
vdp_set_sprite_size()
vdp_get_sprite_mode()

◆ vdp_set_screen_lines()

void vdp_set_screen_lines ( enum vdp_screen_lines  lines)

MSX2 Set number of visible lines.

Parameters
linesVDP_SCREEN_LINES_192 for 192 lines, or
VDP_SCREEN_LINES_212 for 212 lines.

◆ vdp_set_visible()

void vdp_set_visible ( bool  visible)

MSX Show / hide screen.

Parameters
visibleshow screen if true, hide otherwise.

◆ vdp_get_sprite_mode()

uint8_t vdp_get_sprite_mode ( void  )

MSX Get current sprite mode.

The sprite mode will be determined based on the current screen mode.

enum vdp_screen_mode VDP Screen mode BASIC Screen mode Sprite mode compatibility
VDP_SCREEN_MODE_TEXT_1 TEXT 1 SCREEN 0, WIDTH 40 (no sprite) MSX
VDP_SCREEN_MODE_GRAPHIC_1 GRAPHIC 1 SCREEN 1 mode 1 MSX
VDP_SCREEN_MODE_GRAPHIC_2 GRAPHIC 2 SCREEN 2 mode 1 MSX
VDP_SCREEN_MODE_MULTI_COLOR MULTI COLOR SCREEN 3 mode 1 MSX
VDP_SCREEN_MODE_TEXT_2 TEXT 2 SCREEN 0, WIDTH 80 (no sprite) MSX2
VDP_SCREEN_MODE_GRAPHIC_3 GRAPHIC 3 SCREEN 4 mode 2 MSX2
VDP_SCREEN_MODE_GRAPHIC_4 GRAPHIC 4 SCREEN 5 mode 2 MSX2
VDP_SCREEN_MODE_GRAPHIC_5 GRAPHIC 5 SCREEN 6 mode 2 MSX2
VDP_SCREEN_MODE_GRAPHIC_6 GRAPHIC 6 SCREEN 7 mode 2 MSX2
VDP_SCREEN_MODE_GRAPHIC_7 GRAPHIC 7 SCREEN 8 mode 2 MSX2
VDP_SCREEN_MODE_GRAPHIC_7 GRAPHIC 7 YJK/RGB SCREEN 10 or 11 mode 2 MSX2+
VDP_SCREEN_MODE_GRAPHIC_7 GRAPHIC 7 YJK SCREEN 12 mode 2 MSX2+
Returns
The sprite mode based on the current screen mode:
  • 0 if the screen mode was TEXT 1 or TEXT 2,
  • 1 if the sprite mode was mode 1,
  • 2 if the sprite mode was mode 2.
Note
If you call this function before calling vdp_set_screen_mode(), the return value may be wrong.
See also
vdp_set_screen_mode()

◆ vdp_set_sprite_size()

void vdp_set_sprite_size ( enum vdp_sprite_size  size)

MSX Set sprite size.

Parameters
sizesprite size.

◆ vdp_set_sprite_visible()

void vdp_set_sprite_visible ( bool  visible)

MSX2 Show / hide sprites.

Parameters
visibleshow sprites if true, hide otherwise.