libmsx
C library for MSX
Loading...
Searching...
No Matches
Tiled graphics mode

Initialization functions for GRAPHIC 1, 2, and 3 mode. More...

+ Collaboration diagram for Tiled graphics mode:

Functions

void screen1 (void)
 MSX SCREEN 1: WIDTH 32 (GRAPHIC 1 mode).
 
void screen2 (void)
 MSX SCREEN 2: WIDTH 32 (GRAPHIC 2 mode).
 
void screen2_PCG (void)
 MSX SCREEN 2: WIDTH 32 (GRAPHIC 2 mode; PCG mode like as SCREEN 1).
 
void screen4 (void)
 MSX2 SCREEN 4: WIDTH 32 (GRAPHIC 3 mode).
 
void screen4_PCG (void)
 MSX2 SCREEN 4: WIDTH 32 (GRAPHIC 3 mode; PCG mode like as SCREEN 1).
 

Detailed Description

Initialization functions for GRAPHIC 1, 2, and 3 mode.

Function Documentation

◆ screen1()

void screen1 ( void  )

MSX SCREEN 1: WIDTH 32 (GRAPHIC 1 mode).

  • 32 columns x 24 lines tiled graphics mode.
  • Sprite mode 1.

VRAM memory map

VRAM address size contents
0x00000 0x0800 Pattern generator table
0x01800 0x0300 Pattern name table
0x01B00 0x0080 Sprite attribute table
0x02000 0x0020 Color table
0x03800 0x0300 Sprite pattern generator table
Note
Patterns can be defined for each 256-character fonts (pattern generator table in VRAM).
Colors can be defined for each 8-character group of 256-character fonts (color table in VRAM).

◆ screen2()

void screen2 ( void  )

MSX SCREEN 2: WIDTH 32 (GRAPHIC 2 mode).

  • 32 columns x 24 lines tiled graphics mode.
  • Sprite mode 1.

VRAM memory map

VRAM address size contents
0x00000 0x1800 Pattern generator table
0x01800 0x0300 Pattern name table
0x01B00 0x0080 Sprite attribute table
0x02000 0x1800 Color table
0x03800 0x0300 Sprite pattern generator table

The pattern name table is initialized as follows and will not be changed thereafter:

c
uint8_t pattern_name_table[0x0300] = {
0x00, 0x01, ..., 0xff, // (0, 0) .. (31, 7) ; top of screen
0x00, 0x01, ..., 0xff, // (0, 8) .. (31,15) ; middle of screen
0x00, 0x01, ..., 0xff, // (0,16) .. (31,23) ; bottom of screen
};

The pattern generator table and color table are then used as the canvas for the graphics screen. Thus, the characters in the text are also drawn as images one by one. Thus, the text will be more colorful, but a little slower.

Note
In this mode, text is drawn as individual color text. (i.e., text is drawn as a two-tone color graphic).

◆ screen2_PCG()

void screen2_PCG ( void  )

MSX SCREEN 2: WIDTH 32 (GRAPHIC 2 mode; PCG mode like as SCREEN 1).

  • 32 columns x 24 lines tiled graphics mode.
  • Sprite mode 1.

VRAM memory map

VRAM address size contents
0x00000 0x1800 Pattern generator table
0x01800 0x0300 Pattern name table
0x01B00 0x0080 Sprite attribute table
0x02000 0x1800 Color table
0x03800 0x0300 Sprite pattern generator table
Note
For each 256-character font, three patterns/colors can be defined for the top, middle, and bottom of the screen (pattern generator table and color table in VRAM).
a.k.a. SCREEN 1.5

◆ screen4()

void screen4 ( void  )

MSX2 SCREEN 4: WIDTH 32 (GRAPHIC 3 mode).

  • 32 columns x 24 lines tiled graphics mode.
  • Sprite mode 2.

VRAM memory map

VRAM address size contents
0x00000 0x1800 Pattern generator table
0x01800 0x0300 Pattern name table
0x01C00 0x0200 Sprite color table
0x01E00 0x0080 Sprite attribute table
0x02000 0x1800 Color table
0x03800 0x0300 Sprite pattern generator table

The pattern name table is initialized as follows and will not be changed thereafter:

c
uint8_t pattern_name_table[0x0300] = {
0x00, 0x01, ..., 0xff, // (0, 0) .. (31, 7) ; top of screen
0x00, 0x01, ..., 0xff, // (0, 8) .. (31,15) ; middle of screen
0x00, 0x01, ..., 0xff, // (0,16) .. (31,23) ; bottom of screen
};

The pattern generator table and color table are then used as the canvas for the graphics screen. Thus, the characters in the text are also drawn as images one by one. Thus, the text will be more colorful, but a little slower.

Note
In this mode, text is drawn as individual color text. (i.e., text is drawn as a two-tone color graphic).

◆ screen4_PCG()

void screen4_PCG ( void  )

MSX2 SCREEN 4: WIDTH 32 (GRAPHIC 3 mode; PCG mode like as SCREEN 1).

  • 32 columns x 24 lines tiled graphics mode.
  • Sprite mode 2.

VRAM memory map

VRAM address size contents
0x00000 0x1800 Pattern generator table
0x01800 0x0300 Pattern name table
0x01C00 0x0200 Sprite color table
0x01E00 0x0080 Sprite attribute table
0x02000 0x1800 Color table
0x03800 0x0300 Sprite pattern generator table
Note
For each 256-character font, three patterns/colors can be defined for the top, middle, and bottom of the screen (pattern generator table and color table in VRAM).