GBDK 2020 Docs 4.4.0 API Documentation for GBDK 2020

metasprites.h
Go to the documentation of this file.
1
14 #ifndef _METASPRITES_H_INCLUDE
15 #define _METASPRITES_H_INCLUDE
16
17 #include <msx/hardware.h>
18 #include <types.h>
19 #include <stdint.h>
20
34 typedef struct metasprite_t {
35 int8_t dy, dx;
36 uint8_t dtile;
37 uint8_t props;
38 } metasprite_t;
39
40 #define metasprite_end -128
41 #define METASPR_ITEM(dy,dx,dt,a) {(dy),(dx),(dt),(a)}
42 #define METASPR_TERM {metasprite_end}
43
44 extern const void * __current_metasprite;
45 extern uint8_t __current_base_tile;
46 extern uint8_t __render_shadow_OAM;
47
48
49 static uint8_t __move_metasprite(uint8_t id, uint8_t x, uint8_t y) Z88DK_CALLEE PRESERVES_REGS(iyh, iyl);
50 static void __hide_metasprite(uint8_t id) Z88DK_FASTCALL PRESERVES_REGS(iyh, iyl);
51
57 void hide_sprites_range(uint8_t from, uint8_t to) Z88DK_CALLEE PRESERVES_REGS(iyh, iyl);
58
79 inline uint8_t move_metasprite_ex(const metasprite_t * metasprite, uint8_t base_tile, uint8_t base_prop, uint8_t base_sprite, uint8_t x, uint8_t y) {
80 base_prop;
81 __current_metasprite = metasprite;
82 __current_base_tile = base_tile;
83 return __move_metasprite(base_sprite, x, y);
84 }
85
88 inline uint8_t move_metasprite(const metasprite_t * metasprite, uint8_t base_tile, uint8_t base_sprite, uint8_t x, uint8_t y) {
89 __current_metasprite = metasprite;
90 __current_base_tile = base_tile;
91 return __move_metasprite(base_sprite, x, y);
92 }
93
94
104 inline void hide_metasprite(const metasprite_t * metasprite, uint8_t base_sprite) {
105 __current_metasprite = metasprite;
106 __hide_metasprite(base_sprite);
107 }
108
109 #endif
PRESERVES_REGS
#define PRESERVES_REGS(...)
Definition: types.h:32
Z88DK_CALLEE
#define Z88DK_CALLEE
Definition: types.h:46
Z88DK_FASTCALL
#define Z88DK_FASTCALL
Definition: types.h:47
__current_base_tile
uint8_t __current_base_tile
__render_shadow_OAM
uint8_t __render_shadow_OAM
move_metasprite_ex
uint8_t move_metasprite_ex(const metasprite_t *metasprite, uint8_t base_tile, uint8_t base_prop, uint8_t base_sprite, uint8_t x, uint8_t y)
Definition: metasprites.h:159
move_metasprite
uint8_t move_metasprite(const metasprite_t *metasprite, uint8_t base_tile, uint8_t base_sprite, uint8_t x, uint8_t y)
Definition: metasprites.h:168
hide_sprites_range
void hide_sprites_range(uint8_t from, uint8_t to)
__current_metasprite
const void * __current_metasprite
metasprite_t
struct metasprite_t metasprite_t
hide_metasprite
void hide_metasprite(const metasprite_t *metasprite, uint8_t base_sprite)
Definition: metasprites.h:305
hardware.h
iyl
static uint8_t iyl
Definition: metasprites.h:49
iyh
void iyh
Definition: msx.h:102
stdint.h
uint8_t
unsigned char uint8_t
Definition: stdint.h:51
int8_t
signed char int8_t
Definition: stdint.h:43
metasprite_t
Definition: metasprites.h:102
metasprite_t::dy
int8_t dy
Definition: metasprites.h:103
metasprite_t::dx
int8_t dx
Definition: metasprites.h:103
metasprite_t::props
uint8_t props
Definition: metasprites.h:105
metasprite_t::dtile
uint8_t dtile
Definition: metasprites.h:104