libmsx
C library for MSX
Loading...
Searching...
No Matches
metasprite.h
Go to the documentation of this file.
1// -*- coding: utf-8-unix -*-
2/*
3 * Copyright (c) 2021-2024 Daishi Mori (mori0091)
4 *
5 * This software is released under the MIT License.\n
6 * See https://github.com/mori0091/libmsx/blob/main/LICENSE
7 *
8 * GitHub libmsx project\n
9 * https://github.com/mori0091/libmsx
10 */
17#pragma once
18
19#ifndef METASPRITE_H
20#define METASPRITE_H
21
22#include <stdint.h>
23
24#include "vdp.h"
25#include "vmem.h"
26#include "sprite.h"
27
35typedef struct vec2i {
36 int x;
37 int y;
39
60typedef struct metasprite {
65 uint8_t n;
79 uint8_t* pats;
81
95void vmem_set_metasprite_s(vmemptr_t base, uint8_t plane, int x, int y,
96 const metasprite_t* ms,
97 const tagged_color_t tagged_color);
98
112void vmem_set_metasprite_m(vmemptr_t base, uint8_t plane, int x, int y,
113 const metasprite_t* ms,
114 const tagged_color_t* tagged_colors);
115
148void vmem_set_metasprite_a(vmemptr_t base, uint8_t plane, int x, int y,
149 const metasprite_t* ms);
150
153#endif
uint8_t tagged_color_t
Color code with tags of sprite attribute table.
Definition sprite.h:50
int y
Definition metasprite.h:37
vec2i_t * layouts
n element array of sprite positions, in the metasprite local coordinate system.
Definition metasprite.h:75
vec2i_t anchor
the anchor point of the metasprite, in the metasprite local coordinate system.
Definition metasprite.h:70
int x
Definition metasprite.h:36
uint8_t n
Number of sprites, of that the metasprite consists.
Definition metasprite.h:65
uint8_t * pats
n element array of the sprite pattern numbers.
Definition metasprite.h:79
struct vec2i vec2i_t
void vmem_set_metasprite_s(vmemptr_t base, uint8_t plane, int x, int y, const metasprite_t *ms, const tagged_color_t tagged_color)
MSX Display / Move single colored metasprite.
void vmem_set_metasprite_m(vmemptr_t base, uint8_t plane, int x, int y, const metasprite_t *ms, const tagged_color_t *tagged_colors)
MSX Display / Move multi colored metasprite.
struct metasprite metasprite_t
Meta-sprite ; an aggregate of sprites.
void vmem_set_metasprite_a(vmemptr_t base, uint8_t plane, int x, int y, const metasprite_t *ms)
MSX Display / Move metasprite.
Meta-sprite ; an aggregate of sprites.
Definition metasprite.h:60
uint32_t vmemptr_t
Type for VRAM address.
Definition vmem.h:42
Sprites.
Data types and functions for VDP (Video Display Proccessor) access.
Data types and functions for VRAM access.