52#define SM2_SLICE(a) {.ptr = (a), .len = sizeof(a)/sizeof((a)[0])}
void sm2_update_sprites(sm2_Sprite ss[], size_t num)
MSX2 Update the animation state of a series of sprite objects.
void sm2_update_sprite(sm2_Sprite *s)
MSX2 Update the animation state of sprite object.
void sm2_init_sprite(sm2_Sprite *s, const sm2_SpriteSheet *sheet, const sm2_FrameTag *tag)
MSX2 Construction and (re)initialization of the animated color sprite.
uint8_t direction
Animation direction.
uint8_t curr_direction
Current animation direction; forward/reverse.
uint8_t depth
Number of sprite planes required to display the sprite cel.
size_t repeats
Number of repeats; 0 means inf.
uint32_t addr
Base address of image data (pattern, color table, and layout information).
const sm2_SpriteSheet * sheet
Sprite sheet.
const sm2_FrameTag * tag
Current range of animation frames.
uint8_t to
last frame number.
uint8_t curr_frame
Index of current frame.
size_t repeats
Repeat count; Number of loops finished.
uint8_t from
1st frame number.
size_t remaining_duration
Remaining duration of the current frame.
SM2_Direction
Enumeration of animation direction.
struct sm2_Sprite sm2_Sprite
Sprite - Animation state of a sprite.
struct sm2_Frame sm2_Frame
Frame - The frame of the sprite animation.
struct sm2_SpriteSheet sm2_SpriteSheet
SpriteSheet - Whole animation frames and cels of a sprite sheet.
struct sm2_Cel sm2_Cel
Cel - The image of the sprite animation layer.
struct sm2_FrameTag sm2_FrameTag
FrameTag - Definition of a range of animation frames.
Cel - The image of the sprite animation layer.
Sprite - Animation state of a sprite.
void sm2_add_sprite(const sm2_Sprite *s, int x, int y)
MSX2 Add the cels of the current frame of the sprite object to the internal buffer.
void sm2_reserve(uint8_t n)
MSX2 Reserves some sprite planes for direct access.
void sm2_put_sprite(uint8_t base_plane, const sm2_Sprite *s, int x, int y)
MSX2 Display the cels of the current frame of the sprite object.
uint8_t sm2_get_reserved(void)
MSX2 Returns the number of reserved sprite planes.
void sm2_flush(void)
MSX2 Display the sprite cels registered in the internal buffer.
void sm2_add_cel(const sm2_Cel *cel, int x, int y)
MSX2 Add a sprite cel to the internal buffer.
void sm2_put_cel(uint8_t base_plane, const sm2_Cel *cel, int x, int y)
MSX2 Display the sprite cel.
void sm2_init(void)
MSX2 Initialize SM2 module.
SM2 (Sprite Mode 2) Runtime configuration.
Sprite color table interface.
Frame - The frame of the sprite animation.
sm2_Slice(const uint8_t) cel_ids
List of cel numbers for each layer.
size_t duration
Duration of animation frame in milliseconds.
SpriteSheet - Whole animation frames and cels of a sprite sheet.
sm2_Slice(const sm2_Frame) frames
List of animation frames.
sm2_Slice(const sm2_Cel) cels
List of whole cels.