libmsx
C library for MSX
Loading...
Searching...
No Matches
Sprite attribute table

Sprite attribute table interface. More...

+ Collaboration diagram for Sprite attribute table:

Data Structures

struct  sprite
 Element of sprite attribute table. More...
 

Typedefs

typedef uint8_t tagged_color_t
 Color code with tags of sprite attribute table.
 

Enumerations

enum  sprite_tag { SPRITE_TAG_IC = (1<<5) , SPRITE_TAG_CC = (1<<6) , SPRITE_TAG_EC = (1<<7) }
 Enumerations for tags of sprite attribute table. More...
 

Functions

void sprite_set_x (struct sprite *s, int x)
 MSX Set x coordinates to a struct sprite.
 
void sprite_set_y (struct sprite *s, int y)
 MSX Set y coordinates to a struct sprite.
 
void sprite_set_xy (struct sprite *s, int x, int y)
 MSX Set x and y coordinates to a struct sprite.
 
void sprite_set_pat (struct sprite *s, uint8_t pat)
 MSX Set sprite pattern number to a struct sprite.
 
void sprite_set_color (struct sprite *s, tagged_color_t tagged_color)
 MSX Set tags and color code to a struct sprite.
 
void vmem_set_sprite (vmemptr_t base, uint8_t plane, const struct sprite *s)
 MSX Set sprite attribute table element.
 
void vmem_init_sprites (vmemptr_t base)
 MSX Initialize the sprite attribute table.
 

Detailed Description

Sprite attribute table interface.


Data Structure Documentation

◆ sprite

struct sprite

Element of sprite attribute table.

Definition at line 55 of file sprite.h.

Data Fields
uint8_t y y coordinates
uint8_t x x coordinates
uint8_t pat sprite pattern number
tagged_color_t tagged_color EC | CC | IC | 0 | Color Code

Typedef Documentation

◆ tagged_color_t

typedef uint8_t tagged_color_t

Color code with tags of sprite attribute table.

Definition at line 50 of file sprite.h.

Enumeration Type Documentation

◆ sprite_tag

enum sprite_tag

Enumerations for tags of sprite attribute table.

Enumerator
SPRITE_TAG_IC 
SPRITE_TAG_CC 
SPRITE_TAG_EC 

Definition at line 41 of file sprite.h.

Function Documentation

◆ sprite_set_x()

void sprite_set_x ( struct sprite s,
int  x 
)

MSX Set x coordinates to a struct sprite.

Parameters
spointer to a struct sprite.
xx value.

◆ sprite_set_y()

void sprite_set_y ( struct sprite s,
int  y 
)

MSX Set y coordinates to a struct sprite.

Parameters
spointer to a struct sprite.
yy value.

◆ sprite_set_xy()

void sprite_set_xy ( struct sprite s,
int  x,
int  y 
)

MSX Set x and y coordinates to a struct sprite.

Parameters
spointer to a struct sprite.
xx value.
yy value.

◆ sprite_set_pat()

void sprite_set_pat ( struct sprite s,
uint8_t  pat 
)

MSX Set sprite pattern number to a struct sprite.

Parameters
spointer to a struct sprite.
patsprite pattern number.

◆ sprite_set_color()

void sprite_set_color ( struct sprite s,
tagged_color_t  tagged_color 
)

MSX Set tags and color code to a struct sprite.

Parameters
spointer to a struct sprite.
tagged_colortags and color code.

◆ vmem_set_sprite()

void vmem_set_sprite ( vmemptr_t  base,
uint8_t  plane,
const struct sprite s 
)
inline

MSX Set sprite attribute table element.

Parameters
baseBase address of the SPRITE ATTRIBUTE TABLE in VRAM.
planeThe plane number.
sPointer to constructed sprite attribute table element, that to be copied into VRAM.

Definition at line 103 of file sprite.h.

◆ vmem_init_sprites()

void vmem_init_sprites ( vmemptr_t  base)

MSX Initialize the sprite attribute table.

Same as the following code:

c
for (uint8_t plane = 0; plane < 32; plane++) {
struct sprite s = {
.y = 217,
.x = 0,
.pat = plane,
.tagged_color = 0,
};
vmem_set_sprite(base, plane, &s);
}
uint8_t y
y coordinates
Definition sprite.h:56
void vmem_set_sprite(vmemptr_t base, uint8_t plane, const struct sprite *s)
MSX Set sprite attribute table element.
Definition sprite.h:103
Element of sprite attribute table.
Definition sprite.h:55
Parameters
baseBase address of the SPRITE ATTRIBUTE TABLE in VRAM.